diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/asix_devices.c | 14 | ||||
-rw-r--r-- | drivers/net/usb/ax88179_178a.c | 7 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 47 | ||||
-rw-r--r-- | drivers/net/usb/qmi_wwan.c | 1 | ||||
-rw-r--r-- | drivers/net/usb/r8152.c | 17 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 20 |
6 files changed, 73 insertions, 33 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 2c05f6cdb12f..816d511e34d3 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c | |||
@@ -465,19 +465,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) | |||
465 | return ret; | 465 | return ret; |
466 | } | 466 | } |
467 | 467 | ||
468 | ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL); | 468 | ax88772_reset(dev); |
469 | if (ret < 0) | ||
470 | return ret; | ||
471 | |||
472 | msleep(150); | ||
473 | |||
474 | ret = asix_sw_reset(dev, AX_SWRESET_CLEAR); | ||
475 | if (ret < 0) | ||
476 | return ret; | ||
477 | |||
478 | msleep(150); | ||
479 | |||
480 | ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE); | ||
481 | 469 | ||
482 | /* Read PHYID register *AFTER* the PHY was reset properly */ | 470 | /* Read PHYID register *AFTER* the PHY was reset properly */ |
483 | phyid = asix_get_phyid(dev); | 471 | phyid = asix_get_phyid(dev); |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index be4275721039..e6338c16081a 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -937,6 +937,7 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p) | |||
937 | { | 937 | { |
938 | struct usbnet *dev = netdev_priv(net); | 938 | struct usbnet *dev = netdev_priv(net); |
939 | struct sockaddr *addr = p; | 939 | struct sockaddr *addr = p; |
940 | int ret; | ||
940 | 941 | ||
941 | if (netif_running(net)) | 942 | if (netif_running(net)) |
942 | return -EBUSY; | 943 | return -EBUSY; |
@@ -946,8 +947,12 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p) | |||
946 | memcpy(net->dev_addr, addr->sa_data, ETH_ALEN); | 947 | memcpy(net->dev_addr, addr->sa_data, ETH_ALEN); |
947 | 948 | ||
948 | /* Set the MAC address */ | 949 | /* Set the MAC address */ |
949 | return ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, | 950 | ret = ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, |
950 | ETH_ALEN, net->dev_addr); | 951 | ETH_ALEN, net->dev_addr); |
952 | if (ret < 0) | ||
953 | return ret; | ||
954 | |||
955 | return 0; | ||
951 | } | 956 | } |
952 | 957 | ||
953 | static const struct net_device_ops ax88179_netdev_ops = { | 958 | static const struct net_device_ops ax88179_netdev_ops = { |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 2a32d9167d3b..d3920b54a92c 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -67,6 +67,35 @@ static const u8 mbm_guid[16] = { | |||
67 | 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a, | 67 | 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static void usbnet_cdc_update_filter(struct usbnet *dev) | ||
71 | { | ||
72 | struct cdc_state *info = (void *) &dev->data; | ||
73 | struct usb_interface *intf = info->control; | ||
74 | |||
75 | u16 cdc_filter = | ||
76 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | | ||
77 | USB_CDC_PACKET_TYPE_BROADCAST; | ||
78 | |||
79 | if (dev->net->flags & IFF_PROMISC) | ||
80 | cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS; | ||
81 | |||
82 | /* FIXME cdc-ether has some multicast code too, though it complains | ||
83 | * in routine cases. info->ether describes the multicast support. | ||
84 | * Implement that here, manipulating the cdc filter as needed. | ||
85 | */ | ||
86 | |||
87 | usb_control_msg(dev->udev, | ||
88 | usb_sndctrlpipe(dev->udev, 0), | ||
89 | USB_CDC_SET_ETHERNET_PACKET_FILTER, | ||
90 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
91 | cdc_filter, | ||
92 | intf->cur_altsetting->desc.bInterfaceNumber, | ||
93 | NULL, | ||
94 | 0, | ||
95 | USB_CTRL_SET_TIMEOUT | ||
96 | ); | ||
97 | } | ||
98 | |||
70 | /* probes control interface, claims data interface, collects the bulk | 99 | /* probes control interface, claims data interface, collects the bulk |
71 | * endpoints, activates data interface (if needed), maybe sets MTU. | 100 | * endpoints, activates data interface (if needed), maybe sets MTU. |
72 | * all pure cdc, except for certain firmware workarounds, and knowing | 101 | * all pure cdc, except for certain firmware workarounds, and knowing |
@@ -347,16 +376,8 @@ next_desc: | |||
347 | * don't do reset all the way. So the packet filter should | 376 | * don't do reset all the way. So the packet filter should |
348 | * be set to a sane initial value. | 377 | * be set to a sane initial value. |
349 | */ | 378 | */ |
350 | usb_control_msg(dev->udev, | 379 | usbnet_cdc_update_filter(dev); |
351 | usb_sndctrlpipe(dev->udev, 0), | 380 | |
352 | USB_CDC_SET_ETHERNET_PACKET_FILTER, | ||
353 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
354 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST, | ||
355 | intf->cur_altsetting->desc.bInterfaceNumber, | ||
356 | NULL, | ||
357 | 0, | ||
358 | USB_CTRL_SET_TIMEOUT | ||
359 | ); | ||
360 | return 0; | 381 | return 0; |
361 | 382 | ||
362 | bad_desc: | 383 | bad_desc: |
@@ -468,10 +489,6 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
468 | return status; | 489 | return status; |
469 | } | 490 | } |
470 | 491 | ||
471 | /* FIXME cdc-ether has some multicast code too, though it complains | ||
472 | * in routine cases. info->ether describes the multicast support. | ||
473 | * Implement that here, manipulating the cdc filter as needed. | ||
474 | */ | ||
475 | return 0; | 492 | return 0; |
476 | } | 493 | } |
477 | EXPORT_SYMBOL_GPL(usbnet_cdc_bind); | 494 | EXPORT_SYMBOL_GPL(usbnet_cdc_bind); |
@@ -482,6 +499,7 @@ static const struct driver_info cdc_info = { | |||
482 | .bind = usbnet_cdc_bind, | 499 | .bind = usbnet_cdc_bind, |
483 | .unbind = usbnet_cdc_unbind, | 500 | .unbind = usbnet_cdc_unbind, |
484 | .status = usbnet_cdc_status, | 501 | .status = usbnet_cdc_status, |
502 | .set_rx_mode = usbnet_cdc_update_filter, | ||
485 | .manage_power = usbnet_manage_power, | 503 | .manage_power = usbnet_manage_power, |
486 | }; | 504 | }; |
487 | 505 | ||
@@ -491,6 +509,7 @@ static const struct driver_info wwan_info = { | |||
491 | .bind = usbnet_cdc_bind, | 509 | .bind = usbnet_cdc_bind, |
492 | .unbind = usbnet_cdc_unbind, | 510 | .unbind = usbnet_cdc_unbind, |
493 | .status = usbnet_cdc_status, | 511 | .status = usbnet_cdc_status, |
512 | .set_rx_mode = usbnet_cdc_update_filter, | ||
494 | .manage_power = usbnet_manage_power, | 513 | .manage_power = usbnet_manage_power, |
495 | }; | 514 | }; |
496 | 515 | ||
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 22756db53dca..b8a82b86f909 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -780,6 +780,7 @@ static const struct usb_device_id products[] = { | |||
780 | {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ | 780 | {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ |
781 | {QMI_FIXED_INTF(0x413c, 0x81a8, 8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */ | 781 | {QMI_FIXED_INTF(0x413c, 0x81a8, 8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */ |
782 | {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */ | 782 | {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */ |
783 | {QMI_FIXED_INTF(0x03f0, 0x581d, 4)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */ | ||
783 | 784 | ||
784 | /* 4. Gobi 1000 devices */ | 785 | /* 4. Gobi 1000 devices */ |
785 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 786 | {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e3d84c322e4e..c6554c7a8147 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -1162,6 +1162,9 @@ static void intr_callback(struct urb *urb) | |||
1162 | case -ESHUTDOWN: | 1162 | case -ESHUTDOWN: |
1163 | netif_device_detach(tp->netdev); | 1163 | netif_device_detach(tp->netdev); |
1164 | case -ENOENT: | 1164 | case -ENOENT: |
1165 | case -EPROTO: | ||
1166 | netif_info(tp, intr, tp->netdev, | ||
1167 | "Stop submitting intr, status %d\n", status); | ||
1165 | return; | 1168 | return; |
1166 | case -EOVERFLOW: | 1169 | case -EOVERFLOW: |
1167 | netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n"); | 1170 | netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n"); |
@@ -2891,6 +2894,9 @@ static int rtl8152_open(struct net_device *netdev) | |||
2891 | if (res) | 2894 | if (res) |
2892 | goto out; | 2895 | goto out; |
2893 | 2896 | ||
2897 | /* set speed to 0 to avoid autoresume try to submit rx */ | ||
2898 | tp->speed = 0; | ||
2899 | |||
2894 | res = usb_autopm_get_interface(tp->intf); | 2900 | res = usb_autopm_get_interface(tp->intf); |
2895 | if (res < 0) { | 2901 | if (res < 0) { |
2896 | free_all_mem(tp); | 2902 | free_all_mem(tp); |
@@ -2904,6 +2910,8 @@ static int rtl8152_open(struct net_device *netdev) | |||
2904 | clear_bit(WORK_ENABLE, &tp->flags); | 2910 | clear_bit(WORK_ENABLE, &tp->flags); |
2905 | usb_kill_urb(tp->intr_urb); | 2911 | usb_kill_urb(tp->intr_urb); |
2906 | cancel_delayed_work_sync(&tp->schedule); | 2912 | cancel_delayed_work_sync(&tp->schedule); |
2913 | |||
2914 | /* disable the tx/rx, if the workqueue has enabled them. */ | ||
2907 | if (tp->speed & LINK_STATUS) | 2915 | if (tp->speed & LINK_STATUS) |
2908 | tp->rtl_ops.disable(tp); | 2916 | tp->rtl_ops.disable(tp); |
2909 | } | 2917 | } |
@@ -2955,10 +2963,7 @@ static int rtl8152_close(struct net_device *netdev) | |||
2955 | * be disable when autoresume occurs, because the | 2963 | * be disable when autoresume occurs, because the |
2956 | * netif_running() would be false. | 2964 | * netif_running() would be false. |
2957 | */ | 2965 | */ |
2958 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 2966 | rtl_runtime_suspend_enable(tp, false); |
2959 | rtl_runtime_suspend_enable(tp, false); | ||
2960 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | ||
2961 | } | ||
2962 | 2967 | ||
2963 | tasklet_disable(&tp->tl); | 2968 | tasklet_disable(&tp->tl); |
2964 | tp->rtl_ops.down(tp); | 2969 | tp->rtl_ops.down(tp); |
@@ -3205,7 +3210,7 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message) | |||
3205 | netif_device_detach(netdev); | 3210 | netif_device_detach(netdev); |
3206 | } | 3211 | } |
3207 | 3212 | ||
3208 | if (netif_running(netdev)) { | 3213 | if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) { |
3209 | clear_bit(WORK_ENABLE, &tp->flags); | 3214 | clear_bit(WORK_ENABLE, &tp->flags); |
3210 | usb_kill_urb(tp->intr_urb); | 3215 | usb_kill_urb(tp->intr_urb); |
3211 | tasklet_disable(&tp->tl); | 3216 | tasklet_disable(&tp->tl); |
@@ -3253,6 +3258,8 @@ static int rtl8152_resume(struct usb_interface *intf) | |||
3253 | set_bit(WORK_ENABLE, &tp->flags); | 3258 | set_bit(WORK_ENABLE, &tp->flags); |
3254 | } | 3259 | } |
3255 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); | 3260 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); |
3261 | } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | ||
3262 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | ||
3256 | } | 3263 | } |
3257 | 3264 | ||
3258 | mutex_unlock(&tp->control); | 3265 | mutex_unlock(&tp->control); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 20615bbd693b..3a6770a65d78 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1052,6 +1052,21 @@ static void __handle_link_change(struct usbnet *dev) | |||
1052 | clear_bit(EVENT_LINK_CHANGE, &dev->flags); | 1052 | clear_bit(EVENT_LINK_CHANGE, &dev->flags); |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | static void usbnet_set_rx_mode(struct net_device *net) | ||
1056 | { | ||
1057 | struct usbnet *dev = netdev_priv(net); | ||
1058 | |||
1059 | usbnet_defer_kevent(dev, EVENT_SET_RX_MODE); | ||
1060 | } | ||
1061 | |||
1062 | static void __handle_set_rx_mode(struct usbnet *dev) | ||
1063 | { | ||
1064 | if (dev->driver_info->set_rx_mode) | ||
1065 | (dev->driver_info->set_rx_mode)(dev); | ||
1066 | |||
1067 | clear_bit(EVENT_SET_RX_MODE, &dev->flags); | ||
1068 | } | ||
1069 | |||
1055 | /* work that cannot be done in interrupt context uses keventd. | 1070 | /* work that cannot be done in interrupt context uses keventd. |
1056 | * | 1071 | * |
1057 | * NOTE: with 2.5 we could do more of this using completion callbacks, | 1072 | * NOTE: with 2.5 we could do more of this using completion callbacks, |
@@ -1157,6 +1172,10 @@ skip_reset: | |||
1157 | if (test_bit (EVENT_LINK_CHANGE, &dev->flags)) | 1172 | if (test_bit (EVENT_LINK_CHANGE, &dev->flags)) |
1158 | __handle_link_change(dev); | 1173 | __handle_link_change(dev); |
1159 | 1174 | ||
1175 | if (test_bit (EVENT_SET_RX_MODE, &dev->flags)) | ||
1176 | __handle_set_rx_mode(dev); | ||
1177 | |||
1178 | |||
1160 | if (dev->flags) | 1179 | if (dev->flags) |
1161 | netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags); | 1180 | netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags); |
1162 | } | 1181 | } |
@@ -1525,6 +1544,7 @@ static const struct net_device_ops usbnet_netdev_ops = { | |||
1525 | .ndo_stop = usbnet_stop, | 1544 | .ndo_stop = usbnet_stop, |
1526 | .ndo_start_xmit = usbnet_start_xmit, | 1545 | .ndo_start_xmit = usbnet_start_xmit, |
1527 | .ndo_tx_timeout = usbnet_tx_timeout, | 1546 | .ndo_tx_timeout = usbnet_tx_timeout, |
1547 | .ndo_set_rx_mode = usbnet_set_rx_mode, | ||
1528 | .ndo_change_mtu = usbnet_change_mtu, | 1548 | .ndo_change_mtu = usbnet_change_mtu, |
1529 | .ndo_set_mac_address = eth_mac_addr, | 1549 | .ndo_set_mac_address = eth_mac_addr, |
1530 | .ndo_validate_addr = eth_validate_addr, | 1550 | .ndo_validate_addr = eth_validate_addr, |