USB services: Difference between revisions
No edit summary |
|||
Line 406: | Line 406: | ||
== QueryAllInterfaces == | == QueryAllInterfaces == | ||
Takes | Takes an [[#UsbHsInterfaceFilter]] and a type-0x6 output buffer, returns an output u32 total_entries. | ||
The output buffer contains an array of [[#UsbHsInterface]]. | The output buffer contains an array of [[#UsbHsInterface]]. | ||
== QueryAvailableInterfaces == | == QueryAvailableInterfaces == | ||
Takes | Takes an [[#UsbHsInterfaceFilter]] and a type-0x6 output buffer, returns an output s32 total_entries. | ||
The output buffer contains an array of [[#UsbHsInterface]]. | The output buffer contains an array of [[#UsbHsInterface]]. | ||
== QueryAcquiredInterfaces == | == QueryAcquiredInterfaces == | ||
Line 423: | Line 421: | ||
== CreateInterfaceAvailableEvent == | == CreateInterfaceAvailableEvent == | ||
Takes an input u8 and | Takes an input u8 and an [[#UsbHsInterfaceFilter]], and returns an output handle. The input value must be 0..2. This is used as an index in a table. | ||
The struct is located at +2 from the u8 in IPC rawdata | The struct is located at +2 from the u8 in IPC rawdata. | ||
When signaled, this indicates that the user-process should use [[#QueryAvailableInterfaces]] and [[#AcquireUsbIf]] with the output interfaces (and the rest of interface setup). | When signaled, this indicates that the user-process should use [[#QueryAvailableInterfaces]] and [[#AcquireUsbIf]] with the output interfaces (and the rest of interface setup). | ||
Line 631: | Line 629: | ||
This is a 0x228-byte struct (unofficial name). | This is a 0x228-byte struct (unofficial name). | ||
= UsbHsInterfaceFilter = | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x2 || Flags | |||
|- | |||
| 0x2 || 0x2 ||idVendor | |||
|- | |||
| 0x4 || 0x2 || idProduct | |||
|- | |||
| 0x6 || 0x7 || Unused? | |||
|- | |||
| 0xD || 0x1 || bInterfaceClass | |||
|- | |||
| 0xE || 0x1 || bInterfaceSubClass | |||
|- | |||
| 0xF || 0x1 || bInterfaceProtocol | |||
|} | |||
This is a 0x10-byte struct (unofficial name). | |||
This is used to filter [[#UsbHsInterface]], the query commands will only return the interface when these checks pass. When a bit in Flags is set, the associated descriptor field and the field in this struct are compared, on mismatch the interface will be filtered out. Passing Flags=0 is equivalent to disabling filtering since none of these checks will run. | |||
Flags bits 0..1 use usb_device_descriptor, while 7..9 use usb_interface_descriptor. | |||
Flags bits: | |||
* 0: idVendor | |||
* 1: idProduct | |||
* 7: bInterfaceClass | |||
* 8: bInterfaceSubClass | |||
* 9: bInterfaceProtocol | |||
HID-sysmodule uses the following for the input struct: <code>80 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00</code> | |||
= XferReport = | = XferReport = |