diff options
author | David Brownell <david-b@pacbell.net> | 2005-05-10 09:45:10 -0400 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-05-17 00:44:25 -0400 |
commit | 80615f81534109a22a732d0328d63ced4432824e (patch) | |
tree | dddfa2683508d40eb965841169d0ac21435c2cf2 /drivers/usb | |
parent | d3f0fcec2d50a18a84c4f3dd7683206ed37ca009 (diff) |
[PATCH] USB: usbnet driver fixes
Updates to the usbnet driver:
- Remove a warning when built with Zaurus support but not CDC Ethernet;
just moves an #ifdef to cover more code
- Two tweaks to the pseudo-MDLM support:
* correctly handle _either_ of the two GUIDs
* ignore a padding bit that doesn't seem necessary
- Remove ID for one Motorola phone that uses the MDLM stuff.
It also updates the Kconfig helptext to make it clearer that the "Zaurus"
configuration option supports an increasing (sigh) family of nonstandard
peripheral protocols.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/net/Kconfig | 14 | ||||
-rw-r--r-- | drivers/usb/net/usbnet.c | 53 |
2 files changed, 35 insertions, 32 deletions
diff --git a/drivers/usb/net/Kconfig b/drivers/usb/net/Kconfig index db64c908d4a7..b104430e2c6a 100644 --- a/drivers/usb/net/Kconfig +++ b/drivers/usb/net/Kconfig | |||
@@ -219,17 +219,21 @@ config USB_EPSON2888 | |||
219 | by some sample firmware from Epson. | 219 | by some sample firmware from Epson. |
220 | 220 | ||
221 | config USB_ZAURUS | 221 | config USB_ZAURUS |
222 | boolean "Sharp Zaurus (stock ROMs)" | 222 | boolean "Sharp Zaurus (stock ROMs) and compatible" |
223 | depends on USB_USBNET | 223 | depends on USB_USBNET |
224 | select CRC32 | 224 | select CRC32 |
225 | default y | 225 | default y |
226 | help | 226 | help |
227 | Choose this option to support the usb networking links used by | 227 | Choose this option to support the usb networking links used by |
228 | Zaurus models like the SL-5000D, SL-5500, SL-5600, A-300, B-500. | 228 | Zaurus models like the SL-5000D, SL-5500, SL-5600, A-300, B-500. |
229 | 229 | This also supports some related device firmware, as used in some | |
230 | If you install an alternate ROM image, you may no longer need | 230 | PDAs from Olympus and some cell phones from Motorola. |
231 | to support this protocol. Only the "eth-fd" driver really needs | 231 | |
232 | this non-conformant variant of CDC Ethernet protocol. | 232 | If you install an alternate ROM image, such as the Linux 2.6 based |
233 | versions of OpenZaurus, you should no longer need to support this | ||
234 | protocol. Only the "eth-fd" or "net_fd" drivers in these devices | ||
235 | really need this non-conformant variant of CDC Ethernet (or in | ||
236 | some cases CDC MDLM) protocol, not "g_ether". | ||
233 | 237 | ||
234 | config USB_CDCETHER | 238 | config USB_CDCETHER |
235 | boolean "CDC Ethernet support (smart devices such as cable modems)" | 239 | boolean "CDC Ethernet support (smart devices such as cable modems)" |
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index f6bc6b3b333c..85476e76b244 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c | |||
@@ -1517,6 +1517,26 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf) | |||
1517 | } | 1517 | } |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | #endif /* NEED_GENERIC_CDC */ | ||
1521 | |||
1522 | |||
1523 | #ifdef CONFIG_USB_CDCETHER | ||
1524 | #define HAVE_HARDWARE | ||
1525 | |||
1526 | /*------------------------------------------------------------------------- | ||
1527 | * | ||
1528 | * Communications Device Class, Ethernet Control model | ||
1529 | * | ||
1530 | * Takes two interfaces. The DATA interface is inactive till an altsetting | ||
1531 | * is selected. Configuration data includes class descriptors. | ||
1532 | * | ||
1533 | * This should interop with whatever the 2.4 "CDCEther.c" driver | ||
1534 | * (by Brad Hards) talked with. | ||
1535 | * | ||
1536 | *-------------------------------------------------------------------------*/ | ||
1537 | |||
1538 | #include <linux/ctype.h> | ||
1539 | |||
1520 | 1540 | ||
1521 | static void dumpspeed (struct usbnet *dev, __le32 *speeds) | 1541 | static void dumpspeed (struct usbnet *dev, __le32 *speeds) |
1522 | { | 1542 | { |
@@ -1567,26 +1587,6 @@ static void cdc_status (struct usbnet *dev, struct urb *urb) | |||
1567 | } | 1587 | } |
1568 | } | 1588 | } |
1569 | 1589 | ||
1570 | #endif /* NEED_GENERIC_CDC */ | ||
1571 | |||
1572 | |||
1573 | #ifdef CONFIG_USB_CDCETHER | ||
1574 | #define HAVE_HARDWARE | ||
1575 | |||
1576 | /*------------------------------------------------------------------------- | ||
1577 | * | ||
1578 | * Communications Device Class, Ethernet Control model | ||
1579 | * | ||
1580 | * Takes two interfaces. The DATA interface is inactive till an altsetting | ||
1581 | * is selected. Configuration data includes class descriptors. | ||
1582 | * | ||
1583 | * This should interop with whatever the 2.4 "CDCEther.c" driver | ||
1584 | * (by Brad Hards) talked with. | ||
1585 | * | ||
1586 | *-------------------------------------------------------------------------*/ | ||
1587 | |||
1588 | #include <linux/ctype.h> | ||
1589 | |||
1590 | static u8 nibble (unsigned char c) | 1590 | static u8 nibble (unsigned char c) |
1591 | { | 1591 | { |
1592 | if (likely (isdigit (c))) | 1592 | if (likely (isdigit (c))) |
@@ -2765,7 +2765,7 @@ static int blan_mdlm_bind (struct usbnet *dev, struct usb_interface *intf) | |||
2765 | } | 2765 | } |
2766 | /* expect bcdVersion 1.0, ignore */ | 2766 | /* expect bcdVersion 1.0, ignore */ |
2767 | if (memcmp(&desc->bGUID, blan_guid, 16) | 2767 | if (memcmp(&desc->bGUID, blan_guid, 16) |
2768 | || memcmp(&desc->bGUID, blan_guid, 16) ) { | 2768 | && memcmp(&desc->bGUID, blan_guid, 16) ) { |
2769 | /* hey, this one might _really_ be MDLM! */ | 2769 | /* hey, this one might _really_ be MDLM! */ |
2770 | dev_dbg (&intf->dev, "MDLM guid\n"); | 2770 | dev_dbg (&intf->dev, "MDLM guid\n"); |
2771 | goto bad_desc; | 2771 | goto bad_desc; |
@@ -2797,11 +2797,13 @@ static int blan_mdlm_bind (struct usbnet *dev, struct usb_interface *intf) | |||
2797 | * - bPad (ignored, for PADAFTER -- BLAN-only) | 2797 | * - bPad (ignored, for PADAFTER -- BLAN-only) |
2798 | * bits are: | 2798 | * bits are: |
2799 | * - 0x01 -- Zaurus framing (add CRC) | 2799 | * - 0x01 -- Zaurus framing (add CRC) |
2800 | * - 0x02 -- PADBEFORE | 2800 | * - 0x02 -- PADBEFORE (CRC includes some padding) |
2801 | * - 0x04 -- PADAFTER | 2801 | * - 0x04 -- PADAFTER (some padding after CRC) |
2802 | * - 0x08 -- "fermat" packet mangling (for hw bugs) | 2802 | * - 0x08 -- "fermat" packet mangling (for hw bugs) |
2803 | * the PADBEFORE appears not to matter; we interop | ||
2804 | * with devices that use it and those that don't. | ||
2803 | */ | 2805 | */ |
2804 | if (detail->bDetailData[1] != 0x01) { | 2806 | if ((detail->bDetailData[1] & ~02) != 0x01) { |
2805 | /* bmDataCapabilites == 0 would be fine too, | 2807 | /* bmDataCapabilites == 0 would be fine too, |
2806 | * but framing is minidriver-coupled for now. | 2808 | * but framing is minidriver-coupled for now. |
2807 | */ | 2809 | */ |
@@ -4071,9 +4073,6 @@ static const struct usb_device_id products [] = { | |||
4071 | USB_DEVICE (0x8086, 0x07d3), // "blob" bootloader | 4073 | USB_DEVICE (0x8086, 0x07d3), // "blob" bootloader |
4072 | .driver_info = (unsigned long) &blob_info, | 4074 | .driver_info = (unsigned long) &blob_info, |
4073 | }, { | 4075 | }, { |
4074 | USB_DEVICE (0x22b8, 0x600c), // USBNET Motorola E680 | ||
4075 | .driver_info = (unsigned long) &linuxdev_info, | ||
4076 | }, { | ||
4077 | // Linux Ethernet/RNDIS gadget on pxa210/25x/26x | 4076 | // Linux Ethernet/RNDIS gadget on pxa210/25x/26x |
4078 | // e.g. Gumstix, current OpenZaurus, ... | 4077 | // e.g. Gumstix, current OpenZaurus, ... |
4079 | USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203), | 4078 | USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203), |