Difference between revisions of "/dev/usb/oh0"

From WiiBrew
< /dev‎ | usb
Jump to: navigation, search
(Known Devices: add Logitech mic)
Line 4: Line 4:
 
This interface is very similar to OH1.
 
This interface is very similar to OH1.
  
== Host device (/dev/usb/oh0) ==
+
== /dev/usb/oh0 ==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 14: Line 14:
 
* in 0: u8 - number of descriptors to return
 
* in 0: u8 - number of descriptors to return
 
* in 1: u8 - interface class
 
* in 1: u8 - interface class
* out 0: u8 - number of devices
+
* io 0: u8 - number of devices
* out 1: u32* of size num_descriptors * 8 - device list
+
* io 1: u32* of size num_descriptors * 8 - device list
  
 
|-
 
|-
Line 31: Line 31:
 
* in 1: u16 - PID
 
* in 1: u16 - PID
 
* in 2: u8 - Unknown (00)
 
* in 2: u8 - Unknown (00)
* out 0: u8* of size 4 - Unknown (00 a3 f4 c0 -- for 046d:0a03)
+
* io 0: u8* of size 4 - Unknown (00 a3 f4 c0 -- for 046d:0a03)
 +
|}
 +
 
 +
== /dev/usb/oh0/%x/%x ==
 +
{| class="wikitable"
 +
|-
 +
! Ioctl !! Name !! Input !! Output
 +
! Notes
 +
 
 +
|-
 +
| 0 (ioctlv) || USBV0_IOCTL_CTRLMSG || 5 || 1
 +
|
 +
Submits a control transfer.
 +
* in 0: u8 - bmRequestType
 +
* in 1: u8 - bmRequest
 +
* in 2: u16 - wValue (swapped)
 +
* in 3: u16 - wIndex (swapped)
 +
* in 4: u16 - wLength (swapped)
 +
* in 5: u8 - Unknown (00)
 +
* io 0: array of length wLength - Request data
 +
 
 +
|-
 +
| 1 (ioctlv) || USBV0_IOCTL_BLKMSG || 2 || 1
 +
|
 +
Submits a bulk transfer.
 +
* in 0: u8 - Endpoint
 +
* in 1: u16 - Length
 +
* io 0: array of length in[1] - Payload data
 +
 
 +
|-
 +
| 2 (ioctlv) || USBV0_IOCTL_INTRMSG || 2 || 1
 +
|
 +
Submits an interrupt transfer.
 +
* in 0: u8 - Endpoint
 +
* in 1: u16 - Length
 +
* io 0: array of length in[1] - Payload data
 +
 
 +
|-
 +
| 9 (ioctlv) || USBV0_IOCTL_ISOMSG || 3 || 2
 +
|
 +
Submits an isochronous transfer.
 +
* in 0: u8 - Endpoint
 +
* in 1: u16 - Length
 +
* in 2: u8 - Number of isochronous packets
 +
* io 0: u16* of size in[2] - Sizes of the isochronous packets
 +
* io 1: array of length in[1] - Payload data
 +
 
 +
|-
 +
| 26 (ioctlv) || USBV0_IOCTL_DEVREMOVALHOOK || 0 || 0
 +
|
 +
Returns when the device is unplugged.
 
|}
 
|}
  

Revision as of 20:51, 11 November 2016

Description

/dev/usb/oh0 is the external USB bus in the Wii

This interface is very similar to OH1.

/dev/usb/oh0

Ioctl Name Input Output Notes
12 (ioctlv) USBV0_IOCTL_GETDEVLIST 2 2
  • in 0: u8 - number of descriptors to return
  • in 1: u8 - interface class
  • io 0: u8 - number of devices
  • io 1: u32* of size num_descriptors * 8 - device list
27 (ioctlv) USBV0_IOCTL_DEVINSERTHOOK 2 0

Returns when a device with the requested VID/PID is plugged in, or immediately if the device is already inserted.

  • in 0: u16 - VID
  • in 1: u16 - PID
30 (ioctlv) ? 3 1

Unknown.

  • in 0: u16 - VID
  • in 1: u16 - PID
  • in 2: u8 - Unknown (00)
  • io 0: u8* of size 4 - Unknown (00 a3 f4 c0 -- for 046d:0a03)

/dev/usb/oh0/%x/%x

Ioctl Name Input Output Notes
0 (ioctlv) USBV0_IOCTL_CTRLMSG 5 1

Submits a control transfer.

  • in 0: u8 - bmRequestType
  • in 1: u8 - bmRequest
  • in 2: u16 - wValue (swapped)
  • in 3: u16 - wIndex (swapped)
  • in 4: u16 - wLength (swapped)
  • in 5: u8 - Unknown (00)
  • io 0: array of length wLength - Request data
1 (ioctlv) USBV0_IOCTL_BLKMSG 2 1

Submits a bulk transfer.

  • in 0: u8 - Endpoint
  • in 1: u16 - Length
  • io 0: array of length in[1] - Payload data
2 (ioctlv) USBV0_IOCTL_INTRMSG 2 1

Submits an interrupt transfer.

  • in 0: u8 - Endpoint
  • in 1: u16 - Length
  • io 0: array of length in[1] - Payload data
9 (ioctlv) USBV0_IOCTL_ISOMSG 3 2

Submits an isochronous transfer.

  • in 0: u8 - Endpoint
  • in 1: u16 - Length
  • in 2: u8 - Number of isochronous packets
  • io 0: u16* of size in[2] - Sizes of the isochronous packets
  • io 1: array of length in[1] - Payload data
26 (ioctlv) USBV0_IOCTL_DEVREMOVALHOOK 0 0

Returns when the device is unplugged.

Known Devices

  • /dev/usb/oh0/0b95/7720: ASIX AX88772 USB2.0 to Fast Ethernet Adapter (referenced in IOS eth driver)
  • /dev/usb/oh0/57e/308: Nintendo Wii Speak (microphone)
  • /dev/usb/oh0/46d/a03: Logitech microphone

Errors

-4 (IPC_EINVAL): might be caused by an invalid device fd

-7003: STALL (according to gc-linux)

-7004: STALL (according to gc-linux)

-7005: NAK (according to gc-linux)

-7008

-7022