Changeset ff14aede in mainline for uspace/lib/usbhost/src/hcd.c


Ignore:
Timestamp:
2017-11-20T12:24:05Z (6 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
888238e9
Parents:
306a36d
Message:

usbhost: move TT management to library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/hcd.c

    r306a36d rff14aede  
    107107}
    108108
     109/**
     110 * Setup devices Transaction Translation.
     111 *
     112 * This applies for Low/Full speed devices under High speed hub only. Other
     113 * devices just inherit TT from the hub.
     114 *
     115 * Roothub must be handled specially.
     116 */
     117void hcd_setup_device_tt(device_t *dev)
     118{
     119        if (!dev->hub)
     120                return;
     121
     122        if (dev->hub->speed == USB_SPEED_HIGH && usb_speed_is_11(dev->speed)) {
     123                /* For LS devices under HS hub */
     124                dev->tt.address = dev->hub->address;
     125                dev->tt.port = dev->port;
     126        }
     127        else {
     128                /* Inherit hub's TT */
     129                dev->tt = dev->hub->tt;
     130        }
     131}
    109132
    110133/** Prepare generic usb_transfer_batch and schedule it.
Note: See TracChangeset for help on using the changeset viewer.