Changes

505 bytes added ,  19:00, 12 April 2015
Arrange this page better, putting structures into their own page section
Line 3: Line 3:  
==ioctl() interface==
 
==ioctl() interface==
 
===0x11 - UhsQueryInterfaces()===
 
===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.
+
This function is used to determine which USB device interfaces are plugged in and available. Its input is a [[#Interface Filter|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 [[#Interface Profile|0x16c-byte interface profiles]], one for each interface being read. IOS_Ioctl() with this function returns the number of attached USB interfaces permitted by the filter.
    +
==Structures==
 +
===Interface Filter===
 +
This structure is passed to several functions to determine which interface profiles to return or handle.
 
<syntaxhighlight lang="C">
 
<syntaxhighlight lang="C">
 
/* Determines which parameters to check */
 
/* Determines which parameters to check */
Line 30: Line 33:  
     uint8_t if_protocol;      /* Interface protocol */  
 
     uint8_t if_protocol;      /* Interface protocol */  
 
} UhsInterfaceFilter;
 
} UhsInterfaceFilter;
 +
</syntaxhighlight>
    +
===USB Descriptors===
 +
These are device, configuration, and interface descriptors defined by the USB specification.
 +
<syntaxhighlight lang="C">
 
/* USB device descriptor */
 
/* USB device descriptor */
 
typedef struct
 
typedef struct
Line 76: Line 83:  
     uint8_t iInterface;
 
     uint8_t iInterface;
 
} UhsInterfaceDescriptor;
 
} UhsInterfaceDescriptor;
 +
</syntaxhighlight>
    +
===Interface Profile===
 +
This structure is used to represent an available device interface attached to the Wii U.
 +
<syntaxhighlight lang="C">
 
/* Output buffer */
 
/* Output buffer */
 
typedef struct
 
typedef struct
203

edits