usbnet.c (94bd217e2d683719ab21a4ac117d8a1b91cbedc9) | usbnet.c (5b1b0b812a7b1a5b968c5d06d90d1cb88621b941) |
---|---|
1/* 2 * USB Network driver infrastructure 3 * Copyright (C) 2000-2005 by David Brownell 4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 1456 unchanged lines hidden (view full) --- 1465 1466int usbnet_suspend (struct usb_interface *intf, pm_message_t message) 1467{ 1468 struct usbnet *dev = usb_get_intfdata(intf); 1469 1470 if (!dev->suspend_count++) { 1471 spin_lock_irq(&dev->txq.lock); 1472 /* don't autosuspend while transmitting */ | 1/* 2 * USB Network driver infrastructure 3 * Copyright (C) 2000-2005 by David Brownell 4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 1456 unchanged lines hidden (view full) --- 1465 1466int usbnet_suspend (struct usb_interface *intf, pm_message_t message) 1467{ 1468 struct usbnet *dev = usb_get_intfdata(intf); 1469 1470 if (!dev->suspend_count++) { 1471 spin_lock_irq(&dev->txq.lock); 1472 /* don't autosuspend while transmitting */ |
1473 if (dev->txq.qlen && (message.event & PM_EVENT_AUTO)) { | 1473 if (dev->txq.qlen && PMSG_IS_AUTO(message)) { |
1474 spin_unlock_irq(&dev->txq.lock); 1475 return -EBUSY; 1476 } else { 1477 set_bit(EVENT_DEV_ASLEEP, &dev->flags); 1478 spin_unlock_irq(&dev->txq.lock); 1479 } 1480 /* 1481 * accelerate emptying of the rx and queues, to avoid --- 79 unchanged lines hidden --- | 1474 spin_unlock_irq(&dev->txq.lock); 1475 return -EBUSY; 1476 } else { 1477 set_bit(EVENT_DEV_ASLEEP, &dev->flags); 1478 spin_unlock_irq(&dev->txq.lock); 1479 } 1480 /* 1481 * accelerate emptying of the rx and queues, to avoid --- 79 unchanged lines hidden --- |