4 #include <linux/list.h>
9 #define C_HUB_LOCAL_POWER 0
10 #define C_HUB_OVER_CURRENT 1
13 * Port feature numbers
15 #define USB_PORT_FEAT_CONNECTION 0
16 #define USB_PORT_FEAT_ENABLE 1
17 #define USB_PORT_FEAT_SUSPEND 2
18 #define USB_PORT_FEAT_OVER_CURRENT 3
19 #define USB_PORT_FEAT_RESET 4
20 #define USB_PORT_FEAT_POWER 8
21 #define USB_PORT_FEAT_LOWSPEED 9
22 #define USB_PORT_FEAT_C_CONNECTION 16
23 #define USB_PORT_FEAT_C_ENABLE 17
24 #define USB_PORT_FEAT_C_SUSPEND 18
25 #define USB_PORT_FEAT_C_OVER_CURRENT 19
26 #define USB_PORT_FEAT_C_RESET 20
29 #define USB_PORT_STAT_CONNECTION 0x0001
30 #define USB_PORT_STAT_ENABLE 0x0002
31 #define USB_PORT_STAT_SUSPEND 0x0004
32 #define USB_PORT_STAT_OVERCURRENT 0x0008
33 #define USB_PORT_STAT_RESET 0x0010
34 #define USB_PORT_STAT_POWER 0x0100
35 #define USB_PORT_STAT_LOW_SPEED 0x0200
38 #define USB_PORT_STAT_C_CONNECTION 0x0001
39 #define USB_PORT_STAT_C_ENABLE 0x0002
40 #define USB_PORT_STAT_C_SUSPEND 0x0004
41 #define USB_PORT_STAT_C_OVERCURRENT 0x0008
42 #define USB_PORT_STAT_C_RESET 0x0010
44 /* wHubCharacteristics (masks) */
45 #define HUB_CHAR_LPSM 0x0003
46 #define HUB_CHAR_COMPOUND 0x0004
47 #define HUB_CHAR_OCPM 0x0018
52 USB_PORT_UNPOWERED
= 0, /* Default state */
53 USB_PORT_POWERED
, /* When we've put power to it */
54 USB_PORT_ENABLED
, /* When it's been enabled */
55 USB_PORT_DISABLED
, /* If it's been disabled */
56 USB_PORT_ADMINDISABLED
, /* Forced down */
60 usb_hub_port_state cstate
; /* Configuration state */
62 struct usb_device
*child
; /* Device attached to this port */
64 struct usb_hub
*parent
; /* Parent hub */
68 /* Device structure */
69 struct usb_device
*dev
;
71 /* Reference to the hub's polling IRQ */
75 struct list_head hub_list
;
77 /* Temporary event list */
78 struct list_head event_list
;
80 /* Number of ports on the hub */
83 struct usb_hub_port ports
[0]; /* Dynamically allocated */