Interface Selection Structures
Various structures are needed when you select a configuration. An array of USB_INTERFACE_LIST_ENTRY structures, shown in Table 21.7, is passed to
Table 21.7 USB INTERFACE LIST ENTRY fields
InterfaceDescriptor | Points to interface descriptor |
Interface | USB_INTERFACE_INFORMATION pointer |
The
Table 21.8 USB INTERFACE INFORMATION fields
InterfaceNumber | Interface number |
AlternateSetting | Alternate setting |
Class Subclass Protocol | USB class codes |
NumberOfPipes | Number of pipes |
PipeInformation | Array of USB_PIPE_INFORMATION structures |
Table 21.9 shows the USB_PIPE_INFORMATION structure. All fields apart from
Table 21.9 USB_PIPE INFORMATION fields
MaximumPacketSize | Maximum packet size |
EndpointAddress | Endpoint number The top bit is set for input pipes. |
Interval | Polling interval in ms for Interrupt pipes |
PipeType | UsbdPipeTypeControl UsbdPipeTypeIsochronous UsbdPipeTypeBulk UsbdPipeTypeInterrupt |
PipeHandle | Handle for later USBDI calls |
MaximumTransferSize | Maximum transfer size |
PipeFlags | Flags |
String Descriptor
A device may optionally provide string descriptors. Each string descriptor contains just one Unicode string, so the driver must request each string one by one. String index zero is special. Instead of a string, it contains a list of two-byte language ID codes. Language ID 0x0009 is usually used for generic English.
As has been seen, various other descriptors contain string index numbers. If these numbers are non-zero, there is an associated string. When you request a string descriptor using the
A USB_STRING_DESCRIPTOR structure simply has one useful field,
Isochronous Packet Descriptor
The USBD_ISO_PACKET_DESCRIPTOR structure is used to describe an isochronous transfer packet. An isochronous transfer request URB has a single transfer buffer that may contain several individual packets.
For writes, set the
For reads, the packet descriptor
USBDI URB Reference
All these URBs use standard USB control transfers over the default pipe. I will later explain the details of how to set or clear features, or do class or vendor defined control transfers over the default pipe.