Changeset 2aaba7e in mainline for uspace/drv/bus/usb


Ignore:
Timestamp:
2018-01-20T18:23:39Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
21885c92
Parents:
6271a34
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-20 18:21:06)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-20 18:23:39)
Message:

libusbhost: manage (and report) depth of the device

Location:
uspace/drv/bus/usb/xhci
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/device.c

    r6271a34 r2aaba7e  
    178178        /* Calculate route string */
    179179        xhci_device_t *xhci_hub = xhci_device_get(dev->hub);
    180         xhci_dev->tier = xhci_hub->tier + 1;
    181180        xhci_dev->route_str = xhci_hub->route_str;
    182181
    183182        /* Roothub port is not part of the route string */
    184         if (xhci_dev->tier >= 2) {
    185                 const unsigned offset = 4 * (xhci_dev->tier - 2);
     183        if (dev->tier >= 2) {
     184                const unsigned offset = 4 * (dev->tier - 2);
    186185                xhci_dev->route_str |= (dev->port & 0xf) << offset;
    187186                xhci_dev->rh_port = xhci_hub->rh_port;
  • uspace/drv/bus/usb/xhci/device.h

    r6271a34 r2aaba7e  
    4949        uint8_t rh_port;
    5050
    51         /** USB Tier of the device */
    52         uint8_t tier;
    53 
    5451        /** Route string */
    5552        uint32_t route_str;
  • uspace/drv/bus/usb/xhci/rh.c

    r6271a34 r2aaba7e  
    9898        /* Initialize route string */
    9999        rh->device.route_str = 0;
    100         rh->device.tier = 0;
    101100
    102101        return EOK;
     
    157156
    158157        dev->hub = &port->rh->device.base;
     158        dev->tier = 1;
    159159        dev->port = port - port->rh->ports + 1;
    160160
Note: See TracChangeset for help on using the changeset viewer.