Changeset 41e645c in mainline for uspace/drv/uhci-hcd/main.c


Ignore:
Timestamp:
2011-02-20T21:43:50Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
070f11e, ace12560
Parents:
423e8c81 (diff), 063ead6f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Add simple USB multi interface device driver

The MID driver serves as a mini bus driver for devices with several
interfaces or for devices with classes defined at interface level.

The keyboard driver is working with this driver with the same problems
as before introduction of USB MID driver.

The merge also includes addition of bulk transfers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/main.c

    r423e8c81 r41e645c  
    3434#include <driver.h>
    3535#include <usb_iface.h>
     36#include <usb/ddfiface.h>
    3637#include <device/hw_res.h>
    3738
     
    4849
    4950static int uhci_add_device(device_t *device);
    50 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle);
    51 /*----------------------------------------------------------------------------*/
    52 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     51
     52static int usb_iface_get_address(device_t *dev, devman_handle_t handle,
     53    usb_address_t *address)
    5354{
    54         /* This shall be called only for the UHCI itself. */
    55         assert(dev->parent == NULL);
     55        assert(dev);
     56        uhci_t *hc = dev_to_uhci(dev);
     57        assert(hc);
    5658
    57         *handle = dev->handle;
     59        usb_address_t addr = usb_address_keeping_find(&hc->address_manager,
     60            handle);
     61        if (addr < 0) {
     62                return addr;
     63        }
     64
     65        if (address != NULL) {
     66                *address = addr;
     67        }
     68
    5869        return EOK;
    5970}
    60 /*----------------------------------------------------------------------------*/
     71
     72
    6173static usb_iface_t hc_usb_iface = {
    62         .get_hc_handle = usb_iface_get_hc_handle
     74        .get_hc_handle = usb_iface_get_hc_handle_hc_impl,
     75        .get_address = usb_iface_get_address
    6376};
    6477/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.