aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-05-24 20:51:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:44:00 -0400
commit486e2df6ce213d0c776befdf3fe5ffc61dd61688 (patch)
tree70a345f23a4745ec02e82f0228c879914b29451e /drivers
parent45e45ab45c266642276d01e56d9fb5dccbfad960 (diff)
[PATCH] USB gadget: drain rndis response queue on disconnect
Drain the rndis response queue on disconnect. This fixes a problem in which an rndis response left in the queue from a previous session could cause a subsequent session to fail. Signed-off-by: Andy Lowe <alowe@mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/rndis.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index c9a0af29ecb6..06b6eba925b5 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -1025,11 +1025,17 @@ int rndis_signal_disconnect (int configNr)
1025 1025
1026void rndis_uninit (int configNr) 1026void rndis_uninit (int configNr)
1027{ 1027{
1028 u8 *buf;
1029 u32 length;
1030
1028 if (configNr >= RNDIS_MAX_CONFIGS) 1031 if (configNr >= RNDIS_MAX_CONFIGS)
1029 return; 1032 return;
1030 rndis_per_dev_params [configNr].used = 0; 1033 rndis_per_dev_params [configNr].used = 0;
1031 rndis_per_dev_params [configNr].state = RNDIS_UNINITIALIZED; 1034 rndis_per_dev_params [configNr].state = RNDIS_UNINITIALIZED;
1032 return; 1035
1036 /* drain the response queue */
1037 while ((buf = rndis_get_next_response(configNr, &length)))
1038 rndis_free_response(configNr, buf);
1033} 1039}
1034 1040
1035void rndis_set_host_mac (int configNr, const u8 *addr) 1041void rndis_set_host_mac (int configNr, const u8 *addr)