2 #define __USBSTORAGE_H 1
7 typedef struct _usbendpointdesc
17 typedef struct _usbinterfacedesc
25 u8 bInterfaceSubClass
;
26 u8 bInterfaceProtocol
;
28 struct _usbendpointdesc
*endpoints
;
31 typedef struct _usbconfdesc
37 u8 bConfigurationValue
;
41 struct _usbinterfacedesc
*interfaces
;
42 } usb_configurationdesc
;
44 typedef struct __usbdevdesc
59 u8 bNumConfigurations
;
60 struct _usbconfdesc
*configurations
;
86 s32
USB_GetDescriptors(s32 fd
, _usb_devdesc
*udd
);
87 void USB_FreeDescriptors(_usb_devdesc
*udd
);
89 s32
USBStorage_Initialize();
90 s32
USBStorage_Deinitialize();
92 usbstorage_handle
*USBStorage_Open(const char *bus
, u16 vid
, u16 pid
);
93 s32
USBStorage_Close(usbstorage_handle
*dev
);
95 s32
USBStorage_ReadCapacity(usbstorage_handle
*dev
, u32
*sector_size
, u32
*n_sectors
);
97 s32
USBStorage_Read(usbstorage_handle
*dev
, u32 sector
, u8
*buffer
, u16 n_sectors
);
98 s32
USBStorage_Write(usbstorage_handle
*dev
, u32 sector
, const u8
*buffer
, u16 n_sectors
);