aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-26 21:40:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-26 21:40:19 -0400
commitf35c69b736e4f910d7447346980145212c283570 (patch)
tree824b90cd870e6de07bbba19d761c1c74cf1fb4a7 /drivers/net
parentcd4373984a5903276f52777a6003425e023eaa7e (diff)
parente4aa937ec75df0eea0bee03bffa3303ad36c986b (diff)
Merge 3.10-rc3 into char-misc-next
We want the changes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_3ad.c21
-rw-r--r--drivers/net/bonding/bond_3ad.h2
-rw-r--r--drivers/net/bonding/bond_main.c26
-rw-r--r--drivers/net/bonding/bond_procfs.c2
-rw-r--r--drivers/net/bonding/bond_sysfs.c13
-rw-r--r--drivers/net/caif/Kconfig2
-rw-r--r--drivers/net/ethernet/3com/3c59x.c25
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c9
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c61
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c5
-rw-r--r--drivers/net/ethernet/cadence/Kconfig3
-rw-r--r--drivers/net/ethernet/cadence/macb.c18
-rw-r--r--drivers/net/ethernet/cadence/macb.h7
-rw-r--r--drivers/net/ethernet/calxeda/Kconfig2
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.c13
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c18
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c34
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ptp.c1
-rw-r--r--drivers/net/ethernet/ibm/emac/core.c36
-rw-r--r--drivers/net/ethernet/icplus/ipg.h86
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c6
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_resources.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/fw.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/resource_tracker.c29
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic.h8
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c95
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c24
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c54
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c49
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h2
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c111
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c9
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c3
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c3
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_main.c7
-rw-r--r--drivers/net/ethernet/realtek/8139cp.c1
-rw-r--r--drivers/net/ethernet/realtek/r8169.c41
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c5
-rw-r--r--drivers/net/ethernet/sfc/efx.c8
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h31
-rw-r--r--drivers/net/ethernet/sfc/rx.c8
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/Kconfig2
-rw-r--r--drivers/net/macvlan.c7
-rw-r--r--drivers/net/ntb_netdev.c2
-rw-r--r--drivers/net/usb/qmi_wwan.c1
-rw-r--r--drivers/net/usb/rtl8150.c100
-rw-r--r--drivers/net/usb/usbnet.c2
-rw-r--r--drivers/net/virtio_net.c11
-rw-r--r--drivers/net/vxlan.c17
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_calib.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9485_initvals.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h138
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h5
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c74
-rw-r--r--drivers/net/wireless/b43/dma.c19
-rw-r--r--drivers/net/wireless/b43/dma.h4
-rw-r--r--drivers/net/wireless/b43/main.c43
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c7
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c3
-rw-r--r--drivers/net/wireless/iwlegacy/common.c2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api.h27
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c12
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c17
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/ops.c1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c6
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/sta.c13
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/sta.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/tx.c48
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c18
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c3
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c1
-rw-r--r--drivers/net/wireless/mwifiex/main.c1
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c21
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8188ee/trx.h4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c1
83 files changed, 966 insertions, 586 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index fc58d118d844..390061d09693 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2360,14 +2360,15 @@ int bond_3ad_set_carrier(struct bonding *bond)
2360} 2360}
2361 2361
2362/** 2362/**
2363 * bond_3ad_get_active_agg_info - get information of the active aggregator 2363 * __bond_3ad_get_active_agg_info - get information of the active aggregator
2364 * @bond: bonding struct to work on 2364 * @bond: bonding struct to work on
2365 * @ad_info: ad_info struct to fill with the bond's info 2365 * @ad_info: ad_info struct to fill with the bond's info
2366 * 2366 *
2367 * Returns: 0 on success 2367 * Returns: 0 on success
2368 * < 0 on error 2368 * < 0 on error
2369 */ 2369 */
2370int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) 2370int __bond_3ad_get_active_agg_info(struct bonding *bond,
2371 struct ad_info *ad_info)
2371{ 2372{
2372 struct aggregator *aggregator = NULL; 2373 struct aggregator *aggregator = NULL;
2373 struct port *port; 2374 struct port *port;
@@ -2391,6 +2392,18 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
2391 return -1; 2392 return -1;
2392} 2393}
2393 2394
2395/* Wrapper used to hold bond->lock so no slave manipulation can occur */
2396int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
2397{
2398 int ret;
2399
2400 read_lock(&bond->lock);
2401 ret = __bond_3ad_get_active_agg_info(bond, ad_info);
2402 read_unlock(&bond->lock);
2403
2404 return ret;
2405}
2406
2394int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) 2407int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
2395{ 2408{
2396 struct slave *slave, *start_at; 2409 struct slave *slave, *start_at;
@@ -2402,8 +2415,8 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
2402 struct ad_info ad_info; 2415 struct ad_info ad_info;
2403 int res = 1; 2416 int res = 1;
2404 2417
2405 if (bond_3ad_get_active_agg_info(bond, &ad_info)) { 2418 if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
2406 pr_debug("%s: Error: bond_3ad_get_active_agg_info failed\n", 2419 pr_debug("%s: Error: __bond_3ad_get_active_agg_info failed\n",
2407 dev->name); 2420 dev->name);
2408 goto out; 2421 goto out;
2409 } 2422 }
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h
index 0cfaa4afdece..5d91ad0cc041 100644
--- a/drivers/net/bonding/bond_3ad.h
+++ b/drivers/net/bonding/bond_3ad.h
@@ -273,6 +273,8 @@ void bond_3ad_adapter_speed_changed(struct slave *slave);
273void bond_3ad_adapter_duplex_changed(struct slave *slave); 273void bond_3ad_adapter_duplex_changed(struct slave *slave);
274void bond_3ad_handle_link_change(struct slave *slave, char link); 274void bond_3ad_handle_link_change(struct slave *slave, char link);
275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
276int __bond_3ad_get_active_agg_info(struct bonding *bond,
277 struct ad_info *ad_info);
276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 278int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
277int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond, 279int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
278 struct slave *slave); 280 struct slave *slave);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d0aade04e49a..29b846cbfb48 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1362,6 +1362,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
1362 slave->dev->features, 1362 slave->dev->features,
1363 mask); 1363 mask);
1364 } 1364 }
1365 features = netdev_add_tso_features(features, mask);
1365 1366
1366out: 1367out:
1367 read_unlock(&bond->lock); 1368 read_unlock(&bond->lock);
@@ -2555,8 +2556,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_
2555{ 2556{
2556 struct sk_buff *skb; 2557 struct sk_buff *skb;
2557 2558
2558 pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op, 2559 pr_debug("arp %d on slave %s: dst %pI4 src %pI4 vid %d\n", arp_op,
2559 slave_dev->name, dest_ip, src_ip, vlan_id); 2560 slave_dev->name, &dest_ip, &src_ip, vlan_id);
2560 2561
2561 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip, 2562 skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip,
2562 NULL, slave_dev->dev_addr, NULL); 2563 NULL, slave_dev->dev_addr, NULL);
@@ -2588,7 +2589,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2588 __be32 addr; 2589 __be32 addr;
2589 if (!targets[i]) 2590 if (!targets[i])
2590 break; 2591 break;
2591 pr_debug("basa: target %x\n", targets[i]); 2592 pr_debug("basa: target %pI4\n", &targets[i]);
2592 if (!bond_vlan_used(bond)) { 2593 if (!bond_vlan_used(bond)) {
2593 pr_debug("basa: empty vlan: arp_send\n"); 2594 pr_debug("basa: empty vlan: arp_send\n");
2594 addr = bond_confirm_addr(bond->dev, targets[i], 0); 2595 addr = bond_confirm_addr(bond->dev, targets[i], 0);
@@ -4470,7 +4471,7 @@ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)
4470 4471
4471static int bond_check_params(struct bond_params *params) 4472static int bond_check_params(struct bond_params *params)
4472{ 4473{
4473 int arp_validate_value, fail_over_mac_value, primary_reselect_value; 4474 int arp_validate_value, fail_over_mac_value, primary_reselect_value, i;
4474 4475
4475 /* 4476 /*
4476 * Convert string parameters. 4477 * Convert string parameters.
@@ -4650,19 +4651,18 @@ static int bond_check_params(struct bond_params *params)
4650 arp_interval = BOND_LINK_ARP_INTERV; 4651 arp_interval = BOND_LINK_ARP_INTERV;
4651 } 4652 }
4652 4653
4653 for (arp_ip_count = 0; 4654 for (arp_ip_count = 0, i = 0;
4654 (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[arp_ip_count]; 4655 (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[i]; i++) {
4655 arp_ip_count++) {
4656 /* not complete check, but should be good enough to 4656 /* not complete check, but should be good enough to
4657 catch mistakes */ 4657 catch mistakes */
4658 __be32 ip = in_aton(arp_ip_target[arp_ip_count]); 4658 __be32 ip = in_aton(arp_ip_target[i]);
4659 if (!isdigit(arp_ip_target[arp_ip_count][0]) || 4659 if (!isdigit(arp_ip_target[i][0]) || ip == 0 ||
4660 ip == 0 || ip == htonl(INADDR_BROADCAST)) { 4660 ip == htonl(INADDR_BROADCAST)) {
4661 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", 4661 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
4662 arp_ip_target[arp_ip_count]); 4662 arp_ip_target[i]);
4663 arp_interval = 0; 4663 arp_interval = 0;
4664 } else { 4664 } else {
4665 arp_target[arp_ip_count] = ip; 4665 arp_target[arp_ip_count++] = ip;
4666 } 4666 }
4667 } 4667 }
4668 4668
@@ -4696,8 +4696,6 @@ static int bond_check_params(struct bond_params *params)
4696 if (miimon) { 4696 if (miimon) {
4697 pr_info("MII link monitoring set to %d ms\n", miimon); 4697 pr_info("MII link monitoring set to %d ms\n", miimon);
4698 } else if (arp_interval) { 4698 } else if (arp_interval) {
4699 int i;
4700
4701 pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):", 4699 pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):",
4702 arp_interval, 4700 arp_interval,
4703 arp_validate_tbl[arp_validate_value].modename, 4701 arp_validate_tbl[arp_validate_value].modename,
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 94d06f1307b8..4060d41f0ee7 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -130,7 +130,7 @@ static void bond_info_show_master(struct seq_file *seq)
130 seq_printf(seq, "Aggregator selection policy (ad_select): %s\n", 130 seq_printf(seq, "Aggregator selection policy (ad_select): %s\n",
131 ad_select_tbl[bond->params.ad_select].modename); 131 ad_select_tbl[bond->params.ad_select].modename);
132 132
133 if (bond_3ad_get_active_agg_info(bond, &ad_info)) { 133 if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
134 seq_printf(seq, "bond %s has no active aggregator\n", 134 seq_printf(seq, "bond %s has no active aggregator\n",
135 bond->dev->name); 135 bond->dev->name);
136 } else { 136 } else {
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ea7a388f4843..d7434e0a610e 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -316,6 +316,9 @@ static ssize_t bonding_store_mode(struct device *d,
316 int new_value, ret = count; 316 int new_value, ret = count;
317 struct bonding *bond = to_bond(d); 317 struct bonding *bond = to_bond(d);
318 318
319 if (!rtnl_trylock())
320 return restart_syscall();
321
319 if (bond->dev->flags & IFF_UP) { 322 if (bond->dev->flags & IFF_UP) {
320 pr_err("unable to update mode of %s because interface is up.\n", 323 pr_err("unable to update mode of %s because interface is up.\n",
321 bond->dev->name); 324 bond->dev->name);
@@ -352,6 +355,7 @@ static ssize_t bonding_store_mode(struct device *d,
352 bond->dev->name, bond_mode_tbl[new_value].modename, 355 bond->dev->name, bond_mode_tbl[new_value].modename,
353 new_value); 356 new_value);
354out: 357out:
358 rtnl_unlock();
355 return ret; 359 return ret;
356} 360}
357static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, 361static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
@@ -1315,7 +1319,6 @@ static ssize_t bonding_show_mii_status(struct device *d,
1315} 1319}
1316static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL); 1320static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL);
1317 1321
1318
1319/* 1322/*
1320 * Show current 802.3ad aggregator ID. 1323 * Show current 802.3ad aggregator ID.
1321 */ 1324 */
@@ -1329,7 +1332,7 @@ static ssize_t bonding_show_ad_aggregator(struct device *d,
1329 if (bond->params.mode == BOND_MODE_8023AD) { 1332 if (bond->params.mode == BOND_MODE_8023AD) {
1330 struct ad_info ad_info; 1333 struct ad_info ad_info;
1331 count = sprintf(buf, "%d\n", 1334 count = sprintf(buf, "%d\n",
1332 (bond_3ad_get_active_agg_info(bond, &ad_info)) 1335 bond_3ad_get_active_agg_info(bond, &ad_info)
1333 ? 0 : ad_info.aggregator_id); 1336 ? 0 : ad_info.aggregator_id);
1334 } 1337 }
1335 1338
@@ -1351,7 +1354,7 @@ static ssize_t bonding_show_ad_num_ports(struct device *d,
1351 if (bond->params.mode == BOND_MODE_8023AD) { 1354 if (bond->params.mode == BOND_MODE_8023AD) {
1352 struct ad_info ad_info; 1355 struct ad_info ad_info;
1353 count = sprintf(buf, "%d\n", 1356 count = sprintf(buf, "%d\n",
1354 (bond_3ad_get_active_agg_info(bond, &ad_info)) 1357 bond_3ad_get_active_agg_info(bond, &ad_info)
1355 ? 0 : ad_info.ports); 1358 ? 0 : ad_info.ports);
1356 } 1359 }
1357 1360
@@ -1373,7 +1376,7 @@ static ssize_t bonding_show_ad_actor_key(struct device *d,
1373 if (bond->params.mode == BOND_MODE_8023AD) { 1376 if (bond->params.mode == BOND_MODE_8023AD) {
1374 struct ad_info ad_info; 1377 struct ad_info ad_info;
1375 count = sprintf(buf, "%d\n", 1378 count = sprintf(buf, "%d\n",
1376 (bond_3ad_get_active_agg_info(bond, &ad_info)) 1379 bond_3ad_get_active_agg_info(bond, &ad_info)
1377 ? 0 : ad_info.actor_key); 1380 ? 0 : ad_info.actor_key);
1378 } 1381 }
1379 1382
@@ -1395,7 +1398,7 @@ static ssize_t bonding_show_ad_partner_key(struct device *d,
1395 if (bond->params.mode == BOND_MODE_8023AD) { 1398 if (bond->params.mode == BOND_MODE_8023AD) {
1396 struct ad_info ad_info; 1399 struct ad_info ad_info;
1397 count = sprintf(buf, "%d\n", 1400 count = sprintf(buf, "%d\n",
1398 (bond_3ad_get_active_agg_info(bond, &ad_info)) 1401 bond_3ad_get_active_agg_info(bond, &ad_info)
1399 ? 0 : ad_info.partner_key); 1402 ? 0 : ad_info.partner_key);
1400 } 1403 }
1401 1404
diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig
index 7ffc756131a2..547098086773 100644
--- a/drivers/net/caif/Kconfig
+++ b/drivers/net/caif/Kconfig
@@ -43,7 +43,7 @@ config CAIF_HSI
43 43
44config CAIF_VIRTIO 44config CAIF_VIRTIO
45 tristate "CAIF virtio transport driver" 45 tristate "CAIF virtio transport driver"
46 depends on CAIF 46 depends on CAIF && HAS_DMA
47 select VHOST_RING 47 select VHOST_RING
48 select VIRTIO 48 select VIRTIO
49 select GENERIC_ALLOCATOR 49 select GENERIC_ALLOCATOR
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index de570a8f8967..072c6f14e8fc 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -632,7 +632,6 @@ struct vortex_private {
632 pm_state_valid:1, /* pci_dev->saved_config_space has sane contents */ 632 pm_state_valid:1, /* pci_dev->saved_config_space has sane contents */
633 open:1, 633 open:1,
634 medialock:1, 634 medialock:1,
635 must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */
636 large_frames:1, /* accept large frames */ 635 large_frames:1, /* accept large frames */
637 handling_irq:1; /* private in_irq indicator */ 636 handling_irq:1; /* private in_irq indicator */
638 /* {get|set}_wol operations are already serialized by rtnl. 637 /* {get|set}_wol operations are already serialized by rtnl.
@@ -1012,6 +1011,12 @@ static int vortex_init_one(struct pci_dev *pdev,
1012 if (rc < 0) 1011 if (rc < 0)
1013 goto out; 1012 goto out;
1014 1013
1014 rc = pci_request_regions(pdev, DRV_NAME);
1015 if (rc < 0) {
1016 pci_disable_device(pdev);
1017 goto out;
1018 }
1019
1015 unit = vortex_cards_found; 1020 unit = vortex_cards_found;
1016 1021
1017 if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) { 1022 if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) {
@@ -1027,6 +1032,7 @@ static int vortex_init_one(struct pci_dev *pdev,
1027 if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ 1032 if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */
1028 ioaddr = pci_iomap(pdev, 0, 0); 1033 ioaddr = pci_iomap(pdev, 0, 0);
1029 if (!ioaddr) { 1034 if (!ioaddr) {
1035 pci_release_regions(pdev);
1030 pci_disable_device(pdev); 1036 pci_disable_device(pdev);
1031 rc = -ENOMEM; 1037 rc = -ENOMEM;
1032 goto out; 1038 goto out;
@@ -1036,6 +1042,7 @@ static int vortex_init_one(struct pci_dev *pdev,
1036 ent->driver_data, unit); 1042 ent->driver_data, unit);
1037 if (rc < 0) { 1043 if (rc < 0) {
1038 pci_iounmap(pdev, ioaddr); 1044 pci_iounmap(pdev, ioaddr);
1045 pci_release_regions(pdev);
1039 pci_disable_device(pdev); 1046 pci_disable_device(pdev);
1040 goto out; 1047 goto out;
1041 } 1048 }
@@ -1178,11 +1185,6 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
1178 1185
1179 /* PCI-only startup logic */ 1186 /* PCI-only startup logic */
1180 if (pdev) { 1187 if (pdev) {
1181 /* EISA resources already marked, so only PCI needs to do this here */
1182 /* Ignore return value, because Cardbus drivers already allocate for us */
1183 if (request_region(dev->base_addr, vci->io_size, print_name) != NULL)
1184 vp->must_free_region = 1;
1185
1186 /* enable bus-mastering if necessary */ 1188 /* enable bus-mastering if necessary */
1187 if (vci->flags & PCI_USES_MASTER) 1189 if (vci->flags & PCI_USES_MASTER)
1188 pci_set_master(pdev); 1190 pci_set_master(pdev);
@@ -1220,7 +1222,7 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
1220 &vp->rx_ring_dma); 1222 &vp->rx_ring_dma);
1221 retval = -ENOMEM; 1223 retval = -ENOMEM;
1222 if (!vp->rx_ring) 1224 if (!vp->rx_ring)
1223 goto free_region; 1225 goto free_device;
1224 1226
1225 vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE); 1227 vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE);
1226 vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE; 1228 vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE;
@@ -1484,9 +1486,7 @@ free_ring:
1484 + sizeof(struct boom_tx_desc) * TX_RING_SIZE, 1486 + sizeof(struct boom_tx_desc) * TX_RING_SIZE,
1485 vp->rx_ring, 1487 vp->rx_ring,
1486 vp->rx_ring_dma); 1488 vp->rx_ring_dma);
1487free_region: 1489free_device:
1488 if (vp->must_free_region)
1489 release_region(dev->base_addr, vci->io_size);
1490 free_netdev(dev); 1490 free_netdev(dev);
1491 pr_err(PFX "vortex_probe1 fails. Returns %d\n", retval); 1491 pr_err(PFX "vortex_probe1 fails. Returns %d\n", retval);
1492out: 1492out:
@@ -3254,8 +3254,9 @@ static void vortex_remove_one(struct pci_dev *pdev)
3254 + sizeof(struct boom_tx_desc) * TX_RING_SIZE, 3254 + sizeof(struct boom_tx_desc) * TX_RING_SIZE,
3255 vp->rx_ring, 3255 vp->rx_ring,
3256 vp->rx_ring_dma); 3256 vp->rx_ring_dma);
3257 if (vp->must_free_region) 3257
3258 release_region(dev->base_addr, vp->io_size); 3258 pci_release_regions(pdev);
3259
3259 free_netdev(dev); 3260 free_netdev(dev);
3260} 3261}
3261 3262
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index b8fbe266ab68..be59ec4b2c30 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3313,6 +3313,7 @@ static void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data,
3313 */ 3313 */
3314static void bnx2x_set_pbd_gso(struct sk_buff *skb, 3314static void bnx2x_set_pbd_gso(struct sk_buff *skb,
3315 struct eth_tx_parse_bd_e1x *pbd, 3315 struct eth_tx_parse_bd_e1x *pbd,
3316 struct eth_tx_start_bd *tx_start_bd,
3316 u32 xmit_type) 3317 u32 xmit_type)
3317{ 3318{
3318 pbd->lso_mss = cpu_to_le16(skb_shinfo(skb)->gso_size); 3319 pbd->lso_mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
@@ -3326,11 +3327,14 @@ static void bnx2x_set_pbd_gso(struct sk_buff *skb,
3326 ip_hdr(skb)->daddr, 3327 ip_hdr(skb)->daddr,
3327 0, IPPROTO_TCP, 0)); 3328 0, IPPROTO_TCP, 0));
3328 3329
3329 } else 3330 /* GSO on 57710/57711 needs FW to calculate IP checksum */
3331 tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_IP_CSUM;
3332 } else {
3330 pbd->tcp_pseudo_csum = 3333 pbd->tcp_pseudo_csum =
3331 bswab16(~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, 3334 bswab16(~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
3332 &ipv6_hdr(skb)->daddr, 3335 &ipv6_hdr(skb)->daddr,
3333 0, IPPROTO_TCP, 0)); 3336 0, IPPROTO_TCP, 0));
3337 }
3334 3338
3335 pbd->global_data |= 3339 pbd->global_data |=
3336 cpu_to_le16(ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN); 3340 cpu_to_le16(ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN);
@@ -3814,7 +3818,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3814 bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, 3818 bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data,
3815 xmit_type); 3819 xmit_type);
3816 else 3820 else
3817 bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); 3821 bnx2x_set_pbd_gso(skb, pbd_e1x, tx_start_bd,
3822 xmit_type);
3818 } 3823 }
3819 3824
3820 /* Set the PBD's parsing_data field if not zero 3825 /* Set the PBD's parsing_data field if not zero
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 728d42ab2a76..1f2dd928888a 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -94,10 +94,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
94 94
95#define DRV_MODULE_NAME "tg3" 95#define DRV_MODULE_NAME "tg3"
96#define TG3_MAJ_NUM 3 96#define TG3_MAJ_NUM 3
97#define TG3_MIN_NUM 131 97#define TG3_MIN_NUM 132
98#define DRV_MODULE_VERSION \ 98#define DRV_MODULE_VERSION \
99 __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM) 99 __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
100#define DRV_MODULE_RELDATE "April 09, 2013" 100#define DRV_MODULE_RELDATE "May 21, 2013"
101 101
102#define RESET_KIND_SHUTDOWN 0 102#define RESET_KIND_SHUTDOWN 0
103#define RESET_KIND_INIT 1 103#define RESET_KIND_INIT 1
@@ -2957,6 +2957,31 @@ static int tg3_5700_link_polarity(struct tg3 *tp, u32 speed)
2957 return 0; 2957 return 0;
2958} 2958}
2959 2959
2960static bool tg3_phy_power_bug(struct tg3 *tp)
2961{
2962 switch (tg3_asic_rev(tp)) {
2963 case ASIC_REV_5700:
2964 case ASIC_REV_5704:
2965 return true;
2966 case ASIC_REV_5780:
2967 if (tp->phy_flags & TG3_PHYFLG_MII_SERDES)
2968 return true;
2969 return false;
2970 case ASIC_REV_5717:
2971 if (!tp->pci_fn)
2972 return true;
2973 return false;
2974 case ASIC_REV_5719:
2975 case ASIC_REV_5720:
2976 if ((tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
2977 !tp->pci_fn)
2978 return true;
2979 return false;
2980 }
2981
2982 return false;
2983}
2984
2960static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power) 2985static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
2961{ 2986{
2962 u32 val; 2987 u32 val;
@@ -3016,12 +3041,7 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power)
3016 /* The PHY should not be powered down on some chips because 3041 /* The PHY should not be powered down on some chips because
3017 * of bugs. 3042 * of bugs.
3018 */ 3043 */
3019 if (tg3_asic_rev(tp) == ASIC_REV_5700 || 3044 if (tg3_phy_power_bug(tp))
3020 tg3_asic_rev(tp) == ASIC_REV_5704 ||
3021 (tg3_asic_rev(tp) == ASIC_REV_5780 &&
3022 (tp->phy_flags & TG3_PHYFLG_MII_SERDES)) ||
3023 (tg3_asic_rev(tp) == ASIC_REV_5717 &&
3024 !tp->pci_fn))
3025 return; 3045 return;
3026 3046
3027 if (tg3_chip_rev(tp) == CHIPREV_5784_AX || 3047 if (tg3_chip_rev(tp) == CHIPREV_5784_AX ||
@@ -7428,6 +7448,20 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
7428 return (base > 0xffffdcc0) && (base + len + 8 < base); 7448 return (base > 0xffffdcc0) && (base + len + 8 < base);
7429} 7449}
7430 7450
7451/* Test for TSO DMA buffers that cross into regions which are within MSS bytes
7452 * of any 4GB boundaries: 4G, 8G, etc
7453 */
7454static inline int tg3_4g_tso_overflow_test(struct tg3 *tp, dma_addr_t mapping,
7455 u32 len, u32 mss)
7456{
7457 if (tg3_asic_rev(tp) == ASIC_REV_5762 && mss) {
7458 u32 base = (u32) mapping & 0xffffffff;
7459
7460 return ((base + len + (mss & 0x3fff)) < base);
7461 }
7462 return 0;
7463}
7464
7431/* Test for DMA addresses > 40-bit */ 7465/* Test for DMA addresses > 40-bit */
7432static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, 7466static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
7433 int len) 7467 int len)
@@ -7464,6 +7498,9 @@ static bool tg3_tx_frag_set(struct tg3_napi *tnapi, u32 *entry, u32 *budget,
7464 if (tg3_4g_overflow_test(map, len)) 7498 if (tg3_4g_overflow_test(map, len))
7465 hwbug = true; 7499 hwbug = true;
7466 7500
7501 if (tg3_4g_tso_overflow_test(tp, map, len, mss))
7502 hwbug = true;
7503
7467 if (tg3_40bit_overflow_test(tp, map, len)) 7504 if (tg3_40bit_overflow_test(tp, map, len))
7468 hwbug = true; 7505 hwbug = true;
7469 7506
@@ -8874,6 +8911,10 @@ static int tg3_chip_reset(struct tg3 *tp)
8874 tg3_halt_cpu(tp, RX_CPU_BASE); 8911 tg3_halt_cpu(tp, RX_CPU_BASE);
8875 } 8912 }
8876 8913
8914 err = tg3_poll_fw(tp);
8915 if (err)
8916 return err;
8917
8877 tw32(GRC_MODE, tp->grc_mode); 8918 tw32(GRC_MODE, tp->grc_mode);
8878 8919
8879 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A0) { 8920 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A0) {
@@ -8904,10 +8945,6 @@ static int tg3_chip_reset(struct tg3 *tp)
8904 8945
8905 tg3_ape_unlock(tp, TG3_APE_LOCK_GRC); 8946 tg3_ape_unlock(tp, TG3_APE_LOCK_GRC);
8906 8947
8907 err = tg3_poll_fw(tp);
8908 if (err)
8909 return err;
8910
8911 tg3_mdio_start(tp); 8948 tg3_mdio_start(tp);
8912 8949
8913 if (tg3_flag(tp, PCI_EXPRESS) && 8950 if (tg3_flag(tp, PCI_EXPRESS) &&
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index ce4a030d3d0c..07f7ef05c3f2 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3236,9 +3236,10 @@ bnad_init(struct bnad *bnad,
3236 3236
3237 sprintf(bnad->wq_name, "%s_wq_%d", BNAD_NAME, bnad->id); 3237 sprintf(bnad->wq_name, "%s_wq_%d", BNAD_NAME, bnad->id);
3238 bnad->work_q = create_singlethread_workqueue(bnad->wq_name); 3238 bnad->work_q = create_singlethread_workqueue(bnad->wq_name);
3239 3239 if (!bnad->work_q) {
3240 if (!bnad->work_q) 3240 iounmap(bnad->bar0);
3241 return -ENOMEM; 3241 return -ENOMEM;
3242 }
3242 3243
3243 return 0; 3244 return 0;
3244} 3245}
diff --git a/drivers/net/ethernet/cadence/Kconfig b/drivers/net/ethernet/cadence/Kconfig
index 1194446f859a..768285ec10f4 100644
--- a/drivers/net/ethernet/cadence/Kconfig
+++ b/drivers/net/ethernet/cadence/Kconfig
@@ -22,7 +22,7 @@ if NET_CADENCE
22 22
23config ARM_AT91_ETHER 23config ARM_AT91_ETHER
24 tristate "AT91RM9200 Ethernet support" 24 tristate "AT91RM9200 Ethernet support"
25 depends on GENERIC_HARDIRQS 25 depends on GENERIC_HARDIRQS && HAS_DMA
26 select NET_CORE 26 select NET_CORE
27 select MACB 27 select MACB
28 ---help--- 28 ---help---
@@ -31,6 +31,7 @@ config ARM_AT91_ETHER
31 31
32config MACB 32config MACB
33 tristate "Cadence MACB/GEM support" 33 tristate "Cadence MACB/GEM support"
34 depends on HAS_DMA
34 select PHYLIB 35 select PHYLIB
35 ---help--- 36 ---help---
36 The Cadence MACB ethernet interface is found on many Atmel AT32 and 37 The Cadence MACB ethernet interface is found on many Atmel AT32 and
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 6be513deb17f..c89aa41dd448 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -485,7 +485,8 @@ static void macb_tx_interrupt(struct macb *bp)
485 status = macb_readl(bp, TSR); 485 status = macb_readl(bp, TSR);
486 macb_writel(bp, TSR, status); 486 macb_writel(bp, TSR, status);
487 487
488 macb_writel(bp, ISR, MACB_BIT(TCOMP)); 488 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
489 macb_writel(bp, ISR, MACB_BIT(TCOMP));
489 490
490 netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n", 491 netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n",
491 (unsigned long)status); 492 (unsigned long)status);
@@ -738,7 +739,8 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
738 * now. 739 * now.
739 */ 740 */
740 macb_writel(bp, IDR, MACB_RX_INT_FLAGS); 741 macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
741 macb_writel(bp, ISR, MACB_BIT(RCOMP)); 742 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
743 macb_writel(bp, ISR, MACB_BIT(RCOMP));
742 744
743 if (napi_schedule_prep(&bp->napi)) { 745 if (napi_schedule_prep(&bp->napi)) {
744 netdev_vdbg(bp->dev, "scheduling RX softirq\n"); 746 netdev_vdbg(bp->dev, "scheduling RX softirq\n");
@@ -1062,6 +1064,17 @@ static void macb_configure_dma(struct macb *bp)
1062 } 1064 }
1063} 1065}
1064 1066
1067/*
1068 * Configure peripheral capacities according to integration options used
1069 */
1070static void macb_configure_caps(struct macb *bp)
1071{
1072 if (macb_is_gem(bp)) {
1073 if (GEM_BF(IRQCOR, gem_readl(bp, DCFG1)) == 0)
1074 bp->caps |= MACB_CAPS_ISR_CLEAR_ON_WRITE;
1075 }
1076}
1077
1065static void macb_init_hw(struct macb *bp) 1078static void macb_init_hw(struct macb *bp)
1066{ 1079{
1067 u32 config; 1080 u32 config;
@@ -1084,6 +1097,7 @@ static void macb_init_hw(struct macb *bp)
1084 bp->duplex = DUPLEX_HALF; 1097 bp->duplex = DUPLEX_HALF;
1085 1098
1086 macb_configure_dma(bp); 1099 macb_configure_dma(bp);
1100 macb_configure_caps(bp);
1087 1101
1088 /* Initialize TX and RX buffers */ 1102 /* Initialize TX and RX buffers */
1089 macb_writel(bp, RBQP, bp->rx_ring_dma); 1103 macb_writel(bp, RBQP, bp->rx_ring_dma);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 993d70380688..548c0ecae869 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -300,6 +300,8 @@
300#define MACB_REV_SIZE 16 300#define MACB_REV_SIZE 16
301 301
302/* Bitfields in DCFG1. */ 302/* Bitfields in DCFG1. */
303#define GEM_IRQCOR_OFFSET 23
304#define GEM_IRQCOR_SIZE 1
303#define GEM_DBWDEF_OFFSET 25 305#define GEM_DBWDEF_OFFSET 25
304#define GEM_DBWDEF_SIZE 3 306#define GEM_DBWDEF_SIZE 3
305 307
@@ -323,6 +325,9 @@
323#define MACB_MAN_READ 2 325#define MACB_MAN_READ 2
324#define MACB_MAN_CODE 2 326#define MACB_MAN_CODE 2
325 327
328/* Capability mask bits */
329#define MACB_CAPS_ISR_CLEAR_ON_WRITE 0x1
330
326/* Bit manipulation macros */ 331/* Bit manipulation macros */
327#define MACB_BIT(name) \ 332#define MACB_BIT(name) \
328 (1 << MACB_##name##_OFFSET) 333 (1 << MACB_##name##_OFFSET)
@@ -574,6 +579,8 @@ struct macb {
574 unsigned int speed; 579 unsigned int speed;
575 unsigned int duplex; 580 unsigned int duplex;
576 581
582 u32 caps;
583
577 phy_interface_t phy_interface; 584 phy_interface_t phy_interface;
578 585
579 /* AT91RM9200 transmit */ 586 /* AT91RM9200 transmit */
diff --git a/drivers/net/ethernet/calxeda/Kconfig b/drivers/net/ethernet/calxeda/Kconfig
index aba435c3d4ae..184a063bed5f 100644
--- a/drivers/net/ethernet/calxeda/Kconfig
+++ b/drivers/net/ethernet/calxeda/Kconfig
@@ -1,6 +1,6 @@
1config NET_CALXEDA_XGMAC 1config NET_CALXEDA_XGMAC
2 tristate "Calxeda 1G/10G XGMAC Ethernet driver" 2 tristate "Calxeda 1G/10G XGMAC Ethernet driver"
3 depends on HAS_IOMEM 3 depends on HAS_IOMEM && HAS_DMA
4 select CRC32 4 select CRC32
5 help 5 help
6 This is the driver for the XGMAC Ethernet IP block found on Calxeda 6 This is the driver for the XGMAC Ethernet IP block found on Calxeda
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index fd7b547698ab..a236ecd27cf3 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2976,22 +2976,17 @@ static struct be_nic_resource_desc *be_get_nic_desc(u8 *buf, u32 desc_count,
2976 for (i = 0; i < desc_count; i++) { 2976 for (i = 0; i < desc_count; i++) {
2977 desc->desc_len = desc->desc_len ? : RESOURCE_DESC_SIZE; 2977 desc->desc_len = desc->desc_len ? : RESOURCE_DESC_SIZE;
2978 if (((void *)desc + desc->desc_len) > 2978 if (((void *)desc + desc->desc_len) >
2979 (void *)(buf + max_buf_size)) { 2979 (void *)(buf + max_buf_size))
2980 desc = NULL; 2980 return NULL;
2981 break;
2982 }
2983 2981
2984 if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_V0 || 2982 if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_V0 ||
2985 desc->desc_type == NIC_RESOURCE_DESC_TYPE_V1) 2983 desc->desc_type == NIC_RESOURCE_DESC_TYPE_V1)
2986 break; 2984 return desc;
2987 2985
2988 desc = (void *)desc + desc->desc_len; 2986 desc = (void *)desc + desc->desc_len;
2989 } 2987 }
2990 2988
2991 if (!desc || i == MAX_RESOURCE_DESC) 2989 return NULL;
2992 return NULL;
2993
2994 return desc;
2995} 2990}
2996 2991
2997/* Uses Mbox */ 2992/* Uses Mbox */
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index a444110b060f..ca2967b0f18b 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -780,26 +780,18 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
780 if (unlikely(!skb)) 780 if (unlikely(!skb))
781 return skb; 781 return skb;
782 782
783 if (vlan_tx_tag_present(skb)) { 783 if (vlan_tx_tag_present(skb))
784 vlan_tag = be_get_tx_vlan_tag(adapter, skb); 784 vlan_tag = be_get_tx_vlan_tag(adapter, skb);
785 skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); 785 else if (qnq_async_evt_rcvd(adapter) && adapter->pvid)
786 if (skb) 786 vlan_tag = adapter->pvid;
787 skb->vlan_tci = 0;
788 }
789
790 if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
791 if (!vlan_tag)
792 vlan_tag = adapter->pvid;
793 if (skip_hw_vlan)
794 *skip_hw_vlan = true;
795 }
796 787
797 if (vlan_tag) { 788 if (vlan_tag) {
798 skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); 789 skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
799 if (unlikely(!skb)) 790 if (unlikely(!skb))
800 return skb; 791 return skb;
801
802 skb->vlan_tci = 0; 792 skb->vlan_tci = 0;
793 if (skip_hw_vlan)
794 *skip_hw_vlan = true;
803 } 795 }
804 796
805 /* Insert the outer VLAN, if any */ 797 /* Insert the outer VLAN, if any */
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index aff0310a778b..85a06037b242 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -87,6 +87,8 @@
87#define FEC_QUIRK_HAS_GBIT (1 << 3) 87#define FEC_QUIRK_HAS_GBIT (1 << 3)
88/* Controller has extend desc buffer */ 88/* Controller has extend desc buffer */
89#define FEC_QUIRK_HAS_BUFDESC_EX (1 << 4) 89#define FEC_QUIRK_HAS_BUFDESC_EX (1 << 4)
90/* Controller has hardware checksum support */
91#define FEC_QUIRK_HAS_CSUM (1 << 5)
90 92
91static struct platform_device_id fec_devtype[] = { 93static struct platform_device_id fec_devtype[] = {
92 { 94 {
@@ -105,9 +107,9 @@ static struct platform_device_id fec_devtype[] = {
105 }, { 107 }, {
106 .name = "imx6q-fec", 108 .name = "imx6q-fec",
107 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 109 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
108 FEC_QUIRK_HAS_BUFDESC_EX, 110 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM,
109 }, { 111 }, {
110 .name = "mvf-fec", 112 .name = "mvf600-fec",
111 .driver_data = FEC_QUIRK_ENET_MAC, 113 .driver_data = FEC_QUIRK_ENET_MAC,
112 }, { 114 }, {
113 /* sentinel */ 115 /* sentinel */
@@ -120,7 +122,7 @@ enum imx_fec_type {
120 IMX27_FEC, /* runs on i.mx27/35/51 */ 122 IMX27_FEC, /* runs on i.mx27/35/51 */
121 IMX28_FEC, 123 IMX28_FEC,
122 IMX6Q_FEC, 124 IMX6Q_FEC,
123 MVF_FEC, 125 MVF600_FEC,
124}; 126};
125 127
126static const struct of_device_id fec_dt_ids[] = { 128static const struct of_device_id fec_dt_ids[] = {
@@ -128,7 +130,7 @@ static const struct of_device_id fec_dt_ids[] = {
128 { .compatible = "fsl,imx27-fec", .data = &fec_devtype[IMX27_FEC], }, 130 { .compatible = "fsl,imx27-fec", .data = &fec_devtype[IMX27_FEC], },
129 { .compatible = "fsl,imx28-fec", .data = &fec_devtype[IMX28_FEC], }, 131 { .compatible = "fsl,imx28-fec", .data = &fec_devtype[IMX28_FEC], },
130 { .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], }, 132 { .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], },
131 { .compatible = "fsl,mvf-fec", .data = &fec_devtype[MVF_FEC], }, 133 { .compatible = "fsl,mvf600-fec", .data = &fec_devtype[MVF600_FEC], },
132 { /* sentinel */ } 134 { /* sentinel */ }
133}; 135};
134MODULE_DEVICE_TABLE(of, fec_dt_ids); 136MODULE_DEVICE_TABLE(of, fec_dt_ids);
@@ -449,7 +451,7 @@ fec_restart(struct net_device *ndev, int duplex)
449 netif_device_detach(ndev); 451 netif_device_detach(ndev);
450 napi_disable(&fep->napi); 452 napi_disable(&fep->napi);
451 netif_stop_queue(ndev); 453 netif_stop_queue(ndev);
452 netif_tx_lock(ndev); 454 netif_tx_lock_bh(ndev);
453 } 455 }
454 456
455 /* Whack a reset. We should wait for this. */ 457 /* Whack a reset. We should wait for this. */
@@ -614,10 +616,10 @@ fec_restart(struct net_device *ndev, int duplex)
614 writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); 616 writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
615 617
616 if (netif_running(ndev)) { 618 if (netif_running(ndev)) {
617 netif_device_attach(ndev); 619 netif_tx_unlock_bh(ndev);
618 napi_enable(&fep->napi);
619 netif_wake_queue(ndev); 620 netif_wake_queue(ndev);
620 netif_tx_unlock(ndev); 621 napi_enable(&fep->napi);
622 netif_device_attach(ndev);
621 } 623 }
622} 624}
623 625
@@ -1744,6 +1746,8 @@ static const struct net_device_ops fec_netdev_ops = {
1744static int fec_enet_init(struct net_device *ndev) 1746static int fec_enet_init(struct net_device *ndev)
1745{ 1747{
1746 struct fec_enet_private *fep = netdev_priv(ndev); 1748 struct fec_enet_private *fep = netdev_priv(ndev);
1749 const struct platform_device_id *id_entry =
1750 platform_get_device_id(fep->pdev);
1747 struct bufdesc *cbd_base; 1751 struct bufdesc *cbd_base;
1748 1752
1749 /* Allocate memory for buffer descriptors. */ 1753 /* Allocate memory for buffer descriptors. */
@@ -1775,12 +1779,14 @@ static int fec_enet_init(struct net_device *ndev)
1775 writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK); 1779 writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK);
1776 netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT); 1780 netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT);
1777 1781
1778 /* enable hw accelerator */ 1782 if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) {
1779 ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM 1783 /* enable hw accelerator */
1780 | NETIF_F_RXCSUM); 1784 ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1781 ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM 1785 | NETIF_F_RXCSUM);
1782 | NETIF_F_RXCSUM); 1786 ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1783 fep->csum_flags |= FLAG_RX_CSUM_ENABLED; 1787 | NETIF_F_RXCSUM);
1788 fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
1789 }
1784 1790
1785 fec_restart(ndev, 0); 1791 fec_restart(ndev, 0);
1786 1792
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 576e4b858fce..083ea2b4d20a 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -524,6 +524,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
524 return 0; 524 return 0;
525 525
526no_clock: 526no_clock:
527 iounmap(etsects->regs);
527no_ioremap: 528no_ioremap:
528 release_resource(etsects->rsrc); 529 release_resource(etsects->rsrc);
529no_resource: 530no_resource:
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 4989481c19f0..d300a0c0eafc 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -359,10 +359,26 @@ static int emac_reset(struct emac_instance *dev)
359 } 359 }
360 360
361#ifdef CONFIG_PPC_DCR_NATIVE 361#ifdef CONFIG_PPC_DCR_NATIVE
362 /* Enable internal clock source */ 362 /*
363 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) 363 * PPC460EX/GT Embedded Processor Advanced User's Manual
364 dcri_clrset(SDR0, SDR0_ETH_CFG, 364 * section 28.10.1 Mode Register 0 (EMACx_MR0) states:
365 0, SDR0_ETH_CFG_ECS << dev->cell_index); 365 * Note: The PHY must provide a TX Clk in order to perform a soft reset
366 * of the EMAC. If none is present, select the internal clock
367 * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
368 * After a soft reset, select the external clock.
369 */
370 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
371 if (dev->phy_address == 0xffffffff &&
372 dev->phy_map == 0xffffffff) {
373 /* No PHY: select internal loop clock before reset */
374 dcri_clrset(SDR0, SDR0_ETH_CFG,
375 0, SDR0_ETH_CFG_ECS << dev->cell_index);
376 } else {
377 /* PHY present: select external clock before reset */
378 dcri_clrset(SDR0, SDR0_ETH_CFG,
379 SDR0_ETH_CFG_ECS << dev->cell_index, 0);
380 }
381 }
366#endif 382#endif
367 383
368 out_be32(&p->mr0, EMAC_MR0_SRST); 384 out_be32(&p->mr0, EMAC_MR0_SRST);
@@ -370,10 +386,14 @@ static int emac_reset(struct emac_instance *dev)
370 --n; 386 --n;
371 387
372#ifdef CONFIG_PPC_DCR_NATIVE 388#ifdef CONFIG_PPC_DCR_NATIVE
373 /* Enable external clock source */ 389 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
374 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) 390 if (dev->phy_address == 0xffffffff &&
375 dcri_clrset(SDR0, SDR0_ETH_CFG, 391 dev->phy_map == 0xffffffff) {
376 SDR0_ETH_CFG_ECS << dev->cell_index, 0); 392 /* No PHY: restore external clock source after reset */
393 dcri_clrset(SDR0, SDR0_ETH_CFG,
394 SDR0_ETH_CFG_ECS << dev->cell_index, 0);
395 }
396 }
377#endif 397#endif
378 398
379 if (n) { 399 if (n) {
diff --git a/drivers/net/ethernet/icplus/ipg.h b/drivers/net/ethernet/icplus/ipg.h
index 6ce027355fcf..abb300a31912 100644
--- a/drivers/net/ethernet/icplus/ipg.h
+++ b/drivers/net/ethernet/icplus/ipg.h
@@ -195,57 +195,57 @@ enum ipg_regs {
195/* TFD data structure masks. */ 195/* TFD data structure masks. */
196 196
197/* TFDList, TFC */ 197/* TFDList, TFC */
198#define IPG_TFC_RSVD_MASK 0x0000FFFF9FFFFFFF 198#define IPG_TFC_RSVD_MASK 0x0000FFFF9FFFFFFFULL
199#define IPG_TFC_FRAMEID 0x000000000000FFFF 199#define IPG_TFC_FRAMEID 0x000000000000FFFFULL
200#define IPG_TFC_WORDALIGN 0x0000000000030000 200#define IPG_TFC_WORDALIGN 0x0000000000030000ULL
201#define IPG_TFC_WORDALIGNTODWORD 0x0000000000000000 201#define IPG_TFC_WORDALIGNTODWORD 0x0000000000000000ULL
202#define IPG_TFC_WORDALIGNTOWORD 0x0000000000020000 202#define IPG_TFC_WORDALIGNTOWORD 0x0000000000020000ULL
203#define IPG_TFC_WORDALIGNDISABLED 0x0000000000030000 203#define IPG_TFC_WORDALIGNDISABLED 0x0000000000030000ULL
204#define IPG_TFC_TCPCHECKSUMENABLE 0x0000000000040000 204#define IPG_TFC_TCPCHECKSUMENABLE 0x0000000000040000ULL
205#define IPG_TFC_UDPCHECKSUMENABLE 0x0000000000080000 205#define IPG_TFC_UDPCHECKSUMENABLE 0x0000000000080000ULL
206#define IPG_TFC_IPCHECKSUMENABLE 0x0000000000100000 206#define IPG_TFC_IPCHECKSUMENABLE 0x0000000000100000ULL
207#define IPG_TFC_FCSAPPENDDISABLE 0x0000000000200000 207#define IPG_TFC_FCSAPPENDDISABLE 0x0000000000200000ULL
208#define IPG_TFC_TXINDICATE 0x0000000000400000 208#define IPG_TFC_TXINDICATE 0x0000000000400000ULL
209#define IPG_TFC_TXDMAINDICATE 0x0000000000800000 209#define IPG_TFC_TXDMAINDICATE 0x0000000000800000ULL
210#define IPG_TFC_FRAGCOUNT 0x000000000F000000 210#define IPG_TFC_FRAGCOUNT 0x000000000F000000ULL
211#define IPG_TFC_VLANTAGINSERT 0x0000000010000000 211#define IPG_TFC_VLANTAGINSERT 0x0000000010000000ULL
212#define IPG_TFC_TFDDONE 0x0000000080000000 212#define IPG_TFC_TFDDONE 0x0000000080000000ULL
213#define IPG_TFC_VID 0x00000FFF00000000 213#define IPG_TFC_VID 0x00000FFF00000000ULL
214#define IPG_TFC_CFI 0x0000100000000000 214#define IPG_TFC_CFI 0x0000100000000000ULL
215#define IPG_TFC_USERPRIORITY 0x0000E00000000000 215#define IPG_TFC_USERPRIORITY 0x0000E00000000000ULL
216 216
217/* TFDList, FragInfo */ 217/* TFDList, FragInfo */
218#define IPG_TFI_RSVD_MASK 0xFFFF00FFFFFFFFFF 218#define IPG_TFI_RSVD_MASK 0xFFFF00FFFFFFFFFFULL
219#define IPG_TFI_FRAGADDR 0x000000FFFFFFFFFF 219#define IPG_TFI_FRAGADDR 0x000000FFFFFFFFFFULL
220#define IPG_TFI_FRAGLEN 0xFFFF000000000000LL 220#define IPG_TFI_FRAGLEN 0xFFFF000000000000ULL
221 221
222/* RFD data structure masks. */ 222/* RFD data structure masks. */
223 223
224/* RFDList, RFS */ 224/* RFDList, RFS */
225#define IPG_RFS_RSVD_MASK 0x0000FFFFFFFFFFFF 225#define IPG_RFS_RSVD_MASK 0x0000FFFFFFFFFFFFULL
226#define IPG_RFS_RXFRAMELEN 0x000000000000FFFF 226#define IPG_RFS_RXFRAMELEN 0x000000000000FFFFULL
227#define IPG_RFS_RXFIFOOVERRUN 0x0000000000010000 227#define IPG_RFS_RXFIFOOVERRUN 0x0000000000010000ULL
228#define IPG_RFS_RXRUNTFRAME 0x0000000000020000 228#define IPG_RFS_RXRUNTFRAME 0x0000000000020000ULL
229#define IPG_RFS_RXALIGNMENTERROR 0x0000000000040000 229#define IPG_RFS_RXALIGNMENTERROR 0x0000000000040000ULL
230#define IPG_RFS_RXFCSERROR 0x0000000000080000 230#define IPG_RFS_RXFCSERROR 0x0000000000080000ULL
231#define IPG_RFS_RXOVERSIZEDFRAME 0x0000000000100000 231#define IPG_RFS_RXOVERSIZEDFRAME 0x0000000000100000ULL
232#define IPG_RFS_RXLENGTHERROR 0x0000000000200000 232#define IPG_RFS_RXLENGTHERROR 0x0000000000200000ULL
233#define IPG_RFS_VLANDETECTED 0x0000000000400000 233#define IPG_RFS_VLANDETECTED 0x0000000000400000ULL
234#define IPG_RFS_TCPDETECTED 0x0000000000800000 234#define IPG_RFS_TCPDETECTED 0x0000000000800000ULL
235#define IPG_RFS_TCPERROR 0x0000000001000000 235#define IPG_RFS_TCPERROR 0x0000000001000000ULL
236#define IPG_RFS_UDPDETECTED 0x0000000002000000 236#define IPG_RFS_UDPDETECTED 0x0000000002000000ULL
237#define IPG_RFS_UDPERROR 0x0000000004000000 237#define IPG_RFS_UDPERROR 0x0000000004000000ULL
238#define IPG_RFS_IPDETECTED 0x0000000008000000 238#define IPG_RFS_IPDETECTED 0x0000000008000000ULL
239#define IPG_RFS_IPERROR 0x0000000010000000 239#define IPG_RFS_IPERROR 0x0000000010000000ULL
240#define IPG_RFS_FRAMESTART 0x0000000020000000 240#define IPG_RFS_FRAMESTART 0x0000000020000000ULL
241#define IPG_RFS_FRAMEEND 0x0000000040000000 241#define IPG_RFS_FRAMEEND 0x0000000040000000ULL
242#define IPG_RFS_RFDDONE 0x0000000080000000 242#define IPG_RFS_RFDDONE 0x0000000080000000ULL
243#define IPG_RFS_TCI 0x0000FFFF00000000 243#define IPG_RFS_TCI 0x0000FFFF00000000ULL
244 244
245/* RFDList, FragInfo */ 245/* RFDList, FragInfo */
246#define IPG_RFI_RSVD_MASK 0xFFFF00FFFFFFFFFF 246#define IPG_RFI_RSVD_MASK 0xFFFF00FFFFFFFFFFULL
247#define IPG_RFI_FRAGADDR 0x000000FFFFFFFFFF 247#define IPG_RFI_FRAGADDR 0x000000FFFFFFFFFFULL
248#define IPG_RFI_FRAGLEN 0xFFFF000000000000LL 248#define IPG_RFI_FRAGLEN 0xFFFF000000000000ULL
249 249
250/* I/O Register masks. */ 250/* I/O Register masks. */
251 251
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index d0afeea181fb..2ad1494efbb3 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -867,7 +867,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
867 struct netdev_queue *nq = netdev_get_tx_queue(mp->dev, txq->index); 867 struct netdev_queue *nq = netdev_get_tx_queue(mp->dev, txq->index);
868 int reclaimed; 868 int reclaimed;
869 869
870 __netif_tx_lock(nq, smp_processor_id()); 870 __netif_tx_lock_bh(nq);
871 871
872 reclaimed = 0; 872 reclaimed = 0;
873 while (reclaimed < budget && txq->tx_desc_count > 0) { 873 while (reclaimed < budget && txq->tx_desc_count > 0) {
@@ -913,7 +913,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
913 dev_kfree_skb(skb); 913 dev_kfree_skb(skb);
914 } 914 }
915 915
916 __netif_tx_unlock(nq); 916 __netif_tx_unlock_bh(nq);
917 917
918 if (reclaimed < budget) 918 if (reclaimed < budget)
919 mp->work_tx &= ~(1 << txq->index); 919 mp->work_tx &= ~(1 << txq->index);
@@ -2745,7 +2745,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
2745 2745
2746 INIT_WORK(&mp->tx_timeout_task, tx_timeout_task); 2746 INIT_WORK(&mp->tx_timeout_task, tx_timeout_task);
2747 2747
2748 netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, 128); 2748 netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, NAPI_POLL_WEIGHT);
2749 2749
2750 init_timer(&mp->rx_oom); 2750 init_timer(&mp->rx_oom);
2751 mp->rx_oom.data = (unsigned long)mp; 2751 mp->rx_oom.data = (unsigned long)mp;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_resources.c b/drivers/net/ethernet/mellanox/mlx4/en_resources.c
index 91f2b2c43c12..d3f508697a3d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_resources.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_resources.c
@@ -60,7 +60,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
60 context->pri_path.sched_queue = 0x83 | (priv->port - 1) << 6; 60 context->pri_path.sched_queue = 0x83 | (priv->port - 1) << 6;
61 if (user_prio >= 0) { 61 if (user_prio >= 0) {
62 context->pri_path.sched_queue |= user_prio << 3; 62 context->pri_path.sched_queue |= user_prio << 3;
63 context->pri_path.feup = 1 << 6; 63 context->pri_path.feup = MLX4_FEUP_FORCE_ETH_UP;
64 } 64 }
65 context->pri_path.counter_index = 0xff; 65 context->pri_path.counter_index = 0xff;
66 context->cqn_send = cpu_to_be32(cqn); 66 context->cqn_send = cpu_to_be32(cqn);
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index b147bdd40768..58a8e535d698 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -131,7 +131,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
131 [2] = "RSS XOR Hash Function support", 131 [2] = "RSS XOR Hash Function support",
132 [3] = "Device manage flow steering support", 132 [3] = "Device manage flow steering support",
133 [4] = "Automatic MAC reassignment support", 133 [4] = "Automatic MAC reassignment support",
134 [5] = "Time stamping support" 134 [5] = "Time stamping support",
135 [6] = "VST (control vlan insertion/stripping) support",
136 [7] = "FSM (MAC anti-spoofing) support"
135 }; 137 };
136 int i; 138 int i;
137 139
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index e12e0d2e0ee0..1157f028a90f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -372,24 +372,29 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
372 if (MLX4_QP_ST_RC == qp_type) 372 if (MLX4_QP_ST_RC == qp_type)
373 return -EINVAL; 373 return -EINVAL;
374 374
375 /* force strip vlan by clear vsd */
376 qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN);
377 if (0 != vp_oper->state.default_vlan) {
378 qpc->pri_path.vlan_control =
379 MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED |
380 MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED |
381 MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED;
382 } else { /* priority tagged */
383 qpc->pri_path.vlan_control =
384 MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED |
385 MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED;
386 }
387
388 qpc->pri_path.fvl_rx |= MLX4_FVL_RX_FORCE_ETH_VLAN;
375 qpc->pri_path.vlan_index = vp_oper->vlan_idx; 389 qpc->pri_path.vlan_index = vp_oper->vlan_idx;
376 qpc->pri_path.fl = (1 << 6) | (1 << 2); /* set cv bit and hide_cqe_vlan bit*/ 390 qpc->pri_path.fl |= MLX4_FL_CV | MLX4_FL_ETH_HIDE_CQE_VLAN;
377 qpc->pri_path.feup |= 1 << 3; /* set fvl bit */ 391 qpc->pri_path.feup |= MLX4_FEUP_FORCE_ETH_UP | MLX4_FVL_FORCE_ETH_VLAN;
378 qpc->pri_path.sched_queue &= 0xC7; 392 qpc->pri_path.sched_queue &= 0xC7;
379 qpc->pri_path.sched_queue |= (vp_oper->state.default_qos) << 3; 393 qpc->pri_path.sched_queue |= (vp_oper->state.default_qos) << 3;
380 mlx4_dbg(dev, "qp %d port %d Q 0x%x set vlan to %d vidx %d feup %x fl %x\n",
381 be32_to_cpu(qpc->local_qpn) & 0xffffff, port,
382 (int)(qpc->pri_path.sched_queue), vp_oper->state.default_vlan,
383 vp_oper->vlan_idx, (int)(qpc->pri_path.feup),
384 (int)(qpc->pri_path.fl));
385 } 394 }
386 if (vp_oper->state.spoofchk) { 395 if (vp_oper->state.spoofchk) {
387 qpc->pri_path.feup |= 1 << 5; /* set fsm bit */; 396 qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC;
388 qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx; 397 qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx;
389 mlx4_dbg(dev, "spoof qp %d port %d feup 0x%x, myLmc 0x%x mindx %d\n",
390 be32_to_cpu(qpc->local_qpn) & 0xffffff, port,
391 (int)qpc->pri_path.feup, (int)qpc->pri_path.grh_mylmc,
392 vp_oper->mac_idx);
393 } 398 }
394 return 0; 399 return 0;
395} 400}
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 90c253b145ef..c1b693cb3df3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -429,6 +429,7 @@ struct qlcnic_hardware_context {
429 429
430 u16 port_type; 430 u16 port_type;
431 u16 board_type; 431 u16 board_type;
432 u16 supported_type;
432 433
433 u16 link_speed; 434 u16 link_speed;
434 u16 link_duplex; 435 u16 link_duplex;
@@ -906,8 +907,11 @@ struct qlcnic_ipaddr {
906#define QLCNIC_FW_HANG 0x4000 907#define QLCNIC_FW_HANG 0x4000
907#define QLCNIC_FW_LRO_MSS_CAP 0x8000 908#define QLCNIC_FW_LRO_MSS_CAP 0x8000
908#define QLCNIC_TX_INTR_SHARED 0x10000 909#define QLCNIC_TX_INTR_SHARED 0x10000
910#define QLCNIC_APP_CHANGED_FLAGS 0x20000
909#define QLCNIC_IS_MSI_FAMILY(adapter) \ 911#define QLCNIC_IS_MSI_FAMILY(adapter) \
910 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) 912 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
913#define QLCNIC_IS_TSO_CAPABLE(adapter) \
914 ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO)
911 915
912#define QLCNIC_DEF_NUM_STS_DESC_RINGS 4 916#define QLCNIC_DEF_NUM_STS_DESC_RINGS 4
913#define QLCNIC_MSIX_TBL_SPACE 8192 917#define QLCNIC_MSIX_TBL_SPACE 8192
@@ -1033,6 +1037,7 @@ struct qlcnic_adapter {
1033 spinlock_t rx_mac_learn_lock; 1037 spinlock_t rx_mac_learn_lock;
1034 u32 file_prd_off; /*File fw product offset*/ 1038 u32 file_prd_off; /*File fw product offset*/
1035 u32 fw_version; 1039 u32 fw_version;
1040 u32 offload_flags;
1036 const struct firmware *fw; 1041 const struct firmware *fw;
1037}; 1042};
1038 1043
@@ -1514,6 +1519,7 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter);
1514void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter); 1519void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter);
1515void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter); 1520void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter);
1516void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter); 1521void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter);
1522int qlcnic_82xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
1517 1523
1518int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32); 1524int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32);
1519int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32); 1525int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32);
@@ -1540,6 +1546,8 @@ void qlcnic_add_lb_filter(struct qlcnic_adapter *, struct sk_buff *, int, u16);
1540int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter); 1546int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter);
1541int qlcnic_read_mac_addr(struct qlcnic_adapter *); 1547int qlcnic_read_mac_addr(struct qlcnic_adapter *);
1542int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int); 1548int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int);
1549void qlcnic_set_netdev_features(struct qlcnic_adapter *,
1550 struct qlcnic_esw_func_cfg *);
1543void qlcnic_sriov_vf_schedule_multi(struct net_device *); 1551void qlcnic_sriov_vf_schedule_multi(struct net_device *);
1544void qlcnic_vf_add_mc_list(struct net_device *, u16); 1552void qlcnic_vf_add_mc_list(struct net_device *, u16);
1545 1553
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index ea790a93ee7c..b4ff1e35a11d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -696,15 +696,14 @@ u32 qlcnic_83xx_mac_rcode(struct qlcnic_adapter *adapter)
696 return 1; 696 return 1;
697} 697}
698 698
699u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *adapter) 699u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *adapter, u32 *wait_time)
700{ 700{
701 u32 data; 701 u32 data;
702 unsigned long wait_time = 0;
703 struct qlcnic_hardware_context *ahw = adapter->ahw; 702 struct qlcnic_hardware_context *ahw = adapter->ahw;
704 /* wait for mailbox completion */ 703 /* wait for mailbox completion */
705 do { 704 do {
706 data = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL); 705 data = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL);
707 if (++wait_time > QLCNIC_MBX_TIMEOUT) { 706 if (++(*wait_time) > QLCNIC_MBX_TIMEOUT) {
708 data = QLCNIC_RCODE_TIMEOUT; 707 data = QLCNIC_RCODE_TIMEOUT;
709 break; 708 break;
710 } 709 }
@@ -720,8 +719,8 @@ int qlcnic_83xx_mbx_op(struct qlcnic_adapter *adapter,
720 u16 opcode; 719 u16 opcode;
721 u8 mbx_err_code; 720 u8 mbx_err_code;
722 unsigned long flags; 721 unsigned long flags;
723 u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd;
724 struct qlcnic_hardware_context *ahw = adapter->ahw; 722 struct qlcnic_hardware_context *ahw = adapter->ahw;
723 u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd, wait_time = 0;
725 724
726 opcode = LSW(cmd->req.arg[0]); 725 opcode = LSW(cmd->req.arg[0]);
727 if (!test_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status)) { 726 if (!test_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status)) {
@@ -754,15 +753,13 @@ int qlcnic_83xx_mbx_op(struct qlcnic_adapter *adapter,
754 /* Signal FW about the impending command */ 753 /* Signal FW about the impending command */
755 QLCWRX(ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER); 754 QLCWRX(ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER);
756poll: 755poll:
757 rsp = qlcnic_83xx_mbx_poll(adapter); 756 rsp = qlcnic_83xx_mbx_poll(adapter, &wait_time);
758 if (rsp != QLCNIC_RCODE_TIMEOUT) { 757 if (rsp != QLCNIC_RCODE_TIMEOUT) {
759 /* Get the FW response data */ 758 /* Get the FW response data */
760 fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); 759 fw_data = readl(QLCNIC_MBX_FW(ahw, 0));
761 if (fw_data & QLCNIC_MBX_ASYNC_EVENT) { 760 if (fw_data & QLCNIC_MBX_ASYNC_EVENT) {
762 __qlcnic_83xx_process_aen(adapter); 761 __qlcnic_83xx_process_aen(adapter);
763 mbx_val = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); 762 goto poll;
764 if (mbx_val)
765 goto poll;
766 } 763 }
767 mbx_err_code = QLCNIC_MBX_STATUS(fw_data); 764 mbx_err_code = QLCNIC_MBX_STATUS(fw_data);
768 rsp_num = QLCNIC_MBX_NUM_REGS(fw_data); 765 rsp_num = QLCNIC_MBX_NUM_REGS(fw_data);
@@ -1276,11 +1273,13 @@ out:
1276 return err; 1273 return err;
1277} 1274}
1278 1275
1279static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test) 1276static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test,
1277 int num_sds_ring)
1280{ 1278{
1281 struct qlcnic_adapter *adapter = netdev_priv(netdev); 1279 struct qlcnic_adapter *adapter = netdev_priv(netdev);
1282 struct qlcnic_host_sds_ring *sds_ring; 1280 struct qlcnic_host_sds_ring *sds_ring;
1283 struct qlcnic_host_rds_ring *rds_ring; 1281 struct qlcnic_host_rds_ring *rds_ring;
1282 u16 adapter_state = adapter->is_up;
1284 u8 ring; 1283 u8 ring;
1285 int ret; 1284 int ret;
1286 1285
@@ -1304,6 +1303,10 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test)
1304 ret = qlcnic_fw_create_ctx(adapter); 1303 ret = qlcnic_fw_create_ctx(adapter);
1305 if (ret) { 1304 if (ret) {
1306 qlcnic_detach(adapter); 1305 qlcnic_detach(adapter);
1306 if (adapter_state == QLCNIC_ADAPTER_UP_MAGIC) {
1307 adapter->max_sds_rings = num_sds_ring;
1308 qlcnic_attach(adapter);
1309 }
1307 netif_device_attach(netdev); 1310 netif_device_attach(netdev);
1308 return ret; 1311 return ret;
1309 } 1312 }
@@ -1596,7 +1599,8 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode)
1596 if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) 1599 if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
1597 return -EBUSY; 1600 return -EBUSY;
1598 1601
1599 ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST); 1602 ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST,
1603 max_sds_rings);
1600 if (ret) 1604 if (ret)
1601 goto fail_diag_alloc; 1605 goto fail_diag_alloc;
1602 1606
@@ -2830,6 +2834,23 @@ int qlcnic_83xx_test_link(struct qlcnic_adapter *adapter)
2830 break; 2834 break;
2831 } 2835 }
2832 config = cmd.rsp.arg[3]; 2836 config = cmd.rsp.arg[3];
2837 if (QLC_83XX_SFP_PRESENT(config)) {
2838 switch (ahw->module_type) {
2839 case LINKEVENT_MODULE_OPTICAL_UNKNOWN:
2840 case LINKEVENT_MODULE_OPTICAL_SRLR:
2841 case LINKEVENT_MODULE_OPTICAL_LRM:
2842 case LINKEVENT_MODULE_OPTICAL_SFP_1G:
2843 ahw->supported_type = PORT_FIBRE;
2844 break;
2845 case LINKEVENT_MODULE_TWINAX_UNSUPPORTED_CABLE:
2846 case LINKEVENT_MODULE_TWINAX_UNSUPPORTED_CABLELEN:
2847 case LINKEVENT_MODULE_TWINAX:
2848 ahw->supported_type = PORT_TP;
2849 break;
2850 default:
2851 ahw->supported_type = PORT_OTHER;
2852 }
2853 }
2833 if (config & 1) 2854 if (config & 1)
2834 err = 1; 2855 err = 1;
2835 } 2856 }
@@ -2838,7 +2859,8 @@ out:
2838 return config; 2859 return config;
2839} 2860}
2840 2861
2841int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter) 2862int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter,
2863 struct ethtool_cmd *ecmd)
2842{ 2864{
2843 u32 config = 0; 2865 u32 config = 0;
2844 int status = 0; 2866 int status = 0;
@@ -2851,6 +2873,54 @@ int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter)
2851 ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config); 2873 ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config);
2852 /* hard code until there is a way to get it from flash */ 2874 /* hard code until there is a way to get it from flash */
2853 ahw->board_type = QLCNIC_BRDTYPE_83XX_10G; 2875 ahw->board_type = QLCNIC_BRDTYPE_83XX_10G;
2876
2877 if (netif_running(adapter->netdev) && ahw->has_link_events) {
2878 ethtool_cmd_speed_set(ecmd, ahw->link_speed);
2879 ecmd->duplex = ahw->link_duplex;
2880 ecmd->autoneg = ahw->link_autoneg;
2881 } else {
2882 ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
2883 ecmd->duplex = DUPLEX_UNKNOWN;
2884 ecmd->autoneg = AUTONEG_DISABLE;
2885 }
2886
2887 if (ahw->port_type == QLCNIC_XGBE) {
2888 ecmd->supported = SUPPORTED_1000baseT_Full;
2889 ecmd->advertising = ADVERTISED_1000baseT_Full;
2890 } else {
2891 ecmd->supported = (SUPPORTED_10baseT_Half |
2892 SUPPORTED_10baseT_Full |
2893 SUPPORTED_100baseT_Half |
2894 SUPPORTED_100baseT_Full |
2895 SUPPORTED_1000baseT_Half |
2896 SUPPORTED_1000baseT_Full);
2897 ecmd->advertising = (ADVERTISED_100baseT_Half |
2898 ADVERTISED_100baseT_Full |
2899 ADVERTISED_1000baseT_Half |
2900 ADVERTISED_1000baseT_Full);
2901 }
2902
2903 switch (ahw->supported_type) {
2904 case PORT_FIBRE:
2905 ecmd->supported |= SUPPORTED_FIBRE;
2906 ecmd->advertising |= ADVERTISED_FIBRE;
2907 ecmd->port = PORT_FIBRE;
2908 ecmd->transceiver = XCVR_EXTERNAL;
2909 break;
2910 case PORT_TP:
2911 ecmd->supported |= SUPPORTED_TP;
2912 ecmd->advertising |= ADVERTISED_TP;
2913 ecmd->port = PORT_TP;
2914 ecmd->transceiver = XCVR_INTERNAL;
2915 break;
2916 default:
2917 ecmd->supported |= SUPPORTED_FIBRE;
2918 ecmd->advertising |= ADVERTISED_FIBRE;
2919 ecmd->port = PORT_OTHER;
2920 ecmd->transceiver = XCVR_EXTERNAL;
2921 break;
2922 }
2923 ecmd->phy_address = ahw->physical_port;
2854 return status; 2924 return status;
2855} 2925}
2856 2926
@@ -3046,7 +3116,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
3046 if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) 3116 if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
3047 return -EIO; 3117 return -EIO;
3048 3118
3049 ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST); 3119 ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST,
3120 max_sds_rings);
3050 if (ret) 3121 if (ret)
3051 goto fail_diag_irq; 3122 goto fail_diag_irq;
3052 3123
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
index 1f1d85e6f2af..f5db67fc9f55 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
@@ -603,7 +603,7 @@ int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *);
603 603
604void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *); 604void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *);
605void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data); 605void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
606int qlcnic_83xx_get_settings(struct qlcnic_adapter *); 606int qlcnic_83xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
607int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *); 607int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
608void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *, 608void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *,
609 struct ethtool_pauseparam *); 609 struct ethtool_pauseparam *);
@@ -620,7 +620,7 @@ int qlcnic_83xx_flash_test(struct qlcnic_adapter *);
620int qlcnic_83xx_enable_flash_write(struct qlcnic_adapter *); 620int qlcnic_83xx_enable_flash_write(struct qlcnic_adapter *);
621int qlcnic_83xx_disable_flash_write(struct qlcnic_adapter *); 621int qlcnic_83xx_disable_flash_write(struct qlcnic_adapter *);
622u32 qlcnic_83xx_mac_rcode(struct qlcnic_adapter *); 622u32 qlcnic_83xx_mac_rcode(struct qlcnic_adapter *);
623u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *); 623u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *, u32 *);
624void qlcnic_83xx_enable_mbx_poll(struct qlcnic_adapter *); 624void qlcnic_83xx_enable_mbx_poll(struct qlcnic_adapter *);
625void qlcnic_83xx_disable_mbx_poll(struct qlcnic_adapter *); 625void qlcnic_83xx_disable_mbx_poll(struct qlcnic_adapter *);
626#endif 626#endif
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index ab1d8d99cbd5..5e7fb1dfb97b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -382,8 +382,6 @@ static int qlcnic_83xx_idc_tx_soft_reset(struct qlcnic_adapter *adapter)
382 clear_bit(__QLCNIC_RESETTING, &adapter->state); 382 clear_bit(__QLCNIC_RESETTING, &adapter->state);
383 dev_err(&adapter->pdev->dev, "%s:\n", __func__); 383 dev_err(&adapter->pdev->dev, "%s:\n", __func__);
384 384
385 adapter->netdev->trans_start = jiffies;
386
387 return 0; 385 return 0;
388} 386}
389 387
@@ -435,10 +433,6 @@ static void qlcnic_83xx_idc_attach_driver(struct qlcnic_adapter *adapter)
435 } 433 }
436done: 434done:
437 netif_device_attach(netdev); 435 netif_device_attach(netdev);
438 if (netif_running(netdev)) {
439 netif_carrier_on(netdev);
440 netif_wake_queue(netdev);
441 }
442} 436}
443 437
444static int qlcnic_83xx_idc_enter_failed_state(struct qlcnic_adapter *adapter, 438static int qlcnic_83xx_idc_enter_failed_state(struct qlcnic_adapter *adapter,
@@ -642,15 +636,21 @@ static int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *adapter)
642 636
643static void qlcnic_83xx_idc_update_idc_params(struct qlcnic_adapter *adapter) 637static void qlcnic_83xx_idc_update_idc_params(struct qlcnic_adapter *adapter)
644{ 638{
639 struct qlcnic_hardware_context *ahw = adapter->ahw;
640
645 qlcnic_83xx_idc_update_drv_presence_reg(adapter, 1, 1); 641 qlcnic_83xx_idc_update_drv_presence_reg(adapter, 1, 1);
646 clear_bit(__QLCNIC_RESETTING, &adapter->state);
647 set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); 642 set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status);
648 qlcnic_83xx_idc_update_audit_reg(adapter, 0, 1); 643 qlcnic_83xx_idc_update_audit_reg(adapter, 0, 1);
649 set_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status); 644 set_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status);
650 adapter->ahw->idc.quiesce_req = 0; 645
651 adapter->ahw->idc.delay = QLC_83XX_IDC_FW_POLL_DELAY; 646 ahw->idc.quiesce_req = 0;
652 adapter->ahw->idc.err_code = 0; 647 ahw->idc.delay = QLC_83XX_IDC_FW_POLL_DELAY;
653 adapter->ahw->idc.collect_dump = 0; 648 ahw->idc.err_code = 0;
649 ahw->idc.collect_dump = 0;
650 ahw->reset_context = 0;
651 adapter->tx_timeo_cnt = 0;
652
653 clear_bit(__QLCNIC_RESETTING, &adapter->state);
654} 654}
655 655
656/** 656/**
@@ -851,6 +851,7 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter)
851 /* Check for soft reset request */ 851 /* Check for soft reset request */
852 if (ahw->reset_context && 852 if (ahw->reset_context &&
853 !(val & QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY)) { 853 !(val & QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY)) {
854 adapter->ahw->reset_context = 0;
854 qlcnic_83xx_idc_tx_soft_reset(adapter); 855 qlcnic_83xx_idc_tx_soft_reset(adapter);
855 return ret; 856 return ret;
856 } 857 }
@@ -914,6 +915,7 @@ static int qlcnic_83xx_idc_need_quiesce_state(struct qlcnic_adapter *adapter)
914static int qlcnic_83xx_idc_failed_state(struct qlcnic_adapter *adapter) 915static int qlcnic_83xx_idc_failed_state(struct qlcnic_adapter *adapter)
915{ 916{
916 dev_err(&adapter->pdev->dev, "%s: please restart!!\n", __func__); 917 dev_err(&adapter->pdev->dev, "%s: please restart!!\n", __func__);
918 clear_bit(__QLCNIC_RESETTING, &adapter->state);
917 adapter->ahw->idc.err_code = -EIO; 919 adapter->ahw->idc.err_code = -EIO;
918 920
919 return 0; 921 return 0;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 08efb4635007..f67652de5a63 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -131,12 +131,13 @@ static const char qlcnic_83xx_rx_stats_strings[][ETH_GSTRING_LEN] = {
131 "ctx_lro_pkt_cnt", 131 "ctx_lro_pkt_cnt",
132 "ctx_ip_csum_error", 132 "ctx_ip_csum_error",
133 "ctx_rx_pkts_wo_ctx", 133 "ctx_rx_pkts_wo_ctx",
134 "ctx_rx_pkts_dropped_wo_sts", 134 "ctx_rx_pkts_drop_wo_sds_on_card",
135 "ctx_rx_pkts_drop_wo_sds_on_host",
135 "ctx_rx_osized_pkts", 136 "ctx_rx_osized_pkts",
136 "ctx_rx_pkts_dropped_wo_rds", 137 "ctx_rx_pkts_dropped_wo_rds",
137 "ctx_rx_unexpected_mcast_pkts", 138 "ctx_rx_unexpected_mcast_pkts",
138 "ctx_invalid_mac_address", 139 "ctx_invalid_mac_address",
139 "ctx_rx_rds_ring_prim_attemoted", 140 "ctx_rx_rds_ring_prim_attempted",
140 "ctx_rx_rds_ring_prim_success", 141 "ctx_rx_rds_ring_prim_success",
141 "ctx_num_lro_flows_added", 142 "ctx_num_lro_flows_added",
142 "ctx_num_lro_flows_removed", 143 "ctx_num_lro_flows_removed",
@@ -251,6 +252,18 @@ static int
251qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) 252qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
252{ 253{
253 struct qlcnic_adapter *adapter = netdev_priv(dev); 254 struct qlcnic_adapter *adapter = netdev_priv(dev);
255
256 if (qlcnic_82xx_check(adapter))
257 return qlcnic_82xx_get_settings(adapter, ecmd);
258 else if (qlcnic_83xx_check(adapter))
259 return qlcnic_83xx_get_settings(adapter, ecmd);
260
261 return -EIO;
262}
263
264int qlcnic_82xx_get_settings(struct qlcnic_adapter *adapter,
265 struct ethtool_cmd *ecmd)
266{
254 struct qlcnic_hardware_context *ahw = adapter->ahw; 267 struct qlcnic_hardware_context *ahw = adapter->ahw;
255 u32 speed, reg; 268 u32 speed, reg;
256 int check_sfp_module = 0; 269 int check_sfp_module = 0;
@@ -276,10 +289,7 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
276 289
277 } else if (adapter->ahw->port_type == QLCNIC_XGBE) { 290 } else if (adapter->ahw->port_type == QLCNIC_XGBE) {
278 u32 val = 0; 291 u32 val = 0;
279 if (qlcnic_83xx_check(adapter)) 292 val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR);
280 qlcnic_83xx_get_settings(adapter);
281 else
282 val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR);
283 293
284 if (val == QLCNIC_PORT_MODE_802_3_AP) { 294 if (val == QLCNIC_PORT_MODE_802_3_AP) {
285 ecmd->supported = SUPPORTED_1000baseT_Full; 295 ecmd->supported = SUPPORTED_1000baseT_Full;
@@ -289,16 +299,13 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
289 ecmd->advertising = ADVERTISED_10000baseT_Full; 299 ecmd->advertising = ADVERTISED_10000baseT_Full;
290 } 300 }
291 301
292 if (netif_running(dev) && adapter->ahw->has_link_events) { 302 if (netif_running(adapter->netdev) && ahw->has_link_events) {
293 if (qlcnic_82xx_check(adapter)) { 303 reg = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn));
294 reg = QLCRD32(adapter, 304 speed = P3P_LINK_SPEED_VAL(pcifn, reg);
295 P3P_LINK_SPEED_REG(pcifn)); 305 ahw->link_speed = speed * P3P_LINK_SPEED_MHZ;
296 speed = P3P_LINK_SPEED_VAL(pcifn, reg); 306 ethtool_cmd_speed_set(ecmd, ahw->link_speed);
297 ahw->link_speed = speed * P3P_LINK_SPEED_MHZ; 307 ecmd->autoneg = ahw->link_autoneg;
298 } 308 ecmd->duplex = ahw->link_duplex;
299 ethtool_cmd_speed_set(ecmd, adapter->ahw->link_speed);
300 ecmd->autoneg = adapter->ahw->link_autoneg;
301 ecmd->duplex = adapter->ahw->link_duplex;
302 goto skip; 309 goto skip;
303 } 310 }
304 311
@@ -340,8 +347,8 @@ skip:
340 case QLCNIC_BRDTYPE_P3P_10G_SFP_QT: 347 case QLCNIC_BRDTYPE_P3P_10G_SFP_QT:
341 ecmd->advertising |= ADVERTISED_TP; 348 ecmd->advertising |= ADVERTISED_TP;
342 ecmd->supported |= SUPPORTED_TP; 349 ecmd->supported |= SUPPORTED_TP;
343 check_sfp_module = netif_running(dev) && 350 check_sfp_module = netif_running(adapter->netdev) &&
344 adapter->ahw->has_link_events; 351 ahw->has_link_events;
345 case QLCNIC_BRDTYPE_P3P_10G_XFP: 352 case QLCNIC_BRDTYPE_P3P_10G_XFP:
346 ecmd->supported |= SUPPORTED_FIBRE; 353 ecmd->supported |= SUPPORTED_FIBRE;
347 ecmd->advertising |= ADVERTISED_FIBRE; 354 ecmd->advertising |= ADVERTISED_FIBRE;
@@ -355,8 +362,8 @@ skip:
355 ecmd->advertising |= 362 ecmd->advertising |=
356 (ADVERTISED_FIBRE | ADVERTISED_TP); 363 (ADVERTISED_FIBRE | ADVERTISED_TP);
357 ecmd->port = PORT_FIBRE; 364 ecmd->port = PORT_FIBRE;
358 check_sfp_module = netif_running(dev) && 365 check_sfp_module = netif_running(adapter->netdev) &&
359 adapter->ahw->has_link_events; 366 ahw->has_link_events;
360 } else { 367 } else {
361 ecmd->autoneg = AUTONEG_ENABLE; 368 ecmd->autoneg = AUTONEG_ENABLE;
362 ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); 369 ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
@@ -365,13 +372,6 @@ skip:
365 ecmd->port = PORT_TP; 372 ecmd->port = PORT_TP;
366 } 373 }
367 break; 374 break;
368 case QLCNIC_BRDTYPE_83XX_10G:
369 ecmd->autoneg = AUTONEG_DISABLE;
370 ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP);
371 ecmd->advertising |= (ADVERTISED_FIBRE | ADVERTISED_TP);
372 ecmd->port = PORT_FIBRE;
373 check_sfp_module = netif_running(dev) && ahw->has_link_events;
374 break;
375 default: 375 default:
376 dev_err(&adapter->pdev->dev, "Unsupported board model %d\n", 376 dev_err(&adapter->pdev->dev, "Unsupported board model %d\n",
377 adapter->ahw->board_type); 377 adapter->ahw->board_type);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 6a6512ba9f38..106a12f2a02f 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -973,16 +973,57 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu)
973 return rc; 973 return rc;
974} 974}
975 975
976static netdev_features_t qlcnic_process_flags(struct qlcnic_adapter *adapter,
977 netdev_features_t features)
978{
979 u32 offload_flags = adapter->offload_flags;
980
981 if (offload_flags & BIT_0) {
982 features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
983 NETIF_F_IPV6_CSUM;
984 adapter->rx_csum = 1;
985 if (QLCNIC_IS_TSO_CAPABLE(adapter)) {
986 if (!(offload_flags & BIT_1))
987 features &= ~NETIF_F_TSO;
988 else
989 features |= NETIF_F_TSO;
990
991 if (!(offload_flags & BIT_2))
992 features &= ~NETIF_F_TSO6;
993 else
994 features |= NETIF_F_TSO6;
995 }
996 } else {
997 features &= ~(NETIF_F_RXCSUM |
998 NETIF_F_IP_CSUM |
999 NETIF_F_IPV6_CSUM);
1000
1001 if (QLCNIC_IS_TSO_CAPABLE(adapter))
1002 features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
1003 adapter->rx_csum = 0;
1004 }
1005
1006 return features;
1007}
976 1008
977netdev_features_t qlcnic_fix_features(struct net_device *netdev, 1009netdev_features_t qlcnic_fix_features(struct net_device *netdev,
978 netdev_features_t features) 1010 netdev_features_t features)
979{ 1011{
980 struct qlcnic_adapter *adapter = netdev_priv(netdev); 1012 struct qlcnic_adapter *adapter = netdev_priv(netdev);
1013 netdev_features_t changed;
981 1014
982 if ((adapter->flags & QLCNIC_ESWITCH_ENABLED) && 1015 if (qlcnic_82xx_check(adapter) &&
983 qlcnic_82xx_check(adapter)) { 1016 (adapter->flags & QLCNIC_ESWITCH_ENABLED)) {
984 netdev_features_t changed = features ^ netdev->features; 1017 if (adapter->flags & QLCNIC_APP_CHANGED_FLAGS) {
985 features ^= changed & (NETIF_F_ALL_CSUM | NETIF_F_RXCSUM); 1018 features = qlcnic_process_flags(adapter, features);
1019 } else {
1020 changed = features ^ netdev->features;
1021 features ^= changed & (NETIF_F_RXCSUM |
1022 NETIF_F_IP_CSUM |
1023 NETIF_F_IPV6_CSUM |
1024 NETIF_F_TSO |
1025 NETIF_F_TSO6);
1026 }
986 } 1027 }
987 1028
988 if (!(features & NETIF_F_RXCSUM)) 1029 if (!(features & NETIF_F_RXCSUM))
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
index 95b1b5732838..b6818f4356b9 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
@@ -134,7 +134,7 @@ struct qlcnic_mailbox_metadata {
134 134
135#define QLCNIC_SET_OWNER 1 135#define QLCNIC_SET_OWNER 1
136#define QLCNIC_CLR_OWNER 0 136#define QLCNIC_CLR_OWNER 0
137#define QLCNIC_MBX_TIMEOUT 10000 137#define QLCNIC_MBX_TIMEOUT 5000
138 138
139#define QLCNIC_MBX_RSP_OK 1 139#define QLCNIC_MBX_RSP_OK 1
140#define QLCNIC_MBX_PORT_RSP_OK 0x1a 140#define QLCNIC_MBX_PORT_RSP_OK 0x1a
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 264d5a4f8153..aeb26a850679 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -37,24 +37,24 @@ MODULE_PARM_DESC(qlcnic_mac_learn,
37 "Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)"); 37 "Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)");
38 38
39int qlcnic_use_msi = 1; 39int qlcnic_use_msi = 1;
40MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled"); 40MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled)");
41module_param_named(use_msi, qlcnic_use_msi, int, 0444); 41module_param_named(use_msi, qlcnic_use_msi, int, 0444);
42 42
43int qlcnic_use_msi_x = 1; 43int qlcnic_use_msi_x = 1;
44MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled"); 44MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled)");
45module_param_named(use_msi_x, qlcnic_use_msi_x, int, 0444); 45module_param_named(use_msi_x, qlcnic_use_msi_x, int, 0444);
46 46
47int qlcnic_auto_fw_reset = 1; 47int qlcnic_auto_fw_reset = 1;
48MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled"); 48MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled)");
49module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, 0644); 49module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, 0644);
50 50
51int qlcnic_load_fw_file; 51int qlcnic_load_fw_file;
52MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file"); 52MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file)");
53module_param_named(load_fw_file, qlcnic_load_fw_file, int, 0444); 53module_param_named(load_fw_file, qlcnic_load_fw_file, int, 0444);
54 54
55int qlcnic_config_npars; 55int qlcnic_config_npars;
56module_param(qlcnic_config_npars, int, 0444); 56module_param(qlcnic_config_npars, int, 0444);
57MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled"); 57MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled)");
58 58
59static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent); 59static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
60static void qlcnic_remove(struct pci_dev *pdev); 60static void qlcnic_remove(struct pci_dev *pdev);
@@ -84,14 +84,9 @@ static int qlcnic_start_firmware(struct qlcnic_adapter *);
84static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter); 84static void qlcnic_free_lb_filters_mem(struct qlcnic_adapter *adapter);
85static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); 85static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *);
86static int qlcnicvf_start_firmware(struct qlcnic_adapter *); 86static int qlcnicvf_start_firmware(struct qlcnic_adapter *);
87static void qlcnic_set_netdev_features(struct qlcnic_adapter *,
88 struct qlcnic_esw_func_cfg *);
89static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16); 87static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16);
90static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16); 88static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16);
91 89
92#define QLCNIC_IS_TSO_CAPABLE(adapter) \
93 ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO)
94
95static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter) 90static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter)
96{ 91{
97 struct qlcnic_hardware_context *ahw = adapter->ahw; 92 struct qlcnic_hardware_context *ahw = adapter->ahw;
@@ -308,6 +303,23 @@ int qlcnic_read_mac_addr(struct qlcnic_adapter *adapter)
308 return 0; 303 return 0;
309} 304}
310 305
306static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter)
307{
308 struct qlcnic_mac_list_s *cur;
309 struct list_head *head;
310
311 list_for_each(head, &adapter->mac_list) {
312 cur = list_entry(head, struct qlcnic_mac_list_s, list);
313 if (!memcmp(adapter->mac_addr, cur->mac_addr, ETH_ALEN)) {
314 qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
315 0, QLCNIC_MAC_DEL);
316 list_del(&cur->list);
317 kfree(cur);
318 return;
319 }
320 }
321}
322
311static int qlcnic_set_mac(struct net_device *netdev, void *p) 323static int qlcnic_set_mac(struct net_device *netdev, void *p)
312{ 324{
313 struct qlcnic_adapter *adapter = netdev_priv(netdev); 325 struct qlcnic_adapter *adapter = netdev_priv(netdev);
@@ -322,11 +334,15 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
322 if (!is_valid_ether_addr(addr->sa_data)) 334 if (!is_valid_ether_addr(addr->sa_data))
323 return -EINVAL; 335 return -EINVAL;
324 336
337 if (!memcmp(adapter->mac_addr, addr->sa_data, ETH_ALEN))
338 return 0;
339
325 if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { 340 if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
326 netif_device_detach(netdev); 341 netif_device_detach(netdev);
327 qlcnic_napi_disable(adapter); 342 qlcnic_napi_disable(adapter);
328 } 343 }
329 344
345 qlcnic_delete_adapter_mac(adapter);
330 memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len); 346 memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len);
331 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); 347 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
332 qlcnic_set_multi(adapter->netdev); 348 qlcnic_set_multi(adapter->netdev);
@@ -1053,8 +1069,6 @@ void qlcnic_set_eswitch_port_features(struct qlcnic_adapter *adapter,
1053 1069
1054 if (!esw_cfg->promisc_mode) 1070 if (!esw_cfg->promisc_mode)
1055 adapter->flags |= QLCNIC_PROMISC_DISABLED; 1071 adapter->flags |= QLCNIC_PROMISC_DISABLED;
1056
1057 qlcnic_set_netdev_features(adapter, esw_cfg);
1058} 1072}
1059 1073
1060int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter) 1074int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter)
@@ -1069,51 +1083,23 @@ int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *adapter)
1069 return -EIO; 1083 return -EIO;
1070 qlcnic_set_vlan_config(adapter, &esw_cfg); 1084 qlcnic_set_vlan_config(adapter, &esw_cfg);
1071 qlcnic_set_eswitch_port_features(adapter, &esw_cfg); 1085 qlcnic_set_eswitch_port_features(adapter, &esw_cfg);
1086 qlcnic_set_netdev_features(adapter, &esw_cfg);
1072 1087
1073 return 0; 1088 return 0;
1074} 1089}
1075 1090
1076static void 1091void qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
1077qlcnic_set_netdev_features(struct qlcnic_adapter *adapter, 1092 struct qlcnic_esw_func_cfg *esw_cfg)
1078 struct qlcnic_esw_func_cfg *esw_cfg)
1079{ 1093{
1080 struct net_device *netdev = adapter->netdev; 1094 struct net_device *netdev = adapter->netdev;
1081 unsigned long features, vlan_features;
1082 1095
1083 if (qlcnic_83xx_check(adapter)) 1096 if (qlcnic_83xx_check(adapter))
1084 return; 1097 return;
1085 1098
1086 features = (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | 1099 adapter->offload_flags = esw_cfg->offload_flags;
1087 NETIF_F_IPV6_CSUM | NETIF_F_GRO); 1100 adapter->flags |= QLCNIC_APP_CHANGED_FLAGS;
1088 vlan_features = (NETIF_F_SG | NETIF_F_IP_CSUM | 1101 netdev_update_features(netdev);
1089 NETIF_F_IPV6_CSUM); 1102 adapter->flags &= ~QLCNIC_APP_CHANGED_FLAGS;
1090
1091 if (QLCNIC_IS_TSO_CAPABLE(adapter)) {
1092 features |= (NETIF_F_TSO | NETIF_F_TSO6);
1093 vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6);
1094 }
1095
1096 if (netdev->features & NETIF_F_LRO)
1097 features |= NETIF_F_LRO;
1098
1099 if (esw_cfg->offload_flags & BIT_0) {
1100 netdev->features |= features;
1101 adapter->rx_csum = 1;
1102 if (!(esw_cfg->offload_flags & BIT_1)) {
1103 netdev->features &= ~NETIF_F_TSO;
1104 features &= ~NETIF_F_TSO;
1105 }
1106 if (!(esw_cfg->offload_flags & BIT_2)) {
1107 netdev->features &= ~NETIF_F_TSO6;
1108 features &= ~NETIF_F_TSO6;
1109 }
1110 } else {
1111 netdev->features &= ~features;
1112 features &= ~features;
1113 adapter->rx_csum = 0;
1114 }
1115
1116 netdev->vlan_features = (features & vlan_features);
1117} 1103}
1118 1104
1119static int 1105static int
@@ -1995,8 +1981,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1995 pci_enable_pcie_error_reporting(pdev); 1981 pci_enable_pcie_error_reporting(pdev);
1996 1982
1997 ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL); 1983 ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL);
1998 if (!ahw) 1984 if (!ahw) {
1985 err = -ENOMEM;
1999 goto err_out_free_res; 1986 goto err_out_free_res;
1987 }
2000 1988
2001 switch (ent->device) { 1989 switch (ent->device) {
2002 case PCI_DEVICE_ID_QLOGIC_QLE824X: 1990 case PCI_DEVICE_ID_QLOGIC_QLE824X:
@@ -2032,6 +2020,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2032 2020
2033 adapter->qlcnic_wq = create_singlethread_workqueue("qlcnic"); 2021 adapter->qlcnic_wq = create_singlethread_workqueue("qlcnic");
2034 if (adapter->qlcnic_wq == NULL) { 2022 if (adapter->qlcnic_wq == NULL) {
2023 err = -ENOMEM;
2035 dev_err(&pdev->dev, "Failed to create workqueue\n"); 2024 dev_err(&pdev->dev, "Failed to create workqueue\n");
2036 goto err_out_free_netdev; 2025 goto err_out_free_netdev;
2037 } 2026 }
@@ -2112,6 +2101,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2112 goto err_out_disable_msi; 2101 goto err_out_disable_msi;
2113 } 2102 }
2114 2103
2104 err = qlcnic_get_act_pci_func(adapter);
2105 if (err)
2106 goto err_out_disable_mbx_intr;
2107
2115 err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac); 2108 err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac);
2116 if (err) 2109 if (err)
2117 goto err_out_disable_mbx_intr; 2110 goto err_out_disable_mbx_intr;
@@ -2141,9 +2134,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2141 break; 2134 break;
2142 } 2135 }
2143 2136
2144 if (qlcnic_get_act_pci_func(adapter))
2145 goto err_out_disable_mbx_intr;
2146
2147 if (adapter->drv_mac_learn) 2137 if (adapter->drv_mac_learn)
2148 qlcnic_alloc_lb_filters_mem(adapter); 2138 qlcnic_alloc_lb_filters_mem(adapter);
2149 2139
@@ -2481,12 +2471,17 @@ static void qlcnic_tx_timeout(struct net_device *netdev)
2481 if (test_bit(__QLCNIC_RESETTING, &adapter->state)) 2471 if (test_bit(__QLCNIC_RESETTING, &adapter->state))
2482 return; 2472 return;
2483 2473
2484 dev_err(&netdev->dev, "transmit timeout, resetting.\n"); 2474 if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS) {
2485 2475 netdev_info(netdev, "Tx timeout, reset the adapter.\n");
2486 if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS) 2476 if (qlcnic_82xx_check(adapter))
2487 adapter->need_fw_reset = 1; 2477 adapter->need_fw_reset = 1;
2488 else 2478 else if (qlcnic_83xx_check(adapter))
2479 qlcnic_83xx_idc_request_reset(adapter,
2480 QLCNIC_FORCE_FW_DUMP_KEY);
2481 } else {
2482 netdev_info(netdev, "Tx timeout, reset adapter context.\n");
2489 adapter->ahw->reset_context = 1; 2483 adapter->ahw->reset_context = 1;
2484 }
2490} 2485}
2491 2486
2492static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev) 2487static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev)
@@ -3123,10 +3118,8 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
3123 if (adapter->need_fw_reset) 3118 if (adapter->need_fw_reset)
3124 goto detach; 3119 goto detach;
3125 3120
3126 if (adapter->ahw->reset_context && qlcnic_auto_fw_reset) { 3121 if (adapter->ahw->reset_context && qlcnic_auto_fw_reset)
3127 qlcnic_reset_hw_context(adapter); 3122 qlcnic_reset_hw_context(adapter);
3128 adapter->netdev->trans_start = jiffies;
3129 }
3130 3123
3131 return 0; 3124 return 0;
3132 } 3125 }
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
index 44d547d78b84..196b2d100407 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
@@ -280,9 +280,9 @@ void qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter)
280static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr, 280static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr,
281 u32 *pay, u8 pci_func, u8 size) 281 u32 *pay, u8 pci_func, u8 size)
282{ 282{
283 u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd, val, wait_time = 0;
283 struct qlcnic_hardware_context *ahw = adapter->ahw; 284 struct qlcnic_hardware_context *ahw = adapter->ahw;
284 unsigned long flags; 285 unsigned long flags;
285 u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd, val;
286 u16 opcode; 286 u16 opcode;
287 u8 mbx_err_code; 287 u8 mbx_err_code;
288 int i, j; 288 int i, j;
@@ -330,15 +330,13 @@ static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr,
330 * assume something is wrong. 330 * assume something is wrong.
331 */ 331 */
332poll: 332poll:
333 rsp = qlcnic_83xx_mbx_poll(adapter); 333 rsp = qlcnic_83xx_mbx_poll(adapter, &wait_time);
334 if (rsp != QLCNIC_RCODE_TIMEOUT) { 334 if (rsp != QLCNIC_RCODE_TIMEOUT) {
335 /* Get the FW response data */ 335 /* Get the FW response data */
336 fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); 336 fw_data = readl(QLCNIC_MBX_FW(ahw, 0));
337 if (fw_data & QLCNIC_MBX_ASYNC_EVENT) { 337 if (fw_data & QLCNIC_MBX_ASYNC_EVENT) {
338 __qlcnic_83xx_process_aen(adapter); 338 __qlcnic_83xx_process_aen(adapter);
339 mbx_val = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); 339 goto poll;
340 if (mbx_val)
341 goto poll;
342 } 340 }
343 mbx_err_code = QLCNIC_MBX_STATUS(fw_data); 341 mbx_err_code = QLCNIC_MBX_STATUS(fw_data);
344 rsp_num = QLCNIC_MBX_NUM_REGS(fw_data); 342 rsp_num = QLCNIC_MBX_NUM_REGS(fw_data);
@@ -1736,7 +1734,6 @@ static int qlcnic_sriov_vf_handle_context_reset(struct qlcnic_adapter *adapter)
1736 1734
1737 if (!qlcnic_sriov_vf_reinit_driver(adapter)) { 1735 if (!qlcnic_sriov_vf_reinit_driver(adapter)) {
1738 qlcnic_sriov_vf_attach(adapter); 1736 qlcnic_sriov_vf_attach(adapter);
1739 adapter->netdev->trans_start = jiffies;
1740 adapter->tx_timeo_cnt = 0; 1737 adapter->tx_timeo_cnt = 0;
1741 adapter->reset_ctx_cnt = 0; 1738 adapter->reset_ctx_cnt = 0;
1742 adapter->fw_fail_cnt = 0; 1739 adapter->fw_fail_cnt = 0;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index c81be2da119b..1a66ccded235 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -1133,9 +1133,6 @@ static int qlcnic_sriov_validate_linkevent(struct qlcnic_vf_info *vf,
1133 if ((cmd->req.arg[1] >> 16) != vf->rx_ctx_id) 1133 if ((cmd->req.arg[1] >> 16) != vf->rx_ctx_id)
1134 return -EINVAL; 1134 return -EINVAL;
1135 1135
1136 if (!(cmd->req.arg[1] & BIT_8))
1137 return -EINVAL;
1138
1139 return 0; 1136 return 0;
1140} 1137}
1141 1138
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
index 4e22e794a186..e7a2fe21b649 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
@@ -544,6 +544,9 @@ static ssize_t qlcnic_sysfs_write_esw_config(struct file *file,
544 switch (esw_cfg[i].op_mode) { 544 switch (esw_cfg[i].op_mode) {
545 case QLCNIC_PORT_DEFAULTS: 545 case QLCNIC_PORT_DEFAULTS:
546 qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]); 546 qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]);
547 rtnl_lock();
548 qlcnic_set_netdev_features(adapter, &esw_cfg[i]);
549 rtnl_unlock();
547 break; 550 break;
548 case QLCNIC_ADD_VLAN: 551 case QLCNIC_ADD_VLAN:
549 qlcnic_set_vlan_config(adapter, &esw_cfg[i]); 552 qlcnic_set_vlan_config(adapter, &esw_cfg[i]);
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 87463bc701a6..50235d201592 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -1106,6 +1106,7 @@ static int ql_get_next_chunk(struct ql_adapter *qdev, struct rx_ring *rx_ring,
1106 if (pci_dma_mapping_error(qdev->pdev, map)) { 1106 if (pci_dma_mapping_error(qdev->pdev, map)) {
1107 __free_pages(rx_ring->pg_chunk.page, 1107 __free_pages(rx_ring->pg_chunk.page,
1108 qdev->lbq_buf_order); 1108 qdev->lbq_buf_order);
1109 rx_ring->pg_chunk.page = NULL;
1109 netif_err(qdev, drv, qdev->ndev, 1110 netif_err(qdev, drv, qdev->ndev,
1110 "PCI mapping failed.\n"); 1111 "PCI mapping failed.\n");
1111 return -ENOMEM; 1112 return -ENOMEM;
@@ -2777,6 +2778,12 @@ static void ql_free_lbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring
2777 curr_idx = 0; 2778 curr_idx = 0;
2778 2779
2779 } 2780 }
2781 if (rx_ring->pg_chunk.page) {
2782 pci_unmap_page(qdev->pdev, rx_ring->pg_chunk.map,
2783 ql_lbq_block_size(qdev), PCI_DMA_FROMDEVICE);
2784 put_page(rx_ring->pg_chunk.page);
2785 rx_ring->pg_chunk.page = NULL;
2786 }
2780} 2787}
2781 2788
2782static void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring) 2789static void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring)
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 7d1fb9ad1296..03523459c406 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -1136,6 +1136,7 @@ static void cp_clean_rings (struct cp_private *cp)
1136 cp->dev->stats.tx_dropped++; 1136 cp->dev->stats.tx_dropped++;
1137 } 1137 }
1138 } 1138 }
1139 netdev_reset_queue(cp->dev);
1139 1140
1140 memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE); 1141 memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE);
1141 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); 1142 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 79c520b64fdd..393f961a013c 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5856,7 +5856,20 @@ err_out:
5856 return -EIO; 5856 return -EIO;
5857} 5857}
5858 5858
5859static inline void rtl8169_tso_csum(struct rtl8169_private *tp, 5859static bool rtl_skb_pad(struct sk_buff *skb)
5860{
5861 if (skb_padto(skb, ETH_ZLEN))
5862 return false;
5863 skb_put(skb, ETH_ZLEN - skb->len);
5864 return true;
5865}
5866
5867static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp, struct sk_buff *skb)
5868{
5869 return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
5870}
5871
5872static inline bool rtl8169_tso_csum(struct rtl8169_private *tp,
5860 struct sk_buff *skb, u32 *opts) 5873 struct sk_buff *skb, u32 *opts)
5861{ 5874{
5862 const struct rtl_tx_desc_info *info = tx_desc_info + tp->txd_version; 5875 const struct rtl_tx_desc_info *info = tx_desc_info + tp->txd_version;
@@ -5869,13 +5882,20 @@ static inline void rtl8169_tso_csum(struct rtl8169_private *tp,
5869 } else if (skb->ip_summed == CHECKSUM_PARTIAL) { 5882 } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
5870 const struct iphdr *ip = ip_hdr(skb); 5883 const struct iphdr *ip = ip_hdr(skb);
5871 5884
5885 if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
5886 return skb_checksum_help(skb) == 0 && rtl_skb_pad(skb);
5887
5872 if (ip->protocol == IPPROTO_TCP) 5888 if (ip->protocol == IPPROTO_TCP)
5873 opts[offset] |= info->checksum.tcp; 5889 opts[offset] |= info->checksum.tcp;
5874 else if (ip->protocol == IPPROTO_UDP) 5890 else if (ip->protocol == IPPROTO_UDP)
5875 opts[offset] |= info->checksum.udp; 5891 opts[offset] |= info->checksum.udp;
5876 else 5892 else
5877 WARN_ON_ONCE(1); 5893 WARN_ON_ONCE(1);
5894 } else {
5895 if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
5896 return rtl_skb_pad(skb);
5878 } 5897 }
5898 return true;
5879} 5899}
5880 5900
5881static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, 5901static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
@@ -5896,17 +5916,15 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5896 goto err_stop_0; 5916 goto err_stop_0;
5897 } 5917 }
5898 5918
5899 /* 8168evl does not automatically pad to minimum length. */
5900 if (unlikely(tp->mac_version == RTL_GIGA_MAC_VER_34 &&
5901 skb->len < ETH_ZLEN)) {
5902 if (skb_padto(skb, ETH_ZLEN))
5903 goto err_update_stats;
5904 skb_put(skb, ETH_ZLEN - skb->len);
5905 }
5906
5907 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) 5919 if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
5908 goto err_stop_0; 5920 goto err_stop_0;
5909 5921
5922 opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb));
5923 opts[0] = DescOwn;
5924
5925 if (!rtl8169_tso_csum(tp, skb, opts))
5926 goto err_update_stats;
5927
5910 len = skb_headlen(skb); 5928 len = skb_headlen(skb);
5911 mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE); 5929 mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE);
5912 if (unlikely(dma_mapping_error(d, mapping))) { 5930 if (unlikely(dma_mapping_error(d, mapping))) {
@@ -5918,11 +5936,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5918 tp->tx_skb[entry].len = len; 5936 tp->tx_skb[entry].len = len;
5919 txd->addr = cpu_to_le64(mapping); 5937 txd->addr = cpu_to_le64(mapping);
5920 5938
5921 opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb));
5922 opts[0] = DescOwn;
5923
5924 rtl8169_tso_csum(tp, skb, opts);
5925
5926 frags = rtl8169_xmit_frags(tp, skb, opts); 5939 frags = rtl8169_xmit_frags(tp, skb, opts);
5927 if (frags < 0) 5940 if (frags < 0)
5928 goto err_dma_1; 5941 goto err_dma_1;
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 33dc6f2418f2..42e9dd05c936 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2745,11 +2745,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2745 if (mdp->cd->tsu) { 2745 if (mdp->cd->tsu) {
2746 struct resource *rtsu; 2746 struct resource *rtsu;
2747 rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1); 2747 rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
2748 if (!rtsu) {
2749 dev_err(&pdev->dev, "Not found TSU resource\n");
2750 ret = -ENODEV;
2751 goto out_release;
2752 }
2753 mdp->tsu_addr = devm_ioremap_resource(&pdev->dev, rtsu); 2748 mdp->tsu_addr = devm_ioremap_resource(&pdev->dev, rtsu);
2754 if (IS_ERR(mdp->tsu_addr)) { 2749 if (IS_ERR(mdp->tsu_addr)) {
2755 ret = PTR_ERR(mdp->tsu_addr); 2750 ret = PTR_ERR(mdp->tsu_addr);
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 01b99206139a..39e4cb39de29 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -638,14 +638,16 @@ static void efx_start_datapath(struct efx_nic *efx)
638 EFX_MAX_FRAME_LEN(efx->net_dev->mtu) + 638 EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
639 efx->type->rx_buffer_padding); 639 efx->type->rx_buffer_padding);
640 rx_buf_len = (sizeof(struct efx_rx_page_state) + 640 rx_buf_len = (sizeof(struct efx_rx_page_state) +
641 EFX_PAGE_IP_ALIGN + efx->rx_dma_len); 641 NET_IP_ALIGN + efx->rx_dma_len);
642 if (rx_buf_len <= PAGE_SIZE) { 642 if (rx_buf_len <= PAGE_SIZE) {
643 efx->rx_scatter = false; 643 efx->rx_scatter = false;
644 efx->rx_buffer_order = 0; 644 efx->rx_buffer_order = 0;
645 } else if (efx->type->can_rx_scatter) { 645 } else if (efx->type->can_rx_scatter) {
646 BUILD_BUG_ON(EFX_RX_USR_BUF_SIZE % L1_CACHE_BYTES);
646 BUILD_BUG_ON(sizeof(struct efx_rx_page_state) + 647 BUILD_BUG_ON(sizeof(struct efx_rx_page_state) +
647 EFX_PAGE_IP_ALIGN + EFX_RX_USR_BUF_SIZE > 648 2 * ALIGN(NET_IP_ALIGN + EFX_RX_USR_BUF_SIZE,
648 PAGE_SIZE / 2); 649 EFX_RX_BUF_ALIGNMENT) >
650 PAGE_SIZE);
649 efx->rx_scatter = true; 651 efx->rx_scatter = true;
650 efx->rx_dma_len = EFX_RX_USR_BUF_SIZE; 652 efx->rx_dma_len = EFX_RX_USR_BUF_SIZE;
651 efx->rx_buffer_order = 0; 653 efx->rx_buffer_order = 0;
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 9bd433a095c5..39d6bd77f015 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -72,8 +72,20 @@
72/* Maximum possible MTU the driver supports */ 72/* Maximum possible MTU the driver supports */
73#define EFX_MAX_MTU (9 * 1024) 73#define EFX_MAX_MTU (9 * 1024)
74 74
75/* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page. */ 75/* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page,
76#define EFX_RX_USR_BUF_SIZE 1824 76 * and should be a multiple of the cache line size.
77 */
78#define EFX_RX_USR_BUF_SIZE (2048 - 256)
79
80/* If possible, we should ensure cache line alignment at start and end
81 * of every buffer. Otherwise, we just need to ensure 4-byte
82 * alignment of the network header.
83 */
84#if NET_IP_ALIGN == 0
85#define EFX_RX_BUF_ALIGNMENT L1_CACHE_BYTES
86#else
87#define EFX_RX_BUF_ALIGNMENT 4
88#endif
77 89
78/* Forward declare Precision Time Protocol (PTP) support structure. */ 90/* Forward declare Precision Time Protocol (PTP) support structure. */
79struct efx_ptp_data; 91struct efx_ptp_data;
@@ -468,24 +480,11 @@ enum nic_state {
468}; 480};
469 481
470/* 482/*
471 * Alignment of page-allocated RX buffers
472 *
473 * Controls the number of bytes inserted at the start of an RX buffer.
474 * This is the equivalent of NET_IP_ALIGN [which controls the alignment
475 * of the skb->head for hardware DMA].
476 */
477#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
478#define EFX_PAGE_IP_ALIGN 0
479#else
480#define EFX_PAGE_IP_ALIGN NET_IP_ALIGN
481#endif
482
483/*
484 * Alignment of the skb->head which wraps a page-allocated RX buffer 483 * Alignment of the skb->head which wraps a page-allocated RX buffer
485 * 484 *
486 * The skb allocated to wrap an rx_buffer can have this alignment. Since 485 * The skb allocated to wrap an rx_buffer can have this alignment. Since
487 * the data is memcpy'd from the rx_buf, it does not need to be equal to 486 * the data is memcpy'd from the rx_buf, it does not need to be equal to
488 * EFX_PAGE_IP_ALIGN. 487 * NET_IP_ALIGN.
489 */ 488 */
490#define EFX_PAGE_SKB_ALIGN 2 489#define EFX_PAGE_SKB_ALIGN 2
491 490
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index e73e30bac10e..a7dfe36cabf4 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -93,8 +93,8 @@ static inline void efx_sync_rx_buffer(struct efx_nic *efx,
93 93
94void efx_rx_config_page_split(struct efx_nic *efx) 94void efx_rx_config_page_split(struct efx_nic *efx)
95{ 95{
96 efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + EFX_PAGE_IP_ALIGN, 96 efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + NET_IP_ALIGN,
97 L1_CACHE_BYTES); 97 EFX_RX_BUF_ALIGNMENT);
98 efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 : 98 efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 :
99 ((PAGE_SIZE - sizeof(struct efx_rx_page_state)) / 99 ((PAGE_SIZE - sizeof(struct efx_rx_page_state)) /
100 efx->rx_page_buf_step); 100 efx->rx_page_buf_step);
@@ -188,9 +188,9 @@ static int efx_init_rx_buffers(struct efx_rx_queue *rx_queue)
188 do { 188 do {
189 index = rx_queue->added_count & rx_queue->ptr_mask; 189 index = rx_queue->added_count & rx_queue->ptr_mask;
190 rx_buf = efx_rx_buffer(rx_queue, index); 190 rx_buf = efx_rx_buffer(rx_queue, index);
191 rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN; 191 rx_buf->dma_addr = dma_addr + NET_IP_ALIGN;
192 rx_buf->page = page; 192 rx_buf->page = page;
193 rx_buf->page_offset = page_offset + EFX_PAGE_IP_ALIGN; 193 rx_buf->page_offset = page_offset + NET_IP_ALIGN;
194 rx_buf->len = efx->rx_dma_len; 194 rx_buf->len = efx->rx_dma_len;
195 rx_buf->flags = 0; 195 rx_buf->flags = 0;
196 ++rx_queue->added_count; 196 ++rx_queue->added_count;
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index f695a50bac47..43c1f3223322 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -1,6 +1,6 @@
1config STMMAC_ETH 1config STMMAC_ETH
2 tristate "STMicroelectronics 10/100/1000 Ethernet driver" 2 tristate "STMicroelectronics 10/100/1000 Ethernet driver"
3 depends on HAS_IOMEM 3 depends on HAS_IOMEM && HAS_DMA
4 select NET_CORE 4 select NET_CORE
5 select MII 5 select MII
6 select PHYLIB 6 select PHYLIB
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index d5a141c7c4e7..1c502bb0c916 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -229,7 +229,8 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
229 } 229 }
230 230
231 if (port->passthru) 231 if (port->passthru)
232 vlan = list_first_entry(&port->vlans, struct macvlan_dev, list); 232 vlan = list_first_or_null_rcu(&port->vlans,
233 struct macvlan_dev, list);
233 else 234 else
234 vlan = macvlan_hash_lookup(port, eth->h_dest); 235 vlan = macvlan_hash_lookup(port, eth->h_dest);
235 if (vlan == NULL) 236 if (vlan == NULL)
@@ -814,7 +815,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
814 if (err < 0) 815 if (err < 0)
815 goto upper_dev_unlink; 816 goto upper_dev_unlink;
816 817
817 list_add_tail(&vlan->list, &port->vlans); 818 list_add_tail_rcu(&vlan->list, &port->vlans);
818 netif_stacked_transfer_operstate(lowerdev, dev); 819 netif_stacked_transfer_operstate(lowerdev, dev);
819 820
820 return 0; 821 return 0;
@@ -842,7 +843,7 @@ void macvlan_dellink(struct net_device *dev, struct list_head *head)
842{ 843{
843 struct macvlan_dev *vlan = netdev_priv(dev); 844 struct macvlan_dev *vlan = netdev_priv(dev);
844 845
845 list_del(&vlan->list); 846 list_del_rcu(&vlan->list);
846 unregister_netdevice_queue(dev, head); 847 unregister_netdevice_queue(dev, head);
847 netdev_upper_dev_unlink(vlan->lowerdev, dev); 848 netdev_upper_dev_unlink(vlan->lowerdev, dev);
848} 849}
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index ed947dd76fbd..f3cdf64997d6 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -375,6 +375,8 @@ static void ntb_netdev_remove(struct pci_dev *pdev)
375 if (dev == NULL) 375 if (dev == NULL)
376 return; 376 return;
377 377
378 list_del(&dev->list);
379
378 ndev = dev->ndev; 380 ndev = dev->ndev;
379 381
380 unregister_netdev(ndev); 382 unregister_netdev(ndev);
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index cf887c2384e9..86adfa0a912e 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -582,6 +582,7 @@ static const struct usb_device_id products[] = {
582 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ 582 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
583 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ 583 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
584 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ 584 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
585 {QMI_FIXED_INTF(0x1e2d, 0x12d1, 4)}, /* Cinterion PLxx */
585 586
586 /* 4. Gobi 1000 devices */ 587 /* 4. Gobi 1000 devices */
587 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 588 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index a491d3a95393..6cbdac67f3a0 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -130,19 +130,23 @@ struct rtl8150 {
130 struct usb_device *udev; 130 struct usb_device *udev;
131 struct tasklet_struct tl; 131 struct tasklet_struct tl;
132 struct net_device *netdev; 132 struct net_device *netdev;
133 struct urb *rx_urb, *tx_urb, *intr_urb, *ctrl_urb; 133 struct urb *rx_urb, *tx_urb, *intr_urb;
134 struct sk_buff *tx_skb, *rx_skb; 134 struct sk_buff *tx_skb, *rx_skb;
135 struct sk_buff *rx_skb_pool[RX_SKB_POOL_SIZE]; 135 struct sk_buff *rx_skb_pool[RX_SKB_POOL_SIZE];
136 spinlock_t rx_pool_lock; 136 spinlock_t rx_pool_lock;
137 struct usb_ctrlrequest dr; 137 struct usb_ctrlrequest dr;
138 int intr_interval; 138 int intr_interval;
139 __le16 rx_creg;
140 u8 *intr_buff; 139 u8 *intr_buff;
141 u8 phy; 140 u8 phy;
142}; 141};
143 142
144typedef struct rtl8150 rtl8150_t; 143typedef struct rtl8150 rtl8150_t;
145 144
145struct async_req {
146 struct usb_ctrlrequest dr;
147 u16 rx_creg;
148};
149
146static const char driver_name [] = "rtl8150"; 150static const char driver_name [] = "rtl8150";
147 151
148/* 152/*
@@ -164,51 +168,47 @@ static int set_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
164 indx, 0, data, size, 500); 168 indx, 0, data, size, 500);
165} 169}
166 170
167static void ctrl_callback(struct urb *urb) 171static void async_set_reg_cb(struct urb *urb)
168{ 172{
169 rtl8150_t *dev; 173 struct async_req *req = (struct async_req *)urb->context;
170 int status = urb->status; 174 int status = urb->status;
171 175
172 switch (status) { 176 if (status < 0)
173 case 0: 177 dev_dbg(&urb->dev->dev, "%s failed with %d", __func__, status);
174 break; 178 kfree(req);
175 case -EINPROGRESS: 179 usb_free_urb(urb);
176 break;
177 case -ENOENT:
178 break;
179 default:
180 if (printk_ratelimit())
181 dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status);
182 }
183 dev = urb->context;
184 clear_bit(RX_REG_SET, &dev->flags);
185} 180}
186 181
187static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size) 182static int async_set_registers(rtl8150_t *dev, u16 indx, u16 size, u16 reg)
188{ 183{
189 int ret; 184 int res = -ENOMEM;
190 185 struct urb *async_urb;
191 if (test_bit(RX_REG_SET, &dev->flags)) 186 struct async_req *req;
192 return -EAGAIN;
193 187
194 dev->dr.bRequestType = RTL8150_REQT_WRITE; 188 req = kmalloc(sizeof(struct async_req), GFP_ATOMIC);
195 dev->dr.bRequest = RTL8150_REQ_SET_REGS; 189 if (req == NULL)
196 dev->dr.wValue = cpu_to_le16(indx); 190 return res;
197 dev->dr.wIndex = 0; 191 async_urb = usb_alloc_urb(0, GFP_ATOMIC);
198 dev->dr.wLength = cpu_to_le16(size); 192 if (async_urb == NULL) {
199 dev->ctrl_urb->transfer_buffer_length = size; 193 kfree(req);
200 usb_fill_control_urb(dev->ctrl_urb, dev->udev, 194 return res;
201 usb_sndctrlpipe(dev->udev, 0), (char *) &dev->dr, 195 }
202 &dev->rx_creg, size, ctrl_callback, dev); 196 req->rx_creg = cpu_to_le16(reg);
203 if ((ret = usb_submit_urb(dev->ctrl_urb, GFP_ATOMIC))) { 197 req->dr.bRequestType = RTL8150_REQT_WRITE;
204 if (ret == -ENODEV) 198 req->dr.bRequest = RTL8150_REQ_SET_REGS;
199 req->dr.wIndex = 0;
200 req->dr.wValue = cpu_to_le16(indx);
201 req->dr.wLength = cpu_to_le16(size);
202 usb_fill_control_urb(async_urb, dev->udev,
203 usb_sndctrlpipe(dev->udev, 0), (void *)&req->dr,
204 &req->rx_creg, size, async_set_reg_cb, req);
205 res = usb_submit_urb(async_urb, GFP_ATOMIC);
206 if (res) {
207 if (res == -ENODEV)
205 netif_device_detach(dev->netdev); 208 netif_device_detach(dev->netdev);
206 dev_err(&dev->udev->dev, 209 dev_err(&dev->udev->dev, "%s failed with %d\n", __func__, res);
207 "control request submission failed: %d\n", ret); 210 }
208 } else 211 return res;
209 set_bit(RX_REG_SET, &dev->flags);
210
211 return ret;
212} 212}
213 213
214static int read_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 * reg) 214static int read_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 * reg)
@@ -330,13 +330,6 @@ static int alloc_all_urbs(rtl8150_t * dev)
330 usb_free_urb(dev->tx_urb); 330 usb_free_urb(dev->tx_urb);
331 return 0; 331 return 0;
332 } 332 }
333 dev->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
334 if (!dev->ctrl_urb) {
335 usb_free_urb(dev->rx_urb);
336 usb_free_urb(dev->tx_urb);
337 usb_free_urb(dev->intr_urb);
338 return 0;
339 }
340 333
341 return 1; 334 return 1;
342} 335}
@@ -346,7 +339,6 @@ static void free_all_urbs(rtl8150_t * dev)
346 usb_free_urb(dev->rx_urb); 339 usb_free_urb(dev->rx_urb);
347 usb_free_urb(dev->tx_urb); 340 usb_free_urb(dev->tx_urb);
348 usb_free_urb(dev->intr_urb); 341 usb_free_urb(dev->intr_urb);
349 usb_free_urb(dev->ctrl_urb);
350} 342}
351 343
352static void unlink_all_urbs(rtl8150_t * dev) 344static void unlink_all_urbs(rtl8150_t * dev)
@@ -354,7 +346,6 @@ static void unlink_all_urbs(rtl8150_t * dev)
354 usb_kill_urb(dev->rx_urb); 346 usb_kill_urb(dev->rx_urb);
355 usb_kill_urb(dev->tx_urb); 347 usb_kill_urb(dev->tx_urb);
356 usb_kill_urb(dev->intr_urb); 348 usb_kill_urb(dev->intr_urb);
357 usb_kill_urb(dev->ctrl_urb);
358} 349}
359 350
360static inline struct sk_buff *pull_skb(rtl8150_t *dev) 351static inline struct sk_buff *pull_skb(rtl8150_t *dev)
@@ -629,7 +620,6 @@ static int enable_net_traffic(rtl8150_t * dev)
629 } 620 }
630 /* RCR bit7=1 attach Rx info at the end; =0 HW CRC (which is broken) */ 621 /* RCR bit7=1 attach Rx info at the end; =0 HW CRC (which is broken) */
631 rcr = 0x9e; 622 rcr = 0x9e;
632 dev->rx_creg = cpu_to_le16(rcr);
633 tcr = 0xd8; 623 tcr = 0xd8;
634 cr = 0x0c; 624 cr = 0x0c;
635 if (!(rcr & 0x80)) 625 if (!(rcr & 0x80))
@@ -662,20 +652,22 @@ static void rtl8150_tx_timeout(struct net_device *netdev)
662static void rtl8150_set_multicast(struct net_device *netdev) 652static void rtl8150_set_multicast(struct net_device *netdev)
663{ 653{
664 rtl8150_t *dev = netdev_priv(netdev); 654 rtl8150_t *dev = netdev_priv(netdev);
655 u16 rx_creg = 0x9e;
656
665 netif_stop_queue(netdev); 657 netif_stop_queue(netdev);
666 if (netdev->flags & IFF_PROMISC) { 658 if (netdev->flags & IFF_PROMISC) {
667 dev->rx_creg |= cpu_to_le16(0x0001); 659 rx_creg |= 0x0001;
668 dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name); 660 dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name);
669 } else if (!netdev_mc_empty(netdev) || 661 } else if (!netdev_mc_empty(netdev) ||
670 (netdev->flags & IFF_ALLMULTI)) { 662 (netdev->flags & IFF_ALLMULTI)) {
671 dev->rx_creg &= cpu_to_le16(0xfffe); 663 rx_creg &= 0xfffe;
672 dev->rx_creg |= cpu_to_le16(0x0002); 664 rx_creg |= 0x0002;
673 dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name); 665 dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name);
674 } else { 666 } else {
675 /* ~RX_MULTICAST, ~RX_PROMISCUOUS */ 667 /* ~RX_MULTICAST, ~RX_PROMISCUOUS */
676 dev->rx_creg &= cpu_to_le16(0x00fc); 668 rx_creg &= 0x00fc;
677 } 669 }
678 async_set_registers(dev, RCR, 2); 670 async_set_registers(dev, RCR, sizeof(rx_creg), rx_creg);
679 netif_wake_queue(netdev); 671 netif_wake_queue(netdev);
680} 672}
681 673
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index f95cb032394b..06ee82f557d4 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1477,7 +1477,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1477 1477
1478 /* usbnet already took usb runtime pm, so have to enable the feature 1478 /* usbnet already took usb runtime pm, so have to enable the feature
1479 * for usb interface, otherwise usb_autopm_get_interface may return 1479 * for usb interface, otherwise usb_autopm_get_interface may return
1480 * failure if USB_SUSPEND(RUNTIME_PM) is enabled. 1480 * failure if RUNTIME_PM is enabled.
1481 */ 1481 */
1482 if (!driver->supports_autosuspend) { 1482 if (!driver->supports_autosuspend) {
1483 driver->supports_autosuspend = 1; 1483 driver->supports_autosuspend = 1;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 3c23fdc27bf0..c9e00387d999 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -28,7 +28,7 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/cpu.h> 29#include <linux/cpu.h>
30 30
31static int napi_weight = 128; 31static int napi_weight = NAPI_POLL_WEIGHT;
32module_param(napi_weight, int, 0444); 32module_param(napi_weight, int, 0444);
33 33
34static bool csum = true, gso = true; 34static bool csum = true, gso = true;
@@ -636,10 +636,11 @@ static int virtnet_open(struct net_device *dev)
636 struct virtnet_info *vi = netdev_priv(dev); 636 struct virtnet_info *vi = netdev_priv(dev);
637 int i; 637 int i;
638 638
639 for (i = 0; i < vi->curr_queue_pairs; i++) { 639 for (i = 0; i < vi->max_queue_pairs; i++) {
640 /* Make sure we have some buffers: if oom use wq. */ 640 if (i < vi->curr_queue_pairs)
641 if (!try_fill_recv(&vi->rq[i], GFP_KERNEL)) 641 /* Make sure we have some buffers: if oom use wq. */
642 schedule_delayed_work(&vi->refill, 0); 642 if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
643 schedule_delayed_work(&vi->refill, 0);
643 virtnet_napi_enable(&vi->rq[i]); 644 virtnet_napi_enable(&vi->rq[i]);
644 } 645 }
645 646
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index ba81f3c39a83..3b1d2ee7156b 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -301,7 +301,7 @@ static inline struct hlist_head *vxlan_fdb_head(struct vxlan_dev *vxlan,
301} 301}
302 302
303/* Look up Ethernet address in forwarding table */ 303/* Look up Ethernet address in forwarding table */
304static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan, 304static struct vxlan_fdb *__vxlan_find_mac(struct vxlan_dev *vxlan,
305 const u8 *mac) 305 const u8 *mac)
306 306
307{ 307{
@@ -316,6 +316,18 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
316 return NULL; 316 return NULL;
317} 317}
318 318
319static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
320 const u8 *mac)
321{
322 struct vxlan_fdb *f;
323
324 f = __vxlan_find_mac(vxlan, mac);
325 if (f)
326 f->used = jiffies;
327
328 return f;
329}
330
319/* Add/update destinations for multicast */ 331/* Add/update destinations for multicast */
320static int vxlan_fdb_append(struct vxlan_fdb *f, 332static int vxlan_fdb_append(struct vxlan_fdb *f,
321 __be32 ip, __be16 port, __u32 vni, __u32 ifindex) 333 __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
@@ -353,7 +365,7 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
353 struct vxlan_fdb *f; 365 struct vxlan_fdb *f;
354 int notify = 0; 366 int notify = 0;
355 367
356 f = vxlan_find_mac(vxlan, mac); 368 f = __vxlan_find_mac(vxlan, mac);
357 if (f) { 369 if (f) {
358 if (flags & NLM_F_EXCL) { 370 if (flags & NLM_F_EXCL) {
359 netdev_dbg(vxlan->dev, 371 netdev_dbg(vxlan->dev,
@@ -563,7 +575,6 @@ static void vxlan_snoop(struct net_device *dev,
563 575
564 f = vxlan_find_mac(vxlan, src_mac); 576 f = vxlan_find_mac(vxlan, src_mac);
565 if (likely(f)) { 577 if (likely(f)) {
566 f->used = jiffies;
567 if (likely(f->remote.remote_ip == src_ip)) 578 if (likely(f->remote.remote_ip == src_ip))
568 return; 579 return;
569 580
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 9b20d9ee2719..7f702fe3ecc2 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2369,6 +2369,9 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
2369 int i; 2369 int i;
2370 bool needreset = false; 2370 bool needreset = false;
2371 2371
2372 if (!test_bit(ATH_STAT_STARTED, ah->status))
2373 return;
2374
2372 mutex_lock(&ah->lock); 2375 mutex_lock(&ah->lock);
2373 2376
2374 for (i = 0; i < ARRAY_SIZE(ah->txqs); i++) { 2377 for (i = 0; i < ARRAY_SIZE(ah->txqs); i++) {
@@ -2676,6 +2679,7 @@ done:
2676 mmiowb(); 2679 mmiowb();
2677 mutex_unlock(&ah->lock); 2680 mutex_unlock(&ah->lock);
2678 2681
2682 set_bit(ATH_STAT_STARTED, ah->status);
2679 ieee80211_queue_delayed_work(ah->hw, &ah->tx_complete_work, 2683 ieee80211_queue_delayed_work(ah->hw, &ah->tx_complete_work,
2680 msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT)); 2684 msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT));
2681 2685
@@ -2737,6 +2741,7 @@ void ath5k_stop(struct ieee80211_hw *hw)
2737 2741
2738 ath5k_stop_tasklets(ah); 2742 ath5k_stop_tasklets(ah);
2739 2743
2744 clear_bit(ATH_STAT_STARTED, ah->status);
2740 cancel_delayed_work_sync(&ah->tx_complete_work); 2745 cancel_delayed_work_sync(&ah->tx_complete_work);
2741 2746
2742 if (!ath5k_modparam_no_hw_rfkill_switch) 2747 if (!ath5k_modparam_no_hw_rfkill_switch)
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index 17507dc8a1e7..f3dc124c60c7 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -17,7 +17,7 @@ config ATH9K_BTCOEX_SUPPORT
17 17
18config ATH9K 18config ATH9K
19 tristate "Atheros 802.11n wireless cards support" 19 tristate "Atheros 802.11n wireless cards support"
20 depends on MAC80211 20 depends on MAC80211 && HAS_DMA
21 select ATH9K_HW 21 select ATH9K_HW
22 select MAC80211_LEDS 22 select MAC80211_LEDS
23 select LEDS_CLASS 23 select LEDS_CLASS
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 639ba7d18ea4..6988e1d081f2 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -965,7 +965,7 @@ static void ar9003_hw_do_manual_peak_cal(struct ath_hw *ah,
965{ 965{
966 int i; 966 int i;
967 967
968 if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah)) 968 if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah) && !AR_SREV_9485(ah))
969 return; 969 return;
970 970
971 for (i = 0; i < AR9300_MAX_CHAINS; i++) { 971 for (i = 0; i < AR9300_MAX_CHAINS; i++) {
diff --git a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
index 712f415b8c08..88ff1d7b53ab 100644
--- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
@@ -1020,7 +1020,7 @@ static const u32 ar9485_1_1_baseband_postamble[][5] = {
1020 {0x0000a284, 0x00000000, 0x00000000, 0x000002a0, 0x000002a0}, 1020 {0x0000a284, 0x00000000, 0x00000000, 0x000002a0, 0x000002a0},
1021 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1021 {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1022 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1022 {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1023 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, 1023 {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18},
1024 {0x0000a2d0, 0x00071981, 0x00071981, 0x00071982, 0x00071982}, 1024 {0x0000a2d0, 0x00071981, 0x00071981, 0x00071982, 0x00071982},
1025 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, 1025 {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
1026 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1026 {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
diff --git a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
index 0c2ac0c6dc89..e85a8b076c22 100644
--- a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
@@ -233,9 +233,9 @@ static const u32 ar9565_1p0_baseband_core[][2] = {
233 {0x00009d10, 0x01834061}, 233 {0x00009d10, 0x01834061},
234 {0x00009d14, 0x00c00400}, 234 {0x00009d14, 0x00c00400},
235 {0x00009d18, 0x00000000}, 235 {0x00009d18, 0x00000000},
236 {0x00009e08, 0x0078230c}, 236 {0x00009e08, 0x0038230c},
237 {0x00009e24, 0x990bb515}, 237 {0x00009e24, 0x9907b515},
238 {0x00009e28, 0x126f0000}, 238 {0x00009e28, 0x126f0600},
239 {0x00009e30, 0x06336f77}, 239 {0x00009e30, 0x06336f77},
240 {0x00009e34, 0x6af6532f}, 240 {0x00009e34, 0x6af6532f},
241 {0x00009e38, 0x0cc80c00}, 241 {0x00009e38, 0x0cc80c00},
@@ -337,7 +337,7 @@ static const u32 ar9565_1p0_baseband_core[][2] = {
337 337
338static const u32 ar9565_1p0_baseband_postamble[][5] = { 338static const u32 ar9565_1p0_baseband_postamble[][5] = {
339 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ 339 /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
340 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a800d}, 340 {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8009},
341 {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae}, 341 {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae},
342 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x63c640da}, 342 {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x63c640da},
343 {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x09143c81}, 343 {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x09143c81},
@@ -345,9 +345,9 @@ static const u32 ar9565_1p0_baseband_postamble[][5] = {
345 {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c}, 345 {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c},
346 {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4}, 346 {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
347 {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0}, 347 {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0},
348 {0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, 348 {0x00009e04, 0x00802020, 0x00802020, 0x00142020, 0x00142020},
349 {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000d8}, 349 {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
350 {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec86d2e}, 350 {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e},
351 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e}, 351 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e},
352 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 352 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
353 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, 353 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
@@ -450,6 +450,8 @@ static const u32 ar9565_1p0_soc_postamble[][5] = {
450 450
451static const u32 ar9565_1p0_Common_rx_gain_table[][2] = { 451static const u32 ar9565_1p0_Common_rx_gain_table[][2] = {
452 /* Addr allmodes */ 452 /* Addr allmodes */
453 {0x00004050, 0x00300300},
454 {0x0000406c, 0x00100000},
453 {0x0000a000, 0x00010000}, 455 {0x0000a000, 0x00010000},
454 {0x0000a004, 0x00030002}, 456 {0x0000a004, 0x00030002},
455 {0x0000a008, 0x00050004}, 457 {0x0000a008, 0x00050004},
@@ -498,27 +500,27 @@ static const u32 ar9565_1p0_Common_rx_gain_table[][2] = {
498 {0x0000a0b4, 0x00000000}, 500 {0x0000a0b4, 0x00000000},
499 {0x0000a0b8, 0x00000000}, 501 {0x0000a0b8, 0x00000000},
500 {0x0000a0bc, 0x00000000}, 502 {0x0000a0bc, 0x00000000},
501 {0x0000a0c0, 0x001f0000}, 503 {0x0000a0c0, 0x00bf00a0},
502 {0x0000a0c4, 0x01000101}, 504 {0x0000a0c4, 0x11a011a1},
503 {0x0000a0c8, 0x011e011f}, 505 {0x0000a0c8, 0x11be11bf},
504 {0x0000a0cc, 0x011c011d}, 506 {0x0000a0cc, 0x11bc11bd},
505 {0x0000a0d0, 0x02030204}, 507 {0x0000a0d0, 0x22632264},
506 {0x0000a0d4, 0x02010202}, 508 {0x0000a0d4, 0x22612262},
507 {0x0000a0d8, 0x021f0200}, 509 {0x0000a0d8, 0x227f2260},
508 {0x0000a0dc, 0x0302021e}, 510 {0x0000a0dc, 0x4322227e},
509 {0x0000a0e0, 0x03000301}, 511 {0x0000a0e0, 0x43204321},
510 {0x0000a0e4, 0x031e031f}, 512 {0x0000a0e4, 0x433e433f},
511 {0x0000a0e8, 0x0402031d}, 513 {0x0000a0e8, 0x4462433d},
512 {0x0000a0ec, 0x04000401}, 514 {0x0000a0ec, 0x44604461},
513 {0x0000a0f0, 0x041e041f}, 515 {0x0000a0f0, 0x447e447f},
514 {0x0000a0f4, 0x0502041d}, 516 {0x0000a0f4, 0x5582447d},
515 {0x0000a0f8, 0x05000501}, 517 {0x0000a0f8, 0x55805581},
516 {0x0000a0fc, 0x051e051f}, 518 {0x0000a0fc, 0x559e559f},
517 {0x0000a100, 0x06010602}, 519 {0x0000a100, 0x66816682},
518 {0x0000a104, 0x061f0600}, 520 {0x0000a104, 0x669f6680},
519 {0x0000a108, 0x061d061e}, 521 {0x0000a108, 0x669d669e},
520 {0x0000a10c, 0x07020703}, 522 {0x0000a10c, 0x77627763},
521 {0x0000a110, 0x07000701}, 523 {0x0000a110, 0x77607761},
522 {0x0000a114, 0x00000000}, 524 {0x0000a114, 0x00000000},
523 {0x0000a118, 0x00000000}, 525 {0x0000a118, 0x00000000},
524 {0x0000a11c, 0x00000000}, 526 {0x0000a11c, 0x00000000},
@@ -530,27 +532,27 @@ static const u32 ar9565_1p0_Common_rx_gain_table[][2] = {
530 {0x0000a134, 0x00000000}, 532 {0x0000a134, 0x00000000},
531 {0x0000a138, 0x00000000}, 533 {0x0000a138, 0x00000000},
532 {0x0000a13c, 0x00000000}, 534 {0x0000a13c, 0x00000000},
533 {0x0000a140, 0x001f0000}, 535 {0x0000a140, 0x00bf00a0},
534 {0x0000a144, 0x01000101}, 536 {0x0000a144, 0x11a011a1},
535 {0x0000a148, 0x011e011f}, 537 {0x0000a148, 0x11be11bf},
536 {0x0000a14c, 0x011c011d}, 538 {0x0000a14c, 0x11bc11bd},
537 {0x0000a150, 0x02030204}, 539 {0x0000a150, 0x22632264},
538 {0x0000a154, 0x02010202}, 540 {0x0000a154, 0x22612262},
539 {0x0000a158, 0x021f0200}, 541 {0x0000a158, 0x227f2260},
540 {0x0000a15c, 0x0302021e}, 542 {0x0000a15c, 0x4322227e},
541 {0x0000a160, 0x03000301}, 543 {0x0000a160, 0x43204321},
542 {0x0000a164, 0x031e031f}, 544 {0x0000a164, 0x433e433f},
543 {0x0000a168, 0x0402031d}, 545 {0x0000a168, 0x4462433d},
544 {0x0000a16c, 0x04000401}, 546 {0x0000a16c, 0x44604461},
545 {0x0000a170, 0x041e041f}, 547 {0x0000a170, 0x447e447f},
546 {0x0000a174, 0x0502041d}, 548 {0x0000a174, 0x5582447d},
547 {0x0000a178, 0x05000501}, 549 {0x0000a178, 0x55805581},
548 {0x0000a17c, 0x051e051f}, 550 {0x0000a17c, 0x559e559f},
549 {0x0000a180, 0x06010602}, 551 {0x0000a180, 0x66816682},
550 {0x0000a184, 0x061f0600}, 552 {0x0000a184, 0x669f6680},
551 {0x0000a188, 0x061d061e}, 553 {0x0000a188, 0x669d669e},
552 {0x0000a18c, 0x07020703}, 554 {0x0000a18c, 0x77e677e7},
553 {0x0000a190, 0x07000701}, 555 {0x0000a190, 0x77e477e5},
554 {0x0000a194, 0x00000000}, 556 {0x0000a194, 0x00000000},
555 {0x0000a198, 0x00000000}, 557 {0x0000a198, 0x00000000},
556 {0x0000a19c, 0x00000000}, 558 {0x0000a19c, 0x00000000},
@@ -770,7 +772,7 @@ static const u32 ar9565_1p0_Modes_lowest_ob_db_tx_gain_table[][5] = {
770 772
771static const u32 ar9565_1p0_pciephy_clkreq_disable_L1[][2] = { 773static const u32 ar9565_1p0_pciephy_clkreq_disable_L1[][2] = {
772 /* Addr allmodes */ 774 /* Addr allmodes */
773 {0x00018c00, 0x18213ede}, 775 {0x00018c00, 0x18212ede},
774 {0x00018c04, 0x000801d8}, 776 {0x00018c04, 0x000801d8},
775 {0x00018c08, 0x0003780c}, 777 {0x00018c08, 0x0003780c},
776}; 778};
@@ -889,8 +891,8 @@ static const u32 ar9565_1p0_common_wo_xlna_rx_gain_table[][2] = {
889 {0x0000a180, 0x66816682}, 891 {0x0000a180, 0x66816682},
890 {0x0000a184, 0x669f6680}, 892 {0x0000a184, 0x669f6680},
891 {0x0000a188, 0x669d669e}, 893 {0x0000a188, 0x669d669e},
892 {0x0000a18c, 0x77627763}, 894 {0x0000a18c, 0x77e677e7},
893 {0x0000a190, 0x77607761}, 895 {0x0000a190, 0x77e477e5},
894 {0x0000a194, 0x00000000}, 896 {0x0000a194, 0x00000000},
895 {0x0000a198, 0x00000000}, 897 {0x0000a198, 0x00000000},
896 {0x0000a19c, 0x00000000}, 898 {0x0000a19c, 0x00000000},
@@ -1114,7 +1116,7 @@ static const u32 ar9565_1p0_modes_high_ob_db_tx_gain_table[][5] = {
1114 {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, 1116 {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84},
1115 {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, 1117 {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000},
1116 {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, 1118 {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000},
1117 {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, 1119 {0x0000a410, 0x000050d9, 0x000050d9, 0x000050df, 0x000050df},
1118 {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, 1120 {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
1119 {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, 1121 {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
1120 {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, 1122 {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004},
@@ -1140,13 +1142,13 @@ static const u32 ar9565_1p0_modes_high_ob_db_tx_gain_table[][5] = {
1140 {0x0000a558, 0x69027f56, 0x69027f56, 0x53001ce5, 0x53001ce5}, 1142 {0x0000a558, 0x69027f56, 0x69027f56, 0x53001ce5, 0x53001ce5},
1141 {0x0000a55c, 0x6d029f56, 0x6d029f56, 0x57001ce9, 0x57001ce9}, 1143 {0x0000a55c, 0x6d029f56, 0x6d029f56, 0x57001ce9, 0x57001ce9},
1142 {0x0000a560, 0x73049f56, 0x73049f56, 0x5b001ceb, 0x5b001ceb}, 1144 {0x0000a560, 0x73049f56, 0x73049f56, 0x5b001ceb, 0x5b001ceb},
1143 {0x0000a564, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1145 {0x0000a564, 0x7804ff56, 0x7804ff56, 0x60001cf0, 0x60001cf0},
1144 {0x0000a568, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1146 {0x0000a568, 0x7804ff56, 0x7804ff56, 0x61001cf1, 0x61001cf1},
1145 {0x0000a56c, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1147 {0x0000a56c, 0x7804ff56, 0x7804ff56, 0x62001cf2, 0x62001cf2},
1146 {0x0000a570, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1148 {0x0000a570, 0x7804ff56, 0x7804ff56, 0x63001cf3, 0x63001cf3},
1147 {0x0000a574, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1149 {0x0000a574, 0x7804ff56, 0x7804ff56, 0x64001cf4, 0x64001cf4},
1148 {0x0000a578, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1150 {0x0000a578, 0x7804ff56, 0x7804ff56, 0x66001ff6, 0x66001ff6},
1149 {0x0000a57c, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, 1151 {0x0000a57c, 0x7804ff56, 0x7804ff56, 0x66001ff6, 0x66001ff6},
1150 {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1152 {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1151 {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1153 {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1152 {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1154 {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
@@ -1174,7 +1176,7 @@ static const u32 ar9565_1p0_modes_high_power_tx_gain_table[][5] = {
1174 {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, 1176 {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84},
1175 {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, 1177 {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000},
1176 {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, 1178 {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000},
1177 {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, 1179 {0x0000a410, 0x000050d9, 0x000050d9, 0x000050df, 0x000050df},
1178 {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, 1180 {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
1179 {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, 1181 {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
1180 {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, 1182 {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
@@ -1200,13 +1202,13 @@ static const u32 ar9565_1p0_modes_high_power_tx_gain_table[][5] = {
1200 {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5}, 1202 {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
1201 {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9}, 1203 {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
1202 {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb}, 1204 {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
1203 {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1205 {0x0000a564, 0x7504ff56, 0x7504ff56, 0x59001cf0, 0x59001cf0},
1204 {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1206 {0x0000a568, 0x7504ff56, 0x7504ff56, 0x5a001cf1, 0x5a001cf1},
1205 {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1207 {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x5b001cf2, 0x5b001cf2},
1206 {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1208 {0x0000a570, 0x7504ff56, 0x7504ff56, 0x5c001cf3, 0x5c001cf3},
1207 {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1209 {0x0000a574, 0x7504ff56, 0x7504ff56, 0x5d001cf4, 0x5d001cf4},
1208 {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1210 {0x0000a578, 0x7504ff56, 0x7504ff56, 0x5f001ff6, 0x5f001ff6},
1209 {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, 1211 {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x5f001ff6, 0x5f001ff6},
1210 {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1212 {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1211 {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1213 {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
1212 {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 1214 {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 8a1888d02070..366002f266f8 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -254,6 +254,7 @@ struct ath_atx_tid {
254 int sched; 254 int sched;
255 int paused; 255 int paused;
256 u8 state; 256 u8 state;
257 bool stop_cb;
257}; 258};
258 259
259struct ath_node { 260struct ath_node {
@@ -351,7 +352,8 @@ void ath_tx_tasklet(struct ath_softc *sc);
351void ath_tx_edma_tasklet(struct ath_softc *sc); 352void ath_tx_edma_tasklet(struct ath_softc *sc);
352int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, 353int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
353 u16 tid, u16 *ssn); 354 u16 tid, u16 *ssn);
354void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 355bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid,
356 bool flush);
355void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 357void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
356 358
357void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an); 359void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index e6307b86363a..b37eb8d38811 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -2008,6 +2008,14 @@ void ath9k_get_et_stats(struct ieee80211_hw *hw,
2008 WARN_ON(i != ATH9K_SSTATS_LEN); 2008 WARN_ON(i != ATH9K_SSTATS_LEN);
2009} 2009}
2010 2010
2011void ath9k_deinit_debug(struct ath_softc *sc)
2012{
2013 if (config_enabled(CONFIG_ATH9K_DEBUGFS) && sc->rfs_chan_spec_scan) {
2014 relay_close(sc->rfs_chan_spec_scan);
2015 sc->rfs_chan_spec_scan = NULL;
2016 }
2017}
2018
2011int ath9k_init_debug(struct ath_hw *ah) 2019int ath9k_init_debug(struct ath_hw *ah)
2012{ 2020{
2013 struct ath_common *common = ath9k_hw_common(ah); 2021 struct ath_common *common = ath9k_hw_common(ah);
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 794a7ec83a24..9d49aab8b989 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -304,6 +304,7 @@ struct ath9k_debug {
304}; 304};
305 305
306int ath9k_init_debug(struct ath_hw *ah); 306int ath9k_init_debug(struct ath_hw *ah);
307void ath9k_deinit_debug(struct ath_softc *sc);
307 308
308void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); 309void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
309void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, 310void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
@@ -339,6 +340,10 @@ static inline int ath9k_init_debug(struct ath_hw *ah)
339 return 0; 340 return 0;
340} 341}
341 342
343static inline void ath9k_deinit_debug(struct ath_softc *sc)
344{
345}
346
342static inline void ath_debug_stat_interrupt(struct ath_softc *sc, 347static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
343 enum ath9k_int status) 348 enum ath9k_int status)
344{ 349{
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 0237b2868961..aba415103f94 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -906,7 +906,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
906 if (!ath_is_world_regd(reg)) { 906 if (!ath_is_world_regd(reg)) {
907 error = regulatory_hint(hw->wiphy, reg->alpha2); 907 error = regulatory_hint(hw->wiphy, reg->alpha2);
908 if (error) 908 if (error)
909 goto unregister; 909 goto debug_cleanup;
910 } 910 }
911 911
912 ath_init_leds(sc); 912 ath_init_leds(sc);
@@ -914,6 +914,8 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
914 914
915 return 0; 915 return 0;
916 916
917debug_cleanup:
918 ath9k_deinit_debug(sc);
917unregister: 919unregister:
918 ieee80211_unregister_hw(hw); 920 ieee80211_unregister_hw(hw);
919rx_cleanup: 921rx_cleanup:
@@ -942,11 +944,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
942 sc->dfs_detector->exit(sc->dfs_detector); 944 sc->dfs_detector->exit(sc->dfs_detector);
943 945
944 ath9k_eeprom_release(sc); 946 ath9k_eeprom_release(sc);
945
946 if (config_enabled(CONFIG_ATH9K_DEBUGFS) && sc->rfs_chan_spec_scan) {
947 relay_close(sc->rfs_chan_spec_scan);
948 sc->rfs_chan_spec_scan = NULL;
949 }
950} 947}
951 948
952void ath9k_deinit_device(struct ath_softc *sc) 949void ath9k_deinit_device(struct ath_softc *sc)
@@ -960,6 +957,7 @@ void ath9k_deinit_device(struct ath_softc *sc)
960 957
961 ath9k_ps_restore(sc); 958 ath9k_ps_restore(sc);
962 959
960 ath9k_deinit_debug(sc);
963 ieee80211_unregister_hw(hw); 961 ieee80211_unregister_hw(hw);
964 ath_rx_cleanup(sc); 962 ath_rx_cleanup(sc);
965 ath9k_deinit_softc(sc); 963 ath9k_deinit_softc(sc);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6963862a1872..2382d1262e7f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -227,13 +227,13 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
227 if (!test_bit(SC_OP_BEACONS, &sc->sc_flags)) 227 if (!test_bit(SC_OP_BEACONS, &sc->sc_flags))
228 goto work; 228 goto work;
229 229
230 ath9k_set_beacon(sc);
231
232 if (ah->opmode == NL80211_IFTYPE_STATION && 230 if (ah->opmode == NL80211_IFTYPE_STATION &&
233 test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) { 231 test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
234 spin_lock_irqsave(&sc->sc_pm_lock, flags); 232 spin_lock_irqsave(&sc->sc_pm_lock, flags);
235 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; 233 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
236 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); 234 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
235 } else {
236 ath9k_set_beacon(sc);
237 } 237 }
238 work: 238 work:
239 ath_restart_work(sc); 239 ath_restart_work(sc);
@@ -1332,6 +1332,7 @@ static int ath9k_sta_add(struct ieee80211_hw *hw,
1332 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1332 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1333 struct ath_node *an = (struct ath_node *) sta->drv_priv; 1333 struct ath_node *an = (struct ath_node *) sta->drv_priv;
1334 struct ieee80211_key_conf ps_key = { }; 1334 struct ieee80211_key_conf ps_key = { };
1335 int key;
1335 1336
1336 ath_node_attach(sc, sta, vif); 1337 ath_node_attach(sc, sta, vif);
1337 1338
@@ -1339,7 +1340,9 @@ static int ath9k_sta_add(struct ieee80211_hw *hw,
1339 vif->type != NL80211_IFTYPE_AP_VLAN) 1340 vif->type != NL80211_IFTYPE_AP_VLAN)
1340 return 0; 1341 return 0;
1341 1342
1342 an->ps_key = ath_key_config(common, vif, sta, &ps_key); 1343 key = ath_key_config(common, vif, sta, &ps_key);
1344 if (key > 0)
1345 an->ps_key = key;
1343 1346
1344 return 0; 1347 return 0;
1345} 1348}
@@ -1356,6 +1359,7 @@ static void ath9k_del_ps_key(struct ath_softc *sc,
1356 return; 1359 return;
1357 1360
1358 ath_key_delete(common, &ps_key); 1361 ath_key_delete(common, &ps_key);
1362 an->ps_key = 0;
1359} 1363}
1360 1364
1361static int ath9k_sta_remove(struct ieee80211_hw *hw, 1365static int ath9k_sta_remove(struct ieee80211_hw *hw,
@@ -1683,6 +1687,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
1683 u16 tid, u16 *ssn, u8 buf_size) 1687 u16 tid, u16 *ssn, u8 buf_size)
1684{ 1688{
1685 struct ath_softc *sc = hw->priv; 1689 struct ath_softc *sc = hw->priv;
1690 bool flush = false;
1686 int ret = 0; 1691 int ret = 0;
1687 1692
1688 local_bh_disable(); 1693 local_bh_disable();
@@ -1699,12 +1704,13 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
1699 ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1704 ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
1700 ath9k_ps_restore(sc); 1705 ath9k_ps_restore(sc);
1701 break; 1706 break;
1702 case IEEE80211_AMPDU_TX_STOP_CONT:
1703 case IEEE80211_AMPDU_TX_STOP_FLUSH: 1707 case IEEE80211_AMPDU_TX_STOP_FLUSH:
1704 case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: 1708 case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
1709 flush = true;
1710 case IEEE80211_AMPDU_TX_STOP_CONT:
1705 ath9k_ps_wakeup(sc); 1711 ath9k_ps_wakeup(sc);
1706 ath_tx_aggr_stop(sc, sta, tid); 1712 if (ath_tx_aggr_stop(sc, sta, tid, flush))
1707 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1713 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
1708 ath9k_ps_restore(sc); 1714 ath9k_ps_restore(sc);
1709 break; 1715 break;
1710 case IEEE80211_AMPDU_TX_OPERATIONAL: 1716 case IEEE80211_AMPDU_TX_OPERATIONAL:
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index eab0fcb7ded6..14bb3354ea64 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -164,7 +164,20 @@ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
164 ARRAY_SIZE(bf->rates)); 164 ARRAY_SIZE(bf->rates));
165} 165}
166 166
167static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) 167static void ath_tx_clear_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
168{
169 tid->state &= ~AGGR_ADDBA_COMPLETE;
170 tid->state &= ~AGGR_CLEANUP;
171 if (!tid->stop_cb)
172 return;
173
174 ieee80211_start_tx_ba_cb_irqsafe(tid->an->vif, tid->an->sta->addr,
175 tid->tidno);
176 tid->stop_cb = false;
177}
178
179static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid,
180 bool flush_packets)
168{ 181{
169 struct ath_txq *txq = tid->ac->txq; 182 struct ath_txq *txq = tid->ac->txq;
170 struct sk_buff *skb; 183 struct sk_buff *skb;
@@ -181,16 +194,15 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
181 while ((skb = __skb_dequeue(&tid->buf_q))) { 194 while ((skb = __skb_dequeue(&tid->buf_q))) {
182 fi = get_frame_info(skb); 195 fi = get_frame_info(skb);
183 bf = fi->bf; 196 bf = fi->bf;
197 if (!bf && !flush_packets)
198 bf = ath_tx_setup_buffer(sc, txq, tid, skb);
184 199
185 if (!bf) { 200 if (!bf) {
186 bf = ath_tx_setup_buffer(sc, txq, tid, skb); 201 ieee80211_free_txskb(sc->hw, skb);
187 if (!bf) { 202 continue;
188 ieee80211_free_txskb(sc->hw, skb);
189 continue;
190 }
191 } 203 }
192 204
193 if (fi->retries) { 205 if (fi->retries || flush_packets) {
194 list_add_tail(&bf->list, &bf_head); 206 list_add_tail(&bf->list, &bf_head);
195 ath_tx_update_baw(sc, tid, bf->bf_state.seqno); 207 ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
196 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); 208 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
@@ -201,12 +213,10 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
201 } 213 }
202 } 214 }
203 215
204 if (tid->baw_head == tid->baw_tail) { 216 if (tid->baw_head == tid->baw_tail)
205 tid->state &= ~AGGR_ADDBA_COMPLETE; 217 ath_tx_clear_tid(sc, tid);
206 tid->state &= ~AGGR_CLEANUP;
207 }
208 218
209 if (sendbar) { 219 if (sendbar && !flush_packets) {
210 ath_txq_unlock(sc, txq); 220 ath_txq_unlock(sc, txq);
211 ath_send_bar(tid, tid->seq_start); 221 ath_send_bar(tid, tid->seq_start);
212 ath_txq_lock(sc, txq); 222 ath_txq_lock(sc, txq);
@@ -277,9 +287,7 @@ static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
277 287
278 list_add_tail(&bf->list, &bf_head); 288 list_add_tail(&bf->list, &bf_head);
279 289
280 if (fi->retries) 290 ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
281 ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
282
283 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); 291 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
284 } 292 }
285 293
@@ -602,7 +610,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
602 } 610 }
603 611
604 if (tid->state & AGGR_CLEANUP) 612 if (tid->state & AGGR_CLEANUP)
605 ath_tx_flush_tid(sc, tid); 613 ath_tx_flush_tid(sc, tid, false);
606 614
607 rcu_read_unlock(); 615 rcu_read_unlock();
608 616
@@ -620,6 +628,7 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
620 struct ath_tx_status *ts, struct ath_buf *bf, 628 struct ath_tx_status *ts, struct ath_buf *bf,
621 struct list_head *bf_head) 629 struct list_head *bf_head)
622{ 630{
631 struct ieee80211_tx_info *info;
623 bool txok, flush; 632 bool txok, flush;
624 633
625 txok = !(ts->ts_status & ATH9K_TXERR_MASK); 634 txok = !(ts->ts_status & ATH9K_TXERR_MASK);
@@ -631,8 +640,12 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
631 txq->axq_ampdu_depth--; 640 txq->axq_ampdu_depth--;
632 641
633 if (!bf_isampdu(bf)) { 642 if (!bf_isampdu(bf)) {
634 if (!flush) 643 if (!flush) {
644 info = IEEE80211_SKB_CB(bf->bf_mpdu);
645 memcpy(info->control.rates, bf->rates,
646 sizeof(info->control.rates));
635 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); 647 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok);
648 }
636 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); 649 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok);
637 } else 650 } else
638 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok); 651 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok);
@@ -676,7 +689,7 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
676 689
677 skb = bf->bf_mpdu; 690 skb = bf->bf_mpdu;
678 tx_info = IEEE80211_SKB_CB(skb); 691 tx_info = IEEE80211_SKB_CB(skb);
679 rates = tx_info->control.rates; 692 rates = bf->rates;
680 693
681 /* 694 /*
682 * Find the lowest frame length among the rate series that will have a 695 * Find the lowest frame length among the rate series that will have a
@@ -1256,18 +1269,23 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
1256 return 0; 1269 return 0;
1257} 1270}
1258 1271
1259void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) 1272bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid,
1273 bool flush)
1260{ 1274{
1261 struct ath_node *an = (struct ath_node *)sta->drv_priv; 1275 struct ath_node *an = (struct ath_node *)sta->drv_priv;
1262 struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); 1276 struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid);
1263 struct ath_txq *txq = txtid->ac->txq; 1277 struct ath_txq *txq = txtid->ac->txq;
1278 bool ret = !flush;
1279
1280 if (flush)
1281 txtid->stop_cb = false;
1264 1282
1265 if (txtid->state & AGGR_CLEANUP) 1283 if (txtid->state & AGGR_CLEANUP)
1266 return; 1284 return false;
1267 1285
1268 if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { 1286 if (!(txtid->state & AGGR_ADDBA_COMPLETE)) {
1269 txtid->state &= ~AGGR_ADDBA_PROGRESS; 1287 txtid->state &= ~AGGR_ADDBA_PROGRESS;
1270 return; 1288 return ret;
1271 } 1289 }
1272 1290
1273 ath_txq_lock(sc, txq); 1291 ath_txq_lock(sc, txq);
@@ -1279,13 +1297,17 @@ void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid)
1279 * TID can only be reused after all in-progress subframes have been 1297 * TID can only be reused after all in-progress subframes have been
1280 * completed. 1298 * completed.
1281 */ 1299 */
1282 if (txtid->baw_head != txtid->baw_tail) 1300 if (txtid->baw_head != txtid->baw_tail) {
1283 txtid->state |= AGGR_CLEANUP; 1301 txtid->state |= AGGR_CLEANUP;
1284 else 1302 ret = false;
1303 txtid->stop_cb = !flush;
1304 } else {
1285 txtid->state &= ~AGGR_ADDBA_COMPLETE; 1305 txtid->state &= ~AGGR_ADDBA_COMPLETE;
1306 }
1286 1307
1287 ath_tx_flush_tid(sc, txtid); 1308 ath_tx_flush_tid(sc, txtid, flush);
1288 ath_txq_unlock_complete(sc, txq); 1309 ath_txq_unlock_complete(sc, txq);
1310 return ret;
1289} 1311}
1290 1312
1291void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, 1313void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
@@ -2415,6 +2437,7 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
2415 tid->ac = &an->ac[acno]; 2437 tid->ac = &an->ac[acno];
2416 tid->state &= ~AGGR_ADDBA_COMPLETE; 2438 tid->state &= ~AGGR_ADDBA_COMPLETE;
2417 tid->state &= ~AGGR_ADDBA_PROGRESS; 2439 tid->state &= ~AGGR_ADDBA_PROGRESS;
2440 tid->stop_cb = false;
2418 } 2441 }
2419 2442
2420 for (acno = 0, ac = &an->ac[acno]; 2443 for (acno = 0, ac = &an->ac[acno];
@@ -2451,8 +2474,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
2451 } 2474 }
2452 2475
2453 ath_tid_drain(sc, txq, tid); 2476 ath_tid_drain(sc, txq, tid);
2454 tid->state &= ~AGGR_ADDBA_COMPLETE; 2477 ath_tx_clear_tid(sc, tid);
2455 tid->state &= ~AGGR_CLEANUP;
2456 2478
2457 ath_txq_unlock(sc, txq); 2479 ath_txq_unlock(sc, txq);
2458 } 2480 }
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 523355b87659..f7c70b3a6ea9 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1728,6 +1728,25 @@ drop_recycle_buffer:
1728 sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); 1728 sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize);
1729} 1729}
1730 1730
1731void b43_dma_handle_rx_overflow(struct b43_dmaring *ring)
1732{
1733 int current_slot, previous_slot;
1734
1735 B43_WARN_ON(ring->tx);
1736
1737 /* Device has filled all buffers, drop all packets and let TCP
1738 * decrease speed.
1739 * Decrement RX index by one will let the device to see all slots
1740 * as free again
1741 */
1742 /*
1743 *TODO: How to increase rx_drop in mac80211?
1744 */
1745 current_slot = ring->ops->get_current_rxslot(ring);
1746 previous_slot = prev_slot(ring, current_slot);
1747 ring->ops->set_current_rxslot(ring, previous_slot);
1748}
1749
1731void b43_dma_rx(struct b43_dmaring *ring) 1750void b43_dma_rx(struct b43_dmaring *ring)
1732{ 1751{
1733 const struct b43_dma_ops *ops = ring->ops; 1752 const struct b43_dma_ops *ops = ring->ops;
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h
index 9fdd1983079c..df8c8cdcbdb5 100644
--- a/drivers/net/wireless/b43/dma.h
+++ b/drivers/net/wireless/b43/dma.h
@@ -9,7 +9,7 @@
9/* DMA-Interrupt reasons. */ 9/* DMA-Interrupt reasons. */
10#define B43_DMAIRQ_FATALMASK ((1 << 10) | (1 << 11) | (1 << 12) \ 10#define B43_DMAIRQ_FATALMASK ((1 << 10) | (1 << 11) | (1 << 12) \
11 | (1 << 14) | (1 << 15)) 11 | (1 << 14) | (1 << 15))
12#define B43_DMAIRQ_NONFATALMASK (1 << 13) 12#define B43_DMAIRQ_RDESC_UFLOW (1 << 13)
13#define B43_DMAIRQ_RX_DONE (1 << 16) 13#define B43_DMAIRQ_RX_DONE (1 << 16)
14 14
15/*** 32-bit DMA Engine. ***/ 15/*** 32-bit DMA Engine. ***/
@@ -295,6 +295,8 @@ int b43_dma_tx(struct b43_wldev *dev,
295void b43_dma_handle_txstatus(struct b43_wldev *dev, 295void b43_dma_handle_txstatus(struct b43_wldev *dev,
296 const struct b43_txstatus *status); 296 const struct b43_txstatus *status);
297 297
298void b43_dma_handle_rx_overflow(struct b43_dmaring *ring);
299
298void b43_dma_rx(struct b43_dmaring *ring); 300void b43_dma_rx(struct b43_dmaring *ring);
299 301
300void b43_dma_direct_fifo_rx(struct b43_wldev *dev, 302void b43_dma_direct_fifo_rx(struct b43_wldev *dev,
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index d377f77d30b5..6dd07e2ec595 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1902,30 +1902,18 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
1902 } 1902 }
1903 } 1903 }
1904 1904
1905 if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK | 1905 if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK))) {
1906 B43_DMAIRQ_NONFATALMASK))) { 1906 b43err(dev->wl,
1907 if (merged_dma_reason & B43_DMAIRQ_FATALMASK) { 1907 "Fatal DMA error: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X\n",
1908 b43err(dev->wl, "Fatal DMA error: " 1908 dma_reason[0], dma_reason[1],
1909 "0x%08X, 0x%08X, 0x%08X, " 1909 dma_reason[2], dma_reason[3],
1910 "0x%08X, 0x%08X, 0x%08X\n", 1910 dma_reason[4], dma_reason[5]);
1911 dma_reason[0], dma_reason[1], 1911 b43err(dev->wl, "This device does not support DMA "
1912 dma_reason[2], dma_reason[3],
1913 dma_reason[4], dma_reason[5]);
1914 b43err(dev->wl, "This device does not support DMA "
1915 "on your system. It will now be switched to PIO.\n"); 1912 "on your system. It will now be switched to PIO.\n");
1916 /* Fall back to PIO transfers if we get fatal DMA errors! */ 1913 /* Fall back to PIO transfers if we get fatal DMA errors! */
1917 dev->use_pio = true; 1914 dev->use_pio = true;
1918 b43_controller_restart(dev, "DMA error"); 1915 b43_controller_restart(dev, "DMA error");
1919 return; 1916 return;
1920 }
1921 if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) {
1922 b43err(dev->wl, "DMA error: "
1923 "0x%08X, 0x%08X, 0x%08X, "
1924 "0x%08X, 0x%08X, 0x%08X\n",
1925 dma_reason[0], dma_reason[1],
1926 dma_reason[2], dma_reason[3],
1927 dma_reason[4], dma_reason[5]);
1928 }
1929 } 1917 }
1930 1918
1931 if (unlikely(reason & B43_IRQ_UCODE_DEBUG)) 1919 if (unlikely(reason & B43_IRQ_UCODE_DEBUG))
@@ -1944,6 +1932,11 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
1944 handle_irq_noise(dev); 1932 handle_irq_noise(dev);
1945 1933
1946 /* Check the DMA reason registers for received data. */ 1934 /* Check the DMA reason registers for received data. */
1935 if (dma_reason[0] & B43_DMAIRQ_RDESC_UFLOW) {
1936 if (B43_DEBUG)
1937 b43warn(dev->wl, "RX descriptor underrun\n");
1938 b43_dma_handle_rx_overflow(dev->dma.rx_ring);
1939 }
1947 if (dma_reason[0] & B43_DMAIRQ_RX_DONE) { 1940 if (dma_reason[0] & B43_DMAIRQ_RX_DONE) {
1948 if (b43_using_pio_transfers(dev)) 1941 if (b43_using_pio_transfers(dev))
1949 b43_pio_rx(dev->pio.rx_queue); 1942 b43_pio_rx(dev->pio.rx_queue);
@@ -2001,7 +1994,7 @@ static irqreturn_t b43_do_interrupt(struct b43_wldev *dev)
2001 return IRQ_NONE; 1994 return IRQ_NONE;
2002 1995
2003 dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) 1996 dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON)
2004 & 0x0001DC00; 1997 & 0x0001FC00;
2005 dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) 1998 dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON)
2006 & 0x0000DC00; 1999 & 0x0000DC00;
2007 dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) 2000 dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON)
@@ -3130,7 +3123,7 @@ static int b43_chip_init(struct b43_wldev *dev)
3130 b43_write32(dev, 0x018C, 0x02000000); 3123 b43_write32(dev, 0x018C, 0x02000000);
3131 } 3124 }
3132 b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000); 3125 b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000);
3133 b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001DC00); 3126 b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001FC00);
3134 b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00); 3127 b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00);
3135 b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00); 3128 b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00);
3136 b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00); 3129 b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 6d758f285352..761f501959a9 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -4140,6 +4140,10 @@ static const struct ieee80211_iface_limit brcmf_iface_limits[] = {
4140 .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 4140 .types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
4141 BIT(NL80211_IFTYPE_P2P_GO) 4141 BIT(NL80211_IFTYPE_P2P_GO)
4142 }, 4142 },
4143 {
4144 .max = 1,
4145 .types = BIT(NL80211_IFTYPE_P2P_DEVICE)
4146 }
4143}; 4147};
4144static const struct ieee80211_iface_combination brcmf_iface_combos[] = { 4148static const struct ieee80211_iface_combination brcmf_iface_combos[] = {
4145 { 4149 {
@@ -4197,7 +4201,8 @@ static struct wiphy *brcmf_setup_wiphy(struct device *phydev)
4197 BIT(NL80211_IFTYPE_ADHOC) | 4201 BIT(NL80211_IFTYPE_ADHOC) |
4198 BIT(NL80211_IFTYPE_AP) | 4202 BIT(NL80211_IFTYPE_AP) |
4199 BIT(NL80211_IFTYPE_P2P_CLIENT) | 4203 BIT(NL80211_IFTYPE_P2P_CLIENT) |
4200 BIT(NL80211_IFTYPE_P2P_GO); 4204 BIT(NL80211_IFTYPE_P2P_GO) |
4205 BIT(NL80211_IFTYPE_P2P_DEVICE);
4201 wiphy->iface_combinations = brcmf_iface_combos; 4206 wiphy->iface_combinations = brcmf_iface_combos;
4202 wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); 4207 wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos);
4203 wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; 4208 wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index b8f82e688c72..9a95045c97b6 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5741,8 +5741,7 @@ il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length)
5741 hw->flags = 5741 hw->flags =
5742 IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_AMPDU_AGGREGATION | 5742 IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_AMPDU_AGGREGATION |
5743 IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC | IEEE80211_HW_SPECTRUM_MGMT | 5743 IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC | IEEE80211_HW_SPECTRUM_MGMT |
5744 IEEE80211_HW_REPORTS_TX_ACK_STATUS | IEEE80211_HW_SUPPORTS_PS | 5744 IEEE80211_HW_SUPPORTS_PS | IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
5745 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
5746 if (il->cfg->sku & IL_SKU_N) 5745 if (il->cfg->sku & IL_SKU_N)
5747 hw->flags |= 5746 hw->flags |=
5748 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | 5747 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 592d0aa634a8..e9a3cbc409ae 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -1423,7 +1423,7 @@ il_setup_rx_scan_handlers(struct il_priv *il)
1423} 1423}
1424EXPORT_SYMBOL(il_setup_rx_scan_handlers); 1424EXPORT_SYMBOL(il_setup_rx_scan_handlers);
1425 1425
1426inline u16 1426u16
1427il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band, 1427il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band,
1428 u8 n_probes) 1428 u8 n_probes)
1429{ 1429{
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
index 191dcae8ba47..c6384555aab4 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
@@ -173,6 +173,8 @@ enum {
173 REPLY_DEBUG_CMD = 0xf0, 173 REPLY_DEBUG_CMD = 0xf0,
174 DEBUG_LOG_MSG = 0xf7, 174 DEBUG_LOG_MSG = 0xf7,
175 175
176 MCAST_FILTER_CMD = 0xd0,
177
176 /* D3 commands/notifications */ 178 /* D3 commands/notifications */
177 D3_CONFIG_CMD = 0xd3, 179 D3_CONFIG_CMD = 0xd3,
178 PROT_OFFLOAD_CONFIG_CMD = 0xd4, 180 PROT_OFFLOAD_CONFIG_CMD = 0xd4,
@@ -948,4 +950,29 @@ struct iwl_set_calib_default_cmd {
948 u8 data[0]; 950 u8 data[0];
949} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */ 951} __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
950 952
953#define MAX_PORT_ID_NUM 2
954
955/**
956 * struct iwl_mcast_filter_cmd - configure multicast filter.
957 * @filter_own: Set 1 to filter out multicast packets sent by station itself
958 * @port_id: Multicast MAC addresses array specifier. This is a strange way
959 * to identify network interface adopted in host-device IF.
960 * It is used by FW as index in array of addresses. This array has
961 * MAX_PORT_ID_NUM members.
962 * @count: Number of MAC addresses in the array
963 * @pass_all: Set 1 to pass all multicast packets.
964 * @bssid: current association BSSID.
965 * @addr_list: Place holder for array of MAC addresses.
966 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
967 */
968struct iwl_mcast_filter_cmd {
969 u8 filter_own;
970 u8 port_id;
971 u8 count;
972 u8 pass_all;
973 u8 bssid[6];
974 u8 reserved[2];
975 u8 addr_list[0];
976} __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
977
951#endif /* __fw_api_h__ */ 978#endif /* __fw_api_h__ */
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
index e6eca4d66f6c..b2cc3d98e0f7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
@@ -586,10 +586,12 @@ static int iwl_mvm_mac_ctxt_send_cmd(struct iwl_mvm *mvm,
586 */ 586 */
587static void iwl_mvm_mac_ctxt_cmd_fill_sta(struct iwl_mvm *mvm, 587static void iwl_mvm_mac_ctxt_cmd_fill_sta(struct iwl_mvm *mvm,
588 struct ieee80211_vif *vif, 588 struct ieee80211_vif *vif,
589 struct iwl_mac_data_sta *ctxt_sta) 589 struct iwl_mac_data_sta *ctxt_sta,
590 bool force_assoc_off)
590{ 591{
591 /* We need the dtim_period to set the MAC as associated */ 592 /* We need the dtim_period to set the MAC as associated */
592 if (vif->bss_conf.assoc && vif->bss_conf.dtim_period) { 593 if (vif->bss_conf.assoc && vif->bss_conf.dtim_period &&
594 !force_assoc_off) {
593 u32 dtim_offs; 595 u32 dtim_offs;
594 596
595 /* 597 /*
@@ -659,7 +661,8 @@ static int iwl_mvm_mac_ctxt_cmd_station(struct iwl_mvm *mvm,
659 cmd.filter_flags &= ~cpu_to_le32(MAC_FILTER_IN_BEACON); 661 cmd.filter_flags &= ~cpu_to_le32(MAC_FILTER_IN_BEACON);
660 662
661 /* Fill the data specific for station mode */ 663 /* Fill the data specific for station mode */
662 iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.sta); 664 iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.sta,
665 action == FW_CTXT_ACTION_ADD);
663 666
664 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); 667 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd);
665} 668}
@@ -677,7 +680,8 @@ static int iwl_mvm_mac_ctxt_cmd_p2p_client(struct iwl_mvm *mvm,
677 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action); 680 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, action);
678 681
679 /* Fill the data specific for station mode */ 682 /* Fill the data specific for station mode */
680 iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.p2p_sta.sta); 683 iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.p2p_sta.sta,
684 action == FW_CTXT_ACTION_ADD);
681 685
682 cmd.p2p_sta.ctwin = cpu_to_le32(noa->oppps_ctwindow & 686 cmd.p2p_sta.ctwin = cpu_to_le32(noa->oppps_ctwindow &
683 IEEE80211_P2P_OPPPS_CTWINDOW_MASK); 687 IEEE80211_P2P_OPPPS_CTWINDOW_MASK);
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index dd158ec571fb..a5eb8c82f16a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -701,6 +701,20 @@ static void iwl_mvm_configure_filter(struct ieee80211_hw *hw,
701 *total_flags = 0; 701 *total_flags = 0;
702} 702}
703 703
704static int iwl_mvm_configure_mcast_filter(struct iwl_mvm *mvm,
705 struct ieee80211_vif *vif)
706{
707 struct iwl_mcast_filter_cmd mcast_filter_cmd = {
708 .pass_all = 1,
709 };
710
711 memcpy(mcast_filter_cmd.bssid, vif->bss_conf.bssid, ETH_ALEN);
712
713 return iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_SYNC,
714 sizeof(mcast_filter_cmd),
715 &mcast_filter_cmd);
716}
717
704static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, 718static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
705 struct ieee80211_vif *vif, 719 struct ieee80211_vif *vif,
706 struct ieee80211_bss_conf *bss_conf, 720 struct ieee80211_bss_conf *bss_conf,
@@ -722,6 +736,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
722 return; 736 return;
723 } 737 }
724 iwl_mvm_bt_coex_vif_assoc(mvm, vif); 738 iwl_mvm_bt_coex_vif_assoc(mvm, vif);
739 iwl_mvm_configure_mcast_filter(mvm, vif);
725 } else if (mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { 740 } else if (mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) {
726 /* remove AP station now that the MAC is unassoc */ 741 /* remove AP station now that the MAC is unassoc */
727 ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id); 742 ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id);
@@ -931,7 +946,7 @@ static void iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw,
931 946
932 switch (cmd) { 947 switch (cmd) {
933 case STA_NOTIFY_SLEEP: 948 case STA_NOTIFY_SLEEP:
934 if (atomic_read(&mvmsta->pending_frames) > 0) 949 if (atomic_read(&mvm->pending_frames[mvmsta->sta_id]) > 0)
935 ieee80211_sta_block_awake(hw, sta, true); 950 ieee80211_sta_block_awake(hw, sta, true);
936 /* 951 /*
937 * The fw updates the STA to be asleep. Tx packets on the Tx 952 * The fw updates the STA to be asleep. Tx packets on the Tx
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 8269bc562951..9f46b23801bc 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -292,6 +292,7 @@ struct iwl_mvm {
292 struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT]; 292 struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT];
293 struct work_struct sta_drained_wk; 293 struct work_struct sta_drained_wk;
294 unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; 294 unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)];
295 atomic_t pending_frames[IWL_MVM_STATION_COUNT];
295 296
296 /* configured by mac80211 */ 297 /* configured by mac80211 */
297 u32 rts_threshold; 298 u32 rts_threshold;
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index fe031d304d1e..b29c31a41594 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -292,6 +292,7 @@ static const char *iwl_mvm_cmd_strings[REPLY_MAX] = {
292 CMD(BT_COEX_PROT_ENV), 292 CMD(BT_COEX_PROT_ENV),
293 CMD(BT_PROFILE_NOTIFICATION), 293 CMD(BT_PROFILE_NOTIFICATION),
294 CMD(BT_CONFIG), 294 CMD(BT_CONFIG),
295 CMD(MCAST_FILTER_CMD),
295}; 296};
296#undef CMD 297#undef CMD
297 298
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 2157b0f8ced5..2476e43799d5 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -298,6 +298,12 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm,
298 else 298 else
299 cmd->type = cpu_to_le32(SCAN_TYPE_FORCED); 299 cmd->type = cpu_to_le32(SCAN_TYPE_FORCED);
300 300
301 /*
302 * TODO: This is a WA due to a bug in the FW AUX framework that does not
303 * properly handle time events that fail to be scheduled
304 */
305 cmd->type = cpu_to_le32(SCAN_TYPE_FORCED);
306
301 cmd->repeats = cpu_to_le32(1); 307 cmd->repeats = cpu_to_le32(1);
302 308
303 /* 309 /*
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 0fd96e4da461..5c664ed54400 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -219,7 +219,7 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm,
219 mvm_sta->max_agg_bufsize = LINK_QUAL_AGG_FRAME_LIMIT_DEF; 219 mvm_sta->max_agg_bufsize = LINK_QUAL_AGG_FRAME_LIMIT_DEF;
220 220
221 /* HW restart, don't assume the memory has been zeroed */ 221 /* HW restart, don't assume the memory has been zeroed */
222 atomic_set(&mvm_sta->pending_frames, 0); 222 atomic_set(&mvm->pending_frames[sta_id], 0);
223 mvm_sta->tid_disable_agg = 0; 223 mvm_sta->tid_disable_agg = 0;
224 mvm_sta->tfd_queue_msk = 0; 224 mvm_sta->tfd_queue_msk = 0;
225 for (i = 0; i < IEEE80211_NUM_ACS; i++) 225 for (i = 0; i < IEEE80211_NUM_ACS; i++)
@@ -407,14 +407,21 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm,
407 } 407 }
408 408
409 /* 409 /*
410 * Make sure that the tx response code sees the station as -EBUSY and
411 * calls the drain worker.
412 */
413 spin_lock_bh(&mvm_sta->lock);
414 /*
410 * There are frames pending on the AC queues for this station. 415 * There are frames pending on the AC queues for this station.
411 * We need to wait until all the frames are drained... 416 * We need to wait until all the frames are drained...
412 */ 417 */
413 if (atomic_read(&mvm_sta->pending_frames)) { 418 if (atomic_read(&mvm->pending_frames[mvm_sta->sta_id])) {
414 ret = iwl_mvm_drain_sta(mvm, mvm_sta, true);
415 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], 419 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id],
416 ERR_PTR(-EBUSY)); 420 ERR_PTR(-EBUSY));
421 spin_unlock_bh(&mvm_sta->lock);
422 ret = iwl_mvm_drain_sta(mvm, mvm_sta, true);
417 } else { 423 } else {
424 spin_unlock_bh(&mvm_sta->lock);
418 ret = iwl_mvm_rm_sta_common(mvm, mvm_sta->sta_id); 425 ret = iwl_mvm_rm_sta_common(mvm, mvm_sta->sta_id);
419 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], NULL); 426 rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], NULL);
420 } 427 }
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.h b/drivers/net/wireless/iwlwifi/mvm/sta.h
index 12abd2d71835..a4ddce77aaae 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.h
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.h
@@ -274,7 +274,6 @@ struct iwl_mvm_tid_data {
274 * @bt_reduced_txpower: is reduced tx power enabled for this station 274 * @bt_reduced_txpower: is reduced tx power enabled for this station
275 * @lock: lock to protect the whole struct. Since %tid_data is access from Tx 275 * @lock: lock to protect the whole struct. Since %tid_data is access from Tx
276 * and from Tx response flow, it needs a spinlock. 276 * and from Tx response flow, it needs a spinlock.
277 * @pending_frames: number of frames for this STA on the shared Tx queues.
278 * @tid_data: per tid data. Look at %iwl_mvm_tid_data. 277 * @tid_data: per tid data. Look at %iwl_mvm_tid_data.
279 * 278 *
280 * When mac80211 creates a station it reserves some space (hw->sta_data_size) 279 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
@@ -290,7 +289,6 @@ struct iwl_mvm_sta {
290 u8 max_agg_bufsize; 289 u8 max_agg_bufsize;
291 bool bt_reduced_txpower; 290 bool bt_reduced_txpower;
292 spinlock_t lock; 291 spinlock_t lock;
293 atomic_t pending_frames;
294 struct iwl_mvm_tid_data tid_data[IWL_MAX_TID_COUNT]; 292 struct iwl_mvm_tid_data tid_data[IWL_MAX_TID_COUNT];
295 struct iwl_lq_sta lq_sta; 293 struct iwl_lq_sta lq_sta;
296 struct ieee80211_vif *vif; 294 struct ieee80211_vif *vif;
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index 479074303bd7..f212f16502ff 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -416,9 +416,8 @@ int iwl_mvm_tx_skb(struct iwl_mvm *mvm, struct sk_buff *skb,
416 416
417 spin_unlock(&mvmsta->lock); 417 spin_unlock(&mvmsta->lock);
418 418
419 if (mvmsta->vif->type == NL80211_IFTYPE_AP && 419 if (txq_id < IWL_MVM_FIRST_AGG_QUEUE)
420 txq_id < IWL_MVM_FIRST_AGG_QUEUE) 420 atomic_inc(&mvm->pending_frames[mvmsta->sta_id]);
421 atomic_inc(&mvmsta->pending_frames);
422 421
423 return 0; 422 return 0;
424 423
@@ -680,16 +679,41 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
680 /* 679 /*
681 * If the txq is not an AMPDU queue, there is no chance we freed 680 * If the txq is not an AMPDU queue, there is no chance we freed
682 * several skbs. Check that out... 681 * several skbs. Check that out...
683 * If there are no pending frames for this STA, notify mac80211 that
684 * this station can go to sleep in its STA table.
685 */ 682 */
686 if (txq_id < IWL_MVM_FIRST_AGG_QUEUE && mvmsta && 683 if (txq_id < IWL_MVM_FIRST_AGG_QUEUE && !WARN_ON(skb_freed > 1) &&
687 !WARN_ON(skb_freed > 1) && 684 atomic_sub_and_test(skb_freed, &mvm->pending_frames[sta_id])) {
688 mvmsta->vif->type == NL80211_IFTYPE_AP && 685 if (mvmsta) {
689 atomic_sub_and_test(skb_freed, &mvmsta->pending_frames)) { 686 /*
690 ieee80211_sta_block_awake(mvm->hw, sta, false); 687 * If there are no pending frames for this STA, notify
691 set_bit(sta_id, mvm->sta_drained); 688 * mac80211 that this station can go to sleep in its
692 schedule_work(&mvm->sta_drained_wk); 689 * STA table.
690 */
691 if (mvmsta->vif->type == NL80211_IFTYPE_AP)
692 ieee80211_sta_block_awake(mvm->hw, sta, false);
693 /*
694 * We might very well have taken mvmsta pointer while
695 * the station was being removed. The remove flow might
696 * have seen a pending_frame (because we didn't take
697 * the lock) even if now the queues are drained. So make
698 * really sure now that this the station is not being
699 * removed. If it is, run the drain worker to remove it.
700 */
701 spin_lock_bh(&mvmsta->lock);
702 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
703 if (IS_ERR_OR_NULL(sta)) {
704 /*
705 * Station disappeared in the meantime:
706 * so we are draining.
707 */
708 set_bit(sta_id, mvm->sta_drained);
709 schedule_work(&mvm->sta_drained_wk);
710 }
711 spin_unlock_bh(&mvmsta->lock);
712 } else if (!mvmsta) {
713 /* Tx response without STA, so we are draining */
714 set_bit(sta_id, mvm->sta_drained);
715 schedule_work(&mvm->sta_drained_wk);
716 }
693 } 717 }
694 718
695 rcu_read_unlock(); 719 rcu_read_unlock();
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index b878a32e7a98..cb34c7895f2a 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1723,11 +1723,11 @@ static void mac80211_hwsim_free(void)
1723 class_destroy(hwsim_class); 1723 class_destroy(hwsim_class);
1724} 1724}
1725 1725
1726 1726static struct platform_driver mac80211_hwsim_driver = {
1727static struct device_driver mac80211_hwsim_driver = { 1727 .driver = {
1728 .name = "mac80211_hwsim", 1728 .name = "mac80211_hwsim",
1729 .bus = &platform_bus_type, 1729 .owner = THIS_MODULE,
1730 .owner = THIS_MODULE, 1730 },
1731}; 1731};
1732 1732
1733static const struct net_device_ops hwsim_netdev_ops = { 1733static const struct net_device_ops hwsim_netdev_ops = {
@@ -2219,7 +2219,7 @@ static int __init init_mac80211_hwsim(void)
2219 spin_lock_init(&hwsim_radio_lock); 2219 spin_lock_init(&hwsim_radio_lock);
2220 INIT_LIST_HEAD(&hwsim_radios); 2220 INIT_LIST_HEAD(&hwsim_radios);
2221 2221
2222 err = driver_register(&mac80211_hwsim_driver); 2222 err = platform_driver_register(&mac80211_hwsim_driver);
2223 if (err) 2223 if (err)
2224 return err; 2224 return err;
2225 2225
@@ -2254,7 +2254,7 @@ static int __init init_mac80211_hwsim(void)
2254 err = -ENOMEM; 2254 err = -ENOMEM;
2255 goto failed_drvdata; 2255 goto failed_drvdata;
2256 } 2256 }
2257 data->dev->driver = &mac80211_hwsim_driver; 2257 data->dev->driver = &mac80211_hwsim_driver.driver;
2258 err = device_bind_driver(data->dev); 2258 err = device_bind_driver(data->dev);
2259 if (err != 0) { 2259 if (err != 0) {
2260 printk(KERN_DEBUG 2260 printk(KERN_DEBUG
@@ -2564,7 +2564,7 @@ failed_drvdata:
2564failed: 2564failed:
2565 mac80211_hwsim_free(); 2565 mac80211_hwsim_free();
2566failed_unregister_driver: 2566failed_unregister_driver:
2567 driver_unregister(&mac80211_hwsim_driver); 2567 platform_driver_unregister(&mac80211_hwsim_driver);
2568 return err; 2568 return err;
2569} 2569}
2570module_init(init_mac80211_hwsim); 2570module_init(init_mac80211_hwsim);
@@ -2577,6 +2577,6 @@ static void __exit exit_mac80211_hwsim(void)
2577 2577
2578 mac80211_hwsim_free(); 2578 mac80211_hwsim_free();
2579 unregister_netdev(hwsim_mon); 2579 unregister_netdev(hwsim_mon);
2580 driver_unregister(&mac80211_hwsim_driver); 2580 platform_driver_unregister(&mac80211_hwsim_driver);
2581} 2581}
2582module_exit(exit_mac80211_hwsim); 2582module_exit(exit_mac80211_hwsim);
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index d3c8ece980d8..e42b266a023a 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2234,9 +2234,6 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
2234 if (wdev->netdev->reg_state == NETREG_REGISTERED) 2234 if (wdev->netdev->reg_state == NETREG_REGISTERED)
2235 unregister_netdevice(wdev->netdev); 2235 unregister_netdevice(wdev->netdev);
2236 2236
2237 if (wdev->netdev->reg_state == NETREG_UNREGISTERED)
2238 free_netdev(wdev->netdev);
2239
2240 /* Clear the priv in adapter */ 2237 /* Clear the priv in adapter */
2241 priv->netdev = NULL; 2238 priv->netdev = NULL;
2242 2239
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 74db0d24a579..26755d9acb55 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -1191,6 +1191,7 @@ mwifiex_process_hs_config(struct mwifiex_adapter *adapter)
1191 adapter->if_ops.wakeup(adapter); 1191 adapter->if_ops.wakeup(adapter);
1192 adapter->hs_activated = false; 1192 adapter->hs_activated = false;
1193 adapter->is_hs_configured = false; 1193 adapter->is_hs_configured = false;
1194 adapter->is_suspended = false;
1194 mwifiex_hs_activated_event(mwifiex_get_priv(adapter, 1195 mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
1195 MWIFIEX_BSS_ROLE_ANY), 1196 MWIFIEX_BSS_ROLE_ANY),
1196 false); 1197 false);
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 121443a0f2a1..2eb88ea9acf7 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -655,6 +655,7 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv,
655 struct net_device *dev) 655 struct net_device *dev)
656{ 656{
657 dev->netdev_ops = &mwifiex_netdev_ops; 657 dev->netdev_ops = &mwifiex_netdev_ops;
658 dev->destructor = free_netdev;
658 /* Initialize private structure */ 659 /* Initialize private structure */
659 priv->current_key_index = 0; 660 priv->current_key_index = 0;
660 priv->media_connected = false; 661 priv->media_connected = false;
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 311d0b26b81c..1a8a19dbd635 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -96,7 +96,7 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
96 } else { 96 } else {
97 /* Multicast */ 97 /* Multicast */
98 priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE; 98 priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE;
99 if (mcast_list->mode == MWIFIEX_MULTICAST_MODE) { 99 if (mcast_list->mode == MWIFIEX_ALL_MULTI_MODE) {
100 dev_dbg(priv->adapter->dev, 100 dev_dbg(priv->adapter->dev,
101 "info: Enabling All Multicast!\n"); 101 "info: Enabling All Multicast!\n");
102 priv->curr_pkt_filter |= 102 priv->curr_pkt_filter |=
@@ -108,20 +108,11 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv,
108 dev_dbg(priv->adapter->dev, 108 dev_dbg(priv->adapter->dev,
109 "info: Set multicast list=%d\n", 109 "info: Set multicast list=%d\n",
110 mcast_list->num_multicast_addr); 110 mcast_list->num_multicast_addr);
111 /* Set multicast addresses to firmware */ 111 /* Send multicast addresses to firmware */
112 if (old_pkt_filter == priv->curr_pkt_filter) { 112 ret = mwifiex_send_cmd_async(priv,
113 /* Send request to firmware */ 113 HostCmd_CMD_MAC_MULTICAST_ADR,
114 ret = mwifiex_send_cmd_async(priv, 114 HostCmd_ACT_GEN_SET, 0,
115 HostCmd_CMD_MAC_MULTICAST_ADR, 115 mcast_list);
116 HostCmd_ACT_GEN_SET, 0,
117 mcast_list);
118 } else {
119 /* Send request to firmware */
120 ret = mwifiex_send_cmd_async(priv,
121 HostCmd_CMD_MAC_MULTICAST_ADR,
122 HostCmd_ACT_GEN_SET, 0,
123 mcast_list);
124 }
125 } 116 }
126 } 117 }
127 } 118 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.h b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.h
index d3a02e73f53a..21ca33a7c770 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.h
@@ -550,7 +550,7 @@ do { \
550 rxmcs == DESC92C_RATE11M) 550 rxmcs == DESC92C_RATE11M)
551 551
552struct phy_rx_agc_info_t { 552struct phy_rx_agc_info_t {
553 #if __LITTLE_ENDIAN 553 #ifdef __LITTLE_ENDIAN
554 u8 gain:7, trsw:1; 554 u8 gain:7, trsw:1;
555 #else 555 #else
556 u8 trsw:1, gain:7; 556 u8 trsw:1, gain:7;
@@ -574,7 +574,7 @@ struct phy_status_rpt {
574 u8 stream_target_csi[2]; 574 u8 stream_target_csi[2];
575 u8 sig_evm; 575 u8 sig_evm;
576 u8 rsvd_3; 576 u8 rsvd_3;
577#if __LITTLE_ENDIAN 577#ifdef __LITTLE_ENDIAN
578 u8 antsel_rx_keep_2:1; /*ex_intf_flg:1;*/ 578 u8 antsel_rx_keep_2:1; /*ex_intf_flg:1;*/
579 u8 sgi_en:1; 579 u8 sgi_en:1;
580 u8 rxsc:2; 580 u8 rxsc:2;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 23d640a4debd..938b1e670b93 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -349,6 +349,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
349 {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/ 349 {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/
350 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ 350 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
351 {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ 351 {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/
352 {RTL_USB_DEVICE(0x0846, 0xf001, rtl92cu_hal_cfg)}, /*On Netwrks N300MA*/
352 {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ 353 {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
353 {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/ 354 {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/
354 {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/ 355 {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/