aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-07-31 07:59:42 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-07-31 08:16:47 -0400
commite6db06a53b1dcf4e9da4aba143e2eb4d63418abb (patch)
tree10adcecb71c95ce4393c39fa7911d091bcadfe09 /drivers/net
parentecc2edd56c49fa31a0a9ed15a7bf810ae79d3b85 (diff)
parentc56f5c0342dfee11a1a13d2f5bb7618de5b17590 (diff)
Merge with upstream to accommodate with thermal changes
This merge is performed to take commit c56f5c0342dfee11a1 ("Thermal: Make Thermal trip points writeable") out of Linus' tree and then fixup power supply class. This is needed since thermal stuff added a new argument: CC drivers/power/power_supply_core.o drivers/power/power_supply_core.c: In function ‘psy_register_thermal’: drivers/power/power_supply_core.c:204:6: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default] include/linux/thermal.h:154:29: note: expected ‘int’ but argument is of type ‘struct power_supply *’ drivers/power/power_supply_core.c:204:6: error: too few arguments to function ‘thermal_zone_device_register’ include/linux/thermal.h:154:29: note: declared here make[1]: *** [drivers/power/power_supply_core.o] Error 1 make: *** [drivers/power/] Error 2 Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_debugfs.c2
-rw-r--r--drivers/net/bonding/bond_main.c9
-rw-r--r--drivers/net/bonding/bond_procfs.c15
-rw-r--r--drivers/net/caif/caif_hsi.c5
-rw-r--r--drivers/net/can/c_can/c_can.c4
-rw-r--r--drivers/net/can/flexcan.c4
-rw-r--r--drivers/net/ethernet/atheros/atl1c/atl1c_main.c1
-rw-r--r--drivers/net/ethernet/broadcom/b44.c4
-rw-r--r--drivers/net/ethernet/broadcom/bnx2.c6
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c8
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c54
-rw-r--r--drivers/net/ethernet/broadcom/cnic.c10
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.c12
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.h2
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c2
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c17
-rw-r--r--drivers/net/ethernet/intel/Kconfig10
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.c3
-rw-r--r--drivers/net/ethernet/intel/e1000e/defines.h1
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c42
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c75
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c2
-rw-r--r--drivers/net/ethernet/intel/igbvf/ethtool.c29
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c21
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c13
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c15
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c18
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h1
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c2
-rw-r--r--drivers/net/ethernet/realtek/r8169.c1
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c12
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/ring_mode.c3
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c3
-rw-r--r--drivers/net/ethernet/ti/davinci_cpdma.c1
-rw-r--r--drivers/net/phy/mdio-mux.c10
-rw-r--r--drivers/net/phy/micrel.c8
-rw-r--r--drivers/net/usb/ipheth.c5
-rw-r--r--drivers/net/usb/qmi_wwan.c105
-rw-r--r--drivers/net/usb/usbnet.c53
-rw-r--r--drivers/net/wireless/airo.c4
-rw-r--r--drivers/net/wireless/ath/ath.h1
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c27
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c31
-rw-r--r--drivers/net/wireless/ath/key.c4
-rw-r--r--drivers/net/wireless/b43/main.c2
-rw-r--r--drivers/net/wireless/b43legacy/dma.c2
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c4
-rw-r--r--drivers/net/wireless/iwlegacy/common.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c12
-rw-r--r--drivers/net/wireless/mwifiex/11n_rxreorder.c5
-rw-r--r--drivers/net/wireless/mwifiex/11n_rxreorder.h7
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c26
-rw-r--r--drivers/net/wireless/mwifiex/ie.c1
-rw-r--r--drivers/net/wireless/mwifiex/sdio.c6
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c9
-rw-r--r--drivers/net/wireless/mwifiex/txrx.c10
-rw-r--r--drivers/net/wireless/mwifiex/uap_cmd.c11
-rw-r--r--drivers/net/wireless/mwifiex/usb.c28
-rw-r--r--drivers/net/wireless/mwifiex/wmm.c3
-rw-r--r--drivers/net/wireless/rndis_wlan.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c3
-rw-r--r--drivers/net/wireless/ti/wl1251/acx.c2
-rw-r--r--drivers/net/wireless/ti/wl1251/event.c3
-rw-r--r--drivers/net/wireless/ti/wl1251/spi.c4
-rw-r--r--drivers/net/wireless/ti/wlcore/Kconfig1
-rw-r--r--drivers/net/xen-netfront.c8
77 files changed, 505 insertions, 364 deletions
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c
index 3680aa251dea..2cf084eb9d52 100644
--- a/drivers/net/bonding/bond_debugfs.c
+++ b/drivers/net/bonding/bond_debugfs.c
@@ -6,7 +6,7 @@
6#include "bonding.h" 6#include "bonding.h"
7#include "bond_alb.h" 7#include "bond_alb.h"
8 8
9#ifdef CONFIG_DEBUG_FS 9#if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS)
10 10
11#include <linux/debugfs.h> 11#include <linux/debugfs.h>
12#include <linux/seq_file.h> 12#include <linux/seq_file.h>
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b9c2ae62166d..2ee76993f052 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3227,6 +3227,12 @@ static int bond_master_netdev_event(unsigned long event,
3227 switch (event) { 3227 switch (event) {
3228 case NETDEV_CHANGENAME: 3228 case NETDEV_CHANGENAME:
3229 return bond_event_changename(event_bond); 3229 return bond_event_changename(event_bond);
3230 case NETDEV_UNREGISTER:
3231 bond_remove_proc_entry(event_bond);
3232 break;
3233 case NETDEV_REGISTER:
3234 bond_create_proc_entry(event_bond);
3235 break;
3230 default: 3236 default:
3231 break; 3237 break;
3232 } 3238 }
@@ -4411,8 +4417,6 @@ static void bond_uninit(struct net_device *bond_dev)
4411 4417
4412 bond_work_cancel_all(bond); 4418 bond_work_cancel_all(bond);
4413 4419
4414 bond_remove_proc_entry(bond);
4415
4416 bond_debug_unregister(bond); 4420 bond_debug_unregister(bond);
4417 4421
4418 __hw_addr_flush(&bond->mc_list); 4422 __hw_addr_flush(&bond->mc_list);
@@ -4814,7 +4818,6 @@ static int bond_init(struct net_device *bond_dev)
4814 4818
4815 bond_set_lockdep_class(bond_dev); 4819 bond_set_lockdep_class(bond_dev);
4816 4820
4817 bond_create_proc_entry(bond);
4818 list_add_tail(&bond->bond_list, &bn->dev_list); 4821 list_add_tail(&bond->bond_list, &bn->dev_list);
4819 4822
4820 bond_prepare_sysfs_group(bond); 4823 bond_prepare_sysfs_group(bond);
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index ad284baafe87..3cea38d37344 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -150,14 +150,25 @@ static void bond_info_show_master(struct seq_file *seq)
150 } 150 }
151} 151}
152 152
153static const char *bond_slave_link_status(s8 link)
154{
155 static const char * const status[] = {
156 [BOND_LINK_UP] = "up",
157 [BOND_LINK_FAIL] = "going down",
158 [BOND_LINK_DOWN] = "down",
159 [BOND_LINK_BACK] = "going back",
160 };
161
162 return status[link];
163}
164
153static void bond_info_show_slave(struct seq_file *seq, 165static void bond_info_show_slave(struct seq_file *seq,
154 const struct slave *slave) 166 const struct slave *slave)
155{ 167{
156 struct bonding *bond = seq->private; 168 struct bonding *bond = seq->private;
157 169
158 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); 170 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
159 seq_printf(seq, "MII Status: %s\n", 171 seq_printf(seq, "MII Status: %s\n", bond_slave_link_status(slave->link));
160 (slave->link == BOND_LINK_UP) ? "up" : "down");
161 if (slave->speed == SPEED_UNKNOWN) 172 if (slave->speed == SPEED_UNKNOWN)
162 seq_printf(seq, "Speed: %s\n", "Unknown"); 173 seq_printf(seq, "Speed: %s\n", "Unknown");
163 else 174 else
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 1520814c77c7..4a27adb7ae67 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -693,8 +693,6 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
693 */ 693 */
694 memcpy(rx_buf, (u8 *)piggy_desc, 694 memcpy(rx_buf, (u8 *)piggy_desc,
695 CFHSI_DESC_SHORT_SZ); 695 CFHSI_DESC_SHORT_SZ);
696 /* Mark no embedded frame here */
697 piggy_desc->offset = 0;
698 if (desc_pld_len == -EPROTO) 696 if (desc_pld_len == -EPROTO)
699 goto out_of_sync; 697 goto out_of_sync;
700 } 698 }
@@ -737,6 +735,8 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
737 /* Extract any payload in piggyback descriptor. */ 735 /* Extract any payload in piggyback descriptor. */
738 if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0) 736 if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0)
739 goto out_of_sync; 737 goto out_of_sync;
738 /* Mark no embedded frame after extracting it */
739 piggy_desc->offset = 0;
740 } 740 }
741 } 741 }
742 742
@@ -1178,6 +1178,7 @@ int cfhsi_probe(struct platform_device *pdev)
1178 dev_err(&ndev->dev, "%s: Registration error: %d.\n", 1178 dev_err(&ndev->dev, "%s: Registration error: %d.\n",
1179 __func__, res); 1179 __func__, res);
1180 free_netdev(ndev); 1180 free_netdev(ndev);
1181 return -ENODEV;
1181 } 1182 }
1182 /* Add CAIF HSI device to list. */ 1183 /* Add CAIF HSI device to list. */
1183 spin_lock(&cfhsi_list_lock); 1184 spin_lock(&cfhsi_list_lock);
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 8dc84d66eea1..86cd532c78f9 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -590,8 +590,8 @@ static void c_can_chip_config(struct net_device *dev)
590 priv->write_reg(priv, &priv->regs->control, 590 priv->write_reg(priv, &priv->regs->control,
591 CONTROL_ENABLE_AR); 591 CONTROL_ENABLE_AR);
592 592
593 if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY & 593 if ((priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) &&
594 CAN_CTRLMODE_LOOPBACK)) { 594 (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)) {
595 /* loopback + silent mode : useful for hot self-test */ 595 /* loopback + silent mode : useful for hot self-test */
596 priv->write_reg(priv, &priv->regs->control, CONTROL_EIE | 596 priv->write_reg(priv, &priv->regs->control, CONTROL_EIE |
597 CONTROL_SIE | CONTROL_IE | CONTROL_TEST); 597 CONTROL_SIE | CONTROL_IE | CONTROL_TEST);
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 38c0690df5c8..81d474102378 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -939,12 +939,12 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
939 return PTR_ERR(pinctrl); 939 return PTR_ERR(pinctrl);
940 940
941 if (pdev->dev.of_node) { 941 if (pdev->dev.of_node) {
942 const u32 *clock_freq_p; 942 const __be32 *clock_freq_p;
943 943
944 clock_freq_p = of_get_property(pdev->dev.of_node, 944 clock_freq_p = of_get_property(pdev->dev.of_node,
945 "clock-frequency", NULL); 945 "clock-frequency", NULL);
946 if (clock_freq_p) 946 if (clock_freq_p)
947 clock_freq = *clock_freq_p; 947 clock_freq = be32_to_cpup(clock_freq_p);
948 } 948 }
949 949
950 if (!clock_freq) { 950 if (!clock_freq) {
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 9cc15701101b..1f78b63d5efe 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -261,7 +261,6 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter)
261 if ((phy_data & BMSR_LSTATUS) == 0) { 261 if ((phy_data & BMSR_LSTATUS) == 0) {
262 /* link down */ 262 /* link down */
263 netif_carrier_off(netdev); 263 netif_carrier_off(netdev);
264 netif_stop_queue(netdev);
265 hw->hibernate = true; 264 hw->hibernate = true;
266 if (atl1c_reset_mac(hw) != 0) 265 if (atl1c_reset_mac(hw) != 0)
267 if (netif_msg_hw(adapter)) 266 if (netif_msg_hw(adapter))
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 46b8b7d81633..d09c6b583d17 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -656,7 +656,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
656 dma_unmap_single(bp->sdev->dma_dev, mapping, 656 dma_unmap_single(bp->sdev->dma_dev, mapping,
657 RX_PKT_BUF_SZ, DMA_FROM_DEVICE); 657 RX_PKT_BUF_SZ, DMA_FROM_DEVICE);
658 dev_kfree_skb_any(skb); 658 dev_kfree_skb_any(skb);
659 skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA); 659 skb = alloc_skb(RX_PKT_BUF_SZ, GFP_ATOMIC | GFP_DMA);
660 if (skb == NULL) 660 if (skb == NULL)
661 return -ENOMEM; 661 return -ENOMEM;
662 mapping = dma_map_single(bp->sdev->dma_dev, skb->data, 662 mapping = dma_map_single(bp->sdev->dma_dev, skb->data,
@@ -967,7 +967,7 @@ static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
967 dma_unmap_single(bp->sdev->dma_dev, mapping, len, 967 dma_unmap_single(bp->sdev->dma_dev, mapping, len,
968 DMA_TO_DEVICE); 968 DMA_TO_DEVICE);
969 969
970 bounce_skb = __netdev_alloc_skb(dev, len, GFP_ATOMIC | GFP_DMA); 970 bounce_skb = alloc_skb(len, GFP_ATOMIC | GFP_DMA);
971 if (!bounce_skb) 971 if (!bounce_skb)
972 goto err_out; 972 goto err_out;
973 973
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index ac7b74488531..1fa4927a45b1 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -5372,7 +5372,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
5372 int k, last; 5372 int k, last;
5373 5373
5374 if (skb == NULL) { 5374 if (skb == NULL) {
5375 j++; 5375 j = NEXT_TX_BD(j);
5376 continue; 5376 continue;
5377 } 5377 }
5378 5378
@@ -5384,8 +5384,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
5384 tx_buf->skb = NULL; 5384 tx_buf->skb = NULL;
5385 5385
5386 last = tx_buf->nr_frags; 5386 last = tx_buf->nr_frags;
5387 j++; 5387 j = NEXT_TX_BD(j);
5388 for (k = 0; k < last; k++, j++) { 5388 for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {
5389 tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; 5389 tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
5390 dma_unmap_page(&bp->pdev->dev, 5390 dma_unmap_page(&bp->pdev->dev,
5391 dma_unmap_addr(tx_buf, mapping), 5391 dma_unmap_addr(tx_buf, mapping),
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index cbc56f274e0c..8098eea9704d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -190,7 +190,7 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
190 190
191 if ((netif_tx_queue_stopped(txq)) && 191 if ((netif_tx_queue_stopped(txq)) &&
192 (bp->state == BNX2X_STATE_OPEN) && 192 (bp->state == BNX2X_STATE_OPEN) &&
193 (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3)) 193 (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4))
194 netif_tx_wake_queue(txq); 194 netif_tx_wake_queue(txq);
195 195
196 __netif_tx_unlock(txq); 196 __netif_tx_unlock(txq);
@@ -2516,8 +2516,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget)
2516/* we split the first BD into headers and data BDs 2516/* we split the first BD into headers and data BDs
2517 * to ease the pain of our fellow microcode engineers 2517 * to ease the pain of our fellow microcode engineers
2518 * we use one mapping for both BDs 2518 * we use one mapping for both BDs
2519 * So far this has only been observed to happen
2520 * in Other Operating Systems(TM)
2521 */ 2519 */
2522static noinline u16 bnx2x_tx_split(struct bnx2x *bp, 2520static noinline u16 bnx2x_tx_split(struct bnx2x *bp,
2523 struct bnx2x_fp_txdata *txdata, 2521 struct bnx2x_fp_txdata *txdata,
@@ -3171,7 +3169,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3171 3169
3172 txdata->tx_bd_prod += nbd; 3170 txdata->tx_bd_prod += nbd;
3173 3171
3174 if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 3)) { 3172 if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 4)) {
3175 netif_tx_stop_queue(txq); 3173 netif_tx_stop_queue(txq);
3176 3174
3177 /* paired memory barrier is in bnx2x_tx_int(), we have to keep 3175 /* paired memory barrier is in bnx2x_tx_int(), we have to keep
@@ -3180,7 +3178,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3180 smp_mb(); 3178 smp_mb();
3181 3179
3182 fp->eth_q_stats.driver_xoff++; 3180 fp->eth_q_stats.driver_xoff++;
3183 if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3) 3181 if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4)
3184 netif_tx_wake_queue(txq); 3182 netif_tx_wake_queue(txq);
3185 } 3183 }
3186 txdata->tx_pkt++; 3184 txdata->tx_pkt++;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index a3fb7215cd89..6e7d5c0843b4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -40,6 +40,7 @@
40#define I2C_BSC0 0 40#define I2C_BSC0 0
41#define I2C_BSC1 1 41#define I2C_BSC1 1
42#define I2C_WA_RETRY_CNT 3 42#define I2C_WA_RETRY_CNT 3
43#define I2C_WA_PWR_ITER (I2C_WA_RETRY_CNT - 1)
43#define MCPR_IMC_COMMAND_READ_OP 1 44#define MCPR_IMC_COMMAND_READ_OP 1
44#define MCPR_IMC_COMMAND_WRITE_OP 2 45#define MCPR_IMC_COMMAND_WRITE_OP 2
45 46
@@ -7659,6 +7660,28 @@ static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7659 return -EINVAL; 7660 return -EINVAL;
7660} 7661}
7661 7662
7663static void bnx2x_warpcore_power_module(struct link_params *params,
7664 struct bnx2x_phy *phy,
7665 u8 power)
7666{
7667 u32 pin_cfg;
7668 struct bnx2x *bp = params->bp;
7669
7670 pin_cfg = (REG_RD(bp, params->shmem_base +
7671 offsetof(struct shmem_region,
7672 dev_info.port_hw_config[params->port].e3_sfp_ctrl)) &
7673 PORT_HW_CFG_E3_PWR_DIS_MASK) >>
7674 PORT_HW_CFG_E3_PWR_DIS_SHIFT;
7675
7676 if (pin_cfg == PIN_CFG_NA)
7677 return;
7678 DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n",
7679 power, pin_cfg);
7680 /* Low ==> corresponding SFP+ module is powered
7681 * high ==> the SFP+ module is powered down
7682 */
7683 bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1);
7684}
7662static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, 7685static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7663 struct link_params *params, 7686 struct link_params *params,
7664 u16 addr, u8 byte_cnt, 7687 u16 addr, u8 byte_cnt,
@@ -7678,6 +7701,12 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7678 /* 4 byte aligned address */ 7701 /* 4 byte aligned address */
7679 addr32 = addr & (~0x3); 7702 addr32 = addr & (~0x3);
7680 do { 7703 do {
7704 if (cnt == I2C_WA_PWR_ITER) {
7705 bnx2x_warpcore_power_module(params, phy, 0);
7706 /* Note that 100us are not enough here */
7707 usleep_range(1000,1000);
7708 bnx2x_warpcore_power_module(params, phy, 1);
7709 }
7681 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt, 7710 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
7682 data_array); 7711 data_array);
7683 } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT)); 7712 } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT));
@@ -8200,29 +8229,6 @@ static void bnx2x_set_sfp_module_fault_led(struct link_params *params,
8200 bnx2x_set_e1e2_module_fault_led(params, gpio_mode); 8229 bnx2x_set_e1e2_module_fault_led(params, gpio_mode);
8201} 8230}
8202 8231
8203static void bnx2x_warpcore_power_module(struct link_params *params,
8204 struct bnx2x_phy *phy,
8205 u8 power)
8206{
8207 u32 pin_cfg;
8208 struct bnx2x *bp = params->bp;
8209
8210 pin_cfg = (REG_RD(bp, params->shmem_base +
8211 offsetof(struct shmem_region,
8212 dev_info.port_hw_config[params->port].e3_sfp_ctrl)) &
8213 PORT_HW_CFG_E3_PWR_DIS_MASK) >>
8214 PORT_HW_CFG_E3_PWR_DIS_SHIFT;
8215
8216 if (pin_cfg == PIN_CFG_NA)
8217 return;
8218 DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n",
8219 power, pin_cfg);
8220 /* Low ==> corresponding SFP+ module is powered
8221 * high ==> the SFP+ module is powered down
8222 */
8223 bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1);
8224}
8225
8226static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy, 8232static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy,
8227 struct link_params *params) 8233 struct link_params *params)
8228{ 8234{
@@ -9748,7 +9754,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
9748 9754
9749 msleep(1); 9755 msleep(1);
9750 9756
9751 if (!(CHIP_IS_E1(bp))) 9757 if (!(CHIP_IS_E1x(bp)))
9752 port = BP_PATH(bp); 9758 port = BP_PATH(bp);
9753 else 9759 else
9754 port = params->port; 9760 port = params->port;
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index c95e7b5e2b85..2c89d17cbb29 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -534,7 +534,8 @@ int cnic_unregister_driver(int ulp_type)
534 } 534 }
535 535
536 if (atomic_read(&ulp_ops->ref_count) != 0) 536 if (atomic_read(&ulp_ops->ref_count) != 0)
537 netdev_warn(dev->netdev, "Failed waiting for ref count to go to zero\n"); 537 pr_warn("%s: Failed waiting for ref count to go to zero\n",
538 __func__);
538 return 0; 539 return 0;
539 540
540out_unlock: 541out_unlock:
@@ -1053,12 +1054,13 @@ static int cnic_init_uio(struct cnic_dev *dev)
1053 1054
1054 uinfo = &udev->cnic_uinfo; 1055 uinfo = &udev->cnic_uinfo;
1055 1056
1056 uinfo->mem[0].addr = dev->netdev->base_addr; 1057 uinfo->mem[0].addr = pci_resource_start(dev->pcidev, 0);
1057 uinfo->mem[0].internal_addr = dev->regview; 1058 uinfo->mem[0].internal_addr = dev->regview;
1058 uinfo->mem[0].size = dev->netdev->mem_end - dev->netdev->mem_start;
1059 uinfo->mem[0].memtype = UIO_MEM_PHYS; 1059 uinfo->mem[0].memtype = UIO_MEM_PHYS;
1060 1060
1061 if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) { 1061 if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
1062 uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID +
1063 TX_MAX_TSS_RINGS + 1);
1062 uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & 1064 uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen &
1063 PAGE_MASK; 1065 PAGE_MASK;
1064 if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) 1066 if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)
@@ -1068,6 +1070,8 @@ static int cnic_init_uio(struct cnic_dev *dev)
1068 1070
1069 uinfo->name = "bnx2_cnic"; 1071 uinfo->name = "bnx2_cnic";
1070 } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) { 1072 } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) {
1073 uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0);
1074
1071 uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & 1075 uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk &
1072 PAGE_MASK; 1076 PAGE_MASK;
1073 uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); 1077 uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk);
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 8d06ea381741..921c2082af4c 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -122,15 +122,15 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
122 goto done; 122 goto done;
123 123
124 if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) { 124 if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) {
125 dev_warn(&adapter->pdev->dev, "This domain(VM) is not " 125 dev_warn(&adapter->pdev->dev,
126 "permitted to execute this cmd (opcode %d)\n", 126 "opcode %d-%d is not permitted\n",
127 opcode); 127 opcode, subsystem);
128 } else { 128 } else {
129 extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) & 129 extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
130 CQE_STATUS_EXTD_MASK; 130 CQE_STATUS_EXTD_MASK;
131 dev_err(&adapter->pdev->dev, "Cmd (opcode %d) failed:" 131 dev_err(&adapter->pdev->dev,
132 "status %d, extd-status %d\n", 132 "opcode %d-%d failed:status %d-%d\n",
133 opcode, compl_status, extd_status); 133 opcode, subsystem, compl_status, extd_status);
134 } 134 }
135 } 135 }
136done: 136done:
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 9625bf420c16..b3f3fc3d1323 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1566,7 +1566,7 @@ struct be_hw_stats_v1 {
1566 u32 rsvd0[BE_TXP_SW_SZ]; 1566 u32 rsvd0[BE_TXP_SW_SZ];
1567 struct be_erx_stats_v1 erx; 1567 struct be_erx_stats_v1 erx;
1568 struct be_pmem_stats pmem; 1568 struct be_pmem_stats pmem;
1569 u32 rsvd1[3]; 1569 u32 rsvd1[18];
1570}; 1570};
1571 1571
1572struct be_cmd_req_get_stats_v1 { 1572struct be_cmd_req_get_stats_v1 {
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index fdb50cec6b51..501dfa9c88ec 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3237,7 +3237,7 @@ static void be_netdev_init(struct net_device *netdev)
3237 3237
3238 netdev->flags |= IFF_MULTICAST; 3238 netdev->flags |= IFF_MULTICAST;
3239 3239
3240 netif_set_gso_max_size(netdev, 65535); 3240 netif_set_gso_max_size(netdev, 65535 - ETH_HLEN);
3241 3241
3242 netdev->netdev_ops = &be_netdev_ops; 3242 netdev->netdev_ops = &be_netdev_ops;
3243 3243
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 0741aded9eb0..ab1d80ff0791 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1804,18 +1804,16 @@ void gfar_configure_coalescing(struct gfar_private *priv,
1804 if (priv->mode == MQ_MG_MODE) { 1804 if (priv->mode == MQ_MG_MODE) {
1805 baddr = &regs->txic0; 1805 baddr = &regs->txic0;
1806 for_each_set_bit(i, &tx_mask, priv->num_tx_queues) { 1806 for_each_set_bit(i, &tx_mask, priv->num_tx_queues) {
1807 if (likely(priv->tx_queue[i]->txcoalescing)) { 1807 gfar_write(baddr + i, 0);
1808 gfar_write(baddr + i, 0); 1808 if (likely(priv->tx_queue[i]->txcoalescing))
1809 gfar_write(baddr + i, priv->tx_queue[i]->txic); 1809 gfar_write(baddr + i, priv->tx_queue[i]->txic);
1810 }
1811 } 1810 }
1812 1811
1813 baddr = &regs->rxic0; 1812 baddr = &regs->rxic0;
1814 for_each_set_bit(i, &rx_mask, priv->num_rx_queues) { 1813 for_each_set_bit(i, &rx_mask, priv->num_rx_queues) {
1815 if (likely(priv->rx_queue[i]->rxcoalescing)) { 1814 gfar_write(baddr + i, 0);
1816 gfar_write(baddr + i, 0); 1815 if (likely(priv->rx_queue[i]->rxcoalescing))
1817 gfar_write(baddr + i, priv->rx_queue[i]->rxic); 1816 gfar_write(baddr + i, priv->rx_queue[i]->rxic);
1818 }
1819 } 1817 }
1820 } 1818 }
1821} 1819}
@@ -2065,10 +2063,9 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
2065 return NETDEV_TX_OK; 2063 return NETDEV_TX_OK;
2066 } 2064 }
2067 2065
2068 /* Steal sock reference for processing TX time stamps */ 2066 if (skb->sk)
2069 swap(skb_new->sk, skb->sk); 2067 skb_set_owner_w(skb_new, skb->sk);
2070 swap(skb_new->destructor, skb->destructor); 2068 consume_skb(skb);
2071 kfree_skb(skb);
2072 skb = skb_new; 2069 skb = skb_new;
2073 } 2070 }
2074 2071
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 79b07ec6726f..0cafe4fe9406 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -122,8 +122,10 @@ config IGB_DCA
122 122
123config IGB_PTP 123config IGB_PTP
124 bool "PTP Hardware Clock (PHC)" 124 bool "PTP Hardware Clock (PHC)"
125 default y 125 default n
126 depends on IGB && PTP_1588_CLOCK 126 depends on IGB && EXPERIMENTAL
127 select PPS
128 select PTP_1588_CLOCK
127 ---help--- 129 ---help---
128 Say Y here if you want to use PTP Hardware Clock (PHC) in the 130 Say Y here if you want to use PTP Hardware Clock (PHC) in the
129 driver. Only the basic clock operations have been implemented. 131 driver. Only the basic clock operations have been implemented.
@@ -223,7 +225,9 @@ config IXGBE_DCB
223config IXGBE_PTP 225config IXGBE_PTP
224 bool "PTP Clock Support" 226 bool "PTP Clock Support"
225 default n 227 default n
226 depends on IXGBE && PTP_1588_CLOCK 228 depends on IXGBE && EXPERIMENTAL
229 select PPS
230 select PTP_1588_CLOCK
227 ---help--- 231 ---help---
228 Say Y here if you want support for 1588 Timestamping with a 232 Say Y here if you want support for 1588 Timestamping with a
229 PHC device, using the PTP 1588 Clock support. This is 233 PHC device, using the PTP 1588 Clock support. This is
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 36db4df09aed..1f063dcd8f85 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1572,6 +1572,9 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
1572 ctrl = er32(CTRL); 1572 ctrl = er32(CTRL);
1573 status = er32(STATUS); 1573 status = er32(STATUS);
1574 rxcw = er32(RXCW); 1574 rxcw = er32(RXCW);
1575 /* SYNCH bit and IV bit are sticky */
1576 udelay(10);
1577 rxcw = er32(RXCW);
1575 1578
1576 if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { 1579 if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) {
1577 1580
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h
index 351a4097b2ba..76edbc1be33b 100644
--- a/drivers/net/ethernet/intel/e1000e/defines.h
+++ b/drivers/net/ethernet/intel/e1000e/defines.h
@@ -103,6 +103,7 @@
103#define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */ 103#define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */
104#define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */ 104#define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */
105#define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */ 105#define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */
106#define E1000_RXD_ERR_IPE 0x40 /* IP Checksum Error */
106#define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */ 107#define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */
107#define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ 108#define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */
108 109
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 238ab2f8a5e7..e3a7b07df629 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -325,24 +325,46 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
325 **/ 325 **/
326static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) 326static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)
327{ 327{
328 u16 phy_reg; 328 u16 phy_reg = 0;
329 u32 phy_id; 329 u32 phy_id = 0;
330 s32 ret_val;
331 u16 retry_count;
332
333 for (retry_count = 0; retry_count < 2; retry_count++) {
334 ret_val = e1e_rphy_locked(hw, PHY_ID1, &phy_reg);
335 if (ret_val || (phy_reg == 0xFFFF))
336 continue;
337 phy_id = (u32)(phy_reg << 16);
330 338
331 e1e_rphy_locked(hw, PHY_ID1, &phy_reg); 339 ret_val = e1e_rphy_locked(hw, PHY_ID2, &phy_reg);
332 phy_id = (u32)(phy_reg << 16); 340 if (ret_val || (phy_reg == 0xFFFF)) {
333 e1e_rphy_locked(hw, PHY_ID2, &phy_reg); 341 phy_id = 0;
334 phy_id |= (u32)(phy_reg & PHY_REVISION_MASK); 342 continue;
343 }
344 phy_id |= (u32)(phy_reg & PHY_REVISION_MASK);
345 break;
346 }
335 347
336 if (hw->phy.id) { 348 if (hw->phy.id) {
337 if (hw->phy.id == phy_id) 349 if (hw->phy.id == phy_id)
338 return true; 350 return true;
339 } else { 351 } else if (phy_id) {
340 if ((phy_id != 0) && (phy_id != PHY_REVISION_MASK)) 352 hw->phy.id = phy_id;
341 hw->phy.id = phy_id; 353 hw->phy.revision = (u32)(phy_reg & ~PHY_REVISION_MASK);
342 return true; 354 return true;
343 } 355 }
344 356
345 return false; 357 /*
358 * In case the PHY needs to be in mdio slow mode,
359 * set slow mode and try to get the PHY id again.
360 */
361 hw->phy.ops.release(hw);
362 ret_val = e1000_set_mdio_slow_mode_hv(hw);
363 if (!ret_val)
364 ret_val = e1000e_get_phy_id(hw);
365 hw->phy.ops.acquire(hw);
366
367 return !ret_val;
346} 368}
347 369
348/** 370/**
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 31d37a2b5ba8..623e30b9964d 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -496,7 +496,7 @@ static void e1000_receive_skb(struct e1000_adapter *adapter,
496 * @sk_buff: socket buffer with received data 496 * @sk_buff: socket buffer with received data
497 **/ 497 **/
498static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, 498static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
499 __le16 csum, struct sk_buff *skb) 499 struct sk_buff *skb)
500{ 500{
501 u16 status = (u16)status_err; 501 u16 status = (u16)status_err;
502 u8 errors = (u8)(status_err >> 24); 502 u8 errors = (u8)(status_err >> 24);
@@ -511,8 +511,8 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
511 if (status & E1000_RXD_STAT_IXSM) 511 if (status & E1000_RXD_STAT_IXSM)
512 return; 512 return;
513 513
514 /* TCP/UDP checksum error bit is set */ 514 /* TCP/UDP checksum error bit or IP checksum error bit is set */
515 if (errors & E1000_RXD_ERR_TCPE) { 515 if (errors & (E1000_RXD_ERR_TCPE | E1000_RXD_ERR_IPE)) {
516 /* let the stack verify checksum errors */ 516 /* let the stack verify checksum errors */
517 adapter->hw_csum_err++; 517 adapter->hw_csum_err++;
518 return; 518 return;
@@ -523,19 +523,7 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
523 return; 523 return;
524 524
525 /* It must be a TCP or UDP packet with a valid checksum */ 525 /* It must be a TCP or UDP packet with a valid checksum */
526 if (status & E1000_RXD_STAT_TCPCS) { 526 skb->ip_summed = CHECKSUM_UNNECESSARY;
527 /* TCP checksum is good */
528 skb->ip_summed = CHECKSUM_UNNECESSARY;
529 } else {
530 /*
531 * IP fragment with UDP payload
532 * Hardware complements the payload checksum, so we undo it
533 * and then put the value in host order for further stack use.
534 */
535 __sum16 sum = (__force __sum16)swab16((__force u16)csum);
536 skb->csum = csum_unfold(~sum);
537 skb->ip_summed = CHECKSUM_COMPLETE;
538 }
539 adapter->hw_csum_good++; 527 adapter->hw_csum_good++;
540} 528}
541 529
@@ -954,8 +942,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
954 skb_put(skb, length); 942 skb_put(skb, length);
955 943
956 /* Receive Checksum Offload */ 944 /* Receive Checksum Offload */
957 e1000_rx_checksum(adapter, staterr, 945 e1000_rx_checksum(adapter, staterr, skb);
958 rx_desc->wb.lower.hi_dword.csum_ip.csum, skb);
959 946
960 e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); 947 e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb);
961 948
@@ -1341,8 +1328,7 @@ copydone:
1341 total_rx_bytes += skb->len; 1328 total_rx_bytes += skb->len;
1342 total_rx_packets++; 1329 total_rx_packets++;
1343 1330
1344 e1000_rx_checksum(adapter, staterr, 1331 e1000_rx_checksum(adapter, staterr, skb);
1345 rx_desc->wb.lower.hi_dword.csum_ip.csum, skb);
1346 1332
1347 e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); 1333 e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb);
1348 1334
@@ -1512,9 +1498,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,
1512 } 1498 }
1513 } 1499 }
1514 1500
1515 /* Receive Checksum Offload XXX recompute due to CRC strip? */ 1501 /* Receive Checksum Offload */
1516 e1000_rx_checksum(adapter, staterr, 1502 e1000_rx_checksum(adapter, staterr, skb);
1517 rx_desc->wb.lower.hi_dword.csum_ip.csum, skb);
1518 1503
1519 e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb); 1504 e1000_rx_hash(netdev, rx_desc->wb.lower.hi_dword.rss, skb);
1520 1505
@@ -3098,19 +3083,10 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
3098 3083
3099 /* Enable Receive Checksum Offload for TCP and UDP */ 3084 /* Enable Receive Checksum Offload for TCP and UDP */
3100 rxcsum = er32(RXCSUM); 3085 rxcsum = er32(RXCSUM);
3101 if (adapter->netdev->features & NETIF_F_RXCSUM) { 3086 if (adapter->netdev->features & NETIF_F_RXCSUM)
3102 rxcsum |= E1000_RXCSUM_TUOFL; 3087 rxcsum |= E1000_RXCSUM_TUOFL;
3103 3088 else
3104 /*
3105 * IPv4 payload checksum for UDP fragments must be
3106 * used in conjunction with packet-split.
3107 */
3108 if (adapter->rx_ps_pages)
3109 rxcsum |= E1000_RXCSUM_IPPCSE;
3110 } else {
3111 rxcsum &= ~E1000_RXCSUM_TUOFL; 3089 rxcsum &= ~E1000_RXCSUM_TUOFL;
3112 /* no need to clear IPPCSE as it defaults to 0 */
3113 }
3114 ew32(RXCSUM, rxcsum); 3090 ew32(RXCSUM, rxcsum);
3115 3091
3116 if (adapter->hw.mac.type == e1000_pch2lan) { 3092 if (adapter->hw.mac.type == e1000_pch2lan) {
@@ -5241,22 +5217,10 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
5241 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; 5217 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
5242 5218
5243 /* Jumbo frame support */ 5219 /* Jumbo frame support */
5244 if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { 5220 if ((max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) &&
5245 if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { 5221 !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
5246 e_err("Jumbo Frames not supported.\n"); 5222 e_err("Jumbo Frames not supported.\n");
5247 return -EINVAL; 5223 return -EINVAL;
5248 }
5249
5250 /*
5251 * IP payload checksum (enabled with jumbos/packet-split when
5252 * Rx checksum is enabled) and generation of RSS hash is
5253 * mutually exclusive in the hardware.
5254 */
5255 if ((netdev->features & NETIF_F_RXCSUM) &&
5256 (netdev->features & NETIF_F_RXHASH)) {
5257 e_err("Jumbo frames cannot be enabled when both receive checksum offload and receive hashing are enabled. Disable one of the receive offload features before enabling jumbos.\n");
5258 return -EINVAL;
5259 }
5260 } 5224 }
5261 5225
5262 /* Supported frame sizes */ 5226 /* Supported frame sizes */
@@ -6030,17 +5994,6 @@ static int e1000_set_features(struct net_device *netdev,
6030 NETIF_F_RXALL))) 5994 NETIF_F_RXALL)))
6031 return 0; 5995 return 0;
6032 5996
6033 /*
6034 * IP payload checksum (enabled with jumbos/packet-split when Rx
6035 * checksum is enabled) and generation of RSS hash is mutually
6036 * exclusive in the hardware.
6037 */
6038 if (adapter->rx_ps_pages &&
6039 (features & NETIF_F_RXCSUM) && (features & NETIF_F_RXHASH)) {
6040 e_err("Enabling both receive checksum offload and receive hashing is not possible with jumbo frames. Disable jumbos or enable only one of the receive offload features.\n");
6041 return -EINVAL;
6042 }
6043
6044 if (changed & NETIF_F_RXFCS) { 5997 if (changed & NETIF_F_RXFCS) {
6045 if (features & NETIF_F_RXFCS) { 5998 if (features & NETIF_F_RXFCS) {
6046 adapter->flags2 &= ~FLAG2_CRC_STRIPPING; 5999 adapter->flags2 &= ~FLAG2_CRC_STRIPPING;
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index e65083958421..5e84eaac48c1 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -206,8 +206,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
206 mac->rar_entry_count = E1000_RAR_ENTRIES_82580; 206 mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
207 break; 207 break;
208 case e1000_i350: 208 case e1000_i350:
209 case e1000_i210:
210 case e1000_i211:
211 mac->rar_entry_count = E1000_RAR_ENTRIES_I350; 209 mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
212 break; 210 break;
213 default: 211 default:
diff --git a/drivers/net/ethernet/intel/igbvf/ethtool.c b/drivers/net/ethernet/intel/igbvf/ethtool.c
index 8ce67064b9c5..90eef07943f4 100644
--- a/drivers/net/ethernet/intel/igbvf/ethtool.c
+++ b/drivers/net/ethernet/intel/igbvf/ethtool.c
@@ -357,21 +357,28 @@ static int igbvf_set_coalesce(struct net_device *netdev,
357 struct igbvf_adapter *adapter = netdev_priv(netdev); 357 struct igbvf_adapter *adapter = netdev_priv(netdev);
358 struct e1000_hw *hw = &adapter->hw; 358 struct e1000_hw *hw = &adapter->hw;
359 359
360 if ((ec->rx_coalesce_usecs > IGBVF_MAX_ITR_USECS) || 360 if ((ec->rx_coalesce_usecs >= IGBVF_MIN_ITR_USECS) &&
361 ((ec->rx_coalesce_usecs > 3) && 361 (ec->rx_coalesce_usecs <= IGBVF_MAX_ITR_USECS)) {
362 (ec->rx_coalesce_usecs < IGBVF_MIN_ITR_USECS)) || 362 adapter->current_itr = ec->rx_coalesce_usecs << 2;
363 (ec->rx_coalesce_usecs == 2)) 363 adapter->requested_itr = 1000000000 /
364 return -EINVAL; 364 (adapter->current_itr * 256);
365 365 } else if ((ec->rx_coalesce_usecs == 3) ||
366 /* convert to rate of irq's per second */ 366 (ec->rx_coalesce_usecs == 2)) {
367 if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3) {
368 adapter->current_itr = IGBVF_START_ITR; 367 adapter->current_itr = IGBVF_START_ITR;
369 adapter->requested_itr = ec->rx_coalesce_usecs; 368 adapter->requested_itr = ec->rx_coalesce_usecs;
370 } else { 369 } else if (ec->rx_coalesce_usecs == 0) {
371 adapter->current_itr = ec->rx_coalesce_usecs << 2; 370 /*
371 * The user's desire is to turn off interrupt throttling
372 * altogether, but due to HW limitations, we can't do that.
373 * Instead we set a very small value in EITR, which would
374 * allow ~967k interrupts per second, but allow the adapter's
375 * internal clocking to still function properly.
376 */
377 adapter->current_itr = 4;
372 adapter->requested_itr = 1000000000 / 378 adapter->requested_itr = 1000000000 /
373 (adapter->current_itr * 256); 379 (adapter->current_itr * 256);
374 } 380 } else
381 return -EINVAL;
375 382
376 writel(adapter->current_itr, 383 writel(adapter->current_itr,
377 hw->hw_addr + adapter->rx_ring->itr_register); 384 hw->hw_addr + adapter->rx_ring->itr_register);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 3ef3c5284e52..7af291e236bf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -196,7 +196,7 @@ enum ixgbe_ring_state_t {
196 __IXGBE_HANG_CHECK_ARMED, 196 __IXGBE_HANG_CHECK_ARMED,
197 __IXGBE_RX_RSC_ENABLED, 197 __IXGBE_RX_RSC_ENABLED,
198 __IXGBE_RX_CSUM_UDP_ZERO_ERR, 198 __IXGBE_RX_CSUM_UDP_ZERO_ERR,
199 __IXGBE_RX_FCOE_BUFSZ, 199 __IXGBE_RX_FCOE,
200}; 200};
201 201
202#define check_for_tx_hang(ring) \ 202#define check_for_tx_hang(ring) \
@@ -290,7 +290,7 @@ struct ixgbe_ring_feature {
290#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192) 290#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192)
291static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring) 291static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring)
292{ 292{
293 return test_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state) ? 1 : 0; 293 return test_bit(__IXGBE_RX_FCOE, &ring->state) ? 1 : 0;
294} 294}
295#else 295#else
296#define ixgbe_rx_pg_order(_ring) 0 296#define ixgbe_rx_pg_order(_ring) 0
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index af1a5314b494..c377706e81a8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -634,7 +634,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
634 f = &adapter->ring_feature[RING_F_FCOE]; 634 f = &adapter->ring_feature[RING_F_FCOE];
635 if ((rxr_idx >= f->mask) && 635 if ((rxr_idx >= f->mask) &&
636 (rxr_idx < f->mask + f->indices)) 636 (rxr_idx < f->mask + f->indices))
637 set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); 637 set_bit(__IXGBE_RX_FCOE, &ring->state);
638 } 638 }
639 639
640#endif /* IXGBE_FCOE */ 640#endif /* IXGBE_FCOE */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 17ad6a3c1be1..e242104ab471 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1058,17 +1058,17 @@ static inline void ixgbe_rx_hash(struct ixgbe_ring *ring,
1058#ifdef IXGBE_FCOE 1058#ifdef IXGBE_FCOE
1059/** 1059/**
1060 * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type 1060 * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type
1061 * @adapter: address of board private structure 1061 * @ring: structure containing ring specific data
1062 * @rx_desc: advanced rx descriptor 1062 * @rx_desc: advanced rx descriptor
1063 * 1063 *
1064 * Returns : true if it is FCoE pkt 1064 * Returns : true if it is FCoE pkt
1065 */ 1065 */
1066static inline bool ixgbe_rx_is_fcoe(struct ixgbe_adapter *adapter, 1066static inline bool ixgbe_rx_is_fcoe(struct ixgbe_ring *ring,
1067 union ixgbe_adv_rx_desc *rx_desc) 1067 union ixgbe_adv_rx_desc *rx_desc)
1068{ 1068{
1069 __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; 1069 __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
1070 1070
1071 return (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 1071 return test_bit(__IXGBE_RX_FCOE, &ring->state) &&
1072 ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) == 1072 ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) ==
1073 (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE << 1073 (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE <<
1074 IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT))); 1074 IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT)));
@@ -1148,7 +1148,7 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,
1148 1148
1149 /* alloc new page for storage */ 1149 /* alloc new page for storage */
1150 if (likely(!page)) { 1150 if (likely(!page)) {
1151 page = alloc_pages(GFP_ATOMIC | __GFP_COLD, 1151 page = alloc_pages(GFP_ATOMIC | __GFP_COLD | __GFP_COMP,
1152 ixgbe_rx_pg_order(rx_ring)); 1152 ixgbe_rx_pg_order(rx_ring));
1153 if (unlikely(!page)) { 1153 if (unlikely(!page)) {
1154 rx_ring->rx_stats.alloc_rx_page_failed++; 1154 rx_ring->rx_stats.alloc_rx_page_failed++;
@@ -1549,6 +1549,12 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1549 skb->truesize -= ixgbe_rx_bufsz(rx_ring); 1549 skb->truesize -= ixgbe_rx_bufsz(rx_ring);
1550 } 1550 }
1551 1551
1552#ifdef IXGBE_FCOE
1553 /* do not attempt to pad FCoE Frames as this will disrupt DDP */
1554 if (ixgbe_rx_is_fcoe(rx_ring, rx_desc))
1555 return false;
1556
1557#endif
1552 /* if skb_pad returns an error the skb was freed */ 1558 /* if skb_pad returns an error the skb was freed */
1553 if (unlikely(skb->len < 60)) { 1559 if (unlikely(skb->len < 60)) {
1554 int pad_len = 60 - skb->len; 1560 int pad_len = 60 - skb->len;
@@ -1775,7 +1781,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
1775 1781
1776#ifdef IXGBE_FCOE 1782#ifdef IXGBE_FCOE
1777 /* if ddp, not passing to ULD unless for FCP_RSP or error */ 1783 /* if ddp, not passing to ULD unless for FCP_RSP or error */
1778 if (ixgbe_rx_is_fcoe(adapter, rx_desc)) { 1784 if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) {
1779 ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); 1785 ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb);
1780 if (!ddp_bytes) { 1786 if (!ddp_bytes) {
1781 dev_kfree_skb_any(skb); 1787 dev_kfree_skb_any(skb);
@@ -6641,6 +6647,11 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
6641 return -EINVAL; 6647 return -EINVAL;
6642 } 6648 }
6643 6649
6650 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
6651 e_err(drv, "Enable failed, SR-IOV enabled\n");
6652 return -EINVAL;
6653 }
6654
6644 /* Hardware supports up to 8 traffic classes */ 6655 /* Hardware supports up to 8 traffic classes */
6645 if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || 6656 if (tc > adapter->dcb_cfg.num_tcs.pg_tcs ||
6646 (hw->mac.type == ixgbe_mac_82598EB && 6657 (hw->mac.type == ixgbe_mac_82598EB &&
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index ddc6a4d19302..dcebd128becf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -708,6 +708,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
708{ 708{
709 struct ixgbe_hw *hw = &adapter->hw; 709 struct ixgbe_hw *hw = &adapter->hw;
710 u32 incval = 0; 710 u32 incval = 0;
711 u32 timinca = 0;
711 u32 shift = 0; 712 u32 shift = 0;
712 u32 cycle_speed; 713 u32 cycle_speed;
713 unsigned long flags; 714 unsigned long flags;
@@ -730,8 +731,16 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
730 break; 731 break;
731 } 732 }
732 733
733 /* Bail if the cycle speed didn't change */ 734 /*
734 if (adapter->cycle_speed == cycle_speed) 735 * grab the current TIMINCA value from the register so that it can be
736 * double checked. If the register value has been cleared, it must be
737 * reset to the correct value for generating a cyclecounter. If
738 * TIMINCA is zero, the SYSTIME registers do not increment at all.
739 */
740 timinca = IXGBE_READ_REG(hw, IXGBE_TIMINCA);
741
742 /* Bail if the cycle speed didn't change and TIMINCA is non-zero */
743 if (adapter->cycle_speed == cycle_speed && timinca)
735 return; 744 return;
736 745
737 /* disable the SDP clock out */ 746 /* disable the SDP clock out */
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index f69ec4288b10..41e32257a4e8 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -201,6 +201,9 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter,
201 unsigned int i, eop, count = 0; 201 unsigned int i, eop, count = 0;
202 unsigned int total_bytes = 0, total_packets = 0; 202 unsigned int total_bytes = 0, total_packets = 0;
203 203
204 if (test_bit(__IXGBEVF_DOWN, &adapter->state))
205 return true;
206
204 i = tx_ring->next_to_clean; 207 i = tx_ring->next_to_clean;
205 eop = tx_ring->tx_buffer_info[i].next_to_watch; 208 eop = tx_ring->tx_buffer_info[i].next_to_watch;
206 eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); 209 eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
@@ -969,8 +972,6 @@ static irqreturn_t ixgbevf_msix_clean_tx(int irq, void *data)
969 r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues); 972 r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues);
970 for (i = 0; i < q_vector->txr_count; i++) { 973 for (i = 0; i < q_vector->txr_count; i++) {
971 tx_ring = &(adapter->tx_ring[r_idx]); 974 tx_ring = &(adapter->tx_ring[r_idx]);
972 tx_ring->total_bytes = 0;
973 tx_ring->total_packets = 0;
974 ixgbevf_clean_tx_irq(adapter, tx_ring); 975 ixgbevf_clean_tx_irq(adapter, tx_ring);
975 r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, 976 r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues,
976 r_idx + 1); 977 r_idx + 1);
@@ -994,16 +995,6 @@ static irqreturn_t ixgbevf_msix_clean_rx(int irq, void *data)
994 struct ixgbe_hw *hw = &adapter->hw; 995 struct ixgbe_hw *hw = &adapter->hw;
995 struct ixgbevf_ring *rx_ring; 996 struct ixgbevf_ring *rx_ring;
996 int r_idx; 997 int r_idx;
997 int i;
998
999 r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues);
1000 for (i = 0; i < q_vector->rxr_count; i++) {
1001 rx_ring = &(adapter->rx_ring[r_idx]);
1002 rx_ring->total_bytes = 0;
1003 rx_ring->total_packets = 0;
1004 r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues,
1005 r_idx + 1);
1006 }
1007 998
1008 if (!q_vector->rxr_count) 999 if (!q_vector->rxr_count)
1009 return IRQ_HANDLED; 1000 return IRQ_HANDLED;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 926d8aac941c..073b85b45fc5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -929,15 +929,20 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv)
929 if (priv->rx_cq[i].buf) 929 if (priv->rx_cq[i].buf)
930 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); 930 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]);
931 } 931 }
932
933 if (priv->base_tx_qpn) {
934 mlx4_qp_release_range(priv->mdev->dev, priv->base_tx_qpn, priv->tx_ring_num);
935 priv->base_tx_qpn = 0;
936 }
932} 937}
933 938
934int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) 939int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
935{ 940{
936 struct mlx4_en_port_profile *prof = priv->prof; 941 struct mlx4_en_port_profile *prof = priv->prof;
937 int i; 942 int i;
938 int base_tx_qpn, err; 943 int err;
939 944
940 err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &base_tx_qpn); 945 err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &priv->base_tx_qpn);
941 if (err) { 946 if (err) {
942 en_err(priv, "failed reserving range for TX rings\n"); 947 en_err(priv, "failed reserving range for TX rings\n");
943 return err; 948 return err;
@@ -949,7 +954,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
949 prof->tx_ring_size, i, TX)) 954 prof->tx_ring_size, i, TX))
950 goto err; 955 goto err;
951 956
952 if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], base_tx_qpn + i, 957 if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], priv->base_tx_qpn + i,
953 prof->tx_ring_size, TXBB_SIZE)) 958 prof->tx_ring_size, TXBB_SIZE))
954 goto err; 959 goto err;
955 } 960 }
@@ -969,7 +974,6 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
969 974
970err: 975err:
971 en_err(priv, "Failed to allocate NIC resources\n"); 976 en_err(priv, "Failed to allocate NIC resources\n");
972 mlx4_qp_release_range(priv->mdev->dev, base_tx_qpn, priv->tx_ring_num);
973 return -ENOMEM; 977 return -ENOMEM;
974} 978}
975 979
@@ -1204,9 +1208,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
1204 en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num); 1208 en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num);
1205 1209
1206 /* Configure port */ 1210 /* Configure port */
1211 mlx4_en_calc_rx_buf(dev);
1207 err = mlx4_SET_PORT_general(mdev->dev, priv->port, 1212 err = mlx4_SET_PORT_general(mdev->dev, priv->port,
1208 MLX4_EN_MIN_MTU, 1213 priv->rx_skb_size + ETH_FCS_LEN,
1209 0, 0, 0, 0); 1214 prof->tx_pause, prof->tx_ppp,
1215 prof->rx_pause, prof->rx_ppp);
1210 if (err) { 1216 if (err) {
1211 en_err(priv, "Failed setting port general configurations " 1217 en_err(priv, "Failed setting port general configurations "
1212 "for port %d, with error %d\n", priv->port, err); 1218 "for port %d, with error %d\n", priv->port, err);
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index ee6f4fe00837..a0313de122de 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1975,6 +1975,8 @@ slave_start:
1975 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) && 1975 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) &&
1976 !mlx4_is_mfunc(dev)) { 1976 !mlx4_is_mfunc(dev)) {
1977 dev->flags &= ~MLX4_FLAG_MSI_X; 1977 dev->flags &= ~MLX4_FLAG_MSI_X;
1978 dev->caps.num_comp_vectors = 1;
1979 dev->caps.comp_pool = 0;
1978 pci_disable_msix(pdev); 1980 pci_disable_msix(pdev);
1979 err = mlx4_setup_hca(dev); 1981 err = mlx4_setup_hca(dev);
1980 } 1982 }
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 6ae350921b1a..225c20d47900 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -495,6 +495,7 @@ struct mlx4_en_priv {
495 int vids[128]; 495 int vids[128];
496 bool wol; 496 bool wol;
497 struct device *ddev; 497 struct device *ddev;
498 int base_tx_qpn;
498 499
499#ifdef CONFIG_MLX4_EN_DCB 500#ifdef CONFIG_MLX4_EN_DCB
500 struct ieee_ets ets; 501 struct ieee_ets ets;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 46e77a2c5121..ad98f4d7919d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
479 479
480 for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { 480 for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
481 pfn = pci_info[i].id; 481 pfn = pci_info[i].id;
482 if (pfn > QLCNIC_MAX_PCI_FUNC) { 482 if (pfn >= QLCNIC_MAX_PCI_FUNC) {
483 ret = QL_STATUS_INVALID_PARAM; 483 ret = QL_STATUS_INVALID_PARAM;
484 goto err_eswitch; 484 goto err_eswitch;
485 } 485 }
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7260aa79466a..d7a04e091101 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3894,6 +3894,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
3894 case RTL_GIGA_MAC_VER_22: 3894 case RTL_GIGA_MAC_VER_22:
3895 case RTL_GIGA_MAC_VER_23: 3895 case RTL_GIGA_MAC_VER_23:
3896 case RTL_GIGA_MAC_VER_24: 3896 case RTL_GIGA_MAC_VER_24:
3897 case RTL_GIGA_MAC_VER_34:
3897 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); 3898 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);
3898 break; 3899 break;
3899 default: 3900 default:
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 667169b82526..79bf09b41971 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1011,7 +1011,7 @@ static int sh_eth_txfree(struct net_device *ndev)
1011} 1011}
1012 1012
1013/* Packet receive function */ 1013/* Packet receive function */
1014static int sh_eth_rx(struct net_device *ndev) 1014static int sh_eth_rx(struct net_device *ndev, u32 intr_status)
1015{ 1015{
1016 struct sh_eth_private *mdp = netdev_priv(ndev); 1016 struct sh_eth_private *mdp = netdev_priv(ndev);
1017 struct sh_eth_rxdesc *rxdesc; 1017 struct sh_eth_rxdesc *rxdesc;
@@ -1102,9 +1102,11 @@ static int sh_eth_rx(struct net_device *ndev)
1102 /* Restart Rx engine if stopped. */ 1102 /* Restart Rx engine if stopped. */
1103 /* If we don't need to check status, don't. -KDU */ 1103 /* If we don't need to check status, don't. -KDU */
1104 if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) { 1104 if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) {
1105 /* fix the values for the next receiving */ 1105 /* fix the values for the next receiving if RDE is set */
1106 mdp->cur_rx = mdp->dirty_rx = (sh_eth_read(ndev, RDFAR) - 1106 if (intr_status & EESR_RDE)
1107 sh_eth_read(ndev, RDLAR)) >> 4; 1107 mdp->cur_rx = mdp->dirty_rx =
1108 (sh_eth_read(ndev, RDFAR) -
1109 sh_eth_read(ndev, RDLAR)) >> 4;
1108 sh_eth_write(ndev, EDRRR_R, EDRRR); 1110 sh_eth_write(ndev, EDRRR_R, EDRRR);
1109 } 1111 }
1110 1112
@@ -1273,7 +1275,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
1273 EESR_RTSF | /* short frame recv */ 1275 EESR_RTSF | /* short frame recv */
1274 EESR_PRE | /* PHY-LSI recv error */ 1276 EESR_PRE | /* PHY-LSI recv error */
1275 EESR_CERF)){ /* recv frame CRC error */ 1277 EESR_CERF)){ /* recv frame CRC error */
1276 sh_eth_rx(ndev); 1278 sh_eth_rx(ndev, intr_status);
1277 } 1279 }
1278 1280
1279 /* Tx Check */ 1281 /* Tx Check */
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
index fb8377da1687..4b785e10f2ed 100644
--- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
@@ -51,7 +51,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)
51 desc->des3 = desc->des2 + BUF_SIZE_4KiB; 51 desc->des3 = desc->des2 + BUF_SIZE_4KiB;
52 priv->hw->desc->prepare_tx_desc(desc, 1, bmax, 52 priv->hw->desc->prepare_tx_desc(desc, 1, bmax,
53 csum); 53 csum);
54 54 wmb();
55 entry = (++priv->cur_tx) % txsize; 55 entry = (++priv->cur_tx) % txsize;
56 desc = priv->dma_tx + entry; 56 desc = priv->dma_tx + entry;
57 57
@@ -59,6 +59,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)
59 len, DMA_TO_DEVICE); 59 len, DMA_TO_DEVICE);
60 desc->des3 = desc->des2 + BUF_SIZE_4KiB; 60 desc->des3 = desc->des2 + BUF_SIZE_4KiB;
61 priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); 61 priv->hw->desc->prepare_tx_desc(desc, 0, len, csum);
62 wmb();
62 priv->hw->desc->set_tx_owner(desc); 63 priv->hw->desc->set_tx_owner(desc);
63 priv->tx_skbuff[entry] = NULL; 64 priv->tx_skbuff[entry] = NULL;
64 } else { 65 } else {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 51b3b68528ee..ea3003edde18 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1212,6 +1212,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
1212 priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); 1212 priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion);
1213 wmb(); 1213 wmb();
1214 priv->hw->desc->set_tx_owner(desc); 1214 priv->hw->desc->set_tx_owner(desc);
1215 wmb();
1215 } 1216 }
1216 1217
1217 /* Interrupt on completition only for the latest segment */ 1218 /* Interrupt on completition only for the latest segment */
@@ -1227,6 +1228,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
1227 1228
1228 /* To avoid raise condition */ 1229 /* To avoid raise condition */
1229 priv->hw->desc->set_tx_owner(first); 1230 priv->hw->desc->set_tx_owner(first);
1231 wmb();
1230 1232
1231 priv->cur_tx++; 1233 priv->cur_tx++;
1232 1234
@@ -1290,6 +1292,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv)
1290 } 1292 }
1291 wmb(); 1293 wmb();
1292 priv->hw->desc->set_rx_owner(p + entry); 1294 priv->hw->desc->set_rx_owner(p + entry);
1295 wmb();
1293 } 1296 }
1294} 1297}
1295 1298
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index d614c374ed9d..3b5c4571b55e 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/module.h>
18#include <linux/slab.h> 19#include <linux/slab.h>
19#include <linux/err.h> 20#include <linux/err.h>
20#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
index 39ea0674dcde..5c120189ec86 100644
--- a/drivers/net/phy/mdio-mux.c
+++ b/drivers/net/phy/mdio-mux.c
@@ -46,7 +46,13 @@ static int mdio_mux_read(struct mii_bus *bus, int phy_id, int regnum)
46 struct mdio_mux_parent_bus *pb = cb->parent; 46 struct mdio_mux_parent_bus *pb = cb->parent;
47 int r; 47 int r;
48 48
49 mutex_lock(&pb->mii_bus->mdio_lock); 49 /* In theory multiple mdio_mux could be stacked, thus creating
50 * more than a single level of nesting. But in practice,
51 * SINGLE_DEPTH_NESTING will cover the vast majority of use
52 * cases. We use it, instead of trying to handle the general
53 * case.
54 */
55 mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING);
50 r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); 56 r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
51 if (r) 57 if (r)
52 goto out; 58 goto out;
@@ -71,7 +77,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id,
71 77
72 int r; 78 int r;
73 79
74 mutex_lock(&pb->mii_bus->mdio_lock); 80 mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING);
75 r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); 81 r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data);
76 if (r) 82 if (r)
77 goto out; 83 goto out;
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 590f902deb6b..9d6c80c8a0cf 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -161,7 +161,7 @@ static struct phy_driver ks8051_driver = {
161static struct phy_driver ks8001_driver = { 161static struct phy_driver ks8001_driver = {
162 .phy_id = PHY_ID_KS8001, 162 .phy_id = PHY_ID_KS8001,
163 .name = "Micrel KS8001 or KS8721", 163 .name = "Micrel KS8001 or KS8721",
164 .phy_id_mask = 0x00fffff0, 164 .phy_id_mask = 0x00ffffff,
165 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 165 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
166 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 166 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
167 .config_init = kszphy_config_init, 167 .config_init = kszphy_config_init,
@@ -174,7 +174,7 @@ static struct phy_driver ks8001_driver = {
174 174
175static struct phy_driver ksz9021_driver = { 175static struct phy_driver ksz9021_driver = {
176 .phy_id = PHY_ID_KSZ9021, 176 .phy_id = PHY_ID_KSZ9021,
177 .phy_id_mask = 0x000fff10, 177 .phy_id_mask = 0x000ffffe,
178 .name = "Micrel KSZ9021 Gigabit PHY", 178 .name = "Micrel KSZ9021 Gigabit PHY",
179 .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause 179 .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause
180 | SUPPORTED_Asym_Pause), 180 | SUPPORTED_Asym_Pause),
@@ -240,8 +240,8 @@ MODULE_AUTHOR("David J. Choi");
240MODULE_LICENSE("GPL"); 240MODULE_LICENSE("GPL");
241 241
242static struct mdio_device_id __maybe_unused micrel_tbl[] = { 242static struct mdio_device_id __maybe_unused micrel_tbl[] = {
243 { PHY_ID_KSZ9021, 0x000fff10 }, 243 { PHY_ID_KSZ9021, 0x000ffffe },
244 { PHY_ID_KS8001, 0x00fffff0 }, 244 { PHY_ID_KS8001, 0x00ffffff },
245 { PHY_ID_KS8737, 0x00fffff0 }, 245 { PHY_ID_KS8737, 0x00fffff0 },
246 { PHY_ID_KS8041, 0x00fffff0 }, 246 { PHY_ID_KS8041, 0x00fffff0 },
247 { PHY_ID_KS8051, 0x00fffff0 }, 247 { PHY_ID_KS8051, 0x00fffff0 },
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 964031e3da87..a28a983d465e 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -59,6 +59,7 @@
59#define USB_PRODUCT_IPHONE_3G 0x1292 59#define USB_PRODUCT_IPHONE_3G 0x1292
60#define USB_PRODUCT_IPHONE_3GS 0x1294 60#define USB_PRODUCT_IPHONE_3GS 0x1294
61#define USB_PRODUCT_IPHONE_4 0x1297 61#define USB_PRODUCT_IPHONE_4 0x1297
62#define USB_PRODUCT_IPAD 0x129a
62#define USB_PRODUCT_IPHONE_4_VZW 0x129c 63#define USB_PRODUCT_IPHONE_4_VZW 0x129c
63#define USB_PRODUCT_IPHONE_4S 0x12a0 64#define USB_PRODUCT_IPHONE_4S 0x12a0
64 65
@@ -101,6 +102,10 @@ static struct usb_device_id ipheth_table[] = {
101 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 102 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
102 IPHETH_USBINTF_PROTO) }, 103 IPHETH_USBINTF_PROTO) },
103 { USB_DEVICE_AND_INTERFACE_INFO( 104 { USB_DEVICE_AND_INTERFACE_INFO(
105 USB_VENDOR_APPLE, USB_PRODUCT_IPAD,
106 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
107 IPHETH_USBINTF_PROTO) },
108 { USB_DEVICE_AND_INTERFACE_INFO(
104 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, 109 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
105 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 110 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
106 IPHETH_USBINTF_PROTO) }, 111 IPHETH_USBINTF_PROTO) },
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 3b206786b5e7..a051cedd64bd 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -197,6 +197,10 @@ err:
197static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on) 197static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on)
198{ 198{
199 struct usbnet *dev = usb_get_intfdata(intf); 199 struct usbnet *dev = usb_get_intfdata(intf);
200
201 /* can be called while disconnecting */
202 if (!dev)
203 return 0;
200 return qmi_wwan_manage_power(dev, on); 204 return qmi_wwan_manage_power(dev, on);
201} 205}
202 206
@@ -257,29 +261,6 @@ err:
257 return rv; 261 return rv;
258} 262}
259 263
260/* Gobi devices uses identical class/protocol codes for all interfaces regardless
261 * of function. Some of these are CDC ACM like and have the exact same endpoints
262 * we are looking for. This leaves two possible strategies for identifying the
263 * correct interface:
264 * a) hardcoding interface number, or
265 * b) use the fact that the wwan interface is the only one lacking additional
266 * (CDC functional) descriptors
267 *
268 * Let's see if we can get away with the generic b) solution.
269 */
270static int qmi_wwan_bind_gobi(struct usbnet *dev, struct usb_interface *intf)
271{
272 int rv = -EINVAL;
273
274 /* ignore any interface with additional descriptors */
275 if (intf->cur_altsetting->extralen)
276 goto err;
277
278 rv = qmi_wwan_bind_shared(dev, intf);
279err:
280 return rv;
281}
282
283static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf) 264static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf)
284{ 265{
285 struct usb_driver *subdriver = (void *)dev->data[0]; 266 struct usb_driver *subdriver = (void *)dev->data[0];
@@ -347,15 +328,15 @@ static const struct driver_info qmi_wwan_shared = {
347 .manage_power = qmi_wwan_manage_power, 328 .manage_power = qmi_wwan_manage_power,
348}; 329};
349 330
350static const struct driver_info qmi_wwan_gobi = { 331static const struct driver_info qmi_wwan_force_int0 = {
351 .description = "Qualcomm Gobi wwan/QMI device", 332 .description = "Qualcomm WWAN/QMI device",
352 .flags = FLAG_WWAN, 333 .flags = FLAG_WWAN,
353 .bind = qmi_wwan_bind_gobi, 334 .bind = qmi_wwan_bind_shared,
354 .unbind = qmi_wwan_unbind_shared, 335 .unbind = qmi_wwan_unbind_shared,
355 .manage_power = qmi_wwan_manage_power, 336 .manage_power = qmi_wwan_manage_power,
337 .data = BIT(0), /* interface whitelist bitmap */
356}; 338};
357 339
358/* ZTE suck at making USB descriptors */
359static const struct driver_info qmi_wwan_force_int1 = { 340static const struct driver_info qmi_wwan_force_int1 = {
360 .description = "Qualcomm WWAN/QMI device", 341 .description = "Qualcomm WWAN/QMI device",
361 .flags = FLAG_WWAN, 342 .flags = FLAG_WWAN,
@@ -365,6 +346,24 @@ static const struct driver_info qmi_wwan_force_int1 = {
365 .data = BIT(1), /* interface whitelist bitmap */ 346 .data = BIT(1), /* interface whitelist bitmap */
366}; 347};
367 348
349static const struct driver_info qmi_wwan_force_int2 = {
350 .description = "Qualcomm WWAN/QMI device",
351 .flags = FLAG_WWAN,
352 .bind = qmi_wwan_bind_shared,
353 .unbind = qmi_wwan_unbind_shared,
354 .manage_power = qmi_wwan_manage_power,
355 .data = BIT(2), /* interface whitelist bitmap */
356};
357
358static const struct driver_info qmi_wwan_force_int3 = {
359 .description = "Qualcomm WWAN/QMI device",
360 .flags = FLAG_WWAN,
361 .bind = qmi_wwan_bind_shared,
362 .unbind = qmi_wwan_unbind_shared,
363 .manage_power = qmi_wwan_manage_power,
364 .data = BIT(3), /* interface whitelist bitmap */
365};
366
368static const struct driver_info qmi_wwan_force_int4 = { 367static const struct driver_info qmi_wwan_force_int4 = {
369 .description = "Qualcomm WWAN/QMI device", 368 .description = "Qualcomm WWAN/QMI device",
370 .flags = FLAG_WWAN, 369 .flags = FLAG_WWAN,
@@ -390,16 +389,23 @@ static const struct driver_info qmi_wwan_force_int4 = {
390static const struct driver_info qmi_wwan_sierra = { 389static const struct driver_info qmi_wwan_sierra = {
391 .description = "Sierra Wireless wwan/QMI device", 390 .description = "Sierra Wireless wwan/QMI device",
392 .flags = FLAG_WWAN, 391 .flags = FLAG_WWAN,
393 .bind = qmi_wwan_bind_gobi, 392 .bind = qmi_wwan_bind_shared,
394 .unbind = qmi_wwan_unbind_shared, 393 .unbind = qmi_wwan_unbind_shared,
395 .manage_power = qmi_wwan_manage_power, 394 .manage_power = qmi_wwan_manage_power,
396 .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ 395 .data = BIT(8) | BIT(19), /* interface whitelist bitmap */
397}; 396};
398 397
399#define HUAWEI_VENDOR_ID 0x12D1 398#define HUAWEI_VENDOR_ID 0x12D1
399
400/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
401#define QMI_GOBI1K_DEVICE(vend, prod) \
402 USB_DEVICE(vend, prod), \
403 .driver_info = (unsigned long)&qmi_wwan_force_int3
404
405/* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */
400#define QMI_GOBI_DEVICE(vend, prod) \ 406#define QMI_GOBI_DEVICE(vend, prod) \
401 USB_DEVICE(vend, prod), \ 407 USB_DEVICE(vend, prod), \
402 .driver_info = (unsigned long)&qmi_wwan_gobi 408 .driver_info = (unsigned long)&qmi_wwan_force_int0
403 409
404static const struct usb_device_id products[] = { 410static const struct usb_device_id products[] = {
405 { /* Huawei E392, E398 and possibly others sharing both device id and more... */ 411 { /* Huawei E392, E398 and possibly others sharing both device id and more... */
@@ -501,6 +507,15 @@ static const struct usb_device_id products[] = {
501 .bInterfaceProtocol = 0xff, 507 .bInterfaceProtocol = 0xff,
502 .driver_info = (unsigned long)&qmi_wwan_force_int4, 508 .driver_info = (unsigned long)&qmi_wwan_force_int4,
503 }, 509 },
510 { /* ZTE MF60 */
511 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
512 .idVendor = 0x19d2,
513 .idProduct = 0x1402,
514 .bInterfaceClass = 0xff,
515 .bInterfaceSubClass = 0xff,
516 .bInterfaceProtocol = 0xff,
517 .driver_info = (unsigned long)&qmi_wwan_force_int2,
518 },
504 { /* Sierra Wireless MC77xx in QMI mode */ 519 { /* Sierra Wireless MC77xx in QMI mode */
505 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, 520 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
506 .idVendor = 0x1199, 521 .idVendor = 0x1199,
@@ -510,20 +525,24 @@ static const struct usb_device_id products[] = {
510 .bInterfaceProtocol = 0xff, 525 .bInterfaceProtocol = 0xff,
511 .driver_info = (unsigned long)&qmi_wwan_sierra, 526 .driver_info = (unsigned long)&qmi_wwan_sierra,
512 }, 527 },
513 {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 528
514 {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ 529 /* Gobi 1000 devices */
515 {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ 530 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
516 {QMI_GOBI_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ 531 {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
517 {QMI_GOBI_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ 532 {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
518 {QMI_GOBI_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ 533 {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
519 {QMI_GOBI_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ 534 {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
520 {QMI_GOBI_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ 535 {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
521 {QMI_GOBI_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ 536 {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
522 {QMI_GOBI_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ 537 {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
523 {QMI_GOBI_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ 538 {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
524 {QMI_GOBI_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ 539 {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
525 {QMI_GOBI_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ 540 {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
526 {QMI_GOBI_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ 541 {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
542 {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
543 {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
544
545 /* Gobi 2000 and 3000 devices */
527 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ 546 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
528 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ 547 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
529 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ 548 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 9f58330f1312..aba769d77459 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -796,11 +796,13 @@ int usbnet_open (struct net_device *net)
796 if (info->manage_power) { 796 if (info->manage_power) {
797 retval = info->manage_power(dev, 1); 797 retval = info->manage_power(dev, 1);
798 if (retval < 0) 798 if (retval < 0)
799 goto done; 799 goto done_manage_power_error;
800 usb_autopm_put_interface(dev->intf); 800 usb_autopm_put_interface(dev->intf);
801 } 801 }
802 return retval; 802 return retval;
803 803
804done_manage_power_error:
805 clear_bit(EVENT_DEV_OPEN, &dev->flags);
804done: 806done:
805 usb_autopm_put_interface(dev->intf); 807 usb_autopm_put_interface(dev->intf);
806done_nopm: 808done_nopm:
@@ -876,9 +878,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
876{ 878{
877 struct usbnet *dev = netdev_priv(net); 879 struct usbnet *dev = netdev_priv(net);
878 880
879 strncpy (info->driver, dev->driver_name, sizeof info->driver); 881 strlcpy (info->driver, dev->driver_name, sizeof info->driver);
880 strncpy (info->version, DRIVER_VERSION, sizeof info->version); 882 strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
881 strncpy (info->fw_version, dev->driver_info->description, 883 strlcpy (info->fw_version, dev->driver_info->description,
882 sizeof info->fw_version); 884 sizeof info->fw_version);
883 usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info); 885 usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
884} 886}
@@ -1202,6 +1204,21 @@ deferred:
1202} 1204}
1203EXPORT_SYMBOL_GPL(usbnet_start_xmit); 1205EXPORT_SYMBOL_GPL(usbnet_start_xmit);
1204 1206
1207static void rx_alloc_submit(struct usbnet *dev, gfp_t flags)
1208{
1209 struct urb *urb;
1210 int i;
1211
1212 /* don't refill the queue all at once */
1213 for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) {
1214 urb = usb_alloc_urb(0, flags);
1215 if (urb != NULL) {
1216 if (rx_submit(dev, urb, flags) == -ENOLINK)
1217 return;
1218 }
1219 }
1220}
1221
1205/*-------------------------------------------------------------------------*/ 1222/*-------------------------------------------------------------------------*/
1206 1223
1207// tasklet (work deferred from completions, in_irq) or timer 1224// tasklet (work deferred from completions, in_irq) or timer
@@ -1241,26 +1258,14 @@ static void usbnet_bh (unsigned long param)
1241 !timer_pending (&dev->delay) && 1258 !timer_pending (&dev->delay) &&
1242 !test_bit (EVENT_RX_HALT, &dev->flags)) { 1259 !test_bit (EVENT_RX_HALT, &dev->flags)) {
1243 int temp = dev->rxq.qlen; 1260 int temp = dev->rxq.qlen;
1244 int qlen = RX_QLEN (dev); 1261
1245 1262 if (temp < RX_QLEN(dev)) {
1246 if (temp < qlen) { 1263 rx_alloc_submit(dev, GFP_ATOMIC);
1247 struct urb *urb;
1248 int i;
1249
1250 // don't refill the queue all at once
1251 for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) {
1252 urb = usb_alloc_urb (0, GFP_ATOMIC);
1253 if (urb != NULL) {
1254 if (rx_submit (dev, urb, GFP_ATOMIC) ==
1255 -ENOLINK)
1256 return;
1257 }
1258 }
1259 if (temp != dev->rxq.qlen) 1264 if (temp != dev->rxq.qlen)
1260 netif_dbg(dev, link, dev->net, 1265 netif_dbg(dev, link, dev->net,
1261 "rxqlen %d --> %d\n", 1266 "rxqlen %d --> %d\n",
1262 temp, dev->rxq.qlen); 1267 temp, dev->rxq.qlen);
1263 if (dev->rxq.qlen < qlen) 1268 if (dev->rxq.qlen < RX_QLEN(dev))
1264 tasklet_schedule (&dev->bh); 1269 tasklet_schedule (&dev->bh);
1265 } 1270 }
1266 if (dev->txq.qlen < TX_QLEN (dev)) 1271 if (dev->txq.qlen < TX_QLEN (dev))
@@ -1513,6 +1518,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
1513 spin_lock_irq(&dev->txq.lock); 1518 spin_lock_irq(&dev->txq.lock);
1514 /* don't autosuspend while transmitting */ 1519 /* don't autosuspend while transmitting */
1515 if (dev->txq.qlen && PMSG_IS_AUTO(message)) { 1520 if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
1521 dev->suspend_count--;
1516 spin_unlock_irq(&dev->txq.lock); 1522 spin_unlock_irq(&dev->txq.lock);
1517 return -EBUSY; 1523 return -EBUSY;
1518 } else { 1524 } else {
@@ -1569,6 +1575,13 @@ int usbnet_resume (struct usb_interface *intf)
1569 spin_unlock_irq(&dev->txq.lock); 1575 spin_unlock_irq(&dev->txq.lock);
1570 1576
1571 if (test_bit(EVENT_DEV_OPEN, &dev->flags)) { 1577 if (test_bit(EVENT_DEV_OPEN, &dev->flags)) {
1578 /* handle remote wakeup ASAP */
1579 if (!dev->wait &&
1580 netif_device_present(dev->net) &&
1581 !timer_pending(&dev->delay) &&
1582 !test_bit(EVENT_RX_HALT, &dev->flags))
1583 rx_alloc_submit(dev, GFP_KERNEL);
1584
1572 if (!(dev->txq.qlen >= TX_QLEN(dev))) 1585 if (!(dev->txq.qlen >= TX_QLEN(dev)))
1573 netif_tx_wake_all_queues(dev->net); 1586 netif_tx_wake_all_queues(dev->net);
1574 tasklet_schedule (&dev->bh); 1587 tasklet_schedule (&dev->bh);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 520a4b2eb9cc..a747c632597a 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -7233,8 +7233,8 @@ static int airo_get_aplist(struct net_device *dev,
7233 } 7233 }
7234 } else { 7234 } else {
7235 dwrq->flags = 1; /* Should be define'd */ 7235 dwrq->flags = 1; /* Should be define'd */
7236 memcpy(extra + sizeof(struct sockaddr)*i, 7236 memcpy(extra + sizeof(struct sockaddr) * i, qual,
7237 &qual, sizeof(struct iw_quality)*i); 7237 sizeof(struct iw_quality) * i);
7238 } 7238 }
7239 dwrq->length = i; 7239 dwrq->length = i;
7240 7240
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index c54b7d37bff1..420d69b2674c 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -143,6 +143,7 @@ struct ath_common {
143 u32 keymax; 143 u32 keymax;
144 DECLARE_BITMAP(keymap, ATH_KEYMAX); 144 DECLARE_BITMAP(keymap, ATH_KEYMAX);
145 DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX); 145 DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX);
146 DECLARE_BITMAP(ccmp_keymap, ATH_KEYMAX);
146 enum ath_crypt_caps crypt_caps; 147 enum ath_crypt_caps crypt_caps;
147 148
148 unsigned int clockrate; 149 unsigned int clockrate;
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index fbaa30930076..44ad6fe0278f 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1045,11 +1045,11 @@ ath5k_drain_tx_buffs(struct ath5k_hw *ah)
1045 1045
1046 ath5k_txbuf_free_skb(ah, bf); 1046 ath5k_txbuf_free_skb(ah, bf);
1047 1047
1048 spin_lock_bh(&ah->txbuflock); 1048 spin_lock(&ah->txbuflock);
1049 list_move_tail(&bf->list, &ah->txbuf); 1049 list_move_tail(&bf->list, &ah->txbuf);
1050 ah->txbuf_len++; 1050 ah->txbuf_len++;
1051 txq->txq_len--; 1051 txq->txq_len--;
1052 spin_unlock_bh(&ah->txbuflock); 1052 spin_unlock(&ah->txbuflock);
1053 } 1053 }
1054 txq->link = NULL; 1054 txq->link = NULL;
1055 txq->txq_poll_mark = false; 1055 txq->txq_poll_mark = false;
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index a277cf6f339d..4866550ddd96 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -214,6 +214,7 @@ struct ath_frame_info {
214 enum ath9k_key_type keytype; 214 enum ath9k_key_type keytype;
215 u8 keyix; 215 u8 keyix;
216 u8 retries; 216 u8 retries;
217 u8 rtscts_rate;
217}; 218};
218 219
219struct ath_buf_state { 220struct ath_buf_state {
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 2b8f61c210e1..abbd6effd60d 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1496,6 +1496,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
1496 priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--; 1496 priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--;
1497 1497
1498 if (priv->ah->opmode == NL80211_IFTYPE_STATION) { 1498 if (priv->ah->opmode == NL80211_IFTYPE_STATION) {
1499 ath9k_htc_choose_set_bssid(priv);
1499 if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1)) 1500 if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1))
1500 ath9k_htc_start_ani(priv); 1501 ath9k_htc_start_ani(priv);
1501 else if (priv->num_sta_assoc_vif == 0) 1502 else if (priv->num_sta_assoc_vif == 0)
@@ -1503,13 +1504,11 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
1503 } 1504 }
1504 } 1505 }
1505 1506
1506 if (changed & BSS_CHANGED_BSSID) { 1507 if (changed & BSS_CHANGED_IBSS) {
1507 if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { 1508 if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) {
1508 common->curaid = bss_conf->aid; 1509 common->curaid = bss_conf->aid;
1509 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); 1510 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
1510 ath9k_htc_set_bssid(priv); 1511 ath9k_htc_set_bssid(priv);
1511 } else if (priv->ah->opmode == NL80211_IFTYPE_STATION) {
1512 ath9k_htc_choose_set_bssid(priv);
1513 } 1512 }
1514 } 1513 }
1515 1514
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 7db1890448f2..995ca8e1302e 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -622,7 +622,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
622 622
623 if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_AUTO) { 623 if (NR_CPUS > 1 && ah->config.serialize_regmode == SER_REG_MODE_AUTO) {
624 if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI || 624 if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCI ||
625 ((AR_SREV_9160(ah) || AR_SREV_9280(ah)) && 625 ((AR_SREV_9160(ah) || AR_SREV_9280(ah) || AR_SREV_9287(ah)) &&
626 !ah->is_pciexpress)) { 626 !ah->is_pciexpress)) {
627 ah->config.serialize_regmode = 627 ah->config.serialize_regmode =
628 SER_REG_MODE_ON; 628 SER_REG_MODE_ON;
@@ -784,13 +784,25 @@ static void ath9k_hw_init_qos(struct ath_hw *ah)
784 784
785u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah) 785u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah)
786{ 786{
787 struct ath_common *common = ath9k_hw_common(ah);
788 int i = 0;
789
787 REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); 790 REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK);
788 udelay(100); 791 udelay(100);
789 REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); 792 REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK);
790 793
791 while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) 794 while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) {
795
792 udelay(100); 796 udelay(100);
793 797
798 if (WARN_ON_ONCE(i >= 100)) {
799 ath_err(common, "PLL4 meaurement not done\n");
800 break;
801 }
802
803 i++;
804 }
805
794 return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3; 806 return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3;
795} 807}
796EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); 808EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 4de4473776ac..dac1a2709e3c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -971,6 +971,15 @@ void ath_hw_pll_work(struct work_struct *work)
971 hw_pll_work.work); 971 hw_pll_work.work);
972 u32 pll_sqsum; 972 u32 pll_sqsum;
973 973
974 /*
975 * ensure that the PLL WAR is executed only
976 * after the STA is associated (or) if the
977 * beaconing had started in interfaces that
978 * uses beacons.
979 */
980 if (!(sc->sc_flags & SC_OP_BEACONS))
981 return;
982
974 if (AR_SREV_9485(sc->sc_ah)) { 983 if (AR_SREV_9485(sc->sc_ah)) {
975 984
976 ath9k_ps_wakeup(sc); 985 ath9k_ps_wakeup(sc);
@@ -1443,15 +1452,6 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1443 } 1452 }
1444 } 1453 }
1445 1454
1446 if ((ah->opmode == NL80211_IFTYPE_ADHOC) ||
1447 ((vif->type == NL80211_IFTYPE_ADHOC) &&
1448 sc->nvifs > 0)) {
1449 ath_err(common, "Cannot create ADHOC interface when other"
1450 " interfaces already exist.\n");
1451 ret = -EINVAL;
1452 goto out;
1453 }
1454
1455 ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); 1455 ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
1456 1456
1457 sc->nvifs++; 1457 sc->nvifs++;
@@ -1476,15 +1476,6 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1476 mutex_lock(&sc->mutex); 1476 mutex_lock(&sc->mutex);
1477 ath9k_ps_wakeup(sc); 1477 ath9k_ps_wakeup(sc);
1478 1478
1479 /* See if new interface type is valid. */
1480 if ((new_type == NL80211_IFTYPE_ADHOC) &&
1481 (sc->nvifs > 1)) {
1482 ath_err(common, "When using ADHOC, it must be the only"
1483 " interface.\n");
1484 ret = -EINVAL;
1485 goto out;
1486 }
1487
1488 if (ath9k_uses_beacons(new_type) && 1479 if (ath9k_uses_beacons(new_type) &&
1489 !ath9k_uses_beacons(vif->type)) { 1480 !ath9k_uses_beacons(vif->type)) {
1490 if (sc->nbcnvifs >= ATH_BCBUF) { 1481 if (sc->nbcnvifs >= ATH_BCBUF) {
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index e1fcc68124dc..0735aeb3b26c 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -695,9 +695,9 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
695 __skb_unlink(skb, &rx_edma->rx_fifo); 695 __skb_unlink(skb, &rx_edma->rx_fifo);
696 list_add_tail(&bf->list, &sc->rx.rxbuf); 696 list_add_tail(&bf->list, &sc->rx.rxbuf);
697 ath_rx_edma_buf_link(sc, qtype); 697 ath_rx_edma_buf_link(sc, qtype);
698 } else {
699 bf = NULL;
700 } 698 }
699
700 bf = NULL;
701 } 701 }
702 702
703 *dest = bf; 703 *dest = bf;
@@ -822,7 +822,8 @@ static bool ath9k_rx_accept(struct ath_common *common,
822 * descriptor does contain a valid key index. This has been observed 822 * descriptor does contain a valid key index. This has been observed
823 * mostly with CCMP encryption. 823 * mostly with CCMP encryption.
824 */ 824 */
825 if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID) 825 if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID ||
826 !test_bit(rx_stats->rs_keyix, common->ccmp_keymap))
826 rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS; 827 rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
827 828
828 if (!rx_stats->rs_datalen) { 829 if (!rx_stats->rs_datalen) {
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index d59dd01d6cde..4d571394c7a8 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
938 struct ieee80211_tx_rate *rates; 938 struct ieee80211_tx_rate *rates;
939 const struct ieee80211_rate *rate; 939 const struct ieee80211_rate *rate;
940 struct ieee80211_hdr *hdr; 940 struct ieee80211_hdr *hdr;
941 struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
941 int i; 942 int i;
942 u8 rix = 0; 943 u8 rix = 0;
943 944
@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
948 949
949 /* set dur_update_en for l-sig computation except for PS-Poll frames */ 950 /* set dur_update_en for l-sig computation except for PS-Poll frames */
950 info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); 951 info->dur_update = !ieee80211_is_pspoll(hdr->frame_control);
951 952 info->rtscts_rate = fi->rtscts_rate;
952 /*
953 * We check if Short Preamble is needed for the CTS rate by
954 * checking the BSS's global flag.
955 * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used.
956 */
957 rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info);
958 info->rtscts_rate = rate->hw_value;
959
960 if (tx_info->control.vif &&
961 tx_info->control.vif->bss_conf.use_short_preamble)
962 info->rtscts_rate |= rate->hw_value_short;
963 953
964 for (i = 0; i < 4; i++) { 954 for (i = 0; i < 4; i++) {
965 bool is_40, is_sgi, is_sp; 955 bool is_40, is_sgi, is_sp;
@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
1001 } 991 }
1002 992
1003 /* legacy rates */ 993 /* legacy rates */
994 rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
1004 if ((tx_info->band == IEEE80211_BAND_2GHZ) && 995 if ((tx_info->band == IEEE80211_BAND_2GHZ) &&
1005 !(rate->flags & IEEE80211_RATE_ERP_G)) 996 !(rate->flags & IEEE80211_RATE_ERP_G))
1006 phy = WLAN_RC_PHY_CCK; 997 phy = WLAN_RC_PHY_CCK;
1007 else 998 else
1008 phy = WLAN_RC_PHY_OFDM; 999 phy = WLAN_RC_PHY_OFDM;
1009 1000
1010 rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
1011 info->rates[i].Rate = rate->hw_value; 1001 info->rates[i].Rate = rate->hw_value;
1012 if (rate->hw_value_short) { 1002 if (rate->hw_value_short) {
1013 if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) 1003 if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
@@ -1776,10 +1766,22 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
1776 struct ieee80211_sta *sta = tx_info->control.sta; 1766 struct ieee80211_sta *sta = tx_info->control.sta;
1777 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 1767 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
1778 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1768 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1769 const struct ieee80211_rate *rate;
1779 struct ath_frame_info *fi = get_frame_info(skb); 1770 struct ath_frame_info *fi = get_frame_info(skb);
1780 struct ath_node *an = NULL; 1771 struct ath_node *an = NULL;
1781 enum ath9k_key_type keytype; 1772 enum ath9k_key_type keytype;
1773 bool short_preamble = false;
1774
1775 /*
1776 * We check if Short Preamble is needed for the CTS rate by
1777 * checking the BSS's global flag.
1778 * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used.
1779 */
1780 if (tx_info->control.vif &&
1781 tx_info->control.vif->bss_conf.use_short_preamble)
1782 short_preamble = true;
1782 1783
1784 rate = ieee80211_get_rts_cts_rate(hw, tx_info);
1783 keytype = ath9k_cmn_get_hw_crypto_keytype(skb); 1785 keytype = ath9k_cmn_get_hw_crypto_keytype(skb);
1784 1786
1785 if (sta) 1787 if (sta)
@@ -1794,6 +1796,9 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
1794 fi->keyix = ATH9K_TXKEYIX_INVALID; 1796 fi->keyix = ATH9K_TXKEYIX_INVALID;
1795 fi->keytype = keytype; 1797 fi->keytype = keytype;
1796 fi->framelen = framelen; 1798 fi->framelen = framelen;
1799 fi->rtscts_rate = rate->hw_value;
1800 if (short_preamble)
1801 fi->rtscts_rate |= rate->hw_value_short;
1797} 1802}
1798 1803
1799u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) 1804u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
index 0e81904956cf..5c54aa43ca2d 100644
--- a/drivers/net/wireless/ath/key.c
+++ b/drivers/net/wireless/ath/key.c
@@ -556,6 +556,9 @@ int ath_key_config(struct ath_common *common,
556 return -EIO; 556 return -EIO;
557 557
558 set_bit(idx, common->keymap); 558 set_bit(idx, common->keymap);
559 if (key->cipher == WLAN_CIPHER_SUITE_CCMP)
560 set_bit(idx, common->ccmp_keymap);
561
559 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { 562 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
560 set_bit(idx + 64, common->keymap); 563 set_bit(idx + 64, common->keymap);
561 set_bit(idx, common->tkip_keymap); 564 set_bit(idx, common->tkip_keymap);
@@ -582,6 +585,7 @@ void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
582 return; 585 return;
583 586
584 clear_bit(key->hw_key_idx, common->keymap); 587 clear_bit(key->hw_key_idx, common->keymap);
588 clear_bit(key->hw_key_idx, common->ccmp_keymap);
585 if (key->cipher != WLAN_CIPHER_SUITE_TKIP) 589 if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
586 return; 590 return;
587 591
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index acd03a4f9730..1b988f26bdf1 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3767,7 +3767,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
3767 if (prev_status >= B43_STAT_STARTED) { 3767 if (prev_status >= B43_STAT_STARTED) {
3768 err = b43_wireless_core_start(up_dev); 3768 err = b43_wireless_core_start(up_dev);
3769 if (err) { 3769 if (err) {
3770 b43err(wl, "Fatal: Coult not start device for " 3770 b43err(wl, "Fatal: Could not start device for "
3771 "selected %s-GHz band\n", 3771 "selected %s-GHz band\n",
3772 band_to_string(chan->band)); 3772 band_to_string(chan->band));
3773 b43_wireless_core_exit(up_dev); 3773 b43_wireless_core_exit(up_dev);
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index f1f8bd09bd87..c8baf020c20f 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -1072,7 +1072,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
1072 meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); 1072 meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
1073 /* create a bounce buffer in zone_dma on mapping failure. */ 1073 /* create a bounce buffer in zone_dma on mapping failure. */
1074 if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { 1074 if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
1075 bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); 1075 bounce_skb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA);
1076 if (!bounce_skb) { 1076 if (!bounce_skb) {
1077 ring->current_slot = old_top_slot; 1077 ring->current_slot = old_top_slot;
1078 ring->used_slots = old_used_slots; 1078 ring->used_slots = old_used_slots;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index cd9c9bc186d9..eae691e2f7dd 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2633,7 +2633,7 @@ static int b43legacy_switch_phymode(struct b43legacy_wl *wl,
2633 if (prev_status >= B43legacy_STAT_STARTED) { 2633 if (prev_status >= B43legacy_STAT_STARTED) {
2634 err = b43legacy_wireless_core_start(up_dev); 2634 err = b43legacy_wireless_core_start(up_dev);
2635 if (err) { 2635 if (err) {
2636 b43legacyerr(wl, "Fatal: Coult not start device for " 2636 b43legacyerr(wl, "Fatal: Could not start device for "
2637 "newly selected %s-PHY mode\n", 2637 "newly selected %s-PHY mode\n",
2638 phymode_to_string(new_mode)); 2638 phymode_to_string(new_mode));
2639 b43legacy_wireless_core_exit(up_dev); 2639 b43legacy_wireless_core_exit(up_dev);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 509301a5e7e2..ff5d689e13f3 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -3405,7 +3405,7 @@ il4965_remove_dynamic_key(struct il_priv *il,
3405 return 0; 3405 return 0;
3406 } 3406 }
3407 3407
3408 if (il->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { 3408 if (il->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_INVALID) {
3409 IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, 3409 IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx,
3410 key_flags); 3410 key_flags);
3411 spin_unlock_irqrestore(&il->sta_lock, flags); 3411 spin_unlock_irqrestore(&il->sta_lock, flags);
@@ -3420,7 +3420,7 @@ il4965_remove_dynamic_key(struct il_priv *il,
3420 memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); 3420 memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo));
3421 il->stations[sta_id].sta.key.key_flags = 3421 il->stations[sta_id].sta.key.key_flags =
3422 STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; 3422 STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID;
3423 il->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; 3423 il->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx;
3424 il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; 3424 il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
3425 il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 3425 il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
3426 3426
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index cbf2dc18341f..5d4807c2b56d 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4767,14 +4767,12 @@ il_bg_watchdog(unsigned long data)
4767 return; 4767 return;
4768 4768
4769 /* monitor and check for other stuck queues */ 4769 /* monitor and check for other stuck queues */
4770 if (il_is_any_associated(il)) { 4770 for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) {
4771 for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { 4771 /* skip as we already checked the command queue */
4772 /* skip as we already checked the command queue */ 4772 if (cnt == il->cmd_queue)
4773 if (cnt == il->cmd_queue) 4773 continue;
4774 continue; 4774 if (il_check_stuck_queue(il, cnt))
4775 if (il_check_stuck_queue(il, cnt)) 4775 return;
4776 return;
4777 }
4778 } 4776 }
4779 4777
4780 mod_timer(&il->watchdog, 4778 mod_timer(&il->watchdog,
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index e7c157e5ebeb..7f97dec8534d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2239,6 +2239,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file,
2239 return count; 2239 return count;
2240} 2240}
2241 2241
2242#ifdef CONFIG_IWLWIFI_DEBUG
2242static ssize_t iwl_dbgfs_log_event_read(struct file *file, 2243static ssize_t iwl_dbgfs_log_event_read(struct file *file,
2243 char __user *user_buf, 2244 char __user *user_buf,
2244 size_t count, loff_t *ppos) 2245 size_t count, loff_t *ppos)
@@ -2276,6 +2277,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
2276 2277
2277 return count; 2278 return count;
2278} 2279}
2280#endif
2279 2281
2280static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file, 2282static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file,
2281 char __user *user_buf, 2283 char __user *user_buf,
@@ -2345,7 +2347,9 @@ DEBUGFS_READ_FILE_OPS(bt_traffic);
2345DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); 2347DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
2346DEBUGFS_READ_FILE_OPS(reply_tx_error); 2348DEBUGFS_READ_FILE_OPS(reply_tx_error);
2347DEBUGFS_WRITE_FILE_OPS(echo_test); 2349DEBUGFS_WRITE_FILE_OPS(echo_test);
2350#ifdef CONFIG_IWLWIFI_DEBUG
2348DEBUGFS_READ_WRITE_FILE_OPS(log_event); 2351DEBUGFS_READ_WRITE_FILE_OPS(log_event);
2352#endif
2349DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled); 2353DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled);
2350 2354
2351/* 2355/*
@@ -2405,7 +2409,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2405 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 2409 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
2406 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 2410 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
2407 DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR); 2411 DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR);
2412#ifdef CONFIG_IWLWIFI_DEBUG
2408 DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR); 2413 DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR);
2414#endif
2409 2415
2410 if (iwl_advanced_bt_coexist(priv)) 2416 if (iwl_advanced_bt_coexist(priv))
2411 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); 2417 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index 3ee23134c02b..013680332f07 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -796,6 +796,18 @@ int iwlagn_mac_sta_state(struct ieee80211_hw *hw,
796 switch (op) { 796 switch (op) {
797 case ADD: 797 case ADD:
798 ret = iwlagn_mac_sta_add(hw, vif, sta); 798 ret = iwlagn_mac_sta_add(hw, vif, sta);
799 if (ret)
800 break;
801 /*
802 * Clear the in-progress flag, the AP station entry was added
803 * but we'll initialize LQ only when we've associated (which
804 * would also clear the in-progress flag). This is necessary
805 * in case we never initialize LQ because association fails.
806 */
807 spin_lock_bh(&priv->sta_lock);
808 priv->stations[iwl_sta_id(sta)].used &=
809 ~IWL_STA_UCODE_INPROGRESS;
810 spin_unlock_bh(&priv->sta_lock);
799 break; 811 break;
800 case REMOVE: 812 case REMOVE:
801 ret = iwlagn_mac_sta_remove(hw, vif, sta); 813 ret = iwlagn_mac_sta_remove(hw, vif, sta);
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index 9c44088054dd..900ee129e825 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -256,7 +256,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
256 else 256 else
257 last_seq = priv->rx_seq[tid]; 257 last_seq = priv->rx_seq[tid];
258 258
259 if (last_seq >= new_node->start_win) 259 if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM &&
260 last_seq >= new_node->start_win)
260 new_node->start_win = last_seq + 1; 261 new_node->start_win = last_seq + 1;
261 262
262 new_node->win_size = win_size; 263 new_node->win_size = win_size;
@@ -596,5 +597,5 @@ void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv)
596 spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags); 597 spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags);
597 598
598 INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr); 599 INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr);
599 memset(priv->rx_seq, 0, sizeof(priv->rx_seq)); 600 mwifiex_reset_11n_rx_seq_num(priv);
600} 601}
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.h b/drivers/net/wireless/mwifiex/11n_rxreorder.h
index f1bffebabc60..6c9815a0f5d8 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.h
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.h
@@ -37,6 +37,13 @@
37 37
38#define ADDBA_RSP_STATUS_ACCEPT 0 38#define ADDBA_RSP_STATUS_ACCEPT 0
39 39
40#define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff
41
42static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv)
43{
44 memset(priv->rx_seq, 0xff, sizeof(priv->rx_seq));
45}
46
40int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *, 47int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *,
41 u16 seqNum, 48 u16 seqNum,
42 u16 tid, u8 *ta, 49 u16 tid, u8 *ta,
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 015fec3371a0..5c7fd185373c 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -958,6 +958,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
958 case NL80211_HIDDEN_SSID_ZERO_CONTENTS: 958 case NL80211_HIDDEN_SSID_ZERO_CONTENTS:
959 /* firmware doesn't support this type of hidden SSID */ 959 /* firmware doesn't support this type of hidden SSID */
960 default: 960 default:
961 kfree(bss_cfg);
961 return -EINVAL; 962 return -EINVAL;
962 } 963 }
963 964
@@ -1484,7 +1485,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1484 struct wireless_dev *wdev; 1485 struct wireless_dev *wdev;
1485 1486
1486 if (!adapter) 1487 if (!adapter)
1487 return NULL; 1488 return ERR_PTR(-EFAULT);
1488 1489
1489 switch (type) { 1490 switch (type) {
1490 case NL80211_IFTYPE_UNSPECIFIED: 1491 case NL80211_IFTYPE_UNSPECIFIED:
@@ -1494,12 +1495,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1494 if (priv->bss_mode) { 1495 if (priv->bss_mode) {
1495 wiphy_err(wiphy, 1496 wiphy_err(wiphy,
1496 "cannot create multiple sta/adhoc ifaces\n"); 1497 "cannot create multiple sta/adhoc ifaces\n");
1497 return NULL; 1498 return ERR_PTR(-EINVAL);
1498 } 1499 }
1499 1500
1500 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); 1501 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
1501 if (!wdev) 1502 if (!wdev)
1502 return NULL; 1503 return ERR_PTR(-ENOMEM);
1503 1504
1504 wdev->wiphy = wiphy; 1505 wdev->wiphy = wiphy;
1505 priv->wdev = wdev; 1506 priv->wdev = wdev;
@@ -1522,12 +1523,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1522 1523
1523 if (priv->bss_mode) { 1524 if (priv->bss_mode) {
1524 wiphy_err(wiphy, "Can't create multiple AP interfaces"); 1525 wiphy_err(wiphy, "Can't create multiple AP interfaces");
1525 return NULL; 1526 return ERR_PTR(-EINVAL);
1526 } 1527 }
1527 1528
1528 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); 1529 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
1529 if (!wdev) 1530 if (!wdev)
1530 return NULL; 1531 return ERR_PTR(-ENOMEM);
1531 1532
1532 priv->wdev = wdev; 1533 priv->wdev = wdev;
1533 wdev->wiphy = wiphy; 1534 wdev->wiphy = wiphy;
@@ -1544,14 +1545,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1544 break; 1545 break;
1545 default: 1546 default:
1546 wiphy_err(wiphy, "type not supported\n"); 1547 wiphy_err(wiphy, "type not supported\n");
1547 return NULL; 1548 return ERR_PTR(-EINVAL);
1548 } 1549 }
1549 1550
1550 dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, 1551 dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name,
1551 ether_setup, 1); 1552 ether_setup, 1);
1552 if (!dev) { 1553 if (!dev) {
1553 wiphy_err(wiphy, "no memory available for netdevice\n"); 1554 wiphy_err(wiphy, "no memory available for netdevice\n");
1554 goto error; 1555 priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
1556 return ERR_PTR(-ENOMEM);
1555 } 1557 }
1556 1558
1557 mwifiex_init_priv_params(priv, dev); 1559 mwifiex_init_priv_params(priv, dev);
@@ -1582,7 +1584,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1582 /* Register network device */ 1584 /* Register network device */
1583 if (register_netdevice(dev)) { 1585 if (register_netdevice(dev)) {
1584 wiphy_err(wiphy, "cannot register virtual network device\n"); 1586 wiphy_err(wiphy, "cannot register virtual network device\n");
1585 goto error; 1587 free_netdev(dev);
1588 priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
1589 return ERR_PTR(-EFAULT);
1586 } 1590 }
1587 1591
1588 sema_init(&priv->async_sem, 1); 1592 sema_init(&priv->async_sem, 1);
@@ -1594,12 +1598,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1594 mwifiex_dev_debugfs_init(priv); 1598 mwifiex_dev_debugfs_init(priv);
1595#endif 1599#endif
1596 return dev; 1600 return dev;
1597error:
1598 if (dev && (dev->reg_state == NETREG_UNREGISTERED))
1599 free_netdev(dev);
1600 priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
1601
1602 return NULL;
1603} 1601}
1604EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); 1602EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
1605 1603
diff --git a/drivers/net/wireless/mwifiex/ie.c b/drivers/net/wireless/mwifiex/ie.c
index ceb82cd749cc..383820a52beb 100644
--- a/drivers/net/wireless/mwifiex/ie.c
+++ b/drivers/net/wireless/mwifiex/ie.c
@@ -213,6 +213,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv,
213 /* save assoc resp ie index after auto-indexing */ 213 /* save assoc resp ie index after auto-indexing */
214 *assoc_idx = *((u16 *)pos); 214 *assoc_idx = *((u16 *)pos);
215 215
216 kfree(ap_custom_ie);
216 return ret; 217 return ret;
217} 218}
218 219
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index e0377473282f..fc8a9bfa1248 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -978,10 +978,10 @@ static int mwifiex_decode_rx_packet(struct mwifiex_adapter *adapter,
978 dev_dbg(adapter->dev, "info: --- Rx: Event ---\n"); 978 dev_dbg(adapter->dev, "info: --- Rx: Event ---\n");
979 adapter->event_cause = *(u32 *) skb->data; 979 adapter->event_cause = *(u32 *) skb->data;
980 980
981 skb_pull(skb, MWIFIEX_EVENT_HEADER_LEN);
982
983 if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE)) 981 if ((skb->len > 0) && (skb->len < MAX_EVENT_SIZE))
984 memcpy(adapter->event_body, skb->data, skb->len); 982 memcpy(adapter->event_body,
983 skb->data + MWIFIEX_EVENT_HEADER_LEN,
984 skb->len);
985 985
986 /* event cause has been saved to adapter->event_cause */ 986 /* event cause has been saved to adapter->event_cause */
987 adapter->event_received = true; 987 adapter->event_received = true;
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 4ace5a3dcd23..11e731f3581c 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -406,9 +406,9 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
406 break; 406 break;
407 407
408 case EVENT_UAP_STA_ASSOC: 408 case EVENT_UAP_STA_ASSOC:
409 skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER);
410 memset(&sinfo, 0, sizeof(sinfo)); 409 memset(&sinfo, 0, sizeof(sinfo));
411 event = (struct mwifiex_assoc_event *)adapter->event_skb->data; 410 event = (struct mwifiex_assoc_event *)
411 (adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER);
412 if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { 412 if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) {
413 len = -1; 413 len = -1;
414 414
@@ -433,9 +433,8 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
433 GFP_KERNEL); 433 GFP_KERNEL);
434 break; 434 break;
435 case EVENT_UAP_STA_DEAUTH: 435 case EVENT_UAP_STA_DEAUTH:
436 skb_pull(adapter->event_skb, MWIFIEX_UAP_EVENT_EXTRA_HEADER); 436 cfg80211_del_sta(priv->netdev, adapter->event_body +
437 cfg80211_del_sta(priv->netdev, adapter->event_skb->data, 437 MWIFIEX_UAP_EVENT_EXTRA_HEADER, GFP_KERNEL);
438 GFP_KERNEL);
439 break; 438 break;
440 case EVENT_UAP_BSS_IDLE: 439 case EVENT_UAP_BSS_IDLE:
441 priv->media_connected = false; 440 priv->media_connected = false;
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index e2faec4db108..cecb27283196 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -161,15 +161,11 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
161 goto done; 161 goto done;
162 162
163 for (i = 0; i < adapter->priv_num; i++) { 163 for (i = 0; i < adapter->priv_num; i++) {
164
165 tpriv = adapter->priv[i]; 164 tpriv = adapter->priv[i];
166 165
167 if ((GET_BSS_ROLE(tpriv) == MWIFIEX_BSS_ROLE_STA) && 166 if (tpriv->media_connected &&
168 (tpriv->media_connected)) { 167 netif_queue_stopped(tpriv->netdev))
169 if (netif_queue_stopped(tpriv->netdev)) 168 mwifiex_wake_up_net_dev_queue(tpriv->netdev, adapter);
170 mwifiex_wake_up_net_dev_queue(tpriv->netdev,
171 adapter);
172 }
173 } 169 }
174done: 170done:
175 dev_kfree_skb_any(skb); 171 dev_kfree_skb_any(skb);
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c
index 8173ab66066d..89f9a2a45de3 100644
--- a/drivers/net/wireless/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/mwifiex/uap_cmd.c
@@ -27,6 +27,17 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
27 struct cfg80211_ap_settings *params) { 27 struct cfg80211_ap_settings *params) {
28 int i; 28 int i;
29 29
30 if (!params->privacy) {
31 bss_config->protocol = PROTOCOL_NO_SECURITY;
32 bss_config->key_mgmt = KEY_MGMT_NONE;
33 bss_config->wpa_cfg.length = 0;
34 priv->sec_info.wep_enabled = 0;
35 priv->sec_info.wpa_enabled = 0;
36 priv->sec_info.wpa2_enabled = 0;
37
38 return 0;
39 }
40
30 switch (params->auth_type) { 41 switch (params->auth_type) {
31 case NL80211_AUTHTYPE_OPEN_SYSTEM: 42 case NL80211_AUTHTYPE_OPEN_SYSTEM:
32 bss_config->auth_mode = WLAN_AUTH_OPEN; 43 bss_config->auth_mode = WLAN_AUTH_OPEN;
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c
index 49ebf20c56eb..22a5916564b8 100644
--- a/drivers/net/wireless/mwifiex/usb.c
+++ b/drivers/net/wireless/mwifiex/usb.c
@@ -49,6 +49,7 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
49 struct device *dev = adapter->dev; 49 struct device *dev = adapter->dev;
50 u32 recv_type; 50 u32 recv_type;
51 __le32 tmp; 51 __le32 tmp;
52 int ret;
52 53
53 if (adapter->hs_activated) 54 if (adapter->hs_activated)
54 mwifiex_process_hs_config(adapter); 55 mwifiex_process_hs_config(adapter);
@@ -69,16 +70,19 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
69 case MWIFIEX_USB_TYPE_CMD: 70 case MWIFIEX_USB_TYPE_CMD:
70 if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) { 71 if (skb->len > MWIFIEX_SIZE_OF_CMD_BUFFER) {
71 dev_err(dev, "CMD: skb->len too large\n"); 72 dev_err(dev, "CMD: skb->len too large\n");
72 return -1; 73 ret = -1;
74 goto exit_restore_skb;
73 } else if (!adapter->curr_cmd) { 75 } else if (!adapter->curr_cmd) {
74 dev_dbg(dev, "CMD: no curr_cmd\n"); 76 dev_dbg(dev, "CMD: no curr_cmd\n");
75 if (adapter->ps_state == PS_STATE_SLEEP_CFM) { 77 if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
76 mwifiex_process_sleep_confirm_resp( 78 mwifiex_process_sleep_confirm_resp(
77 adapter, skb->data, 79 adapter, skb->data,
78 skb->len); 80 skb->len);
79 return 0; 81 ret = 0;
82 goto exit_restore_skb;
80 } 83 }
81 return -1; 84 ret = -1;
85 goto exit_restore_skb;
82 } 86 }
83 87
84 adapter->curr_cmd->resp_skb = skb; 88 adapter->curr_cmd->resp_skb = skb;
@@ -87,20 +91,22 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
87 case MWIFIEX_USB_TYPE_EVENT: 91 case MWIFIEX_USB_TYPE_EVENT:
88 if (skb->len < sizeof(u32)) { 92 if (skb->len < sizeof(u32)) {
89 dev_err(dev, "EVENT: skb->len too small\n"); 93 dev_err(dev, "EVENT: skb->len too small\n");
90 return -1; 94 ret = -1;
95 goto exit_restore_skb;
91 } 96 }
92 skb_copy_from_linear_data(skb, &tmp, sizeof(u32)); 97 skb_copy_from_linear_data(skb, &tmp, sizeof(u32));
93 adapter->event_cause = le32_to_cpu(tmp); 98 adapter->event_cause = le32_to_cpu(tmp);
94 skb_pull(skb, sizeof(u32));
95 dev_dbg(dev, "event_cause %#x\n", adapter->event_cause); 99 dev_dbg(dev, "event_cause %#x\n", adapter->event_cause);
96 100
97 if (skb->len > MAX_EVENT_SIZE) { 101 if (skb->len > MAX_EVENT_SIZE) {
98 dev_err(dev, "EVENT: event body too large\n"); 102 dev_err(dev, "EVENT: event body too large\n");
99 return -1; 103 ret = -1;
104 goto exit_restore_skb;
100 } 105 }
101 106
102 skb_copy_from_linear_data(skb, adapter->event_body, 107 memcpy(adapter->event_body, skb->data +
103 skb->len); 108 MWIFIEX_EVENT_HEADER_LEN, skb->len);
109
104 adapter->event_received = true; 110 adapter->event_received = true;
105 adapter->event_skb = skb; 111 adapter->event_skb = skb;
106 break; 112 break;
@@ -124,6 +130,12 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
124 } 130 }
125 131
126 return -EINPROGRESS; 132 return -EINPROGRESS;
133
134exit_restore_skb:
135 /* The buffer will be reused for further cmds/events */
136 skb_push(skb, INTF_HEADER_LEN);
137
138 return ret;
127} 139}
128 140
129static void mwifiex_usb_rx_complete(struct urb *urb) 141static void mwifiex_usb_rx_complete(struct urb *urb)
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index f3fc65515857..3fa4d4176993 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -404,6 +404,8 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter)
404 priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; 404 priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE;
405 priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE; 405 priv->add_ba_param.rx_win_size = MWIFIEX_AMPDU_DEF_RXWINSIZE;
406 406
407 mwifiex_reset_11n_rx_seq_num(priv);
408
407 atomic_set(&priv->wmm.tx_pkts_queued, 0); 409 atomic_set(&priv->wmm.tx_pkts_queued, 0);
408 atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID); 410 atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID);
409 } 411 }
@@ -1221,6 +1223,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
1221 1223
1222 if (!ptr->is_11n_enabled || 1224 if (!ptr->is_11n_enabled ||
1223 mwifiex_is_ba_stream_setup(priv, ptr, tid) || 1225 mwifiex_is_ba_stream_setup(priv, ptr, tid) ||
1226 priv->wps.session_enable ||
1224 ((priv->sec_info.wpa_enabled || 1227 ((priv->sec_info.wpa_enabled ||
1225 priv->sec_info.wpa2_enabled) && 1228 priv->sec_info.wpa2_enabled) &&
1226 !priv->wpa_is_gtk_set)) { 1229 !priv->wpa_is_gtk_set)) {
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 2e9e6af21362..dfcd02ab6cae 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2110,7 +2110,7 @@ resize_buf:
2110 while (check_bssid_list_item(bssid, bssid_len, buf, len)) { 2110 while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
2111 if (rndis_bss_info_update(usbdev, bssid) && match_bssid && 2111 if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
2112 matched) { 2112 matched) {
2113 if (!ether_addr_equal(bssid->mac, match_bssid)) 2113 if (ether_addr_equal(bssid->mac, match_bssid))
2114 *matched = true; 2114 *matched = true;
2115 } 2115 }
2116 2116
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index d357d1ed92f6..74ecc33fdd90 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue)
436 case QID_RX: 436 case QID_RX:
437 if (!rt2x00queue_full(queue)) 437 if (!rt2x00queue_full(queue))
438 rt2x00queue_for_each_entry(queue, 438 rt2x00queue_for_each_entry(queue,
439 Q_INDEX_DONE,
440 Q_INDEX, 439 Q_INDEX,
440 Q_INDEX_DONE,
441 NULL, 441 NULL,
442 rt2x00usb_kick_rx_entry); 442 rt2x00usb_kick_rx_entry);
443 break; 443 break;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index d228358e6a40..9970c2b1b199 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -301,9 +301,11 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
301 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ 301 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
302 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ 302 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
303 {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ 303 {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/
304 {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
304 {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ 305 {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
305 {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ 306 {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
306 {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ 307 {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
308 {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/
307 /* HP - Lite-On ,8188CUS Slim Combo */ 309 /* HP - Lite-On ,8188CUS Slim Combo */
308 {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, 310 {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)},
309 {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */ 311 {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */
@@ -346,6 +348,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
346 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ 348 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
347 {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ 349 {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/
348 {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ 350 {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
351 {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/
349 {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/ 352 {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
350 {RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/ 353 {RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/
351 {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ 354 {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/
diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c
index ad87a1ac6462..db6430c1a084 100644
--- a/drivers/net/wireless/ti/wl1251/acx.c
+++ b/drivers/net/wireless/ti/wl1251/acx.c
@@ -869,7 +869,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime)
869 } 869 }
870 870
871 *mactime = tsf_info->current_tsf_lsb | 871 *mactime = tsf_info->current_tsf_lsb |
872 (tsf_info->current_tsf_msb << 31); 872 ((u64)tsf_info->current_tsf_msb << 32);
873 873
874out: 874out:
875 kfree(tsf_info); 875 kfree(tsf_info);
diff --git a/drivers/net/wireless/ti/wl1251/event.c b/drivers/net/wireless/ti/wl1251/event.c
index 9f15ccaf8f05..5ec50a476a69 100644
--- a/drivers/net/wireless/ti/wl1251/event.c
+++ b/drivers/net/wireless/ti/wl1251/event.c
@@ -76,8 +76,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
76 } 76 }
77 } 77 }
78 78
79 if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID && 79 if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) {
80 wl->station_mode != STATION_ACTIVE_MODE) {
81 wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT"); 80 wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
82 81
83 /* indicate to the stack, that beacons have been lost */ 82 /* indicate to the stack, that beacons have been lost */
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 87f6305bda2c..567660cd2fcd 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -73,6 +73,8 @@ static void wl1251_spi_reset(struct wl1251 *wl)
73 spi_sync(wl_to_spi(wl), &m); 73 spi_sync(wl_to_spi(wl), &m);
74 74
75 wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); 75 wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
76
77 kfree(cmd);
76} 78}
77 79
78static void wl1251_spi_wake(struct wl1251 *wl) 80static void wl1251_spi_wake(struct wl1251 *wl)
@@ -127,6 +129,8 @@ static void wl1251_spi_wake(struct wl1251 *wl)
127 spi_sync(wl_to_spi(wl), &m); 129 spi_sync(wl_to_spi(wl), &m);
128 130
129 wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN); 131 wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN);
132
133 kfree(cmd);
130} 134}
131 135
132static void wl1251_spi_reset_wake(struct wl1251 *wl) 136static void wl1251_spi_reset_wake(struct wl1251 *wl)
diff --git a/drivers/net/wireless/ti/wlcore/Kconfig b/drivers/net/wireless/ti/wlcore/Kconfig
index 54156b0b5c2d..d7b907e67170 100644
--- a/drivers/net/wireless/ti/wlcore/Kconfig
+++ b/drivers/net/wireless/ti/wlcore/Kconfig
@@ -1,7 +1,6 @@
1config WLCORE 1config WLCORE
2 tristate "TI wlcore support" 2 tristate "TI wlcore support"
3 depends on WL_TI && GENERIC_HARDIRQS && MAC80211 3 depends on WL_TI && GENERIC_HARDIRQS && MAC80211
4 depends on INET
5 select FW_LOADER 4 select FW_LOADER
6 ---help--- 5 ---help---
7 This module contains the main code for TI WLAN chips. It abstracts 6 This module contains the main code for TI WLAN chips. It abstracts
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 2027afe405fe..30899901aef5 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1935,14 +1935,14 @@ static int __devexit xennet_remove(struct xenbus_device *dev)
1935 1935
1936 dev_dbg(&dev->dev, "%s\n", dev->nodename); 1936 dev_dbg(&dev->dev, "%s\n", dev->nodename);
1937 1937
1938 unregister_netdev(info->netdev);
1939
1940 xennet_disconnect_backend(info); 1938 xennet_disconnect_backend(info);
1941 1939
1942 del_timer_sync(&info->rx_refill_timer);
1943
1944 xennet_sysfs_delif(info->netdev); 1940 xennet_sysfs_delif(info->netdev);
1945 1941
1942 unregister_netdev(info->netdev);
1943
1944 del_timer_sync(&info->rx_refill_timer);
1945
1946 free_percpu(info->stats); 1946 free_percpu(info->stats);
1947 1947
1948 free_netdev(info->netdev); 1948 free_netdev(info->netdev);