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 | 31 | ||||
-rw-r--r-- | drivers/usb/net/zd1201.c | 3 |
3 files changed, 48 insertions, 8 deletions
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index f6c19d73b7d..a02be795d63 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) free_netdev(pegasus->net); } -static int pegasus_suspend (struct usb_interface *intf, pm_message_t state) +static int pegasus_suspend (struct usb_interface *intf, pm_message_t message) { struct pegasus *pegasus = usb_get_intfdata(intf); netif_device_detach (pegasus->net); + if (netif_running(pegasus->net)) { + cancel_delayed_work(&pegasus->carrier_check); + + usb_kill_urb(pegasus->rx_urb); + usb_kill_urb(pegasus->intr_urb); + } + intf->dev.power.power_state = PMSG_SUSPEND; return 0; } @@ -1376,7 +1383,20 @@ static int pegasus_resume (struct usb_interface *intf) { struct pegasus *pegasus = usb_get_intfdata(intf); + intf->dev.power.power_state = PMSG_ON; netif_device_attach (pegasus->net); + if (netif_running(pegasus->net)) { + pegasus->rx_urb->status = 0; + pegasus->rx_urb->actual_length = 0; + read_bulk_callback(pegasus->rx_urb, 0); + + pegasus->intr_urb->status = 0; + pegasus->intr_urb->actual_length = 0; + intr_callback(pegasus->intr_urb, 0); + + queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, + CARRIER_CHECK_DELAY); + } return 0; } diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index dd8b4456ea3..bbaef047d53 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c @@ -426,7 +426,7 @@ static void skb_return (struct usbnet *dev, struct sk_buff *skb) dev->stats.rx_bytes += skb->len; if (netif_msg_rx_status (dev)) - devdbg (dev, "< rx, len %d, type 0x%x", + devdbg (dev, "< rx, len %zd, type 0x%x", skb->len + sizeof (struct ethhdr), skb->protocol); memset (skb->cb, 0, sizeof (struct skb_data)); status = netif_rx (skb); @@ -3732,11 +3732,17 @@ out: #ifdef CONFIG_PM -static int usbnet_suspend (struct usb_interface *intf, u32 state) +static 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); + intf->dev.power.power_state = PMSG_SUSPEND; return 0; } @@ -3744,7 +3750,9 @@ static int usbnet_resume (struct usb_interface *intf) { struct usbnet *dev = usb_get_intfdata(intf); + intf->dev.power.power_state = PMSG_ON; netif_device_attach (dev->net); + tasklet_schedule (&dev->bh); return 0; } @@ -4009,10 +4017,23 @@ static const struct usb_device_id products [] = { .idProduct = 0x9050, /* C-860 */ ZAURUS_MASTER_INTERFACE, .driver_info = ZAURUS_PXA_INFO, +}, + #ifdef CONFIG_USB_ZAURUS - /* at least some (reports vary) C-860 units have very different - * lies about their standards support. + /* at least some (reports vary) PXA units have very different + * lies about their standards support: they claim to be cell + * phones giving direct radio access (which they aren't). */ +{ + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = 0x04DD, + /* Sharp ROM v1.32 */ + .idProduct = 0x8006, /* SL-5600 */ + .bInterfaceClass = USB_CLASS_COMM, + .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, + .bInterfaceProtocol = USB_CDC_PROTO_NONE, + .driver_info = (unsigned long) &zaurus_pxa_mdlm_info, }, { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO | USB_DEVICE_ID_MATCH_DEVICE, @@ -4023,8 +4044,8 @@ static const struct usb_device_id products [] = { .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, .bInterfaceProtocol = USB_CDC_PROTO_NONE, .driver_info = (unsigned long) &zaurus_pxa_mdlm_info, -#endif }, +#endif /* Olympus has some models with a Zaurus-compatible option. * R-1000 uses a FreeScale i.MXL cpu (ARMv4T) diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 938025e2c64..c81cd0a619b 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c @@ -106,8 +106,7 @@ int zd1201_fw_upload(struct usb_device *dev, int apfw) err = 0; exit: - if (buf) - kfree(buf); + kfree(buf); release_firmware(fw_entry); return err; } |