These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / cdc.h
1 #ifndef _IPXE_CDC_H
2 #define _IPXE_CDC_H
3
4 /** @file
5  *
6  * USB Communications Device Class (CDC)
7  *
8  */
9
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12 #include <ipxe/usb.h>
13
14 /** Class code for communications devices */
15 #define USB_CLASS_CDC 2
16
17 /** Union functional descriptor */
18 struct cdc_union_descriptor {
19         /** Descriptor header */
20         struct usb_descriptor_header header;
21         /** Descriptor subtype */
22         uint8_t subtype;
23         /** Interfaces (variable-length) */
24         uint8_t interface[1];
25 } __attribute__ (( packed ));
26
27 /** Union functional descriptor subtype */
28 #define CDC_SUBTYPE_UNION 6
29
30 /** Ethernet descriptor subtype */
31 #define CDC_SUBTYPE_ETHERNET 15
32
33 /** Network connection notification */
34 #define CDC_NETWORK_CONNECTION                                          \
35         ( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE |           \
36           USB_REQUEST_TYPE ( 0x00 ) )
37
38 /** Connection speed change notification */
39 #define CDC_CONNECTION_SPEED_CHANGE                                     \
40         ( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE |           \
41           USB_REQUEST_TYPE ( 0x2a ) )
42
43 /** Connection speed change notification */
44 struct cdc_connection_speed_change {
45         /** Downlink bit rate, in bits per second */
46         uint32_t down;
47         /** Uplink bit rate, in bits per second */
48         uint32_t up;
49 } __attribute__ (( packed ));
50
51 extern struct cdc_union_descriptor *
52 cdc_union_descriptor ( struct usb_configuration_descriptor *config,
53                        struct usb_interface_descriptor *interface );
54
55 #endif /* _IPXE_CDC_H */