diff options
Diffstat (limited to 'drivers/usb/net')
-rw-r--r-- | drivers/usb/net/pegasus.c | 22 | ||||
-rw-r--r-- | drivers/usb/net/usbnet.c | 10 |
2 files changed, 30 insertions, 2 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 | ||
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index dd8b4456ea35..3e341b1ffdb1 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c | |||
@@ -3732,11 +3732,17 @@ out: | |||
3732 | 3732 | ||
3733 | #ifdef CONFIG_PM | 3733 | #ifdef CONFIG_PM |
3734 | 3734 | ||
3735 | static int usbnet_suspend (struct usb_interface *intf, u32 state) | 3735 | static int usbnet_suspend (struct usb_interface *intf, pm_message_t message) |
3736 | { | 3736 | { |
3737 | struct usbnet *dev = usb_get_intfdata(intf); | 3737 | struct usbnet *dev = usb_get_intfdata(intf); |
3738 | 3738 | ||
3739 | /* accelerate emptying of the rx and queues, to avoid | ||
3740 | * having everything error out. | ||
3741 | */ | ||
3739 | netif_device_detach (dev->net); | 3742 | netif_device_detach (dev->net); |
3743 | (void) unlink_urbs (dev, &dev->rxq); | ||
3744 | (void) unlink_urbs (dev, &dev->txq); | ||
3745 | intf->dev.power.power_state = PMSG_SUSPEND; | ||
3740 | return 0; | 3746 | return 0; |
3741 | } | 3747 | } |
3742 | 3748 | ||
@@ -3744,7 +3750,9 @@ static int usbnet_resume (struct usb_interface *intf) | |||
3744 | { | 3750 | { |
3745 | struct usbnet *dev = usb_get_intfdata(intf); | 3751 | struct usbnet *dev = usb_get_intfdata(intf); |
3746 | 3752 | ||
3753 | intf->dev.power.power_state = PMSG_ON; | ||
3747 | netif_device_attach (dev->net); | 3754 | netif_device_attach (dev->net); |
3755 | tasklet_schedule (&dev->bh); | ||
3748 | return 0; | 3756 | return 0; |
3749 | } | 3757 | } |
3750 | 3758 | ||