From 9e43f7a6e9021cf61cddf3c52cb719c1acc0868d Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Wed, 8 Apr 2009 17:36:33 +0000 Subject: [PATCH] --- yaml --- r: 143613 b: refs/heads/master c: 8db324ec4322a15cf8819b8a7f0eff5aa98b2ff6 h: refs/heads/master i: 143611: 4f21aef441ab4591d7416370a62bb7043b501920 v: v3 --- [refs] | 2 +- trunk/drivers/usb/wusbcore/devconnect.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 0826938e1cc8..7be0eef4a882 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f720af91ec2c67e9a1abbd935570f4b4e1f0dd54 +refs/heads/master: 8db324ec4322a15cf8819b8a7f0eff5aa98b2ff6 diff --git a/trunk/drivers/usb/wusbcore/devconnect.c b/trunk/drivers/usb/wusbcore/devconnect.c index 386eaa22d215..63f200e4efb1 100644 --- a/trunk/drivers/usb/wusbcore/devconnect.c +++ b/trunk/drivers/usb/wusbcore/devconnect.c @@ -396,7 +396,8 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc, /* After a device disconnects, change the GTK (see [WUSB] * section 6.2.11.2). */ - wusbhc_gtk_rekey(wusbhc); + if (wusbhc->active) + wusbhc_gtk_rekey(wusbhc); /* The Wireless USB part has forgotten about the device already; now * khubd's timer will pick up the disconnection and remove the USB @@ -1084,15 +1085,21 @@ int wusbhc_devconnect_start(struct wusbhc *wusbhc) * wusbhc_devconnect_stop - stop managing connected devices * @wusbhc: the WUSB HC * - * Removes the Host Info IE and stops the keep alives. - * - * FIXME: should this disconnect all devices? + * Disconnects any devices still connected, stops the keep alives and + * removes the Host Info IE. */ void wusbhc_devconnect_stop(struct wusbhc *wusbhc) { - cancel_delayed_work_sync(&wusbhc->keep_alive_timer); - WARN_ON(!list_empty(&wusbhc->cack_list)); + int i; + mutex_lock(&wusbhc->mutex); + for (i = 0; i < wusbhc->ports_max; i++) { + if (wusbhc->port[i].wusb_dev) + __wusbhc_dev_disconnect(wusbhc, &wusbhc->port[i]); + } + mutex_unlock(&wusbhc->mutex); + + cancel_delayed_work_sync(&wusbhc->keep_alive_timer); wusbhc_mmcie_rm(wusbhc, &wusbhc->wuie_host_info->hdr); kfree(wusbhc->wuie_host_info); wusbhc->wuie_host_info = NULL;