1 #ifndef DEVICES_USB_HUB_H
2 #define DEVICES_USB_HUB_H
4 ** $VER: usb_hub.h 3.0 (31.05.09)
6 ** usb definitions include file
8 ** (C) Copyright 2002-2009 Chris Hodges
12 #include <exec/types.h>
18 /* Usb Hub Requests */
19 #define UHR_GET_STATE 0x02 /* URTF_OTHER for port and URTF_DEVICE for Hub itself */
20 #define UHR_CLEAR_TT_BUFFER 0x08
21 #define UHR_RESET_TT_BUFFER 0x09
22 #define UHR_GET_TT_STATE 0x0a
23 #define UHR_STOP_TT 0x0b
25 /* Usb Hub Feature Selectors */
26 #define UFS_C_HUB_LOCAL_POWER 0x00
27 #define UFS_C_HUB_OVER_CURRENT 0x01
28 #define UFS_PORT_CONNECTION 0x00
29 #define UFS_PORT_ENABLE 0x01
30 #define UFS_PORT_SUSPEND 0x02
31 #define UFS_PORT_OVER_CURRENT 0x03
32 #define UFS_PORT_RESET 0x04
33 #define UFS_PORT_POWER 0x08
34 #define UFS_PORT_LOW_SPEED 0x09
35 #define UFS_C_PORT_CONNECTION 0x10
36 #define UFS_C_PORT_ENABLE 0x11
37 #define UFS_C_PORT_SUSPEND 0x12
38 #define UFS_C_PORT_OVER_CURRENT 0x13
39 #define UFS_C_PORT_RESET 0x14
40 #define UFS_PORT_TEST 0x15
41 #define UFS_PORT_INDICATOR 0x16
43 /* HUB class specific descriptors */
45 #define UDT_SSHUB 0x2a /* SuperSpeed hub descriptor */
47 /* Usb Class Specific Descriptor: Hub Descriptor */
50 UBYTE bLength
; /* Number of bytes in this descriptor, including this byte */
51 UBYTE bDescriptorType
; /* Descriptor Type, value: 29H for hub descriptor */
52 UBYTE bNbrPorts
; /* Number of downstream ports that this hub supports */
53 UWORD wHubCharacteristics
; /* Hub flags */
54 UBYTE bPwrOn2PwrGood
; /* Time (in 2ms intervals) for power-good on port */
55 UBYTE bHubContrCurrent
; /* Maximum current requirements of the Hub Controller in mA. */
56 UBYTE DeviceRemovable
; /* Variable Size! Indicates if a port has a removable (0) device attached, Bit n<-> Port n */
57 UBYTE PortPwrCtrlMask
; /* Variable Size! Obsolete (USB1.0) */
60 /* Usb Class Specific Descriptor: SuperSpeed Hub Descriptor */
63 UBYTE bLength
; /* Number of bytes in this descriptor, including this byte */
64 UBYTE bDescriptorType
; /* Descriptor Type, value: 2AH for SuperSpeed hub descriptor */
65 UBYTE bNbrPorts
; /* Number of downstream ports that this hub supports */
66 UWORD wHubCharacteristics
; /* Hub flags */
67 UBYTE bPwrOn2PwrGood
; /* Time (in 2ms intervals) for power-good on port */
68 UBYTE bHubContrCurrent
; /* */
69 UBYTE bHubHdrDecLat
; /* Hub Packet Header Decode Latency */
70 UWORD wHubDelay
; /* */
71 UWORD DeviceRemovable
; /* Indicates if a port has a removable device attached */
74 /* Flags for wHubCharacteristics */
75 #define UHCF_INDIVID_POWER 0x0001 /* Individual port power switching */
76 #define UHCF_IS_COMPOUND 0x0004 /* Hub is part of a compound device */
77 #define UHCF_INDIVID_OVP 0x0008 /* Individual port over-current status */
78 #define UHCF_NO_OVP 0x0010 /* No over-current protection */
79 #define UHCF_PORT_INDICATORS 0x0080 /* Port indicators are supported */
81 #define UHCS_THINK_TIME 13
82 #define UHCF_THINK_TIME_8 0x0000 /* TT Think Time 8 FS bit times */
83 #define UHCF_THINK_TIME_16 0x2000 /* TT Think Time 16 FS bit times */
84 #define UHCF_THINK_TIME_24 0x4000 /* TT Think Time 24 FS bit times */
85 #define UHCF_THINK_TIME_32 0x6000 /* TT Think Time 32 FS bit times */
86 #define UHCM_THINK_TIME 0x6000
88 /* Structure returned by GetHubStatus() */
92 UWORD wHubStatus
; /* Current status of hub (see below) */
93 UWORD wHubChange
; /* Changes of status */
96 /* Flags for wHubStatus and wHubChange */
97 #define UHSF_LOCAL_POWER_LOST 0x0001
98 #define UHSF_OVER_CURRENT 0x0002
100 /* Structure returned by GetPortStatus() */
103 UWORD wPortStatus
; /* Current status of port (see below) */
104 UWORD wPortChange
; /* Changes of status */
107 /* Flags for wPortStatus and wPortChange */
108 #define UPSF_PORT_CONNECTION 0x0001
109 #define UPSF_PORT_ENABLE 0x0002
110 #define UPSF_PORT_SUSPEND 0x0004
111 #define UPSF_PORT_OVER_CURRENT 0x0008
112 #define UPSF_PORT_RESET 0x0010
113 #define UPSF_PORT_POWER 0x0100
114 #define UPSF_PORT_LOW_SPEED 0x0200
115 #define UPSF_PORT_HIGH_SPEED 0x0400 /* USB 2.0 */
116 #define UPSF_PORT_TEST_MODE 0x0800 /* USB 2.0 */
117 #define UPSF_PORT_INDICATOR 0x1000 /* USB 2.0 */
119 #if defined(__GNUC__)
123 #endif /* DEVICES_USB_HUB_H */