10 #include "../sf/service.h"
11 #include "../services/usb.h"
12 #include "../kernel/event.h"
14 #define USBDS_DEFAULT_InterfaceNumber 0x4
22 Event CtrlInCompletionEvent;
23 Event CtrlOutCompletionEvent;
29 Event CompletionEvent;
36 char Manufacturer[0x20];
38 char SerialNumber[0x20];
54 UsbComplexId_Default = 0x2
81 Event* usbDsGetStateChangeEvent(
void);
133 Result usbDsInterface_CtrlOutPostBufferAsync(
UsbDsInterface* interface,
void* buffer,
size_t size,
u32* urbId);
Kernel-mode event structure.
Definition: event.h:13
Service object structure.
Definition: service.h:14
u16 idProduct
PID.
Definition: usbds.h:34
u16 idVendor
VID.
Definition: usbds.h:33
u32 id
urbId from post-buffer cmds
Definition: usbds.h:42
Imported from libusb, with some adjustments.
Definition: usb.h:48
Imported from libusb, with some adjustments.
Definition: usb.h:25
Imported from libusb, with some adjustments.
Definition: usb.h:35
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
UsbState
USB Device States, per USB 2.0 spec.
Definition: usb.h:211
Result usbDsRegisterInterface(UsbDsInterface **out)
Only available on [5.0.0+].
Result usbDsDisable(void)
Only available on [5.0.0+].
Result usbDsGetDsInterface(UsbDsInterface **out, struct usb_interface_descriptor *descriptor, const char *interface_name)
Removed in [5.0.0+].
Result usbDsWaitReady(u64 timeout)
Helper func.
Result usbDsInterface_RegisterEndpoint(UsbDsInterface *interface, UsbDsEndpoint **endpoint, u8 endpoint_address)
Only available on [5.0.0+].
Result usbDsAddUsbStringDescriptor(u8 *out_index, const char *string)
Only available on [5.0.0+].
Result usbDsSetBinaryObjectStore(const void *bos, size_t bos_size)
Only available on [5.0.0+].
Result usbDsClearDeviceData(void)
Only available on [5.0.0+].
Result usbDsSetUsbDeviceDescriptor(UsbDeviceSpeed speed, struct usb_device_descriptor *descriptor)
Only available on [5.0.0+].
Result usbDsParseReportData(UsbDsReportData *reportdata, u32 urbId, u32 *requestedSize, u32 *transferredSize)
Helper func.
Result usbDsGetState(UsbState *out)
Gets the device state. See UsbState.
Result usbDsEnable(void)
Only available on [5.0.0+].
Result usbDsInitialize(void)
Opens a session with usb:ds.
void usbDsExit(void)
Closes the usb:ds session. Any interfaces/endpoints which are left open are automatically closed,...
Result usbDsAddUsbLanguageStringDescriptor(u8 *out_index, const u16 *lang_ids, u16 num_langs)
Only available on [5.0.0+].
Result usbDsInterface_AppendConfigurationData(UsbDsInterface *interface, UsbDeviceSpeed speed, const void *buffer, size_t size)
Only available on [5.0.0+].
Result usbDsRegisterInterfaceEx(UsbDsInterface **out, u8 intf_num)
Only available on [5.0.0+].
Service * usbDsGetServiceSession(void)
Gets the Service object for the actual usb:ds service session.
UsbDeviceSpeed
Definition: usbds.h:57
@ UsbDeviceSpeed_Full
USB 1.1 Full Speed.
Definition: usbds.h:58
@ UsbDeviceSpeed_High
USB 2.0 High Speed.
Definition: usbds.h:59
@ UsbDeviceSpeed_Super
USB 3.0 Super Speed.
Definition: usbds.h:60
Result usbDsDeleteUsbStringDescriptor(u8 index)
Only available on [5.0.0+].
Result usbDsSetVidPidBcd(const UsbDsDeviceInfo *deviceinfo)
Removed in [5.0.0+].
Result usbDsInterface_GetDsEndpoint(UsbDsInterface *interface, UsbDsEndpoint **endpoint, struct usb_endpoint_descriptor *descriptor)
Removed in [5.0.0+].