提交 68972efa 编写于 作者: P Paul Stewart 提交者: David S. Miller

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: NPaul Stewart <pstew@chromium.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7833aa05
...@@ -736,6 +736,7 @@ int usbnet_open (struct net_device *net) ...@@ -736,6 +736,7 @@ int usbnet_open (struct net_device *net)
} }
} }
set_bit(EVENT_DEV_OPEN, &dev->flags);
netif_start_queue (net); netif_start_queue (net);
netif_info(dev, ifup, dev->net, netif_info(dev, ifup, dev->net,
"open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n",
...@@ -1259,6 +1260,9 @@ void usbnet_disconnect (struct usb_interface *intf) ...@@ -1259,6 +1260,9 @@ void usbnet_disconnect (struct usb_interface *intf)
if (dev->driver_info->unbind) if (dev->driver_info->unbind)
dev->driver_info->unbind (dev, intf); dev->driver_info->unbind (dev, intf);
usb_kill_urb(dev->interrupt);
usb_free_urb(dev->interrupt);
free_netdev(net); free_netdev(net);
usb_put_dev (xdev); usb_put_dev (xdev);
} }
...@@ -1498,6 +1502,10 @@ int usbnet_resume (struct usb_interface *intf) ...@@ -1498,6 +1502,10 @@ int usbnet_resume (struct usb_interface *intf)
int retval; int retval;
if (!--dev->suspend_count) { if (!--dev->suspend_count) {
/* resume interrupt URBs */
if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags))
usb_submit_urb(dev->interrupt, GFP_NOIO);
spin_lock_irq(&dev->txq.lock); spin_lock_irq(&dev->txq.lock);
while ((res = usb_get_from_anchor(&dev->deferred))) { while ((res = usb_get_from_anchor(&dev->deferred))) {
......
...@@ -68,6 +68,7 @@ struct usbnet { ...@@ -68,6 +68,7 @@ struct usbnet {
# define EVENT_RX_PAUSED 5 # define EVENT_RX_PAUSED 5
# define EVENT_DEV_WAKING 6 # define EVENT_DEV_WAKING 6
# define EVENT_DEV_ASLEEP 7 # define EVENT_DEV_ASLEEP 7
# define EVENT_DEV_OPEN 8
}; };
static inline struct usb_driver *driver_of(struct usb_interface *intf) static inline struct usb_driver *driver_of(struct usb_interface *intf)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册