Changeset 129b821f in mainline for uspace/drv/bus/usb/usbhub/status.h


Ignore:
Timestamp:
2018-01-20T12:34:50Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
682c9354
Parents:
60d3f35
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-20 12:33:42)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-20 12:34:50)
Message:

usbhub: be aware of its own speed

This resulted in a bunch of changes just because the roothubs in older
HC's are virtual, and need to be aware of their own speed too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/status.h

    r60d3f35 r129b821f  
    9797    (uint32_usb2host(1 << (16 + USB_HUB_FEATURE_C_HUB_LOCAL_POWER)))
    9898
    99 
    100 /**
    101  * speed getter for port status
    102  *
    103  * @param status
    104  * @return speed of usb device (for more see usb specification)
    105  */
    106 static inline usb_speed_t usb_port_speed(usb_port_status_t status)
     99static inline usb_speed_t usb_port_speed(usb_speed_t hub_speed, uint32_t status)
    107100{
     101        if (hub_speed == USB_SPEED_SUPER)
     102                return USB_SPEED_SUPER;
     103        if (hub_speed == USB_SPEED_HIGH && (status & USB_HUB_PORT_STATUS_HIGH_SPEED))
     104                return USB_SPEED_HIGH;
    108105        if ((status & USB_HUB_PORT_STATUS_LOW_SPEED) != 0)
    109106                return USB_SPEED_LOW;
    110         if ((status & USB_HUB_PORT_STATUS_HIGH_SPEED) != 0)
    111                 return USB_SPEED_HIGH;
    112         /* TODO: add super speed */
    113107        return USB_SPEED_FULL;
    114108}
Note: See TracChangeset for help on using the changeset viewer.