diff options
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r-- | drivers/net/usb/usbnet.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 069c1cf0fdf7..9ab439d144ed 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -645,6 +645,7 @@ int usbnet_stop (struct net_device *net) | |||
645 | struct driver_info *info = dev->driver_info; | 645 | struct driver_info *info = dev->driver_info; |
646 | int retval; | 646 | int retval; |
647 | 647 | ||
648 | clear_bit(EVENT_DEV_OPEN, &dev->flags); | ||
648 | netif_stop_queue (net); | 649 | netif_stop_queue (net); |
649 | 650 | ||
650 | netif_info(dev, ifdown, dev->net, | 651 | netif_info(dev, ifdown, dev->net, |
@@ -736,6 +737,7 @@ int usbnet_open (struct net_device *net) | |||
736 | } | 737 | } |
737 | } | 738 | } |
738 | 739 | ||
740 | set_bit(EVENT_DEV_OPEN, &dev->flags); | ||
739 | netif_start_queue (net); | 741 | netif_start_queue (net); |
740 | netif_info(dev, ifup, dev->net, | 742 | netif_info(dev, ifup, dev->net, |
741 | "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", | 743 | "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", |
@@ -1259,6 +1261,9 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
1259 | if (dev->driver_info->unbind) | 1261 | if (dev->driver_info->unbind) |
1260 | dev->driver_info->unbind (dev, intf); | 1262 | dev->driver_info->unbind (dev, intf); |
1261 | 1263 | ||
1264 | usb_kill_urb(dev->interrupt); | ||
1265 | usb_free_urb(dev->interrupt); | ||
1266 | |||
1262 | free_netdev(net); | 1267 | free_netdev(net); |
1263 | usb_put_dev (xdev); | 1268 | usb_put_dev (xdev); |
1264 | } | 1269 | } |
@@ -1498,6 +1503,10 @@ int usbnet_resume (struct usb_interface *intf) | |||
1498 | int retval; | 1503 | int retval; |
1499 | 1504 | ||
1500 | if (!--dev->suspend_count) { | 1505 | if (!--dev->suspend_count) { |
1506 | /* resume interrupt URBs */ | ||
1507 | if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags)) | ||
1508 | usb_submit_urb(dev->interrupt, GFP_NOIO); | ||
1509 | |||
1501 | spin_lock_irq(&dev->txq.lock); | 1510 | spin_lock_irq(&dev->txq.lock); |
1502 | while ((res = usb_get_from_anchor(&dev->deferred))) { | 1511 | while ((res = usb_get_from_anchor(&dev->deferred))) { |
1503 | 1512 | ||
@@ -1516,9 +1525,12 @@ int usbnet_resume (struct usb_interface *intf) | |||
1516 | smp_mb(); | 1525 | smp_mb(); |
1517 | clear_bit(EVENT_DEV_ASLEEP, &dev->flags); | 1526 | clear_bit(EVENT_DEV_ASLEEP, &dev->flags); |
1518 | spin_unlock_irq(&dev->txq.lock); | 1527 | spin_unlock_irq(&dev->txq.lock); |
1519 | if (!(dev->txq.qlen >= TX_QLEN(dev))) | 1528 | |
1520 | netif_start_queue(dev->net); | 1529 | if (test_bit(EVENT_DEV_OPEN, &dev->flags)) { |
1521 | tasklet_schedule (&dev->bh); | 1530 | if (!(dev->txq.qlen >= TX_QLEN(dev))) |
1531 | netif_start_queue(dev->net); | ||
1532 | tasklet_schedule (&dev->bh); | ||
1533 | } | ||
1522 | } | 1534 | } |
1523 | return 0; | 1535 | return 0; |
1524 | } | 1536 | } |