new USB_GetHIDDescriptor()
[libogc.git] / gc / ogc / usbstorage.h
blob480dfe9c66354b716c84c018f5fd660fea45e9e1
1 #ifndef __USBSTORAGE_H__
2 #define __USBSTORAGE_H__
4 #if defined(HW_RVL)
6 #ifdef __cplusplus
7 extern "C" {
8 #endif /* __cplusplus */
10 #include <gctypes.h>
11 #include <ogc/cond.h>
12 #include <ogc/disc_io.h>
14 #define USBSTORAGE_OK 0
15 #define USBSTORAGE_ENOINTERFACE -10000
16 #define USBSTORAGE_ESENSE -10001
17 #define USBSTORAGE_ESHORTWRITE -10002
18 #define USBSTORAGE_ESHORTREAD -10003
19 #define USBSTORAGE_ESIGNATURE -10004
20 #define USBSTORAGE_ETAG -10005
21 #define USBSTORAGE_ESTATUS -10006
22 #define USBSTORAGE_EDATARESIDUE -10007
23 #define USBSTORAGE_ETIMEDOUT -10008
24 #define USBSTORAGE_EINIT -10009
26 typedef struct
28 u8 configuration;
29 u32 interface;
30 u32 altInterface;
32 u8 ep_in;
33 u8 ep_out;
35 u8 max_lun;
36 u32 *sector_size;
38 s32 usb_fd;
40 mutex_t lock;
41 cond_t cond;
42 s32 retval;
44 u32 tag;
45 u8 suspended;
47 u8 *buffer;
48 } usbstorage_handle;
50 s32 USBStorage_Initialize();
52 s32 USBStorage_Open(usbstorage_handle *dev, const char *bus, u16 vid, u16 pid);
53 s32 USBStorage_Close(usbstorage_handle *dev);
54 s32 USBStorage_Reset(usbstorage_handle *dev);
56 s32 USBStorage_GetMaxLUN(usbstorage_handle *dev);
57 s32 USBStorage_MountLUN(usbstorage_handle *dev, u8 lun);
58 s32 USBStorage_Suspend(usbstorage_handle *dev);
60 s32 USBStorage_ReadCapacity(usbstorage_handle *dev, u8 lun, u32 *sector_size, u32 *n_sectors);
61 s32 USBStorage_Read(usbstorage_handle *dev, u8 lun, u32 sector, u16 n_sectors, u8 *buffer);
62 s32 USBStorage_Write(usbstorage_handle *dev, u8 lun, u32 sector, u16 n_sectors, const u8 *buffer);
64 #define DEVICE_TYPE_WII_USB (('W'<<24)|('U'<<16)|('S'<<8)|'B')
66 extern const DISC_INTERFACE __io_usbstorage;
68 #ifdef __cplusplus
70 #endif /* __cplusplus */
72 #endif /* HW_RVL */
74 #endif /* __USBSTORAGE_H__ */