diff options
author | David S. Miller <davem@davemloft.net> | 2016-07-06 13:35:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-06 13:35:22 -0400 |
commit | 30d0844bdcea9fb8b0b3c8abfa5547bc3bcf8baa (patch) | |
tree | 87302af9e03ee50cf135cc9ce6589f41fe3b3db1 /drivers/net/usb | |
parent | ae3e4562e2ce0149a4424c994a282955700711e7 (diff) | |
parent | bc86765181aa26cc9afcb0a6f9f253cbb1186f26 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/usb/r8152.c
All three conflicts were overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 7 | ||||
-rw-r--r-- | drivers/net/usb/r8152.c | 35 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 10 |
3 files changed, 42 insertions, 10 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 53759c315b97..877c9516e781 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -854,6 +854,13 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ | |||
854 | if (cdc_ncm_init(dev)) | 854 | if (cdc_ncm_init(dev)) |
855 | goto error2; | 855 | goto error2; |
856 | 856 | ||
857 | /* Some firmwares need a pause here or they will silently fail | ||
858 | * to set up the interface properly. This value was decided | ||
859 | * empirically on a Sierra Wireless MC7455 running 02.08.02.00 | ||
860 | * firmware. | ||
861 | */ | ||
862 | usleep_range(10000, 20000); | ||
863 | |||
857 | /* configure data interface */ | 864 | /* configure data interface */ |
858 | temp = usb_set_interface(dev->udev, iface_no, data_altsetting); | 865 | temp = usb_set_interface(dev->udev, iface_no, data_altsetting); |
859 | if (temp) { | 866 | if (temp) { |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 24d367280ecf..b225bc27fbe2 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #define NETNEXT_VERSION "08" | 31 | #define NETNEXT_VERSION "08" |
32 | 32 | ||
33 | /* Information for net */ | 33 | /* Information for net */ |
34 | #define NET_VERSION "4" | 34 | #define NET_VERSION "5" |
35 | 35 | ||
36 | #define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION | 36 | #define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION |
37 | #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" | 37 | #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>" |
@@ -625,6 +625,7 @@ struct r8152 { | |||
625 | int (*eee_set)(struct r8152 *, struct ethtool_eee *); | 625 | int (*eee_set)(struct r8152 *, struct ethtool_eee *); |
626 | bool (*in_nway)(struct r8152 *); | 626 | bool (*in_nway)(struct r8152 *); |
627 | void (*hw_phy_cfg)(struct r8152 *); | 627 | void (*hw_phy_cfg)(struct r8152 *); |
628 | void (*autosuspend_en)(struct r8152 *tp, bool enable); | ||
628 | } rtl_ops; | 629 | } rtl_ops; |
629 | 630 | ||
630 | int intr_interval; | 631 | int intr_interval; |
@@ -2412,9 +2413,6 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable) | |||
2412 | if (enable) { | 2413 | if (enable) { |
2413 | u32 ocp_data; | 2414 | u32 ocp_data; |
2414 | 2415 | ||
2415 | r8153_u1u2en(tp, false); | ||
2416 | r8153_u2p3en(tp, false); | ||
2417 | |||
2418 | __rtl_set_wol(tp, WAKE_ANY); | 2416 | __rtl_set_wol(tp, WAKE_ANY); |
2419 | 2417 | ||
2420 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG); | 2418 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG); |
@@ -2425,7 +2423,28 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable) | |||
2425 | 2423 | ||
2426 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML); | 2424 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML); |
2427 | } else { | 2425 | } else { |
2426 | u32 ocp_data; | ||
2427 | |||
2428 | __rtl_set_wol(tp, tp->saved_wolopts); | 2428 | __rtl_set_wol(tp, tp->saved_wolopts); |
2429 | |||
2430 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG); | ||
2431 | |||
2432 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34); | ||
2433 | ocp_data &= ~LINK_OFF_WAKE_EN; | ||
2434 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data); | ||
2435 | |||
2436 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML); | ||
2437 | } | ||
2438 | } | ||
2439 | |||
2440 | static void rtl8153_runtime_enable(struct r8152 *tp, bool enable) | ||
2441 | { | ||
2442 | rtl_runtime_suspend_enable(tp, enable); | ||
2443 | |||
2444 | if (enable) { | ||
2445 | r8153_u1u2en(tp, false); | ||
2446 | r8153_u2p3en(tp, false); | ||
2447 | } else { | ||
2429 | r8153_u2p3en(tp, true); | 2448 | r8153_u2p3en(tp, true); |
2430 | r8153_u1u2en(tp, true); | 2449 | r8153_u1u2en(tp, true); |
2431 | } | 2450 | } |
@@ -3530,7 +3549,7 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message) | |||
3530 | napi_disable(&tp->napi); | 3549 | napi_disable(&tp->napi); |
3531 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 3550 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { |
3532 | rtl_stop_rx(tp); | 3551 | rtl_stop_rx(tp); |
3533 | rtl_runtime_suspend_enable(tp, true); | 3552 | tp->rtl_ops.autosuspend_en(tp, true); |
3534 | } else { | 3553 | } else { |
3535 | cancel_delayed_work_sync(&tp->schedule); | 3554 | cancel_delayed_work_sync(&tp->schedule); |
3536 | tp->rtl_ops.down(tp); | 3555 | tp->rtl_ops.down(tp); |
@@ -3557,7 +3576,7 @@ static int rtl8152_resume(struct usb_interface *intf) | |||
3557 | 3576 | ||
3558 | if (netif_running(tp->netdev) && tp->netdev->flags & IFF_UP) { | 3577 | if (netif_running(tp->netdev) && tp->netdev->flags & IFF_UP) { |
3559 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 3578 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { |
3560 | rtl_runtime_suspend_enable(tp, false); | 3579 | tp->rtl_ops.autosuspend_en(tp, false); |
3561 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | 3580 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); |
3562 | napi_disable(&tp->napi); | 3581 | napi_disable(&tp->napi); |
3563 | set_bit(WORK_ENABLE, &tp->flags); | 3582 | set_bit(WORK_ENABLE, &tp->flags); |
@@ -3572,7 +3591,7 @@ static int rtl8152_resume(struct usb_interface *intf) | |||
3572 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); | 3591 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); |
3573 | } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 3592 | } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { |
3574 | if (tp->netdev->flags & IFF_UP) | 3593 | if (tp->netdev->flags & IFF_UP) |
3575 | rtl_runtime_suspend_enable(tp, false); | 3594 | tp->rtl_ops.autosuspend_en(tp, false); |
3576 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | 3595 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); |
3577 | } | 3596 | } |
3578 | 3597 | ||
@@ -4158,6 +4177,7 @@ static int rtl_ops_init(struct r8152 *tp) | |||
4158 | ops->eee_set = r8152_set_eee; | 4177 | ops->eee_set = r8152_set_eee; |
4159 | ops->in_nway = rtl8152_in_nway; | 4178 | ops->in_nway = rtl8152_in_nway; |
4160 | ops->hw_phy_cfg = r8152b_hw_phy_cfg; | 4179 | ops->hw_phy_cfg = r8152b_hw_phy_cfg; |
4180 | ops->autosuspend_en = rtl_runtime_suspend_enable; | ||
4161 | break; | 4181 | break; |
4162 | 4182 | ||
4163 | case RTL_VER_03: | 4183 | case RTL_VER_03: |
@@ -4174,6 +4194,7 @@ static int rtl_ops_init(struct r8152 *tp) | |||
4174 | ops->eee_set = r8153_set_eee; | 4194 | ops->eee_set = r8153_set_eee; |
4175 | ops->in_nway = rtl8153_in_nway; | 4195 | ops->in_nway = rtl8153_in_nway; |
4176 | ops->hw_phy_cfg = r8153_hw_phy_cfg; | 4196 | ops->hw_phy_cfg = r8153_hw_phy_cfg; |
4197 | ops->autosuspend_en = rtl8153_runtime_enable; | ||
4177 | break; | 4198 | break; |
4178 | 4199 | ||
4179 | default: | 4200 | default: |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 61ba46404937..6086a0163249 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -395,8 +395,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu) | |||
395 | dev->hard_mtu = net->mtu + net->hard_header_len; | 395 | dev->hard_mtu = net->mtu + net->hard_header_len; |
396 | if (dev->rx_urb_size == old_hard_mtu) { | 396 | if (dev->rx_urb_size == old_hard_mtu) { |
397 | dev->rx_urb_size = dev->hard_mtu; | 397 | dev->rx_urb_size = dev->hard_mtu; |
398 | if (dev->rx_urb_size > old_rx_urb_size) | 398 | if (dev->rx_urb_size > old_rx_urb_size) { |
399 | usbnet_pause_rx(dev); | ||
399 | usbnet_unlink_rx_urbs(dev); | 400 | usbnet_unlink_rx_urbs(dev); |
401 | usbnet_resume_rx(dev); | ||
402 | } | ||
400 | } | 403 | } |
401 | 404 | ||
402 | /* max qlen depend on hard_mtu and rx_urb_size */ | 405 | /* max qlen depend on hard_mtu and rx_urb_size */ |
@@ -1508,8 +1511,9 @@ static void usbnet_bh (unsigned long param) | |||
1508 | } else if (netif_running (dev->net) && | 1511 | } else if (netif_running (dev->net) && |
1509 | netif_device_present (dev->net) && | 1512 | netif_device_present (dev->net) && |
1510 | netif_carrier_ok(dev->net) && | 1513 | netif_carrier_ok(dev->net) && |
1511 | !timer_pending (&dev->delay) && | 1514 | !timer_pending(&dev->delay) && |
1512 | !test_bit (EVENT_RX_HALT, &dev->flags)) { | 1515 | !test_bit(EVENT_RX_PAUSED, &dev->flags) && |
1516 | !test_bit(EVENT_RX_HALT, &dev->flags)) { | ||
1513 | int temp = dev->rxq.qlen; | 1517 | int temp = dev->rxq.qlen; |
1514 | 1518 | ||
1515 | if (temp < RX_QLEN(dev)) { | 1519 | if (temp < RX_QLEN(dev)) { |