9 #define USB_MAXPATH IPC_MAXPATH_LEN 14 #define USB_CLASS_HID 0x03 15 #define USB_SUBCLASS_BOOT 0x01 16 #define USB_PROTOCOL_KEYBOARD 0x01 17 #define USB_PROTOCOL_MOUSE 0x02 19 #define USB_REPTYPE_INPUT 0x01 20 #define USB_REPTYPE_OUTPUT 0x02 21 #define USB_REPTYPE_FEATURE 0x03 24 #define USB_DT_DEVICE 0x01 25 #define USB_DT_CONFIG 0x02 26 #define USB_DT_STRING 0x03 27 #define USB_DT_INTERFACE 0x04 28 #define USB_DT_ENDPOINT 0x05 29 #define USB_DT_DEVICE_QUALIFIER 0x06 30 #define USB_DT_OTHER_SPEED_CONFIG 0x07 31 #define USB_DT_INTERFACE_POWER 0x08 32 #define USB_DT_OTG 0x09 33 #define USB_DT_DEBUG 0x10 34 #define USB_DT_INTERFACE_ASSOCIATION 0x11 35 #define USB_DT_HID 0x21 36 #define USB_DT_REPORT 0x22 37 #define USB_DT_PHYSICAL 0x23 38 #define USB_DT_CLASS_SPECIFIC_INTERFACE 0x24 39 #define USB_DT_CLASS_SPECIFIC_ENDPOINT 0x25 40 #define USB_DT_HUB 0x29 43 #define USB_REQ_GETSTATUS 0x00 44 #define USB_REQ_CLEARFEATURE 0x01 45 #define USB_REQ_SETFEATURE 0x03 46 #define USB_REQ_SETADDRESS 0x05 47 #define USB_REQ_GETDESCRIPTOR 0x06 48 #define USB_REQ_SETDESCRIPTOR 0x07 49 #define USB_REQ_GETCONFIG 0x08 50 #define USB_REQ_SETCONFIG 0x09 51 #define USB_REQ_GETINTERFACE 0x0A 52 #define USB_REQ_SETINTERFACE 0x0B 53 #define USB_REQ_SYNCFRAME 0x0C 55 #define USB_REQ_GETREPORT 0x01 56 #define USB_REQ_GETIDLE 0x02 57 #define USB_REQ_GETPROTOCOL 0x03 58 #define USB_REQ_SETREPORT 0x09 59 #define USB_REQ_SETIDLE 0x0A 60 #define USB_REQ_SETPROTOCOL 0x0B 63 #define USB_DT_DEVICE_SIZE 18 64 #define USB_DT_CONFIG_SIZE 9 65 #define USB_DT_INTERFACE_SIZE 9 66 #define USB_DT_ENDPOINT_SIZE 7 67 #define USB_DT_ENDPOINT_AUDIO_SIZE 9 68 #define USB_DT_HID_SIZE 9 69 #define USB_DT_HUB_NONVAR_SIZE 7 72 #define USB_CTRLTYPE_DIR_HOST2DEVICE (0<<7) 73 #define USB_CTRLTYPE_DIR_DEVICE2HOST (1<<7) 74 #define USB_CTRLTYPE_TYPE_STANDARD (0<<5) 75 #define USB_CTRLTYPE_TYPE_CLASS (1<<5) 76 #define USB_CTRLTYPE_TYPE_VENDOR (2<<5) 77 #define USB_CTRLTYPE_TYPE_RESERVED (3<<5) 78 #define USB_CTRLTYPE_REC_DEVICE 0 79 #define USB_CTRLTYPE_REC_INTERFACE 1 80 #define USB_CTRLTYPE_REC_ENDPOINT 2 81 #define USB_CTRLTYPE_REC_OTHER 3 83 #define USB_REQTYPE_INTERFACE_GET (USB_CTRLTYPE_DIR_DEVICE2HOST|USB_CTRLTYPE_TYPE_CLASS|USB_CTRLTYPE_REC_INTERFACE) 84 #define USB_REQTYPE_INTERFACE_SET (USB_CTRLTYPE_DIR_HOST2DEVICE|USB_CTRLTYPE_TYPE_CLASS|USB_CTRLTYPE_REC_INTERFACE) 85 #define USB_REQTYPE_ENDPOINT_GET (USB_CTRLTYPE_DIR_DEVICE2HOST|USB_CTRLTYPE_TYPE_CLASS|USB_CTRLTYPE_REC_ENDPOINT) 86 #define USB_REQTYPE_ENDPOINT_SET (USB_CTRLTYPE_DIR_HOST2DEVICE|USB_CTRLTYPE_TYPE_CLASS|USB_CTRLTYPE_REC_ENDPOINT) 88 #define USB_FEATURE_ENDPOINT_HALT 0 90 #define USB_ENDPOINT_INTERRUPT 0x03 91 #define USB_ENDPOINT_IN 0x80 92 #define USB_ENDPOINT_OUT 0x00 94 #define USB_OH0_DEVICE_ID 0x00000000 // for completion 95 #define USB_OH1_DEVICE_ID 0x00200000 101 typedef struct _usbendpointdesc
111 typedef struct _usbinterfacedesc
116 u8 bAlternateSetting;
119 u8 bInterfaceSubClass;
120 u8 bInterfaceProtocol;
124 struct _usbendpointdesc *endpoints;
127 typedef struct _usbconfdesc
133 u8 bConfigurationValue;
137 struct _usbinterfacedesc *interfaces;
140 typedef struct _usbdevdesc
155 u8 bNumConfigurations;
156 struct _usbconfdesc *configurations;
159 typedef struct _usbhiddesc
168 u16 wDescriptorLength;
172 typedef struct _usb_device_entry {
181 s32 USB_Initialize();
182 s32 USB_Deinitialize();
185 s32 USB_CloseDevice(
s32 *fd);
186 s32 USB_CloseDeviceAsync(
s32 *fd,usbcallback cb,
void *usrdata);
188 s32 USB_GetDescriptors(
s32 fd, usb_devdesc *udd);
189 void USB_FreeDescriptors(usb_devdesc *udd);
192 s32 USB_GetHIDDescriptor(
s32 fd,
u8 interface,usb_hiddesc *uhd,
u32 size);
194 s32 USB_GetDeviceDescription(
s32 fd,usb_devdesc *devdesc);
195 s32 USB_DeviceRemovalNotifyAsync(
s32 fd,usbcallback cb,
void *userdata);
196 s32 USB_DeviceChangeNotifyAsync(
u8 interface_class,usbcallback cb,
void *userdata);
198 s32 USB_SuspendDevice(
s32 fd);
199 s32 USB_ResumeDevice(
s32 fd);
201 s32 USB_ReadIsoMsg(
s32 fd,
u8 bEndpoint,
u8 bPackets,
u16 *rpPacketSizes,
void *rpData);
202 s32 USB_ReadIsoMsgAsync(
s32 fd,
u8 bEndpoint,
u8 bPackets,
u16 *rpPacketSizes,
void *rpData,usbcallback cb,
void *userdata);
204 s32 USB_ReadIntrMsg(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData);
205 s32 USB_ReadIntrMsgAsync(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData,usbcallback cb,
void *usrdata);
207 s32 USB_ReadBlkMsg(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData);
208 s32 USB_ReadBlkMsgAsync(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData,usbcallback cb,
void *usrdata);
210 s32 USB_ReadCtrlMsg(
s32 fd,
u8 bmRequestType,
u8 bmRequest,
u16 wValue,
u16 wIndex,
u16 wLength,
void *rpData);
211 s32 USB_ReadCtrlMsgAsync(
s32 fd,
u8 bmRequestType,
u8 bmRequest,
u16 wValue,
u16 wIndex,
u16 wLength,
void *rpData,usbcallback cb,
void *usrdata);
213 s32 USB_WriteIsoMsg(
s32 fd,
u8 bEndpoint,
u8 bPackets,
u16 *rpPacketSizes,
void *rpData);
214 s32 USB_WriteIsoMsgAsync(
s32 fd,
u8 bEndpoint,
u8 bPackets,
u16 *rpPacketSizes,
void *rpData,usbcallback cb,
void *userdata);
216 s32 USB_WriteIntrMsg(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData);
217 s32 USB_WriteIntrMsgAsync(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData,usbcallback cb,
void *usrdata);
219 s32 USB_WriteBlkMsg(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData);
220 s32 USB_WriteBlkMsgAsync(
s32 fd,
u8 bEndpoint,
u16 wLength,
void *rpData,usbcallback cb,
void *usrdata);
222 s32 USB_WriteCtrlMsg(
s32 fd,
u8 bmRequestType,
u8 bmRequest,
u16 wValue,
u16 wIndex,
u16 wLength,
void *rpData);
223 s32 USB_WriteCtrlMsgAsync(
s32 fd,
u8 bmRequestType,
u8 bmRequest,
u16 wValue,
u16 wIndex,
u16 wLength,
void *rpData,usbcallback cb,
void *usrdata);
225 s32 USB_GetConfiguration(
s32 fd,
u8 *configuration);
226 s32 USB_SetConfiguration(
s32 fd,
u8 configuration);
227 s32 USB_SetAlternativeInterface(
s32 fd,
u8 interface,
u8 alternateSetting);
228 s32 USB_ClearHalt(
s32 fd,
u8 endpointAddress);
229 s32 USB_GetDeviceList(usb_device_entry *descr_buffer,
u8 num_descr,
u8 interface_class,
u8 *cnt_descr);
231 s32 USB_GetAsciiString(
s32 fd,
u8 bIndex,
u16 wLangID,
u16 wLength,
void *rpData);
int32_t s32
32bit signed integer
Definition: gctypes.h:24
#define ATTRIBUTE_PACKED
Definition: gccore.h:95
GLsizeiptr size
Definition: glext.h:6559
GLenum type
Definition: glext.h:6233
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
GLuint64EXT * result
Definition: glext.h:12211
GLuint index
Definition: glext.h:6671
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19