31 typedef void (*sceUsbdDoneCallback)(
int result,
int count,
void *arg);
38 u8 wHubCharacteristicsLb;
39 u8 wHubCharacteristicsHb;
42 u8 deviceRemovable[32];
52 int (*probe)(
int devID);
53 int (*connect)(
int devID);
54 int (*disconnect)(
int devID);
78 u8 bNumConfigurations;
89 u8 bConfigurationValue;
100 u8 bAlternateSetting;
103 u8 bInterfaceSubClass;
104 u8 bInterfaceProtocol;
129 u8 wDescriptorLengthLb;
130 u8 wDescriptorLengthHb;
150 #define USB_MAX_ISOCH_PACKETS 8
165 #define USB_CLASS_PER_INTERFACE 0
166 #define USB_CLASS_AUDIO 1
167 #define USB_CLASS_COMM 2
168 #define USB_CLASS_HID 3
169 #define USB_CLASS_PHYSICAL 5
170 #define USB_CLASS_PRINTER 7
171 #define USB_CLASS_MASS_STORAGE 8
172 #define USB_CLASS_HUB 9
173 #define USB_CLASS_DATA 10
174 #define USB_CLASS_APP_SPEC 0xfe
175 #define USB_CLASS_VENDOR_SPEC 0xff
180 #define USB_TYPE_STANDARD (0x00 << 5)
181 #define USB_TYPE_CLASS (0x01 << 5)
182 #define USB_TYPE_VENDOR (0x02 << 5)
183 #define USB_TYPE_RESERVED (0x03 << 5)
188 #define USB_RECIP_DEVICE 0x00
189 #define USB_RECIP_INTERFACE 0x01
190 #define USB_RECIP_ENDPOINT 0x02
191 #define USB_RECIP_OTHER 0x03
193 #define USB_ENDPOINT_XFER_CONTROL 0
194 #define USB_ENDPOINT_XFER_ISOC 1
195 #define USB_ENDPOINT_XFER_BULK 2
196 #define USB_ENDPOINT_XFER_INT 3
197 #define USB_ENDPOINT_XFERTYPE_MASK 3
199 #define USB_REQ_GET_REPORT 0x01
200 #define USB_REQ_GET_IDLE 0x02
201 #define USB_REQ_GET_PROTOCOL 0x03
202 #define USB_REQ_SET_REPORT 0x09
203 #define USB_REQ_SET_IDLE 0x0A
204 #define USB_REQ_SET_PROTOCOL 0x0B
209 #define USB_DIR_OUT 0
210 #define USB_DIR_IN 0x80
211 #define USB_ENDPOINT_DIR_MASK 0x80
213 #define USB_DT_DEVICE 1
214 #define USB_DT_CONFIG 2
215 #define USB_DT_STRING 3
216 #define USB_DT_INTERFACE 4
217 #define USB_DT_ENDPOINT 5
218 #define USB_DT_HUB 0x29
220 #define USB_CLASS_HUB 9
222 #define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
223 #define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
225 #define USB_REQ_GET_STATUS 0x00
226 #define USB_REQ_CLEAR_FEATURE 0x01
227 #define USB_REQ_SET_FEATURE 0x03
228 #define USB_REQ_SET_ADDRESS 0x05
229 #define USB_REQ_GET_DESCRIPTOR 0x06
230 #define USB_REQ_SET_DESCRIPTOR 0x07
231 #define USB_REQ_GET_CONFIGURATION 0x08
232 #define USB_REQ_SET_CONFIGURATION 0x09
233 #define USB_REQ_GET_INTERFACE 0x0A
234 #define USB_REQ_SET_INTERFACE 0x0B
235 #define USB_REQ_SYNCH_FRAME 0x0C
238 #define USB_RC_OK 0x000
240 #define USB_RC_CRC 0x001
242 #define USB_RC_BITSTUFF 0x002
244 #define USB_RC_TOGGLE 0x003
246 #define USB_RC_STALL 0x004
248 #define USB_RC_NORESPONSE 0x005
250 #define USB_RC_BADPID 0x006
252 #define USB_RC_WRONGPID 0x007
254 #define USB_RC_DATAOVER 0x008
256 #define USB_RC_DATAUNDER 0x009
258 #define USB_RC_BUFFOVER 0x00C
260 #define USB_RC_BUFFUNDER 0x00D
262 #define USB_RC_NOTACCESSED 0x00E
264 #define USB_RC_NOTACCESSED2 0x00F
267 #define USB_RC_BADDEV 0x101
269 #define USB_RC_BADPIPE 0x102
271 #define USB_RC_BADLENGTH 0x103
273 #define USB_RC_BADDRIVER 0x104
275 #define USB_RC_BADCONTEXT 0x105
276 #define USB_RC_BADALIGN 0x106
277 #define USB_RC_BADHUBDEPTH 0x107
280 #define USB_RC_ED 0x111
282 #define USB_RC_IOREQ 0x112
284 #define USB_RC_BADOPTION 0x113
287 #define USB_RC_BUSY 0x121
289 #define USB_RC_ABORTED 0x122
292 #define USB_RC_NOSUPPORT 0x131
294 #define USB_RC_UNKNOWN 0x132
298 extern void *sceUsbdScanStaticDescriptor(
int devId,
void *data, u8 type);
299 extern int sceUsbdGetDeviceLocation(
int devId, u8 *path);
300 extern int sceUsbdSetPrivateData(
int devId,
void *data);
301 extern void *sceUsbdGetPrivateData(
int devId);
304 extern int sceUsbdClosePipe(
int id);
305 extern int sceUsbdTransferPipe(
int id,
void *data, u32 len,
void *option, sceUsbdDoneCallback callback,
void *cbArg);
308 extern int sceUsbdUnregisterAutoloader(
void);
309 extern int sceUsbdChangeThreadPriority(
int prio1,
int prio2);
312 extern int sceUsbdGetReportDescriptor(
int devId,
int cfgNum,
int ifNum,
void **desc, u32 *len);
316 #define UsbCallbackProc sceUsbdDoneCallback
317 #define UsbDriver sceUsbdLddOps
318 #define UsbIsochronousPswLen sceUsbdIsochronousPswLen
319 #define UsbMultiIsochronousRequest sceUsbdMultiIsochronousRequest
320 #define UsbMultiIsochronousDoneCallback sceUsbdMultiIsochronousDoneCallback
321 #define UsbRegisterDriver sceUsbdRegisterLdd
322 #define UsbUnregisterDriver sceUsbdUnregisterLdd
323 #define UsbGetDeviceStaticDescriptor sceUsbdScanStaticDescriptor
324 #define UsbGetDeviceLocation sceUsbdGetDeviceLocation
325 #define UsbSetDevicePrivateData sceUsbdSetPrivateData
326 #define UsbGetDevicePrivateData sceUsbdGetPrivateData
327 #define UsbOpenEndpoint sceUsbdOpenPipe
328 #define UsbOpenEndpointAligned sceUsbdOpenPipeAligned
329 #define UsbCloseEndpoint sceUsbdClosePipe
330 #define UsbTransfer sceUsbdTransferPipe
331 #define UsbRegisterAutoloader sceUsbdRegisterAutoloader
332 #define UsbUnregisterAutoloader sceUsbdUnregisterAutoloader
333 #define UsbChangeThreadPriority sceUsbdChangeThreadPriority
334 #define UsbGetReportDescriptor sceUsbdGetReportDescriptor
335 #define UsbMultiIsochronousTransfer sceUsbdMultiIsochronousTransfer
337 #define usbd_IMPORTS_start DECLARE_IMPORT_TABLE(usbd, 1, 2)
338 #define usbd_IMPORTS_end END_IMPORT_TABLE
340 #define I_sceUsbdRegisterLdd DECLARE_IMPORT(4, sceUsbdRegisterLdd)
341 #define I_sceUsbdUnregisterLdd DECLARE_IMPORT(5, sceUsbdUnregisterLdd)
342 #define I_sceUsbdScanStaticDescriptor DECLARE_IMPORT(6, sceUsbdScanStaticDescriptor)
343 #define I_sceUsbdSetPrivateData DECLARE_IMPORT(7, sceUsbdSetPrivateData)
344 #define I_sceUsbdGetPrivateData DECLARE_IMPORT(8, sceUsbdGetPrivateData)
345 #define I_sceUsbdOpenPipe DECLARE_IMPORT(9, sceUsbdOpenPipe)
346 #define I_sceUsbdClosePipe DECLARE_IMPORT(10, sceUsbdClosePipe)
347 #define I_sceUsbdTransferPipe DECLARE_IMPORT(11, sceUsbdTransferPipe)
348 #define I_sceUsbdOpenPipeAligned DECLARE_IMPORT(12, sceUsbdOpenPipeAligned)
349 #define I_sceUsbdGetDeviceLocation DECLARE_IMPORT(13, sceUsbdGetDeviceLocation)
350 #define I_sceUsbdRegisterAutoloader DECLARE_IMPORT(14, sceUsbdRegisterAutoloader)
351 #define I_sceUsbdUnregisterAutoloader DECLARE_IMPORT(15, sceUsbdUnregisterAutoloader)
352 #define I_sceUsbdChangeThreadPriority DECLARE_IMPORT(16, sceUsbdChangeThreadPriority)
353 #define I_sceUsbdGetReportDescriptor DECLARE_IMPORT(17, sceUsbdGetReportDescriptor)
354 #define I_sceUsbdMultiIsochronousTransfer DECLARE_IMPORT(18, sceUsbdMultiIsochronousTransfer)
357 #define I_UsbCallbackProc I_sceUsbdDoneCallback
358 #define I_UsbDriver I_sceUsbdLddOps
359 #define I_UsbIsochronousPswLen I_sceUsbdIsochronousPswLen
360 #define I_UsbMultiIsochronousRequest I_sceUsbdMultiIsochronousRequest
361 #define I_UsbMultiIsochronousDoneCallback I_sceUsbdMultiIsochronousDoneCallback
362 #define I_UsbRegisterDriver I_sceUsbdRegisterLdd
363 #define I_UsbUnregisterDriver I_sceUsbdUnregisterLdd
364 #define I_UsbGetDeviceStaticDescriptor I_sceUsbdScanStaticDescriptor
365 #define I_UsbGetDeviceLocation I_sceUsbdGetDeviceLocation
366 #define I_UsbSetDevicePrivateData I_sceUsbdSetPrivateData
367 #define I_UsbGetDevicePrivateData I_sceUsbdGetPrivateData
368 #define I_UsbOpenEndpoint I_sceUsbdOpenPipe
369 #define I_UsbOpenEndpointAligned I_sceUsbdOpenPipeAligned
370 #define I_UsbCloseEndpoint I_sceUsbdClosePipe
371 #define I_UsbTransfer I_sceUsbdTransferPipe
372 #define I_UsbRegisterAutoloader I_sceUsbdRegisterAutoloader
373 #define I_UsbUnregisterAutoloader I_sceUsbdUnregisterAutoloader
374 #define I_UsbChangeThreadPriority I_sceUsbdChangeThreadPriority
375 #define I_UsbGetReportDescriptor I_sceUsbdGetReportDescriptor
376 #define I_UsbMultiIsochronousTransfer I_sceUsbdMultiIsochronousTransfer