Difference between revisions of "/dev/uhs"
Marionumber1 (talk | contribs) (Start documenting UHS (USB Host Stack)) |
Marionumber1 (talk | contribs) (→0x11 - UhsQueryInterfaces(): Describe UhsQueryInterfaces() better) |
||
Line 3: | Line 3: | ||
==ioctl() interface== | ==ioctl() interface== | ||
===0x11 - UhsQueryInterfaces()=== | ===0x11 - UhsQueryInterfaces()=== | ||
− | This function | + | This function is used to determine which USB device interfaces are plugged in and available. Its input is a 0x10-byte buffer containing a series of parameters to filter the interfaces by, such as class, subclass, vendor ID, and product ID. The output is an array of 0x16c-byte interface descriptors, one for each interface being read. IOS_Ioctl() with this function returns the number of attached USB interfaces permitted by the filter. |
Revision as of 01:07, 12 April 2015
/dev/uhs is the IOSU device node for USB. It provides an interface for low-level USB device access, which nsysuhs.rpl exposes to the Cafe OS userspace. The interface is opened through /dev/uhs/%d, where %d is an integer representing something (controller number?). Only 0 can be opened, as 1 returns access denied and further values do not exist as device nodes. Once opened, ioctl() requests can be issued to the interface, which are documented below.
ioctl() interface
0x11 - UhsQueryInterfaces()
This function is used to determine which USB device interfaces are plugged in and available. Its input is a 0x10-byte buffer containing a series of parameters to filter the interfaces by, such as class, subclass, vendor ID, and product ID. The output is an array of 0x16c-byte interface descriptors, one for each interface being read. IOS_Ioctl() with this function returns the number of attached USB interfaces permitted by the filter.