aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_3ad.c16
-rw-r--r--drivers/net/bonding/bond_main.c124
-rw-r--r--drivers/net/bonding/bonding.h47
-rw-r--r--drivers/net/can/flexcan.c172
-rw-r--r--drivers/net/ethernet/broadcom/b44.c14
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c9
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c3
-rw-r--r--drivers/net/ethernet/broadcom/tg3.h6
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c40
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c1
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h4
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c84
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c13
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h4
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/main.c4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c1
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c5
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c9
-rw-r--r--drivers/net/ethernet/realtek/r8169.c2
-rw-r--r--drivers/net/ethernet/sfc/ptp.c7
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c2
-rw-r--r--drivers/net/ethernet/ti/cpsw.c6
-rw-r--r--drivers/net/macvlan.c7
-rw-r--r--drivers/net/phy/phy_device.c16
-rw-r--r--drivers/net/tun.c4
-rw-r--r--drivers/net/usb/ax88179_178a.c34
-rw-r--r--drivers/net/veth.c3
-rw-r--r--drivers/net/virtio_net.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c70
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c13
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c14
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/sta.c1
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/tx.c14
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/tx.c18
-rw-r--r--drivers/net/wireless/libertas/cfg.c2
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c34
-rw-r--r--drivers/net/wireless/mwifiex/usb.c12
-rw-r--r--drivers/net/wireless/mwifiex/wmm.c3
-rw-r--r--drivers/net/xen-netfront.c1
45 files changed, 554 insertions, 292 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 6d20fbde8d43..dcde56057fe1 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -181,7 +181,7 @@ static inline int __agg_has_partner(struct aggregator *agg)
181 */ 181 */
182static inline void __disable_port(struct port *port) 182static inline void __disable_port(struct port *port)
183{ 183{
184 bond_set_slave_inactive_flags(port->slave); 184 bond_set_slave_inactive_flags(port->slave, BOND_SLAVE_NOTIFY_LATER);
185} 185}
186 186
187/** 187/**
@@ -193,7 +193,7 @@ static inline void __enable_port(struct port *port)
193 struct slave *slave = port->slave; 193 struct slave *slave = port->slave;
194 194
195 if ((slave->link == BOND_LINK_UP) && IS_UP(slave->dev)) 195 if ((slave->link == BOND_LINK_UP) && IS_UP(slave->dev))
196 bond_set_slave_active_flags(slave); 196 bond_set_slave_active_flags(slave, BOND_SLAVE_NOTIFY_LATER);
197} 197}
198 198
199/** 199/**
@@ -2062,6 +2062,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2062 struct list_head *iter; 2062 struct list_head *iter;
2063 struct slave *slave; 2063 struct slave *slave;
2064 struct port *port; 2064 struct port *port;
2065 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
2065 2066
2066 read_lock(&bond->lock); 2067 read_lock(&bond->lock);
2067 rcu_read_lock(); 2068 rcu_read_lock();
@@ -2119,8 +2120,19 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2119 } 2120 }
2120 2121
2121re_arm: 2122re_arm:
2123 bond_for_each_slave_rcu(bond, slave, iter) {
2124 if (slave->should_notify) {
2125 should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
2126 break;
2127 }
2128 }
2122 rcu_read_unlock(); 2129 rcu_read_unlock();
2123 read_unlock(&bond->lock); 2130 read_unlock(&bond->lock);
2131
2132 if (should_notify_rtnl && rtnl_trylock()) {
2133 bond_slave_state_notify(bond);
2134 rtnl_unlock();
2135 }
2124 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks); 2136 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
2125} 2137}
2126 2138
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1c6104d3501d..e5628fc725c3 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -829,21 +829,25 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
829 if (bond_is_lb(bond)) { 829 if (bond_is_lb(bond)) {
830 bond_alb_handle_active_change(bond, new_active); 830 bond_alb_handle_active_change(bond, new_active);
831 if (old_active) 831 if (old_active)
832 bond_set_slave_inactive_flags(old_active); 832 bond_set_slave_inactive_flags(old_active,
833 BOND_SLAVE_NOTIFY_NOW);
833 if (new_active) 834 if (new_active)
834 bond_set_slave_active_flags(new_active); 835 bond_set_slave_active_flags(new_active,
836 BOND_SLAVE_NOTIFY_NOW);
835 } else { 837 } else {
836 rcu_assign_pointer(bond->curr_active_slave, new_active); 838 rcu_assign_pointer(bond->curr_active_slave, new_active);
837 } 839 }
838 840
839 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) { 841 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP) {
840 if (old_active) 842 if (old_active)
841 bond_set_slave_inactive_flags(old_active); 843 bond_set_slave_inactive_flags(old_active,
844 BOND_SLAVE_NOTIFY_NOW);
842 845
843 if (new_active) { 846 if (new_active) {
844 bool should_notify_peers = false; 847 bool should_notify_peers = false;
845 848
846 bond_set_slave_active_flags(new_active); 849 bond_set_slave_active_flags(new_active,
850 BOND_SLAVE_NOTIFY_NOW);
847 851
848 if (bond->params.fail_over_mac) 852 if (bond->params.fail_over_mac)
849 bond_do_fail_over_mac(bond, new_active, 853 bond_do_fail_over_mac(bond, new_active,
@@ -1193,6 +1197,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1193 return -EBUSY; 1197 return -EBUSY;
1194 } 1198 }
1195 1199
1200 if (bond_dev == slave_dev) {
1201 pr_err("%s: cannot enslave bond to itself.\n", bond_dev->name);
1202 return -EPERM;
1203 }
1204
1196 /* vlan challenged mutual exclusion */ 1205 /* vlan challenged mutual exclusion */
1197 /* no need to lock since we're protected by rtnl_lock */ 1206 /* no need to lock since we're protected by rtnl_lock */
1198 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { 1207 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
@@ -1463,14 +1472,15 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1463 1472
1464 switch (bond->params.mode) { 1473 switch (bond->params.mode) {
1465 case BOND_MODE_ACTIVEBACKUP: 1474 case BOND_MODE_ACTIVEBACKUP:
1466 bond_set_slave_inactive_flags(new_slave); 1475 bond_set_slave_inactive_flags(new_slave,
1476 BOND_SLAVE_NOTIFY_NOW);
1467 break; 1477 break;
1468 case BOND_MODE_8023AD: 1478 case BOND_MODE_8023AD:
1469 /* in 802.3ad mode, the internal mechanism 1479 /* in 802.3ad mode, the internal mechanism
1470 * will activate the slaves in the selected 1480 * will activate the slaves in the selected
1471 * aggregator 1481 * aggregator
1472 */ 1482 */
1473 bond_set_slave_inactive_flags(new_slave); 1483 bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW);
1474 /* if this is the first slave */ 1484 /* if this is the first slave */
1475 if (!prev_slave) { 1485 if (!prev_slave) {
1476 SLAVE_AD_INFO(new_slave).id = 1; 1486 SLAVE_AD_INFO(new_slave).id = 1;
@@ -1488,7 +1498,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1488 case BOND_MODE_TLB: 1498 case BOND_MODE_TLB:
1489 case BOND_MODE_ALB: 1499 case BOND_MODE_ALB:
1490 bond_set_active_slave(new_slave); 1500 bond_set_active_slave(new_slave);
1491 bond_set_slave_inactive_flags(new_slave); 1501 bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW);
1492 break; 1502 break;
1493 default: 1503 default:
1494 pr_debug("This slave is always active in trunk mode\n"); 1504 pr_debug("This slave is always active in trunk mode\n");
@@ -1654,9 +1664,6 @@ static int __bond_release_one(struct net_device *bond_dev,
1654 return -EINVAL; 1664 return -EINVAL;
1655 } 1665 }
1656 1666
1657 /* release the slave from its bond */
1658 bond->slave_cnt--;
1659
1660 bond_sysfs_slave_del(slave); 1667 bond_sysfs_slave_del(slave);
1661 1668
1662 bond_upper_dev_unlink(bond_dev, slave_dev); 1669 bond_upper_dev_unlink(bond_dev, slave_dev);
@@ -1738,6 +1745,7 @@ static int __bond_release_one(struct net_device *bond_dev,
1738 1745
1739 unblock_netpoll_tx(); 1746 unblock_netpoll_tx();
1740 synchronize_rcu(); 1747 synchronize_rcu();
1748 bond->slave_cnt--;
1741 1749
1742 if (!bond_has_slaves(bond)) { 1750 if (!bond_has_slaves(bond)) {
1743 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev); 1751 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
@@ -2015,7 +2023,8 @@ static void bond_miimon_commit(struct bonding *bond)
2015 2023
2016 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || 2024 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP ||
2017 bond->params.mode == BOND_MODE_8023AD) 2025 bond->params.mode == BOND_MODE_8023AD)
2018 bond_set_slave_inactive_flags(slave); 2026 bond_set_slave_inactive_flags(slave,
2027 BOND_SLAVE_NOTIFY_NOW);
2019 2028
2020 pr_info("%s: link status definitely down for interface %s, disabling it\n", 2029 pr_info("%s: link status definitely down for interface %s, disabling it\n",
2021 bond->dev->name, slave->dev->name); 2030 bond->dev->name, slave->dev->name);
@@ -2562,7 +2571,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2562 slave->link = BOND_LINK_UP; 2571 slave->link = BOND_LINK_UP;
2563 if (bond->current_arp_slave) { 2572 if (bond->current_arp_slave) {
2564 bond_set_slave_inactive_flags( 2573 bond_set_slave_inactive_flags(
2565 bond->current_arp_slave); 2574 bond->current_arp_slave,
2575 BOND_SLAVE_NOTIFY_NOW);
2566 bond->current_arp_slave = NULL; 2576 bond->current_arp_slave = NULL;
2567 } 2577 }
2568 2578
@@ -2582,7 +2592,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2582 slave->link_failure_count++; 2592 slave->link_failure_count++;
2583 2593
2584 slave->link = BOND_LINK_DOWN; 2594 slave->link = BOND_LINK_DOWN;
2585 bond_set_slave_inactive_flags(slave); 2595 bond_set_slave_inactive_flags(slave,
2596 BOND_SLAVE_NOTIFY_NOW);
2586 2597
2587 pr_info("%s: link status definitely down for interface %s, disabling it\n", 2598 pr_info("%s: link status definitely down for interface %s, disabling it\n",
2588 bond->dev->name, slave->dev->name); 2599 bond->dev->name, slave->dev->name);
@@ -2615,17 +2626,17 @@ do_failover:
2615 2626
2616/* 2627/*
2617 * Send ARP probes for active-backup mode ARP monitor. 2628 * Send ARP probes for active-backup mode ARP monitor.
2629 *
2630 * Called with rcu_read_lock hold.
2618 */ 2631 */
2619static bool bond_ab_arp_probe(struct bonding *bond) 2632static bool bond_ab_arp_probe(struct bonding *bond)
2620{ 2633{
2621 struct slave *slave, *before = NULL, *new_slave = NULL, 2634 struct slave *slave, *before = NULL, *new_slave = NULL,
2622 *curr_arp_slave, *curr_active_slave; 2635 *curr_arp_slave = rcu_dereference(bond->current_arp_slave),
2636 *curr_active_slave = rcu_dereference(bond->curr_active_slave);
2623 struct list_head *iter; 2637 struct list_head *iter;
2624 bool found = false; 2638 bool found = false;
2625 2639 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
2626 rcu_read_lock();
2627 curr_arp_slave = rcu_dereference(bond->current_arp_slave);
2628 curr_active_slave = rcu_dereference(bond->curr_active_slave);
2629 2640
2630 if (curr_arp_slave && curr_active_slave) 2641 if (curr_arp_slave && curr_active_slave)
2631 pr_info("PROBE: c_arp %s && cas %s BAD\n", 2642 pr_info("PROBE: c_arp %s && cas %s BAD\n",
@@ -2634,32 +2645,23 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2634 2645
2635 if (curr_active_slave) { 2646 if (curr_active_slave) {
2636 bond_arp_send_all(bond, curr_active_slave); 2647 bond_arp_send_all(bond, curr_active_slave);
2637 rcu_read_unlock(); 2648 return should_notify_rtnl;
2638 return true;
2639 } 2649 }
2640 rcu_read_unlock();
2641 2650
2642 /* if we don't have a curr_active_slave, search for the next available 2651 /* if we don't have a curr_active_slave, search for the next available
2643 * backup slave from the current_arp_slave and make it the candidate 2652 * backup slave from the current_arp_slave and make it the candidate
2644 * for becoming the curr_active_slave 2653 * for becoming the curr_active_slave
2645 */ 2654 */
2646 2655
2647 if (!rtnl_trylock())
2648 return false;
2649 /* curr_arp_slave might have gone away */
2650 curr_arp_slave = ACCESS_ONCE(bond->current_arp_slave);
2651
2652 if (!curr_arp_slave) { 2656 if (!curr_arp_slave) {
2653 curr_arp_slave = bond_first_slave(bond); 2657 curr_arp_slave = bond_first_slave_rcu(bond);
2654 if (!curr_arp_slave) { 2658 if (!curr_arp_slave)
2655 rtnl_unlock(); 2659 return should_notify_rtnl;
2656 return true;
2657 }
2658 } 2660 }
2659 2661
2660 bond_set_slave_inactive_flags(curr_arp_slave); 2662 bond_set_slave_inactive_flags(curr_arp_slave, BOND_SLAVE_NOTIFY_LATER);
2661 2663
2662 bond_for_each_slave(bond, slave, iter) { 2664 bond_for_each_slave_rcu(bond, slave, iter) {
2663 if (!found && !before && IS_UP(slave->dev)) 2665 if (!found && !before && IS_UP(slave->dev))
2664 before = slave; 2666 before = slave;
2665 2667
@@ -2677,7 +2679,8 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2677 if (slave->link_failure_count < UINT_MAX) 2679 if (slave->link_failure_count < UINT_MAX)
2678 slave->link_failure_count++; 2680 slave->link_failure_count++;
2679 2681
2680 bond_set_slave_inactive_flags(slave); 2682 bond_set_slave_inactive_flags(slave,
2683 BOND_SLAVE_NOTIFY_LATER);
2681 2684
2682 pr_info("%s: backup interface %s is now down.\n", 2685 pr_info("%s: backup interface %s is now down.\n",
2683 bond->dev->name, slave->dev->name); 2686 bond->dev->name, slave->dev->name);
@@ -2689,26 +2692,31 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2689 if (!new_slave && before) 2692 if (!new_slave && before)
2690 new_slave = before; 2693 new_slave = before;
2691 2694
2692 if (!new_slave) { 2695 if (!new_slave)
2693 rtnl_unlock(); 2696 goto check_state;
2694 return true;
2695 }
2696 2697
2697 new_slave->link = BOND_LINK_BACK; 2698 new_slave->link = BOND_LINK_BACK;
2698 bond_set_slave_active_flags(new_slave); 2699 bond_set_slave_active_flags(new_slave, BOND_SLAVE_NOTIFY_LATER);
2699 bond_arp_send_all(bond, new_slave); 2700 bond_arp_send_all(bond, new_slave);
2700 new_slave->jiffies = jiffies; 2701 new_slave->jiffies = jiffies;
2701 rcu_assign_pointer(bond->current_arp_slave, new_slave); 2702 rcu_assign_pointer(bond->current_arp_slave, new_slave);
2702 rtnl_unlock();
2703 2703
2704 return true; 2704check_state:
2705 bond_for_each_slave_rcu(bond, slave, iter) {
2706 if (slave->should_notify) {
2707 should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
2708 break;
2709 }
2710 }
2711 return should_notify_rtnl;
2705} 2712}
2706 2713
2707static void bond_activebackup_arp_mon(struct work_struct *work) 2714static void bond_activebackup_arp_mon(struct work_struct *work)
2708{ 2715{
2709 struct bonding *bond = container_of(work, struct bonding, 2716 struct bonding *bond = container_of(work, struct bonding,
2710 arp_work.work); 2717 arp_work.work);
2711 bool should_notify_peers = false, should_commit = false; 2718 bool should_notify_peers = false;
2719 bool should_notify_rtnl = false;
2712 int delta_in_ticks; 2720 int delta_in_ticks;
2713 2721
2714 delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval); 2722 delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
@@ -2717,11 +2725,12 @@ static void bond_activebackup_arp_mon(struct work_struct *work)
2717 goto re_arm; 2725 goto re_arm;
2718 2726
2719 rcu_read_lock(); 2727 rcu_read_lock();
2728
2720 should_notify_peers = bond_should_notify_peers(bond); 2729 should_notify_peers = bond_should_notify_peers(bond);
2721 should_commit = bond_ab_arp_inspect(bond);
2722 rcu_read_unlock();
2723 2730
2724 if (should_commit) { 2731 if (bond_ab_arp_inspect(bond)) {
2732 rcu_read_unlock();
2733
2725 /* Race avoidance with bond_close flush of workqueue */ 2734 /* Race avoidance with bond_close flush of workqueue */
2726 if (!rtnl_trylock()) { 2735 if (!rtnl_trylock()) {
2727 delta_in_ticks = 1; 2736 delta_in_ticks = 1;
@@ -2730,23 +2739,28 @@ static void bond_activebackup_arp_mon(struct work_struct *work)
2730 } 2739 }
2731 2740
2732 bond_ab_arp_commit(bond); 2741 bond_ab_arp_commit(bond);
2742
2733 rtnl_unlock(); 2743 rtnl_unlock();
2744 rcu_read_lock();
2734 } 2745 }
2735 2746
2736 if (!bond_ab_arp_probe(bond)) { 2747 should_notify_rtnl = bond_ab_arp_probe(bond);
2737 /* rtnl locking failed, re-arm */ 2748 rcu_read_unlock();
2738 delta_in_ticks = 1;
2739 should_notify_peers = false;
2740 }
2741 2749
2742re_arm: 2750re_arm:
2743 if (bond->params.arp_interval) 2751 if (bond->params.arp_interval)
2744 queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks); 2752 queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks);
2745 2753
2746 if (should_notify_peers) { 2754 if (should_notify_peers || should_notify_rtnl) {
2747 if (!rtnl_trylock()) 2755 if (!rtnl_trylock())
2748 return; 2756 return;
2749 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev); 2757
2758 if (should_notify_peers)
2759 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
2760 bond->dev);
2761 if (should_notify_rtnl)
2762 bond_slave_state_notify(bond);
2763
2750 rtnl_unlock(); 2764 rtnl_unlock();
2751 } 2765 }
2752} 2766}
@@ -3046,9 +3060,11 @@ static int bond_open(struct net_device *bond_dev)
3046 bond_for_each_slave(bond, slave, iter) { 3060 bond_for_each_slave(bond, slave, iter) {
3047 if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP) 3061 if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)
3048 && (slave != bond->curr_active_slave)) { 3062 && (slave != bond->curr_active_slave)) {
3049 bond_set_slave_inactive_flags(slave); 3063 bond_set_slave_inactive_flags(slave,
3064 BOND_SLAVE_NOTIFY_NOW);
3050 } else { 3065 } else {
3051 bond_set_slave_active_flags(slave); 3066 bond_set_slave_active_flags(slave,
3067 BOND_SLAVE_NOTIFY_NOW);
3052 } 3068 }
3053 } 3069 }
3054 read_unlock(&bond->curr_slave_lock); 3070 read_unlock(&bond->curr_slave_lock);
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 86ccfb9f71cc..2b0fdec695f7 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -195,7 +195,8 @@ struct slave {
195 s8 new_link; 195 s8 new_link;
196 u8 backup:1, /* indicates backup slave. Value corresponds with 196 u8 backup:1, /* indicates backup slave. Value corresponds with
197 BOND_STATE_ACTIVE and BOND_STATE_BACKUP */ 197 BOND_STATE_ACTIVE and BOND_STATE_BACKUP */
198 inactive:1; /* indicates inactive slave */ 198 inactive:1, /* indicates inactive slave */
199 should_notify:1; /* indicateds whether the state changed */
199 u8 duplex; 200 u8 duplex;
200 u32 original_mtu; 201 u32 original_mtu;
201 u32 link_failure_count; 202 u32 link_failure_count;
@@ -303,6 +304,24 @@ static inline void bond_set_backup_slave(struct slave *slave)
303 } 304 }
304} 305}
305 306
307static inline void bond_set_slave_state(struct slave *slave,
308 int slave_state, bool notify)
309{
310 if (slave->backup == slave_state)
311 return;
312
313 slave->backup = slave_state;
314 if (notify) {
315 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL);
316 slave->should_notify = 0;
317 } else {
318 if (slave->should_notify)
319 slave->should_notify = 0;
320 else
321 slave->should_notify = 1;
322 }
323}
324
306static inline void bond_slave_state_change(struct bonding *bond) 325static inline void bond_slave_state_change(struct bonding *bond)
307{ 326{
308 struct list_head *iter; 327 struct list_head *iter;
@@ -316,6 +335,19 @@ static inline void bond_slave_state_change(struct bonding *bond)
316 } 335 }
317} 336}
318 337
338static inline void bond_slave_state_notify(struct bonding *bond)
339{
340 struct list_head *iter;
341 struct slave *tmp;
342
343 bond_for_each_slave(bond, tmp, iter) {
344 if (tmp->should_notify) {
345 rtmsg_ifinfo(RTM_NEWLINK, tmp->dev, 0, GFP_KERNEL);
346 tmp->should_notify = 0;
347 }
348 }
349}
350
319static inline int bond_slave_state(struct slave *slave) 351static inline int bond_slave_state(struct slave *slave)
320{ 352{
321 return slave->backup; 353 return slave->backup;
@@ -343,6 +375,9 @@ static inline bool bond_is_active_slave(struct slave *slave)
343#define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \ 375#define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \
344 BOND_ARP_VALIDATE_BACKUP) 376 BOND_ARP_VALIDATE_BACKUP)
345 377
378#define BOND_SLAVE_NOTIFY_NOW true
379#define BOND_SLAVE_NOTIFY_LATER false
380
346static inline int slave_do_arp_validate(struct bonding *bond, 381static inline int slave_do_arp_validate(struct bonding *bond,
347 struct slave *slave) 382 struct slave *slave)
348{ 383{
@@ -394,17 +429,19 @@ static inline void bond_netpoll_send_skb(const struct slave *slave,
394} 429}
395#endif 430#endif
396 431
397static inline void bond_set_slave_inactive_flags(struct slave *slave) 432static inline void bond_set_slave_inactive_flags(struct slave *slave,
433 bool notify)
398{ 434{
399 if (!bond_is_lb(slave->bond)) 435 if (!bond_is_lb(slave->bond))
400 bond_set_backup_slave(slave); 436 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify);
401 if (!slave->bond->params.all_slaves_active) 437 if (!slave->bond->params.all_slaves_active)
402 slave->inactive = 1; 438 slave->inactive = 1;
403} 439}
404 440
405static inline void bond_set_slave_active_flags(struct slave *slave) 441static inline void bond_set_slave_active_flags(struct slave *slave,
442 bool notify)
406{ 443{
407 bond_set_active_slave(slave); 444 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
408 slave->inactive = 0; 445 slave->inactive = 0;
409} 446}
410 447
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 320bef2dba42..61376abdab39 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -144,6 +144,8 @@
144 144
145#define FLEXCAN_MB_CODE_MASK (0xf0ffffff) 145#define FLEXCAN_MB_CODE_MASK (0xf0ffffff)
146 146
147#define FLEXCAN_TIMEOUT_US (50)
148
147/* 149/*
148 * FLEXCAN hardware feature flags 150 * FLEXCAN hardware feature flags
149 * 151 *
@@ -262,6 +264,22 @@ static inline void flexcan_write(u32 val, void __iomem *addr)
262} 264}
263#endif 265#endif
264 266
267static inline int flexcan_transceiver_enable(const struct flexcan_priv *priv)
268{
269 if (!priv->reg_xceiver)
270 return 0;
271
272 return regulator_enable(priv->reg_xceiver);
273}
274
275static inline int flexcan_transceiver_disable(const struct flexcan_priv *priv)
276{
277 if (!priv->reg_xceiver)
278 return 0;
279
280 return regulator_disable(priv->reg_xceiver);
281}
282
265static inline int flexcan_has_and_handle_berr(const struct flexcan_priv *priv, 283static inline int flexcan_has_and_handle_berr(const struct flexcan_priv *priv,
266 u32 reg_esr) 284 u32 reg_esr)
267{ 285{
@@ -269,26 +287,95 @@ static inline int flexcan_has_and_handle_berr(const struct flexcan_priv *priv,
269 (reg_esr & FLEXCAN_ESR_ERR_BUS); 287 (reg_esr & FLEXCAN_ESR_ERR_BUS);
270} 288}
271 289
272static inline void flexcan_chip_enable(struct flexcan_priv *priv) 290static int flexcan_chip_enable(struct flexcan_priv *priv)
273{ 291{
274 struct flexcan_regs __iomem *regs = priv->base; 292 struct flexcan_regs __iomem *regs = priv->base;
293 unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
275 u32 reg; 294 u32 reg;
276 295
277 reg = flexcan_read(&regs->mcr); 296 reg = flexcan_read(&regs->mcr);
278 reg &= ~FLEXCAN_MCR_MDIS; 297 reg &= ~FLEXCAN_MCR_MDIS;
279 flexcan_write(reg, &regs->mcr); 298 flexcan_write(reg, &regs->mcr);
280 299
281 udelay(10); 300 while (timeout-- && (flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
301 usleep_range(10, 20);
302
303 if (flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK)
304 return -ETIMEDOUT;
305
306 return 0;
282} 307}
283 308
284static inline void flexcan_chip_disable(struct flexcan_priv *priv) 309static int flexcan_chip_disable(struct flexcan_priv *priv)
285{ 310{
286 struct flexcan_regs __iomem *regs = priv->base; 311 struct flexcan_regs __iomem *regs = priv->base;
312 unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
287 u32 reg; 313 u32 reg;
288 314
289 reg = flexcan_read(&regs->mcr); 315 reg = flexcan_read(&regs->mcr);
290 reg |= FLEXCAN_MCR_MDIS; 316 reg |= FLEXCAN_MCR_MDIS;
291 flexcan_write(reg, &regs->mcr); 317 flexcan_write(reg, &regs->mcr);
318
319 while (timeout-- && !(flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
320 usleep_range(10, 20);
321
322 if (!(flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
323 return -ETIMEDOUT;
324
325 return 0;
326}
327
328static int flexcan_chip_freeze(struct flexcan_priv *priv)
329{
330 struct flexcan_regs __iomem *regs = priv->base;
331 unsigned int timeout = 1000 * 1000 * 10 / priv->can.bittiming.bitrate;
332 u32 reg;
333
334 reg = flexcan_read(&regs->mcr);
335 reg |= FLEXCAN_MCR_HALT;
336 flexcan_write(reg, &regs->mcr);
337
338 while (timeout-- && !(flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))
339 usleep_range(100, 200);
340
341 if (!(flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))
342 return -ETIMEDOUT;
343
344 return 0;
345}
346
347static int flexcan_chip_unfreeze(struct flexcan_priv *priv)
348{
349 struct flexcan_regs __iomem *regs = priv->base;
350 unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
351 u32 reg;
352
353 reg = flexcan_read(&regs->mcr);
354 reg &= ~FLEXCAN_MCR_HALT;
355 flexcan_write(reg, &regs->mcr);
356
357 while (timeout-- && (flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))
358 usleep_range(10, 20);
359
360 if (flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK)
361 return -ETIMEDOUT;
362
363 return 0;
364}
365
366static int flexcan_chip_softreset(struct flexcan_priv *priv)
367{
368 struct flexcan_regs __iomem *regs = priv->base;
369 unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
370
371 flexcan_write(FLEXCAN_MCR_SOFTRST, &regs->mcr);
372 while (timeout-- && (flexcan_read(&regs->mcr) & FLEXCAN_MCR_SOFTRST))
373 usleep_range(10, 20);
374
375 if (flexcan_read(&regs->mcr) & FLEXCAN_MCR_SOFTRST)
376 return -ETIMEDOUT;
377
378 return 0;
292} 379}
293 380
294static int flexcan_get_berr_counter(const struct net_device *dev, 381static int flexcan_get_berr_counter(const struct net_device *dev,
@@ -709,19 +796,14 @@ static int flexcan_chip_start(struct net_device *dev)
709 u32 reg_mcr, reg_ctrl; 796 u32 reg_mcr, reg_ctrl;
710 797
711 /* enable module */ 798 /* enable module */
712 flexcan_chip_enable(priv); 799 err = flexcan_chip_enable(priv);
800 if (err)
801 return err;
713 802
714 /* soft reset */ 803 /* soft reset */
715 flexcan_write(FLEXCAN_MCR_SOFTRST, &regs->mcr); 804 err = flexcan_chip_softreset(priv);
716 udelay(10); 805 if (err)
717 806 goto out_chip_disable;
718 reg_mcr = flexcan_read(&regs->mcr);
719 if (reg_mcr & FLEXCAN_MCR_SOFTRST) {
720 netdev_err(dev, "Failed to softreset can module (mcr=0x%08x)\n",
721 reg_mcr);
722 err = -ENODEV;
723 goto out;
724 }
725 807
726 flexcan_set_bittiming(dev); 808 flexcan_set_bittiming(dev);
727 809
@@ -788,16 +870,14 @@ static int flexcan_chip_start(struct net_device *dev)
788 if (priv->devtype_data->features & FLEXCAN_HAS_V10_FEATURES) 870 if (priv->devtype_data->features & FLEXCAN_HAS_V10_FEATURES)
789 flexcan_write(0x0, &regs->rxfgmask); 871 flexcan_write(0x0, &regs->rxfgmask);
790 872
791 if (priv->reg_xceiver) { 873 err = flexcan_transceiver_enable(priv);
792 err = regulator_enable(priv->reg_xceiver); 874 if (err)
793 if (err) 875 goto out_chip_disable;
794 goto out;
795 }
796 876
797 /* synchronize with the can bus */ 877 /* synchronize with the can bus */
798 reg_mcr = flexcan_read(&regs->mcr); 878 err = flexcan_chip_unfreeze(priv);
799 reg_mcr &= ~FLEXCAN_MCR_HALT; 879 if (err)
800 flexcan_write(reg_mcr, &regs->mcr); 880 goto out_transceiver_disable;
801 881
802 priv->can.state = CAN_STATE_ERROR_ACTIVE; 882 priv->can.state = CAN_STATE_ERROR_ACTIVE;
803 883
@@ -810,7 +890,9 @@ static int flexcan_chip_start(struct net_device *dev)
810 890
811 return 0; 891 return 0;
812 892
813 out: 893 out_transceiver_disable:
894 flexcan_transceiver_disable(priv);
895 out_chip_disable:
814 flexcan_chip_disable(priv); 896 flexcan_chip_disable(priv);
815 return err; 897 return err;
816} 898}
@@ -825,18 +907,17 @@ static void flexcan_chip_stop(struct net_device *dev)
825{ 907{
826 struct flexcan_priv *priv = netdev_priv(dev); 908 struct flexcan_priv *priv = netdev_priv(dev);
827 struct flexcan_regs __iomem *regs = priv->base; 909 struct flexcan_regs __iomem *regs = priv->base;
828 u32 reg; 910
911 /* freeze + disable module */
912 flexcan_chip_freeze(priv);
913 flexcan_chip_disable(priv);
829 914
830 /* Disable all interrupts */ 915 /* Disable all interrupts */
831 flexcan_write(0, &regs->imask1); 916 flexcan_write(0, &regs->imask1);
917 flexcan_write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
918 &regs->ctrl);
832 919
833 /* Disable + halt module */ 920 flexcan_transceiver_disable(priv);
834 reg = flexcan_read(&regs->mcr);
835 reg |= FLEXCAN_MCR_MDIS | FLEXCAN_MCR_HALT;
836 flexcan_write(reg, &regs->mcr);
837
838 if (priv->reg_xceiver)
839 regulator_disable(priv->reg_xceiver);
840 priv->can.state = CAN_STATE_STOPPED; 921 priv->can.state = CAN_STATE_STOPPED;
841 922
842 return; 923 return;
@@ -866,7 +947,7 @@ static int flexcan_open(struct net_device *dev)
866 /* start chip and queuing */ 947 /* start chip and queuing */
867 err = flexcan_chip_start(dev); 948 err = flexcan_chip_start(dev);
868 if (err) 949 if (err)
869 goto out_close; 950 goto out_free_irq;
870 951
871 can_led_event(dev, CAN_LED_EVENT_OPEN); 952 can_led_event(dev, CAN_LED_EVENT_OPEN);
872 953
@@ -875,6 +956,8 @@ static int flexcan_open(struct net_device *dev)
875 956
876 return 0; 957 return 0;
877 958
959 out_free_irq:
960 free_irq(dev->irq, dev);
878 out_close: 961 out_close:
879 close_candev(dev); 962 close_candev(dev);
880 out_disable_per: 963 out_disable_per:
@@ -945,12 +1028,16 @@ static int register_flexcandev(struct net_device *dev)
945 goto out_disable_ipg; 1028 goto out_disable_ipg;
946 1029
947 /* select "bus clock", chip must be disabled */ 1030 /* select "bus clock", chip must be disabled */
948 flexcan_chip_disable(priv); 1031 err = flexcan_chip_disable(priv);
1032 if (err)
1033 goto out_disable_per;
949 reg = flexcan_read(&regs->ctrl); 1034 reg = flexcan_read(&regs->ctrl);
950 reg |= FLEXCAN_CTRL_CLK_SRC; 1035 reg |= FLEXCAN_CTRL_CLK_SRC;
951 flexcan_write(reg, &regs->ctrl); 1036 flexcan_write(reg, &regs->ctrl);
952 1037
953 flexcan_chip_enable(priv); 1038 err = flexcan_chip_enable(priv);
1039 if (err)
1040 goto out_chip_disable;
954 1041
955 /* set freeze, halt and activate FIFO, restrict register access */ 1042 /* set freeze, halt and activate FIFO, restrict register access */
956 reg = flexcan_read(&regs->mcr); 1043 reg = flexcan_read(&regs->mcr);
@@ -967,14 +1054,15 @@ static int register_flexcandev(struct net_device *dev)
967 if (!(reg & FLEXCAN_MCR_FEN)) { 1054 if (!(reg & FLEXCAN_MCR_FEN)) {
968 netdev_err(dev, "Could not enable RX FIFO, unsupported core\n"); 1055 netdev_err(dev, "Could not enable RX FIFO, unsupported core\n");
969 err = -ENODEV; 1056 err = -ENODEV;
970 goto out_disable_per; 1057 goto out_chip_disable;
971 } 1058 }
972 1059
973 err = register_candev(dev); 1060 err = register_candev(dev);
974 1061
975 out_disable_per:
976 /* disable core and turn off clocks */ 1062 /* disable core and turn off clocks */
1063 out_chip_disable:
977 flexcan_chip_disable(priv); 1064 flexcan_chip_disable(priv);
1065 out_disable_per:
978 clk_disable_unprepare(priv->clk_per); 1066 clk_disable_unprepare(priv->clk_per);
979 out_disable_ipg: 1067 out_disable_ipg:
980 clk_disable_unprepare(priv->clk_ipg); 1068 clk_disable_unprepare(priv->clk_ipg);
@@ -1104,9 +1192,10 @@ static int flexcan_probe(struct platform_device *pdev)
1104static int flexcan_remove(struct platform_device *pdev) 1192static int flexcan_remove(struct platform_device *pdev)
1105{ 1193{
1106 struct net_device *dev = platform_get_drvdata(pdev); 1194 struct net_device *dev = platform_get_drvdata(pdev);
1195 struct flexcan_priv *priv = netdev_priv(dev);
1107 1196
1108 unregister_flexcandev(dev); 1197 unregister_flexcandev(dev);
1109 1198 netif_napi_del(&priv->napi);
1110 free_candev(dev); 1199 free_candev(dev);
1111 1200
1112 return 0; 1201 return 0;
@@ -1117,8 +1206,11 @@ static int flexcan_suspend(struct device *device)
1117{ 1206{
1118 struct net_device *dev = dev_get_drvdata(device); 1207 struct net_device *dev = dev_get_drvdata(device);
1119 struct flexcan_priv *priv = netdev_priv(dev); 1208 struct flexcan_priv *priv = netdev_priv(dev);
1209 int err;
1120 1210
1121 flexcan_chip_disable(priv); 1211 err = flexcan_chip_disable(priv);
1212 if (err)
1213 return err;
1122 1214
1123 if (netif_running(dev)) { 1215 if (netif_running(dev)) {
1124 netif_stop_queue(dev); 1216 netif_stop_queue(dev);
@@ -1139,9 +1231,7 @@ static int flexcan_resume(struct device *device)
1139 netif_device_attach(dev); 1231 netif_device_attach(dev);
1140 netif_start_queue(dev); 1232 netif_start_queue(dev);
1141 } 1233 }
1142 flexcan_chip_enable(priv); 1234 return flexcan_chip_enable(priv);
1143
1144 return 0;
1145} 1235}
1146#endif /* CONFIG_PM_SLEEP */ 1236#endif /* CONFIG_PM_SLEEP */
1147 1237
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 1f7b5aa114fa..8a7bf7dad898 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -1484,6 +1484,10 @@ static int b44_open(struct net_device *dev)
1484 add_timer(&bp->timer); 1484 add_timer(&bp->timer);
1485 1485
1486 b44_enable_ints(bp); 1486 b44_enable_ints(bp);
1487
1488 if (bp->flags & B44_FLAG_EXTERNAL_PHY)
1489 phy_start(bp->phydev);
1490
1487 netif_start_queue(dev); 1491 netif_start_queue(dev);
1488out: 1492out:
1489 return err; 1493 return err;
@@ -1646,6 +1650,9 @@ static int b44_close(struct net_device *dev)
1646 1650
1647 netif_stop_queue(dev); 1651 netif_stop_queue(dev);
1648 1652
1653 if (bp->flags & B44_FLAG_EXTERNAL_PHY)
1654 phy_stop(bp->phydev);
1655
1649 napi_disable(&bp->napi); 1656 napi_disable(&bp->napi);
1650 1657
1651 del_timer_sync(&bp->timer); 1658 del_timer_sync(&bp->timer);
@@ -2222,7 +2229,12 @@ static void b44_adjust_link(struct net_device *dev)
2222 } 2229 }
2223 2230
2224 if (status_changed) { 2231 if (status_changed) {
2225 b44_check_phy(bp); 2232 u32 val = br32(bp, B44_TX_CTRL);
2233 if (bp->flags & B44_FLAG_FULL_DUPLEX)
2234 val |= TX_CTRL_DUPLEX;
2235 else
2236 val &= ~TX_CTRL_DUPLEX;
2237 bw32(bp, B44_TX_CTRL, val);
2226 phy_print_status(phydev); 2238 phy_print_status(phydev);
2227 } 2239 }
2228} 2240}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 66c0df78c3ff..dbcff509dc3f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3875,7 +3875,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3875 xmit_type); 3875 xmit_type);
3876 } 3876 }
3877 3877
3878 /* Add the macs to the parsing BD this is a vf */ 3878 /* Add the macs to the parsing BD if this is a vf or if
3879 * Tx Switching is enabled.
3880 */
3879 if (IS_VF(bp)) { 3881 if (IS_VF(bp)) {
3880 /* override GRE parameters in BD */ 3882 /* override GRE parameters in BD */
3881 bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.src_hi, 3883 bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.src_hi,
@@ -3887,6 +3889,11 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3887 &pbd_e2->data.mac_addr.dst_mid, 3889 &pbd_e2->data.mac_addr.dst_mid,
3888 &pbd_e2->data.mac_addr.dst_lo, 3890 &pbd_e2->data.mac_addr.dst_lo,
3889 eth->h_dest); 3891 eth->h_dest);
3892 } else if (bp->flags & TX_SWITCHING) {
3893 bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.dst_hi,
3894 &pbd_e2->data.mac_addr.dst_mid,
3895 &pbd_e2->data.mac_addr.dst_lo,
3896 eth->h_dest);
3890 } 3897 }
3891 3898
3892 SET_FLAG(pbd_e2_parsing_data, 3899 SET_FLAG(pbd_e2_parsing_data,
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3167ed6593b0..3b6d0ba86c71 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6843,8 +6843,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
6843 6843
6844 work_mask |= opaque_key; 6844 work_mask |= opaque_key;
6845 6845
6846 if ((desc->err_vlan & RXD_ERR_MASK) != 0 && 6846 if (desc->err_vlan & RXD_ERR_MASK) {
6847 (desc->err_vlan != RXD_ERR_ODD_NIBBLE_RCVD_MII)) {
6848 drop_it: 6847 drop_it:
6849 tg3_recycle_rx(tnapi, tpr, opaque_key, 6848 tg3_recycle_rx(tnapi, tpr, opaque_key,
6850 desc_idx, *post_ptr); 6849 desc_idx, *post_ptr);
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index ef472385bce4..04321e5a356e 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2608,7 +2608,11 @@ struct tg3_rx_buffer_desc {
2608#define RXD_ERR_TOO_SMALL 0x00400000 2608#define RXD_ERR_TOO_SMALL 0x00400000
2609#define RXD_ERR_NO_RESOURCES 0x00800000 2609#define RXD_ERR_NO_RESOURCES 0x00800000
2610#define RXD_ERR_HUGE_FRAME 0x01000000 2610#define RXD_ERR_HUGE_FRAME 0x01000000
2611#define RXD_ERR_MASK 0xffff0000 2611
2612#define RXD_ERR_MASK (RXD_ERR_BAD_CRC | RXD_ERR_COLLISION | \
2613 RXD_ERR_LINK_LOST | RXD_ERR_PHY_DECODE | \
2614 RXD_ERR_MAC_ABRT | RXD_ERR_TOO_SMALL | \
2615 RXD_ERR_NO_RESOURCES | RXD_ERR_HUGE_FRAME)
2612 2616
2613 u32 reserved; 2617 u32 reserved;
2614 u32 opaque; 2618 u32 opaque;
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index cf64f3d0b60d..4ad1187e82fb 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -707,7 +707,8 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget)
707 else 707 else
708 skb_checksum_none_assert(skb); 708 skb_checksum_none_assert(skb);
709 709
710 if (flags & BNA_CQ_EF_VLAN) 710 if ((flags & BNA_CQ_EF_VLAN) &&
711 (bnad->netdev->features & NETIF_F_HW_VLAN_CTAG_RX))
711 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cmpl->vlan_tag)); 712 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cmpl->vlan_tag));
712 713
713 if (BNAD_RXBUF_IS_SK_BUFF(unmap_q->type)) 714 if (BNAD_RXBUF_IS_SK_BUFF(unmap_q->type))
@@ -2094,7 +2095,9 @@ bnad_init_rx_config(struct bnad *bnad, struct bna_rx_config *rx_config)
2094 rx_config->q1_buf_size = BFI_SMALL_RXBUF_SIZE; 2095 rx_config->q1_buf_size = BFI_SMALL_RXBUF_SIZE;
2095 } 2096 }
2096 2097
2097 rx_config->vlan_strip_status = BNA_STATUS_T_ENABLED; 2098 rx_config->vlan_strip_status =
2099 (bnad->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) ?
2100 BNA_STATUS_T_ENABLED : BNA_STATUS_T_DISABLED;
2098} 2101}
2099 2102
2100static void 2103static void
@@ -3245,11 +3248,6 @@ bnad_set_rx_mode(struct net_device *netdev)
3245 BNA_RXMODE_ALLMULTI; 3248 BNA_RXMODE_ALLMULTI;
3246 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL); 3249 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL);
3247 3250
3248 if (bnad->cfg_flags & BNAD_CF_PROMISC)
3249 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3250 else
3251 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3252
3253 spin_unlock_irqrestore(&bnad->bna_lock, flags); 3251 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3254} 3252}
3255 3253
@@ -3374,6 +3372,27 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
3374 return 0; 3372 return 0;
3375} 3373}
3376 3374
3375static int bnad_set_features(struct net_device *dev, netdev_features_t features)
3376{
3377 struct bnad *bnad = netdev_priv(dev);
3378 netdev_features_t changed = features ^ dev->features;
3379
3380 if ((changed & NETIF_F_HW_VLAN_CTAG_RX) && netif_running(dev)) {
3381 unsigned long flags;
3382
3383 spin_lock_irqsave(&bnad->bna_lock, flags);
3384
3385 if (features & NETIF_F_HW_VLAN_CTAG_RX)
3386 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3387 else
3388 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3389
3390 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3391 }
3392
3393 return 0;
3394}
3395
3377#ifdef CONFIG_NET_POLL_CONTROLLER 3396#ifdef CONFIG_NET_POLL_CONTROLLER
3378static void 3397static void
3379bnad_netpoll(struct net_device *netdev) 3398bnad_netpoll(struct net_device *netdev)
@@ -3421,6 +3440,7 @@ static const struct net_device_ops bnad_netdev_ops = {
3421 .ndo_change_mtu = bnad_change_mtu, 3440 .ndo_change_mtu = bnad_change_mtu,
3422 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid, 3441 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid,
3423 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid, 3442 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid,
3443 .ndo_set_features = bnad_set_features,
3424#ifdef CONFIG_NET_POLL_CONTROLLER 3444#ifdef CONFIG_NET_POLL_CONTROLLER
3425 .ndo_poll_controller = bnad_netpoll 3445 .ndo_poll_controller = bnad_netpoll
3426#endif 3446#endif
@@ -3433,14 +3453,14 @@ bnad_netdev_init(struct bnad *bnad, bool using_dac)
3433 3453
3434 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | 3454 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
3435 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3455 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3436 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX; 3456 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX |
3457 NETIF_F_HW_VLAN_CTAG_RX;
3437 3458
3438 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA | 3459 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA |
3439 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3460 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3440 NETIF_F_TSO | NETIF_F_TSO6; 3461 NETIF_F_TSO | NETIF_F_TSO6;
3441 3462
3442 netdev->features |= netdev->hw_features | 3463 netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
3443 NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
3444 3464
3445 if (using_dac) 3465 if (using_dac)
3446 netdev->features |= NETIF_F_HIGHDMA; 3466 netdev->features |= NETIF_F_HIGHDMA;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 43ab35fea48d..34e2488767d9 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -6179,6 +6179,7 @@ static struct pci_driver cxgb4_driver = {
6179 .id_table = cxgb4_pci_tbl, 6179 .id_table = cxgb4_pci_tbl,
6180 .probe = init_one, 6180 .probe = init_one,
6181 .remove = remove_one, 6181 .remove = remove_one,
6182 .shutdown = remove_one,
6182 .err_handler = &cxgb4_eeh, 6183 .err_handler = &cxgb4_eeh,
6183}; 6184};
6184 6185
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 8d09615da585..05529e273050 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -350,11 +350,13 @@ struct be_drv_stats {
350 u32 roce_drops_crc; 350 u32 roce_drops_crc;
351}; 351};
352 352
353/* A vlan-id of 0xFFFF must be used to clear transparent vlan-tagging */
354#define BE_RESET_VLAN_TAG_ID 0xFFFF
355
353struct be_vf_cfg { 356struct be_vf_cfg {
354 unsigned char mac_addr[ETH_ALEN]; 357 unsigned char mac_addr[ETH_ALEN];
355 int if_handle; 358 int if_handle;
356 int pmac_id; 359 int pmac_id;
357 u16 def_vid;
358 u16 vlan_tag; 360 u16 vlan_tag;
359 u32 tx_rate; 361 u32 tx_rate;
360}; 362};
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 04ac9c6a0d39..36c80612e21a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -913,24 +913,14 @@ static int be_ipv6_tx_stall_chk(struct be_adapter *adapter,
913 return BE3_chip(adapter) && be_ipv6_exthdr_check(skb); 913 return BE3_chip(adapter) && be_ipv6_exthdr_check(skb);
914} 914}
915 915
916static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter, 916static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
917 struct sk_buff *skb, 917 struct sk_buff *skb,
918 bool *skip_hw_vlan) 918 bool *skip_hw_vlan)
919{ 919{
920 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; 920 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
921 unsigned int eth_hdr_len; 921 unsigned int eth_hdr_len;
922 struct iphdr *ip; 922 struct iphdr *ip;
923 923
924 /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or less
925 * may cause a transmit stall on that port. So the work-around is to
926 * pad short packets (<= 32 bytes) to a 36-byte length.
927 */
928 if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
929 if (skb_padto(skb, 36))
930 goto tx_drop;
931 skb->len = 36;
932 }
933
934 /* For padded packets, BE HW modifies tot_len field in IP header 924 /* For padded packets, BE HW modifies tot_len field in IP header
935 * incorrecly when VLAN tag is inserted by HW. 925 * incorrecly when VLAN tag is inserted by HW.
936 * For padded packets, Lancer computes incorrect checksum. 926 * For padded packets, Lancer computes incorrect checksum.
@@ -959,7 +949,7 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
959 vlan_tx_tag_present(skb)) { 949 vlan_tx_tag_present(skb)) {
960 skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan); 950 skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan);
961 if (unlikely(!skb)) 951 if (unlikely(!skb))
962 goto tx_drop; 952 goto err;
963 } 953 }
964 954
965 /* HW may lockup when VLAN HW tagging is requested on 955 /* HW may lockup when VLAN HW tagging is requested on
@@ -981,15 +971,39 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
981 be_vlan_tag_tx_chk(adapter, skb)) { 971 be_vlan_tag_tx_chk(adapter, skb)) {
982 skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan); 972 skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan);
983 if (unlikely(!skb)) 973 if (unlikely(!skb))
984 goto tx_drop; 974 goto err;
985 } 975 }
986 976
987 return skb; 977 return skb;
988tx_drop: 978tx_drop:
989 dev_kfree_skb_any(skb); 979 dev_kfree_skb_any(skb);
980err:
990 return NULL; 981 return NULL;
991} 982}
992 983
984static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
985 struct sk_buff *skb,
986 bool *skip_hw_vlan)
987{
988 /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or
989 * less may cause a transmit stall on that port. So the work-around is
990 * to pad short packets (<= 32 bytes) to a 36-byte length.
991 */
992 if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
993 if (skb_padto(skb, 36))
994 return NULL;
995 skb->len = 36;
996 }
997
998 if (BEx_chip(adapter) || lancer_chip(adapter)) {
999 skb = be_lancer_xmit_workarounds(adapter, skb, skip_hw_vlan);
1000 if (!skb)
1001 return NULL;
1002 }
1003
1004 return skb;
1005}
1006
993static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev) 1007static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
994{ 1008{
995 struct be_adapter *adapter = netdev_priv(netdev); 1009 struct be_adapter *adapter = netdev_priv(netdev);
@@ -1157,6 +1171,14 @@ ret:
1157 return status; 1171 return status;
1158} 1172}
1159 1173
1174static void be_clear_promisc(struct be_adapter *adapter)
1175{
1176 adapter->promiscuous = false;
1177 adapter->flags &= ~BE_FLAGS_VLAN_PROMISC;
1178
1179 be_cmd_rx_filter(adapter, IFF_PROMISC, OFF);
1180}
1181
1160static void be_set_rx_mode(struct net_device *netdev) 1182static void be_set_rx_mode(struct net_device *netdev)
1161{ 1183{
1162 struct be_adapter *adapter = netdev_priv(netdev); 1184 struct be_adapter *adapter = netdev_priv(netdev);
@@ -1170,9 +1192,7 @@ static void be_set_rx_mode(struct net_device *netdev)
1170 1192
1171 /* BE was previously in promiscuous mode; disable it */ 1193 /* BE was previously in promiscuous mode; disable it */
1172 if (adapter->promiscuous) { 1194 if (adapter->promiscuous) {
1173 adapter->promiscuous = false; 1195 be_clear_promisc(adapter);
1174 be_cmd_rx_filter(adapter, IFF_PROMISC, OFF);
1175
1176 if (adapter->vlans_added) 1196 if (adapter->vlans_added)
1177 be_vid_config(adapter); 1197 be_vid_config(adapter);
1178 } 1198 }
@@ -1287,24 +1307,20 @@ static int be_set_vf_vlan(struct net_device *netdev,
1287 1307
1288 if (vlan || qos) { 1308 if (vlan || qos) {
1289 vlan |= qos << VLAN_PRIO_SHIFT; 1309 vlan |= qos << VLAN_PRIO_SHIFT;
1290 if (vf_cfg->vlan_tag != vlan) { 1310 if (vf_cfg->vlan_tag != vlan)
1291 /* If this is new value, program it. Else skip. */
1292 vf_cfg->vlan_tag = vlan;
1293 status = be_cmd_set_hsw_config(adapter, vlan, vf + 1, 1311 status = be_cmd_set_hsw_config(adapter, vlan, vf + 1,
1294 vf_cfg->if_handle, 0); 1312 vf_cfg->if_handle, 0);
1295 }
1296 } else { 1313 } else {
1297 /* Reset Transparent Vlan Tagging. */ 1314 /* Reset Transparent Vlan Tagging. */
1298 vf_cfg->vlan_tag = 0; 1315 status = be_cmd_set_hsw_config(adapter, BE_RESET_VLAN_TAG_ID,
1299 vlan = vf_cfg->def_vid; 1316 vf + 1, vf_cfg->if_handle, 0);
1300 status = be_cmd_set_hsw_config(adapter, vlan, vf + 1,
1301 vf_cfg->if_handle, 0);
1302 } 1317 }
1303 1318
1304 1319 if (!status)
1305 if (status) 1320 vf_cfg->vlan_tag = vlan;
1321 else
1306 dev_info(&adapter->pdev->dev, 1322 dev_info(&adapter->pdev->dev,
1307 "VLAN %d config on VF %d failed\n", vlan, vf); 1323 "VLAN %d config on VF %d failed\n", vlan, vf);
1308 return status; 1324 return status;
1309} 1325}
1310 1326
@@ -3013,11 +3029,11 @@ static int be_vf_setup_init(struct be_adapter *adapter)
3013 3029
3014static int be_vf_setup(struct be_adapter *adapter) 3030static int be_vf_setup(struct be_adapter *adapter)
3015{ 3031{
3032 struct device *dev = &adapter->pdev->dev;
3016 struct be_vf_cfg *vf_cfg; 3033 struct be_vf_cfg *vf_cfg;
3017 u16 def_vlan, lnk_speed;
3018 int status, old_vfs, vf; 3034 int status, old_vfs, vf;
3019 struct device *dev = &adapter->pdev->dev;
3020 u32 privileges; 3035 u32 privileges;
3036 u16 lnk_speed;
3021 3037
3022 old_vfs = pci_num_vf(adapter->pdev); 3038 old_vfs = pci_num_vf(adapter->pdev);
3023 if (old_vfs) { 3039 if (old_vfs) {
@@ -3084,12 +3100,6 @@ static int be_vf_setup(struct be_adapter *adapter)
3084 if (!status) 3100 if (!status)
3085 vf_cfg->tx_rate = lnk_speed; 3101 vf_cfg->tx_rate = lnk_speed;
3086 3102
3087 status = be_cmd_get_hsw_config(adapter, &def_vlan,
3088 vf + 1, vf_cfg->if_handle, NULL);
3089 if (status)
3090 goto err;
3091 vf_cfg->def_vid = def_vlan;
3092
3093 if (!old_vfs) 3103 if (!old_vfs)
3094 be_cmd_enable_vf(adapter, vf + 1); 3104 be_cmd_enable_vf(adapter, vf + 1);
3095 } 3105 }
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 903362a7b584..479a7cba45c0 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -389,12 +389,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
389 netdev_err(ndev, "Tx DMA memory map failed\n"); 389 netdev_err(ndev, "Tx DMA memory map failed\n");
390 return NETDEV_TX_OK; 390 return NETDEV_TX_OK;
391 } 391 }
392 /* Send it on its way. Tell FEC it's ready, interrupt when done,
393 * it's the last BD of the frame, and to put the CRC on the end.
394 */
395 status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR
396 | BD_ENET_TX_LAST | BD_ENET_TX_TC);
397 bdp->cbd_sc = status;
398 392
399 if (fep->bufdesc_ex) { 393 if (fep->bufdesc_ex) {
400 394
@@ -416,6 +410,13 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
416 } 410 }
417 } 411 }
418 412
413 /* Send it on its way. Tell FEC it's ready, interrupt when done,
414 * it's the last BD of the frame, and to put the CRC on the end.
415 */
416 status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR
417 | BD_ENET_TX_LAST | BD_ENET_TX_TC);
418 bdp->cbd_sc = status;
419
419 bdp_pre = fec_enet_get_prevdesc(bdp, fep); 420 bdp_pre = fec_enet_get_prevdesc(bdp, fep);
420 if ((id_entry->driver_data & FEC_QUIRK_ERR006358) && 421 if ((id_entry->driver_data & FEC_QUIRK_ERR006358) &&
421 !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) { 422 !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) {
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 6b65f7795215..7aec6c833973 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -51,8 +51,8 @@
51 51
52#define DRV_NAME "mlx4_core" 52#define DRV_NAME "mlx4_core"
53#define PFX DRV_NAME ": " 53#define PFX DRV_NAME ": "
54#define DRV_VERSION "1.1" 54#define DRV_VERSION "2.2-1"
55#define DRV_RELDATE "Dec, 2011" 55#define DRV_RELDATE "Feb, 2014"
56 56
57#define MLX4_FS_UDP_UC_EN (1 << 1) 57#define MLX4_FS_UDP_UC_EN (1 << 1)
58#define MLX4_FS_TCP_UC_EN (1 << 2) 58#define MLX4_FS_TCP_UC_EN (1 << 2)
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 9ca223bc90fc..b57e8c87a34e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -57,8 +57,8 @@
57#include "en_port.h" 57#include "en_port.h"
58 58
59#define DRV_NAME "mlx4_en" 59#define DRV_NAME "mlx4_en"
60#define DRV_VERSION "2.0" 60#define DRV_VERSION "2.2-1"
61#define DRV_RELDATE "Dec 2011" 61#define DRV_RELDATE "Feb 2014"
62 62
63#define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN) 63#define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN)
64 64
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index a064f06e0cb8..23b7e2d35a93 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -46,8 +46,8 @@
46#include "mlx5_core.h" 46#include "mlx5_core.h"
47 47
48#define DRIVER_NAME "mlx5_core" 48#define DRIVER_NAME "mlx5_core"
49#define DRIVER_VERSION "1.0" 49#define DRIVER_VERSION "2.2-1"
50#define DRIVER_RELDATE "June 2013" 50#define DRIVER_RELDATE "Feb 2014"
51 51
52MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>"); 52MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>");
53MODULE_DESCRIPTION("Mellanox ConnectX-IB HCA core library"); 53MODULE_DESCRIPTION("Mellanox ConnectX-IB HCA core library");
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 4146664d4d6a..27c4f131863b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -340,6 +340,7 @@ int qlcnic_83xx_setup_intr(struct qlcnic_adapter *adapter)
340 if (qlcnic_sriov_vf_check(adapter)) 340 if (qlcnic_sriov_vf_check(adapter))
341 return -EINVAL; 341 return -EINVAL;
342 num_msix = 1; 342 num_msix = 1;
343 adapter->drv_sds_rings = QLCNIC_SINGLE_RING;
343 adapter->drv_tx_rings = QLCNIC_SINGLE_RING; 344 adapter->drv_tx_rings = QLCNIC_SINGLE_RING;
344 } 345 }
345 } 346 }
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
index 77f1bce432d2..7d4f54912bad 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
@@ -807,7 +807,7 @@ qlcnic_dcb_get_pg_tc_cfg_tx(struct net_device *netdev, int tc, u8 *prio,
807 !type->tc_param_valid) 807 !type->tc_param_valid)
808 return; 808 return;
809 809
810 if (tc < 0 || (tc > QLC_DCB_MAX_TC)) 810 if (tc < 0 || (tc >= QLC_DCB_MAX_TC))
811 return; 811 return;
812 812
813 tc_cfg = &type->tc_cfg[tc]; 813 tc_cfg = &type->tc_cfg[tc];
@@ -843,7 +843,7 @@ static void qlcnic_dcb_get_pg_bwg_cfg_tx(struct net_device *netdev, int pgid,
843 !type->tc_param_valid) 843 !type->tc_param_valid)
844 return; 844 return;
845 845
846 if (pgid < 0 || pgid > QLC_DCB_MAX_PG) 846 if (pgid < 0 || pgid >= QLC_DCB_MAX_PG)
847 return; 847 return;
848 848
849 pgcfg = &type->pg_cfg[pgid]; 849 pgcfg = &type->pg_cfg[pgid];
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index ba78c7481fa3..1222865cfb73 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -816,9 +816,10 @@ static int qlcnic_82xx_setup_intr(struct qlcnic_adapter *adapter)
816 816
817 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) { 817 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
818 qlcnic_disable_multi_tx(adapter); 818 qlcnic_disable_multi_tx(adapter);
819 adapter->drv_sds_rings = QLCNIC_SINGLE_RING;
819 820
820 err = qlcnic_enable_msi_legacy(adapter); 821 err = qlcnic_enable_msi_legacy(adapter);
821 if (!err) 822 if (err)
822 return err; 823 return err;
823 } 824 }
824 } 825 }
@@ -3863,7 +3864,7 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt,
3863 strcpy(buf, "Tx"); 3864 strcpy(buf, "Tx");
3864 } 3865 }
3865 3866
3866 if (!qlcnic_use_msi_x && !qlcnic_use_msi) { 3867 if (!QLCNIC_IS_MSI_FAMILY(adapter)) {
3867 netdev_err(netdev, "No RSS/TSS support in INT-x mode\n"); 3868 netdev_err(netdev, "No RSS/TSS support in INT-x mode\n");
3868 return -EINVAL; 3869 return -EINVAL;
3869 } 3870 }
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index 09acf15c3a56..e5277a632671 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -13,8 +13,6 @@
13#define QLC_VF_MIN_TX_RATE 100 13#define QLC_VF_MIN_TX_RATE 100
14#define QLC_VF_MAX_TX_RATE 9999 14#define QLC_VF_MAX_TX_RATE 9999
15#define QLC_MAC_OPCODE_MASK 0x7 15#define QLC_MAC_OPCODE_MASK 0x7
16#define QLC_MAC_STAR_ADD 6
17#define QLC_MAC_STAR_DEL 7
18#define QLC_VF_FLOOD_BIT BIT_16 16#define QLC_VF_FLOOD_BIT BIT_16
19#define QLC_FLOOD_MODE 0x5 17#define QLC_FLOOD_MODE 0x5
20 18
@@ -1206,13 +1204,6 @@ static int qlcnic_sriov_validate_cfg_macvlan(struct qlcnic_adapter *adapter,
1206 struct qlcnic_vport *vp = vf->vp; 1204 struct qlcnic_vport *vp = vf->vp;
1207 u8 op, new_op; 1205 u8 op, new_op;
1208 1206
1209 if (((cmd->req.arg[1] & QLC_MAC_OPCODE_MASK) == QLC_MAC_STAR_ADD) ||
1210 ((cmd->req.arg[1] & QLC_MAC_OPCODE_MASK) == QLC_MAC_STAR_DEL)) {
1211 netdev_err(adapter->netdev, "MAC + any VLAN filter not allowed from VF %d\n",
1212 vf->pci_func);
1213 return -EINVAL;
1214 }
1215
1216 if (!(cmd->req.arg[1] & BIT_8)) 1207 if (!(cmd->req.arg[1] & BIT_8))
1217 return -EINVAL; 1208 return -EINVAL;
1218 1209
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 91a67ae8f17b..e9779653cd4c 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7118,6 +7118,8 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7118 } 7118 }
7119 7119
7120 mutex_init(&tp->wk.mutex); 7120 mutex_init(&tp->wk.mutex);
7121 u64_stats_init(&tp->rx_stats.syncp);
7122 u64_stats_init(&tp->tx_stats.syncp);
7121 7123
7122 /* Get MAC address */ 7124 /* Get MAC address */
7123 for (i = 0; i < ETH_ALEN; i++) 7125 for (i = 0; i < ETH_ALEN; i++)
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index eb75fbd11a01..d7a36829649a 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1668,6 +1668,13 @@ void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev)
1668 struct efx_ptp_data *ptp = efx->ptp_data; 1668 struct efx_ptp_data *ptp = efx->ptp_data;
1669 int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE); 1669 int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE);
1670 1670
1671 if (!ptp) {
1672 if (net_ratelimit())
1673 netif_warn(efx, drv, efx->net_dev,
1674 "Received PTP event but PTP not set up\n");
1675 return;
1676 }
1677
1671 if (!ptp->enabled) 1678 if (!ptp->enabled)
1672 return; 1679 return;
1673 1680
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a2e7d2c96e36..078ad0ec8593 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1705,7 +1705,7 @@ static int stmmac_open(struct net_device *dev)
1705 priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); 1705 priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
1706 priv->dma_buf_sz = STMMAC_ALIGN(buf_sz); 1706 priv->dma_buf_sz = STMMAC_ALIGN(buf_sz);
1707 1707
1708 alloc_dma_desc_resources(priv); 1708 ret = alloc_dma_desc_resources(priv);
1709 if (ret < 0) { 1709 if (ret < 0) {
1710 pr_err("%s: DMA descriptors allocation failed\n", __func__); 1710 pr_err("%s: DMA descriptors allocation failed\n", __func__);
1711 goto dma_desc_error; 1711 goto dma_desc_error;
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 651087b5c8da..ffd4d12acf6d 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1164,11 +1164,17 @@ static void cpsw_init_host_port(struct cpsw_priv *priv)
1164 1164
1165static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv) 1165static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
1166{ 1166{
1167 u32 slave_port;
1168
1169 slave_port = cpsw_get_slave_port(priv, slave->slave_num);
1170
1167 if (!slave->phy) 1171 if (!slave->phy)
1168 return; 1172 return;
1169 phy_stop(slave->phy); 1173 phy_stop(slave->phy);
1170 phy_disconnect(slave->phy); 1174 phy_disconnect(slave->phy);
1171 slave->phy = NULL; 1175 slave->phy = NULL;
1176 cpsw_ale_control_set(priv->ale, slave_port,
1177 ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
1172} 1178}
1173 1179
1174static int cpsw_ndo_open(struct net_device *ndev) 1180static int cpsw_ndo_open(struct net_device *ndev)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index a5d21893670d..1831fb7cd017 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -506,6 +506,9 @@ static int macvlan_change_mtu(struct net_device *dev, int new_mtu)
506static struct lock_class_key macvlan_netdev_xmit_lock_key; 506static struct lock_class_key macvlan_netdev_xmit_lock_key;
507static struct lock_class_key macvlan_netdev_addr_lock_key; 507static struct lock_class_key macvlan_netdev_addr_lock_key;
508 508
509#define ALWAYS_ON_FEATURES \
510 (NETIF_F_SG | NETIF_F_GEN_CSUM | NETIF_F_GSO_SOFTWARE | NETIF_F_LLTX)
511
509#define MACVLAN_FEATURES \ 512#define MACVLAN_FEATURES \
510 (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ 513 (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
511 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \ 514 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_UFO | NETIF_F_GSO_ROBUST | \
@@ -539,7 +542,7 @@ static int macvlan_init(struct net_device *dev)
539 dev->state = (dev->state & ~MACVLAN_STATE_MASK) | 542 dev->state = (dev->state & ~MACVLAN_STATE_MASK) |
540 (lowerdev->state & MACVLAN_STATE_MASK); 543 (lowerdev->state & MACVLAN_STATE_MASK);
541 dev->features = lowerdev->features & MACVLAN_FEATURES; 544 dev->features = lowerdev->features & MACVLAN_FEATURES;
542 dev->features |= NETIF_F_LLTX; 545 dev->features |= ALWAYS_ON_FEATURES;
543 dev->gso_max_size = lowerdev->gso_max_size; 546 dev->gso_max_size = lowerdev->gso_max_size;
544 dev->iflink = lowerdev->ifindex; 547 dev->iflink = lowerdev->ifindex;
545 dev->hard_header_len = lowerdev->hard_header_len; 548 dev->hard_header_len = lowerdev->hard_header_len;
@@ -699,7 +702,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
699 features = netdev_increment_features(vlan->lowerdev->features, 702 features = netdev_increment_features(vlan->lowerdev->features,
700 features, 703 features,
701 mask); 704 mask);
702 features |= NETIF_F_LLTX; 705 features |= ALWAYS_ON_FEATURES;
703 706
704 return features; 707 return features;
705} 708}
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 82514e72b3d8..4b970f7624c0 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -916,6 +916,8 @@ int genphy_read_status(struct phy_device *phydev)
916 int err; 916 int err;
917 int lpa; 917 int lpa;
918 int lpagb = 0; 918 int lpagb = 0;
919 int common_adv;
920 int common_adv_gb = 0;
919 921
920 /* Update the link, but return if there was an error */ 922 /* Update the link, but return if there was an error */
921 err = genphy_update_link(phydev); 923 err = genphy_update_link(phydev);
@@ -937,7 +939,7 @@ int genphy_read_status(struct phy_device *phydev)
937 939
938 phydev->lp_advertising = 940 phydev->lp_advertising =
939 mii_stat1000_to_ethtool_lpa_t(lpagb); 941 mii_stat1000_to_ethtool_lpa_t(lpagb);
940 lpagb &= adv << 2; 942 common_adv_gb = lpagb & adv << 2;
941 } 943 }
942 944
943 lpa = phy_read(phydev, MII_LPA); 945 lpa = phy_read(phydev, MII_LPA);
@@ -950,25 +952,25 @@ int genphy_read_status(struct phy_device *phydev)
950 if (adv < 0) 952 if (adv < 0)
951 return adv; 953 return adv;
952 954
953 lpa &= adv; 955 common_adv = lpa & adv;
954 956
955 phydev->speed = SPEED_10; 957 phydev->speed = SPEED_10;
956 phydev->duplex = DUPLEX_HALF; 958 phydev->duplex = DUPLEX_HALF;
957 phydev->pause = 0; 959 phydev->pause = 0;
958 phydev->asym_pause = 0; 960 phydev->asym_pause = 0;
959 961
960 if (lpagb & (LPA_1000FULL | LPA_1000HALF)) { 962 if (common_adv_gb & (LPA_1000FULL | LPA_1000HALF)) {
961 phydev->speed = SPEED_1000; 963 phydev->speed = SPEED_1000;
962 964
963 if (lpagb & LPA_1000FULL) 965 if (common_adv_gb & LPA_1000FULL)
964 phydev->duplex = DUPLEX_FULL; 966 phydev->duplex = DUPLEX_FULL;
965 } else if (lpa & (LPA_100FULL | LPA_100HALF)) { 967 } else if (common_adv & (LPA_100FULL | LPA_100HALF)) {
966 phydev->speed = SPEED_100; 968 phydev->speed = SPEED_100;
967 969
968 if (lpa & LPA_100FULL) 970 if (common_adv & LPA_100FULL)
969 phydev->duplex = DUPLEX_FULL; 971 phydev->duplex = DUPLEX_FULL;
970 } else 972 } else
971 if (lpa & LPA_10FULL) 973 if (common_adv & LPA_10FULL)
972 phydev->duplex = DUPLEX_FULL; 974 phydev->duplex = DUPLEX_FULL;
973 975
974 if (phydev->duplex == DUPLEX_FULL) { 976 if (phydev->duplex == DUPLEX_FULL) {
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 8fe9cb7d0f72..26f8635b027d 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1686,7 +1686,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1686 TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX | 1686 TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
1687 NETIF_F_HW_VLAN_STAG_TX; 1687 NETIF_F_HW_VLAN_STAG_TX;
1688 dev->features = dev->hw_features; 1688 dev->features = dev->hw_features;
1689 dev->vlan_features = dev->features; 1689 dev->vlan_features = dev->features &
1690 ~(NETIF_F_HW_VLAN_CTAG_TX |
1691 NETIF_F_HW_VLAN_STAG_TX);
1690 1692
1691 INIT_LIST_HEAD(&tun->disabled); 1693 INIT_LIST_HEAD(&tun->disabled);
1692 err = tun_attach(tun, file, false); 1694 err = tun_attach(tun, file, false);
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 42085e622be6..054e59ca6946 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1387,6 +1387,19 @@ static const struct driver_info ax88178a_info = {
1387 .tx_fixup = ax88179_tx_fixup, 1387 .tx_fixup = ax88179_tx_fixup,
1388}; 1388};
1389 1389
1390static const struct driver_info dlink_dub1312_info = {
1391 .description = "D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter",
1392 .bind = ax88179_bind,
1393 .unbind = ax88179_unbind,
1394 .status = ax88179_status,
1395 .link_reset = ax88179_link_reset,
1396 .reset = ax88179_reset,
1397 .stop = ax88179_stop,
1398 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1399 .rx_fixup = ax88179_rx_fixup,
1400 .tx_fixup = ax88179_tx_fixup,
1401};
1402
1390static const struct driver_info sitecom_info = { 1403static const struct driver_info sitecom_info = {
1391 .description = "Sitecom USB 3.0 to Gigabit Adapter", 1404 .description = "Sitecom USB 3.0 to Gigabit Adapter",
1392 .bind = ax88179_bind, 1405 .bind = ax88179_bind,
@@ -1413,6 +1426,19 @@ static const struct driver_info samsung_info = {
1413 .tx_fixup = ax88179_tx_fixup, 1426 .tx_fixup = ax88179_tx_fixup,
1414}; 1427};
1415 1428
1429static const struct driver_info lenovo_info = {
1430 .description = "Lenovo OneLinkDock Gigabit LAN",
1431 .bind = ax88179_bind,
1432 .unbind = ax88179_unbind,
1433 .status = ax88179_status,
1434 .link_reset = ax88179_link_reset,
1435 .reset = ax88179_reset,
1436 .stop = ax88179_stop,
1437 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1438 .rx_fixup = ax88179_rx_fixup,
1439 .tx_fixup = ax88179_tx_fixup,
1440};
1441
1416static const struct usb_device_id products[] = { 1442static const struct usb_device_id products[] = {
1417{ 1443{
1418 /* ASIX AX88179 10/100/1000 */ 1444 /* ASIX AX88179 10/100/1000 */
@@ -1423,6 +1449,10 @@ static const struct usb_device_id products[] = {
1423 USB_DEVICE(0x0b95, 0x178a), 1449 USB_DEVICE(0x0b95, 0x178a),
1424 .driver_info = (unsigned long)&ax88178a_info, 1450 .driver_info = (unsigned long)&ax88178a_info,
1425}, { 1451}, {
1452 /* D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter */
1453 USB_DEVICE(0x2001, 0x4a00),
1454 .driver_info = (unsigned long)&dlink_dub1312_info,
1455}, {
1426 /* Sitecom USB 3.0 to Gigabit Adapter */ 1456 /* Sitecom USB 3.0 to Gigabit Adapter */
1427 USB_DEVICE(0x0df6, 0x0072), 1457 USB_DEVICE(0x0df6, 0x0072),
1428 .driver_info = (unsigned long)&sitecom_info, 1458 .driver_info = (unsigned long)&sitecom_info,
@@ -1430,6 +1460,10 @@ static const struct usb_device_id products[] = {
1430 /* Samsung USB Ethernet Adapter */ 1460 /* Samsung USB Ethernet Adapter */
1431 USB_DEVICE(0x04e8, 0xa100), 1461 USB_DEVICE(0x04e8, 0xa100),
1432 .driver_info = (unsigned long)&samsung_info, 1462 .driver_info = (unsigned long)&samsung_info,
1463}, {
1464 /* Lenovo OneLinkDock Gigabit LAN */
1465 USB_DEVICE(0x17ef, 0x304b),
1466 .driver_info = (unsigned long)&lenovo_info,
1433}, 1467},
1434 { }, 1468 { },
1435}; 1469};
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 2ec2041b62d4..5b374370f71c 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -285,7 +285,8 @@ static void veth_setup(struct net_device *dev)
285 dev->ethtool_ops = &veth_ethtool_ops; 285 dev->ethtool_ops = &veth_ethtool_ops;
286 dev->features |= NETIF_F_LLTX; 286 dev->features |= NETIF_F_LLTX;
287 dev->features |= VETH_FEATURES; 287 dev->features |= VETH_FEATURES;
288 dev->vlan_features = dev->features; 288 dev->vlan_features = dev->features &
289 ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX);
289 dev->destructor = veth_dev_free; 290 dev->destructor = veth_dev_free;
290 291
291 dev->hw_features = VETH_FEATURES; 292 dev->hw_features = VETH_FEATURES;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index d75f8edf4fb3..5632a99cbbd2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1711,7 +1711,8 @@ static int virtnet_probe(struct virtio_device *vdev)
1711 /* If we can receive ANY GSO packets, we must allocate large ones. */ 1711 /* If we can receive ANY GSO packets, we must allocate large ones. */
1712 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || 1712 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) ||
1713 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || 1713 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) ||
1714 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN)) 1714 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN) ||
1715 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO))
1715 vi->big_packets = true; 1716 vi->big_packets = true;
1716 1717
1717 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) 1718 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
diff --git a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
index 1cc13569b17b..1b6b4d0cfa97 100644
--- a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
@@ -57,7 +57,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
57 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e}, 57 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
58 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 58 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
59 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, 59 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
60 {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, 60 {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
61 {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, 61 {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
62 {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282}, 62 {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
63 {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27}, 63 {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
@@ -96,7 +96,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
96 {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000}, 96 {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
97 {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 97 {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
98 {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, 98 {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
99 {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, 99 {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
100 {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, 100 {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
101}; 101};
102 102
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 11eab9f01fd8..303ce27964c1 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1534,7 +1534,7 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
1534bool ath9k_hw_check_alive(struct ath_hw *ah) 1534bool ath9k_hw_check_alive(struct ath_hw *ah)
1535{ 1535{
1536 int count = 50; 1536 int count = 50;
1537 u32 reg; 1537 u32 reg, last_val;
1538 1538
1539 if (AR_SREV_9300(ah)) 1539 if (AR_SREV_9300(ah))
1540 return !ath9k_hw_detect_mac_hang(ah); 1540 return !ath9k_hw_detect_mac_hang(ah);
@@ -1542,9 +1542,13 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1542 if (AR_SREV_9285_12_OR_LATER(ah)) 1542 if (AR_SREV_9285_12_OR_LATER(ah))
1543 return true; 1543 return true;
1544 1544
1545 last_val = REG_READ(ah, AR_OBS_BUS_1);
1545 do { 1546 do {
1546 reg = REG_READ(ah, AR_OBS_BUS_1); 1547 reg = REG_READ(ah, AR_OBS_BUS_1);
1548 if (reg != last_val)
1549 return true;
1547 1550
1551 last_val = reg;
1548 if ((reg & 0x7E7FFFEF) == 0x00702400) 1552 if ((reg & 0x7E7FFFEF) == 0x00702400)
1549 continue; 1553 continue;
1550 1554
@@ -1556,6 +1560,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1556 default: 1560 default:
1557 return true; 1561 return true;
1558 } 1562 }
1563
1564 udelay(1);
1559 } while (count-- > 0); 1565 } while (count-- > 0);
1560 1566
1561 return false; 1567 return false;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index a0ebdd000fc2..82e340d3ec60 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -732,11 +732,18 @@ static struct ath_rxbuf *ath_get_next_rx_buf(struct ath_softc *sc,
732 return NULL; 732 return NULL;
733 733
734 /* 734 /*
735 * mark descriptor as zero-length and set the 'more' 735 * Re-check previous descriptor, in case it has been filled
736 * flag to ensure that both buffers get discarded 736 * in the mean time.
737 */ 737 */
738 rs->rs_datalen = 0; 738 ret = ath9k_hw_rxprocdesc(ah, ds, rs);
739 rs->rs_more = true; 739 if (ret == -EINPROGRESS) {
740 /*
741 * mark descriptor as zero-length and set the 'more'
742 * flag to ensure that both buffers get discarded
743 */
744 rs->rs_datalen = 0;
745 rs->rs_more = true;
746 }
740 } 747 }
741 748
742 list_del(&bf->list); 749 list_del(&bf->list);
@@ -985,32 +992,32 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
985 struct ath_common *common = ath9k_hw_common(ah); 992 struct ath_common *common = ath9k_hw_common(ah);
986 struct ieee80211_hdr *hdr; 993 struct ieee80211_hdr *hdr;
987 bool discard_current = sc->rx.discard_next; 994 bool discard_current = sc->rx.discard_next;
988 int ret = 0;
989 995
990 /* 996 /*
991 * Discard corrupt descriptors which are marked in 997 * Discard corrupt descriptors which are marked in
992 * ath_get_next_rx_buf(). 998 * ath_get_next_rx_buf().
993 */ 999 */
994 sc->rx.discard_next = rx_stats->rs_more;
995 if (discard_current) 1000 if (discard_current)
996 return -EINVAL; 1001 goto corrupt;
1002
1003 sc->rx.discard_next = false;
997 1004
998 /* 1005 /*
999 * Discard zero-length packets. 1006 * Discard zero-length packets.
1000 */ 1007 */
1001 if (!rx_stats->rs_datalen) { 1008 if (!rx_stats->rs_datalen) {
1002 RX_STAT_INC(rx_len_err); 1009 RX_STAT_INC(rx_len_err);
1003 return -EINVAL; 1010 goto corrupt;
1004 } 1011 }
1005 1012
1006 /* 1013 /*
1007 * rs_status follows rs_datalen so if rs_datalen is too large 1014 * rs_status follows rs_datalen so if rs_datalen is too large
1008 * we can take a hint that hardware corrupted it, so ignore 1015 * we can take a hint that hardware corrupted it, so ignore
1009 * those frames. 1016 * those frames.
1010 */ 1017 */
1011 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) { 1018 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) {
1012 RX_STAT_INC(rx_len_err); 1019 RX_STAT_INC(rx_len_err);
1013 return -EINVAL; 1020 goto corrupt;
1014 } 1021 }
1015 1022
1016 /* Only use status info from the last fragment */ 1023 /* Only use status info from the last fragment */
@@ -1024,10 +1031,8 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1024 * This is different from the other corrupt descriptor 1031 * This is different from the other corrupt descriptor
1025 * condition handled above. 1032 * condition handled above.
1026 */ 1033 */
1027 if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC) { 1034 if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC)
1028 ret = -EINVAL; 1035 goto corrupt;
1029 goto exit;
1030 }
1031 1036
1032 hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len); 1037 hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len);
1033 1038
@@ -1043,18 +1048,15 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1043 if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime)) 1048 if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime))
1044 RX_STAT_INC(rx_spectral); 1049 RX_STAT_INC(rx_spectral);
1045 1050
1046 ret = -EINVAL; 1051 return -EINVAL;
1047 goto exit;
1048 } 1052 }
1049 1053
1050 /* 1054 /*
1051 * everything but the rate is checked here, the rate check is done 1055 * everything but the rate is checked here, the rate check is done
1052 * separately to avoid doing two lookups for a rate for each frame. 1056 * separately to avoid doing two lookups for a rate for each frame.
1053 */ 1057 */
1054 if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error)) { 1058 if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error))
1055 ret = -EINVAL; 1059 return -EINVAL;
1056 goto exit;
1057 }
1058 1060
1059 if (ath_is_mybeacon(common, hdr)) { 1061 if (ath_is_mybeacon(common, hdr)) {
1060 RX_STAT_INC(rx_beacons); 1062 RX_STAT_INC(rx_beacons);
@@ -1064,15 +1066,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1064 /* 1066 /*
1065 * This shouldn't happen, but have a safety check anyway. 1067 * This shouldn't happen, but have a safety check anyway.
1066 */ 1068 */
1067 if (WARN_ON(!ah->curchan)) { 1069 if (WARN_ON(!ah->curchan))
1068 ret = -EINVAL; 1070 return -EINVAL;
1069 goto exit;
1070 }
1071 1071
1072 if (ath9k_process_rate(common, hw, rx_stats, rx_status)) { 1072 if (ath9k_process_rate(common, hw, rx_stats, rx_status))
1073 ret =-EINVAL; 1073 return -EINVAL;
1074 goto exit;
1075 }
1076 1074
1077 ath9k_process_rssi(common, hw, rx_stats, rx_status); 1075 ath9k_process_rssi(common, hw, rx_stats, rx_status);
1078 1076
@@ -1087,9 +1085,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1087 sc->rx.num_pkts++; 1085 sc->rx.num_pkts++;
1088#endif 1086#endif
1089 1087
1090exit: 1088 return 0;
1091 sc->rx.discard_next = false; 1089
1092 return ret; 1090corrupt:
1091 sc->rx.discard_next = rx_stats->rs_more;
1092 return -EINVAL;
1093} 1093}
1094 1094
1095static void ath9k_rx_skb_postprocess(struct ath_common *common, 1095static void ath9k_rx_skb_postprocess(struct ath_common *common,
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 0a75e2f68c9d..f042a18c8495 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1444,14 +1444,16 @@ void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
1444 for (tidno = 0, tid = &an->tid[tidno]; 1444 for (tidno = 0, tid = &an->tid[tidno];
1445 tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { 1445 tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
1446 1446
1447 if (!tid->sched)
1448 continue;
1449
1450 ac = tid->ac; 1447 ac = tid->ac;
1451 txq = ac->txq; 1448 txq = ac->txq;
1452 1449
1453 ath_txq_lock(sc, txq); 1450 ath_txq_lock(sc, txq);
1454 1451
1452 if (!tid->sched) {
1453 ath_txq_unlock(sc, txq);
1454 continue;
1455 }
1456
1455 buffered = ath_tid_has_buffered(tid); 1457 buffered = ath_tid_has_buffered(tid);
1456 1458
1457 tid->sched = false; 1459 tid->sched = false;
@@ -2184,14 +2186,15 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
2184 txq->stopped = true; 2186 txq->stopped = true;
2185 } 2187 }
2186 2188
2189 if (txctl->an)
2190 tid = ath_get_skb_tid(sc, txctl->an, skb);
2191
2187 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) { 2192 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
2188 ath_txq_unlock(sc, txq); 2193 ath_txq_unlock(sc, txq);
2189 txq = sc->tx.uapsdq; 2194 txq = sc->tx.uapsdq;
2190 ath_txq_lock(sc, txq); 2195 ath_txq_lock(sc, txq);
2191 } else if (txctl->an && 2196 } else if (txctl->an &&
2192 ieee80211_is_data_present(hdr->frame_control)) { 2197 ieee80211_is_data_present(hdr->frame_control)) {
2193 tid = ath_get_skb_tid(sc, txctl->an, skb);
2194
2195 WARN_ON(tid->ac->txq != txctl->txq); 2198 WARN_ON(tid->ac->txq != txctl->txq);
2196 2199
2197 if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) 2200 if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 3e991897d7ca..119ee6eaf1c3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -457,7 +457,6 @@ struct brcmf_sdio {
457 457
458 u8 tx_hdrlen; /* sdio bus header length for tx packet */ 458 u8 tx_hdrlen; /* sdio bus header length for tx packet */
459 bool txglom; /* host tx glomming enable flag */ 459 bool txglom; /* host tx glomming enable flag */
460 struct sk_buff *txglom_sgpad; /* scatter-gather padding buffer */
461 u16 head_align; /* buffer pointer alignment */ 460 u16 head_align; /* buffer pointer alignment */
462 u16 sgentry_align; /* scatter-gather buffer alignment */ 461 u16 sgentry_align; /* scatter-gather buffer alignment */
463}; 462};
@@ -1944,9 +1943,8 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
1944 if (lastfrm && chain_pad) 1943 if (lastfrm && chain_pad)
1945 tail_pad += blksize - chain_pad; 1944 tail_pad += blksize - chain_pad;
1946 if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) { 1945 if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) {
1947 pkt_pad = bus->txglom_sgpad; 1946 pkt_pad = brcmu_pkt_buf_get_skb(tail_pad + tail_chop +
1948 if (pkt_pad == NULL) 1947 bus->head_align);
1949 brcmu_pkt_buf_get_skb(tail_pad + tail_chop);
1950 if (pkt_pad == NULL) 1948 if (pkt_pad == NULL)
1951 return -ENOMEM; 1949 return -ENOMEM;
1952 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad); 1950 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad);
@@ -1957,6 +1955,7 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
1957 tail_chop); 1955 tail_chop);
1958 *(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop; 1956 *(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop;
1959 skb_trim(pkt, pkt->len - tail_chop); 1957 skb_trim(pkt, pkt->len - tail_chop);
1958 skb_trim(pkt_pad, tail_pad + tail_chop);
1960 __skb_queue_after(pktq, pkt, pkt_pad); 1959 __skb_queue_after(pktq, pkt, pkt_pad);
1961 } else { 1960 } else {
1962 ntail = pkt->data_len + tail_pad - 1961 ntail = pkt->data_len + tail_pad -
@@ -2011,7 +2010,7 @@ brcmf_sdio_txpkt_prep(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
2011 return ret; 2010 return ret;
2012 head_pad = (u16)ret; 2011 head_pad = (u16)ret;
2013 if (head_pad) 2012 if (head_pad)
2014 memset(pkt_next->data, 0, head_pad + bus->tx_hdrlen); 2013 memset(pkt_next->data + bus->tx_hdrlen, 0, head_pad);
2015 2014
2016 total_len += pkt_next->len; 2015 total_len += pkt_next->len;
2017 2016
@@ -3486,10 +3485,6 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
3486 bus->txglom = false; 3485 bus->txglom = false;
3487 value = 1; 3486 value = 1;
3488 pad_size = bus->sdiodev->func[2]->cur_blksize << 1; 3487 pad_size = bus->sdiodev->func[2]->cur_blksize << 1;
3489 bus->txglom_sgpad = brcmu_pkt_buf_get_skb(pad_size);
3490 if (!bus->txglom_sgpad)
3491 brcmf_err("allocating txglom padding skb failed, reduced performance\n");
3492
3493 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom", 3488 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
3494 &value, sizeof(u32)); 3489 &value, sizeof(u32));
3495 if (err < 0) { 3490 if (err < 0) {
@@ -4053,7 +4048,6 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
4053 brcmf_sdio_chip_detach(&bus->ci); 4048 brcmf_sdio_chip_detach(&bus->ci);
4054 } 4049 }
4055 4050
4056 brcmu_pkt_buf_free_skb(bus->txglom_sgpad);
4057 kfree(bus->rxbuf); 4051 kfree(bus->rxbuf);
4058 kfree(bus->hdrbuf); 4052 kfree(bus->hdrbuf);
4059 kfree(bus); 4053 kfree(bus);
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index d36e252d2ccb..596525528f50 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -147,7 +147,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta)
147 147
148 if (!sta->ap && sta->u.sta.challenge) 148 if (!sta->ap && sta->u.sta.challenge)
149 kfree(sta->u.sta.challenge); 149 kfree(sta->u.sta.challenge);
150 del_timer(&sta->timer); 150 del_timer_sync(&sta->timer);
151#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 151#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
152 152
153 kfree(sta); 153 kfree(sta);
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c
index c0d070c5df5e..9cdd91cdf661 100644
--- a/drivers/net/wireless/iwlwifi/dvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/dvm/sta.c
@@ -590,6 +590,7 @@ void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id,
590 sizeof(priv->tid_data[sta_id][tid])); 590 sizeof(priv->tid_data[sta_id][tid]));
591 591
592 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE; 592 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;
593 priv->stations[sta_id].used &= ~IWL_STA_UCODE_INPROGRESS;
593 594
594 priv->num_stations--; 595 priv->num_stations--;
595 596
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index a6839dfcb82d..398dd096674c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -1291,8 +1291,6 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1291 struct iwl_compressed_ba_resp *ba_resp = (void *)pkt->data; 1291 struct iwl_compressed_ba_resp *ba_resp = (void *)pkt->data;
1292 struct iwl_ht_agg *agg; 1292 struct iwl_ht_agg *agg;
1293 struct sk_buff_head reclaimed_skbs; 1293 struct sk_buff_head reclaimed_skbs;
1294 struct ieee80211_tx_info *info;
1295 struct ieee80211_hdr *hdr;
1296 struct sk_buff *skb; 1294 struct sk_buff *skb;
1297 int sta_id; 1295 int sta_id;
1298 int tid; 1296 int tid;
@@ -1379,22 +1377,28 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1379 freed = 0; 1377 freed = 0;
1380 1378
1381 skb_queue_walk(&reclaimed_skbs, skb) { 1379 skb_queue_walk(&reclaimed_skbs, skb) {
1382 hdr = (struct ieee80211_hdr *)skb->data; 1380 struct ieee80211_hdr *hdr = (void *)skb->data;
1381 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1383 1382
1384 if (ieee80211_is_data_qos(hdr->frame_control)) 1383 if (ieee80211_is_data_qos(hdr->frame_control))
1385 freed++; 1384 freed++;
1386 else 1385 else
1387 WARN_ON_ONCE(1); 1386 WARN_ON_ONCE(1);
1388 1387
1389 info = IEEE80211_SKB_CB(skb);
1390 iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]); 1388 iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]);
1391 1389
1390 memset(&info->status, 0, sizeof(info->status));
1391 /* Packet was transmitted successfully, failures come as single
1392 * frames because before failing a frame the firmware transmits
1393 * it without aggregation at least once.
1394 */
1395 info->flags |= IEEE80211_TX_STAT_ACK;
1396
1392 if (freed == 1) { 1397 if (freed == 1) {
1393 /* this is the first skb we deliver in this batch */ 1398 /* this is the first skb we deliver in this batch */
1394 /* put the rate scaling data there */ 1399 /* put the rate scaling data there */
1395 info = IEEE80211_SKB_CB(skb); 1400 info = IEEE80211_SKB_CB(skb);
1396 memset(&info->status, 0, sizeof(info->status)); 1401 memset(&info->status, 0, sizeof(info->status));
1397 info->flags |= IEEE80211_TX_STAT_ACK;
1398 info->flags |= IEEE80211_TX_STAT_AMPDU; 1402 info->flags |= IEEE80211_TX_STAT_AMPDU;
1399 info->status.ampdu_ack_len = ba_resp->txed_2_done; 1403 info->status.ampdu_ack_len = ba_resp->txed_2_done;
1400 info->status.ampdu_len = ba_resp->txed; 1404 info->status.ampdu_len = ba_resp->txed;
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index e4ead86f06d6..2b0ba1fc3c82 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -152,7 +152,7 @@ enum iwl_power_scheme {
152 IWL_POWER_SCHEME_LP 152 IWL_POWER_SCHEME_LP
153}; 153};
154 154
155#define IWL_CONN_MAX_LISTEN_INTERVAL 70 155#define IWL_CONN_MAX_LISTEN_INTERVAL 10
156#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ 156#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\
157 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\ 157 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\
158 IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\ 158 IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index 4df12fa9d336..76ee486039d7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -822,16 +822,12 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
822 struct iwl_mvm_ba_notif *ba_notif = (void *)pkt->data; 822 struct iwl_mvm_ba_notif *ba_notif = (void *)pkt->data;
823 struct sk_buff_head reclaimed_skbs; 823 struct sk_buff_head reclaimed_skbs;
824 struct iwl_mvm_tid_data *tid_data; 824 struct iwl_mvm_tid_data *tid_data;
825 struct ieee80211_tx_info *info;
826 struct ieee80211_sta *sta; 825 struct ieee80211_sta *sta;
827 struct iwl_mvm_sta *mvmsta; 826 struct iwl_mvm_sta *mvmsta;
828 struct ieee80211_hdr *hdr;
829 struct sk_buff *skb; 827 struct sk_buff *skb;
830 int sta_id, tid, freed; 828 int sta_id, tid, freed;
831
832 /* "flow" corresponds to Tx queue */ 829 /* "flow" corresponds to Tx queue */
833 u16 scd_flow = le16_to_cpu(ba_notif->scd_flow); 830 u16 scd_flow = le16_to_cpu(ba_notif->scd_flow);
834
835 /* "ssn" is start of block-ack Tx window, corresponds to index 831 /* "ssn" is start of block-ack Tx window, corresponds to index
836 * (in Tx queue's circular buffer) of first TFD/frame in window */ 832 * (in Tx queue's circular buffer) of first TFD/frame in window */
837 u16 ba_resp_scd_ssn = le16_to_cpu(ba_notif->scd_ssn); 833 u16 ba_resp_scd_ssn = le16_to_cpu(ba_notif->scd_ssn);
@@ -888,22 +884,26 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
888 freed = 0; 884 freed = 0;
889 885
890 skb_queue_walk(&reclaimed_skbs, skb) { 886 skb_queue_walk(&reclaimed_skbs, skb) {
891 hdr = (struct ieee80211_hdr *)skb->data; 887 struct ieee80211_hdr *hdr = (void *)skb->data;
888 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
892 889
893 if (ieee80211_is_data_qos(hdr->frame_control)) 890 if (ieee80211_is_data_qos(hdr->frame_control))
894 freed++; 891 freed++;
895 else 892 else
896 WARN_ON_ONCE(1); 893 WARN_ON_ONCE(1);
897 894
898 info = IEEE80211_SKB_CB(skb);
899 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); 895 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]);
900 896
897 memset(&info->status, 0, sizeof(info->status));
898 /* Packet was transmitted successfully, failures come as single
899 * frames because before failing a frame the firmware transmits
900 * it without aggregation at least once.
901 */
902 info->flags |= IEEE80211_TX_STAT_ACK;
903
901 if (freed == 1) { 904 if (freed == 1) {
902 /* this is the first skb we deliver in this batch */ 905 /* this is the first skb we deliver in this batch */
903 /* put the rate scaling data there */ 906 /* put the rate scaling data there */
904 info = IEEE80211_SKB_CB(skb);
905 memset(&info->status, 0, sizeof(info->status));
906 info->flags |= IEEE80211_TX_STAT_ACK;
907 info->flags |= IEEE80211_TX_STAT_AMPDU; 907 info->flags |= IEEE80211_TX_STAT_AMPDU;
908 info->status.ampdu_ack_len = ba_notif->txed_2_done; 908 info->status.ampdu_ack_len = ba_notif->txed_2_done;
909 info->status.ampdu_len = ba_notif->txed; 909 info->status.ampdu_len = ba_notif->txed;
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 32f75007a825..cb6d189bc3e6 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -621,7 +621,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
621 id = *pos++; 621 id = *pos++;
622 elen = *pos++; 622 elen = *pos++;
623 left -= 2; 623 left -= 2;
624 if (elen > left || elen == 0) { 624 if (elen > left) {
625 lbs_deb_scan("scan response: invalid IE fmt\n"); 625 lbs_deb_scan("scan response: invalid IE fmt\n");
626 goto done; 626 goto done;
627 } 627 }
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 03688aa14e8a..7fe7b53fb17a 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1211,6 +1211,12 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
1211 rd_index = card->rxbd_rdptr & reg->rx_mask; 1211 rd_index = card->rxbd_rdptr & reg->rx_mask;
1212 skb_data = card->rx_buf_list[rd_index]; 1212 skb_data = card->rx_buf_list[rd_index];
1213 1213
1214 /* If skb allocation was failed earlier for Rx packet,
1215 * rx_buf_list[rd_index] would have been left with a NULL.
1216 */
1217 if (!skb_data)
1218 return -ENOMEM;
1219
1214 MWIFIEX_SKB_PACB(skb_data, &buf_pa); 1220 MWIFIEX_SKB_PACB(skb_data, &buf_pa);
1215 pci_unmap_single(card->dev, buf_pa, MWIFIEX_RX_DATA_BUF_SIZE, 1221 pci_unmap_single(card->dev, buf_pa, MWIFIEX_RX_DATA_BUF_SIZE,
1216 PCI_DMA_FROMDEVICE); 1222 PCI_DMA_FROMDEVICE);
@@ -1525,6 +1531,14 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
1525 if (adapter->ps_state == PS_STATE_SLEEP_CFM) { 1531 if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
1526 mwifiex_process_sleep_confirm_resp(adapter, skb->data, 1532 mwifiex_process_sleep_confirm_resp(adapter, skb->data,
1527 skb->len); 1533 skb->len);
1534 mwifiex_pcie_enable_host_int(adapter);
1535 if (mwifiex_write_reg(adapter,
1536 PCIE_CPU_INT_EVENT,
1537 CPU_INTR_SLEEP_CFM_DONE)) {
1538 dev_warn(adapter->dev,
1539 "Write register failed\n");
1540 return -1;
1541 }
1528 while (reg->sleep_cookie && (count++ < 10) && 1542 while (reg->sleep_cookie && (count++ < 10) &&
1529 mwifiex_pcie_ok_to_access_hw(adapter)) 1543 mwifiex_pcie_ok_to_access_hw(adapter))
1530 usleep_range(50, 60); 1544 usleep_range(50, 60);
@@ -1993,23 +2007,9 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
1993 adapter->int_status |= pcie_ireg; 2007 adapter->int_status |= pcie_ireg;
1994 spin_unlock_irqrestore(&adapter->int_lock, flags); 2008 spin_unlock_irqrestore(&adapter->int_lock, flags);
1995 2009
1996 if (pcie_ireg & HOST_INTR_CMD_DONE) { 2010 if (!adapter->pps_uapsd_mode &&
1997 if ((adapter->ps_state == PS_STATE_SLEEP_CFM) || 2011 adapter->ps_state == PS_STATE_SLEEP &&
1998 (adapter->ps_state == PS_STATE_SLEEP)) { 2012 mwifiex_pcie_ok_to_access_hw(adapter)) {
1999 mwifiex_pcie_enable_host_int(adapter);
2000 if (mwifiex_write_reg(adapter,
2001 PCIE_CPU_INT_EVENT,
2002 CPU_INTR_SLEEP_CFM_DONE)
2003 ) {
2004 dev_warn(adapter->dev,
2005 "Write register failed\n");
2006 return;
2007
2008 }
2009 }
2010 } else if (!adapter->pps_uapsd_mode &&
2011 adapter->ps_state == PS_STATE_SLEEP &&
2012 mwifiex_pcie_ok_to_access_hw(adapter)) {
2013 /* Potentially for PCIe we could get other 2013 /* Potentially for PCIe we could get other
2014 * interrupts like shared. Don't change power 2014 * interrupts like shared. Don't change power
2015 * state until cookie is set */ 2015 * state until cookie is set */
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c
index e8ebbd4bc3cd..208748804a55 100644
--- a/drivers/net/wireless/mwifiex/usb.c
+++ b/drivers/net/wireless/mwifiex/usb.c
@@ -22,8 +22,6 @@
22 22
23#define USB_VERSION "1.0" 23#define USB_VERSION "1.0"
24 24
25static const char usbdriver_name[] = "usb8xxx";
26
27static struct mwifiex_if_ops usb_ops; 25static struct mwifiex_if_ops usb_ops;
28static struct semaphore add_remove_card_sem; 26static struct semaphore add_remove_card_sem;
29static struct usb_card_rec *usb_card; 27static struct usb_card_rec *usb_card;
@@ -527,13 +525,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf)
527 MWIFIEX_BSS_ROLE_ANY), 525 MWIFIEX_BSS_ROLE_ANY),
528 MWIFIEX_ASYNC_CMD); 526 MWIFIEX_ASYNC_CMD);
529 527
530#ifdef CONFIG_PM
531 /* Resume handler may be called due to remote wakeup,
532 * force to exit suspend anyway
533 */
534 usb_disable_autosuspend(card->udev);
535#endif /* CONFIG_PM */
536
537 return 0; 528 return 0;
538} 529}
539 530
@@ -567,13 +558,12 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
567} 558}
568 559
569static struct usb_driver mwifiex_usb_driver = { 560static struct usb_driver mwifiex_usb_driver = {
570 .name = usbdriver_name, 561 .name = "mwifiex_usb",
571 .probe = mwifiex_usb_probe, 562 .probe = mwifiex_usb_probe,
572 .disconnect = mwifiex_usb_disconnect, 563 .disconnect = mwifiex_usb_disconnect,
573 .id_table = mwifiex_usb_table, 564 .id_table = mwifiex_usb_table,
574 .suspend = mwifiex_usb_suspend, 565 .suspend = mwifiex_usb_suspend,
575 .resume = mwifiex_usb_resume, 566 .resume = mwifiex_usb_resume,
576 .supports_autosuspend = 1,
577}; 567};
578 568
579static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter) 569static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter)
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 13eaeed03898..981cf6e7c73b 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -559,7 +559,8 @@ mwifiex_clean_txrx(struct mwifiex_private *priv)
559 mwifiex_wmm_delete_all_ralist(priv); 559 mwifiex_wmm_delete_all_ralist(priv);
560 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid)); 560 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid));
561 561
562 if (priv->adapter->if_ops.clean_pcie_ring) 562 if (priv->adapter->if_ops.clean_pcie_ring &&
563 !priv->adapter->surprise_removed)
563 priv->adapter->if_ops.clean_pcie_ring(priv->adapter); 564 priv->adapter->if_ops.clean_pcie_ring(priv->adapter);
564 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); 565 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
565} 566}
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index f9daa9e183f2..e30d80033cbc 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -907,6 +907,7 @@ static int handle_incoming_queue(struct net_device *dev,
907 907
908 /* Ethernet work: Delayed to here as it peeks the header. */ 908 /* Ethernet work: Delayed to here as it peeks the header. */
909 skb->protocol = eth_type_trans(skb, dev); 909 skb->protocol = eth_type_trans(skb, dev);
910 skb_reset_network_header(skb);
910 911
911 if (checksum_setup(dev, skb)) { 912 if (checksum_setup(dev, skb)) {
912 kfree_skb(skb); 913 kfree_skb(skb);