diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/wusbcore/devconnect.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c index 386eaa22d215..63f200e4efb1 100644 --- a/drivers/usb/wusbcore/devconnect.c +++ b/drivers/usb/wusbcore/devconnect.c | |||
@@ -396,7 +396,8 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc, | |||
396 | 396 | ||
397 | /* After a device disconnects, change the GTK (see [WUSB] | 397 | /* After a device disconnects, change the GTK (see [WUSB] |
398 | * section 6.2.11.2). */ | 398 | * section 6.2.11.2). */ |
399 | wusbhc_gtk_rekey(wusbhc); | 399 | if (wusbhc->active) |
400 | wusbhc_gtk_rekey(wusbhc); | ||
400 | 401 | ||
401 | /* The Wireless USB part has forgotten about the device already; now | 402 | /* The Wireless USB part has forgotten about the device already; now |
402 | * khubd's timer will pick up the disconnection and remove the USB | 403 | * khubd's timer will pick up the disconnection and remove the USB |
@@ -1084,15 +1085,21 @@ error_mmcie_set: | |||
1084 | * wusbhc_devconnect_stop - stop managing connected devices | 1085 | * wusbhc_devconnect_stop - stop managing connected devices |
1085 | * @wusbhc: the WUSB HC | 1086 | * @wusbhc: the WUSB HC |
1086 | * | 1087 | * |
1087 | * Removes the Host Info IE and stops the keep alives. | 1088 | * Disconnects any devices still connected, stops the keep alives and |
1088 | * | 1089 | * removes the Host Info IE. |
1089 | * FIXME: should this disconnect all devices? | ||
1090 | */ | 1090 | */ |
1091 | void wusbhc_devconnect_stop(struct wusbhc *wusbhc) | 1091 | void wusbhc_devconnect_stop(struct wusbhc *wusbhc) |
1092 | { | 1092 | { |
1093 | cancel_delayed_work_sync(&wusbhc->keep_alive_timer); | 1093 | int i; |
1094 | WARN_ON(!list_empty(&wusbhc->cack_list)); | ||
1095 | 1094 | ||
1095 | mutex_lock(&wusbhc->mutex); | ||
1096 | for (i = 0; i < wusbhc->ports_max; i++) { | ||
1097 | if (wusbhc->port[i].wusb_dev) | ||
1098 | __wusbhc_dev_disconnect(wusbhc, &wusbhc->port[i]); | ||
1099 | } | ||
1100 | mutex_unlock(&wusbhc->mutex); | ||
1101 | |||
1102 | cancel_delayed_work_sync(&wusbhc->keep_alive_timer); | ||
1096 | wusbhc_mmcie_rm(wusbhc, &wusbhc->wuie_host_info->hdr); | 1103 | wusbhc_mmcie_rm(wusbhc, &wusbhc->wuie_host_info->hdr); |
1097 | kfree(wusbhc->wuie_host_info); | 1104 | kfree(wusbhc->wuie_host_info); |
1098 | wusbhc->wuie_host_info = NULL; | 1105 | wusbhc->wuie_host_info = NULL; |