Difference between revisions of "/dev/usb/hid (v5)"

From WiiBrew
< /dev‎ | usb
Jump to: navigation, search
(Ioctls)
Line 7: Line 7:
 
== Handles ==
 
== Handles ==
 
Handles for USB_HID function exactly the same as for USB_VEN.
 
Handles for USB_HID function exactly the same as for USB_VEN.
 +
 +
== Internal device structure ==
 +
HID has an additional member at the end of the device structure that seems to be used for keeping track of ongoing transfers.
  
 
== Ioctls ==
 
== Ioctls ==
Line 33: Line 36:
 
| 0x10 || SuspendResume || Identical to VEN
 
| 0x10 || SuspendResume || Identical to VEN
 
|-
 
|-
| 0x11 || CancelEndpoint (?)
+
| 0x11 || CancelEndpoint
 
| Calls /dev/usb/usb ioctl 0x10
 
| Calls /dev/usb/usb ioctl 0x10
 +
 +
Depending on the endpoint (<code>in[8]</code>), this may abort an ongoing transfer with return code -7022 (USB_CANCELLED).
 
|-
 
|-
 
| 0x12 (ioctlv) || CtrlTransfer (?) || ?
 
| 0x12 (ioctlv) || CtrlTransfer (?) || ?

Revision as of 14:52, 28 October 2017

/dev/usb/hid is used to interact with USB HIDs in IOS57, 58 and 59.

It is very similar to /dev/usb/ven and other v5 interfaces. Some ioctl handlers are identical to USB_VEN. Both rely on /dev/usb/usb for most actions.

Handles

Handles for USB_HID function exactly the same as for USB_VEN.

Internal device structure

HID has an additional member at the end of the device structure that seems to be used for keeping track of ongoing transfers.

Ioctls

Ioctl Name Notes
0 GetVersion Identical to VEN
1 GetDeviceChange Identical to VEN
2 Shutdown Identical to VEN
3 GetDeviceInfo (?) ?
4 ? Identical to VEN
5 ? Identical to VEN
6 AttachFinish Identical to VEN
7 SetAlternateSetting Not available in HID
8 ? Does not exist in HID
0x10 SuspendResume Identical to VEN
0x11 CancelEndpoint Calls /dev/usb/usb ioctl 0x10

Depending on the endpoint (in[8]), this may abort an ongoing transfer with return code -7022 (USB_CANCELLED).

0x12 (ioctlv) CtrlTransfer (?) ?
0x13 (ioctlv) IntrTransfer (?) ?
0x14 (ioctlv) IsoTransfer Not available in HID
0x15 (ioctlv) BulkTransfer Not available in HID