aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/usbnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r--drivers/net/usb/usbnet.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index f9cd42d058b0..5b16d9a1269a 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1252,20 +1252,23 @@ EXPORT_SYMBOL_GPL(usbnet_probe);
1252 1252
1253/*-------------------------------------------------------------------------*/ 1253/*-------------------------------------------------------------------------*/
1254 1254
1255/* FIXME these suspend/resume methods assume non-CDC style 1255/*
1256 * devices, with only one interface. 1256 * suspend the whole driver as soon as the first interface is suspended
1257 * resume only when the last interface is resumed
1257 */ 1258 */
1258 1259
1259int usbnet_suspend (struct usb_interface *intf, pm_message_t message) 1260int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
1260{ 1261{
1261 struct usbnet *dev = usb_get_intfdata(intf); 1262 struct usbnet *dev = usb_get_intfdata(intf);
1262 1263
1263 /* accelerate emptying of the rx and queues, to avoid 1264 if (!dev->suspend_count++) {
1264 * having everything error out. 1265 /* accelerate emptying of the rx and queues, to avoid
1265 */ 1266 * having everything error out.
1266 netif_device_detach (dev->net); 1267 */
1267 (void) unlink_urbs (dev, &dev->rxq); 1268 netif_device_detach (dev->net);
1268 (void) unlink_urbs (dev, &dev->txq); 1269 (void) unlink_urbs (dev, &dev->rxq);
1270 (void) unlink_urbs (dev, &dev->txq);
1271 }
1269 return 0; 1272 return 0;
1270} 1273}
1271EXPORT_SYMBOL_GPL(usbnet_suspend); 1274EXPORT_SYMBOL_GPL(usbnet_suspend);
@@ -1274,8 +1277,10 @@ int usbnet_resume (struct usb_interface *intf)
1274{ 1277{
1275 struct usbnet *dev = usb_get_intfdata(intf); 1278 struct usbnet *dev = usb_get_intfdata(intf);
1276 1279
1277 netif_device_attach (dev->net); 1280 if (!--dev->suspend_count) {
1278 tasklet_schedule (&dev->bh); 1281 netif_device_attach (dev->net);
1282 tasklet_schedule (&dev->bh);
1283 }
1279 return 0; 1284 return 0;
1280} 1285}
1281EXPORT_SYMBOL_GPL(usbnet_resume); 1286EXPORT_SYMBOL_GPL(usbnet_resume);