support 3 usb ethernet: dm9620, ax8872b, sr9700

This commit is contained in:
胡卫国
2011-07-20 15:03:14 +08:00
committed by 杨云
parent bd03eb18b7
commit a01f37a6f2
4 changed files with 3165 additions and 1177 deletions

View File

@@ -196,13 +196,22 @@ config USB_NET_CDC_EEM
IEEE 802 "local assignment" bit is set in the address, a "usbX"
name is used instead.
config USB_NET_DM9601
tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices"
config USB_NET_DM9620
tristate "Davicom DM9620 based USB 1.1 10/100 ethernet devices"
depends on USB_USBNET
select CRC32
default y
help
This option adds support for Davicom DM9601 based USB 1.1
10/100 Ethernet adapters.
config USB_NET_SR9700
tristate "WilLing Electrnic SR9700 based USB 2.0"
depends on USB_USBNET
select CRC32
default y
help
This option adds support for Davicom SR9700 based USB 2.0
10/100 Ethernet adapters.
config USB_NET_SMSC95XX
tristate "SMSC LAN95XX based USB 2.0 10/100 ethernet devices"

View File

@@ -10,8 +10,8 @@ obj-$(CONFIG_USB_HSO) += hso.o
obj-$(CONFIG_USB_NET_AX8817X) += asix.o
obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o
obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o
obj-$(CONFIG_USB_NET_DM9601) += dm9601.o
obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95xx.o
obj-$(CONFIG_USB_NET_DM9620) += dm9620.o
obj-$(CONFIG_USB_NET_SR9700) += sr9700.o
obj-$(CONFIG_USB_NET_GL620A) += gl620a.o
obj-$(CONFIG_USB_NET_NET1080) += net1080.o
obj-$(CONFIG_USB_NET_PLUSB) += plusb.o

File diff suppressed because it is too large Load Diff

View File

@@ -325,13 +325,13 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
static const char ifname[] = "usbpn%d";
const struct usb_cdc_union_desc *union_header = NULL;
const struct usb_cdc_header_desc *phonet_header = NULL;
const struct usb_host_interface *data_desc;
struct usb_interface *data_intf;
struct usb_device *usbdev = interface_to_usbdev(intf);
struct net_device *dev;
struct usbpn_dev *pnd;
u8 *data;
int phonet = 0;
int len, err;
data = intf->altsetting->extra;
@@ -352,7 +352,10 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
(struct usb_cdc_union_desc *)data;
break;
case 0xAB:
phonet = 1;
if (phonet_header || dlen < 5)
break;
phonet_header =
(struct usb_cdc_header_desc *)data;
break;
}
}
@@ -360,7 +363,7 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
len -= dlen;
}
if (!union_header || !phonet)
if (!union_header || !phonet_header)
return -EINVAL;
data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0);