6 int usb_hub_setup(struct usbdevice_s *usbdev);
9 /****************************************************************
11 ****************************************************************/
13 #define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
14 #define USB_DT_HUB3 (USB_TYPE_CLASS | 0x0a)
16 #define HUB_REQ_SET_HUB_DEPTH 0x0C
18 struct usb_hub_descriptor {
22 u16 wHubCharacteristics;
25 // Variable length fields for DeviceRemovable[], PortPwrCtrlMask[] follow.
28 #define USB_PORT_FEAT_CONNECTION 0
29 #define USB_PORT_FEAT_ENABLE 1
30 #define USB_PORT_FEAT_SUSPEND 2
31 #define USB_PORT_FEAT_OVER_CURRENT 3
32 #define USB_PORT_FEAT_RESET 4
33 #define USB_PORT_FEAT_POWER 8
34 #define USB_PORT_FEAT_LOWSPEED 9
35 #define USB_PORT_FEAT_C_CONNECTION 16
36 #define USB_PORT_FEAT_C_ENABLE 17
37 #define USB_PORT_FEAT_C_SUSPEND 18
38 #define USB_PORT_FEAT_C_OVER_CURRENT 19
39 #define USB_PORT_FEAT_C_RESET 20
40 #define USB_PORT_FEAT_TEST 21
41 #define USB_PORT_FEAT_INDICATOR 22
42 #define USB_PORT_FEAT_C_PORT_L1 23
44 struct usb_port_status {
49 #define USB_PORT_STAT_CONNECTION 0x0001
50 #define USB_PORT_STAT_ENABLE 0x0002
51 #define USB_PORT_STAT_SUSPEND 0x0004
52 #define USB_PORT_STAT_OVERCURRENT 0x0008
53 #define USB_PORT_STAT_RESET 0x0010
54 #define USB_PORT_STAT_LINK_SHIFT 5
55 #define USB_PORT_STAT_LINK_MASK (0x7 << USB_PORT_STAT_LINK_SHIFT)
56 #define USB_PORT_STAT_POWER 0x0100
57 #define USB_PORT_STAT_SPEED_SHIFT 9
58 #define USB_PORT_STAT_SPEED_MASK (0x3 << USB_PORT_STAT_SPEED_SHIFT)
59 #define USB_PORT_STAT_LOW_SPEED 0x0200
60 #define USB_PORT_STAT_HIGH_SPEED 0x0400
61 #define USB_PORT_STAT_TEST 0x0800
62 #define USB_PORT_STAT_INDICATOR 0x1000