On Tuesday 10 May 2005 6:15 am, Andrea Arcangeli wrote: > On Sat, May 07, 2005 at 02:04:45PM -0700, David Brownell wrote: > > The attached patch should go against current Linus BK. > > ... > > It works fine here, even without the id.
Good, thanks for confirming! Greg, this patch would be good to get into 2.6.12-final ... since it makes that pseudo-MDLM class work for more devices (including some Zaurii that were broken by the blacklist fix). > usb 5-1.1: new full speed USB device using ehci_hcd and address 23 > usb0: register usbnet at usb-0001:02:0b.2-1.1, pseudo-MDLM (BLAN) > device, 86:f8:80:1c:95:4c > usbcore: registered new driver usbnet > > > So if I understand correctly to connect to the e680 now one needs to > setup CONFIG_USB_ZAURUS, right? Yes, because its firmware is an evolution of the Zaurus firmware. None of it actually conforms to the standards it claims to support. What most folk do is just enable all the "usbnet" config options. But for folk that don't do that, this version of the patch updates some Kconfig descriptions to make this a bit more clear. - Dave
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 <[EMAIL PROTECTED]> --- 1.24/drivers/usb/net/Kconfig 2005-03-09 12:18:40 -08:00 +++ edited/drivers/usb/net/Kconfig 2005-05-10 06:36:49 -07:00 @@ -219,17 +219,21 @@ by some sample firmware from Epson. config USB_ZAURUS - boolean "Sharp Zaurus (stock ROMs)" + boolean "Sharp Zaurus (stock ROMs) and compatible" depends on USB_USBNET select CRC32 default y help Choose this option to support the usb networking links used by Zaurus models like the SL-5000D, SL-5500, SL-5600, A-300, B-500. + This also supports some related device firmware, as used in some + PDAs from Olympus and some cell phones from Motorola. - If you install an alternate ROM image, you may no longer need - to support this protocol. Only the "eth-fd" driver really needs - this non-conformant variant of CDC Ethernet protocol. + If you install an alternate ROM image, such as the Linux 2.6 based + versions of OpenZaurus, you should no longer need to support this + protocol. Only the "eth-fd" or "net_fd" drivers in these devices + really need this non-conformant variant of CDC Ethernet (or in + some cases CDC MDLM) protocol, not "g_ether". config USB_CDCETHER boolean "CDC Ethernet support (smart devices such as cable modems)" --- x/drivers/usb/net/usbnet.c 2005-05-04 23:03:13.000000000 -0700 +++ gadget-2.6/drivers/usb/net/usbnet.c 2005-05-06 09:14:07.000000000 -0700 @@ -1517,6 +1517,26 @@ } } +#endif /* NEED_GENERIC_CDC */ + + +#ifdef CONFIG_USB_CDCETHER +#define HAVE_HARDWARE + +/*------------------------------------------------------------------------- + * + * Communications Device Class, Ethernet Control model + * + * Takes two interfaces. The DATA interface is inactive till an altsetting + * is selected. Configuration data includes class descriptors. + * + * This should interop with whatever the 2.4 "CDCEther.c" driver + * (by Brad Hards) talked with. + * + *-------------------------------------------------------------------------*/ + +#include <linux/ctype.h> + static void dumpspeed (struct usbnet *dev, __le32 *speeds) { @@ -1567,26 +1587,6 @@ } } -#endif /* NEED_GENERIC_CDC */ - - -#ifdef CONFIG_USB_CDCETHER -#define HAVE_HARDWARE - -/*------------------------------------------------------------------------- - * - * Communications Device Class, Ethernet Control model - * - * Takes two interfaces. The DATA interface is inactive till an altsetting - * is selected. Configuration data includes class descriptors. - * - * This should interop with whatever the 2.4 "CDCEther.c" driver - * (by Brad Hards) talked with. - * - *-------------------------------------------------------------------------*/ - -#include <linux/ctype.h> - static u8 nibble (unsigned char c) { if (likely (isdigit (c))) @@ -2765,7 +2765,7 @@ } /* expect bcdVersion 1.0, ignore */ if (memcmp(&desc->bGUID, blan_guid, 16) - || memcmp(&desc->bGUID, blan_guid, 16) ) { + && memcmp(&desc->bGUID, blan_guid, 16) ) { /* hey, this one might _really_ be MDLM! */ dev_dbg (&intf->dev, "MDLM guid\n"); goto bad_desc; @@ -2797,11 +2797,13 @@ * - bPad (ignored, for PADAFTER -- BLAN-only) * bits are: * - 0x01 -- Zaurus framing (add CRC) - * - 0x02 -- PADBEFORE - * - 0x04 -- PADAFTER + * - 0x02 -- PADBEFORE (CRC includes some padding) + * - 0x04 -- PADAFTER (some padding after CRC) * - 0x08 -- "fermat" packet mangling (for hw bugs) + * the PADBEFORE appears not to matter; we interop + * with devices that use it and those that don't. */ - if (detail->bDetailData[1] != 0x01) { + if ((detail->bDetailData[1] & ~02) != 0x01) { /* bmDataCapabilites == 0 would be fine too, * but framing is minidriver-coupled for now. */ @@ -4071,9 +4073,6 @@ USB_DEVICE (0x8086, 0x07d3), // "blob" bootloader .driver_info = (unsigned long) &blob_info, }, { - USB_DEVICE (0x22b8, 0x600c), // USBNET Motorola E680 - .driver_info = (unsigned long) &linuxdev_info, -}, { // Linux Ethernet/RNDIS gadget on pxa210/25x/26x // e.g. Gumstix, current OpenZaurus, ... USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203),