summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/ecm.h
diff options
context:
space:
mode:
authorMichael Brown2015-02-02 15:41:19 +0100
committerMichael Brown2015-02-03 13:33:35 +0100
commitcc5a27f9cbbc43c485c4eceab4bd091714be7505 (patch)
tree2285e53ea90ce4b9b3ad0d9a747e05f8562a0d8e /src/drivers/net/ecm.h
parent[usb] Add support for xHCI host controllers (diff)
downloadipxe-cc5a27f9cbbc43c485c4eceab4bd091714be7505.tar.gz
ipxe-cc5a27f9cbbc43c485c4eceab4bd091714be7505.tar.xz
ipxe-cc5a27f9cbbc43c485c4eceab4bd091714be7505.zip
[ncm] Add support for CDC-NCM USB Ethernet devices
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/ecm.h')
-rw-r--r--src/drivers/net/ecm.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/drivers/net/ecm.h b/src/drivers/net/ecm.h
new file mode 100644
index 00000000..e8ec3fb6
--- /dev/null
+++ b/src/drivers/net/ecm.h
@@ -0,0 +1,40 @@
+#ifndef _ECM_H
+#define _ECM_H
+
+/** @file
+ *
+ * CDC-ECM USB Ethernet driver
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <ipxe/usb.h>
+#include <ipxe/cdc.h>
+
+/** An Ethernet Functional Descriptor */
+struct ecm_ethernet_descriptor {
+ /** Descriptor header */
+ struct usb_descriptor_header header;
+ /** Descriptor subtype */
+ uint8_t subtype;
+ /** MAC addres string */
+ uint8_t mac;
+ /** Ethernet statistics bitmap */
+ uint32_t statistics;
+ /** Maximum segment size */
+ uint16_t mtu;
+ /** Multicast filter configuration */
+ uint16_t mcast;
+ /** Number of wake-on-LAN filters */
+ uint8_t wol;
+} __attribute__ (( packed ));
+
+extern struct ecm_ethernet_descriptor *
+ecm_ethernet_descriptor ( struct usb_configuration_descriptor *config,
+ struct usb_interface_descriptor *interface );
+extern int ecm_fetch_mac ( struct usb_device *usb,
+ struct ecm_ethernet_descriptor *desc,
+ uint8_t *hw_addr );
+
+#endif /* _ECM_H */