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


Ignore:
Timestamp:
2018-02-28T16:37:50Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b20da0
Parents:
f5e5f73 (diff), b2dca8de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
git-committer:
Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
Message:

Merge github.com:helenos-xhci-team/helenos

This commit merges support for USB 3 and generally refactors, fixes,
extends and cleans up the existing USB framework.

Notable additions and features:

  • new host controller driver has been implemented to control various xHC models (among others, NEC Renesas uPD720200)
  • isochronous data transfer mode
  • support for explicit USB device removal
  • USB tablet driver
File:
1 edited

Legend:

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

    rf5e5f73 rdf6ded8  
    3838
    3939/**
    40  * structure holding port status and changes flags.
    41  * should not be accessed directly, use supplied getter/setter methods.
    42  *
    43  * For more information refer to tables 11-15 and 11-16 in
    44  * "Universal Serial Bus Specification Revision 1.1" pages 274 and 277
    45  * (290 and 293 in pdf)
    46  *
    47  */
    48 typedef uint32_t usb_port_status_t;
    49 #define USB_HUB_PORT_STATUS_CONNECTION \
    50     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_CONNECTION)))
    51 #define USB_HUB_PORT_STATUS_ENABLED \
    52     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_ENABLE)))
    53 #define USB_HUB_PORT_STATUS_SUSPEND \
    54     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_SUSPEND)))
    55 #define USB_HUB_PORT_STATUS_OC \
    56     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_OVER_CURRENT)))
    57 #define USB_HUB_PORT_STATUS_RESET \
    58     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_RESET)))
    59 #define USB_HUB_PORT_STATUS_POWER \
    60     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_POWER)))
    61 #define USB_HUB_PORT_STATUS_LOW_SPEED \
    62     (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_LOW_SPEED)))
    63 #define USB_HUB_PORT_STATUS_HIGH_SPEED \
    64     (uint32_usb2host(1 << 10))
    65 #define USB_HUB_PORT_STATUS_TEST_MODE \
    66     (uint32_usb2host(1 << 11))
    67 #define USB_HUB_PORT_INDICATOR_CONTROL \
    68     (uint32_usb2host(1 << 12))
    69 
    70 #define USB_HUB_PORT_C_STATUS_CONNECTION \
    71     (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_CONNECTION)))
    72 #define USB_HUB_PORT_C_STATUS_ENABLED \
    73     (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_ENABLE)))
    74 #define USB_HUB_PORT_C_STATUS_SUSPEND \
    75     (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_SUSPEND)))
    76 #define USB_HUB_PORT_C_STATUS_OC \
    77     (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_OVER_CURRENT)))
    78 #define USB_HUB_PORT_C_STATUS_RESET \
    79     (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_RESET)))
    80 
    81 /**
    8240 * structure holding hub status and changes flags.
    8341 *
     
    9755    (uint32_usb2host(1 << (16 + USB_HUB_FEATURE_C_HUB_LOCAL_POWER)))
    9856
    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)
     57static inline usb_speed_t usb_port_speed(usb_speed_t hub_speed, uint32_t status)
    10758{
    108         if ((status & USB_HUB_PORT_STATUS_LOW_SPEED) != 0)
     59        if (hub_speed == USB_SPEED_SUPER)
     60                return USB_SPEED_SUPER;
     61        if (hub_speed == USB_SPEED_HIGH
     62            && (status & USB2_HUB_PORT_STATUS_HIGH_SPEED))
     63                return USB_SPEED_HIGH;
     64        if ((status & USB2_HUB_PORT_STATUS_LOW_SPEED) != 0)
    10965                return USB_SPEED_LOW;
    110         if ((status & USB_HUB_PORT_STATUS_HIGH_SPEED) != 0)
    111                 return USB_SPEED_HIGH;
    11266        return USB_SPEED_FULL;
    11367}
Note: See TracChangeset for help on using the changeset viewer.