iPXE
|
USB Communications Device Class (CDC) More...
#include <ipxe/usb.h>
Go to the source code of this file.
Data Structures | |
struct | cdc_union_descriptor |
Union functional descriptor. More... | |
struct | cdc_connection_speed_change |
Connection speed change notification. More... | |
Defines | |
#define | USB_CLASS_CDC 2 |
Class code for communications devices. | |
#define | CDC_SEND_ENCAPSULATED_COMMAND |
Send encapsulated command. | |
#define | CDC_GET_ENCAPSULATED_RESPONSE |
Get encapsulated response. | |
#define | CDC_SUBTYPE_UNION 6 |
Union functional descriptor subtype. | |
#define | CDC_SUBTYPE_ETHERNET 15 |
Ethernet descriptor subtype. | |
#define | CDC_RESPONSE_AVAILABLE |
Response available. | |
#define | CDC_NETWORK_CONNECTION |
Network connection notification. | |
#define | CDC_CONNECTION_SPEED_CHANGE |
Connection speed change notification. | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct cdc_union_descriptor * | cdc_union_descriptor (struct usb_configuration_descriptor *config, struct usb_interface_descriptor *interface) |
Locate CDC union functional descriptor. | |
static int | cdc_send_encapsulated_command (struct usb_device *usb, unsigned int interface, void *data, size_t len) |
Send encapsulated command. | |
static int | cdc_get_encapsulated_response (struct usb_device *usb, unsigned int interface, void *data, size_t len) |
Get encapsulated response. |
USB Communications Device Class (CDC)
Definition in file cdc.h.
#define USB_CLASS_CDC 2 |
Class code for communications devices.
Definition at line 15 of file cdc.h.
Referenced by usb_describe().
#define CDC_SEND_ENCAPSULATED_COMMAND |
( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ USB_REQUEST_TYPE ( 0x00 ) )
Send encapsulated command.
Definition at line 18 of file cdc.h.
Referenced by cdc_send_encapsulated_command().
#define CDC_GET_ENCAPSULATED_RESPONSE |
( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ USB_REQUEST_TYPE ( 0x01 ) )
Get encapsulated response.
Definition at line 23 of file cdc.h.
Referenced by cdc_get_encapsulated_response().
#define CDC_SUBTYPE_UNION 6 |
Union functional descriptor subtype.
Definition at line 38 of file cdc.h.
Referenced by cdc_union_descriptor().
#define CDC_SUBTYPE_ETHERNET 15 |
Ethernet descriptor subtype.
Definition at line 41 of file cdc.h.
Referenced by ecm_ethernet_descriptor().
#define CDC_RESPONSE_AVAILABLE |
( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ USB_REQUEST_TYPE ( 0x01 ) )
Response available.
Definition at line 44 of file cdc.h.
Referenced by acm_intr_complete().
#define CDC_NETWORK_CONNECTION |
( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ USB_REQUEST_TYPE ( 0x00 ) )
Network connection notification.
Definition at line 49 of file cdc.h.
Referenced by ecm_intr_complete(), and ncm_intr_complete().
#define CDC_CONNECTION_SPEED_CHANGE |
( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ USB_REQUEST_TYPE ( 0x2a ) )
Connection speed change notification.
Definition at line 54 of file cdc.h.
Referenced by ecm_intr_complete(), and ncm_intr_complete().
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct cdc_union_descriptor* cdc_union_descriptor | ( | struct usb_configuration_descriptor * | config, |
struct usb_interface_descriptor * | interface | ||
) | [read] |
Locate CDC union functional descriptor.
config | Configuration descriptor |
interface | Interface descriptor |
desc | Union functional descriptor, or NULL if not found |
Definition at line 44 of file cdc.c.
References CDC_SUBTYPE_UNION, for_each_interface_descriptor, cdc_union_descriptor::header, NULL, cdc_union_descriptor::subtype, usb_descriptor_header::type, and USB_CS_INTERFACE_DESCRIPTOR.
{ struct cdc_union_descriptor *desc; for_each_interface_descriptor ( desc, config, interface ) { if ( ( desc->header.type == USB_CS_INTERFACE_DESCRIPTOR ) && ( desc->subtype == CDC_SUBTYPE_UNION ) ) return desc; } return NULL; }
static int cdc_send_encapsulated_command | ( | struct usb_device * | usb, |
unsigned int | interface, | ||
void * | data, | ||
size_t | len | ||
) | [inline, static] |
Send encapsulated command.
usb | USB device |
interface | Interface number |
data | Command |
len | Length of command |
rc | Return status code |
Definition at line 80 of file cdc.h.
References CDC_SEND_ENCAPSULATED_COMMAND, and usb_control().
Referenced by acm_control_transmit().
{ return usb_control ( usb, CDC_SEND_ENCAPSULATED_COMMAND, 0, interface, data, len ); }
static int cdc_get_encapsulated_response | ( | struct usb_device * | usb, |
unsigned int | interface, | ||
void * | data, | ||
size_t | len | ||
) | [inline, static] |
Get encapsulated response.
usb | USB device |
interface | Interface number |
data | Response buffer |
len | Length of response buffer |
rc | Return status code |
Definition at line 97 of file cdc.h.
References CDC_GET_ENCAPSULATED_RESPONSE, and usb_control().
Referenced by acm_control_receive().
{ return usb_control ( usb, CDC_GET_ENCAPSULATED_RESPONSE, 0, interface, data, len ); }