33#define ED_URB_DEL 0x08
46#define TD_CC 0xF0000000
47#define TD_CC_GET(td_p) ((td_p >>28) & 0x0F)
48#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0FFFFFFF) | (((cc) & 0x0F) << 28)
49#define TD_EC 0x0C000000
50#define TD_T_DATA0 0x02000000
51#define TD_T_DATA1 0x03000000
52#define TD_T_TOGGLE 0x00000000
53#define TD_R 0x00040000
54#define TD_DI 0x00E00000
55#define TD_DI_SET(X) (((X) & 0x07)<< 21)
56#define TD_DP 0x00180000
57#define TD_DP_SETUP 0x00000000
58#define TD_DP_IN 0x00100000
59#define TD_DP_OUT 0x00080000
61#define TD_ISO 0x00010000
62#define TD_DEL 0x00020000
83typedef struct ohci_hcca
85 uint32_t int_table[NUM_INTS];
94 uint8_t reserved_for_hc[116];
102#define OHCI_USB_RESET (0 << 6)
103#define OHCI_USB_RESUME (1 << 6)
104#define OHCI_USB_OPER (2 << 6)
105#define OHCI_USB_SUSPEND (3 << 6)
110#define OHCI_HCR (1 << 0)
111#define OHCI_CLF (1 << 1)
112#define OHCI_BLF (1 << 2)
113#define OHCI_OCR (1 << 3)
114#define OHCI_SOC (3 << 16)
116#define OHCI_INTR_MIE 0x80000000
122#define USB_DIR_IN 0x80
127#define USB_DT_DEVICE 0x01
128#define USB_DT_CONFIG 0x02
129#define USB_DT_STRING 0x03
130#define USB_DT_INTERFACE 0x04
131#define USB_DT_ENDPOINT 0x05
136#define USB_REQ_GET_STATUS 0x00
137#define USB_REQ_CLEAR_FEATURE 0x01
138#define USB_REQ_SET_FEATURE 0x03
139#define USB_REQ_SET_ADDRESS 0x05
140#define USB_REQ_GET_DESCRIPTOR 0x06
141#define USB_REQ_SET_CONFIGURATION 0x09
142#define USB_REQ_SET_INTERFACE 0x0B
147 __packed uint8_t requesttype;
148 __packed uint8_t request;
149 __packed uint16_t
value;
150 __packed uint16_t index;
151 __packed uint16_t length;
170typedef struct usb_device_descriptor
172 __packed uint8_t bLength;
173 __packed uint8_t bDescriptorType;
174 __packed uint16_t bcdUSB;
175 __packed uint8_t bDeviceClass;
176 __packed uint8_t bDeviceSubClass;
177 __packed uint8_t bDeviceProtocol;
178 __packed uint8_t bMaxPacketSize0;
179 __packed uint16_t idVendor;
180 __packed uint16_t idProduct;
181 __packed uint16_t bcdDevice;
182 __packed uint8_t iManufacturer;
183 __packed uint8_t iProduct;
184 __packed uint8_t iSerialNumber;
185 __packed uint8_t bNumConfigurations;
188typedef struct __attribute__((__packed__)) usb_device_descriptor
191 uint8_t bDescriptorType;
193 uint8_t bDeviceClass;
194 uint8_t bDeviceSubClass;
195 uint8_t bDeviceProtocol;
196 uint8_t bMaxPacketSize0;
200 uint8_t iManufacturer;
202 uint8_t iSerialNumber;
203 uint8_t bNumConfigurations;
211typedef struct usb_config_descriptor
213 __packed uint8_t bLength;
214 __packed uint8_t bDescriptorType;
215 __packed uint16_t wTotalLength;
216 __packed uint8_t bNumInterfaces;
217 __packed uint8_t bConfigurationValue;
218 __packed uint8_t iConfiguration;
219 __packed uint8_t bmAttributes;
220 __packed uint8_t MaxPower;
223typedef struct __attribute__((__packed__)) usb_config_descriptor
226 uint8_t bDescriptorType;
227 uint16_t wTotalLength;
228 uint8_t bNumInterfaces;
229 uint8_t bConfigurationValue;
230 uint8_t iConfiguration;
231 uint8_t bmAttributes;
240typedef struct usb_interface_descriptor
242 __packed uint8_t bLength;
243 __packed uint8_t bDescriptorType;
244 __packed uint8_t bInterfaceNumber;
245 __packed uint8_t bAlternateSetting;
246 __packed uint8_t bNumEndpoints;
247 __packed uint8_t bInterfaceClass;
248 __packed uint8_t bInterfaceSubClass;
249 __packed uint8_t bInterfaceProtocol;
250 __packed uint8_t iInterface;
253typedef struct __attribute__((__packed__)) usb_interface_descriptor
256 uint8_t bDescriptorType;
257 uint8_t bInterfaceNumber;
258 uint8_t bAlternateSetting;
259 uint8_t bNumEndpoints;
260 uint8_t bInterfaceClass;
261 uint8_t bInterfaceSubClass;
262 uint8_t bInterfaceProtocol;
272typedef struct usb_endpoint_descriptor
274 __packed uint8_t bLength;
275 __packed uint8_t bDescriptorType;
276 __packed uint8_t bEndpointAddress;
277 __packed uint8_t bmAttributes;
278 __packed uint16_t wMaxPacketSize;
279 __packed uint8_t bInterval;
280 __packed uint8_t bRefresh;
281 __packed uint8_t bSynchAddress;
284typedef struct __attribute__((__packed__)) usb_endpoint_descriptor
287 uint8_t bDescriptorType;
288 uint8_t bEndpointAddress;
289 uint8_t bmAttributes;
290 uint16_t wMaxPacketSize;
293 uint8_t bSynchAddress;
298#define MINISEC_1 84000
299#define MINISEC_10 840000
300#define MINISEC_100 8400000
void *__dso_handle __attribute__((weak))