Changeset 357a302 in mainline for uspace/drv/uhci-hcd/main.c


Ignore:
Timestamp:
2011-02-20T14:17:40Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b68b279
Parents:
3ae93a8
Message:

USB interfaces reorganization

The most important change is that getting USB address of a device
is an operation of generic USB interface, not USB-HC interface.
That is needed for proper functionality of a MID driver.

Also added sample implementation of USB interface operations as is
needed by most drivers (sample does not mean unfunctional or partially
implemented here).
They are stored in libusb/ddfiface.h

Updated UHCI, UHCI-RH, hub, VHC drivers to use these sample
implementations.

Updated libusb device recognition routines to route get_address requests
through USB interface.

File:
1 edited

Legend:

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

    r3ae93a8 r357a302  
    5555}
    5656
     57static int usb_iface_get_address(device_t *dev, devman_handle_t handle,
     58    usb_address_t *address)
     59{
     60        assert(dev);
     61        uhci_t *hc = dev_to_uhci(dev);
     62        assert(hc);
     63
     64        usb_address_t addr = usb_address_keeping_find(&hc->address_manager,
     65            handle);
     66        if (addr < 0) {
     67                return addr;
     68        }
     69
     70        if (address != NULL) {
     71                *address = addr;
     72        }
     73
     74        return EOK;
     75}
     76
    5777static usb_iface_t hc_usb_iface = {
    58         .get_hc_handle = usb_iface_get_hc_handle
     78        .get_hc_handle = usb_iface_get_hc_handle,
     79        .get_address = usb_iface_get_address
    5980};
    6081
Note: See TracChangeset for help on using the changeset viewer.