[ecm] Use generic USB network device framework

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-02-16 14:06:27 +00:00
parent a92fb8d9a5
commit 5b9b5ced4e
2 changed files with 35 additions and 211 deletions

View File

@@ -10,23 +10,12 @@
FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/usb.h>
#include <ipxe/usbnet.h>
#include <ipxe/cdc.h>
/** CDC-ECM subclass */
#define USB_SUBCLASS_CDC_ECM 0x06
/** CDC-ECM interfaces */
enum ecm_interfaces {
/** Communications interface */
ECM_INTERFACE_COMMS = 0,
/** Data interface */
ECM_INTERFACE_DATA,
ECM_INTERFACE_COUNT
};
/** Alternate setting for CDC-ECM data interface */
#define ECM_DATA_ALTERNATE 1
/** Set Ethernet packet filter */
#define ECM_SET_ETHERNET_PACKET_FILTER \
( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
@@ -72,18 +61,8 @@ struct ecm_device {
struct usb_bus *bus;
/** Network device */
struct net_device *netdev;
/** Communications interface */
unsigned int comms;
/** Data interface */
unsigned int data;
/** Interrupt endpoint */
struct usb_endpoint intr;
/** Bulk IN endpoint */
struct usb_endpoint in;
/** Bulk OUT endpoint */
struct usb_endpoint out;
/** USB network device */
struct usbnet_device usbnet;
};
/** Interrupt maximum fill level