diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/qmi_wwan.c | 9 | ||||
-rw-r--r-- | drivers/net/usb/sierra_net.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 16 |
3 files changed, 18 insertions, 9 deletions
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index adfab3fc5478..b1ba68f1a049 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -297,7 +297,7 @@ static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message) | |||
297 | if (ret < 0) | 297 | if (ret < 0) |
298 | goto err; | 298 | goto err; |
299 | 299 | ||
300 | if (info->subdriver && info->subdriver->suspend) | 300 | if (intf == info->control && info->subdriver && info->subdriver->suspend) |
301 | ret = info->subdriver->suspend(intf, message); | 301 | ret = info->subdriver->suspend(intf, message); |
302 | if (ret < 0) | 302 | if (ret < 0) |
303 | usbnet_resume(intf); | 303 | usbnet_resume(intf); |
@@ -310,13 +310,14 @@ static int qmi_wwan_resume(struct usb_interface *intf) | |||
310 | struct usbnet *dev = usb_get_intfdata(intf); | 310 | struct usbnet *dev = usb_get_intfdata(intf); |
311 | struct qmi_wwan_state *info = (void *)&dev->data; | 311 | struct qmi_wwan_state *info = (void *)&dev->data; |
312 | int ret = 0; | 312 | int ret = 0; |
313 | bool callsub = (intf == info->control && info->subdriver && info->subdriver->resume); | ||
313 | 314 | ||
314 | if (info->subdriver && info->subdriver->resume) | 315 | if (callsub) |
315 | ret = info->subdriver->resume(intf); | 316 | ret = info->subdriver->resume(intf); |
316 | if (ret < 0) | 317 | if (ret < 0) |
317 | goto err; | 318 | goto err; |
318 | ret = usbnet_resume(intf); | 319 | ret = usbnet_resume(intf); |
319 | if (ret < 0 && info->subdriver && info->subdriver->resume && info->subdriver->suspend) | 320 | if (ret < 0 && callsub && info->subdriver->suspend) |
320 | info->subdriver->suspend(intf, PMSG_SUSPEND); | 321 | info->subdriver->suspend(intf, PMSG_SUSPEND); |
321 | err: | 322 | err: |
322 | return ret; | 323 | return ret; |
@@ -398,7 +399,6 @@ static const struct usb_device_id products[] = { | |||
398 | /* 4. Gobi 1000 devices */ | 399 | /* 4. Gobi 1000 devices */ |
399 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 400 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
400 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 401 | {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
401 | {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | ||
402 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | 402 | {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ |
403 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | 403 | {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ |
404 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | 404 | {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ |
@@ -440,6 +440,7 @@ static const struct usb_device_id products[] = { | |||
440 | {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ | 440 | {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ |
441 | {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ | 441 | {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ |
442 | {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ | 442 | {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ |
443 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | ||
443 | {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ | 444 | {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ |
444 | {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ | 445 | {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ |
445 | {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ | 446 | {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 7be49ea60b6d..8e22417fa6c1 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -656,7 +656,7 @@ static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap) | |||
656 | return -EIO; | 656 | return -EIO; |
657 | } | 657 | } |
658 | 658 | ||
659 | *datap = *attrdata; | 659 | *datap = le16_to_cpu(*attrdata); |
660 | 660 | ||
661 | kfree(attrdata); | 661 | kfree(attrdata); |
662 | return result; | 662 | return result; |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index fd4b26d46fd5..fc9f578a1e25 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1201,19 +1201,26 @@ deferred: | |||
1201 | } | 1201 | } |
1202 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); | 1202 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); |
1203 | 1203 | ||
1204 | static void rx_alloc_submit(struct usbnet *dev, gfp_t flags) | 1204 | static int rx_alloc_submit(struct usbnet *dev, gfp_t flags) |
1205 | { | 1205 | { |
1206 | struct urb *urb; | 1206 | struct urb *urb; |
1207 | int i; | 1207 | int i; |
1208 | int ret = 0; | ||
1208 | 1209 | ||
1209 | /* don't refill the queue all at once */ | 1210 | /* don't refill the queue all at once */ |
1210 | for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { | 1211 | for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { |
1211 | urb = usb_alloc_urb(0, flags); | 1212 | urb = usb_alloc_urb(0, flags); |
1212 | if (urb != NULL) { | 1213 | if (urb != NULL) { |
1213 | if (rx_submit(dev, urb, flags) == -ENOLINK) | 1214 | ret = rx_submit(dev, urb, flags); |
1214 | return; | 1215 | if (ret) |
1216 | goto err; | ||
1217 | } else { | ||
1218 | ret = -ENOMEM; | ||
1219 | goto err; | ||
1215 | } | 1220 | } |
1216 | } | 1221 | } |
1222 | err: | ||
1223 | return ret; | ||
1217 | } | 1224 | } |
1218 | 1225 | ||
1219 | /*-------------------------------------------------------------------------*/ | 1226 | /*-------------------------------------------------------------------------*/ |
@@ -1257,7 +1264,8 @@ static void usbnet_bh (unsigned long param) | |||
1257 | int temp = dev->rxq.qlen; | 1264 | int temp = dev->rxq.qlen; |
1258 | 1265 | ||
1259 | if (temp < RX_QLEN(dev)) { | 1266 | if (temp < RX_QLEN(dev)) { |
1260 | rx_alloc_submit(dev, GFP_ATOMIC); | 1267 | if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK) |
1268 | return; | ||
1261 | if (temp != dev->rxq.qlen) | 1269 | if (temp != dev->rxq.qlen) |
1262 | netif_dbg(dev, link, dev->net, | 1270 | netif_dbg(dev, link, dev->net, |
1263 | "rxqlen %d --> %d\n", | 1271 | "rxqlen %d --> %d\n", |