16 int usb_hub_init(struct usb_pipe *pipe);
19 /****************************************************************
21 ****************************************************************/
23 #define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
25 struct usb_hub_descriptor {
29 u16 wHubCharacteristics;
32 // Variable length fields for DeviceRemovable[], PortPwrCtrlMask[] follow.
35 #define USB_PORT_FEAT_CONNECTION 0
36 #define USB_PORT_FEAT_ENABLE 1
37 #define USB_PORT_FEAT_SUSPEND 2
38 #define USB_PORT_FEAT_OVER_CURRENT 3
39 #define USB_PORT_FEAT_RESET 4
40 #define USB_PORT_FEAT_POWER 8
41 #define USB_PORT_FEAT_LOWSPEED 9
42 #define USB_PORT_FEAT_C_CONNECTION 16
43 #define USB_PORT_FEAT_C_ENABLE 17
44 #define USB_PORT_FEAT_C_SUSPEND 18
45 #define USB_PORT_FEAT_C_OVER_CURRENT 19
46 #define USB_PORT_FEAT_C_RESET 20
47 #define USB_PORT_FEAT_TEST 21
48 #define USB_PORT_FEAT_INDICATOR 22
49 #define USB_PORT_FEAT_C_PORT_L1 23
51 struct usb_port_status {
56 #define USB_PORT_STAT_CONNECTION 0x0001
57 #define USB_PORT_STAT_ENABLE 0x0002
58 #define USB_PORT_STAT_SUSPEND 0x0004
59 #define USB_PORT_STAT_OVERCURRENT 0x0008
60 #define USB_PORT_STAT_RESET 0x0010
61 #define USB_PORT_STAT_L1 0x0020
62 #define USB_PORT_STAT_POWER 0x0100
63 #define USB_PORT_STAT_SPEED_SHIFT 9
64 #define USB_PORT_STAT_SPEED_MASK (0x3 << USB_PORT_STAT_SPEED_SHIFT)
65 #define USB_PORT_STAT_LOW_SPEED 0x0200
66 #define USB_PORT_STAT_HIGH_SPEED 0x0400
67 #define USB_PORT_STAT_TEST 0x0800
68 #define USB_PORT_STAT_INDICATOR 0x1000