aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-04-28 16:45:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:50 -0400
commit340600ab4cf0cc41efd01a65af97ebb7d35a7f85 (patch)
tree4834521d8ccf7e7b63bbc8500fbe5323ee174b3b /drivers/usb/gadget/ether.c
parent247f3105636caa9d1d8a4c3dfb755de42633bc80 (diff)
[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.c11
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;
94#ifdef CONFIG_USB_ETH_RNDIS 94#ifdef CONFIG_USB_ETH_RNDIS
95#include "rndis.h" 95#include "rndis.h"
96#else 96#else
97#define rndis_init() 0 97#define rndis_init() 0
98#define rndis_exit() do{}while(0) 98#define rndis_uninit(x) do{}while(0)
99#define rndis_exit() do{}while(0)
99#endif 100#endif
100 101
101/* CDC and RNDIS support the same host-chosen outgoing packet filters. */ 102/* CDC and RNDIS support the same host-chosen outgoing packet filters. */
@@ -395,7 +396,8 @@ static inline int BITRATE(struct usb_gadget *g)
395#define STRING_SUBSET 8 396#define STRING_SUBSET 8
396#define STRING_RNDIS 9 397#define STRING_RNDIS 9
397 398
398#define USB_BUFSIZ 256 /* holds our biggest descriptor */ 399/* holds our biggest descriptor (or RNDIS response) */
400#define USB_BUFSIZ 256
399 401
400/* 402/*
401 * This device advertises one configuration, eth_config, unless RNDIS 403 * This device advertises one configuration, eth_config, unless RNDIS
@@ -1124,6 +1126,7 @@ static void eth_reset_config (struct eth_dev *dev)
1124 1126
1125 netif_stop_queue (dev->net); 1127 netif_stop_queue (dev->net);
1126 netif_carrier_off (dev->net); 1128 netif_carrier_off (dev->net);
1129 rndis_uninit(dev->rndis_config);
1127 1130
1128 /* disable endpoints, forcing (synchronous) completion of 1131 /* disable endpoints, forcing (synchronous) completion of
1129 * pending i/o. then free the requests. 1132 * pending i/o. then free the requests.
@@ -2565,7 +2568,7 @@ fail0:
2565 /* these set up a lot of the OIDs that RNDIS needs */ 2568 /* these set up a lot of the OIDs that RNDIS needs */
2566 rndis_set_host_mac (dev->rndis_config, dev->host_mac); 2569 rndis_set_host_mac (dev->rndis_config, dev->host_mac);
2567 if (rndis_set_param_dev (dev->rndis_config, dev->net, 2570 if (rndis_set_param_dev (dev->rndis_config, dev->net,
2568 &dev->stats)) 2571 &dev->stats, &dev->cdc_filter))
2569 goto fail0; 2572 goto fail0;
2570 if (rndis_set_param_vendor (dev->rndis_config, vendorID, 2573 if (rndis_set_param_vendor (dev->rndis_config, vendorID,
2571 manufacturer)) 2574 manufacturer))