Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/usb/net/Kconfig  |  125 +++++++++--------
 drivers/usb/net/Makefile |    1 
 drivers/usb/net/simple.c |  329 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/net/usbnet.c |  240 +---------------------------------
 drivers/usb/net/usbnet.h |    9 +
 5 files changed, 417 insertions(+), 287 deletions(-)

diff -puN drivers/usb/net/Kconfig~gregkh-usb-usb-usbnet-02 drivers/usb/net/Kconfig
--- devel/drivers/usb/net/Kconfig~gregkh-usb-usb-usbnet-02	2005-09-07 20:10:19.000000000 -0700
+++ devel-akpm/drivers/usb/net/Kconfig	2005-09-07 20:10:19.000000000 -0700
@@ -128,32 +128,6 @@ config USB_USBNET
 comment "USB Host-to-Host Cables"
 	depends on USB_USBNET
 
-config USB_ALI_M5632
-	boolean "ALi M5632 based 'USB 2.0 Data Link' cables"
-	depends on USB_USBNET
-	default y
-	help
-	  Choose this option if you're using a host-to-host cable
-	  based on this design, which supports USB 2.0 high speed.
-
-config USB_AN2720
-	boolean "AnchorChips 2720 based cables (Xircom PGUNET, ...)"
-	depends on USB_USBNET
-	default y
-	help
-	  Choose this option if you're using a host-to-host cable
-	  based on this design.  Note that AnchorChips is now a
-	  Cypress brand.
-
-config USB_BELKIN
-	boolean "eTEK based host-to-host cables (Advance, Belkin, ...)"
-	depends on USB_USBNET
-	default y
-	help
-	  Choose this option if you're using a host-to-host cable
-	  based on this design:  two NetChip 2890 chips and an Atmel
-	  microcontroller, with LEDs that indicate traffic.
-
 config USB_GENESYS
 	boolean "GeneSys GL620USB-A based cables"
 	default y
@@ -182,42 +156,9 @@ config USB_PL2301
 	  Choose this option if you're using a host-to-host cable
 	  with one of these chips.
 
-config USB_KC2190
-	boolean "KT Technology KC2190 based cables (InstaNet)"
-	default y
-	depends on USB_USBNET && EXPERIMENTAL
-	help
-	  Choose this option if you're using a host-to-host cable
-	  with one of these chips.
-
 comment "Intelligent USB Devices/Gadgets"
 	depends on USB_USBNET
 
-config USB_ARMLINUX
-	boolean "Embedded ARM Linux links (iPaq, ...)"
-	depends on USB_USBNET
-	default y
-	help
-	  Choose this option to support the "usb-eth" networking driver
-	  used by most of the ARM Linux community with device controllers
-	  such as the SA-11x0 and PXA-25x UDCs, or the tftp capabilities
-	  in some PXA versions of the "blob" boot loader.
-
-	  Linux-based "Gumstix" PXA-25x based systems use this protocol
-	  to talk with other Linux systems.
-
-	  Although the ROMs shipped with Sharp Zaurus products use a
-	  different link level framing protocol, you can have them use
-	  this simpler protocol by installing a different kernel.
-
-config USB_EPSON2888
-	boolean "Epson 2888 based firmware (DEVELOPMENT)"
-	depends on USB_USBNET
-	default y
-	help
-	  Choose this option to support the usb networking links used
-	  by some sample firmware from Epson.
-
 config USB_ZAURUS
 	boolean "Sharp Zaurus (stock ROMs) and compatible"
 	depends on USB_USBNET
@@ -292,6 +233,72 @@ config USB_AX8817X
 	  This driver creates an interface named "ethX", where X depends on
 	  what other networking devices you have in use.  
 
+
+config USB_NET_SIMPLE
+	tristate "Simple USB Network Links"
+	depends on USB_USBNET
+	help
+	  This driver module supports USB network devices that can work
+	  without any device-specific information.  Select it if you have
+	  one of these drivers.
+
+	  Note that while many USB host-to-host cables can work in this mode,
+	  that may mean not being able to talk to Win32 systems or more
+	  commonly not being able to handle certain (like replugging the
+	  host on the other end) very well.
+
+config USB_ALI_M5632
+	boolean "ALi M5632 based 'USB 2.0 Data Link' cables"
+	depends on USB_NET_SIMPLE
+	default y
+	help
+	  Choose this option if you're using a host-to-host cable
+	  based on this design, which supports USB 2.0 high speed.
+
+config USB_AN2720
+	boolean "AnchorChips 2720 based cables (Xircom PGUNET, ...)"
+	depends on USB_NET_SIMPLE
+	default y
+	help
+	  Choose this option if you're using a host-to-host cable
+	  based on this design.  Note that AnchorChips is now a
+	  Cypress brand.
+
+config USB_BELKIN
+	boolean "eTEK based host-to-host cables (Advance, Belkin, ...)"
+	depends on USB_NET_SIMPLE
+	default y
+	help
+	  Choose this option if you're using a host-to-host cable
+	  based on this design:  two NetChip 2890 chips and an Atmel
+	  microcontroller, with LEDs that indicate traffic.
+
+config USB_ARMLINUX
+	boolean "Embedded ARM Linux links (iPaq, ...)"
+	depends on USB_NET_SIMPLE
+	default y
+	help
+	  Choose this option to support the "usb-eth" networking driver
+	  used by most of the ARM Linux community with device controllers
+	  such as the SA-11x0 and PXA-25x UDCs, or the tftp capabilities
+	  in some PXA versions of the "blob" boot loader.
+
+	  Linux-based "Gumstix" PXA-25x based systems use this protocol
+	  to talk with other Linux systems.
+
+	  Although the ROMs shipped with Sharp Zaurus products use a
+	  different link level framing protocol, you can have them use
+	  this simpler protocol by installing a different kernel.
+
+config USB_EPSON2888
+	boolean "Epson 2888 based firmware (DEVELOPMENT)"
+	depends on USB_NET_SIMPLE
+	default y
+	help
+	  Choose this option to support the usb networking links used
+	  by some sample firmware from Epson.
+
+
 config USB_ZD1201
 	tristate "USB ZD1201 based Wireless device support"
 	depends on NET_RADIO
diff -puN drivers/usb/net/Makefile~gregkh-usb-usb-usbnet-02 drivers/usb/net/Makefile
--- devel/drivers/usb/net/Makefile~gregkh-usb-usb-usbnet-02	2005-09-07 20:10:19.000000000 -0700
+++ devel-akpm/drivers/usb/net/Makefile	2005-09-07 20:10:19.000000000 -0700
@@ -6,5 +6,6 @@ obj-$(CONFIG_USB_CATC)		+= catc.o
 obj-$(CONFIG_USB_KAWETH)	+= kaweth.o
 obj-$(CONFIG_USB_PEGASUS)	+= pegasus.o
 obj-$(CONFIG_USB_RTL8150)	+= rtl8150.o
+obj-$(CONFIG_USB_NET_SIMPLE)	+= simple.o
 obj-$(CONFIG_USB_USBNET)	+= usbnet.o
 obj-$(CONFIG_USB_ZD1201)	+= zd1201.o
diff -puN /dev/null drivers/usb/net/simple.c
--- /dev/null	2003-09-15 06:40:47.000000000 -0700
+++ devel-akpm/drivers/usb/net/simple.c	2005-09-07 20:10:19.000000000 -0700
@@ -0,0 +1,329 @@
+/*
+ * Simple "CDC Subset" USB Networking Links
+ * Copyright (C) 2000-2005 by David Brownell
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/config.h>
+#ifdef	CONFIG_USB_DEBUG
+#   define DEBUG
+#endif
+#include <linux/module.h>
+#include <linux/kmod.h>
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
+#include <linux/workqueue.h>
+#include <linux/mii.h>
+#include <linux/usb.h>
+
+#include "usbnet.h"
+
+
+/*
+ * This supports simple USB network links that don't require any special
+ * framing hardware control operations.  The protocol used here is a
+ * strict subset of CDC Ethernet, with two basic differences:
+ *
+ *  - Minimal control model:  one interface, no altsettings, and
+ *    no vendor or class specific control requests.  If a device is
+ *    configured, it is allowed to exchange packets with the host.
+ *    Fancier models would mean not working on some hardware.
+ *
+ *  - There is no additional framing data for USB.  Packets are written
+ *    exactly as in CDC Ethernet, starting with an Ethernet header and
+ *    terminated by a short packet.  The host will never send a zero
+ *    length packet; they can't be reliably sent.
+ *
+ * Anything that can transmit and receive USB bulk packets can implement
+ * this protocol.  That includes both smart peripherals and quite a lot
+ * of "host-to-host" USB links.
+ *
+ * Note that although Linux may use many of those host-to-host links
+ * with this "simple" framing, that doesn't mean there may not be a
+ * better approach.  Handling the "other end unplugs/replugs" scenario
+ * tends require chip-specific vendor requests.
+ *
+ * Also, Windows peers at the other end of host-to-host cables may expect
+ * their own framing to be used rather than this "simple" model.
+ */
+
+#if defined(CONFIG_USB_EPSON2888) || defined(CONFIG_USB_ARMLINUX)
+/* PDA style devices are always connected if present */
+static int always_connected (struct usbnet *dev)
+{
+	return 0;
+}
+#endif
+
+#ifdef	CONFIG_USB_ALI_M5632
+#define	HAVE_HARDWARE
+
+/*-------------------------------------------------------------------------
+ *
+ * ALi M5632 driver ... does high speed
+ *
+ *-------------------------------------------------------------------------*/
+
+static const struct driver_info	ali_m5632_info = {
+	.description =	"ALi M5632",
+};
+
+
+#endif
+
+
+#ifdef	CONFIG_USB_AN2720
+#define	HAVE_HARDWARE
+
+/*-------------------------------------------------------------------------
+ *
+ * AnchorChips 2720 driver ... http://www.cypress.com
+ *
+ * This doesn't seem to have a way to detect whether the peer is
+ * connected, or need any reset handshaking.  It's got pretty big
+ * internal buffers (handles most of a frame's worth of data).
+ * Chip data sheets don't describe any vendor control messages.
+ *
+ *-------------------------------------------------------------------------*/
+
+static const struct driver_info	an2720_info = {
+	.description =	"AnchorChips/Cypress 2720",
+	// no reset available!
+	// no check_connect available!
+
+	.in = 2, .out = 2,		// direction distinguishes these
+};
+
+#endif	/* CONFIG_USB_AN2720 */
+
+
+#ifdef	CONFIG_USB_BELKIN
+#define	HAVE_HARDWARE
+
+/*-------------------------------------------------------------------------
+ *
+ * Belkin F5U104 ... two NetChip 2280 devices + Atmel microcontroller
+ *
+ * ... also two eTEK designs, including one sold as "Advance USBNET"
+ *
+ *-------------------------------------------------------------------------*/
+
+static const struct driver_info	belkin_info = {
+	.description =	"Belkin, eTEK, or compatible",
+};
+
+#endif	/* CONFIG_USB_BELKIN */
+
+
+
+#ifdef	CONFIG_USB_EPSON2888
+#define	HAVE_HARDWARE
+
+/*-------------------------------------------------------------------------
+ *
+ * EPSON USB clients
+ *
+ * This is the same idea as Linux PDAs (below) except the firmware in the
+ * device might not be Tux-powered.  Epson provides reference firmware that
+ * implements this interface.  Product developers can reuse or modify that
+ * code, such as by using their own product and vendor codes.
+ *
+ * Support was from Juro Bystricky <bystricky.juro@erd.epson.com>
+ *
+ *-------------------------------------------------------------------------*/
+
+static const struct driver_info	epson2888_info = {
+	.description =	"Epson USB Device",
+	.check_connect = always_connected,
+
+	.in = 4, .out = 3,
+};
+
+#endif	/* CONFIG_USB_EPSON2888 */
+
+
+#ifdef CONFIG_USB_KC2190
+#define HAVE_HARDWARE
+static const struct driver_info kc2190_info = {
+	.description =  "KC Technology KC-190",
+};
+#endif /* CONFIG_USB_KC2190 */
+
+
+#ifdef	CONFIG_USB_ARMLINUX
+#define	HAVE_HARDWARE
+
+/*-------------------------------------------------------------------------
+ *
+ * Intel's SA-1100 chip integrates basic USB support, and is used
+ * in PDAs like some iPaqs, the Yopy, some Zaurus models, and more.
+ * When they run Linux, arch/arm/mach-sa1100/usb-eth.c may be used to
+ * network using minimal USB framing data.
+ *
+ * This describes the driver currently in standard ARM Linux kernels.
+ * The Zaurus uses a different driver (see later).
+ *
+ * PXA25x and PXA210 use XScale cores (ARM v5TE) with better USB support
+ * and different USB endpoint numbering than the SA1100 devices.  The
+ * mach-pxa/usb-eth.c driver re-uses the device ids from mach-sa1100
+ * so we rely on the endpoint descriptors.
+ *
+ *-------------------------------------------------------------------------*/
+
+static const struct driver_info	linuxdev_info = {
+	.description =	"Linux Device",
+	.check_connect = always_connected,
+};
+
+static const struct driver_info	yopy_info = {
+	.description =	"Yopy",
+	.check_connect = always_connected,
+};
+
+static const struct driver_info	blob_info = {
+	.description =	"Boot Loader OBject",
+	.check_connect = always_connected,
+};
+
+#endif	/* CONFIG_USB_ARMLINUX */
+
+
+/*-------------------------------------------------------------------------*/
+
+#ifndef	HAVE_HARDWARE
+#error You need to configure some hardware for this driver
+#endif
+
+/*
+ * chip vendor names won't normally be on the cables, and
+ * may not be on the device.
+ */
+
+static const struct usb_device_id	products [] = {
+
+#ifdef	CONFIG_USB_ALI_M5632
+{
+	USB_DEVICE (0x0402, 0x5632),	// ALi defaults
+	.driver_info =	(unsigned long) &ali_m5632_info,
+},
+#endif
+
+#ifdef	CONFIG_USB_AN2720
+{
+	USB_DEVICE (0x0547, 0x2720),	// AnchorChips defaults
+	.driver_info =	(unsigned long) &an2720_info,
+}, {
+	USB_DEVICE (0x0547, 0x2727),	// Xircom PGUNET
+	.driver_info =	(unsigned long) &an2720_info,
+},
+#endif
+
+#ifdef	CONFIG_USB_BELKIN
+{
+	USB_DEVICE (0x050d, 0x0004),	// Belkin
+	.driver_info =	(unsigned long) &belkin_info,
+}, {
+	USB_DEVICE (0x056c, 0x8100),	// eTEK
+	.driver_info =	(unsigned long) &belkin_info,
+}, {
+	USB_DEVICE (0x0525, 0x9901),	// Advance USBNET (eTEK)
+	.driver_info =	(unsigned long) &belkin_info,
+},
+#endif
+
+#ifdef	CONFIG_USB_EPSON2888
+{
+	USB_DEVICE (0x0525, 0x2888),	// EPSON USB client
+	.driver_info	= (unsigned long) &epson2888_info,
+},
+#endif
+
+#ifdef CONFIG_USB_KC2190
+{
+	USB_DEVICE (0x050f, 0x0190),	// KC-190
+	.driver_info =	(unsigned long) &kc2190_info,
+},
+#endif
+
+#ifdef	CONFIG_USB_ARMLINUX
+/*
+ * SA-1100 using standard ARM Linux kernels, or compatible.
+ * Often used when talking to Linux PDAs (iPaq, Yopy, etc).
+ * The sa-1100 "usb-eth" driver handles the basic framing.
+ *
+ * PXA25x or PXA210 ...  these use a "usb-eth" driver much like
+ * the sa1100 one, but hardware uses different endpoint numbers.
+ *
+ * Or the Linux "Ethernet" gadget on hardware that can't talk
+ * CDC Ethernet (e.g., no altsettings), in either of two modes:
+ *  - acting just like the old "usb-eth" firmware, though
+ *    the implementation is different
+ *  - supporting RNDIS as the first/default configuration for
+ *    MS-Windows interop; Linux needs to use the other config
+ */
+{
+	// 1183 = 0x049F, both used as hex values?
+	// Compaq "Itsy" vendor/product id
+	USB_DEVICE (0x049F, 0x505A),	// usb-eth, or compatible
+	.driver_info =	(unsigned long) &linuxdev_info,
+}, {
+	USB_DEVICE (0x0E7E, 0x1001),	// G.Mate "Yopy"
+	.driver_info =	(unsigned long) &yopy_info,
+}, {
+	USB_DEVICE (0x8086, 0x07d3),	// "blob" bootloader
+	.driver_info =	(unsigned long) &blob_info,
+}, {
+	// Linux Ethernet/RNDIS gadget on pxa210/25x/26x
+	// e.g. Gumstix, current OpenZaurus, ...
+	USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203),
+	.driver_info =	(unsigned long) &linuxdev_info,
+},
+#endif
+
+	{ },		// END
+};
+MODULE_DEVICE_TABLE(usb, products);
+
+/*-------------------------------------------------------------------------*/
+
+static struct usb_driver simple_driver = {
+	.owner =	THIS_MODULE,
+	.name =		"simple",
+	.probe =	usbnet_probe,
+	.suspend =	usbnet_suspend,
+	.resume =	usbnet_resume,
+	.disconnect =	usbnet_disconnect,
+	.id_table =	products,
+};
+
+static int __init simple_init(void)
+{
+ 	return usb_register(&simple_driver);
+}
+module_init(simple_init);
+
+static void __exit simple_exit(void)
+{
+ 	usb_deregister(&simple_driver);
+}
+module_exit(simple_exit);
+
+MODULE_AUTHOR("David Brownell");
+MODULE_DESCRIPTION("Simple USB networking links");
+MODULE_LICENSE("GPL");
diff -puN drivers/usb/net/usbnet.c~gregkh-usb-usb-usbnet-02 drivers/usb/net/usbnet.c
--- devel/drivers/usb/net/usbnet.c~gregkh-usb-usb-usbnet-02	2005-09-07 20:10:19.000000000 -0700
+++ devel-akpm/drivers/usb/net/usbnet.c	2005-09-07 20:10:19.000000000 -0700
@@ -318,48 +318,6 @@ static void skb_return (struct usbnet *d
 }
 
 
-#ifdef	CONFIG_USB_ALI_M5632
-#define	HAVE_HARDWARE
-
-/*-------------------------------------------------------------------------
- *
- * ALi M5632 driver ... does high speed
- *
- *-------------------------------------------------------------------------*/
-
-static const struct driver_info	ali_m5632_info = {
-	.description =	"ALi M5632",
-};
-
-
-#endif
-
-
-#ifdef	CONFIG_USB_AN2720
-#define	HAVE_HARDWARE
-
-/*-------------------------------------------------------------------------
- *
- * AnchorChips 2720 driver ... http://www.cypress.com
- *
- * This doesn't seem to have a way to detect whether the peer is
- * connected, or need any reset handshaking.  It's got pretty big
- * internal buffers (handles most of a frame's worth of data).
- * Chip data sheets don't describe any vendor control messages.
- *
- *-------------------------------------------------------------------------*/
-
-static const struct driver_info	an2720_info = {
-	.description =	"AnchorChips/Cypress 2720",
-	// no reset available!
-	// no check_connect available!
-
-	.in = 2, .out = 2,		// direction distinguishes these
-};
-
-#endif	/* CONFIG_USB_AN2720 */
-
-
 #ifdef CONFIG_USB_AX8817X
 /* ASIX AX8817X based USB 2.0 Ethernet Devices */
 
@@ -1138,25 +1096,6 @@ static const struct driver_info ax88772_
 
 
 
-#ifdef	CONFIG_USB_BELKIN
-#define	HAVE_HARDWARE
-
-/*-------------------------------------------------------------------------
- *
- * Belkin F5U104 ... two NetChip 2280 devices + Atmel microcontroller
- *
- * ... also two eTEK designs, including one sold as "Advance USBNET"
- *
- *-------------------------------------------------------------------------*/
-
-static const struct driver_info	belkin_info = {
-	.description =	"Belkin, eTEK, or compatible",
-};
-
-#endif	/* CONFIG_USB_BELKIN */
-
-
-
 /*-------------------------------------------------------------------------
  *
  * Communications Device Class declarations.
@@ -1534,32 +1473,6 @@ static const struct driver_info	cdc_info
 
 
 
-#ifdef	CONFIG_USB_EPSON2888
-#define	HAVE_HARDWARE
-
-/*-------------------------------------------------------------------------
- *
- * EPSON USB clients
- *
- * This is the same idea as Linux PDAs (below) except the firmware in the
- * device might not be Tux-powered.  Epson provides reference firmware that
- * implements this interface.  Product developers can reuse or modify that
- * code, such as by using their own product and vendor codes.
- *
- * Support was from Juro Bystricky <bystricky.juro@erd.epson.com>
- *
- *-------------------------------------------------------------------------*/
-
-static const struct driver_info	epson2888_info = {
-	.description =	"Epson USB Device",
-	.check_connect = always_connected,
-
-	.in = 4, .out = 3,
-};
-
-#endif	/* CONFIG_USB_EPSON2888 */
-
-
 #ifdef CONFIG_USB_GENESYS
 #define	HAVE_HARDWARE
 
@@ -2491,52 +2404,6 @@ static const struct driver_info	prolific
 #endif /* CONFIG_USB_PL2301 */
 
 
-#ifdef CONFIG_USB_KC2190
-#define HAVE_HARDWARE
-static const struct driver_info kc2190_info = {
-	.description =  "KC Technology KC-190",
-};
-#endif /* CONFIG_USB_KC2190 */
-
-
-#ifdef	CONFIG_USB_ARMLINUX
-#define	HAVE_HARDWARE
-
-/*-------------------------------------------------------------------------
- *
- * Intel's SA-1100 chip integrates basic USB support, and is used
- * in PDAs like some iPaqs, the Yopy, some Zaurus models, and more.
- * When they run Linux, arch/arm/mach-sa1100/usb-eth.c may be used to
- * network using minimal USB framing data.
- *
- * This describes the driver currently in standard ARM Linux kernels.
- * The Zaurus uses a different driver (see later).
- *
- * PXA25x and PXA210 use XScale cores (ARM v5TE) with better USB support
- * and different USB endpoint numbering than the SA1100 devices.  The
- * mach-pxa/usb-eth.c driver re-uses the device ids from mach-sa1100
- * so we rely on the endpoint descriptors.
- *
- *-------------------------------------------------------------------------*/
-
-static const struct driver_info	linuxdev_info = {
-	.description =	"Linux Device",
-	.check_connect = always_connected,
-};
-
-static const struct driver_info	yopy_info = {
-	.description =	"Yopy",
-	.check_connect = always_connected,
-};
-
-static const struct driver_info	blob_info = {
-	.description =	"Boot Loader OBject",
-	.check_connect = always_connected,
-};
-
-#endif	/* CONFIG_USB_ARMLINUX */
-
-
 #ifdef CONFIG_USB_ZAURUS
 #define	HAVE_HARDWARE
 
@@ -2604,7 +2471,7 @@ static int zaurus_bind (struct usbnet *d
 static const struct driver_info	zaurus_sl5x00_info = {
 	.description =	"Sharp Zaurus SL-5x00",
 	.flags =	FLAG_FRAMING_Z,
-	.check_connect = always_connected,
+	.check_connect = usbnet_always_connected,
 	.bind =		zaurus_bind,
 	.unbind =	cdc_unbind,
 	.tx_fixup = 	zaurus_tx_fixup,
@@ -2614,7 +2481,7 @@ static const struct driver_info	zaurus_s
 static const struct driver_info	zaurus_pxa_info = {
 	.description =	"Sharp Zaurus, PXA-2xx based",
 	.flags =	FLAG_FRAMING_Z,
-	.check_connect = always_connected,
+	.check_connect = usbnet_always_connected,
 	.bind =		zaurus_bind,
 	.unbind =	cdc_unbind,
 	.tx_fixup = 	zaurus_tx_fixup,
@@ -2624,7 +2491,7 @@ static const struct driver_info	zaurus_p
 static const struct driver_info	olympus_mxl_info = {
 	.description =	"Olympus R1000",
 	.flags =	FLAG_FRAMING_Z,
-	.check_connect = always_connected,
+	.check_connect = usbnet_always_connected,
 	.bind =		zaurus_bind,
 	.unbind =	cdc_unbind,
 	.tx_fixup = 	zaurus_tx_fixup,
@@ -2755,7 +2622,7 @@ bad_desc:
 static const struct driver_info	bogus_mdlm_info = {
 	.description =	"pseudo-MDLM (BLAN) device",
 	.flags =	FLAG_FRAMING_Z,
-	.check_connect = always_connected,
+	.check_connect = usbnet_always_connected,
 	.tx_fixup = 	zaurus_tx_fixup,
 	.bind =		blan_mdlm_bind,
 };
@@ -3566,7 +3433,7 @@ static void usbnet_bh (unsigned long par
  
 // precondition: never called in_interrupt
 
-static void usbnet_disconnect (struct usb_interface *intf)
+void usbnet_disconnect (struct usb_interface *intf)
 {
 	struct usbnet		*dev;
 	struct usb_device	*xdev;
@@ -3596,6 +3463,7 @@ static void usbnet_disconnect (struct us
 	free_netdev(net);
 	usb_put_dev (xdev);
 }
+EXPORT_SYMBOL_GPL(usbnet_disconnect);
 
 
 /*-------------------------------------------------------------------------*/
@@ -3604,7 +3472,7 @@ static struct ethtool_ops usbnet_ethtool
 
 // precondition: never called in_interrupt
 
-static int
+int
 usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 {
 	struct usbnet			*dev;
@@ -3735,12 +3603,11 @@ out:
 	usb_put_dev(xdev);
 	return status;
 }
+EXPORT_SYMBOL_GPL(usbnet_probe);
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef	CONFIG_PM
-
-static int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
+int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
 {
 	struct usbnet		*dev = usb_get_intfdata(intf);
 	
@@ -3753,8 +3620,9 @@ static int usbnet_suspend (struct usb_in
 	intf->dev.power.power_state = PMSG_SUSPEND;
 	return 0;
 }
+EXPORT_SYMBOL_GPL(usbnet_suspend);
 
-static int usbnet_resume (struct usb_interface *intf)
+int usbnet_resume (struct usb_interface *intf)
 {
 	struct usbnet		*dev = usb_get_intfdata(intf);
 
@@ -3763,13 +3631,8 @@ static int usbnet_resume (struct usb_int
 	tasklet_schedule (&dev->bh);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(usbnet_resume);
 
-#else	/* !CONFIG_PM */
-
-#define	usbnet_suspend	NULL
-#define	usbnet_resume	NULL
-
-#endif	/* CONFIG_PM */
 
 /*-------------------------------------------------------------------------*/
 
@@ -3784,36 +3647,6 @@ static int usbnet_resume (struct usb_int
 
 static const struct usb_device_id	products [] = {
 
-#ifdef	CONFIG_USB_ALI_M5632
-{
-	USB_DEVICE (0x0402, 0x5632),	// ALi defaults
-	.driver_info =	(unsigned long) &ali_m5632_info,
-},
-#endif
-
-#ifdef	CONFIG_USB_AN2720
-{
-	USB_DEVICE (0x0547, 0x2720),	// AnchorChips defaults
-	.driver_info =	(unsigned long) &an2720_info,
-}, {
-	USB_DEVICE (0x0547, 0x2727),	// Xircom PGUNET
-	.driver_info =	(unsigned long) &an2720_info,
-},
-#endif
-
-#ifdef	CONFIG_USB_BELKIN
-{
-	USB_DEVICE (0x050d, 0x0004),	// Belkin
-	.driver_info =	(unsigned long) &belkin_info,
-}, {
-	USB_DEVICE (0x056c, 0x8100),	// eTEK
-	.driver_info =	(unsigned long) &belkin_info,
-}, {
-	USB_DEVICE (0x0525, 0x9901),	// Advance USBNET (eTEK)
-	.driver_info =	(unsigned long) &belkin_info,
-},
-#endif
-
 #ifdef CONFIG_USB_AX8817X
 {
 	// Linksys USB200M
@@ -3870,13 +3703,6 @@ static const struct usb_device_id	produc
 },
 #endif
 
-#ifdef	CONFIG_USB_EPSON2888
-{
-	USB_DEVICE (0x0525, 0x2888),	// EPSON USB client
-	.driver_info	= (unsigned long) &epson2888_info,
-},
-#endif
-
 #ifdef	CONFIG_USB_GENESYS
 {
 	USB_DEVICE (0x05e3, 0x0502),	// GL620USB-A
@@ -3907,13 +3733,6 @@ static const struct usb_device_id	produc
 },
 #endif
 
-#ifdef CONFIG_USB_KC2190
-{
-	USB_DEVICE (0x050f, 0x0190),	// KC-190
-	.driver_info =	(unsigned long) &kc2190_info,
-},
-#endif
-
 #ifdef	CONFIG_USB_RNDIS
 {
 	/* RNDIS is MSFT's un-official variant of CDC ACM */
@@ -3922,41 +3741,6 @@ static const struct usb_device_id	produc
 },
 #endif
 
-#ifdef	CONFIG_USB_ARMLINUX
-/*
- * SA-1100 using standard ARM Linux kernels, or compatible.
- * Often used when talking to Linux PDAs (iPaq, Yopy, etc).
- * The sa-1100 "usb-eth" driver handles the basic framing.
- *
- * PXA25x or PXA210 ...  these use a "usb-eth" driver much like
- * the sa1100 one, but hardware uses different endpoint numbers.
- *
- * Or the Linux "Ethernet" gadget on hardware that can't talk
- * CDC Ethernet (e.g., no altsettings), in either of two modes:
- *  - acting just like the old "usb-eth" firmware, though
- *    the implementation is different 
- *  - supporting RNDIS as the first/default configuration for
- *    MS-Windows interop; Linux needs to use the other config
- */
-{
-	// 1183 = 0x049F, both used as hex values?
-	// Compaq "Itsy" vendor/product id
-	USB_DEVICE (0x049F, 0x505A),	// usb-eth, or compatible
-	.driver_info =	(unsigned long) &linuxdev_info,
-}, {
-	USB_DEVICE (0x0E7E, 0x1001),	// G.Mate "Yopy"
-	.driver_info =	(unsigned long) &yopy_info,
-}, {
-	USB_DEVICE (0x8086, 0x07d3),	// "blob" bootloader
-	.driver_info =	(unsigned long) &blob_info,
-}, {
-	// Linux Ethernet/RNDIS gadget on pxa210/25x/26x
-	// e.g. Gumstix, current OpenZaurus, ...
-	USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203),
-	.driver_info =	(unsigned long) &linuxdev_info,
-}, 
-#endif
-
 #if	defined(CONFIG_USB_ZAURUS) || defined(CONFIG_USB_CDCETHER)
 /*
  * SA-1100 based Sharp Zaurus ("collie"), or compatible.
diff -puN drivers/usb/net/usbnet.h~gregkh-usb-usb-usbnet-02 drivers/usb/net/usbnet.h
--- devel/drivers/usb/net/usbnet.h~gregkh-usb-usb-usbnet-02	2005-09-07 20:10:19.000000000 -0700
+++ devel-akpm/drivers/usb/net/usbnet.h	2005-09-07 20:10:19.000000000 -0700
@@ -112,6 +112,15 @@ struct driver_info {
 	unsigned long	data;		/* Misc driver specific data */
 };
 
+/* Minidrivers are just drivers using the "usbnet" core as a powerful
+ * network-specific subroutine library ... that happens to do pretty
+ * much everything except custom framing and chip-specific stuff.
+ */
+extern int usbnet_probe(struct usb_interface *, const struct usb_device_id *);
+extern int usbnet_suspend (struct usb_interface *, pm_message_t );
+extern int usbnet_resume (struct usb_interface *);
+extern void usbnet_disconnect(struct usb_interface *);
+
 
 /* we record the state for each of our queued skbs */
 enum skb_state {
_