Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56827
b: refs/heads/master
c: 3643312
h: refs/heads/master
i:
  56825: 9fd0a03
  56823: 72813ab
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed May 23, 2007
1 parent cb4c0cb commit 61cb510
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 741ec4e6d0b7780d29a63f908d6d21df425be365
refs/heads/master: 36433127ae7a842482ba857f5ad3c431817a9542
25 changes: 15 additions & 10 deletions trunk/drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,20 +1252,23 @@ EXPORT_SYMBOL_GPL(usbnet_probe);

/*-------------------------------------------------------------------------*/

/* FIXME these suspend/resume methods assume non-CDC style
* devices, with only one interface.
/*
* suspend the whole driver as soon as the first interface is suspended
* resume only when the last interface is resumed
*/

int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
{
struct usbnet *dev = usb_get_intfdata(intf);

/* accelerate emptying of the rx and queues, to avoid
* having everything error out.
*/
netif_device_detach (dev->net);
(void) unlink_urbs (dev, &dev->rxq);
(void) unlink_urbs (dev, &dev->txq);
if (!dev->suspend_count++) {
/* accelerate emptying of the rx and queues, to avoid
* having everything error out.
*/
netif_device_detach (dev->net);
(void) unlink_urbs (dev, &dev->rxq);
(void) unlink_urbs (dev, &dev->txq);
}
return 0;
}
EXPORT_SYMBOL_GPL(usbnet_suspend);
Expand All @@ -1274,8 +1277,10 @@ int usbnet_resume (struct usb_interface *intf)
{
struct usbnet *dev = usb_get_intfdata(intf);

netif_device_attach (dev->net);
tasklet_schedule (&dev->bh);
if (!--dev->suspend_count) {
netif_device_attach (dev->net);
tasklet_schedule (&dev->bh);
}
return 0;
}
EXPORT_SYMBOL_GPL(usbnet_resume);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/usb/usbnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct usbnet {
const char *driver_name;
wait_queue_head_t *wait;
struct mutex phy_mutex;
unsigned char suspend_count;

/* i/o info: pipes etc */
unsigned in, out;
Expand Down

0 comments on commit 61cb510

Please sign in to comment.