diff options
author | Paul Stewart <pstew@chromium.org> | 2011-04-28 01:43:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-28 15:56:09 -0400 |
commit | 68972efa657040f891c7eda07c7da8c8dd576788 (patch) | |
tree | 56e451d2101c37802fa043e41f55b8b5daad6b82 | |
parent | 7833aa05b8db63484b43b4b4c389cd4533140afb (diff) |
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>
-rw-r--r-- | drivers/net/usb/usbnet.c | 8 | ||||
-rw-r--r-- | include/linux/usb/usbnet.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 069c1cf0fdf7..009bba3d753e 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -736,6 +736,7 @@ int usbnet_open (struct net_device *net) | |||
736 | } | 736 | } |
737 | } | 737 | } |
738 | 738 | ||
739 | set_bit(EVENT_DEV_OPEN, &dev->flags); | ||
739 | netif_start_queue (net); | 740 | netif_start_queue (net); |
740 | netif_info(dev, ifup, dev->net, | 741 | netif_info(dev, ifup, dev->net, |
741 | "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", | 742 | "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", |
@@ -1259,6 +1260,9 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
1259 | if (dev->driver_info->unbind) | 1260 | if (dev->driver_info->unbind) |
1260 | dev->driver_info->unbind (dev, intf); | 1261 | dev->driver_info->unbind (dev, intf); |
1261 | 1262 | ||
1263 | usb_kill_urb(dev->interrupt); | ||
1264 | usb_free_urb(dev->interrupt); | ||
1265 | |||
1262 | free_netdev(net); | 1266 | free_netdev(net); |
1263 | usb_put_dev (xdev); | 1267 | usb_put_dev (xdev); |
1264 | } | 1268 | } |
@@ -1498,6 +1502,10 @@ int usbnet_resume (struct usb_interface *intf) | |||
1498 | int retval; | 1502 | int retval; |
1499 | 1503 | ||
1500 | if (!--dev->suspend_count) { | 1504 | if (!--dev->suspend_count) { |
1505 | /* resume interrupt URBs */ | ||
1506 | if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags)) | ||
1507 | usb_submit_urb(dev->interrupt, GFP_NOIO); | ||
1508 | |||
1501 | spin_lock_irq(&dev->txq.lock); | 1509 | spin_lock_irq(&dev->txq.lock); |
1502 | while ((res = usb_get_from_anchor(&dev->deferred))) { | 1510 | while ((res = usb_get_from_anchor(&dev->deferred))) { |
1503 | 1511 | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 0e1855079fbb..605b0aa8d852 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -68,6 +68,7 @@ struct usbnet { | |||
68 | # define EVENT_RX_PAUSED 5 | 68 | # define EVENT_RX_PAUSED 5 |
69 | # define EVENT_DEV_WAKING 6 | 69 | # define EVENT_DEV_WAKING 6 |
70 | # define EVENT_DEV_ASLEEP 7 | 70 | # define EVENT_DEV_ASLEEP 7 |
71 | # define EVENT_DEV_OPEN 8 | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 74 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |