aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-03-05 20:32:02 -0500
committerDavid S. Miller <davem@davemloft.net>2014-03-05 20:32:02 -0500
commit67ddc87f162e2d0e29db2b6b21c5a3fbcb8be206 (patch)
treec83ac73e3d569156d4b7f3dab3e7e27e0054cd0d /drivers/net
parent6092c79fd00ce48ee8698955ea6419cc5cd65641 (diff)
parentc3bebc71c4bcdafa24b506adf0c1de3c1f77e2e0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/wireless/ath/ath9k/recv.c drivers/net/wireless/mwifiex/pcie.c net/ipv6/sit.c The SIT driver conflict consists of a bug fix being done by hand in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper was created (netdev_alloc_pcpu_stats()) which takes care of this. The two wireless conflicts were overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
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.c77
-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, 299 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index f04f3625e944..a2ef3f72de88 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/**
@@ -2063,6 +2063,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2063 struct list_head *iter; 2063 struct list_head *iter;
2064 struct slave *slave; 2064 struct slave *slave;
2065 struct port *port; 2065 struct port *port;
2066 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
2066 2067
2067 read_lock(&bond->lock); 2068 read_lock(&bond->lock);
2068 rcu_read_lock(); 2069 rcu_read_lock();
@@ -2120,8 +2121,19 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2120 } 2121 }
2121 2122
2122re_arm: 2123re_arm:
2124 bond_for_each_slave_rcu(bond, slave, iter) {
2125 if (slave->should_notify) {
2126 should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
2127 break;
2128 }
2129 }
2123 rcu_read_unlock(); 2130 rcu_read_unlock();
2124 read_unlock(&bond->lock); 2131 read_unlock(&bond->lock);
2132
2133 if (should_notify_rtnl && rtnl_trylock()) {
2134 bond_slave_state_notify(bond);
2135 rtnl_unlock();
2136 }
2125 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks); 2137 queue_delayed_work(bond->wq, &bond->ad_work, ad_delta_in_ticks);
2126} 2138}
2127 2139
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 12861e37d526..730d72c706c9 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,
@@ -1182,6 +1186,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1182 return -EBUSY; 1186 return -EBUSY;
1183 } 1187 }
1184 1188
1189 if (bond_dev == slave_dev) {
1190 pr_err("%s: cannot enslave bond to itself.\n", bond_dev->name);
1191 return -EPERM;
1192 }
1193
1185 /* vlan challenged mutual exclusion */ 1194 /* vlan challenged mutual exclusion */
1186 /* no need to lock since we're protected by rtnl_lock */ 1195 /* no need to lock since we're protected by rtnl_lock */
1187 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) { 1196 if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
@@ -1451,14 +1460,15 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1451 1460
1452 switch (bond->params.mode) { 1461 switch (bond->params.mode) {
1453 case BOND_MODE_ACTIVEBACKUP: 1462 case BOND_MODE_ACTIVEBACKUP:
1454 bond_set_slave_inactive_flags(new_slave); 1463 bond_set_slave_inactive_flags(new_slave,
1464 BOND_SLAVE_NOTIFY_NOW);
1455 break; 1465 break;
1456 case BOND_MODE_8023AD: 1466 case BOND_MODE_8023AD:
1457 /* in 802.3ad mode, the internal mechanism 1467 /* in 802.3ad mode, the internal mechanism
1458 * will activate the slaves in the selected 1468 * will activate the slaves in the selected
1459 * aggregator 1469 * aggregator
1460 */ 1470 */
1461 bond_set_slave_inactive_flags(new_slave); 1471 bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW);
1462 /* if this is the first slave */ 1472 /* if this is the first slave */
1463 if (!prev_slave) { 1473 if (!prev_slave) {
1464 SLAVE_AD_INFO(new_slave).id = 1; 1474 SLAVE_AD_INFO(new_slave).id = 1;
@@ -1476,7 +1486,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1476 case BOND_MODE_TLB: 1486 case BOND_MODE_TLB:
1477 case BOND_MODE_ALB: 1487 case BOND_MODE_ALB:
1478 bond_set_active_slave(new_slave); 1488 bond_set_active_slave(new_slave);
1479 bond_set_slave_inactive_flags(new_slave); 1489 bond_set_slave_inactive_flags(new_slave, BOND_SLAVE_NOTIFY_NOW);
1480 break; 1490 break;
1481 default: 1491 default:
1482 pr_debug("This slave is always active in trunk mode\n"); 1492 pr_debug("This slave is always active in trunk mode\n");
@@ -1641,9 +1651,6 @@ static int __bond_release_one(struct net_device *bond_dev,
1641 return -EINVAL; 1651 return -EINVAL;
1642 } 1652 }
1643 1653
1644 /* release the slave from its bond */
1645 bond->slave_cnt--;
1646
1647 bond_sysfs_slave_del(slave); 1654 bond_sysfs_slave_del(slave);
1648 1655
1649 bond_upper_dev_unlink(bond_dev, slave_dev); 1656 bond_upper_dev_unlink(bond_dev, slave_dev);
@@ -1725,6 +1732,7 @@ static int __bond_release_one(struct net_device *bond_dev,
1725 1732
1726 unblock_netpoll_tx(); 1733 unblock_netpoll_tx();
1727 synchronize_rcu(); 1734 synchronize_rcu();
1735 bond->slave_cnt--;
1728 1736
1729 if (!bond_has_slaves(bond)) { 1737 if (!bond_has_slaves(bond)) {
1730 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev); 1738 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
@@ -1998,7 +2006,8 @@ static void bond_miimon_commit(struct bonding *bond)
1998 2006
1999 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || 2007 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP ||
2000 bond->params.mode == BOND_MODE_8023AD) 2008 bond->params.mode == BOND_MODE_8023AD)
2001 bond_set_slave_inactive_flags(slave); 2009 bond_set_slave_inactive_flags(slave,
2010 BOND_SLAVE_NOTIFY_NOW);
2002 2011
2003 pr_info("%s: link status definitely down for interface %s, disabling it\n", 2012 pr_info("%s: link status definitely down for interface %s, disabling it\n",
2004 bond->dev->name, slave->dev->name); 2013 bond->dev->name, slave->dev->name);
@@ -2553,7 +2562,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2553 slave->link = BOND_LINK_UP; 2562 slave->link = BOND_LINK_UP;
2554 if (bond->current_arp_slave) { 2563 if (bond->current_arp_slave) {
2555 bond_set_slave_inactive_flags( 2564 bond_set_slave_inactive_flags(
2556 bond->current_arp_slave); 2565 bond->current_arp_slave,
2566 BOND_SLAVE_NOTIFY_NOW);
2557 bond->current_arp_slave = NULL; 2567 bond->current_arp_slave = NULL;
2558 } 2568 }
2559 2569
@@ -2573,7 +2583,8 @@ static void bond_ab_arp_commit(struct bonding *bond)
2573 slave->link_failure_count++; 2583 slave->link_failure_count++;
2574 2584
2575 slave->link = BOND_LINK_DOWN; 2585 slave->link = BOND_LINK_DOWN;
2576 bond_set_slave_inactive_flags(slave); 2586 bond_set_slave_inactive_flags(slave,
2587 BOND_SLAVE_NOTIFY_NOW);
2577 2588
2578 pr_info("%s: link status definitely down for interface %s, disabling it\n", 2589 pr_info("%s: link status definitely down for interface %s, disabling it\n",
2579 bond->dev->name, slave->dev->name); 2590 bond->dev->name, slave->dev->name);
@@ -2606,17 +2617,17 @@ do_failover:
2606 2617
2607/* 2618/*
2608 * Send ARP probes for active-backup mode ARP monitor. 2619 * Send ARP probes for active-backup mode ARP monitor.
2620 *
2621 * Called with rcu_read_lock hold.
2609 */ 2622 */
2610static bool bond_ab_arp_probe(struct bonding *bond) 2623static bool bond_ab_arp_probe(struct bonding *bond)
2611{ 2624{
2612 struct slave *slave, *before = NULL, *new_slave = NULL, 2625 struct slave *slave, *before = NULL, *new_slave = NULL,
2613 *curr_arp_slave, *curr_active_slave; 2626 *curr_arp_slave = rcu_dereference(bond->current_arp_slave),
2627 *curr_active_slave = rcu_dereference(bond->curr_active_slave);
2614 struct list_head *iter; 2628 struct list_head *iter;
2615 bool found = false; 2629 bool found = false;
2616 2630 bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
2617 rcu_read_lock();
2618 curr_arp_slave = rcu_dereference(bond->current_arp_slave);
2619 curr_active_slave = rcu_dereference(bond->curr_active_slave);
2620 2631
2621 if (curr_arp_slave && curr_active_slave) 2632 if (curr_arp_slave && curr_active_slave)
2622 pr_info("PROBE: c_arp %s && cas %s BAD\n", 2633 pr_info("PROBE: c_arp %s && cas %s BAD\n",
@@ -2625,32 +2636,23 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2625 2636
2626 if (curr_active_slave) { 2637 if (curr_active_slave) {
2627 bond_arp_send_all(bond, curr_active_slave); 2638 bond_arp_send_all(bond, curr_active_slave);
2628 rcu_read_unlock(); 2639 return should_notify_rtnl;
2629 return true;
2630 } 2640 }
2631 rcu_read_unlock();
2632 2641
2633 /* if we don't have a curr_active_slave, search for the next available 2642 /* if we don't have a curr_active_slave, search for the next available
2634 * backup slave from the current_arp_slave and make it the candidate 2643 * backup slave from the current_arp_slave and make it the candidate
2635 * for becoming the curr_active_slave 2644 * for becoming the curr_active_slave
2636 */ 2645 */
2637 2646
2638 if (!rtnl_trylock())
2639 return false;
2640 /* curr_arp_slave might have gone away */
2641 curr_arp_slave = ACCESS_ONCE(bond->current_arp_slave);
2642
2643 if (!curr_arp_slave) { 2647 if (!curr_arp_slave) {
2644 curr_arp_slave = bond_first_slave(bond); 2648 curr_arp_slave = bond_first_slave_rcu(bond);
2645 if (!curr_arp_slave) { 2649 if (!curr_arp_slave)
2646 rtnl_unlock(); 2650 return should_notify_rtnl;
2647 return true;
2648 }
2649 } 2651 }
2650 2652
2651 bond_set_slave_inactive_flags(curr_arp_slave); 2653 bond_set_slave_inactive_flags(curr_arp_slave, BOND_SLAVE_NOTIFY_LATER);
2652 2654
2653 bond_for_each_slave(bond, slave, iter) { 2655 bond_for_each_slave_rcu(bond, slave, iter) {
2654 if (!found && !before && IS_UP(slave->dev)) 2656 if (!found && !before && IS_UP(slave->dev))
2655 before = slave; 2657 before = slave;
2656 2658
@@ -2668,7 +2670,8 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2668 if (slave->link_failure_count < UINT_MAX) 2670 if (slave->link_failure_count < UINT_MAX)
2669 slave->link_failure_count++; 2671 slave->link_failure_count++;
2670 2672
2671 bond_set_slave_inactive_flags(slave); 2673 bond_set_slave_inactive_flags(slave,
2674 BOND_SLAVE_NOTIFY_LATER);
2672 2675
2673 pr_info("%s: backup interface %s is now down\n", 2676 pr_info("%s: backup interface %s is now down\n",
2674 bond->dev->name, slave->dev->name); 2677 bond->dev->name, slave->dev->name);
@@ -2680,26 +2683,31 @@ static bool bond_ab_arp_probe(struct bonding *bond)
2680 if (!new_slave && before) 2683 if (!new_slave && before)
2681 new_slave = before; 2684 new_slave = before;
2682 2685
2683 if (!new_slave) { 2686 if (!new_slave)
2684 rtnl_unlock(); 2687 goto check_state;
2685 return true;
2686 }
2687 2688
2688 new_slave->link = BOND_LINK_BACK; 2689 new_slave->link = BOND_LINK_BACK;
2689 bond_set_slave_active_flags(new_slave); 2690 bond_set_slave_active_flags(new_slave, BOND_SLAVE_NOTIFY_LATER);
2690 bond_arp_send_all(bond, new_slave); 2691 bond_arp_send_all(bond, new_slave);
2691 new_slave->last_link_up = jiffies; 2692 new_slave->last_link_up = jiffies;
2692 rcu_assign_pointer(bond->current_arp_slave, new_slave); 2693 rcu_assign_pointer(bond->current_arp_slave, new_slave);
2693 rtnl_unlock();
2694 2694
2695 return true; 2695check_state:
2696 bond_for_each_slave_rcu(bond, slave, iter) {
2697 if (slave->should_notify) {
2698 should_notify_rtnl = BOND_SLAVE_NOTIFY_NOW;
2699 break;
2700 }
2701 }
2702 return should_notify_rtnl;
2696} 2703}
2697 2704
2698static void bond_activebackup_arp_mon(struct work_struct *work) 2705static void bond_activebackup_arp_mon(struct work_struct *work)
2699{ 2706{
2700 struct bonding *bond = container_of(work, struct bonding, 2707 struct bonding *bond = container_of(work, struct bonding,
2701 arp_work.work); 2708 arp_work.work);
2702 bool should_notify_peers = false, should_commit = false; 2709 bool should_notify_peers = false;
2710 bool should_notify_rtnl = false;
2703 int delta_in_ticks; 2711 int delta_in_ticks;
2704 2712
2705 delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval); 2713 delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
@@ -2708,11 +2716,12 @@ static void bond_activebackup_arp_mon(struct work_struct *work)
2708 goto re_arm; 2716 goto re_arm;
2709 2717
2710 rcu_read_lock(); 2718 rcu_read_lock();
2719
2711 should_notify_peers = bond_should_notify_peers(bond); 2720 should_notify_peers = bond_should_notify_peers(bond);
2712 should_commit = bond_ab_arp_inspect(bond);
2713 rcu_read_unlock();
2714 2721
2715 if (should_commit) { 2722 if (bond_ab_arp_inspect(bond)) {
2723 rcu_read_unlock();
2724
2716 /* Race avoidance with bond_close flush of workqueue */ 2725 /* Race avoidance with bond_close flush of workqueue */
2717 if (!rtnl_trylock()) { 2726 if (!rtnl_trylock()) {
2718 delta_in_ticks = 1; 2727 delta_in_ticks = 1;
@@ -2721,23 +2730,28 @@ static void bond_activebackup_arp_mon(struct work_struct *work)
2721 } 2730 }
2722 2731
2723 bond_ab_arp_commit(bond); 2732 bond_ab_arp_commit(bond);
2733
2724 rtnl_unlock(); 2734 rtnl_unlock();
2735 rcu_read_lock();
2725 } 2736 }
2726 2737
2727 if (!bond_ab_arp_probe(bond)) { 2738 should_notify_rtnl = bond_ab_arp_probe(bond);
2728 /* rtnl locking failed, re-arm */ 2739 rcu_read_unlock();
2729 delta_in_ticks = 1;
2730 should_notify_peers = false;
2731 }
2732 2740
2733re_arm: 2741re_arm:
2734 if (bond->params.arp_interval) 2742 if (bond->params.arp_interval)
2735 queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks); 2743 queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks);
2736 2744
2737 if (should_notify_peers) { 2745 if (should_notify_peers || should_notify_rtnl) {
2738 if (!rtnl_trylock()) 2746 if (!rtnl_trylock())
2739 return; 2747 return;
2740 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev); 2748
2749 if (should_notify_peers)
2750 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
2751 bond->dev);
2752 if (should_notify_rtnl)
2753 bond_slave_state_notify(bond);
2754
2741 rtnl_unlock(); 2755 rtnl_unlock();
2742 } 2756 }
2743} 2757}
@@ -3036,9 +3050,11 @@ static int bond_open(struct net_device *bond_dev)
3036 bond_for_each_slave(bond, slave, iter) { 3050 bond_for_each_slave(bond, slave, iter) {
3037 if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP) 3051 if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)
3038 && (slave != bond->curr_active_slave)) { 3052 && (slave != bond->curr_active_slave)) {
3039 bond_set_slave_inactive_flags(slave); 3053 bond_set_slave_inactive_flags(slave,
3054 BOND_SLAVE_NOTIFY_NOW);
3040 } else { 3055 } else {
3041 bond_set_slave_active_flags(slave); 3056 bond_set_slave_active_flags(slave,
3057 BOND_SLAVE_NOTIFY_NOW);
3042 } 3058 }
3043 } 3059 }
3044 read_unlock(&bond->curr_slave_lock); 3060 read_unlock(&bond->curr_slave_lock);
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 430362891d0d..b7127a1ba2c9 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -196,7 +196,8 @@ struct slave {
196 s8 new_link; 196 s8 new_link;
197 u8 backup:1, /* indicates backup slave. Value corresponds with 197 u8 backup:1, /* indicates backup slave. Value corresponds with
198 BOND_STATE_ACTIVE and BOND_STATE_BACKUP */ 198 BOND_STATE_ACTIVE and BOND_STATE_BACKUP */
199 inactive:1; /* indicates inactive slave */ 199 inactive:1, /* indicates inactive slave */
200 should_notify:1; /* indicateds whether the state changed */
200 u8 duplex; 201 u8 duplex;
201 u32 original_mtu; 202 u32 original_mtu;
202 u32 link_failure_count; 203 u32 link_failure_count;
@@ -304,6 +305,24 @@ static inline void bond_set_backup_slave(struct slave *slave)
304 } 305 }
305} 306}
306 307
308static inline void bond_set_slave_state(struct slave *slave,
309 int slave_state, bool notify)
310{
311 if (slave->backup == slave_state)
312 return;
313
314 slave->backup = slave_state;
315 if (notify) {
316 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_KERNEL);
317 slave->should_notify = 0;
318 } else {
319 if (slave->should_notify)
320 slave->should_notify = 0;
321 else
322 slave->should_notify = 1;
323 }
324}
325
307static inline void bond_slave_state_change(struct bonding *bond) 326static inline void bond_slave_state_change(struct bonding *bond)
308{ 327{
309 struct list_head *iter; 328 struct list_head *iter;
@@ -317,6 +336,19 @@ static inline void bond_slave_state_change(struct bonding *bond)
317 } 336 }
318} 337}
319 338
339static inline void bond_slave_state_notify(struct bonding *bond)
340{
341 struct list_head *iter;
342 struct slave *tmp;
343
344 bond_for_each_slave(bond, tmp, iter) {
345 if (tmp->should_notify) {
346 rtmsg_ifinfo(RTM_NEWLINK, tmp->dev, 0, GFP_KERNEL);
347 tmp->should_notify = 0;
348 }
349 }
350}
351
320static inline int bond_slave_state(struct slave *slave) 352static inline int bond_slave_state(struct slave *slave)
321{ 353{
322 return slave->backup; 354 return slave->backup;
@@ -349,6 +381,9 @@ static inline bool bond_is_active_slave(struct slave *slave)
349#define BOND_ARP_FILTER_BACKUP (BOND_ARP_VALIDATE_BACKUP | \ 381#define BOND_ARP_FILTER_BACKUP (BOND_ARP_VALIDATE_BACKUP | \
350 BOND_ARP_FILTER) 382 BOND_ARP_FILTER)
351 383
384#define BOND_SLAVE_NOTIFY_NOW true
385#define BOND_SLAVE_NOTIFY_LATER false
386
352static inline int slave_do_arp_validate(struct bonding *bond, 387static inline int slave_do_arp_validate(struct bonding *bond,
353 struct slave *slave) 388 struct slave *slave)
354{ 389{
@@ -402,17 +437,19 @@ static inline void bond_netpoll_send_skb(const struct slave *slave,
402} 437}
403#endif 438#endif
404 439
405static inline void bond_set_slave_inactive_flags(struct slave *slave) 440static inline void bond_set_slave_inactive_flags(struct slave *slave,
441 bool notify)
406{ 442{
407 if (!bond_is_lb(slave->bond)) 443 if (!bond_is_lb(slave->bond))
408 bond_set_backup_slave(slave); 444 bond_set_slave_state(slave, BOND_STATE_BACKUP, notify);
409 if (!slave->bond->params.all_slaves_active) 445 if (!slave->bond->params.all_slaves_active)
410 slave->inactive = 1; 446 slave->inactive = 1;
411} 447}
412 448
413static inline void bond_set_slave_active_flags(struct slave *slave) 449static inline void bond_set_slave_active_flags(struct slave *slave,
450 bool notify)
414{ 451{
415 bond_set_active_slave(slave); 452 bond_set_slave_state(slave, BOND_STATE_ACTIVE, notify);
416 slave->inactive = 0; 453 slave->inactive = 0;
417} 454}
418 455
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 26bc25bd465d..117b5c7f8ac9 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 6e5e7c0ffbd7..e12735fbdcdb 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 bf436d0a1094..aeec9ccc0b39 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
@@ -3240,11 +3243,6 @@ bnad_set_rx_mode(struct net_device *netdev)
3240 BNA_RXMODE_ALLMULTI; 3243 BNA_RXMODE_ALLMULTI;
3241 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL); 3244 bna_rx_mode_set(bnad->rx_info[0].rx, new_mode, mode_mask, NULL);
3242 3245
3243 if (bnad->cfg_flags & BNAD_CF_PROMISC)
3244 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3245 else
3246 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3247
3248 spin_unlock_irqrestore(&bnad->bna_lock, flags); 3246 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3249} 3247}
3250 3248
@@ -3369,6 +3367,27 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
3369 return 0; 3367 return 0;
3370} 3368}
3371 3369
3370static int bnad_set_features(struct net_device *dev, netdev_features_t features)
3371{
3372 struct bnad *bnad = netdev_priv(dev);
3373 netdev_features_t changed = features ^ dev->features;
3374
3375 if ((changed & NETIF_F_HW_VLAN_CTAG_RX) && netif_running(dev)) {
3376 unsigned long flags;
3377
3378 spin_lock_irqsave(&bnad->bna_lock, flags);
3379
3380 if (features & NETIF_F_HW_VLAN_CTAG_RX)
3381 bna_rx_vlan_strip_enable(bnad->rx_info[0].rx);
3382 else
3383 bna_rx_vlan_strip_disable(bnad->rx_info[0].rx);
3384
3385 spin_unlock_irqrestore(&bnad->bna_lock, flags);
3386 }
3387
3388 return 0;
3389}
3390
3372#ifdef CONFIG_NET_POLL_CONTROLLER 3391#ifdef CONFIG_NET_POLL_CONTROLLER
3373static void 3392static void
3374bnad_netpoll(struct net_device *netdev) 3393bnad_netpoll(struct net_device *netdev)
@@ -3416,6 +3435,7 @@ static const struct net_device_ops bnad_netdev_ops = {
3416 .ndo_change_mtu = bnad_change_mtu, 3435 .ndo_change_mtu = bnad_change_mtu,
3417 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid, 3436 .ndo_vlan_rx_add_vid = bnad_vlan_rx_add_vid,
3418 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid, 3437 .ndo_vlan_rx_kill_vid = bnad_vlan_rx_kill_vid,
3438 .ndo_set_features = bnad_set_features,
3419#ifdef CONFIG_NET_POLL_CONTROLLER 3439#ifdef CONFIG_NET_POLL_CONTROLLER
3420 .ndo_poll_controller = bnad_netpoll 3440 .ndo_poll_controller = bnad_netpoll
3421#endif 3441#endif
@@ -3428,14 +3448,14 @@ bnad_netdev_init(struct bnad *bnad, bool using_dac)
3428 3448
3429 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | 3449 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
3430 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3450 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3431 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX; 3451 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX |
3452 NETIF_F_HW_VLAN_CTAG_RX;
3432 3453
3433 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA | 3454 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA |
3434 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 3455 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3435 NETIF_F_TSO | NETIF_F_TSO6; 3456 NETIF_F_TSO | NETIF_F_TSO6;
3436 3457
3437 netdev->features |= netdev->hw_features | 3458 netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
3438 NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
3439 3459
3440 if (using_dac) 3460 if (using_dac)
3441 netdev->features |= NETIF_F_HIGHDMA; 3461 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 da4edc1c77b3..0ac53dd84c61 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -6206,6 +6206,7 @@ static struct pci_driver cxgb4_driver = {
6206 .id_table = cxgb4_pci_tbl, 6206 .id_table = cxgb4_pci_tbl,
6207 .probe = init_one, 6207 .probe = init_one,
6208 .remove = remove_one, 6208 .remove = remove_one,
6209 .shutdown = remove_one,
6209 .err_handler = &cxgb4_eeh, 6210 .err_handler = &cxgb4_eeh,
6210}; 6211};
6211 6212
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index bf5ca71df77f..a91267be715a 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 34644969a4be..6e10230a2ee0 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
@@ -3022,11 +3038,11 @@ static int be_vf_setup_init(struct be_adapter *adapter)
3022 3038
3023static int be_vf_setup(struct be_adapter *adapter) 3039static int be_vf_setup(struct be_adapter *adapter)
3024{ 3040{
3041 struct device *dev = &adapter->pdev->dev;
3025 struct be_vf_cfg *vf_cfg; 3042 struct be_vf_cfg *vf_cfg;
3026 u16 def_vlan, lnk_speed;
3027 int status, old_vfs, vf; 3043 int status, old_vfs, vf;
3028 struct device *dev = &adapter->pdev->dev;
3029 u32 privileges; 3044 u32 privileges;
3045 u16 lnk_speed;
3030 3046
3031 old_vfs = pci_num_vf(adapter->pdev); 3047 old_vfs = pci_num_vf(adapter->pdev);
3032 if (old_vfs) { 3048 if (old_vfs) {
@@ -3093,12 +3109,6 @@ static int be_vf_setup(struct be_adapter *adapter)
3093 if (!status) 3109 if (!status)
3094 vf_cfg->tx_rate = lnk_speed; 3110 vf_cfg->tx_rate = lnk_speed;
3095 3111
3096 status = be_cmd_get_hsw_config(adapter, &def_vlan,
3097 vf + 1, vf_cfg->if_handle, NULL);
3098 if (status)
3099 goto err;
3100 vf_cfg->def_vid = def_vlan;
3101
3102 if (!old_vfs) 3112 if (!old_vfs)
3103 be_cmd_enable_vf(adapter, vf + 1); 3113 be_cmd_enable_vf(adapter, vf + 1);
3104 } 3114 }
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 4ff7da83c4b3..69e1f36858e0 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 81df046a6d69..6f7c866d0bfa 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 0f39778e0e5b..3b83fbde4975 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -345,6 +345,7 @@ int qlcnic_83xx_setup_intr(struct qlcnic_adapter *adapter)
345 if (qlcnic_sriov_vf_check(adapter)) 345 if (qlcnic_sriov_vf_check(adapter))
346 return -EINVAL; 346 return -EINVAL;
347 num_msix = 1; 347 num_msix = 1;
348 adapter->drv_sds_rings = QLCNIC_SINGLE_RING;
348 adapter->drv_tx_rings = QLCNIC_SINGLE_RING; 349 adapter->drv_tx_rings = QLCNIC_SINGLE_RING;
349 } 350 }
350 } 351 }
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 a33547292878..4b92d9d90267 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -825,9 +825,10 @@ static int qlcnic_82xx_setup_intr(struct qlcnic_adapter *adapter)
825 825
826 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) { 826 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
827 qlcnic_disable_multi_tx(adapter); 827 qlcnic_disable_multi_tx(adapter);
828 adapter->drv_sds_rings = QLCNIC_SINGLE_RING;
828 829
829 err = qlcnic_enable_msi_legacy(adapter); 830 err = qlcnic_enable_msi_legacy(adapter);
830 if (!err) 831 if (err)
831 return err; 832 return err;
832 } 833 }
833 } 834 }
@@ -3872,7 +3873,7 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt,
3872 strcpy(buf, "Tx"); 3873 strcpy(buf, "Tx");
3873 } 3874 }
3874 3875
3875 if (!qlcnic_use_msi_x && !qlcnic_use_msi) { 3876 if (!QLCNIC_IS_MSI_FAMILY(adapter)) {
3876 netdev_err(netdev, "No RSS/TSS support in INT-x mode\n"); 3877 netdev_err(netdev, "No RSS/TSS support in INT-x mode\n");
3877 return -EINVAL; 3878 return -EINVAL;
3878 } 3879 }
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index a28460cf873d..14f748cbf0de 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#define QLC_SRIOV_ALLOW_VLAN0 BIT_19 18#define QLC_SRIOV_ALLOW_VLAN0 BIT_19
@@ -1210,13 +1208,6 @@ static int qlcnic_sriov_validate_cfg_macvlan(struct qlcnic_adapter *adapter,
1210 struct qlcnic_vport *vp = vf->vp; 1208 struct qlcnic_vport *vp = vf->vp;
1211 u8 op, new_op; 1209 u8 op, new_op;
1212 1210
1213 if (((cmd->req.arg[1] & QLC_MAC_OPCODE_MASK) == QLC_MAC_STAR_ADD) ||
1214 ((cmd->req.arg[1] & QLC_MAC_OPCODE_MASK) == QLC_MAC_STAR_DEL)) {
1215 netdev_err(adapter->netdev, "MAC + any VLAN filter not allowed from VF %d\n",
1216 vf->pci_func);
1217 return -EINVAL;
1218 }
1219
1220 if (!(cmd->req.arg[1] & BIT_8)) 1211 if (!(cmd->req.arg[1] & BIT_8))
1221 return -EINVAL; 1212 return -EINVAL;
1222 1213
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 28275e395cb8..722344fcd155 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1652,6 +1652,13 @@ void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev)
1652 struct efx_ptp_data *ptp = efx->ptp_data; 1652 struct efx_ptp_data *ptp = efx->ptp_data;
1653 int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE); 1653 int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE);
1654 1654
1655 if (!ptp) {
1656 if (net_ratelimit())
1657 netif_warn(efx, drv, efx->net_dev,
1658 "Received PTP event but PTP not set up\n");
1659 return;
1660 }
1661
1655 if (!ptp->enabled) 1662 if (!ptp->enabled)
1656 return; 1663 return;
1657 1664
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 0b6a2802d51b..53f85dd3bbad 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 44227c25a276..c683ac2c8c94 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 | \
@@ -538,7 +541,7 @@ static int macvlan_init(struct net_device *dev)
538 dev->state = (dev->state & ~MACVLAN_STATE_MASK) | 541 dev->state = (dev->state & ~MACVLAN_STATE_MASK) |
539 (lowerdev->state & MACVLAN_STATE_MASK); 542 (lowerdev->state & MACVLAN_STATE_MASK);
540 dev->features = lowerdev->features & MACVLAN_FEATURES; 543 dev->features = lowerdev->features & MACVLAN_FEATURES;
541 dev->features |= NETIF_F_LLTX; 544 dev->features |= ALWAYS_ON_FEATURES;
542 dev->gso_max_size = lowerdev->gso_max_size; 545 dev->gso_max_size = lowerdev->gso_max_size;
543 dev->iflink = lowerdev->ifindex; 546 dev->iflink = lowerdev->ifindex;
544 dev->hard_header_len = lowerdev->hard_header_len; 547 dev->hard_header_len = lowerdev->hard_header_len;
@@ -692,7 +695,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev,
692 features = netdev_increment_features(vlan->lowerdev->features, 695 features = netdev_increment_features(vlan->lowerdev->features,
693 features, 696 features,
694 mask); 697 mask);
695 features |= NETIF_F_LLTX; 698 features |= ALWAYS_ON_FEATURES;
696 699
697 return features; 700 return features;
698} 701}
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index a70b604ac644..a2fbb3e1db9a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -933,6 +933,8 @@ int genphy_read_status(struct phy_device *phydev)
933 int err; 933 int err;
934 int lpa; 934 int lpa;
935 int lpagb = 0; 935 int lpagb = 0;
936 int common_adv;
937 int common_adv_gb = 0;
936 938
937 /* Update the link, but return if there was an error */ 939 /* Update the link, but return if there was an error */
938 err = genphy_update_link(phydev); 940 err = genphy_update_link(phydev);
@@ -954,7 +956,7 @@ int genphy_read_status(struct phy_device *phydev)
954 956
955 phydev->lp_advertising = 957 phydev->lp_advertising =
956 mii_stat1000_to_ethtool_lpa_t(lpagb); 958 mii_stat1000_to_ethtool_lpa_t(lpagb);
957 lpagb &= adv << 2; 959 common_adv_gb = lpagb & adv << 2;
958 } 960 }
959 961
960 lpa = phy_read(phydev, MII_LPA); 962 lpa = phy_read(phydev, MII_LPA);
@@ -967,25 +969,25 @@ int genphy_read_status(struct phy_device *phydev)
967 if (adv < 0) 969 if (adv < 0)
968 return adv; 970 return adv;
969 971
970 lpa &= adv; 972 common_adv = lpa & adv;
971 973
972 phydev->speed = SPEED_10; 974 phydev->speed = SPEED_10;
973 phydev->duplex = DUPLEX_HALF; 975 phydev->duplex = DUPLEX_HALF;
974 phydev->pause = 0; 976 phydev->pause = 0;
975 phydev->asym_pause = 0; 977 phydev->asym_pause = 0;
976 978
977 if (lpagb & (LPA_1000FULL | LPA_1000HALF)) { 979 if (common_adv_gb & (LPA_1000FULL | LPA_1000HALF)) {
978 phydev->speed = SPEED_1000; 980 phydev->speed = SPEED_1000;
979 981
980 if (lpagb & LPA_1000FULL) 982 if (common_adv_gb & LPA_1000FULL)
981 phydev->duplex = DUPLEX_FULL; 983 phydev->duplex = DUPLEX_FULL;
982 } else if (lpa & (LPA_100FULL | LPA_100HALF)) { 984 } else if (common_adv & (LPA_100FULL | LPA_100HALF)) {
983 phydev->speed = SPEED_100; 985 phydev->speed = SPEED_100;
984 986
985 if (lpa & LPA_100FULL) 987 if (common_adv & LPA_100FULL)
986 phydev->duplex = DUPLEX_FULL; 988 phydev->duplex = DUPLEX_FULL;
987 } else 989 } else
988 if (lpa & LPA_10FULL) 990 if (common_adv & LPA_10FULL)
989 phydev->duplex = DUPLEX_FULL; 991 phydev->duplex = DUPLEX_FULL;
990 992
991 if (phydev->duplex == DUPLEX_FULL) { 993 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 955df81a4358..d2e6fdb25e28 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1395,6 +1395,19 @@ static const struct driver_info ax88178a_info = {
1395 .tx_fixup = ax88179_tx_fixup, 1395 .tx_fixup = ax88179_tx_fixup,
1396}; 1396};
1397 1397
1398static const struct driver_info dlink_dub1312_info = {
1399 .description = "D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter",
1400 .bind = ax88179_bind,
1401 .unbind = ax88179_unbind,
1402 .status = ax88179_status,
1403 .link_reset = ax88179_link_reset,
1404 .reset = ax88179_reset,
1405 .stop = ax88179_stop,
1406 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1407 .rx_fixup = ax88179_rx_fixup,
1408 .tx_fixup = ax88179_tx_fixup,
1409};
1410
1398static const struct driver_info sitecom_info = { 1411static const struct driver_info sitecom_info = {
1399 .description = "Sitecom USB 3.0 to Gigabit Adapter", 1412 .description = "Sitecom USB 3.0 to Gigabit Adapter",
1400 .bind = ax88179_bind, 1413 .bind = ax88179_bind,
@@ -1421,6 +1434,19 @@ static const struct driver_info samsung_info = {
1421 .tx_fixup = ax88179_tx_fixup, 1434 .tx_fixup = ax88179_tx_fixup,
1422}; 1435};
1423 1436
1437static const struct driver_info lenovo_info = {
1438 .description = "Lenovo OneLinkDock Gigabit LAN",
1439 .bind = ax88179_bind,
1440 .unbind = ax88179_unbind,
1441 .status = ax88179_status,
1442 .link_reset = ax88179_link_reset,
1443 .reset = ax88179_reset,
1444 .stop = ax88179_stop,
1445 .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1446 .rx_fixup = ax88179_rx_fixup,
1447 .tx_fixup = ax88179_tx_fixup,
1448};
1449
1424static const struct usb_device_id products[] = { 1450static const struct usb_device_id products[] = {
1425{ 1451{
1426 /* ASIX AX88179 10/100/1000 */ 1452 /* ASIX AX88179 10/100/1000 */
@@ -1431,6 +1457,10 @@ static const struct usb_device_id products[] = {
1431 USB_DEVICE(0x0b95, 0x178a), 1457 USB_DEVICE(0x0b95, 0x178a),
1432 .driver_info = (unsigned long)&ax88178a_info, 1458 .driver_info = (unsigned long)&ax88178a_info,
1433}, { 1459}, {
1460 /* D-Link DUB-1312 USB 3.0 to Gigabit Ethernet Adapter */
1461 USB_DEVICE(0x2001, 0x4a00),
1462 .driver_info = (unsigned long)&dlink_dub1312_info,
1463}, {
1434 /* Sitecom USB 3.0 to Gigabit Adapter */ 1464 /* Sitecom USB 3.0 to Gigabit Adapter */
1435 USB_DEVICE(0x0df6, 0x0072), 1465 USB_DEVICE(0x0df6, 0x0072),
1436 .driver_info = (unsigned long)&sitecom_info, 1466 .driver_info = (unsigned long)&sitecom_info,
@@ -1438,6 +1468,10 @@ static const struct usb_device_id products[] = {
1438 /* Samsung USB Ethernet Adapter */ 1468 /* Samsung USB Ethernet Adapter */
1439 USB_DEVICE(0x04e8, 0xa100), 1469 USB_DEVICE(0x04e8, 0xa100),
1440 .driver_info = (unsigned long)&samsung_info, 1470 .driver_info = (unsigned long)&samsung_info,
1471}, {
1472 /* Lenovo OneLinkDock Gigabit LAN */
1473 USB_DEVICE(0x17ef, 0x304b),
1474 .driver_info = (unsigned long)&lenovo_info,
1441}, 1475},
1442 { }, 1476 { },
1443}; 1477};
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 34b52638e12d..3aca92e80e1e 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -277,7 +277,8 @@ static void veth_setup(struct net_device *dev)
277 dev->ethtool_ops = &veth_ethtool_ops; 277 dev->ethtool_ops = &veth_ethtool_ops;
278 dev->features |= NETIF_F_LLTX; 278 dev->features |= NETIF_F_LLTX;
279 dev->features |= VETH_FEATURES; 279 dev->features |= VETH_FEATURES;
280 dev->vlan_features = dev->features; 280 dev->vlan_features = dev->features &
281 ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX);
281 dev->destructor = veth_dev_free; 282 dev->destructor = veth_dev_free;
282 283
283 dev->hw_features = VETH_FEATURES; 284 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 5db01b4212c8..2509c2ff0828 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1533,7 +1533,7 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
1533bool ath9k_hw_check_alive(struct ath_hw *ah) 1533bool ath9k_hw_check_alive(struct ath_hw *ah)
1534{ 1534{
1535 int count = 50; 1535 int count = 50;
1536 u32 reg; 1536 u32 reg, last_val;
1537 1537
1538 if (AR_SREV_9300(ah)) 1538 if (AR_SREV_9300(ah))
1539 return !ath9k_hw_detect_mac_hang(ah); 1539 return !ath9k_hw_detect_mac_hang(ah);
@@ -1541,9 +1541,13 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1541 if (AR_SREV_9285_12_OR_LATER(ah)) 1541 if (AR_SREV_9285_12_OR_LATER(ah))
1542 return true; 1542 return true;
1543 1543
1544 last_val = REG_READ(ah, AR_OBS_BUS_1);
1544 do { 1545 do {
1545 reg = REG_READ(ah, AR_OBS_BUS_1); 1546 reg = REG_READ(ah, AR_OBS_BUS_1);
1547 if (reg != last_val)
1548 return true;
1546 1549
1550 last_val = reg;
1547 if ((reg & 0x7E7FFFEF) == 0x00702400) 1551 if ((reg & 0x7E7FFFEF) == 0x00702400)
1548 continue; 1552 continue;
1549 1553
@@ -1555,6 +1559,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1555 default: 1559 default:
1556 return true; 1560 return true;
1557 } 1561 }
1562
1563 udelay(1);
1558 } while (count-- > 0); 1564 } while (count-- > 0);
1559 1565
1560 return false; 1566 return false;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 076dae1e5ab7..425e34f94af4 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);
@@ -787,32 +794,32 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
787 struct ath_common *common = ath9k_hw_common(ah); 794 struct ath_common *common = ath9k_hw_common(ah);
788 struct ieee80211_hdr *hdr; 795 struct ieee80211_hdr *hdr;
789 bool discard_current = sc->rx.discard_next; 796 bool discard_current = sc->rx.discard_next;
790 int ret = 0;
791 797
792 /* 798 /*
793 * Discard corrupt descriptors which are marked in 799 * Discard corrupt descriptors which are marked in
794 * ath_get_next_rx_buf(). 800 * ath_get_next_rx_buf().
795 */ 801 */
796 sc->rx.discard_next = rx_stats->rs_more;
797 if (discard_current) 802 if (discard_current)
798 return -EINVAL; 803 goto corrupt;
804
805 sc->rx.discard_next = false;
799 806
800 /* 807 /*
801 * Discard zero-length packets. 808 * Discard zero-length packets.
802 */ 809 */
803 if (!rx_stats->rs_datalen) { 810 if (!rx_stats->rs_datalen) {
804 RX_STAT_INC(rx_len_err); 811 RX_STAT_INC(rx_len_err);
805 return -EINVAL; 812 goto corrupt;
806 } 813 }
807 814
808 /* 815 /*
809 * rs_status follows rs_datalen so if rs_datalen is too large 816 * rs_status follows rs_datalen so if rs_datalen is too large
810 * we can take a hint that hardware corrupted it, so ignore 817 * we can take a hint that hardware corrupted it, so ignore
811 * those frames. 818 * those frames.
812 */ 819 */
813 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) { 820 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) {
814 RX_STAT_INC(rx_len_err); 821 RX_STAT_INC(rx_len_err);
815 return -EINVAL; 822 goto corrupt;
816 } 823 }
817 824
818 /* Only use status info from the last fragment */ 825 /* Only use status info from the last fragment */
@@ -826,10 +833,8 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
826 * This is different from the other corrupt descriptor 833 * This is different from the other corrupt descriptor
827 * condition handled above. 834 * condition handled above.
828 */ 835 */
829 if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC) { 836 if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC)
830 ret = -EINVAL; 837 goto corrupt;
831 goto exit;
832 }
833 838
834 hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len); 839 hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len);
835 840
@@ -845,18 +850,15 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
845 if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime)) 850 if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime))
846 RX_STAT_INC(rx_spectral); 851 RX_STAT_INC(rx_spectral);
847 852
848 ret = -EINVAL; 853 return -EINVAL;
849 goto exit;
850 } 854 }
851 855
852 /* 856 /*
853 * everything but the rate is checked here, the rate check is done 857 * everything but the rate is checked here, the rate check is done
854 * separately to avoid doing two lookups for a rate for each frame. 858 * separately to avoid doing two lookups for a rate for each frame.
855 */ 859 */
856 if (!ath9k_cmn_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error, sc->rx.rxfilter)) { 860 if (!ath9k_cmn_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error, sc->rx.rxfilter))
857 ret = -EINVAL; 861 return -EINVAL;
858 goto exit;
859 }
860 862
861 if (ath_is_mybeacon(common, hdr)) { 863 if (ath_is_mybeacon(common, hdr)) {
862 RX_STAT_INC(rx_beacons); 864 RX_STAT_INC(rx_beacons);
@@ -866,22 +868,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
866 /* 868 /*
867 * This shouldn't happen, but have a safety check anyway. 869 * This shouldn't happen, but have a safety check anyway.
868 */ 870 */
869 if (WARN_ON(!ah->curchan)) { 871 if (WARN_ON(!ah->curchan))
870 ret = -EINVAL; 872 return -EINVAL;
871 goto exit;
872 }
873 873
874 if (ath9k_cmn_process_rate(common, hw, rx_stats, rx_status)) { 874 if (ath9k_cmn_process_rate(common, hw, rx_stats, rx_status))
875 /* 875 return -EINVAL;
876 * No valid hardware bitrate found -- we should not get here
877 * because hardware has already validated this frame as OK.
878 */
879 ath_dbg(common, ANY, "unsupported hw bitrate detected 0x%02x using 1 Mbit\n",
880 rx_stats->rs_rate);
881 RX_STAT_INC(rx_rate_err);
882 ret =-EINVAL;
883 goto exit;
884 }
885 876
886 ath9k_cmn_process_rssi(common, hw, rx_stats, rx_status); 877 ath9k_cmn_process_rssi(common, hw, rx_stats, rx_status);
887 878
@@ -896,9 +887,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
896 sc->rx.num_pkts++; 887 sc->rx.num_pkts++;
897#endif 888#endif
898 889
899exit: 890 return 0;
900 sc->rx.discard_next = false; 891
901 return ret; 892corrupt:
893 sc->rx.discard_next = rx_stats->rs_more;
894 return -EINVAL;
902} 895}
903 896
904/* 897/*
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index a6507046dfe8..312314ce7642 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 631d5dc5b6d5..49d4196ef9d2 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -485,7 +485,6 @@ struct brcmf_sdio {
485 485
486 u8 tx_hdrlen; /* sdio bus header length for tx packet */ 486 u8 tx_hdrlen; /* sdio bus header length for tx packet */
487 bool txglom; /* host tx glomming enable flag */ 487 bool txglom; /* host tx glomming enable flag */
488 struct sk_buff *txglom_sgpad; /* scatter-gather padding buffer */
489 u16 head_align; /* buffer pointer alignment */ 488 u16 head_align; /* buffer pointer alignment */
490 u16 sgentry_align; /* scatter-gather buffer alignment */ 489 u16 sgentry_align; /* scatter-gather buffer alignment */
491}; 490};
@@ -2101,9 +2100,8 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
2101 if (lastfrm && chain_pad) 2100 if (lastfrm && chain_pad)
2102 tail_pad += blksize - chain_pad; 2101 tail_pad += blksize - chain_pad;
2103 if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) { 2102 if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) {
2104 pkt_pad = bus->txglom_sgpad; 2103 pkt_pad = brcmu_pkt_buf_get_skb(tail_pad + tail_chop +
2105 if (pkt_pad == NULL) 2104 bus->head_align);
2106 brcmu_pkt_buf_get_skb(tail_pad + tail_chop);
2107 if (pkt_pad == NULL) 2105 if (pkt_pad == NULL)
2108 return -ENOMEM; 2106 return -ENOMEM;
2109 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad); 2107 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad);
@@ -2114,6 +2112,7 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
2114 tail_chop); 2112 tail_chop);
2115 *(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop; 2113 *(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop;
2116 skb_trim(pkt, pkt->len - tail_chop); 2114 skb_trim(pkt, pkt->len - tail_chop);
2115 skb_trim(pkt_pad, tail_pad + tail_chop);
2117 __skb_queue_after(pktq, pkt, pkt_pad); 2116 __skb_queue_after(pktq, pkt, pkt_pad);
2118 } else { 2117 } else {
2119 ntail = pkt->data_len + tail_pad - 2118 ntail = pkt->data_len + tail_pad -
@@ -2168,7 +2167,7 @@ brcmf_sdio_txpkt_prep(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
2168 return ret; 2167 return ret;
2169 head_pad = (u16)ret; 2168 head_pad = (u16)ret;
2170 if (head_pad) 2169 if (head_pad)
2171 memset(pkt_next->data, 0, head_pad + bus->tx_hdrlen); 2170 memset(pkt_next->data + bus->tx_hdrlen, 0, head_pad);
2172 2171
2173 total_len += pkt_next->len; 2172 total_len += pkt_next->len;
2174 2173
@@ -3527,10 +3526,6 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
3527 bus->txglom = false; 3526 bus->txglom = false;
3528 value = 1; 3527 value = 1;
3529 pad_size = bus->sdiodev->func[2]->cur_blksize << 1; 3528 pad_size = bus->sdiodev->func[2]->cur_blksize << 1;
3530 bus->txglom_sgpad = brcmu_pkt_buf_get_skb(pad_size);
3531 if (!bus->txglom_sgpad)
3532 brcmf_err("allocating txglom padding skb failed, reduced performance\n");
3533
3534 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom", 3529 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
3535 &value, sizeof(u32)); 3530 &value, sizeof(u32));
3536 if (err < 0) { 3531 if (err < 0) {
@@ -4253,7 +4248,6 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
4253 brcmf_chip_detach(bus->ci); 4248 brcmf_chip_detach(bus->ci);
4254 } 4249 }
4255 4250
4256 brcmu_pkt_buf_free_skb(bus->txglom_sgpad);
4257 kfree(bus->rxbuf); 4251 kfree(bus->rxbuf);
4258 kfree(bus->hdrbuf); 4252 kfree(bus->hdrbuf);
4259 kfree(bus); 4253 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 ebea5f2e2741..ad0315abf765 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -151,7 +151,7 @@ enum iwl_power_scheme {
151 IWL_POWER_SCHEME_LP 151 IWL_POWER_SCHEME_LP
152}; 152};
153 153
154#define IWL_CONN_MAX_LISTEN_INTERVAL 70 154#define IWL_CONN_MAX_LISTEN_INTERVAL 10
155#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ 155#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\
156 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\ 156 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\
157 IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\ 157 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 74d60bf27750..98096fa364cd 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -845,16 +845,12 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
845 struct iwl_mvm_ba_notif *ba_notif = (void *)pkt->data; 845 struct iwl_mvm_ba_notif *ba_notif = (void *)pkt->data;
846 struct sk_buff_head reclaimed_skbs; 846 struct sk_buff_head reclaimed_skbs;
847 struct iwl_mvm_tid_data *tid_data; 847 struct iwl_mvm_tid_data *tid_data;
848 struct ieee80211_tx_info *info;
849 struct ieee80211_sta *sta; 848 struct ieee80211_sta *sta;
850 struct iwl_mvm_sta *mvmsta; 849 struct iwl_mvm_sta *mvmsta;
851 struct ieee80211_hdr *hdr;
852 struct sk_buff *skb; 850 struct sk_buff *skb;
853 int sta_id, tid, freed; 851 int sta_id, tid, freed;
854
855 /* "flow" corresponds to Tx queue */ 852 /* "flow" corresponds to Tx queue */
856 u16 scd_flow = le16_to_cpu(ba_notif->scd_flow); 853 u16 scd_flow = le16_to_cpu(ba_notif->scd_flow);
857
858 /* "ssn" is start of block-ack Tx window, corresponds to index 854 /* "ssn" is start of block-ack Tx window, corresponds to index
859 * (in Tx queue's circular buffer) of first TFD/frame in window */ 855 * (in Tx queue's circular buffer) of first TFD/frame in window */
860 u16 ba_resp_scd_ssn = le16_to_cpu(ba_notif->scd_ssn); 856 u16 ba_resp_scd_ssn = le16_to_cpu(ba_notif->scd_ssn);
@@ -911,22 +907,26 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
911 freed = 0; 907 freed = 0;
912 908
913 skb_queue_walk(&reclaimed_skbs, skb) { 909 skb_queue_walk(&reclaimed_skbs, skb) {
914 hdr = (struct ieee80211_hdr *)skb->data; 910 struct ieee80211_hdr *hdr = (void *)skb->data;
911 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
915 912
916 if (ieee80211_is_data_qos(hdr->frame_control)) 913 if (ieee80211_is_data_qos(hdr->frame_control))
917 freed++; 914 freed++;
918 else 915 else
919 WARN_ON_ONCE(1); 916 WARN_ON_ONCE(1);
920 917
921 info = IEEE80211_SKB_CB(skb);
922 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); 918 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]);
923 919
920 memset(&info->status, 0, sizeof(info->status));
921 /* Packet was transmitted successfully, failures come as single
922 * frames because before failing a frame the firmware transmits
923 * it without aggregation at least once.
924 */
925 info->flags |= IEEE80211_TX_STAT_ACK;
926
924 if (freed == 1) { 927 if (freed == 1) {
925 /* this is the first skb we deliver in this batch */ 928 /* this is the first skb we deliver in this batch */
926 /* put the rate scaling data there */ 929 /* put the rate scaling data there */
927 info = IEEE80211_SKB_CB(skb);
928 memset(&info->status, 0, sizeof(info->status));
929 info->flags |= IEEE80211_TX_STAT_ACK;
930 info->flags |= IEEE80211_TX_STAT_AMPDU; 930 info->flags |= IEEE80211_TX_STAT_AMPDU;
931 info->status.ampdu_ack_len = ba_notif->txed_2_done; 931 info->status.ampdu_ack_len = ba_notif->txed_2_done;
932 info->status.ampdu_len = ba_notif->txed; 932 info->status.ampdu_len = ba_notif->txed;
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 2d72a6b4b93e..54e344aed6e0 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 d11d4acf0890..31d8a9df1331 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1217,6 +1217,12 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
1217 rd_index = card->rxbd_rdptr & reg->rx_mask; 1217 rd_index = card->rxbd_rdptr & reg->rx_mask;
1218 skb_data = card->rx_buf_list[rd_index]; 1218 skb_data = card->rx_buf_list[rd_index];
1219 1219
1220 /* If skb allocation was failed earlier for Rx packet,
1221 * rx_buf_list[rd_index] would have been left with a NULL.
1222 */
1223 if (!skb_data)
1224 return -ENOMEM;
1225
1220 mwifiex_unmap_pci_memory(adapter, skb_data, PCI_DMA_FROMDEVICE); 1226 mwifiex_unmap_pci_memory(adapter, skb_data, PCI_DMA_FROMDEVICE);
1221 card->rx_buf_list[rd_index] = NULL; 1227 card->rx_buf_list[rd_index] = NULL;
1222 1228
@@ -1529,6 +1535,14 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
1529 if (adapter->ps_state == PS_STATE_SLEEP_CFM) { 1535 if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
1530 mwifiex_process_sleep_confirm_resp(adapter, skb->data, 1536 mwifiex_process_sleep_confirm_resp(adapter, skb->data,
1531 skb->len); 1537 skb->len);
1538 mwifiex_pcie_enable_host_int(adapter);
1539 if (mwifiex_write_reg(adapter,
1540 PCIE_CPU_INT_EVENT,
1541 CPU_INTR_SLEEP_CFM_DONE)) {
1542 dev_warn(adapter->dev,
1543 "Write register failed\n");
1544 return -1;
1545 }
1532 while (reg->sleep_cookie && (count++ < 10) && 1546 while (reg->sleep_cookie && (count++ < 10) &&
1533 mwifiex_pcie_ok_to_access_hw(adapter)) 1547 mwifiex_pcie_ok_to_access_hw(adapter))
1534 usleep_range(50, 60); 1548 usleep_range(50, 60);
@@ -1975,23 +1989,9 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
1975 adapter->int_status |= pcie_ireg; 1989 adapter->int_status |= pcie_ireg;
1976 spin_unlock_irqrestore(&adapter->int_lock, flags); 1990 spin_unlock_irqrestore(&adapter->int_lock, flags);
1977 1991
1978 if (pcie_ireg & HOST_INTR_CMD_DONE) { 1992 if (!adapter->pps_uapsd_mode &&
1979 if ((adapter->ps_state == PS_STATE_SLEEP_CFM) || 1993 adapter->ps_state == PS_STATE_SLEEP &&
1980 (adapter->ps_state == PS_STATE_SLEEP)) { 1994 mwifiex_pcie_ok_to_access_hw(adapter)) {
1981 mwifiex_pcie_enable_host_int(adapter);
1982 if (mwifiex_write_reg(adapter,
1983 PCIE_CPU_INT_EVENT,
1984 CPU_INTR_SLEEP_CFM_DONE)
1985 ) {
1986 dev_warn(adapter->dev,
1987 "Write register failed\n");
1988 return;
1989
1990 }
1991 }
1992 } else if (!adapter->pps_uapsd_mode &&
1993 adapter->ps_state == PS_STATE_SLEEP &&
1994 mwifiex_pcie_ok_to_access_hw(adapter)) {
1995 /* Potentially for PCIe we could get other 1995 /* Potentially for PCIe we could get other
1996 * interrupts like shared. Don't change power 1996 * interrupts like shared. Don't change power
1997 * state until cookie is set */ 1997 * 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 e0ba0115e5ae..1c5f2b66f057 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -554,7 +554,8 @@ mwifiex_clean_txrx(struct mwifiex_private *priv)
554 mwifiex_wmm_delete_all_ralist(priv); 554 mwifiex_wmm_delete_all_ralist(priv);
555 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid)); 555 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid));
556 556
557 if (priv->adapter->if_ops.clean_pcie_ring) 557 if (priv->adapter->if_ops.clean_pcie_ring &&
558 !priv->adapter->surprise_removed)
558 priv->adapter->if_ops.clean_pcie_ring(priv->adapter); 559 priv->adapter->if_ops.clean_pcie_ring(priv->adapter);
559 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); 560 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
560 561
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 2b62d799bfd8..a38f03ded5a4 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);