Changeset 2aaba7e in mainline


Ignore:
Timestamp:
2018-01-20T18:23:39Z (6 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
Files:
7 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
  • uspace/lib/drv/generic/remote_usb.c

    r6271a34 r2aaba7e  
    7777        usb_device_desc_t tmp_desc;
    7878
    79         const int ret = async_req_1_4(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     79        const int ret = async_req_1_5(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    8080            IPC_M_USB_GET_MY_DESCRIPTION,
    8181            (sysarg_t *) &tmp_desc.address,
     82            (sysarg_t *) &tmp_desc.depth,
    8283            (sysarg_t *) &tmp_desc.speed,
    8384            &tmp_desc.handle,
     
    117118                async_answer_0(callid, ret);
    118119        } else {
    119                 async_answer_4(callid, EOK,
     120                async_answer_5(callid, EOK,
    120121                    (sysarg_t) desc.address,
     122                    (sysarg_t) desc.depth,
    121123                    (sysarg_t) desc.speed,
    122124                    desc.handle,
  • uspace/lib/drv/include/usb_iface.h

    r6271a34 r2aaba7e  
    4545
    4646typedef struct {
    47         usb_address_t address;
    48         usb_speed_t speed;
    49         devman_handle_t handle;
    50         int iface;
     47        usb_address_t address;          /** Current USB address */
     48        uint8_t depth;                  /** Depth in the hub hiearchy */
     49        usb_speed_t speed;              /** Speed of the device */
     50        devman_handle_t handle;         /** Handle to DDF function of the HC driver */
     51        int iface;                      /** Interface set by multi interface driver, -1 if none */
    5152} usb_device_desc_t;
    5253
  • uspace/lib/usbhost/include/usb/host/bus.h

    r6271a34 r2aaba7e  
    6868        /* Invalid for the roothub device */
    6969        unsigned port;
     70
     71        /** Hub under which this device is connected */
    7072        struct device *hub;
     73
     74        /** USB Tier of the device */
     75        uint8_t tier;
    7176
    7277        /* Transaction translator */
  • uspace/lib/usbhost/src/ddf_helpers.c

    r6271a34 r2aaba7e  
    164164
    165165        dev->hub = hub;
     166        dev->tier = hub->tier + 1;
    166167        dev->port = port;
    167168        dev->speed = speed;
     
    242243        *desc = (usb_device_desc_t) {
    243244                .address = dev->address,
     245                .depth = dev->tier,
    244246                .speed = dev->speed,
    245247                .handle = ddf_fun_get_handle(fun),
Note: See TracChangeset for help on using the changeset viewer.