aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/appletalk/cops.c4
-rw-r--r--drivers/net/appletalk/ltpc.c4
-rw-r--r--drivers/net/bonding/bond_main.c12
-rw-r--r--drivers/net/cris/eth_v10.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c72
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c1
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c2
-rw-r--r--drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c4
-rw-r--r--drivers/net/ethernet/freescale/fs_enet/mii-fec.c8
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.c10
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c36
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c16
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_regs.h8
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c28
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c19
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_tx.c17
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/icm.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/icm.h2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mcg.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h1
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mr.c27
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/profile.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/sense.c14
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c13
-rw-r--r--drivers/net/ethernet/renesas/Kconfig4
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c11
-rw-r--r--drivers/net/ethernet/sfc/efx.c6
-rw-r--r--drivers/net/ethernet/sfc/efx.h14
-rw-r--r--drivers/net/ethernet/sfc/ethtool.c16
-rw-r--r--drivers/net/ethernet/sfc/tx.c19
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c2
-rw-r--r--drivers/net/ethernet/ti/davinci_cpdma.c3
-rw-r--r--drivers/net/ethernet/xscale/ixp4xx_eth.c1
-rw-r--r--drivers/net/hyperv/netvsc.c7
-rw-r--r--drivers/net/hyperv/rndis_filter.c11
-rw-r--r--drivers/net/irda/bfin_sir.c8
-rw-r--r--drivers/net/irda/ks959-sir.c1
-rw-r--r--drivers/net/irda/ksdazzle-sir.c1
-rw-r--r--drivers/net/macvtap.c3
-rw-r--r--drivers/net/netconsole.c6
-rw-r--r--drivers/net/phy/mdio-mux-gpio.c1
-rw-r--r--drivers/net/phy/mdio-mux.c2
-rw-r--r--drivers/net/ppp/pptp.c4
-rw-r--r--drivers/net/team/team.c16
-rw-r--r--drivers/net/tun.c1
-rw-r--r--drivers/net/usb/cdc-phonet.c1
-rw-r--r--drivers/net/usb/cdc_ncm.c20
-rw-r--r--drivers/net/usb/qmi_wwan.c251
-rw-r--r--drivers/net/usb/sierra_net.c52
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c2
-rw-r--r--drivers/net/wan/dscc4.c5
-rw-r--r--drivers/net/wimax/i2400m/fw.c4
-rw-r--r--drivers/net/wireless/at76c50x-usb.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c6
-rw-r--r--drivers/net/wireless/ath/ath5k/mac80211-ops.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
-rw-r--r--drivers/net/wireless/b43/main.c21
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/channel.c5
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c3
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rs.c13
-rw-r--r--drivers/net/wireless/libertas/cfg.c1
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c1
-rw-r--r--drivers/net/wireless/libertas/main.c5
-rw-r--r--drivers/net/wireless/p54/p54usb.c2
-rw-r--r--drivers/net/wireless/rndis_wlan.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c68
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c71
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c3
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c2
81 files changed, 467 insertions, 583 deletions
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index 545c09ed9079..cff6f023c03a 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -996,9 +996,7 @@ static int __init cops_module_init(void)
996 printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n", 996 printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n",
997 cardname); 997 cardname);
998 cops_dev = cops_probe(-1); 998 cops_dev = cops_probe(-1);
999 if (IS_ERR(cops_dev)) 999 return PTR_RET(cops_dev);
1000 return PTR_ERR(cops_dev);
1001 return 0;
1002} 1000}
1003 1001
1004static void __exit cops_module_exit(void) 1002static void __exit cops_module_exit(void)
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 0910dce3996d..b5782cdf0bca 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -1243,9 +1243,7 @@ static int __init ltpc_module_init(void)
1243 "ltpc: Autoprobing is not recommended for modules\n"); 1243 "ltpc: Autoprobing is not recommended for modules\n");
1244 1244
1245 dev_ltpc = ltpc_probe(); 1245 dev_ltpc = ltpc_probe();
1246 if (IS_ERR(dev_ltpc)) 1246 return PTR_RET(dev_ltpc);
1247 return PTR_ERR(dev_ltpc);
1248 return 0;
1249} 1247}
1250module_init(ltpc_module_init); 1248module_init(ltpc_module_init);
1251#endif 1249#endif
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6fae5f3ec7f6..d688a8af432c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -398,7 +398,7 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
398 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping)); 398 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
399 skb->queue_mapping = qdisc_skb_cb(skb)->slave_dev_queue_mapping; 399 skb->queue_mapping = qdisc_skb_cb(skb)->slave_dev_queue_mapping;
400 400
401 if (unlikely(netpoll_tx_running(slave_dev))) 401 if (unlikely(netpoll_tx_running(bond->dev)))
402 bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); 402 bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
403 else 403 else
404 dev_queue_xmit(skb); 404 dev_queue_xmit(skb);
@@ -1235,12 +1235,12 @@ static inline int slave_enable_netpoll(struct slave *slave)
1235 struct netpoll *np; 1235 struct netpoll *np;
1236 int err = 0; 1236 int err = 0;
1237 1237
1238 np = kzalloc(sizeof(*np), GFP_KERNEL); 1238 np = kzalloc(sizeof(*np), GFP_ATOMIC);
1239 err = -ENOMEM; 1239 err = -ENOMEM;
1240 if (!np) 1240 if (!np)
1241 goto out; 1241 goto out;
1242 1242
1243 err = __netpoll_setup(np, slave->dev); 1243 err = __netpoll_setup(np, slave->dev, GFP_ATOMIC);
1244 if (err) { 1244 if (err) {
1245 kfree(np); 1245 kfree(np);
1246 goto out; 1246 goto out;
@@ -1257,9 +1257,7 @@ static inline void slave_disable_netpoll(struct slave *slave)
1257 return; 1257 return;
1258 1258
1259 slave->np = NULL; 1259 slave->np = NULL;
1260 synchronize_rcu_bh(); 1260 __netpoll_free_rcu(np);
1261 __netpoll_cleanup(np);
1262 kfree(np);
1263} 1261}
1264static inline bool slave_dev_support_netpoll(struct net_device *slave_dev) 1262static inline bool slave_dev_support_netpoll(struct net_device *slave_dev)
1265{ 1263{
@@ -1292,7 +1290,7 @@ static void bond_netpoll_cleanup(struct net_device *bond_dev)
1292 read_unlock(&bond->lock); 1290 read_unlock(&bond->lock);
1293} 1291}
1294 1292
1295static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni) 1293static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni, gfp_t gfp)
1296{ 1294{
1297 struct bonding *bond = netdev_priv(dev); 1295 struct bonding *bond = netdev_priv(dev);
1298 struct slave *slave; 1296 struct slave *slave;
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index f0c8bd54ce29..021d69c5d9bc 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1712,7 +1712,7 @@ e100_set_network_leds(int active)
1712static void 1712static void
1713e100_netpoll(struct net_device* netdev) 1713e100_netpoll(struct net_device* netdev)
1714{ 1714{
1715 e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev, NULL); 1715 e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev);
1716} 1716}
1717#endif 1717#endif
1718 1718
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 77bcd4cb4ffb..463b9ec57d80 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1278,7 +1278,7 @@ struct bnx2x {
1278#define BNX2X_FW_RX_ALIGN_START (1UL << BNX2X_RX_ALIGN_SHIFT) 1278#define BNX2X_FW_RX_ALIGN_START (1UL << BNX2X_RX_ALIGN_SHIFT)
1279 1279
1280#define BNX2X_FW_RX_ALIGN_END \ 1280#define BNX2X_FW_RX_ALIGN_END \
1281 max(1UL << BNX2X_RX_ALIGN_SHIFT, \ 1281 max_t(u64, 1UL << BNX2X_RX_ALIGN_SHIFT, \
1282 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 1282 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
1283 1283
1284#define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5) 1284#define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index dd451c3dd83d..02b5a343b195 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -4041,20 +4041,6 @@ static bool bnx2x_get_load_status(struct bnx2x *bp, int engine)
4041 return val != 0; 4041 return val != 0;
4042} 4042}
4043 4043
4044/*
4045 * Reset the load status for the current engine.
4046 */
4047static void bnx2x_clear_load_status(struct bnx2x *bp)
4048{
4049 u32 val;
4050 u32 mask = (BP_PATH(bp) ? BNX2X_PATH1_LOAD_CNT_MASK :
4051 BNX2X_PATH0_LOAD_CNT_MASK);
4052 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_RECOVERY_REG);
4053 val = REG_RD(bp, BNX2X_RECOVERY_GLOB_REG);
4054 REG_WR(bp, BNX2X_RECOVERY_GLOB_REG, val & (~mask));
4055 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RECOVERY_REG);
4056}
4057
4058static void _print_next_block(int idx, const char *blk) 4044static void _print_next_block(int idx, const char *blk)
4059{ 4045{
4060 pr_cont("%s%s", idx ? ", " : "", blk); 4046 pr_cont("%s%s", idx ? ", " : "", blk);
@@ -9384,32 +9370,24 @@ static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp)
9384 return rc; 9370 return rc;
9385} 9371}
9386 9372
9387static bool __devinit bnx2x_can_flr(struct bnx2x *bp)
9388{
9389 int pos;
9390 u32 cap;
9391 struct pci_dev *dev = bp->pdev;
9392
9393 pos = pci_pcie_cap(dev);
9394 if (!pos)
9395 return false;
9396
9397 pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP, &cap);
9398 if (!(cap & PCI_EXP_DEVCAP_FLR))
9399 return false;
9400
9401 return true;
9402}
9403
9404static int __devinit bnx2x_do_flr(struct bnx2x *bp) 9373static int __devinit bnx2x_do_flr(struct bnx2x *bp)
9405{ 9374{
9406 int i, pos; 9375 int i, pos;
9407 u16 status; 9376 u16 status;
9408 struct pci_dev *dev = bp->pdev; 9377 struct pci_dev *dev = bp->pdev;
9409 9378
9410 /* probe the capability first */ 9379
9411 if (bnx2x_can_flr(bp)) 9380 if (CHIP_IS_E1x(bp)) {
9412 return -ENOTTY; 9381 BNX2X_DEV_INFO("FLR not supported in E1/E1H\n");
9382 return -EINVAL;
9383 }
9384
9385 /* only bootcode REQ_BC_VER_4_INITIATE_FLR and onwards support flr */
9386 if (bp->common.bc_ver < REQ_BC_VER_4_INITIATE_FLR) {
9387 BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n",
9388 bp->common.bc_ver);
9389 return -EINVAL;
9390 }
9413 9391
9414 pos = pci_pcie_cap(dev); 9392 pos = pci_pcie_cap(dev);
9415 if (!pos) 9393 if (!pos)
@@ -9429,12 +9407,8 @@ static int __devinit bnx2x_do_flr(struct bnx2x *bp)
9429 "transaction is not cleared; proceeding with reset anyway\n"); 9407 "transaction is not cleared; proceeding with reset anyway\n");
9430 9408
9431clear: 9409clear:
9432 if (bp->common.bc_ver < REQ_BC_VER_4_INITIATE_FLR) {
9433 BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n",
9434 bp->common.bc_ver);
9435 return -EINVAL;
9436 }
9437 9410
9411 BNX2X_DEV_INFO("Initiating FLR\n");
9438 bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0); 9412 bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0);
9439 9413
9440 return 0; 9414 return 0;
@@ -9454,8 +9428,21 @@ static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp)
9454 * the one required, then FLR will be sufficient to clean any residue 9428 * the one required, then FLR will be sufficient to clean any residue
9455 * left by previous driver 9429 * left by previous driver
9456 */ 9430 */
9457 if (bnx2x_test_firmware_version(bp, false) && bnx2x_can_flr(bp)) 9431 rc = bnx2x_test_firmware_version(bp, false);
9458 return bnx2x_do_flr(bp); 9432
9433 if (!rc) {
9434 /* fw version is good */
9435 BNX2X_DEV_INFO("FW version matches our own. Attempting FLR\n");
9436 rc = bnx2x_do_flr(bp);
9437 }
9438
9439 if (!rc) {
9440 /* FLR was performed */
9441 BNX2X_DEV_INFO("FLR successful\n");
9442 return 0;
9443 }
9444
9445 BNX2X_DEV_INFO("Could not FLR\n");
9459 9446
9460 /* Close the MCP request, return failure*/ 9447 /* Close the MCP request, return failure*/
9461 rc = bnx2x_prev_mcp_done(bp); 9448 rc = bnx2x_prev_mcp_done(bp);
@@ -11427,9 +11414,6 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
11427 if (!chip_is_e1x) 11414 if (!chip_is_e1x)
11428 REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ, 1); 11415 REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ, 1);
11429 11416
11430 /* Reset the load counter */
11431 bnx2x_clear_load_status(bp);
11432
11433 dev->watchdog_timeo = TX_TIMEOUT; 11417 dev->watchdog_timeo = TX_TIMEOUT;
11434 11418
11435 dev->netdev_ops = &bnx2x_netdev_ops; 11419 dev->netdev_ops = &bnx2x_netdev_ops;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 734fd87cd990..62f754bd0dfe 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -2485,6 +2485,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
2485 break; 2485 break;
2486 2486
2487 default: 2487 default:
2488 kfree(new_cmd);
2488 BNX2X_ERR("Unknown command: %d\n", cmd); 2489 BNX2X_ERR("Unknown command: %d\n", cmd);
2489 return -EINVAL; 2490 return -EINVAL;
2490 } 2491 }
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index c60de89b6669..90a903d83d87 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1948,7 +1948,7 @@ static int be_rx_cqs_create(struct be_adapter *adapter)
1948 1948
1949 if (adapter->num_rx_qs != MAX_RX_QS) 1949 if (adapter->num_rx_qs != MAX_RX_QS)
1950 dev_info(&adapter->pdev->dev, 1950 dev_info(&adapter->pdev->dev,
1951 "Created only %d receive queues", adapter->num_rx_qs); 1951 "Created only %d receive queues\n", adapter->num_rx_qs);
1952 1952
1953 return 0; 1953 return 0;
1954} 1954}
diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
index 0f2d1a710909..151453309401 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
@@ -174,8 +174,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
174 174
175 new_bus->phy_mask = ~0; 175 new_bus->phy_mask = ~0;
176 new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); 176 new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
177 if (!new_bus->irq) 177 if (!new_bus->irq) {
178 ret = -ENOMEM;
178 goto out_unmap_regs; 179 goto out_unmap_regs;
180 }
179 181
180 new_bus->parent = &ofdev->dev; 182 new_bus->parent = &ofdev->dev;
181 dev_set_drvdata(&ofdev->dev, new_bus); 183 dev_set_drvdata(&ofdev->dev, new_bus);
diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
index 55bb867258e6..cdf702a59485 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
@@ -137,8 +137,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
137 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); 137 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
138 138
139 fec->fecp = ioremap(res.start, resource_size(&res)); 139 fec->fecp = ioremap(res.start, resource_size(&res));
140 if (!fec->fecp) 140 if (!fec->fecp) {
141 ret = -ENOMEM;
141 goto out_fec; 142 goto out_fec;
143 }
142 144
143 if (get_bus_freq) { 145 if (get_bus_freq) {
144 clock = get_bus_freq(ofdev->dev.of_node); 146 clock = get_bus_freq(ofdev->dev.of_node);
@@ -172,8 +174,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
172 174
173 new_bus->phy_mask = ~0; 175 new_bus->phy_mask = ~0;
174 new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); 176 new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
175 if (!new_bus->irq) 177 if (!new_bus->irq) {
178 ret = -ENOMEM;
176 goto out_unmap_regs; 179 goto out_unmap_regs;
180 }
177 181
178 new_bus->parent = &ofdev->dev; 182 new_bus->parent = &ofdev->dev;
179 dev_set_drvdata(&ofdev->dev, new_bus); 183 dev_set_drvdata(&ofdev->dev, new_bus);
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 0b3bade957fd..080c89093feb 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -999,7 +999,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
999 **/ 999 **/
1000static s32 e1000_reset_hw_82571(struct e1000_hw *hw) 1000static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
1001{ 1001{
1002 u32 ctrl, ctrl_ext, eecd; 1002 u32 ctrl, ctrl_ext, eecd, tctl;
1003 s32 ret_val; 1003 s32 ret_val;
1004 1004
1005 /* 1005 /*
@@ -1014,7 +1014,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
1014 ew32(IMC, 0xffffffff); 1014 ew32(IMC, 0xffffffff);
1015 1015
1016 ew32(RCTL, 0); 1016 ew32(RCTL, 0);
1017 ew32(TCTL, E1000_TCTL_PSP); 1017 tctl = er32(TCTL);
1018 tctl &= ~E1000_TCTL_EN;
1019 ew32(TCTL, tctl);
1018 e1e_flush(); 1020 e1e_flush();
1019 1021
1020 usleep_range(10000, 20000); 1022 usleep_range(10000, 20000);
@@ -1601,10 +1603,8 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
1601 * auto-negotiation in the TXCW register and disable 1603 * auto-negotiation in the TXCW register and disable
1602 * forced link in the Device Control register in an 1604 * forced link in the Device Control register in an
1603 * attempt to auto-negotiate with our link partner. 1605 * attempt to auto-negotiate with our link partner.
1604 * If the partner code word is null, stop forcing
1605 * and restart auto negotiation.
1606 */ 1606 */
1607 if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) { 1607 if (rxcw & E1000_RXCW_C) {
1608 /* Enable autoneg, and unforce link up */ 1608 /* Enable autoneg, and unforce link up */
1609 ew32(TXCW, mac->txcw); 1609 ew32(TXCW, mac->txcw);
1610 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); 1610 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 95b245310f17..46c3b1f9ff89 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -178,6 +178,24 @@ static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
178 pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]); 178 pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]);
179} 179}
180 180
181static void e1000e_dump_ps_pages(struct e1000_adapter *adapter,
182 struct e1000_buffer *bi)
183{
184 int i;
185 struct e1000_ps_page *ps_page;
186
187 for (i = 0; i < adapter->rx_ps_pages; i++) {
188 ps_page = &bi->ps_pages[i];
189
190 if (ps_page->page) {
191 pr_info("packet dump for ps_page %d:\n", i);
192 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS,
193 16, 1, page_address(ps_page->page),
194 PAGE_SIZE, true);
195 }
196 }
197}
198
181/* 199/*
182 * e1000e_dump - Print registers, Tx-ring and Rx-ring 200 * e1000e_dump - Print registers, Tx-ring and Rx-ring
183 */ 201 */
@@ -299,10 +317,10 @@ static void e1000e_dump(struct e1000_adapter *adapter)
299 (unsigned long long)buffer_info->time_stamp, 317 (unsigned long long)buffer_info->time_stamp,
300 buffer_info->skb, next_desc); 318 buffer_info->skb, next_desc);
301 319
302 if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) 320 if (netif_msg_pktdata(adapter) && buffer_info->skb)
303 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 321 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS,
304 16, 1, phys_to_virt(buffer_info->dma), 322 16, 1, buffer_info->skb->data,
305 buffer_info->length, true); 323 buffer_info->skb->len, true);
306 } 324 }
307 325
308 /* Print Rx Ring Summary */ 326 /* Print Rx Ring Summary */
@@ -381,10 +399,8 @@ rx_ring_summary:
381 buffer_info->skb, next_desc); 399 buffer_info->skb, next_desc);
382 400
383 if (netif_msg_pktdata(adapter)) 401 if (netif_msg_pktdata(adapter))
384 print_hex_dump(KERN_INFO, "", 402 e1000e_dump_ps_pages(adapter,
385 DUMP_PREFIX_ADDRESS, 16, 1, 403 buffer_info);
386 phys_to_virt(buffer_info->dma),
387 adapter->rx_ps_bsize0, true);
388 } 404 }
389 } 405 }
390 break; 406 break;
@@ -444,12 +460,12 @@ rx_ring_summary:
444 (unsigned long long)buffer_info->dma, 460 (unsigned long long)buffer_info->dma,
445 buffer_info->skb, next_desc); 461 buffer_info->skb, next_desc);
446 462
447 if (netif_msg_pktdata(adapter)) 463 if (netif_msg_pktdata(adapter) &&
464 buffer_info->skb)
448 print_hex_dump(KERN_INFO, "", 465 print_hex_dump(KERN_INFO, "",
449 DUMP_PREFIX_ADDRESS, 16, 466 DUMP_PREFIX_ADDRESS, 16,
450 1, 467 1,
451 phys_to_virt 468 buffer_info->skb->data,
452 (buffer_info->dma),
453 adapter->rx_buffer_len, 469 adapter->rx_buffer_len,
454 true); 470 true);
455 } 471 }
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 5e84eaac48c1..ba994fb4cec6 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -254,6 +254,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
254 */ 254 */
255 size += NVM_WORD_SIZE_BASE_SHIFT; 255 size += NVM_WORD_SIZE_BASE_SHIFT;
256 256
257 /*
258 * Check for invalid size
259 */
260 if ((hw->mac.type == e1000_82576) && (size > 15)) {
261 pr_notice("The NVM size is not valid, defaulting to 32K\n");
262 size = 15;
263 }
264
257 nvm->word_size = 1 << size; 265 nvm->word_size = 1 << size;
258 if (hw->mac.type < e1000_i210) { 266 if (hw->mac.type < e1000_i210) {
259 nvm->opcode_bits = 8; 267 nvm->opcode_bits = 8;
@@ -281,14 +289,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
281 } else 289 } else
282 nvm->type = e1000_nvm_flash_hw; 290 nvm->type = e1000_nvm_flash_hw;
283 291
284 /*
285 * Check for invalid size
286 */
287 if ((hw->mac.type == e1000_82576) && (size > 15)) {
288 pr_notice("The NVM size is not valid, defaulting to 32K\n");
289 size = 15;
290 }
291
292 /* NVM Function Pointers */ 292 /* NVM Function Pointers */
293 switch (hw->mac.type) { 293 switch (hw->mac.type) {
294 case e1000_82580: 294 case e1000_82580:
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index 10efcd88dca0..28394bea5253 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -156,8 +156,12 @@
156 : (0x0E018 + ((_n) * 0x40))) 156 : (0x0E018 + ((_n) * 0x40)))
157#define E1000_TXDCTL(_n) ((_n) < 4 ? (0x03828 + ((_n) * 0x100)) \ 157#define E1000_TXDCTL(_n) ((_n) < 4 ? (0x03828 + ((_n) * 0x100)) \
158 : (0x0E028 + ((_n) * 0x40))) 158 : (0x0E028 + ((_n) * 0x40)))
159#define E1000_DCA_TXCTRL(_n) (0x03814 + (_n << 8)) 159#define E1000_RXCTL(_n) ((_n) < 4 ? (0x02814 + ((_n) * 0x100)) : \
160#define E1000_DCA_RXCTRL(_n) (0x02814 + (_n << 8)) 160 (0x0C014 + ((_n) * 0x40)))
161#define E1000_DCA_RXCTRL(_n) E1000_RXCTL(_n)
162#define E1000_TXCTL(_n) ((_n) < 4 ? (0x03814 + ((_n) * 0x100)) : \
163 (0x0E014 + ((_n) * 0x40)))
164#define E1000_DCA_TXCTRL(_n) E1000_TXCTL(_n)
161#define E1000_TDWBAL(_n) ((_n) < 4 ? (0x03838 + ((_n) * 0x100)) \ 165#define E1000_TDWBAL(_n) ((_n) < 4 ? (0x03838 + ((_n) * 0x100)) \
162 : (0x0E038 + ((_n) * 0x40))) 166 : (0x0E038 + ((_n) * 0x40)))
163#define E1000_TDWBAH(_n) ((_n) < 4 ? (0x0383C + ((_n) * 0x100)) \ 167#define E1000_TDWBAH(_n) ((_n) < 4 ? (0x0383C + ((_n) * 0x100)) \
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index a19c84cad0e9..70591117051b 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -209,8 +209,8 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
209 /* When SoL/IDER sessions are active, autoneg/speed/duplex 209 /* When SoL/IDER sessions are active, autoneg/speed/duplex
210 * cannot be changed */ 210 * cannot be changed */
211 if (igb_check_reset_block(hw)) { 211 if (igb_check_reset_block(hw)) {
212 dev_err(&adapter->pdev->dev, "Cannot change link " 212 dev_err(&adapter->pdev->dev,
213 "characteristics when SoL/IDER is active.\n"); 213 "Cannot change link characteristics when SoL/IDER is active.\n");
214 return -EINVAL; 214 return -EINVAL;
215 } 215 }
216 216
@@ -1089,8 +1089,8 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
1089 wr32(reg, (_test[pat] & write)); 1089 wr32(reg, (_test[pat] & write));
1090 val = rd32(reg) & mask; 1090 val = rd32(reg) & mask;
1091 if (val != (_test[pat] & write & mask)) { 1091 if (val != (_test[pat] & write & mask)) {
1092 dev_err(&adapter->pdev->dev, "pattern test reg %04X " 1092 dev_err(&adapter->pdev->dev,
1093 "failed: got 0x%08X expected 0x%08X\n", 1093 "pattern test reg %04X failed: got 0x%08X expected 0x%08X\n",
1094 reg, val, (_test[pat] & write & mask)); 1094 reg, val, (_test[pat] & write & mask));
1095 *data = reg; 1095 *data = reg;
1096 return 1; 1096 return 1;
@@ -1108,8 +1108,8 @@ static bool reg_set_and_check(struct igb_adapter *adapter, u64 *data,
1108 wr32(reg, write & mask); 1108 wr32(reg, write & mask);
1109 val = rd32(reg); 1109 val = rd32(reg);
1110 if ((write & mask) != (val & mask)) { 1110 if ((write & mask) != (val & mask)) {
1111 dev_err(&adapter->pdev->dev, "set/check reg %04X test failed:" 1111 dev_err(&adapter->pdev->dev,
1112 " got 0x%08X expected 0x%08X\n", reg, 1112 "set/check reg %04X test failed: got 0x%08X expected 0x%08X\n", reg,
1113 (val & mask), (write & mask)); 1113 (val & mask), (write & mask));
1114 *data = reg; 1114 *data = reg;
1115 return 1; 1115 return 1;
@@ -1171,8 +1171,9 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
1171 wr32(E1000_STATUS, toggle); 1171 wr32(E1000_STATUS, toggle);
1172 after = rd32(E1000_STATUS) & toggle; 1172 after = rd32(E1000_STATUS) & toggle;
1173 if (value != after) { 1173 if (value != after) {
1174 dev_err(&adapter->pdev->dev, "failed STATUS register test " 1174 dev_err(&adapter->pdev->dev,
1175 "got: 0x%08X expected: 0x%08X\n", after, value); 1175 "failed STATUS register test got: 0x%08X expected: 0x%08X\n",
1176 after, value);
1176 *data = 1; 1177 *data = 1;
1177 return 1; 1178 return 1;
1178 } 1179 }
@@ -1497,6 +1498,9 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
1497 break; 1498 break;
1498 } 1499 }
1499 1500
1501 /* add small delay to avoid loopback test failure */
1502 msleep(50);
1503
1500 /* force 1000, set loopback */ 1504 /* force 1000, set loopback */
1501 igb_write_phy_reg(hw, PHY_CONTROL, 0x4140); 1505 igb_write_phy_reg(hw, PHY_CONTROL, 0x4140);
1502 1506
@@ -1777,16 +1781,14 @@ static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
1777 * sessions are active */ 1781 * sessions are active */
1778 if (igb_check_reset_block(&adapter->hw)) { 1782 if (igb_check_reset_block(&adapter->hw)) {
1779 dev_err(&adapter->pdev->dev, 1783 dev_err(&adapter->pdev->dev,
1780 "Cannot do PHY loopback test " 1784 "Cannot do PHY loopback test when SoL/IDER is active.\n");
1781 "when SoL/IDER is active.\n");
1782 *data = 0; 1785 *data = 0;
1783 goto out; 1786 goto out;
1784 } 1787 }
1785 if ((adapter->hw.mac.type == e1000_i210) 1788 if ((adapter->hw.mac.type == e1000_i210)
1786 || (adapter->hw.mac.type == e1000_i210)) { 1789 || (adapter->hw.mac.type == e1000_i211)) {
1787 dev_err(&adapter->pdev->dev, 1790 dev_err(&adapter->pdev->dev,
1788 "Loopback test not supported " 1791 "Loopback test not supported on this part at this time.\n");
1789 "on this part at this time.\n");
1790 *data = 0; 1792 *data = 0;
1791 goto out; 1793 goto out;
1792 } 1794 }
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b7c2d5050572..48cc4fb1a307 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -462,10 +462,10 @@ static void igb_dump(struct igb_adapter *adapter)
462 (u64)buffer_info->time_stamp, 462 (u64)buffer_info->time_stamp,
463 buffer_info->skb, next_desc); 463 buffer_info->skb, next_desc);
464 464
465 if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) 465 if (netif_msg_pktdata(adapter) && buffer_info->skb)
466 print_hex_dump(KERN_INFO, "", 466 print_hex_dump(KERN_INFO, "",
467 DUMP_PREFIX_ADDRESS, 467 DUMP_PREFIX_ADDRESS,
468 16, 1, phys_to_virt(buffer_info->dma), 468 16, 1, buffer_info->skb->data,
469 buffer_info->length, true); 469 buffer_info->length, true);
470 } 470 }
471 } 471 }
@@ -547,18 +547,17 @@ rx_ring_summary:
547 (u64)buffer_info->dma, 547 (u64)buffer_info->dma,
548 buffer_info->skb, next_desc); 548 buffer_info->skb, next_desc);
549 549
550 if (netif_msg_pktdata(adapter)) { 550 if (netif_msg_pktdata(adapter) &&
551 buffer_info->dma && buffer_info->skb) {
551 print_hex_dump(KERN_INFO, "", 552 print_hex_dump(KERN_INFO, "",
552 DUMP_PREFIX_ADDRESS, 553 DUMP_PREFIX_ADDRESS,
553 16, 1, 554 16, 1, buffer_info->skb->data,
554 phys_to_virt(buffer_info->dma), 555 IGB_RX_HDR_LEN, true);
555 IGB_RX_HDR_LEN, true);
556 print_hex_dump(KERN_INFO, "", 556 print_hex_dump(KERN_INFO, "",
557 DUMP_PREFIX_ADDRESS, 557 DUMP_PREFIX_ADDRESS,
558 16, 1, 558 16, 1,
559 phys_to_virt( 559 page_address(buffer_info->page) +
560 buffer_info->page_dma + 560 buffer_info->page_offset,
561 buffer_info->page_offset),
562 PAGE_SIZE/2, true); 561 PAGE_SIZE/2, true);
563 } 562 }
564 } 563 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index 50fc137501da..18bf08c9d7a4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -804,12 +804,13 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
804 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { 804 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
805 /* Set KX4/KX/KR support according to speed requested */ 805 /* Set KX4/KX/KR support according to speed requested */
806 autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP); 806 autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP);
807 if (speed & IXGBE_LINK_SPEED_10GB_FULL) 807 if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
808 if (orig_autoc & IXGBE_AUTOC_KX4_SUPP) 808 if (orig_autoc & IXGBE_AUTOC_KX4_SUPP)
809 autoc |= IXGBE_AUTOC_KX4_SUPP; 809 autoc |= IXGBE_AUTOC_KX4_SUPP;
810 if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) && 810 if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) &&
811 (hw->phy.smart_speed_active == false)) 811 (hw->phy.smart_speed_active == false))
812 autoc |= IXGBE_AUTOC_KR_SUPP; 812 autoc |= IXGBE_AUTOC_KR_SUPP;
813 }
813 if (speed & IXGBE_LINK_SPEED_1GB_FULL) 814 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
814 autoc |= IXGBE_AUTOC_KX_SUPP; 815 autoc |= IXGBE_AUTOC_KX_SUPP;
815 } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) && 816 } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index f32e70300770..5aba5ecdf1e2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -614,8 +614,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
614 /* If source MAC is equal to our own MAC and not performing 614 /* If source MAC is equal to our own MAC and not performing
615 * the selftest or flb disabled - drop the packet */ 615 * the selftest or flb disabled - drop the packet */
616 if (s_mac == priv->mac && 616 if (s_mac == priv->mac &&
617 (!(dev->features & NETIF_F_LOOPBACK) || 617 !((dev->features & NETIF_F_LOOPBACK) ||
618 !priv->validate_loopback)) 618 priv->validate_loopback))
619 goto next; 619 goto next;
620 620
621 /* 621 /*
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 019d856b1334..10bba09c44ea 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -164,7 +164,6 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
164 ring->cons = 0xffffffff; 164 ring->cons = 0xffffffff;
165 ring->last_nr_txbb = 1; 165 ring->last_nr_txbb = 1;
166 ring->poll_cnt = 0; 166 ring->poll_cnt = 0;
167 ring->blocked = 0;
168 memset(ring->tx_info, 0, ring->size * sizeof(struct mlx4_en_tx_info)); 167 memset(ring->tx_info, 0, ring->size * sizeof(struct mlx4_en_tx_info));
169 memset(ring->buf, 0, ring->buf_size); 168 memset(ring->buf, 0, ring->buf_size);
170 169
@@ -365,14 +364,13 @@ static void mlx4_en_process_tx_cq(struct net_device *dev, struct mlx4_en_cq *cq)
365 ring->cons += txbbs_skipped; 364 ring->cons += txbbs_skipped;
366 netdev_tx_completed_queue(ring->tx_queue, packets, bytes); 365 netdev_tx_completed_queue(ring->tx_queue, packets, bytes);
367 366
368 /* Wakeup Tx queue if this ring stopped it */ 367 /*
369 if (unlikely(ring->blocked)) { 368 * Wakeup Tx queue if this stopped, and at least 1 packet
370 if ((u32) (ring->prod - ring->cons) <= 369 * was completed
371 ring->size - HEADROOM - MAX_DESC_TXBBS) { 370 */
372 ring->blocked = 0; 371 if (netif_tx_queue_stopped(ring->tx_queue) && txbbs_skipped > 0) {
373 netif_tx_wake_queue(ring->tx_queue); 372 netif_tx_wake_queue(ring->tx_queue);
374 priv->port_stats.wake_queue++; 373 priv->port_stats.wake_queue++;
375 }
376 } 374 }
377} 375}
378 376
@@ -592,7 +590,6 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
592 ring->size - HEADROOM - MAX_DESC_TXBBS)) { 590 ring->size - HEADROOM - MAX_DESC_TXBBS)) {
593 /* every full Tx ring stops queue */ 591 /* every full Tx ring stops queue */
594 netif_tx_stop_queue(ring->tx_queue); 592 netif_tx_stop_queue(ring->tx_queue);
595 ring->blocked = 1;
596 priv->port_stats.queue_stopped++; 593 priv->port_stats.queue_stopped++;
597 594
598 return NETDEV_TX_BUSY; 595 return NETDEV_TX_BUSY;
diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c
index 88b7b3e75ab1..daf417923661 100644
--- a/drivers/net/ethernet/mellanox/mlx4/icm.c
+++ b/drivers/net/ethernet/mellanox/mlx4/icm.c
@@ -358,13 +358,14 @@ void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table,
358} 358}
359 359
360int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, 360int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
361 u64 virt, int obj_size, int nobj, int reserved, 361 u64 virt, int obj_size, u32 nobj, int reserved,
362 int use_lowmem, int use_coherent) 362 int use_lowmem, int use_coherent)
363{ 363{
364 int obj_per_chunk; 364 int obj_per_chunk;
365 int num_icm; 365 int num_icm;
366 unsigned chunk_size; 366 unsigned chunk_size;
367 int i; 367 int i;
368 u64 size;
368 369
369 obj_per_chunk = MLX4_TABLE_CHUNK_SIZE / obj_size; 370 obj_per_chunk = MLX4_TABLE_CHUNK_SIZE / obj_size;
370 num_icm = (nobj + obj_per_chunk - 1) / obj_per_chunk; 371 num_icm = (nobj + obj_per_chunk - 1) / obj_per_chunk;
@@ -380,10 +381,12 @@ int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
380 table->coherent = use_coherent; 381 table->coherent = use_coherent;
381 mutex_init(&table->mutex); 382 mutex_init(&table->mutex);
382 383
384 size = (u64) nobj * obj_size;
383 for (i = 0; i * MLX4_TABLE_CHUNK_SIZE < reserved * obj_size; ++i) { 385 for (i = 0; i * MLX4_TABLE_CHUNK_SIZE < reserved * obj_size; ++i) {
384 chunk_size = MLX4_TABLE_CHUNK_SIZE; 386 chunk_size = MLX4_TABLE_CHUNK_SIZE;
385 if ((i + 1) * MLX4_TABLE_CHUNK_SIZE > nobj * obj_size) 387 if ((i + 1) * MLX4_TABLE_CHUNK_SIZE > size)
386 chunk_size = PAGE_ALIGN(nobj * obj_size - i * MLX4_TABLE_CHUNK_SIZE); 388 chunk_size = PAGE_ALIGN(size -
389 i * MLX4_TABLE_CHUNK_SIZE);
387 390
388 table->icm[i] = mlx4_alloc_icm(dev, chunk_size >> PAGE_SHIFT, 391 table->icm[i] = mlx4_alloc_icm(dev, chunk_size >> PAGE_SHIFT,
389 (use_lowmem ? GFP_KERNEL : GFP_HIGHUSER) | 392 (use_lowmem ? GFP_KERNEL : GFP_HIGHUSER) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.h b/drivers/net/ethernet/mellanox/mlx4/icm.h
index 19e4efc0b342..a67744f53506 100644
--- a/drivers/net/ethernet/mellanox/mlx4/icm.h
+++ b/drivers/net/ethernet/mellanox/mlx4/icm.h
@@ -78,7 +78,7 @@ int mlx4_table_get_range(struct mlx4_dev *dev, struct mlx4_icm_table *table,
78void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table, 78void mlx4_table_put_range(struct mlx4_dev *dev, struct mlx4_icm_table *table,
79 int start, int end); 79 int start, int end);
80int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table, 80int mlx4_init_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table,
81 u64 virt, int obj_size, int nobj, int reserved, 81 u64 virt, int obj_size, u32 nobj, int reserved,
82 int use_lowmem, int use_coherent); 82 int use_lowmem, int use_coherent);
83void mlx4_cleanup_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table); 83void mlx4_cleanup_icm_table(struct mlx4_dev *dev, struct mlx4_icm_table *table);
84void *mlx4_table_find(struct mlx4_icm_table *table, int obj, dma_addr_t *dma_handle); 84void *mlx4_table_find(struct mlx4_icm_table *table, int obj, dma_addr_t *dma_handle);
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 48d0e90194cb..827b72dfce99 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -157,9 +157,6 @@ int mlx4_check_port_params(struct mlx4_dev *dev,
157 "on this HCA, aborting.\n"); 157 "on this HCA, aborting.\n");
158 return -EINVAL; 158 return -EINVAL;
159 } 159 }
160 if (port_type[i] == MLX4_PORT_TYPE_ETH &&
161 port_type[i + 1] == MLX4_PORT_TYPE_IB)
162 return -EINVAL;
163 } 160 }
164 } 161 }
165 162
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index 4ec3835e1bc2..a018ea2a43de 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -432,8 +432,10 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
432 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn) { 432 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn) {
433 /* Entry already exists, add to duplicates */ 433 /* Entry already exists, add to duplicates */
434 dqp = kmalloc(sizeof *dqp, GFP_KERNEL); 434 dqp = kmalloc(sizeof *dqp, GFP_KERNEL);
435 if (!dqp) 435 if (!dqp) {
436 err = -ENOMEM;
436 goto out_mailbox; 437 goto out_mailbox;
438 }
437 dqp->qpn = qpn; 439 dqp->qpn = qpn;
438 list_add_tail(&dqp->list, &entry->duplicates); 440 list_add_tail(&dqp->list, &entry->duplicates);
439 found = true; 441 found = true;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 59ebc0339638..4d9df8f2a126 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -249,7 +249,7 @@ struct mlx4_bitmap {
249struct mlx4_buddy { 249struct mlx4_buddy {
250 unsigned long **bits; 250 unsigned long **bits;
251 unsigned int *num_free; 251 unsigned int *num_free;
252 int max_order; 252 u32 max_order;
253 spinlock_t lock; 253 spinlock_t lock;
254}; 254};
255 255
@@ -258,7 +258,7 @@ struct mlx4_icm;
258struct mlx4_icm_table { 258struct mlx4_icm_table {
259 u64 virt; 259 u64 virt;
260 int num_icm; 260 int num_icm;
261 int num_obj; 261 u32 num_obj;
262 int obj_size; 262 int obj_size;
263 int lowmem; 263 int lowmem;
264 int coherent; 264 int coherent;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 5f1ab105debc..9d27e42264e2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -248,7 +248,6 @@ struct mlx4_en_tx_ring {
248 u32 doorbell_qpn; 248 u32 doorbell_qpn;
249 void *buf; 249 void *buf;
250 u16 poll_cnt; 250 u16 poll_cnt;
251 int blocked;
252 struct mlx4_en_tx_info *tx_info; 251 struct mlx4_en_tx_info *tx_info;
253 u8 *bounce_buf; 252 u8 *bounce_buf;
254 u32 last_nr_txbb; 253 u32 last_nr_txbb;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index af55b7ce5341..c202d3ad2a0e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -37,6 +37,7 @@
37#include <linux/export.h> 37#include <linux/export.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/vmalloc.h>
40 41
41#include <linux/mlx4/cmd.h> 42#include <linux/mlx4/cmd.h>
42 43
@@ -120,7 +121,7 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order)
120 buddy->max_order = max_order; 121 buddy->max_order = max_order;
121 spin_lock_init(&buddy->lock); 122 spin_lock_init(&buddy->lock);
122 123
123 buddy->bits = kzalloc((buddy->max_order + 1) * sizeof (long *), 124 buddy->bits = kcalloc(buddy->max_order + 1, sizeof (long *),
124 GFP_KERNEL); 125 GFP_KERNEL);
125 buddy->num_free = kcalloc((buddy->max_order + 1), sizeof *buddy->num_free, 126 buddy->num_free = kcalloc((buddy->max_order + 1), sizeof *buddy->num_free,
126 GFP_KERNEL); 127 GFP_KERNEL);
@@ -129,10 +130,12 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order)
129 130
130 for (i = 0; i <= buddy->max_order; ++i) { 131 for (i = 0; i <= buddy->max_order; ++i) {
131 s = BITS_TO_LONGS(1 << (buddy->max_order - i)); 132 s = BITS_TO_LONGS(1 << (buddy->max_order - i));
132 buddy->bits[i] = kmalloc(s * sizeof (long), GFP_KERNEL); 133 buddy->bits[i] = kcalloc(s, sizeof (long), GFP_KERNEL | __GFP_NOWARN);
133 if (!buddy->bits[i]) 134 if (!buddy->bits[i]) {
134 goto err_out_free; 135 buddy->bits[i] = vzalloc(s * sizeof(long));
135 bitmap_zero(buddy->bits[i], 1 << (buddy->max_order - i)); 136 if (!buddy->bits[i])
137 goto err_out_free;
138 }
136 } 139 }
137 140
138 set_bit(0, buddy->bits[buddy->max_order]); 141 set_bit(0, buddy->bits[buddy->max_order]);
@@ -142,7 +145,10 @@ static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order)
142 145
143err_out_free: 146err_out_free:
144 for (i = 0; i <= buddy->max_order; ++i) 147 for (i = 0; i <= buddy->max_order; ++i)
145 kfree(buddy->bits[i]); 148 if (buddy->bits[i] && is_vmalloc_addr(buddy->bits[i]))
149 vfree(buddy->bits[i]);
150 else
151 kfree(buddy->bits[i]);
146 152
147err_out: 153err_out:
148 kfree(buddy->bits); 154 kfree(buddy->bits);
@@ -156,7 +162,10 @@ static void mlx4_buddy_cleanup(struct mlx4_buddy *buddy)
156 int i; 162 int i;
157 163
158 for (i = 0; i <= buddy->max_order; ++i) 164 for (i = 0; i <= buddy->max_order; ++i)
159 kfree(buddy->bits[i]); 165 if (is_vmalloc_addr(buddy->bits[i]))
166 vfree(buddy->bits[i]);
167 else
168 kfree(buddy->bits[i]);
160 169
161 kfree(buddy->bits); 170 kfree(buddy->bits);
162 kfree(buddy->num_free); 171 kfree(buddy->num_free);
@@ -668,7 +677,7 @@ int mlx4_init_mr_table(struct mlx4_dev *dev)
668 return err; 677 return err;
669 678
670 err = mlx4_buddy_init(&mr_table->mtt_buddy, 679 err = mlx4_buddy_init(&mr_table->mtt_buddy,
671 ilog2(dev->caps.num_mtts / 680 ilog2((u32)dev->caps.num_mtts /
672 (1 << log_mtts_per_seg))); 681 (1 << log_mtts_per_seg)));
673 if (err) 682 if (err)
674 goto err_buddy; 683 goto err_buddy;
@@ -678,7 +687,7 @@ int mlx4_init_mr_table(struct mlx4_dev *dev)
678 mlx4_alloc_mtt_range(dev, 687 mlx4_alloc_mtt_range(dev,
679 fls(dev->caps.reserved_mtts - 1)); 688 fls(dev->caps.reserved_mtts - 1));
680 if (priv->reserved_mtts < 0) { 689 if (priv->reserved_mtts < 0) {
681 mlx4_warn(dev, "MTT table of order %d is too small.\n", 690 mlx4_warn(dev, "MTT table of order %u is too small.\n",
682 mr_table->mtt_buddy.max_order); 691 mr_table->mtt_buddy.max_order);
683 err = -ENOMEM; 692 err = -ENOMEM;
684 goto err_reserve_mtts; 693 goto err_reserve_mtts;
diff --git a/drivers/net/ethernet/mellanox/mlx4/profile.c b/drivers/net/ethernet/mellanox/mlx4/profile.c
index 9ee4725363d5..8e0c3cc2a1ec 100644
--- a/drivers/net/ethernet/mellanox/mlx4/profile.c
+++ b/drivers/net/ethernet/mellanox/mlx4/profile.c
@@ -76,7 +76,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
76 u64 size; 76 u64 size;
77 u64 start; 77 u64 start;
78 int type; 78 int type;
79 int num; 79 u32 num;
80 int log_num; 80 int log_num;
81 }; 81 };
82 82
@@ -105,7 +105,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
105 si_meminfo(&si); 105 si_meminfo(&si);
106 request->num_mtt = 106 request->num_mtt =
107 roundup_pow_of_two(max_t(unsigned, request->num_mtt, 107 roundup_pow_of_two(max_t(unsigned, request->num_mtt,
108 min(1UL << 31, 108 min(1UL << (31 - log_mtts_per_seg),
109 si.totalram >> (log_mtts_per_seg - 1)))); 109 si.totalram >> (log_mtts_per_seg - 1))));
110 110
111 profile[MLX4_RES_QP].size = dev_cap->qpc_entry_sz; 111 profile[MLX4_RES_QP].size = dev_cap->qpc_entry_sz;
diff --git a/drivers/net/ethernet/mellanox/mlx4/sense.c b/drivers/net/ethernet/mellanox/mlx4/sense.c
index 802498293528..34ee09bae36e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/sense.c
+++ b/drivers/net/ethernet/mellanox/mlx4/sense.c
@@ -81,20 +81,6 @@ void mlx4_do_sense_ports(struct mlx4_dev *dev,
81 } 81 }
82 82
83 /* 83 /*
84 * Adjust port configuration:
85 * If port 1 sensed nothing and port 2 is IB, set both as IB
86 * If port 2 sensed nothing and port 1 is Eth, set both as Eth
87 */
88 if (stype[0] == MLX4_PORT_TYPE_ETH) {
89 for (i = 1; i < dev->caps.num_ports; i++)
90 stype[i] = stype[i] ? stype[i] : MLX4_PORT_TYPE_ETH;
91 }
92 if (stype[dev->caps.num_ports - 1] == MLX4_PORT_TYPE_IB) {
93 for (i = 0; i < dev->caps.num_ports - 1; i++)
94 stype[i] = stype[i] ? stype[i] : MLX4_PORT_TYPE_IB;
95 }
96
97 /*
98 * If sensed nothing, remain in current configuration. 84 * If sensed nothing, remain in current configuration.
99 */ 85 */
100 for (i = 0; i < dev->caps.num_ports; i++) 86 for (i = 0; i < dev->caps.num_ports; i++)
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 4069edab229e..53743f7a2ca9 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -346,28 +346,15 @@ static phy_interface_t lpc_phy_interface_mode(struct device *dev)
346 "phy-mode", NULL); 346 "phy-mode", NULL);
347 if (mode && !strcmp(mode, "mii")) 347 if (mode && !strcmp(mode, "mii"))
348 return PHY_INTERFACE_MODE_MII; 348 return PHY_INTERFACE_MODE_MII;
349 return PHY_INTERFACE_MODE_RMII;
350 } 349 }
351
352 /* non-DT */
353#ifdef CONFIG_ARCH_LPC32XX_MII_SUPPORT
354 return PHY_INTERFACE_MODE_MII;
355#else
356 return PHY_INTERFACE_MODE_RMII; 350 return PHY_INTERFACE_MODE_RMII;
357#endif
358} 351}
359 352
360static bool use_iram_for_net(struct device *dev) 353static bool use_iram_for_net(struct device *dev)
361{ 354{
362 if (dev && dev->of_node) 355 if (dev && dev->of_node)
363 return of_property_read_bool(dev->of_node, "use-iram"); 356 return of_property_read_bool(dev->of_node, "use-iram");
364
365 /* non-DT */
366#ifdef CONFIG_ARCH_LPC32XX_IRAM_FOR_NET
367 return true;
368#else
369 return false; 357 return false;
370#endif
371} 358}
372 359
373/* Receive Status information word */ 360/* Receive Status information word */
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 46df3a04030c..24c2305d7948 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -8,7 +8,7 @@ config SH_ETH
8 (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \ 8 (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
9 CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \ 9 CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
10 CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \ 10 CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
11 CPU_SUBTYPE_SH7757 || ARCH_R8A7740) 11 CPU_SUBTYPE_SH7757 || ARCH_R8A7740 || ARCH_R8A7779)
12 select CRC32 12 select CRC32
13 select NET_CORE 13 select NET_CORE
14 select MII 14 select MII
@@ -18,4 +18,4 @@ config SH_ETH
18 Renesas SuperH Ethernet device driver. 18 Renesas SuperH Ethernet device driver.
19 This driver supporting CPUs are: 19 This driver supporting CPUs are:
20 - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757, 20 - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
21 and R8A7740. 21 R8A7740 and R8A7779.
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index af0b867a6cf6..bad8f2eec9b4 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -78,7 +78,7 @@ static void sh_eth_select_mii(struct net_device *ndev)
78#endif 78#endif
79 79
80/* There is CPU dependent code */ 80/* There is CPU dependent code */
81#if defined(CONFIG_CPU_SUBTYPE_SH7724) 81#if defined(CONFIG_CPU_SUBTYPE_SH7724) || defined(CONFIG_ARCH_R8A7779)
82#define SH_ETH_RESET_DEFAULT 1 82#define SH_ETH_RESET_DEFAULT 1
83static void sh_eth_set_duplex(struct net_device *ndev) 83static void sh_eth_set_duplex(struct net_device *ndev)
84{ 84{
@@ -93,13 +93,18 @@ static void sh_eth_set_duplex(struct net_device *ndev)
93static void sh_eth_set_rate(struct net_device *ndev) 93static void sh_eth_set_rate(struct net_device *ndev)
94{ 94{
95 struct sh_eth_private *mdp = netdev_priv(ndev); 95 struct sh_eth_private *mdp = netdev_priv(ndev);
96 unsigned int bits = ECMR_RTM;
97
98#if defined(CONFIG_ARCH_R8A7779)
99 bits |= ECMR_ELB;
100#endif
96 101
97 switch (mdp->speed) { 102 switch (mdp->speed) {
98 case 10: /* 10BASE */ 103 case 10: /* 10BASE */
99 sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~ECMR_RTM, ECMR); 104 sh_eth_write(ndev, sh_eth_read(ndev, ECMR) & ~bits, ECMR);
100 break; 105 break;
101 case 100:/* 100BASE */ 106 case 100:/* 100BASE */
102 sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | ECMR_RTM, ECMR); 107 sh_eth_write(ndev, sh_eth_read(ndev, ECMR) | bits, ECMR);
103 break; 108 break;
104 default: 109 default:
105 break; 110 break;
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 70554a1b2b02..65a8d49106a4 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1503,6 +1503,11 @@ static int efx_probe_all(struct efx_nic *efx)
1503 goto fail2; 1503 goto fail2;
1504 } 1504 }
1505 1505
1506 BUILD_BUG_ON(EFX_DEFAULT_DMAQ_SIZE < EFX_RXQ_MIN_ENT);
1507 if (WARN_ON(EFX_DEFAULT_DMAQ_SIZE < EFX_TXQ_MIN_ENT(efx))) {
1508 rc = -EINVAL;
1509 goto fail3;
1510 }
1506 efx->rxq_entries = efx->txq_entries = EFX_DEFAULT_DMAQ_SIZE; 1511 efx->rxq_entries = efx->txq_entries = EFX_DEFAULT_DMAQ_SIZE;
1507 1512
1508 rc = efx_probe_filters(efx); 1513 rc = efx_probe_filters(efx);
@@ -2070,6 +2075,7 @@ static int efx_register_netdev(struct efx_nic *efx)
2070 net_dev->irq = efx->pci_dev->irq; 2075 net_dev->irq = efx->pci_dev->irq;
2071 net_dev->netdev_ops = &efx_netdev_ops; 2076 net_dev->netdev_ops = &efx_netdev_ops;
2072 SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops); 2077 SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops);
2078 net_dev->gso_max_segs = EFX_TSO_MAX_SEGS;
2073 2079
2074 rtnl_lock(); 2080 rtnl_lock();
2075 2081
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index be8f9158a714..70755c97251a 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -30,6 +30,7 @@ extern netdev_tx_t
30efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb); 30efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
31extern void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index); 31extern void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
32extern int efx_setup_tc(struct net_device *net_dev, u8 num_tc); 32extern int efx_setup_tc(struct net_device *net_dev, u8 num_tc);
33extern unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);
33 34
34/* RX */ 35/* RX */
35extern int efx_probe_rx_queue(struct efx_rx_queue *rx_queue); 36extern int efx_probe_rx_queue(struct efx_rx_queue *rx_queue);
@@ -52,10 +53,15 @@ extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue);
52#define EFX_MAX_EVQ_SIZE 16384UL 53#define EFX_MAX_EVQ_SIZE 16384UL
53#define EFX_MIN_EVQ_SIZE 512UL 54#define EFX_MIN_EVQ_SIZE 512UL
54 55
55/* The smallest [rt]xq_entries that the driver supports. Callers of 56/* Maximum number of TCP segments we support for soft-TSO */
56 * efx_wake_queue() assume that they can subsequently send at least one 57#define EFX_TSO_MAX_SEGS 100
57 * skb. Falcon/A1 may require up to three descriptors per skb_frag. */ 58
58#define EFX_MIN_RING_SIZE (roundup_pow_of_two(2 * 3 * MAX_SKB_FRAGS)) 59/* The smallest [rt]xq_entries that the driver supports. RX minimum
60 * is a bit arbitrary. For TX, we must have space for at least 2
61 * TSO skbs.
62 */
63#define EFX_RXQ_MIN_ENT 128U
64#define EFX_TXQ_MIN_ENT(efx) (2 * efx_tx_max_skb_descs(efx))
59 65
60/* Filters */ 66/* Filters */
61extern int efx_probe_filters(struct efx_nic *efx); 67extern int efx_probe_filters(struct efx_nic *efx);
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 10536f93b561..8cba2df82b18 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -680,21 +680,27 @@ static int efx_ethtool_set_ringparam(struct net_device *net_dev,
680 struct ethtool_ringparam *ring) 680 struct ethtool_ringparam *ring)
681{ 681{
682 struct efx_nic *efx = netdev_priv(net_dev); 682 struct efx_nic *efx = netdev_priv(net_dev);
683 u32 txq_entries;
683 684
684 if (ring->rx_mini_pending || ring->rx_jumbo_pending || 685 if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
685 ring->rx_pending > EFX_MAX_DMAQ_SIZE || 686 ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
686 ring->tx_pending > EFX_MAX_DMAQ_SIZE) 687 ring->tx_pending > EFX_MAX_DMAQ_SIZE)
687 return -EINVAL; 688 return -EINVAL;
688 689
689 if (ring->rx_pending < EFX_MIN_RING_SIZE || 690 if (ring->rx_pending < EFX_RXQ_MIN_ENT) {
690 ring->tx_pending < EFX_MIN_RING_SIZE) {
691 netif_err(efx, drv, efx->net_dev, 691 netif_err(efx, drv, efx->net_dev,
692 "TX and RX queues cannot be smaller than %ld\n", 692 "RX queues cannot be smaller than %u\n",
693 EFX_MIN_RING_SIZE); 693 EFX_RXQ_MIN_ENT);
694 return -EINVAL; 694 return -EINVAL;
695 } 695 }
696 696
697 return efx_realloc_channels(efx, ring->rx_pending, ring->tx_pending); 697 txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx));
698 if (txq_entries != ring->tx_pending)
699 netif_warn(efx, drv, efx->net_dev,
700 "increasing TX queue size to minimum of %u\n",
701 txq_entries);
702
703 return efx_realloc_channels(efx, ring->rx_pending, txq_entries);
698} 704}
699 705
700static int efx_ethtool_set_pauseparam(struct net_device *net_dev, 706static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 9b225a7769f7..18713436b443 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -119,6 +119,25 @@ efx_max_tx_len(struct efx_nic *efx, dma_addr_t dma_addr)
119 return len; 119 return len;
120} 120}
121 121
122unsigned int efx_tx_max_skb_descs(struct efx_nic *efx)
123{
124 /* Header and payload descriptor for each output segment, plus
125 * one for every input fragment boundary within a segment
126 */
127 unsigned int max_descs = EFX_TSO_MAX_SEGS * 2 + MAX_SKB_FRAGS;
128
129 /* Possibly one more per segment for the alignment workaround */
130 if (EFX_WORKAROUND_5391(efx))
131 max_descs += EFX_TSO_MAX_SEGS;
132
133 /* Possibly more for PCIe page boundaries within input fragments */
134 if (PAGE_SIZE > EFX_PAGE_SIZE)
135 max_descs += max_t(unsigned int, MAX_SKB_FRAGS,
136 DIV_ROUND_UP(GSO_MAX_SIZE, EFX_PAGE_SIZE));
137
138 return max_descs;
139}
140
122/* 141/*
123 * Add a socket buffer to a TX queue 142 * Add a socket buffer to a TX queue
124 * 143 *
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fd8882f9602a..c136162e6473 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2077,7 +2077,7 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
2077 goto error_netdev_register; 2077 goto error_netdev_register;
2078 } 2078 }
2079 2079
2080 priv->stmmac_clk = clk_get(priv->device, NULL); 2080 priv->stmmac_clk = clk_get(priv->device, STMMAC_RESOURCE_NAME);
2081 if (IS_ERR(priv->stmmac_clk)) { 2081 if (IS_ERR(priv->stmmac_clk)) {
2082 pr_warning("%s: warning: cannot get CSR clock\n", __func__); 2082 pr_warning("%s: warning: cannot get CSR clock\n", __func__);
2083 goto error_clk_get; 2083 goto error_clk_get;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index cd01ee7ecef1..b93245c11995 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -74,7 +74,7 @@ static int __devinit stmmac_probe_config_dt(struct platform_device *pdev,
74 * the necessary resources and invokes the main to init 74 * the necessary resources and invokes the main to init
75 * the net device, register the mdio bus etc. 75 * the net device, register the mdio bus etc.
76 */ 76 */
77static int stmmac_pltfr_probe(struct platform_device *pdev) 77static int __devinit stmmac_pltfr_probe(struct platform_device *pdev)
78{ 78{
79 int ret = 0; 79 int ret = 0;
80 struct resource *res; 80 struct resource *res;
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 3b5c4571b55e..d15c888e9df8 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -538,11 +538,12 @@ EXPORT_SYMBOL_GPL(cpdma_chan_create);
538 538
539int cpdma_chan_destroy(struct cpdma_chan *chan) 539int cpdma_chan_destroy(struct cpdma_chan *chan)
540{ 540{
541 struct cpdma_ctlr *ctlr = chan->ctlr; 541 struct cpdma_ctlr *ctlr;
542 unsigned long flags; 542 unsigned long flags;
543 543
544 if (!chan) 544 if (!chan)
545 return -EINVAL; 545 return -EINVAL;
546 ctlr = chan->ctlr;
546 547
547 spin_lock_irqsave(&ctlr->lock, flags); 548 spin_lock_irqsave(&ctlr->lock, flags);
548 if (chan->state != CPDMA_STATE_IDLE) 549 if (chan->state != CPDMA_STATE_IDLE)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 482648fcf0b6..98934bdf6acf 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1003,6 +1003,7 @@ static int ixp4xx_nway_reset(struct net_device *dev)
1003} 1003}
1004 1004
1005int ixp46x_phc_index = -1; 1005int ixp46x_phc_index = -1;
1006EXPORT_SYMBOL_GPL(ixp46x_phc_index);
1006 1007
1007static int ixp4xx_get_ts_info(struct net_device *dev, 1008static int ixp4xx_get_ts_info(struct net_device *dev,
1008 struct ethtool_ts_info *info) 1009 struct ethtool_ts_info *info)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 6cee2917eb02..4a1a5f58fa73 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -383,13 +383,6 @@ int netvsc_device_remove(struct hv_device *device)
383 unsigned long flags; 383 unsigned long flags;
384 384
385 net_device = hv_get_drvdata(device); 385 net_device = hv_get_drvdata(device);
386 spin_lock_irqsave(&device->channel->inbound_lock, flags);
387 net_device->destroy = true;
388 spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
389
390 /* Wait for all send completions */
391 wait_event(net_device->wait_drain,
392 atomic_read(&net_device->num_outstanding_sends) == 0);
393 386
394 netvsc_disconnect_vsp(net_device); 387 netvsc_disconnect_vsp(net_device);
395 388
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index e5d6146937fa..1e88a1095934 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -718,6 +718,9 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
718{ 718{
719 struct rndis_request *request; 719 struct rndis_request *request;
720 struct rndis_halt_request *halt; 720 struct rndis_halt_request *halt;
721 struct netvsc_device *nvdev = dev->net_dev;
722 struct hv_device *hdev = nvdev->dev;
723 ulong flags;
721 724
722 /* Attempt to do a rndis device halt */ 725 /* Attempt to do a rndis device halt */
723 request = get_rndis_request(dev, RNDIS_MSG_HALT, 726 request = get_rndis_request(dev, RNDIS_MSG_HALT,
@@ -735,6 +738,14 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
735 dev->state = RNDIS_DEV_UNINITIALIZED; 738 dev->state = RNDIS_DEV_UNINITIALIZED;
736 739
737cleanup: 740cleanup:
741 spin_lock_irqsave(&hdev->channel->inbound_lock, flags);
742 nvdev->destroy = true;
743 spin_unlock_irqrestore(&hdev->channel->inbound_lock, flags);
744
745 /* Wait for all send completions */
746 wait_event(nvdev->wait_drain,
747 atomic_read(&nvdev->num_outstanding_sends) == 0);
748
738 if (request) 749 if (request)
739 put_rndis_request(dev, request); 750 put_rndis_request(dev, request);
740 return; 751 return;
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c
index a561ae44a9ac..c6a0299aa9f9 100644
--- a/drivers/net/irda/bfin_sir.c
+++ b/drivers/net/irda/bfin_sir.c
@@ -158,7 +158,7 @@ static int bfin_sir_set_speed(struct bfin_sir_port *port, int speed)
158 /* If not add the 'RPOLC', we can't catch the receive interrupt. 158 /* If not add the 'RPOLC', we can't catch the receive interrupt.
159 * It's related with the HW layout and the IR transiver. 159 * It's related with the HW layout and the IR transiver.
160 */ 160 */
161 val |= IREN | RPOLC; 161 val |= UMOD_IRDA | RPOLC;
162 UART_PUT_GCTL(port, val); 162 UART_PUT_GCTL(port, val);
163 return ret; 163 return ret;
164} 164}
@@ -432,7 +432,7 @@ static void bfin_sir_shutdown(struct bfin_sir_port *port, struct net_device *dev
432 bfin_sir_stop_rx(port); 432 bfin_sir_stop_rx(port);
433 433
434 val = UART_GET_GCTL(port); 434 val = UART_GET_GCTL(port);
435 val &= ~(UCEN | IREN | RPOLC); 435 val &= ~(UCEN | UMOD_MASK | RPOLC);
436 UART_PUT_GCTL(port, val); 436 UART_PUT_GCTL(port, val);
437 437
438#ifdef CONFIG_SIR_BFIN_DMA 438#ifdef CONFIG_SIR_BFIN_DMA
@@ -518,10 +518,10 @@ static void bfin_sir_send_work(struct work_struct *work)
518 * reset all the UART. 518 * reset all the UART.
519 */ 519 */
520 val = UART_GET_GCTL(port); 520 val = UART_GET_GCTL(port);
521 val &= ~(IREN | RPOLC); 521 val &= ~(UMOD_MASK | RPOLC);
522 UART_PUT_GCTL(port, val); 522 UART_PUT_GCTL(port, val);
523 SSYNC(); 523 SSYNC();
524 val |= IREN | RPOLC; 524 val |= UMOD_IRDA | RPOLC;
525 UART_PUT_GCTL(port, val); 525 UART_PUT_GCTL(port, val);
526 SSYNC(); 526 SSYNC();
527 /* bfin_sir_set_speed(port, self->speed); */ 527 /* bfin_sir_set_speed(port, self->speed); */
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c
index 824e2a93fe8a..5f3aeac3f86d 100644
--- a/drivers/net/irda/ks959-sir.c
+++ b/drivers/net/irda/ks959-sir.c
@@ -542,6 +542,7 @@ static int ks959_net_open(struct net_device *netdev)
542 sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); 542 sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
543 kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); 543 kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
544 if (!kingsun->irlap) { 544 if (!kingsun->irlap) {
545 err = -ENOMEM;
545 dev_err(&kingsun->usbdev->dev, "irlap_open failed\n"); 546 dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
546 goto free_mem; 547 goto free_mem;
547 } 548 }
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c
index 5a278ab83c2f..2d4b6a1ab202 100644
--- a/drivers/net/irda/ksdazzle-sir.c
+++ b/drivers/net/irda/ksdazzle-sir.c
@@ -436,6 +436,7 @@ static int ksdazzle_net_open(struct net_device *netdev)
436 sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); 436 sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
437 kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); 437 kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
438 if (!kingsun->irlap) { 438 if (!kingsun->irlap) {
439 err = -ENOMEM;
439 dev_err(&kingsun->usbdev->dev, "irlap_open failed\n"); 440 dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
440 goto free_mem; 441 goto free_mem;
441 } 442 }
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 0737bd4d1669..0f0f9ce3a776 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -94,7 +94,8 @@ static int get_slot(struct macvlan_dev *vlan, struct macvtap_queue *q)
94 int i; 94 int i;
95 95
96 for (i = 0; i < MAX_MACVTAP_QUEUES; i++) { 96 for (i = 0; i < MAX_MACVTAP_QUEUES; i++) {
97 if (rcu_dereference(vlan->taps[i]) == q) 97 if (rcu_dereference_protected(vlan->taps[i],
98 lockdep_is_held(&macvtap_lock)) == q)
98 return i; 99 return i;
99 } 100 }
100 101
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index f9347ea3d381..b3321129a83c 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -640,15 +640,9 @@ static int netconsole_netdev_event(struct notifier_block *this,
640 * rtnl_lock already held 640 * rtnl_lock already held
641 */ 641 */
642 if (nt->np.dev) { 642 if (nt->np.dev) {
643 spin_unlock_irqrestore(
644 &target_list_lock,
645 flags);
646 __netpoll_cleanup(&nt->np); 643 __netpoll_cleanup(&nt->np);
647 spin_lock_irqsave(&target_list_lock,
648 flags);
649 dev_put(nt->np.dev); 644 dev_put(nt->np.dev);
650 nt->np.dev = NULL; 645 nt->np.dev = NULL;
651 netconsole_target_put(nt);
652 } 646 }
653 nt->enabled = 0; 647 nt->enabled = 0;
654 stopped = true; 648 stopped = true;
diff --git a/drivers/net/phy/mdio-mux-gpio.c b/drivers/net/phy/mdio-mux-gpio.c
index e0cc4ef33dee..eefe49e8713c 100644
--- a/drivers/net/phy/mdio-mux-gpio.c
+++ b/drivers/net/phy/mdio-mux-gpio.c
@@ -101,7 +101,6 @@ err:
101 n--; 101 n--;
102 gpio_free(s->gpio[n]); 102 gpio_free(s->gpio[n]);
103 } 103 }
104 devm_kfree(&pdev->dev, s);
105 return r; 104 return r;
106} 105}
107 106
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
index 5c120189ec86..4d4d25efc1e1 100644
--- a/drivers/net/phy/mdio-mux.c
+++ b/drivers/net/phy/mdio-mux.c
@@ -132,7 +132,7 @@ int mdio_mux_init(struct device *dev,
132 pb->mii_bus = parent_bus; 132 pb->mii_bus = parent_bus;
133 133
134 ret_val = -ENODEV; 134 ret_val = -ENODEV;
135 for_each_child_of_node(dev->of_node, child_bus_node) { 135 for_each_available_child_of_node(dev->of_node, child_bus_node) {
136 u32 v; 136 u32 v;
137 137
138 r = of_property_read_u32(child_bus_node, "reg", &v); 138 r = of_property_read_u32(child_bus_node, "reg", &v);
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 1c98321b56cc..162464fe86bf 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -189,7 +189,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
189 if (sk_pppox(po)->sk_state & PPPOX_DEAD) 189 if (sk_pppox(po)->sk_state & PPPOX_DEAD)
190 goto tx_error; 190 goto tx_error;
191 191
192 rt = ip_route_output_ports(&init_net, &fl4, NULL, 192 rt = ip_route_output_ports(sock_net(sk), &fl4, NULL,
193 opt->dst_addr.sin_addr.s_addr, 193 opt->dst_addr.sin_addr.s_addr,
194 opt->src_addr.sin_addr.s_addr, 194 opt->src_addr.sin_addr.s_addr,
195 0, 0, IPPROTO_GRE, 195 0, 0, IPPROTO_GRE,
@@ -468,7 +468,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
468 po->chan.private = sk; 468 po->chan.private = sk;
469 po->chan.ops = &pptp_chan_ops; 469 po->chan.ops = &pptp_chan_ops;
470 470
471 rt = ip_route_output_ports(&init_net, &fl4, sk, 471 rt = ip_route_output_ports(sock_net(sk), &fl4, sk,
472 opt->dst_addr.sin_addr.s_addr, 472 opt->dst_addr.sin_addr.s_addr,
473 opt->src_addr.sin_addr.s_addr, 473 opt->src_addr.sin_addr.s_addr,
474 0, 0, 474 0, 0,
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 87707ab39430..341b65dbbcd3 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -795,16 +795,17 @@ static void team_port_leave(struct team *team, struct team_port *port)
795} 795}
796 796
797#ifdef CONFIG_NET_POLL_CONTROLLER 797#ifdef CONFIG_NET_POLL_CONTROLLER
798static int team_port_enable_netpoll(struct team *team, struct team_port *port) 798static int team_port_enable_netpoll(struct team *team, struct team_port *port,
799 gfp_t gfp)
799{ 800{
800 struct netpoll *np; 801 struct netpoll *np;
801 int err; 802 int err;
802 803
803 np = kzalloc(sizeof(*np), GFP_KERNEL); 804 np = kzalloc(sizeof(*np), gfp);
804 if (!np) 805 if (!np)
805 return -ENOMEM; 806 return -ENOMEM;
806 807
807 err = __netpoll_setup(np, port->dev); 808 err = __netpoll_setup(np, port->dev, gfp);
808 if (err) { 809 if (err) {
809 kfree(np); 810 kfree(np);
810 return err; 811 return err;
@@ -833,7 +834,8 @@ static struct netpoll_info *team_netpoll_info(struct team *team)
833} 834}
834 835
835#else 836#else
836static int team_port_enable_netpoll(struct team *team, struct team_port *port) 837static int team_port_enable_netpoll(struct team *team, struct team_port *port,
838 gfp_t gfp)
837{ 839{
838 return 0; 840 return 0;
839} 841}
@@ -913,7 +915,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
913 } 915 }
914 916
915 if (team_netpoll_info(team)) { 917 if (team_netpoll_info(team)) {
916 err = team_port_enable_netpoll(team, port); 918 err = team_port_enable_netpoll(team, port, GFP_KERNEL);
917 if (err) { 919 if (err) {
918 netdev_err(dev, "Failed to enable netpoll on device %s\n", 920 netdev_err(dev, "Failed to enable netpoll on device %s\n",
919 portname); 921 portname);
@@ -1443,7 +1445,7 @@ static void team_netpoll_cleanup(struct net_device *dev)
1443} 1445}
1444 1446
1445static int team_netpoll_setup(struct net_device *dev, 1447static int team_netpoll_setup(struct net_device *dev,
1446 struct netpoll_info *npifo) 1448 struct netpoll_info *npifo, gfp_t gfp)
1447{ 1449{
1448 struct team *team = netdev_priv(dev); 1450 struct team *team = netdev_priv(dev);
1449 struct team_port *port; 1451 struct team_port *port;
@@ -1451,7 +1453,7 @@ static int team_netpoll_setup(struct net_device *dev,
1451 1453
1452 mutex_lock(&team->lock); 1454 mutex_lock(&team->lock);
1453 list_for_each_entry(port, &team->port_list, list) { 1455 list_for_each_entry(port, &team->port_list, list) {
1454 err = team_port_enable_netpoll(team, port); 1456 err = team_port_enable_netpoll(team, port, gfp);
1455 if (err) { 1457 if (err) {
1456 __team_netpoll_cleanup(team); 1458 __team_netpoll_cleanup(team);
1457 break; 1459 break;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 926d4db5cb38..3a16d4fdaa05 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -187,7 +187,6 @@ static void __tun_detach(struct tun_struct *tun)
187 netif_tx_lock_bh(tun->dev); 187 netif_tx_lock_bh(tun->dev);
188 netif_carrier_off(tun->dev); 188 netif_carrier_off(tun->dev);
189 tun->tfile = NULL; 189 tun->tfile = NULL;
190 tun->socket.file = NULL;
191 netif_tx_unlock_bh(tun->dev); 190 netif_tx_unlock_bh(tun->dev);
192 191
193 /* Drop read queue */ 192 /* Drop read queue */
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 64610048ce87..7d78669000d7 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -232,6 +232,7 @@ static int usbpn_open(struct net_device *dev)
232 struct urb *req = usb_alloc_urb(0, GFP_KERNEL); 232 struct urb *req = usb_alloc_urb(0, GFP_KERNEL);
233 233
234 if (!req || rx_submit(pnd, req, GFP_KERNEL | __GFP_COLD)) { 234 if (!req || rx_submit(pnd, req, GFP_KERNEL | __GFP_COLD)) {
235 usb_free_urb(req);
235 usbpn_close(dev); 236 usbpn_close(dev);
236 return -ENOMEM; 237 return -ENOMEM;
237 } 238 }
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index f4ce5957df32..4cd582a4f625 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1225,6 +1225,26 @@ static const struct usb_device_id cdc_devs[] = {
1225 .driver_info = (unsigned long) &wwan_info, 1225 .driver_info = (unsigned long) &wwan_info,
1226 }, 1226 },
1227 1227
1228 /* Dell branded MBM devices like DW5550 */
1229 { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
1230 | USB_DEVICE_ID_MATCH_VENDOR,
1231 .idVendor = 0x413c,
1232 .bInterfaceClass = USB_CLASS_COMM,
1233 .bInterfaceSubClass = USB_CDC_SUBCLASS_NCM,
1234 .bInterfaceProtocol = USB_CDC_PROTO_NONE,
1235 .driver_info = (unsigned long) &wwan_info,
1236 },
1237
1238 /* Toshiba branded MBM devices */
1239 { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
1240 | USB_DEVICE_ID_MATCH_VENDOR,
1241 .idVendor = 0x0930,
1242 .bInterfaceClass = USB_CLASS_COMM,
1243 .bInterfaceSubClass = USB_CDC_SUBCLASS_NCM,
1244 .bInterfaceProtocol = USB_CDC_PROTO_NONE,
1245 .driver_info = (unsigned long) &wwan_info,
1246 },
1247
1228 /* Generic CDC-NCM devices */ 1248 /* Generic CDC-NCM devices */
1229 { USB_INTERFACE_INFO(USB_CLASS_COMM, 1249 { USB_INTERFACE_INFO(USB_CLASS_COMM,
1230 USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), 1250 USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 2ea126a16d79..328397c66730 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -247,30 +247,12 @@ err:
247 */ 247 */
248static int qmi_wwan_bind_shared(struct usbnet *dev, struct usb_interface *intf) 248static int qmi_wwan_bind_shared(struct usbnet *dev, struct usb_interface *intf)
249{ 249{
250 int rv;
251 struct qmi_wwan_state *info = (void *)&dev->data; 250 struct qmi_wwan_state *info = (void *)&dev->data;
252 251
253 /* ZTE makes devices where the interface descriptors and endpoint
254 * configurations of two or more interfaces are identical, even
255 * though the functions are completely different. If set, then
256 * driver_info->data is a bitmap of acceptable interface numbers
257 * allowing us to bind to one such interface without binding to
258 * all of them
259 */
260 if (dev->driver_info->data &&
261 !test_bit(intf->cur_altsetting->desc.bInterfaceNumber, &dev->driver_info->data)) {
262 dev_info(&intf->dev, "not on our whitelist - ignored");
263 rv = -ENODEV;
264 goto err;
265 }
266
267 /* control and data is shared */ 252 /* control and data is shared */
268 info->control = intf; 253 info->control = intf;
269 info->data = intf; 254 info->data = intf;
270 rv = qmi_wwan_register_subdriver(dev); 255 return qmi_wwan_register_subdriver(dev);
271
272err:
273 return rv;
274} 256}
275 257
276static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf) 258static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
@@ -356,214 +338,64 @@ static const struct driver_info qmi_wwan_shared = {
356 .manage_power = qmi_wwan_manage_power, 338 .manage_power = qmi_wwan_manage_power,
357}; 339};
358 340
359static const struct driver_info qmi_wwan_force_int0 = {
360 .description = "Qualcomm WWAN/QMI device",
361 .flags = FLAG_WWAN,
362 .bind = qmi_wwan_bind_shared,
363 .unbind = qmi_wwan_unbind,
364 .manage_power = qmi_wwan_manage_power,
365 .data = BIT(0), /* interface whitelist bitmap */
366};
367
368static const struct driver_info qmi_wwan_force_int1 = {
369 .description = "Qualcomm WWAN/QMI device",
370 .flags = FLAG_WWAN,
371 .bind = qmi_wwan_bind_shared,
372 .unbind = qmi_wwan_unbind,
373 .manage_power = qmi_wwan_manage_power,
374 .data = BIT(1), /* interface whitelist bitmap */
375};
376
377static const struct driver_info qmi_wwan_force_int2 = {
378 .description = "Qualcomm WWAN/QMI device",
379 .flags = FLAG_WWAN,
380 .bind = qmi_wwan_bind_shared,
381 .unbind = qmi_wwan_unbind,
382 .manage_power = qmi_wwan_manage_power,
383 .data = BIT(2), /* interface whitelist bitmap */
384};
385
386static const struct driver_info qmi_wwan_force_int3 = {
387 .description = "Qualcomm WWAN/QMI device",
388 .flags = FLAG_WWAN,
389 .bind = qmi_wwan_bind_shared,
390 .unbind = qmi_wwan_unbind,
391 .manage_power = qmi_wwan_manage_power,
392 .data = BIT(3), /* interface whitelist bitmap */
393};
394
395static const struct driver_info qmi_wwan_force_int4 = {
396 .description = "Qualcomm WWAN/QMI device",
397 .flags = FLAG_WWAN,
398 .bind = qmi_wwan_bind_shared,
399 .unbind = qmi_wwan_unbind,
400 .manage_power = qmi_wwan_manage_power,
401 .data = BIT(4), /* interface whitelist bitmap */
402};
403
404/* Sierra Wireless provide equally useless interface descriptors
405 * Devices in QMI mode can be switched between two different
406 * configurations:
407 * a) USB interface #8 is QMI/wwan
408 * b) USB interfaces #8, #19 and #20 are QMI/wwan
409 *
410 * Both configurations provide a number of other interfaces (serial++),
411 * some of which have the same endpoint configuration as we expect, so
412 * a whitelist or blacklist is necessary.
413 *
414 * FIXME: The below whitelist should include BIT(20). It does not
415 * because I cannot get it to work...
416 */
417static const struct driver_info qmi_wwan_sierra = {
418 .description = "Sierra Wireless wwan/QMI device",
419 .flags = FLAG_WWAN,
420 .bind = qmi_wwan_bind_shared,
421 .unbind = qmi_wwan_unbind,
422 .manage_power = qmi_wwan_manage_power,
423 .data = BIT(8) | BIT(19), /* interface whitelist bitmap */
424};
425
426#define HUAWEI_VENDOR_ID 0x12D1 341#define HUAWEI_VENDOR_ID 0x12D1
427 342
343/* map QMI/wwan function by a fixed interface number */
344#define QMI_FIXED_INTF(vend, prod, num) \
345 USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
346 .driver_info = (unsigned long)&qmi_wwan_shared
347
428/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */ 348/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
429#define QMI_GOBI1K_DEVICE(vend, prod) \ 349#define QMI_GOBI1K_DEVICE(vend, prod) \
430 USB_DEVICE(vend, prod), \ 350 QMI_FIXED_INTF(vend, prod, 3)
431 .driver_info = (unsigned long)&qmi_wwan_force_int3
432 351
433/* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */ 352/* Gobi 2000/3000 QMI/wwan interface number is 0 according to qcserial */
434#define QMI_GOBI_DEVICE(vend, prod) \ 353#define QMI_GOBI_DEVICE(vend, prod) \
435 USB_DEVICE(vend, prod), \ 354 QMI_FIXED_INTF(vend, prod, 0)
436 .driver_info = (unsigned long)&qmi_wwan_force_int0
437 355
438static const struct usb_device_id products[] = { 356static const struct usb_device_id products[] = {
357 /* 1. CDC ECM like devices match on the control interface */
439 { /* Huawei E392, E398 and possibly others sharing both device id and more... */ 358 { /* Huawei E392, E398 and possibly others sharing both device id and more... */
440 .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, 359 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9),
441 .idVendor = HUAWEI_VENDOR_ID,
442 .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
443 .bInterfaceSubClass = 1,
444 .bInterfaceProtocol = 9, /* CDC Ethernet *control* interface */
445 .driver_info = (unsigned long)&qmi_wwan_info, 360 .driver_info = (unsigned long)&qmi_wwan_info,
446 }, 361 },
447 { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */ 362 { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
448 .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, 363 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57),
449 .idVendor = HUAWEI_VENDOR_ID,
450 .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
451 .bInterfaceSubClass = 1,
452 .bInterfaceProtocol = 57, /* CDC Ethernet *control* interface */
453 .driver_info = (unsigned long)&qmi_wwan_info, 364 .driver_info = (unsigned long)&qmi_wwan_info,
454 }, 365 },
455 { /* Huawei E392, E398 and possibly others in "Windows mode" 366
456 * using a combined control and data interface without any CDC 367 /* 2. Combined interface devices matching on class+protocol */
457 * functional descriptors 368 { /* Huawei E392, E398 and possibly others in "Windows mode" */
458 */ 369 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17),
459 .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO,
460 .idVendor = HUAWEI_VENDOR_ID,
461 .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
462 .bInterfaceSubClass = 1,
463 .bInterfaceProtocol = 17,
464 .driver_info = (unsigned long)&qmi_wwan_shared, 370 .driver_info = (unsigned long)&qmi_wwan_shared,
465 }, 371 },
466 { /* Pantech UML290 */ 372 { /* Pantech UML290 */
467 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, 373 USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
468 .idVendor = 0x106c,
469 .idProduct = 0x3718,
470 .bInterfaceClass = 0xff,
471 .bInterfaceSubClass = 0xf0,
472 .bInterfaceProtocol = 0xff,
473 .driver_info = (unsigned long)&qmi_wwan_shared, 374 .driver_info = (unsigned long)&qmi_wwan_shared,
474 }, 375 },
475 { /* ZTE MF820D */ 376 { /* Pantech UML290 - newer firmware */
476 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, 377 USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
477 .idVendor = 0x19d2, 378 .driver_info = (unsigned long)&qmi_wwan_shared,
478 .idProduct = 0x0167,
479 .bInterfaceClass = 0xff,
480 .bInterfaceSubClass = 0xff,
481 .bInterfaceProtocol = 0xff,
482 .driver_info = (unsigned long)&qmi_wwan_force_int4,
483 },
484 { /* ZTE MF821D */
485 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
486 .idVendor = 0x19d2,
487 .idProduct = 0x0326,
488 .bInterfaceClass = 0xff,
489 .bInterfaceSubClass = 0xff,
490 .bInterfaceProtocol = 0xff,
491 .driver_info = (unsigned long)&qmi_wwan_force_int4,
492 },
493 { /* ZTE (Vodafone) K3520-Z */
494 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
495 .idVendor = 0x19d2,
496 .idProduct = 0x0055,
497 .bInterfaceClass = 0xff,
498 .bInterfaceSubClass = 0xff,
499 .bInterfaceProtocol = 0xff,
500 .driver_info = (unsigned long)&qmi_wwan_force_int1,
501 },
502 { /* ZTE (Vodafone) K3565-Z */
503 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
504 .idVendor = 0x19d2,
505 .idProduct = 0x0063,
506 .bInterfaceClass = 0xff,
507 .bInterfaceSubClass = 0xff,
508 .bInterfaceProtocol = 0xff,
509 .driver_info = (unsigned long)&qmi_wwan_force_int4,
510 },
511 { /* ZTE (Vodafone) K3570-Z */
512 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
513 .idVendor = 0x19d2,
514 .idProduct = 0x1008,
515 .bInterfaceClass = 0xff,
516 .bInterfaceSubClass = 0xff,
517 .bInterfaceProtocol = 0xff,
518 .driver_info = (unsigned long)&qmi_wwan_force_int4,
519 },
520 { /* ZTE (Vodafone) K3571-Z */
521 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
522 .idVendor = 0x19d2,
523 .idProduct = 0x1010,
524 .bInterfaceClass = 0xff,
525 .bInterfaceSubClass = 0xff,
526 .bInterfaceProtocol = 0xff,
527 .driver_info = (unsigned long)&qmi_wwan_force_int4,
528 },
529 { /* ZTE (Vodafone) K3765-Z */
530 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
531 .idVendor = 0x19d2,
532 .idProduct = 0x2002,
533 .bInterfaceClass = 0xff,
534 .bInterfaceSubClass = 0xff,
535 .bInterfaceProtocol = 0xff,
536 .driver_info = (unsigned long)&qmi_wwan_force_int4,
537 },
538 { /* ZTE (Vodafone) K4505-Z */
539 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
540 .idVendor = 0x19d2,
541 .idProduct = 0x0104,
542 .bInterfaceClass = 0xff,
543 .bInterfaceSubClass = 0xff,
544 .bInterfaceProtocol = 0xff,
545 .driver_info = (unsigned long)&qmi_wwan_force_int4,
546 },
547 { /* ZTE MF60 */
548 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
549 .idVendor = 0x19d2,
550 .idProduct = 0x1402,
551 .bInterfaceClass = 0xff,
552 .bInterfaceSubClass = 0xff,
553 .bInterfaceProtocol = 0xff,
554 .driver_info = (unsigned long)&qmi_wwan_force_int2,
555 },
556 { /* Sierra Wireless MC77xx in QMI mode */
557 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
558 .idVendor = 0x1199,
559 .idProduct = 0x68a2,
560 .bInterfaceClass = 0xff,
561 .bInterfaceSubClass = 0xff,
562 .bInterfaceProtocol = 0xff,
563 .driver_info = (unsigned long)&qmi_wwan_sierra,
564 }, 379 },
565 380
566 /* Gobi 1000 devices */ 381 /* 3. Combined interface devices matching on interface number */
382 {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
383 {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */
384 {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */
385 {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */
386 {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
387 {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
388 {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
389 {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
390 {QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
391 {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
392 {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
393 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
394 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
395 {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
396 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
397
398 /* 4. Gobi 1000 devices */
567 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 399 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
568 {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ 400 {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
569 {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ 401 {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
@@ -579,7 +411,7 @@ static const struct usb_device_id products[] = {
579 {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ 411 {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
580 {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ 412 {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
581 413
582 /* Gobi 2000 and 3000 devices */ 414 /* 5. Gobi 2000 and 3000 devices */
583 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ 415 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
584 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ 416 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
585 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ 417 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
@@ -589,6 +421,8 @@ static const struct usb_device_id products[] = {
589 {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ 421 {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
590 {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ 422 {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
591 {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ 423 {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
424 {QMI_GOBI_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
425 {QMI_GOBI_DEVICE(0x1199, 0x68a9)}, /* Sierra Wireless Modem */
592 {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ 426 {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
593 {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ 427 {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
594 {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ 428 {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
@@ -600,11 +434,14 @@ static const struct usb_device_id products[] = {
600 {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ 434 {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
601 {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ 435 {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
602 {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */ 436 {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */
437 {QMI_FIXED_INTF(0x1199, 0x9011, 5)}, /* alternate interface number!? */
603 {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ 438 {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
604 {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ 439 {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
605 {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */ 440 {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
606 {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */ 441 {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
607 {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */ 442 {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
443 {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
444
608 { } /* END */ 445 { } /* END */
609}; 446};
610MODULE_DEVICE_TABLE(usb, products); 447MODULE_DEVICE_TABLE(usb, products);
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index d75d1f56becf..7be49ea60b6d 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -68,15 +68,8 @@ static atomic_t iface_counter = ATOMIC_INIT(0);
68 */ 68 */
69#define SIERRA_NET_USBCTL_BUF_LEN 1024 69#define SIERRA_NET_USBCTL_BUF_LEN 1024
70 70
71/* list of interface numbers - used for constructing interface lists */
72struct sierra_net_iface_info {
73 const u32 infolen; /* number of interface numbers on list */
74 const u8 *ifaceinfo; /* pointer to the array holding the numbers */
75};
76
77struct sierra_net_info_data { 71struct sierra_net_info_data {
78 u16 rx_urb_size; 72 u16 rx_urb_size;
79 struct sierra_net_iface_info whitelist;
80}; 73};
81 74
82/* Private data structure */ 75/* Private data structure */
@@ -637,21 +630,6 @@ static int sierra_net_change_mtu(struct net_device *net, int new_mtu)
637 return usbnet_change_mtu(net, new_mtu); 630 return usbnet_change_mtu(net, new_mtu);
638} 631}
639 632
640static int is_whitelisted(const u8 ifnum,
641 const struct sierra_net_iface_info *whitelist)
642{
643 if (whitelist) {
644 const u8 *list = whitelist->ifaceinfo;
645 int i;
646
647 for (i = 0; i < whitelist->infolen; i++) {
648 if (list[i] == ifnum)
649 return 1;
650 }
651 }
652 return 0;
653}
654
655static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap) 633static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap)
656{ 634{
657 int result = 0; 635 int result = 0;
@@ -706,11 +684,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
706 dev_dbg(&dev->udev->dev, "%s", __func__); 684 dev_dbg(&dev->udev->dev, "%s", __func__);
707 685
708 ifacenum = intf->cur_altsetting->desc.bInterfaceNumber; 686 ifacenum = intf->cur_altsetting->desc.bInterfaceNumber;
709 /* We only accept certain interfaces */
710 if (!is_whitelisted(ifacenum, &data->whitelist)) {
711 dev_dbg(&dev->udev->dev, "Ignoring interface: %d", ifacenum);
712 return -ENODEV;
713 }
714 numendpoints = intf->cur_altsetting->desc.bNumEndpoints; 687 numendpoints = intf->cur_altsetting->desc.bNumEndpoints;
715 /* We have three endpoints, bulk in and out, and a status */ 688 /* We have three endpoints, bulk in and out, and a status */
716 if (numendpoints != 3) { 689 if (numendpoints != 3) {
@@ -945,13 +918,8 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
945 return NULL; 918 return NULL;
946} 919}
947 920
948static const u8 sierra_net_ifnum_list[] = { 7, 10, 11 };
949static const struct sierra_net_info_data sierra_net_info_data_direct_ip = { 921static const struct sierra_net_info_data sierra_net_info_data_direct_ip = {
950 .rx_urb_size = 8 * 1024, 922 .rx_urb_size = 8 * 1024,
951 .whitelist = {
952 .infolen = ARRAY_SIZE(sierra_net_ifnum_list),
953 .ifaceinfo = sierra_net_ifnum_list
954 }
955}; 923};
956 924
957static const struct driver_info sierra_net_info_direct_ip = { 925static const struct driver_info sierra_net_info_direct_ip = {
@@ -965,15 +933,19 @@ static const struct driver_info sierra_net_info_direct_ip = {
965 .data = (unsigned long)&sierra_net_info_data_direct_ip, 933 .data = (unsigned long)&sierra_net_info_data_direct_ip,
966}; 934};
967 935
936#define DIRECT_IP_DEVICE(vend, prod) \
937 {USB_DEVICE_INTERFACE_NUMBER(vend, prod, 7), \
938 .driver_info = (unsigned long)&sierra_net_info_direct_ip}, \
939 {USB_DEVICE_INTERFACE_NUMBER(vend, prod, 10), \
940 .driver_info = (unsigned long)&sierra_net_info_direct_ip}, \
941 {USB_DEVICE_INTERFACE_NUMBER(vend, prod, 11), \
942 .driver_info = (unsigned long)&sierra_net_info_direct_ip}
943
968static const struct usb_device_id products[] = { 944static const struct usb_device_id products[] = {
969 {USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless USB-to-WWAN modem */ 945 DIRECT_IP_DEVICE(0x1199, 0x68A3), /* Sierra Wireless USB-to-WWAN modem */
970 .driver_info = (unsigned long) &sierra_net_info_direct_ip}, 946 DIRECT_IP_DEVICE(0x0F3D, 0x68A3), /* AT&T Direct IP modem */
971 {USB_DEVICE(0x0F3D, 0x68A3), /* AT&T Direct IP modem */ 947 DIRECT_IP_DEVICE(0x1199, 0x68AA), /* Sierra Wireless Direct IP LTE modem */
972 .driver_info = (unsigned long) &sierra_net_info_direct_ip}, 948 DIRECT_IP_DEVICE(0x0F3D, 0x68AA), /* AT&T Direct IP LTE modem */
973 {USB_DEVICE(0x1199, 0x68AA), /* Sierra Wireless Direct IP LTE modem */
974 .driver_info = (unsigned long) &sierra_net_info_direct_ip},
975 {USB_DEVICE(0x0F3D, 0x68AA), /* AT&T Direct IP LTE modem */
976 .driver_info = (unsigned long) &sierra_net_info_direct_ip},
977 949
978 {}, /* last item */ 950 {}, /* last item */
979}; 951};
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 93e0cfb739b8..ce9d4f2c9776 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3019,6 +3019,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
3019 netdev->watchdog_timeo = 5 * HZ; 3019 netdev->watchdog_timeo = 5 * HZ;
3020 3020
3021 INIT_WORK(&adapter->work, vmxnet3_reset_work); 3021 INIT_WORK(&adapter->work, vmxnet3_reset_work);
3022 set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);
3022 3023
3023 if (adapter->intr.type == VMXNET3_IT_MSIX) { 3024 if (adapter->intr.type == VMXNET3_IT_MSIX) {
3024 int i; 3025 int i;
@@ -3043,7 +3044,6 @@ vmxnet3_probe_device(struct pci_dev *pdev,
3043 goto err_register; 3044 goto err_register;
3044 } 3045 }
3045 3046
3046 set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);
3047 vmxnet3_check_link(adapter, false); 3047 vmxnet3_check_link(adapter, false);
3048 atomic_inc(&devices_found); 3048 atomic_inc(&devices_found);
3049 return 0; 3049 return 0;
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 9eb6479306d6..ef36cafd44b7 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -774,14 +774,15 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
774 } 774 }
775 /* Global interrupt queue */ 775 /* Global interrupt queue */
776 writel((u32)(((IRQ_RING_SIZE >> 5) - 1) << 20), ioaddr + IQLENR1); 776 writel((u32)(((IRQ_RING_SIZE >> 5) - 1) << 20), ioaddr + IQLENR1);
777
778 rc = -ENOMEM;
779
777 priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev, 780 priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev,
778 IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma); 781 IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma);
779 if (!priv->iqcfg) 782 if (!priv->iqcfg)
780 goto err_free_irq_5; 783 goto err_free_irq_5;
781 writel(priv->iqcfg_dma, ioaddr + IQCFG); 784 writel(priv->iqcfg_dma, ioaddr + IQCFG);
782 785
783 rc = -ENOMEM;
784
785 /* 786 /*
786 * SCC 0-3 private rx/tx irq structures 787 * SCC 0-3 private rx/tx irq structures
787 * IQRX/TXi needs to be set soon. Learned it the hard way... 788 * IQRX/TXi needs to be set soon. Learned it the hard way...
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index 283237f6f074..def12b38cbf7 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -326,8 +326,10 @@ int i2400m_barker_db_init(const char *_options)
326 unsigned barker; 326 unsigned barker;
327 327
328 options_orig = kstrdup(_options, GFP_KERNEL); 328 options_orig = kstrdup(_options, GFP_KERNEL);
329 if (options_orig == NULL) 329 if (options_orig == NULL) {
330 result = -ENOMEM;
330 goto error_parse; 331 goto error_parse;
332 }
331 options = options_orig; 333 options = options_orig;
332 334
333 while ((token = strsep(&options, ",")) != NULL) { 335 while ((token = strsep(&options, ",")) != NULL) {
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index efc162e0b511..88b8d64c90f1 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -342,7 +342,7 @@ static int at76_dfu_get_status(struct usb_device *udev,
342 return ret; 342 return ret;
343} 343}
344 344
345static u8 at76_dfu_get_state(struct usb_device *udev, u8 *state) 345static int at76_dfu_get_state(struct usb_device *udev, u8 *state)
346{ 346{
347 int ret; 347 int ret;
348 348
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 8c4c040a47b8..2aab20ee9f38 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2056,9 +2056,7 @@ ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf)
2056void 2056void
2057ath5k_beacon_config(struct ath5k_hw *ah) 2057ath5k_beacon_config(struct ath5k_hw *ah)
2058{ 2058{
2059 unsigned long flags; 2059 spin_lock_bh(&ah->block);
2060
2061 spin_lock_irqsave(&ah->block, flags);
2062 ah->bmisscount = 0; 2060 ah->bmisscount = 0;
2063 ah->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA); 2061 ah->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
2064 2062
@@ -2085,7 +2083,7 @@ ath5k_beacon_config(struct ath5k_hw *ah)
2085 2083
2086 ath5k_hw_set_imr(ah, ah->imask); 2084 ath5k_hw_set_imr(ah, ah->imask);
2087 mmiowb(); 2085 mmiowb();
2088 spin_unlock_irqrestore(&ah->block, flags); 2086 spin_unlock_bh(&ah->block);
2089} 2087}
2090 2088
2091static void ath5k_tasklet_beacon(unsigned long data) 2089static void ath5k_tasklet_beacon(unsigned long data)
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 260e7dc7f751..d56453e43d7e 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -254,7 +254,6 @@ ath5k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
254 struct ath5k_vif *avf = (void *)vif->drv_priv; 254 struct ath5k_vif *avf = (void *)vif->drv_priv;
255 struct ath5k_hw *ah = hw->priv; 255 struct ath5k_hw *ah = hw->priv;
256 struct ath_common *common = ath5k_hw_common(ah); 256 struct ath_common *common = ath5k_hw_common(ah);
257 unsigned long flags;
258 257
259 mutex_lock(&ah->lock); 258 mutex_lock(&ah->lock);
260 259
@@ -300,9 +299,9 @@ ath5k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
300 } 299 }
301 300
302 if (changes & BSS_CHANGED_BEACON) { 301 if (changes & BSS_CHANGED_BEACON) {
303 spin_lock_irqsave(&ah->block, flags); 302 spin_lock_bh(&ah->block);
304 ath5k_beacon_update(hw, vif); 303 ath5k_beacon_update(hw, vif);
305 spin_unlock_irqrestore(&ah->block, flags); 304 spin_unlock_bh(&ah->block);
306 } 305 }
307 306
308 if (changes & BSS_CHANGED_BEACON_ENABLED) 307 if (changes & BSS_CHANGED_BEACON_ENABLED)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index cfa91ab7acf8..60b6a9daff7e 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -730,6 +730,7 @@ int ath9k_hw_init(struct ath_hw *ah)
730 case AR9300_DEVID_QCA955X: 730 case AR9300_DEVID_QCA955X:
731 case AR9300_DEVID_AR9580: 731 case AR9300_DEVID_AR9580:
732 case AR9300_DEVID_AR9462: 732 case AR9300_DEVID_AR9462:
733 case AR9485_DEVID_AR1111:
733 break; 734 break;
734 default: 735 default:
735 if (common->bus_ops->ath_bus_type == ATH_USB) 736 if (common->bus_ops->ath_bus_type == ATH_USB)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index dd0c146d81dc..ce7332c64efb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -49,6 +49,7 @@
49#define AR9300_DEVID_AR9462 0x0034 49#define AR9300_DEVID_AR9462 0x0034
50#define AR9300_DEVID_AR9330 0x0035 50#define AR9300_DEVID_AR9330 0x0035
51#define AR9300_DEVID_QCA955X 0x0038 51#define AR9300_DEVID_QCA955X 0x0038
52#define AR9485_DEVID_AR1111 0x0037
52 53
53#define AR5416_AR9100_DEVID 0x000b 54#define AR5416_AR9100_DEVID 0x000b
54 55
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 7990cd55599c..b42be910a83d 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -773,15 +773,10 @@ bool ath9k_hw_intrpend(struct ath_hw *ah)
773} 773}
774EXPORT_SYMBOL(ath9k_hw_intrpend); 774EXPORT_SYMBOL(ath9k_hw_intrpend);
775 775
776void ath9k_hw_disable_interrupts(struct ath_hw *ah) 776void ath9k_hw_kill_interrupts(struct ath_hw *ah)
777{ 777{
778 struct ath_common *common = ath9k_hw_common(ah); 778 struct ath_common *common = ath9k_hw_common(ah);
779 779
780 if (!(ah->imask & ATH9K_INT_GLOBAL))
781 atomic_set(&ah->intr_ref_cnt, -1);
782 else
783 atomic_dec(&ah->intr_ref_cnt);
784
785 ath_dbg(common, INTERRUPT, "disable IER\n"); 780 ath_dbg(common, INTERRUPT, "disable IER\n");
786 REG_WRITE(ah, AR_IER, AR_IER_DISABLE); 781 REG_WRITE(ah, AR_IER, AR_IER_DISABLE);
787 (void) REG_READ(ah, AR_IER); 782 (void) REG_READ(ah, AR_IER);
@@ -793,6 +788,17 @@ void ath9k_hw_disable_interrupts(struct ath_hw *ah)
793 (void) REG_READ(ah, AR_INTR_SYNC_ENABLE); 788 (void) REG_READ(ah, AR_INTR_SYNC_ENABLE);
794 } 789 }
795} 790}
791EXPORT_SYMBOL(ath9k_hw_kill_interrupts);
792
793void ath9k_hw_disable_interrupts(struct ath_hw *ah)
794{
795 if (!(ah->imask & ATH9K_INT_GLOBAL))
796 atomic_set(&ah->intr_ref_cnt, -1);
797 else
798 atomic_dec(&ah->intr_ref_cnt);
799
800 ath9k_hw_kill_interrupts(ah);
801}
796EXPORT_SYMBOL(ath9k_hw_disable_interrupts); 802EXPORT_SYMBOL(ath9k_hw_disable_interrupts);
797 803
798void ath9k_hw_enable_interrupts(struct ath_hw *ah) 804void ath9k_hw_enable_interrupts(struct ath_hw *ah)
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 0eba36dca6f8..4a745e68dd94 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -738,6 +738,7 @@ bool ath9k_hw_intrpend(struct ath_hw *ah);
738void ath9k_hw_set_interrupts(struct ath_hw *ah); 738void ath9k_hw_set_interrupts(struct ath_hw *ah);
739void ath9k_hw_enable_interrupts(struct ath_hw *ah); 739void ath9k_hw_enable_interrupts(struct ath_hw *ah);
740void ath9k_hw_disable_interrupts(struct ath_hw *ah); 740void ath9k_hw_disable_interrupts(struct ath_hw *ah);
741void ath9k_hw_kill_interrupts(struct ath_hw *ah);
741 742
742void ar9002_hw_attach_mac_ops(struct ath_hw *ah); 743void ar9002_hw_attach_mac_ops(struct ath_hw *ah);
743 744
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6049d8b82855..a22df749b8db 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -462,8 +462,10 @@ irqreturn_t ath_isr(int irq, void *dev)
462 if (!ath9k_hw_intrpend(ah)) 462 if (!ath9k_hw_intrpend(ah))
463 return IRQ_NONE; 463 return IRQ_NONE;
464 464
465 if(test_bit(SC_OP_HW_RESET, &sc->sc_flags)) 465 if (test_bit(SC_OP_HW_RESET, &sc->sc_flags)) {
466 ath9k_hw_kill_interrupts(ah);
466 return IRQ_HANDLED; 467 return IRQ_HANDLED;
468 }
467 469
468 /* 470 /*
469 * Figure out the reason(s) for the interrupt. Note 471 * Figure out the reason(s) for the interrupt. Note
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 87b89d55e637..a978984d78a5 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -37,6 +37,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
37 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ 37 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
38 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ 38 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
39 { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */ 39 { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */
40 { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */
40 { 0 } 41 { 0 }
41}; 42};
42 43
@@ -320,6 +321,7 @@ static int ath_pci_suspend(struct device *device)
320 * Otherwise the chip never moved to full sleep, 321 * Otherwise the chip never moved to full sleep,
321 * when no interface is up. 322 * when no interface is up.
322 */ 323 */
324 ath9k_stop_btcoex(sc);
323 ath9k_hw_disable(sc->sc_ah); 325 ath9k_hw_disable(sc->sc_ah);
324 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); 326 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
325 327
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 12aca02228c2..4480c0cc655f 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1044,7 +1044,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1044 struct ieee80211_hw *hw = sc->hw; 1044 struct ieee80211_hw *hw = sc->hw;
1045 struct ieee80211_hdr *hdr; 1045 struct ieee80211_hdr *hdr;
1046 int retval; 1046 int retval;
1047 bool decrypt_error = false;
1048 struct ath_rx_status rs; 1047 struct ath_rx_status rs;
1049 enum ath9k_rx_qtype qtype; 1048 enum ath9k_rx_qtype qtype;
1050 bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA); 1049 bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
@@ -1066,6 +1065,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1066 tsf_lower = tsf & 0xffffffff; 1065 tsf_lower = tsf & 0xffffffff;
1067 1066
1068 do { 1067 do {
1068 bool decrypt_error = false;
1069 /* If handling rx interrupt and flush is in progress => exit */ 1069 /* If handling rx interrupt and flush is in progress => exit */
1070 if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0)) 1070 if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
1071 break; 1071 break;
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index b80352b308d5..a140165dfee0 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2719,32 +2719,37 @@ static int b43_gpio_init(struct b43_wldev *dev)
2719 if (dev->dev->chip_id == 0x4301) { 2719 if (dev->dev->chip_id == 0x4301) {
2720 mask |= 0x0060; 2720 mask |= 0x0060;
2721 set |= 0x0060; 2721 set |= 0x0060;
2722 } else if (dev->dev->chip_id == 0x5354) {
2723 /* Don't allow overtaking buttons GPIOs */
2724 set &= 0x2; /* 0x2 is LED GPIO on BCM5354 */
2722 } 2725 }
2723 if (dev->dev->chip_id == 0x5354) 2726
2724 set &= 0xff02;
2725 if (0 /* FIXME: conditional unknown */ ) { 2727 if (0 /* FIXME: conditional unknown */ ) {
2726 b43_write16(dev, B43_MMIO_GPIO_MASK, 2728 b43_write16(dev, B43_MMIO_GPIO_MASK,
2727 b43_read16(dev, B43_MMIO_GPIO_MASK) 2729 b43_read16(dev, B43_MMIO_GPIO_MASK)
2728 | 0x0100); 2730 | 0x0100);
2729 mask |= 0x0180; 2731 /* BT Coexistance Input */
2730 set |= 0x0180; 2732 mask |= 0x0080;
2733 set |= 0x0080;
2734 /* BT Coexistance Out */
2735 mask |= 0x0100;
2736 set |= 0x0100;
2731 } 2737 }
2732 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) { 2738 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) {
2739 /* PA is controlled by gpio 9, let ucode handle it */
2733 b43_write16(dev, B43_MMIO_GPIO_MASK, 2740 b43_write16(dev, B43_MMIO_GPIO_MASK,
2734 b43_read16(dev, B43_MMIO_GPIO_MASK) 2741 b43_read16(dev, B43_MMIO_GPIO_MASK)
2735 | 0x0200); 2742 | 0x0200);
2736 mask |= 0x0200; 2743 mask |= 0x0200;
2737 set |= 0x0200; 2744 set |= 0x0200;
2738 } 2745 }
2739 if (dev->dev->core_rev >= 2)
2740 mask |= 0x0010; /* FIXME: This is redundant. */
2741 2746
2742 switch (dev->dev->bus_type) { 2747 switch (dev->dev->bus_type) {
2743#ifdef CONFIG_B43_BCMA 2748#ifdef CONFIG_B43_BCMA
2744 case B43_BUS_BCMA: 2749 case B43_BUS_BCMA:
2745 bcma_cc_write32(&dev->dev->bdev->bus->drv_cc, BCMA_CC_GPIOCTL, 2750 bcma_cc_write32(&dev->dev->bdev->bus->drv_cc, BCMA_CC_GPIOCTL,
2746 (bcma_cc_read32(&dev->dev->bdev->bus->drv_cc, 2751 (bcma_cc_read32(&dev->dev->bdev->bus->drv_cc,
2747 BCMA_CC_GPIOCTL) & mask) | set); 2752 BCMA_CC_GPIOCTL) & ~mask) | set);
2748 break; 2753 break;
2749#endif 2754#endif
2750#ifdef CONFIG_B43_SSB 2755#ifdef CONFIG_B43_SSB
@@ -2753,7 +2758,7 @@ static int b43_gpio_init(struct b43_wldev *dev)
2753 if (gpiodev) 2758 if (gpiodev)
2754 ssb_write32(gpiodev, B43_GPIO_CONTROL, 2759 ssb_write32(gpiodev, B43_GPIO_CONTROL,
2755 (ssb_read32(gpiodev, B43_GPIO_CONTROL) 2760 (ssb_read32(gpiodev, B43_GPIO_CONTROL)
2756 & mask) | set); 2761 & ~mask) | set);
2757 break; 2762 break;
2758#endif 2763#endif
2759 } 2764 }
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 9a4c63f927cb..7ed7d7577024 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
@@ -382,9 +382,7 @@ brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
382{ 382{
383 struct brcms_c_info *wlc = wlc_cm->wlc; 383 struct brcms_c_info *wlc = wlc_cm->wlc;
384 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel; 384 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel;
385 const struct ieee80211_reg_rule *reg_rule;
386 struct txpwr_limits txpwr; 385 struct txpwr_limits txpwr;
387 int ret;
388 386
389 brcms_c_channel_reg_limits(wlc_cm, chanspec, &txpwr); 387 brcms_c_channel_reg_limits(wlc_cm, chanspec, &txpwr);
390 388
@@ -393,8 +391,7 @@ brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
393 ); 391 );
394 392
395 /* set or restore gmode as required by regulatory */ 393 /* set or restore gmode as required by regulatory */
396 ret = freq_reg_info(wlc->wiphy, ch->center_freq, 0, &reg_rule); 394 if (ch->flags & IEEE80211_CHAN_NO_OFDM)
397 if (!ret && (reg_rule->flags & NL80211_RRF_NO_OFDM))
398 brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false); 395 brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false);
399 else 396 else
400 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false); 397 brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 9e79d47e077f..192ad5c1fcc8 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -121,7 +121,8 @@ static struct ieee80211_channel brcms_2ghz_chantable[] = {
121 IEEE80211_CHAN_NO_HT40PLUS), 121 IEEE80211_CHAN_NO_HT40PLUS),
122 CHAN2GHZ(14, 2484, 122 CHAN2GHZ(14, 2484,
123 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS | 123 IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
124 IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS) 124 IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS |
125 IEEE80211_CHAN_NO_OFDM)
125}; 126};
126 127
127static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = { 128static struct ieee80211_channel brcms_5ghz_nphy_chantable[] = {
diff --git a/drivers/net/wireless/iwlwifi/dvm/rs.c b/drivers/net/wireless/iwlwifi/dvm/rs.c
index 6fddd2785e6e..a82f46c10f5e 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rs.c
@@ -707,11 +707,14 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
707 */ 707 */
708static bool rs_use_green(struct ieee80211_sta *sta) 708static bool rs_use_green(struct ieee80211_sta *sta)
709{ 709{
710 struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; 710 /*
711 struct iwl_rxon_context *ctx = sta_priv->ctx; 711 * There's a bug somewhere in this code that causes the
712 712 * scaling to get stuck because GF+SGI can't be combined
713 return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && 713 * in SISO rates. Until we find that bug, disable GF, it
714 !(ctx->ht.non_gf_sta_present); 714 * has only limited benefit and we still interoperate with
715 * GF APs since we can always receive GF transmissions.
716 */
717 return false;
715} 718}
716 719
717/** 720/**
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index eb5de800ed90..1c10b542ab23 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -1254,6 +1254,7 @@ static int lbs_associate(struct lbs_private *priv,
1254 netif_tx_wake_all_queues(priv->dev); 1254 netif_tx_wake_all_queues(priv->dev);
1255 } 1255 }
1256 1256
1257 kfree(cmd);
1257done: 1258done:
1258 lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); 1259 lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
1259 return ret; 1260 return ret;
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 76caebaa4397..e970897f6ab5 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1314,6 +1314,7 @@ static void if_sdio_remove(struct sdio_func *func)
1314 kfree(packet); 1314 kfree(packet);
1315 } 1315 }
1316 1316
1317 kfree(card);
1317 lbs_deb_leave(LBS_DEB_SDIO); 1318 lbs_deb_leave(LBS_DEB_SDIO);
1318} 1319}
1319 1320
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 58048189bd24..fe1ea43c5149 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -571,7 +571,10 @@ static int lbs_thread(void *data)
571 netdev_info(dev, "Timeout submitting command 0x%04x\n", 571 netdev_info(dev, "Timeout submitting command 0x%04x\n",
572 le16_to_cpu(cmdnode->cmdbuf->command)); 572 le16_to_cpu(cmdnode->cmdbuf->command));
573 lbs_complete_command(priv, cmdnode, -ETIMEDOUT); 573 lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
574 if (priv->reset_card) 574
575 /* Reset card, but only when it isn't in the process
576 * of being shutdown anyway. */
577 if (!dev->dismantle && priv->reset_card)
575 priv->reset_card(priv); 578 priv->reset_card(priv);
576 } 579 }
577 priv->cmd_timed_out = 0; 580 priv->cmd_timed_out = 0;
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 7f207b6e9552..effb044a8a9d 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -42,7 +42,7 @@ MODULE_FIRMWARE("isl3887usb");
42 * whenever you add a new device. 42 * whenever you add a new device.
43 */ 43 */
44 44
45static struct usb_device_id p54u_table[] __devinitdata = { 45static struct usb_device_id p54u_table[] = {
46 /* Version 1 devices (pci chip + net2280) */ 46 /* Version 1 devices (pci chip + net2280) */
47 {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */ 47 {USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */
48 {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ 48 {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 241162e8111d..7a4ae9ee1c63 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1803,6 +1803,7 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
1803 struct cfg80211_pmksa *pmksa, 1803 struct cfg80211_pmksa *pmksa,
1804 int max_pmkids) 1804 int max_pmkids)
1805{ 1805{
1806 struct ndis_80211_pmkid *new_pmkids;
1806 int i, err, newlen; 1807 int i, err, newlen;
1807 unsigned int count; 1808 unsigned int count;
1808 1809
@@ -1833,11 +1834,12 @@ static struct ndis_80211_pmkid *update_pmkid(struct usbnet *usbdev,
1833 /* add new pmkid */ 1834 /* add new pmkid */
1834 newlen = sizeof(*pmkids) + (count + 1) * sizeof(pmkids->bssid_info[0]); 1835 newlen = sizeof(*pmkids) + (count + 1) * sizeof(pmkids->bssid_info[0]);
1835 1836
1836 pmkids = krealloc(pmkids, newlen, GFP_KERNEL); 1837 new_pmkids = krealloc(pmkids, newlen, GFP_KERNEL);
1837 if (!pmkids) { 1838 if (!new_pmkids) {
1838 err = -ENOMEM; 1839 err = -ENOMEM;
1839 goto error; 1840 goto error;
1840 } 1841 }
1842 pmkids = new_pmkids;
1841 1843
1842 pmkids->length = cpu_to_le32(newlen); 1844 pmkids->length = cpu_to_le32(newlen);
1843 pmkids->bssid_info_count = cpu_to_le32(count + 1); 1845 pmkids->bssid_info_count = cpu_to_le32(count + 1);
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 88455b1b9fe0..cb8c2aca54e4 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -221,6 +221,67 @@ static void rt2800_rf_write(struct rt2x00_dev *rt2x00dev,
221 mutex_unlock(&rt2x00dev->csr_mutex); 221 mutex_unlock(&rt2x00dev->csr_mutex);
222} 222}
223 223
224static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev)
225{
226 u32 reg;
227 int i, count;
228
229 rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL, &reg);
230 if (rt2x00_get_field32(reg, WLAN_EN))
231 return 0;
232
233 rt2x00_set_field32(&reg, WLAN_GPIO_OUT_OE_BIT_ALL, 0xff);
234 rt2x00_set_field32(&reg, FRC_WL_ANT_SET, 1);
235 rt2x00_set_field32(&reg, WLAN_CLK_EN, 0);
236 rt2x00_set_field32(&reg, WLAN_EN, 1);
237 rt2800_register_write(rt2x00dev, WLAN_FUN_CTRL, reg);
238
239 udelay(REGISTER_BUSY_DELAY);
240
241 count = 0;
242 do {
243 /*
244 * Check PLL_LD & XTAL_RDY.
245 */
246 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
247 rt2800_register_read(rt2x00dev, CMB_CTRL, &reg);
248 if (rt2x00_get_field32(reg, PLL_LD) &&
249 rt2x00_get_field32(reg, XTAL_RDY))
250 break;
251 udelay(REGISTER_BUSY_DELAY);
252 }
253
254 if (i >= REGISTER_BUSY_COUNT) {
255
256 if (count >= 10)
257 return -EIO;
258
259 rt2800_register_write(rt2x00dev, 0x58, 0x018);
260 udelay(REGISTER_BUSY_DELAY);
261 rt2800_register_write(rt2x00dev, 0x58, 0x418);
262 udelay(REGISTER_BUSY_DELAY);
263 rt2800_register_write(rt2x00dev, 0x58, 0x618);
264 udelay(REGISTER_BUSY_DELAY);
265 count++;
266 } else {
267 count = 0;
268 }
269
270 rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL, &reg);
271 rt2x00_set_field32(&reg, PCIE_APP0_CLK_REQ, 0);
272 rt2x00_set_field32(&reg, WLAN_CLK_EN, 1);
273 rt2x00_set_field32(&reg, WLAN_RESET, 1);
274 rt2800_register_write(rt2x00dev, WLAN_FUN_CTRL, reg);
275 udelay(10);
276 rt2x00_set_field32(&reg, WLAN_RESET, 0);
277 rt2800_register_write(rt2x00dev, WLAN_FUN_CTRL, reg);
278 udelay(10);
279 rt2800_register_write(rt2x00dev, INT_SOURCE_CSR, 0x7fffffff);
280 } while (count != 0);
281
282 return 0;
283}
284
224void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, 285void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev,
225 const u8 command, const u8 token, 286 const u8 command, const u8 token,
226 const u8 arg0, const u8 arg1) 287 const u8 arg0, const u8 arg1)
@@ -400,6 +461,13 @@ int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev,
400{ 461{
401 unsigned int i; 462 unsigned int i;
402 u32 reg; 463 u32 reg;
464 int retval;
465
466 if (rt2x00_rt(rt2x00dev, RT3290)) {
467 retval = rt2800_enable_wlan_rt3290(rt2x00dev);
468 if (retval)
469 return -EBUSY;
470 }
403 471
404 /* 472 /*
405 * If driver doesn't wake up firmware here, 473 * If driver doesn't wake up firmware here,
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 235376e9cb04..98aa426a3564 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -980,66 +980,6 @@ static int rt2800pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
980 return rt2800_validate_eeprom(rt2x00dev); 980 return rt2800_validate_eeprom(rt2x00dev);
981} 981}
982 982
983static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev)
984{
985 u32 reg;
986 int i, count;
987
988 rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL, &reg);
989 if (rt2x00_get_field32(reg, WLAN_EN))
990 return 0;
991
992 rt2x00_set_field32(&reg, WLAN_GPIO_OUT_OE_BIT_ALL, 0xff);
993 rt2x00_set_field32(&reg, FRC_WL_ANT_SET, 1);
994 rt2x00_set_field32(&reg, WLAN_CLK_EN, 0);
995 rt2x00_set_field32(&reg, WLAN_EN, 1);
996 rt2800_register_write(rt2x00dev, WLAN_FUN_CTRL, reg);
997
998 udelay(REGISTER_BUSY_DELAY);
999
1000 count = 0;
1001 do {
1002 /*
1003 * Check PLL_LD & XTAL_RDY.
1004 */
1005 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
1006 rt2800_register_read(rt2x00dev, CMB_CTRL, &reg);
1007 if (rt2x00_get_field32(reg, PLL_LD) &&
1008 rt2x00_get_field32(reg, XTAL_RDY))
1009 break;
1010 udelay(REGISTER_BUSY_DELAY);
1011 }
1012
1013 if (i >= REGISTER_BUSY_COUNT) {
1014
1015 if (count >= 10)
1016 return -EIO;
1017
1018 rt2800_register_write(rt2x00dev, 0x58, 0x018);
1019 udelay(REGISTER_BUSY_DELAY);
1020 rt2800_register_write(rt2x00dev, 0x58, 0x418);
1021 udelay(REGISTER_BUSY_DELAY);
1022 rt2800_register_write(rt2x00dev, 0x58, 0x618);
1023 udelay(REGISTER_BUSY_DELAY);
1024 count++;
1025 } else {
1026 count = 0;
1027 }
1028
1029 rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL, &reg);
1030 rt2x00_set_field32(&reg, PCIE_APP0_CLK_REQ, 0);
1031 rt2x00_set_field32(&reg, WLAN_CLK_EN, 1);
1032 rt2x00_set_field32(&reg, WLAN_RESET, 1);
1033 rt2800_register_write(rt2x00dev, WLAN_FUN_CTRL, reg);
1034 udelay(10);
1035 rt2x00_set_field32(&reg, WLAN_RESET, 0);
1036 rt2800_register_write(rt2x00dev, WLAN_FUN_CTRL, reg);
1037 udelay(10);
1038 rt2800_register_write(rt2x00dev, INT_SOURCE_CSR, 0x7fffffff);
1039 } while (count != 0);
1040
1041 return 0;
1042}
1043static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) 983static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1044{ 984{
1045 int retval; 985 int retval;
@@ -1063,17 +1003,6 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1063 return retval; 1003 return retval;
1064 1004
1065 /* 1005 /*
1066 * In probe phase call rt2800_enable_wlan_rt3290 to enable wlan
1067 * clk for rt3290. That avoid the MCU fail in start phase.
1068 */
1069 if (rt2x00_rt(rt2x00dev, RT3290)) {
1070 retval = rt2800_enable_wlan_rt3290(rt2x00dev);
1071
1072 if (retval)
1073 return retval;
1074 }
1075
1076 /*
1077 * This device has multiple filters for control frames 1006 * This device has multiple filters for control frames
1078 * and has a separate filter for PS Poll frames. 1007 * and has a separate filter for PS Poll frames.
1079 */ 1008 */
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index f32259686b45..3f7bc5cadf9a 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2243,8 +2243,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
2243 2243
2244static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev) 2244static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev)
2245{ 2245{
2246 struct ieee80211_conf conf = { .flags = 0 }; 2246 struct rt2x00lib_conf libconf = { .conf = &rt2x00dev->hw->conf };
2247 struct rt2x00lib_conf libconf = { .conf = &conf };
2248 2247
2249 rt61pci_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS); 2248 rt61pci_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS);
2250} 2249}
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 71a30b026089..533024095c43 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -44,7 +44,7 @@ MODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>");
44MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver"); 44MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver");
45MODULE_LICENSE("GPL"); 45MODULE_LICENSE("GPL");
46 46
47static struct usb_device_id rtl8187_table[] __devinitdata = { 47static struct usb_device_id rtl8187_table[] = {
48 /* Asus */ 48 /* Asus */
49 {USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187}, 49 {USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187},
50 /* Belkin */ 50 /* Belkin */