6 int usb_hub_init(struct usb_pipe *pipe);
9 /****************************************************************
11 ****************************************************************/
13 #define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
15 struct usb_hub_descriptor {
19 u16 wHubCharacteristics;
22 // Variable length fields for DeviceRemovable[], PortPwrCtrlMask[] follow.
25 #define USB_PORT_FEAT_CONNECTION 0
26 #define USB_PORT_FEAT_ENABLE 1
27 #define USB_PORT_FEAT_SUSPEND 2
28 #define USB_PORT_FEAT_OVER_CURRENT 3
29 #define USB_PORT_FEAT_RESET 4
30 #define USB_PORT_FEAT_POWER 8
31 #define USB_PORT_FEAT_LOWSPEED 9
32 #define USB_PORT_FEAT_C_CONNECTION 16
33 #define USB_PORT_FEAT_C_ENABLE 17
34 #define USB_PORT_FEAT_C_SUSPEND 18
35 #define USB_PORT_FEAT_C_OVER_CURRENT 19
36 #define USB_PORT_FEAT_C_RESET 20
37 #define USB_PORT_FEAT_TEST 21
38 #define USB_PORT_FEAT_INDICATOR 22
39 #define USB_PORT_FEAT_C_PORT_L1 23
41 struct usb_port_status {
46 #define USB_PORT_STAT_CONNECTION 0x0001
47 #define USB_PORT_STAT_ENABLE 0x0002
48 #define USB_PORT_STAT_SUSPEND 0x0004
49 #define USB_PORT_STAT_OVERCURRENT 0x0008
50 #define USB_PORT_STAT_RESET 0x0010
51 #define USB_PORT_STAT_L1 0x0020
52 #define USB_PORT_STAT_POWER 0x0100
53 #define USB_PORT_STAT_SPEED_SHIFT 9
54 #define USB_PORT_STAT_SPEED_MASK (0x3 << USB_PORT_STAT_SPEED_SHIFT)
55 #define USB_PORT_STAT_LOW_SPEED 0x0200
56 #define USB_PORT_STAT_HIGH_SPEED 0x0400
57 #define USB_PORT_STAT_TEST 0x0800
58 #define USB_PORT_STAT_INDICATOR 0x1000