diff options
author | David Brownell <david-b@pacbell.net> | 2005-04-18 20:39:22 -0400 |
---|---|---|
committer | Greg K-H <gregkh@suse.de> | 2005-04-18 20:39:22 -0400 |
commit | 27d72e8572336d9f4e17a12ac924cb5223a5758d (patch) | |
tree | 791a046b5d860233f652973d0627752b67a3c600 /drivers/usb/net/pegasus.c | |
parent | c6053ecffb895f6c0e0ec9c1d298e35cffc1f7a6 (diff) |
[PATCH] usb suspend updates (interface suspend)
This is the first of a few installments of PM API updates to match the
recent switch to "pm_message_t". This installment primarily affects
USB device drivers (for USB interfaces), and it changes the handful of
drivers which currently implement suspend methods:
- <linux/usb.h> and usbcore, signature change
- Some drivers only changed the signature, net effect this just
shuts up "sparse -Wbitwise":
* hid-core
* stir4200
- Two network drivers did that, and also grew slightly more
featureful suspend code ... they now properly shut down
their activities. (As should stir4200...)
* pegasus
* usbnet
Note that the Wake-On-Lan (WOL) support in pegasus doesn't yet work; looks
to me like it's missing a request to turn it on, vs just configuring it.
The ASIX code in usbnet also has WOL hooks that are ready to use; untested.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Index: gregkh-2.6/drivers/net/irda/stir4200.c
===================================================================
Diffstat (limited to 'drivers/usb/net/pegasus.c')
-rw-r--r-- | drivers/usb/net/pegasus.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index f6c19d73b7da..a02be795d63e 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -1364,11 +1364,18 @@ static void pegasus_disconnect(struct usb_interface *intf) | |||
1364 | free_netdev(pegasus->net); | 1364 | free_netdev(pegasus->net); |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | static int pegasus_suspend (struct usb_interface *intf, pm_message_t state) | 1367 | static int pegasus_suspend (struct usb_interface *intf, pm_message_t message) |
1368 | { | 1368 | { |
1369 | struct pegasus *pegasus = usb_get_intfdata(intf); | 1369 | struct pegasus *pegasus = usb_get_intfdata(intf); |
1370 | 1370 | ||
1371 | netif_device_detach (pegasus->net); | 1371 | netif_device_detach (pegasus->net); |
1372 | if (netif_running(pegasus->net)) { | ||
1373 | cancel_delayed_work(&pegasus->carrier_check); | ||
1374 | |||
1375 | usb_kill_urb(pegasus->rx_urb); | ||
1376 | usb_kill_urb(pegasus->intr_urb); | ||
1377 | } | ||
1378 | intf->dev.power.power_state = PMSG_SUSPEND; | ||
1372 | return 0; | 1379 | return 0; |
1373 | } | 1380 | } |
1374 | 1381 | ||
@@ -1376,7 +1383,20 @@ static int pegasus_resume (struct usb_interface *intf) | |||
1376 | { | 1383 | { |
1377 | struct pegasus *pegasus = usb_get_intfdata(intf); | 1384 | struct pegasus *pegasus = usb_get_intfdata(intf); |
1378 | 1385 | ||
1386 | intf->dev.power.power_state = PMSG_ON; | ||
1379 | netif_device_attach (pegasus->net); | 1387 | netif_device_attach (pegasus->net); |
1388 | if (netif_running(pegasus->net)) { | ||
1389 | pegasus->rx_urb->status = 0; | ||
1390 | pegasus->rx_urb->actual_length = 0; | ||
1391 | read_bulk_callback(pegasus->rx_urb, 0); | ||
1392 | |||
1393 | pegasus->intr_urb->status = 0; | ||
1394 | pegasus->intr_urb->actual_length = 0; | ||
1395 | intr_callback(pegasus->intr_urb, 0); | ||
1396 | |||
1397 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, | ||
1398 | CARRIER_CHECK_DELAY); | ||
1399 | } | ||
1380 | return 0; | 1400 | return 0; |
1381 | } | 1401 | } |
1382 | 1402 | ||