Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 603a0a4 in mainline


Ignore:
Timestamp:
2013-02-08T20:33:12Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
c5f4e6a
Parents:
2a5a7711
Message:

libsub, classes/hub: Salvage comments and remove dead code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/classes/hub.h

    r2a5a7711 r603a0a4  
    6767        /** Descriptor length. */
    6868        uint8_t length;
     69
    6970        /** Descriptor type (0x29). */
    7071        uint8_t descriptor_type;
     72
    7173        /** Number of downstream ports. */
    7274        uint8_t port_count;
    73         /** Characteristics bitmask. */
     75
     76        /** Characteristics bitmask.
     77         *
     78         *  D1...D0: Logical Power Switching Mode
     79         *  00: Ganged power switching (all ports power at
     80         *  once)
     81         *  01: Individual port power switching
     82         *  1X: Reserved. Used only on 1.0 compliant hubs
     83         *  that implement no power switching.
     84         *  D2: Identifies a Compound Device
     85         *  0: Hub is not part of a compound device
     86         *  1: Hub is part of a compound device
     87         *  D4...D3: Over-current Protection Mode
     88         *  00: Global Over-current Protection. The hub
     89         *  reports over-current as a summation of all
     90         *  ports current draw, without a breakdown of
     91         *  individual port over-current status.
     92         *  01: Individual Port Over-current Protection. The
     93         *  hub reports over-current on a per-port basis.
     94         *  Each port has an over-current indicator.
     95         *  1X: No Over-current Protection. This option is
     96         *  allowed only for bus-powered hubs that do not
     97         *  implement over-current protection.
     98         *  D15...D5: Reserved
     99         */
    74100        uint8_t characteristics;
    75101#define HUB_CHAR_POWER_PER_PORT_FLAG    (1 << 0)
     
    78104#define HUB_CHAR_OC_PER_PORT_FLAG       (1 << 3)
    79105#define HUB_CHAR_NO_OC_FLAG             (1 << 4)
    80         /* Unused part of characteristics field */
     106
     107        /** Unused part of characteristics field */
    81108        uint8_t characteristics_reserved;
    82         /** Time from power-on to stabilization of current on the port. */
     109
     110        /** Time from power-on to stabilization of current on the port.
     111         *
     112         *  Time (in 2ms intervals) from the time the power-on
     113         *  sequence begins on a port until power is good on that
     114         *  port. The USB System Software uses this value to
     115         *  determine how long to wait before accessing a
     116         *  powered-on port.
     117         */
    83118        uint8_t power_good_time;
    84         /** Maximum current requirements in mA. */
     119        /** Maximum current requirements in mA.
     120         *
     121         *  Maximum current requirements of the Hub Controller
     122         *  electronics in mA.
     123         */
    85124        uint8_t max_current;
    86125} __attribute__ ((packed)) usb_hub_descriptor_header_t;
    87126
    88 
    89 #if 0
    90 /**
    91  * @brief usb hub descriptor
    92  *
    93  * For more information see Universal Serial Bus Specification Revision 1.1
    94  * chapter 11.16.2
    95  */
    96 typedef struct usb_hub_descriptor_type {
    97     /** Number of bytes in this descriptor, including this byte */
    98     //uint8_t bDescLength;
    99 
    100     /** Descriptor Type, value: 29H for hub descriptor */
    101     //uint8_t bDescriptorType;
    102 
    103     /** Number of downstream ports that this hub supports */
    104     uint8_t port_count;
    105 
    106     /**
    107             D1...D0: Logical Power Switching Mode
    108             00: Ganged power switching (all ports power at
    109             once)
    110             01: Individual port power switching
    111             1X: Reserved. Used only on 1.0 compliant hubs
    112             that implement no power switching.
    113             D2: Identifies a Compound Device
    114             0: Hub is not part of a compound device
    115             1: Hub is part of a compound device
    116             D4...D3: Over-current Protection Mode
    117             00: Global Over-current Protection. The hub
    118             reports over-current as a summation of all
    119             ports current draw, without a breakdown of
    120             individual port over-current status.
    121             01: Individual Port Over-current Protection. The
    122             hub reports over-current on a per-port basis.
    123             Each port has an over-current indicator.
    124             1X: No Over-current Protection. This option is
    125             allowed only for bus-powered hubs that do not
    126             implement over-current protection.
    127             D15...D5:
    128             Reserved
    129      */
    130     uint16_t hub_characteristics;
    131 
    132     /**
    133             Time (in 2ms intervals) from the time the power-on
    134             sequence begins on a port until power is good on that
    135             port. The USB System Software uses this value to
    136             determine how long to wait before accessing a
    137             powered-on port.
    138      */
    139     uint8_t pwr_on_2_good_time;
    140 
    141     /**
    142             Maximum current requirements of the Hub Controller
    143             electronics in mA.
    144      */
    145     uint8_t current_requirement;
    146 
    147     /**
    148             Indicates if a port has a removable device attached.
    149             This field is reported on byte-granularity. Within a
    150             byte, if no port exists for a given location, the field
    151             representing the port characteristics returns 0.
    152             Bit value definition:
    153             0B - Device is removable
    154             1B - Device is non-removable
    155             This is a bitmap corresponding to the individual ports
    156             on the hub:
    157             Bit 0: Reserved for future use
    158             Bit 1: Port 1
    159             Bit 2: Port 2
    160             ....
    161             Bit n: Port n (implementation-dependent, up to a
    162             maximum of 255 ports).
    163      */
    164     uint8_t devices_removable[32];
    165 
    166     /**
    167             This field exists for reasons of compatibility with
    168             software written for 1.0 compliant devices. All bits in
    169             this field should be set to 1B. This field has one bit for
    170             each port on the hub with additional pad bits, if
    171             necessary, to make the number of bits in the field an
    172             integer multiple of 8.
    173      */
    174     //uint8_t * port_pwr_ctrl_mask;
    175 } usb_hub_descriptor_t;
    176 #endif
    177 
     127/** One bit for the device and one bit for every port */
     128#define STATUS_BYTES(ports) ((1 + ports + 7) / 8)
    178129
    179130/**     @brief usb hub specific request types.
Note: See TracChangeset for help on using the changeset viewer.