9 #include "../services/sm.h" 15 #define USBDS_DEFAULT_InterfaceNumber 0x4 19 #define USB_DT_INTERFACE_SIZE 9 20 #define USB_DT_ENDPOINT_SIZE 7 25 uint8_t bDescriptorType;
28 uint16_t wMaxPacketSize;
35 uint8_t bDescriptorType;
40 uint8_t bInterfaceSubClass;
41 uint8_t bInterfaceProtocol;
49 char Manufacturer[0x20];
51 char SerialNumber[0x20];
72 Handle CtrlInCompletionEvent;
73 Handle CtrlOutCompletionEvent;
83 UsbComplexId_Default = 0x2
88 USB_CLASS_PER_INTERFACE = 0,
92 USB_CLASS_PHYSICAL = 5,
93 USB_CLASS_PRINTER = 7,
96 USB_CLASS_MASS_STORAGE = 8,
99 USB_CLASS_SMART_CARD = 0x0b,
100 USB_CLASS_CONTENT_SECURITY = 0x0d,
101 USB_CLASS_VIDEO = 0x0e,
102 USB_CLASS_PERSONAL_HEALTHCARE = 0x0f,
103 USB_CLASS_DIAGNOSTIC_DEVICE = 0xdc,
104 USB_CLASS_WIRELESS = 0xe0,
105 USB_CLASS_APPLICATION = 0xfe,
106 USB_CLASS_VENDOR_SPEC = 0xff
111 USB_DT_DEVICE = 0x01,
112 USB_DT_CONFIG = 0x02,
113 USB_DT_STRING = 0x03,
114 USB_DT_INTERFACE = 0x04,
115 USB_DT_ENDPOINT = 0x05,
117 USB_DT_DEVICE_CAPABILITY = 0x10,
119 USB_DT_REPORT = 0x22,
120 USB_DT_PHYSICAL = 0x23,
122 USB_DT_SUPERSPEED_HUB = 0x2a,
123 USB_DT_SS_ENDPOINT_COMPANION = 0x30
128 USB_ENDPOINT_IN = 0x80,
129 USB_ENDPOINT_OUT = 0x00
134 USB_TRANSFER_TYPE_CONTROL = 0,
135 USB_TRANSFER_TYPE_ISOCHRONOUS = 1,
136 USB_TRANSFER_TYPE_BULK = 2,
137 USB_TRANSFER_TYPE_INTERRUPT = 3,
138 USB_TRANSFER_TYPE_BULK_STREAM = 4,
143 USB_ISO_SYNC_TYPE_NONE = 0,
144 USB_ISO_SYNC_TYPE_ASYNC = 1,
145 USB_ISO_SYNC_TYPE_ADAPTIVE = 2,
146 USB_ISO_SYNC_TYPE_SYNC = 3
151 USB_ISO_USAGE_TYPE_DATA = 0,
152 USB_ISO_USAGE_TYPE_FEEDBACK = 1,
153 USB_ISO_USAGE_TYPE_IMPLICIT = 2,
161 Service* usbDsGetServiceSession(
void);
162 Handle usbDsGetStateChangeEvent(
void);
179 Result usbDsInterface_CtrlOutPostBufferAsync(
UsbDsInterface* interface,
void* buffer,
size_t size,
u32 *urbId);
Result usbDsWaitReady(void)
Wait for initialization to finish where data-transfer is usable.
uint8_t bInterfaceClass
Ignored.
Definition: usb.h:39
usb_endpoint_direction
Imported from libusb, with changed names.
Definition: usb.h:127
usb_iso_usage_type
Imported from libusb, with changed names.
Definition: usb.h:150
uint16_t u16
16-bit unsigned integer.
Definition: types.h:22
void usbDsEndpoint_Close(UsbDsEndpoint *endpoint)
IDsEndpoint.
u16 bcdDevice
PID.
Definition: usb.h:48
void usbDsInterface_Close(UsbDsInterface *interface)
IDsInterface.
u32 Handle
Kernel object handle.
Definition: types.h:45
Service object structure.
Definition: sm.h:23
u32 Result
Function error code result type.
Definition: types.h:46
Imported from libusb, with some adjustments.
Definition: usb.h:33
u32 requestedSize
urbId from post-buffer cmds
Definition: usb.h:56
uint32_t u32
32-bit unsigned integer.
Definition: types.h:23
usb_transfer_type
Imported from libusb, with changed names.
Definition: usb.h:133
Result usbDsParseReportData(UsbDsReportData *reportdata, u32 urbId, u32 *requestedSize, u32 *transferredSize)
Parse usbDsReportData from the Get*ReportData commands, where urbId is from the post-buffer commands...
uint8_t bEndpointAddress
Must match USB_DT_ENDPOINT.
Definition: usb.h:26
usb_iso_sync_type
Imported from libusb, with changed names.
Definition: usb.h:142
u16 idProduct
VID.
Definition: usb.h:47
Imported from libusb, with some adjustments.
Definition: usb.h:23
uint8_t bInterfaceNumber
Must match USB_DT_INTERFACE.
Definition: usb.h:36
void usbDsExit(void)
Exit usbDs. Any interfaces/endpoints which are left open are automatically closed, since otherwise usb-sysmodule won't fully reset usbds to defaults.
uint8_t bmAttributes
Should be one of the usb_endpoint_direction values, the endpoint-number is automatically allocated...
Definition: usb.h:27
uint8_t bNumEndpoints
Must match 0.
Definition: usb.h:38
usb_descriptor_type
Imported from libusb, with changed names.
Definition: usb.h:110
usb_class_code
Imported from libusb, with changed names.
Definition: usb.h:87
uint8_t bAlternateSetting
See also USBDS_DEFAULT_InterfaceNumber.
Definition: usb.h:37