diff options
author | David Brownell <david-b@pacbell.net> | 2005-04-28 22:45:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-27 23:43:50 +0200 |
commit | 340600ab4cf0cc41efd01a65af97ebb7d35a7f85 (patch) | |
tree | 4834521d8ccf7e7b63bbc8500fbe5323ee174b3b /drivers/usb/gadget/ether.c | |
parent | [PATCH] USB HCDs: no longer need to register root hub (diff) | |
download | linux-340600ab4cf0cc41efd01a65af97ebb7d35a7f85.tar.xz linux-340600ab4cf0cc41efd01a65af97ebb7d35a7f85.zip |
[PATCH] USB: rndis updates (mostly cleanup)
Some bugfixes and lots of cleanup (net code shrink):
- On reset, force the RNDIS state machine its initial state
- Hook up the RNDIS (outgoing) filters to the CDC mechanism
- Lots of cleanup:
* Eliminate duplicate copy of OID table;
* Unify handlying of the OID "query" response data pointer;
* Reduce code duplication for calculating query response lengths;
* Remove some checks for "can't happen" errors;
* Get rid of debugging #ifdefs by making the debug flag an integer level
Most of the patch, by volume, relates to those query response cleanups.
It incidentally shaves off a few hundred bytes of object code.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r-- | drivers/usb/gadget/ether.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 3f783cbdc7c3..a766c29c3ec9 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -94,8 +94,9 @@ static const char driver_desc [] = DRIVER_DESC; #ifdef CONFIG_USB_ETH_RNDIS #include "rndis.h" #else -#define rndis_init() 0 -#define rndis_exit() do{}while(0) +#define rndis_init() 0 +#define rndis_uninit(x) do{}while(0) +#define rndis_exit() do{}while(0) #endif /* CDC and RNDIS support the same host-chosen outgoing packet filters. */ @@ -395,7 +396,8 @@ static inline int BITRATE(struct usb_gadget *g) #define STRING_SUBSET 8 #define STRING_RNDIS 9 -#define USB_BUFSIZ 256 /* holds our biggest descriptor */ +/* holds our biggest descriptor (or RNDIS response) */ +#define USB_BUFSIZ 256 /* * This device advertises one configuration, eth_config, unless RNDIS @@ -1124,6 +1126,7 @@ static void eth_reset_config (struct eth_dev *dev) netif_stop_queue (dev->net); netif_carrier_off (dev->net); + rndis_uninit(dev->rndis_config); /* disable endpoints, forcing (synchronous) completion of * pending i/o. then free the requests. @@ -2565,7 +2568,7 @@ fail0: /* these set up a lot of the OIDs that RNDIS needs */ rndis_set_host_mac (dev->rndis_config, dev->host_mac); if (rndis_set_param_dev (dev->rndis_config, dev->net, - &dev->stats)) + &dev->stats, &dev->cdc_filter)) goto fail0; if (rndis_set_param_vendor (dev->rndis_config, vendorID, manufacturer)) |