[usb] Handle CDC union functional descriptors

USB Communications Device Class devices may use a union functional
descriptor to group several interfaces into a function.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-02-09 16:33:49 +00:00
parent a60f2ddfeb
commit cf153f60a5
3 changed files with 100 additions and 3 deletions

View File

@@ -14,6 +14,19 @@ FILE_LICENCE ( GPL2_OR_LATER );
/** Class code for communications devices */
#define USB_CLASS_CDC 2
/** Union functional descriptor */
struct cdc_union_descriptor {
/** Descriptor header */
struct usb_descriptor_header header;
/** Descriptor subtype */
uint8_t subtype;
/** Interfaces (variable-length) */
uint8_t interface[1];
} __attribute__ (( packed ));
/** Union functional descriptor subtype */
#define CDC_SUBTYPE_UNION 6
/** Ethernet descriptor subtype */
#define CDC_SUBTYPE_ETHERNET 15
@@ -35,4 +48,8 @@ struct cdc_connection_speed_change {
uint32_t up;
} __attribute__ (( packed ));
extern struct cdc_union_descriptor *
cdc_union_descriptor ( struct usb_configuration_descriptor *config,
struct usb_interface_descriptor *interface );
#endif /* _IPXE_CDC_H */