From cf153f60a54b4706225f6326dc65b9343148c9f3 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 9 Feb 2015 16:33:49 +0000 Subject: [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 --- src/include/ipxe/cdc.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/cdc.h b/src/include/ipxe/cdc.h index 2eec598a9..929a6a659 100644 --- a/src/include/ipxe/cdc.h +++ b/src/include/ipxe/cdc.h @@ -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 */ -- cgit v1.2.3-55-g7522