diff options
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r-- | drivers/net/usb/usbnet.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index fc9f578a1e25..cb04f900cc46 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1158,6 +1158,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1158 | usb_anchor_urb(urb, &dev->deferred); | 1158 | usb_anchor_urb(urb, &dev->deferred); |
1159 | /* no use to process more packets */ | 1159 | /* no use to process more packets */ |
1160 | netif_stop_queue(net); | 1160 | netif_stop_queue(net); |
1161 | usb_put_urb(urb); | ||
1161 | spin_unlock_irqrestore(&dev->txq.lock, flags); | 1162 | spin_unlock_irqrestore(&dev->txq.lock, flags); |
1162 | netdev_dbg(dev->net, "Delaying transmission for resumption\n"); | 1163 | netdev_dbg(dev->net, "Delaying transmission for resumption\n"); |
1163 | goto deferred; | 1164 | goto deferred; |
@@ -1310,6 +1311,8 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
1310 | 1311 | ||
1311 | cancel_work_sync(&dev->kevent); | 1312 | cancel_work_sync(&dev->kevent); |
1312 | 1313 | ||
1314 | usb_scuttle_anchored_urbs(&dev->deferred); | ||
1315 | |||
1313 | if (dev->driver_info->unbind) | 1316 | if (dev->driver_info->unbind) |
1314 | dev->driver_info->unbind (dev, intf); | 1317 | dev->driver_info->unbind (dev, intf); |
1315 | 1318 | ||
@@ -1588,10 +1591,27 @@ int usbnet_resume (struct usb_interface *intf) | |||
1588 | tasklet_schedule (&dev->bh); | 1591 | tasklet_schedule (&dev->bh); |
1589 | } | 1592 | } |
1590 | } | 1593 | } |
1594 | |||
1595 | if (test_and_clear_bit(EVENT_DEVICE_REPORT_IDLE, &dev->flags)) | ||
1596 | usb_autopm_get_interface_no_resume(intf); | ||
1597 | |||
1591 | return 0; | 1598 | return 0; |
1592 | } | 1599 | } |
1593 | EXPORT_SYMBOL_GPL(usbnet_resume); | 1600 | EXPORT_SYMBOL_GPL(usbnet_resume); |
1594 | 1601 | ||
1602 | /* | ||
1603 | * Either a subdriver implements manage_power, then it is assumed to always | ||
1604 | * be ready to be suspended or it reports the readiness to be suspended | ||
1605 | * explicitly | ||
1606 | */ | ||
1607 | void usbnet_device_suggests_idle(struct usbnet *dev) | ||
1608 | { | ||
1609 | if (!test_and_set_bit(EVENT_DEVICE_REPORT_IDLE, &dev->flags)) { | ||
1610 | dev->intf->needs_remote_wakeup = 1; | ||
1611 | usb_autopm_put_interface_async(dev->intf); | ||
1612 | } | ||
1613 | } | ||
1614 | EXPORT_SYMBOL(usbnet_device_suggests_idle); | ||
1595 | 1615 | ||
1596 | /*-------------------------------------------------------------------------*/ | 1616 | /*-------------------------------------------------------------------------*/ |
1597 | 1617 | ||