aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/cdc.h49
-rw-r--r--src/include/ipxe/errfile.h1
2 files changed, 50 insertions, 0 deletions
diff --git a/src/include/ipxe/cdc.h b/src/include/ipxe/cdc.h
index f1799cd9a..b8b4a59d9 100644
--- a/src/include/ipxe/cdc.h
+++ b/src/include/ipxe/cdc.h
@@ -14,6 +14,16 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/** Class code for communications devices */
#define USB_CLASS_CDC 2
+/** Send encapsulated command */
+#define CDC_SEND_ENCAPSULATED_COMMAND \
+ ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
+ USB_REQUEST_TYPE ( 0x00 ) )
+
+/** Get encapsulated response */
+#define CDC_GET_ENCAPSULATED_RESPONSE \
+ ( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
+ USB_REQUEST_TYPE ( 0x01 ) )
+
/** Union functional descriptor */
struct cdc_union_descriptor {
/** Descriptor header */
@@ -30,6 +40,11 @@ struct cdc_union_descriptor {
/** Ethernet descriptor subtype */
#define CDC_SUBTYPE_ETHERNET 15
+/** Response available */
+#define CDC_RESPONSE_AVAILABLE \
+ ( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
+ USB_REQUEST_TYPE ( 0x01 ) )
+
/** Network connection notification */
#define CDC_NETWORK_CONNECTION \
( USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
@@ -52,4 +67,38 @@ extern struct cdc_union_descriptor *
cdc_union_descriptor ( struct usb_configuration_descriptor *config,
struct usb_interface_descriptor *interface );
+/**
+ * Send encapsulated command
+ *
+ * @v usb USB device
+ * @v interface Interface number
+ * @v data Command
+ * @v len Length of command
+ * @ret rc Return status code
+ */
+static inline __attribute__ (( always_inline )) int
+cdc_send_encapsulated_command ( struct usb_device *usb, unsigned int interface,
+ void *data, size_t len ) {
+
+ return usb_control ( usb, CDC_SEND_ENCAPSULATED_COMMAND, 0, interface,
+ data, len );
+}
+
+/**
+* Get encapsulated response
+*
+* @v usb USB device
+* @v interface Interface number
+* @v data Response buffer
+* @v len Length of response buffer
+* @ret rc Return status code
+*/
+static inline __attribute__ (( always_inline )) int
+cdc_get_encapsulated_response ( struct usb_device *usb, unsigned int interface,
+ void *data, size_t len ) {
+
+ return usb_control ( usb, CDC_GET_ENCAPSULATED_RESPONSE, 0, interface,
+ data, len );
+}
+
#endif /* _IPXE_CDC_H */
diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h
index 413fa46f9..65b4d9c91 100644
--- a/src/include/ipxe/errfile.h
+++ b/src/include/ipxe/errfile.h
@@ -184,6 +184,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_intelvf ( ERRFILE_DRIVER | 0x00780000 )
#define ERRFILE_intelxvf ( ERRFILE_DRIVER | 0x00790000 )
#define ERRFILE_smsc95xx ( ERRFILE_DRIVER | 0x007a0000 )
+#define ERRFILE_acm ( ERRFILE_DRIVER | 0x007b0000 )
#define ERRFILE_aoe ( ERRFILE_NET | 0x00000000 )
#define ERRFILE_arp ( ERRFILE_NET | 0x00010000 )