usbnet: Resubmit interrupt URB if device is open

Resubmit interrupt URB if device is open. Use a flag set in
usbnet_open() to determine this state. Also kill and free
interrupt URB in usbnet_disconnect().

[Rebased off git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git]

Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Paul Stewart and committed by David S. Miller 68972efa 7833aa05

+9
+8
drivers/net/usb/usbnet.c
··· 736 736 } 737 737 } 738 738 739 + set_bit(EVENT_DEV_OPEN, &dev->flags); 739 740 netif_start_queue (net); 740 741 netif_info(dev, ifup, dev->net, 741 742 "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", ··· 1260 1259 if (dev->driver_info->unbind) 1261 1260 dev->driver_info->unbind (dev, intf); 1262 1261 1262 + usb_kill_urb(dev->interrupt); 1263 + usb_free_urb(dev->interrupt); 1264 + 1263 1265 free_netdev(net); 1264 1266 usb_put_dev (xdev); 1265 1267 } ··· 1502 1498 int retval; 1503 1499 1504 1500 if (!--dev->suspend_count) { 1501 + /* resume interrupt URBs */ 1502 + if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags)) 1503 + usb_submit_urb(dev->interrupt, GFP_NOIO); 1504 + 1505 1505 spin_lock_irq(&dev->txq.lock); 1506 1506 while ((res = usb_get_from_anchor(&dev->deferred))) { 1507 1507
+1
include/linux/usb/usbnet.h
··· 68 68 # define EVENT_RX_PAUSED 5 69 69 # define EVENT_DEV_WAKING 6 70 70 # define EVENT_DEV_ASLEEP 7 71 + # define EVENT_DEV_OPEN 8 71 72 }; 72 73 73 74 static inline struct usb_driver *driver_of(struct usb_interface *intf)