aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-18 01:26:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-18 01:26:41 -0500
commitccb19d263fd1c9e34948e2158c53eacbff369344 (patch)
tree6683e55f183920dcbf3e1a5b749e7f9780c465b3
parent6a488979f574cb4287880db2dbc8b13cee30c5be (diff)
parentc3b5003b628d8e373262bee42c7260d6a799c73e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (47 commits) tg3: Fix single-vector MSI-X code openvswitch: Fix multipart datapath dumps. ipv6: fix per device IP snmp counters inetpeer: initialize ->redirect_genid in inet_getpeer() net: fix NULL-deref in WARN() in skb_gso_segment() net: WARN if skb_checksum_help() is called on skb requiring segmentation caif: Remove bad WARN_ON in caif_dev caif: Fix typo in Vendor/Product-ID for CAIF modems bnx2x: Disable AN KR work-around for BCM57810 bnx2x: Remove AutoGrEEEn for BCM84833 bnx2x: Remove 100Mb force speed for BCM84833 bnx2x: Fix PFC setting on BCM57840 bnx2x: Fix Super-Isolate mode for BCM84833 net: fix some sparse errors net: kill duplicate included header net: sh-eth: Fix build error by the value which is not defined net: Use device model to get driver name in skb_gso_segment() bridge: BH already disabled in br_fdb_cleanup() net: move sock_update_memcg outside of CONFIG_INET mwl8k: Fixing Sparse ENDIAN CHECK warning ...
-rw-r--r--Documentation/devices.txt3
-rw-r--r--MAINTAINERS15
-rw-r--r--drivers/bcma/bcma_private.h1
-rw-r--r--drivers/bcma/host_pci.c43
-rw-r--r--drivers/bcma/main.c24
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c7
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c298
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h1
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c27
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_ethtool.c2
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c32
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_qmr.c14
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mac.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c5
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c40
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c2
-rw-r--r--drivers/net/wireless/mwl8k.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c28
-rw-r--r--drivers/vhost/net.c8
-rw-r--r--include/linux/bcma/bcma.h2
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/linux/netfilter/xt_CT.h3
-rw-r--r--include/net/flow.h2
-rw-r--r--mm/memcontrol.c2
-rw-r--r--net/bridge/br_fdb.c4
-rw-r--r--net/caif/caif_dev.c16
-rw-r--r--net/caif/caif_usb.c3
-rw-r--r--net/core/dev.c32
-rw-r--r--net/core/net-sysfs.c2
-rw-r--r--net/core/secure_seq.c2
-rw-r--r--net/ipv4/inetpeer.c3
-rw-r--r--net/ipv4/ipconfig.c8
-rw-r--r--net/ipv4/ping.c27
-rw-r--r--net/ipv4/udp_diag.c1
-rw-r--r--net/ipv6/datagram.c2
-rw-r--r--net/ipv6/proc.c4
-rw-r--r--net/ipv6/route.c1
-rw-r--r--net/mac80211/cfg.c2
-rw-r--r--net/mac80211/rx.c1
-rw-r--r--net/mac80211/sta_info.c6
-rw-r--r--net/mac80211/tx.c10
-rw-r--r--net/mac80211/wpa.c19
-rw-r--r--net/mac80211/wpa.h2
-rw-r--r--net/netfilter/ipset/ip_set_core.c37
-rw-r--r--net/netfilter/nf_conntrack_helper.c12
-rw-r--r--net/netfilter/nf_conntrack_netlink.c4
-rw-r--r--net/netfilter/xt_CT.c8
-rw-r--r--net/netfilter/xt_hashlimit.c5
-rw-r--r--net/openvswitch/datapath.c8
-rw-r--r--net/openvswitch/datapath.h1
-rw-r--r--net/openvswitch/flow.c1
-rw-r--r--net/openvswitch/vport-internal_dev.c1
-rw-r--r--net/openvswitch/vport.c1
58 files changed, 429 insertions, 380 deletions
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index cec8864ce4e..00383186d8f 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -447,6 +447,9 @@ Your cooperation is appreciated.
447 234 = /dev/btrfs-control Btrfs control device 447 234 = /dev/btrfs-control Btrfs control device
448 235 = /dev/autofs Autofs control device 448 235 = /dev/autofs Autofs control device
449 236 = /dev/mapper/control Device-Mapper control device 449 236 = /dev/mapper/control Device-Mapper control device
450 237 = /dev/loop-control Loopback control device
451 238 = /dev/vhost-net Host kernel accelerator for virtio net
452
450 240-254 Reserved for local use 453 240-254 Reserved for local use
451 255 Reserved for MISC_DYNAMIC_MINOR 454 255 Reserved for MISC_DYNAMIC_MINOR
452 455
diff --git a/MAINTAINERS b/MAINTAINERS
index 341dee3b02c..fa3f5e6a608 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1412,6 +1412,7 @@ F: net/ax25/
1412B43 WIRELESS DRIVER 1412B43 WIRELESS DRIVER
1413M: Stefano Brivio <stefano.brivio@polimi.it> 1413M: Stefano Brivio <stefano.brivio@polimi.it>
1414L: linux-wireless@vger.kernel.org 1414L: linux-wireless@vger.kernel.org
1415L: b43-dev@lists.infradead.org (moderated for non-subscribers)
1415W: http://linuxwireless.org/en/users/Drivers/b43 1416W: http://linuxwireless.org/en/users/Drivers/b43
1416S: Maintained 1417S: Maintained
1417F: drivers/net/wireless/b43/ 1418F: drivers/net/wireless/b43/
@@ -1588,6 +1589,13 @@ L: linux-scsi@vger.kernel.org
1588S: Supported 1589S: Supported
1589F: drivers/scsi/bnx2fc/ 1590F: drivers/scsi/bnx2fc/
1590 1591
1592BROADCOM SPECIFIC AMBA DRIVER (BCMA)
1593M: Rafał Miłecki <zajec5@gmail.com>
1594L: linux-wireless@vger.kernel.org
1595S: Maintained
1596F: drivers/bcma/
1597F: include/linux/bcma/
1598
1591BROCADE BFA FC SCSI DRIVER 1599BROCADE BFA FC SCSI DRIVER
1592M: Jing Huang <huangj@brocade.com> 1600M: Jing Huang <huangj@brocade.com>
1593L: linux-scsi@vger.kernel.org 1601L: linux-scsi@vger.kernel.org
@@ -6117,13 +6125,6 @@ S: Maintained
6117F: drivers/ssb/ 6125F: drivers/ssb/
6118F: include/linux/ssb/ 6126F: include/linux/ssb/
6119 6127
6120BROADCOM SPECIFIC AMBA DRIVER (BCMA)
6121M: Rafał Miłecki <zajec5@gmail.com>
6122L: linux-wireless@vger.kernel.org
6123S: Maintained
6124F: drivers/bcma/
6125F: include/linux/bcma/
6126
6127SONY VAIO CONTROL DEVICE DRIVER 6128SONY VAIO CONTROL DEVICE DRIVER
6128M: Mattia Dongili <malattia@linux.it> 6129M: Mattia Dongili <malattia@linux.it>
6129L: platform-driver-x86@vger.kernel.org 6130L: platform-driver-x86@vger.kernel.org
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index fda56bde36b..0def898a1d1 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -19,6 +19,7 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
19 struct bcma_device *core_cc, 19 struct bcma_device *core_cc,
20 struct bcma_device *core_mips); 20 struct bcma_device *core_mips);
21#ifdef CONFIG_PM 21#ifdef CONFIG_PM
22int bcma_bus_suspend(struct bcma_bus *bus);
22int bcma_bus_resume(struct bcma_bus *bus); 23int bcma_bus_resume(struct bcma_bus *bus);
23#endif 24#endif
24 25
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 443b83a2fd7..f59244e3397 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -235,38 +235,32 @@ static void bcma_host_pci_remove(struct pci_dev *dev)
235} 235}
236 236
237#ifdef CONFIG_PM 237#ifdef CONFIG_PM
238static int bcma_host_pci_suspend(struct pci_dev *dev, pm_message_t state) 238static int bcma_host_pci_suspend(struct device *dev)
239{ 239{
240 /* Host specific */ 240 struct pci_dev *pdev = to_pci_dev(dev);
241 pci_save_state(dev); 241 struct bcma_bus *bus = pci_get_drvdata(pdev);
242 pci_disable_device(dev);
243 pci_set_power_state(dev, pci_choose_state(dev, state));
244 242
245 return 0; 243 bus->mapped_core = NULL;
244
245 return bcma_bus_suspend(bus);
246} 246}
247 247
248static int bcma_host_pci_resume(struct pci_dev *dev) 248static int bcma_host_pci_resume(struct device *dev)
249{ 249{
250 struct bcma_bus *bus = pci_get_drvdata(dev); 250 struct pci_dev *pdev = to_pci_dev(dev);
251 int err; 251 struct bcma_bus *bus = pci_get_drvdata(pdev);
252 252
253 /* Host specific */ 253 return bcma_bus_resume(bus);
254 pci_set_power_state(dev, 0); 254}
255 err = pci_enable_device(dev);
256 if (err)
257 return err;
258 pci_restore_state(dev);
259 255
260 /* Bus specific */ 256static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend,
261 err = bcma_bus_resume(bus); 257 bcma_host_pci_resume);
262 if (err) 258#define BCMA_PM_OPS (&bcma_pm_ops)
263 return err;
264 259
265 return 0;
266}
267#else /* CONFIG_PM */ 260#else /* CONFIG_PM */
268# define bcma_host_pci_suspend NULL 261
269# define bcma_host_pci_resume NULL 262#define BCMA_PM_OPS NULL
263
270#endif /* CONFIG_PM */ 264#endif /* CONFIG_PM */
271 265
272static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = { 266static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
@@ -284,8 +278,7 @@ static struct pci_driver bcma_pci_bridge_driver = {
284 .id_table = bcma_pci_bridge_tbl, 278 .id_table = bcma_pci_bridge_tbl,
285 .probe = bcma_host_pci_probe, 279 .probe = bcma_host_pci_probe,
286 .remove = bcma_host_pci_remove, 280 .remove = bcma_host_pci_remove,
287 .suspend = bcma_host_pci_suspend, 281 .driver.pm = BCMA_PM_OPS,
288 .resume = bcma_host_pci_resume,
289}; 282};
290 283
291int __init bcma_host_pci_init(void) 284int __init bcma_host_pci_init(void)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 10f92b371e5..febbc0a1222 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -241,6 +241,21 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
241} 241}
242 242
243#ifdef CONFIG_PM 243#ifdef CONFIG_PM
244int bcma_bus_suspend(struct bcma_bus *bus)
245{
246 struct bcma_device *core;
247
248 list_for_each_entry(core, &bus->cores, list) {
249 struct device_driver *drv = core->dev.driver;
250 if (drv) {
251 struct bcma_driver *adrv = container_of(drv, struct bcma_driver, drv);
252 if (adrv->suspend)
253 adrv->suspend(core);
254 }
255 }
256 return 0;
257}
258
244int bcma_bus_resume(struct bcma_bus *bus) 259int bcma_bus_resume(struct bcma_bus *bus)
245{ 260{
246 struct bcma_device *core; 261 struct bcma_device *core;
@@ -252,6 +267,15 @@ int bcma_bus_resume(struct bcma_bus *bus)
252 bcma_core_chipcommon_init(&bus->drv_cc); 267 bcma_core_chipcommon_init(&bus->drv_cc);
253 } 268 }
254 269
270 list_for_each_entry(core, &bus->cores, list) {
271 struct device_driver *drv = core->dev.driver;
272 if (drv) {
273 struct bcma_driver *adrv = container_of(drv, struct bcma_driver, drv);
274 if (adrv->resume)
275 adrv->resume(core);
276 }
277 }
278
255 return 0; 279 return 0;
256} 280}
257#endif 281#endif
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index a688b9d975a..f99c6e312a5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -365,13 +365,18 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
365 DP(NETIF_MSG_LINK, "cfg_idx = %x\n", cfg_idx); 365 DP(NETIF_MSG_LINK, "cfg_idx = %x\n", cfg_idx);
366 366
367 if (cmd->autoneg == AUTONEG_ENABLE) { 367 if (cmd->autoneg == AUTONEG_ENABLE) {
368 u32 an_supported_speed = bp->port.supported[cfg_idx];
369 if (bp->link_params.phy[EXT_PHY1].type ==
370 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833)
371 an_supported_speed |= (SUPPORTED_100baseT_Half |
372 SUPPORTED_100baseT_Full);
368 if (!(bp->port.supported[cfg_idx] & SUPPORTED_Autoneg)) { 373 if (!(bp->port.supported[cfg_idx] & SUPPORTED_Autoneg)) {
369 DP(NETIF_MSG_LINK, "Autoneg not supported\n"); 374 DP(NETIF_MSG_LINK, "Autoneg not supported\n");
370 return -EINVAL; 375 return -EINVAL;
371 } 376 }
372 377
373 /* advertise the requested speed and duplex if supported */ 378 /* advertise the requested speed and duplex if supported */
374 if (cmd->advertising & ~(bp->port.supported[cfg_idx])) { 379 if (cmd->advertising & ~an_supported_speed) {
375 DP(NETIF_MSG_LINK, "Advertisement parameters " 380 DP(NETIF_MSG_LINK, "Advertisement parameters "
376 "are not supported\n"); 381 "are not supported\n");
377 return -EINVAL; 382 return -EINVAL;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 4df9505b67b..2091e5dbbcd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -2502,7 +2502,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params,
2502 struct bnx2x_nig_brb_pfc_port_params *nig_params) 2502 struct bnx2x_nig_brb_pfc_port_params *nig_params)
2503{ 2503{
2504 u32 xcm_mask = 0, ppp_enable = 0, pause_enable = 0, llfc_out_en = 0; 2504 u32 xcm_mask = 0, ppp_enable = 0, pause_enable = 0, llfc_out_en = 0;
2505 u32 llfc_enable = 0, xcm0_out_en = 0, p0_hwpfc_enable = 0; 2505 u32 llfc_enable = 0, xcm_out_en = 0, hwpfc_enable = 0;
2506 u32 pkt_priority_to_cos = 0; 2506 u32 pkt_priority_to_cos = 0;
2507 struct bnx2x *bp = params->bp; 2507 struct bnx2x *bp = params->bp;
2508 u8 port = params->port; 2508 u8 port = params->port;
@@ -2516,9 +2516,8 @@ static void bnx2x_update_pfc_nig(struct link_params *params,
2516 * MAC control frames (that are not pause packets) 2516 * MAC control frames (that are not pause packets)
2517 * will be forwarded to the XCM. 2517 * will be forwarded to the XCM.
2518 */ 2518 */
2519 xcm_mask = REG_RD(bp, 2519 xcm_mask = REG_RD(bp, port ? NIG_REG_LLH1_XCM_MASK :
2520 port ? NIG_REG_LLH1_XCM_MASK : 2520 NIG_REG_LLH0_XCM_MASK);
2521 NIG_REG_LLH0_XCM_MASK);
2522 /* 2521 /*
2523 * nig params will override non PFC params, since it's possible to 2522 * nig params will override non PFC params, since it's possible to
2524 * do transition from PFC to SAFC 2523 * do transition from PFC to SAFC
@@ -2533,8 +2532,8 @@ static void bnx2x_update_pfc_nig(struct link_params *params,
2533 ppp_enable = 1; 2532 ppp_enable = 1;
2534 xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : 2533 xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN :
2535 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); 2534 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN);
2536 xcm0_out_en = 0; 2535 xcm_out_en = 0;
2537 p0_hwpfc_enable = 1; 2536 hwpfc_enable = 1;
2538 } else { 2537 } else {
2539 if (nig_params) { 2538 if (nig_params) {
2540 llfc_out_en = nig_params->llfc_out_en; 2539 llfc_out_en = nig_params->llfc_out_en;
@@ -2545,7 +2544,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params,
2545 2544
2546 xcm_mask |= (port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : 2545 xcm_mask |= (port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN :
2547 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); 2546 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN);
2548 xcm0_out_en = 1; 2547 xcm_out_en = 1;
2549 } 2548 }
2550 2549
2551 if (CHIP_IS_E3(bp)) 2550 if (CHIP_IS_E3(bp))
@@ -2564,13 +2563,16 @@ static void bnx2x_update_pfc_nig(struct link_params *params,
2564 REG_WR(bp, port ? NIG_REG_LLH1_XCM_MASK : 2563 REG_WR(bp, port ? NIG_REG_LLH1_XCM_MASK :
2565 NIG_REG_LLH0_XCM_MASK, xcm_mask); 2564 NIG_REG_LLH0_XCM_MASK, xcm_mask);
2566 2565
2567 REG_WR(bp, NIG_REG_LLFC_EGRESS_SRC_ENABLE_0, 0x7); 2566 REG_WR(bp, port ? NIG_REG_LLFC_EGRESS_SRC_ENABLE_1 :
2567 NIG_REG_LLFC_EGRESS_SRC_ENABLE_0, 0x7);
2568 2568
2569 /* output enable for RX_XCM # IF */ 2569 /* output enable for RX_XCM # IF */
2570 REG_WR(bp, NIG_REG_XCM0_OUT_EN, xcm0_out_en); 2570 REG_WR(bp, port ? NIG_REG_XCM1_OUT_EN :
2571 NIG_REG_XCM0_OUT_EN, xcm_out_en);
2571 2572
2572 /* HW PFC TX enable */ 2573 /* HW PFC TX enable */
2573 REG_WR(bp, NIG_REG_P0_HWPFC_ENABLE, p0_hwpfc_enable); 2574 REG_WR(bp, port ? NIG_REG_P1_HWPFC_ENABLE :
2575 NIG_REG_P0_HWPFC_ENABLE, hwpfc_enable);
2574 2576
2575 if (nig_params) { 2577 if (nig_params) {
2576 u8 i = 0; 2578 u8 i = 0;
@@ -3761,7 +3763,15 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3761 /* Advertise pause */ 3763 /* Advertise pause */
3762 bnx2x_ext_phy_set_pause(params, phy, vars); 3764 bnx2x_ext_phy_set_pause(params, phy, vars);
3763 3765
3764 vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY; 3766 /*
3767 * Set KR Autoneg Work-Around flag for Warpcore version older than D108
3768 */
3769 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3770 MDIO_WC_REG_UC_INFO_B1_VERSION, &val16);
3771 if (val16 < 0xd108) {
3772 DP(NETIF_MSG_LINK, "Enable AN KR work-around\n");
3773 vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
3774 }
3765 3775
3766 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, 3776 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3767 MDIO_WC_REG_DIGITAL5_MISC7, &val16); 3777 MDIO_WC_REG_DIGITAL5_MISC7, &val16);
@@ -9266,62 +9276,68 @@ static void bnx2x_8727_link_reset(struct bnx2x_phy *phy,
9266/* BCM8481/BCM84823/BCM84833 PHY SECTION */ 9276/* BCM8481/BCM84823/BCM84833 PHY SECTION */
9267/******************************************************************/ 9277/******************************************************************/
9268static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, 9278static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy,
9269 struct link_params *params) 9279 struct bnx2x *bp,
9280 u8 port)
9270{ 9281{
9271 u16 val, fw_ver1, fw_ver2, cnt; 9282 u16 val, fw_ver1, fw_ver2, cnt;
9272 u8 port;
9273 struct bnx2x *bp = params->bp;
9274 9283
9275 port = params->port; 9284 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9285 bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1);
9286 bnx2x_save_spirom_version(bp, port,
9287 ((fw_ver1 & 0xf000)>>5) | (fw_ver1 & 0x7f),
9288 phy->ver_addr);
9289 } else {
9290 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */
9291 /* (1) set reg 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */
9292 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0014);
9293 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200);
9294 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81B, 0x0000);
9295 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81C, 0x0300);
9296 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x0009);
9297
9298 for (cnt = 0; cnt < 100; cnt++) {
9299 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val);
9300 if (val & 1)
9301 break;
9302 udelay(5);
9303 }
9304 if (cnt == 100) {
9305 DP(NETIF_MSG_LINK, "Unable to read 848xx "
9306 "phy fw version(1)\n");
9307 bnx2x_save_spirom_version(bp, port, 0,
9308 phy->ver_addr);
9309 return;
9310 }
9276 9311
9277 /* For the 32 bits registers in 848xx, access via MDIO2ARM interface.*/
9278 /* (1) set register 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */
9279 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0014);
9280 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200);
9281 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81B, 0x0000);
9282 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81C, 0x0300);
9283 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x0009);
9284 9312
9285 for (cnt = 0; cnt < 100; cnt++) { 9313 /* 2) read register 0xc200_0000 (SPI_FW_STATUS) */
9286 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val); 9314 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0000);
9287 if (val & 1) 9315 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200);
9288 break; 9316 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x000A);
9289 udelay(5); 9317 for (cnt = 0; cnt < 100; cnt++) {
9290 } 9318 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val);
9291 if (cnt == 100) { 9319 if (val & 1)
9292 DP(NETIF_MSG_LINK, "Unable to read 848xx phy fw version(1)\n"); 9320 break;
9293 bnx2x_save_spirom_version(bp, port, 0, 9321 udelay(5);
9294 phy->ver_addr); 9322 }
9295 return; 9323 if (cnt == 100) {
9296 } 9324 DP(NETIF_MSG_LINK, "Unable to read 848xx phy fw "
9325 "version(2)\n");
9326 bnx2x_save_spirom_version(bp, port, 0,
9327 phy->ver_addr);
9328 return;
9329 }
9297 9330
9331 /* lower 16 bits of the register SPI_FW_STATUS */
9332 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81B, &fw_ver1);
9333 /* upper 16 bits of register SPI_FW_STATUS */
9334 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81C, &fw_ver2);
9298 9335
9299 /* 2) read register 0xc200_0000 (SPI_FW_STATUS) */ 9336 bnx2x_save_spirom_version(bp, port, (fw_ver2<<16) | fw_ver1,
9300 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0000);
9301 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200);
9302 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x000A);
9303 for (cnt = 0; cnt < 100; cnt++) {
9304 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val);
9305 if (val & 1)
9306 break;
9307 udelay(5);
9308 }
9309 if (cnt == 100) {
9310 DP(NETIF_MSG_LINK, "Unable to read 848xx phy fw version(2)\n");
9311 bnx2x_save_spirom_version(bp, port, 0,
9312 phy->ver_addr); 9337 phy->ver_addr);
9313 return;
9314 } 9338 }
9315 9339
9316 /* lower 16 bits of the register SPI_FW_STATUS */
9317 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81B, &fw_ver1);
9318 /* upper 16 bits of register SPI_FW_STATUS */
9319 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81C, &fw_ver2);
9320
9321 bnx2x_save_spirom_version(bp, port, (fw_ver2<<16) | fw_ver1,
9322 phy->ver_addr);
9323} 9340}
9324
9325static void bnx2x_848xx_set_led(struct bnx2x *bp, 9341static void bnx2x_848xx_set_led(struct bnx2x *bp,
9326 struct bnx2x_phy *phy) 9342 struct bnx2x_phy *phy)
9327{ 9343{
@@ -9392,10 +9408,13 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy,
9392 u16 tmp_req_line_speed; 9408 u16 tmp_req_line_speed;
9393 9409
9394 tmp_req_line_speed = phy->req_line_speed; 9410 tmp_req_line_speed = phy->req_line_speed;
9395 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) 9411 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9396 if (phy->req_line_speed == SPEED_10000) 9412 if (phy->req_line_speed == SPEED_10000)
9397 phy->req_line_speed = SPEED_AUTO_NEG; 9413 phy->req_line_speed = SPEED_AUTO_NEG;
9398 9414 } else {
9415 /* Save spirom version */
9416 bnx2x_save_848xx_spirom_version(phy, bp, params->port);
9417 }
9399 /* 9418 /*
9400 * This phy uses the NIG latch mechanism since link indication 9419 * This phy uses the NIG latch mechanism since link indication
9401 * arrives through its LED4 and not via its LASI signal, so we 9420 * arrives through its LED4 and not via its LASI signal, so we
@@ -9443,13 +9462,10 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy,
9443 an_1000_val); 9462 an_1000_val);
9444 9463
9445 /* set 100 speed advertisement */ 9464 /* set 100 speed advertisement */
9446 if (((phy->req_line_speed == SPEED_AUTO_NEG) && 9465 if ((phy->req_line_speed == SPEED_AUTO_NEG) &&
9447 (phy->speed_cap_mask & 9466 (phy->speed_cap_mask &
9448 (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | 9467 (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL |
9449 PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF)) && 9468 PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF))) {
9450 (phy->supported &
9451 (SUPPORTED_100baseT_Half |
9452 SUPPORTED_100baseT_Full)))) {
9453 an_10_100_val |= (1<<7); 9469 an_10_100_val |= (1<<7);
9454 /* Enable autoneg and restart autoneg for legacy speeds */ 9470 /* Enable autoneg and restart autoneg for legacy speeds */
9455 autoneg_val |= (1<<9 | 1<<12); 9471 autoneg_val |= (1<<9 | 1<<12);
@@ -9539,9 +9555,6 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy,
9539 MDIO_AN_REG_8481_10GBASE_T_AN_CTRL, 9555 MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,
9540 1); 9556 1);
9541 9557
9542 /* Save spirom version */
9543 bnx2x_save_848xx_spirom_version(phy, params);
9544
9545 phy->req_line_speed = tmp_req_line_speed; 9558 phy->req_line_speed = tmp_req_line_speed;
9546 9559
9547 return 0; 9560 return 0;
@@ -9749,17 +9762,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
9749 9762
9750 /* Wait for GPHY to come out of reset */ 9763 /* Wait for GPHY to come out of reset */
9751 msleep(50); 9764 msleep(50);
9752 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { 9765 if (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9753 /* Bring PHY out of super isolate mode */
9754 bnx2x_cl45_read(bp, phy,
9755 MDIO_CTL_DEVAD,
9756 MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);
9757 val &= ~MDIO_84833_SUPER_ISOLATE;
9758 bnx2x_cl45_write(bp, phy,
9759 MDIO_CTL_DEVAD,
9760 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
9761 bnx2x_84833_pair_swap_cfg(phy, params, vars);
9762 } else {
9763 /* 9766 /*
9764 * BCM84823 requires that XGXS links up first @ 10G for normal 9767 * BCM84823 requires that XGXS links up first @ 10G for normal
9765 * behavior. 9768 * behavior.
@@ -9816,24 +9819,23 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
9816 DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n", 9819 DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n",
9817 params->multi_phy_config, val); 9820 params->multi_phy_config, val);
9818 9821
9819 /* AutogrEEEn */ 9822 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9820 if (params->feature_config_flags & 9823 bnx2x_84833_pair_swap_cfg(phy, params, vars);
9821 FEATURE_CONFIG_AUTOGREEEN_ENABLED)
9822 cmd_args[0] = 0x2;
9823 else
9824 cmd_args[0] = 0x0;
9825 9824
9826 cmd_args[1] = 0x0; 9825 /* Keep AutogrEEEn disabled. */
9827 cmd_args[2] = PHY84833_CONSTANT_LATENCY + 1; 9826 cmd_args[0] = 0x0;
9828 cmd_args[3] = PHY84833_CONSTANT_LATENCY; 9827 cmd_args[1] = 0x0;
9829 rc = bnx2x_84833_cmd_hdlr(phy, params, 9828 cmd_args[2] = PHY84833_CONSTANT_LATENCY + 1;
9830 PHY84833_CMD_SET_EEE_MODE, cmd_args); 9829 cmd_args[3] = PHY84833_CONSTANT_LATENCY;
9831 if (rc != 0) 9830 rc = bnx2x_84833_cmd_hdlr(phy, params,
9832 DP(NETIF_MSG_LINK, "Cfg AutogrEEEn failed.\n"); 9831 PHY84833_CMD_SET_EEE_MODE, cmd_args);
9832 if (rc != 0)
9833 DP(NETIF_MSG_LINK, "Cfg AutogrEEEn failed.\n");
9834 }
9833 if (initialize) 9835 if (initialize)
9834 rc = bnx2x_848xx_cmn_config_init(phy, params, vars); 9836 rc = bnx2x_848xx_cmn_config_init(phy, params, vars);
9835 else 9837 else
9836 bnx2x_save_848xx_spirom_version(phy, params); 9838 bnx2x_save_848xx_spirom_version(phy, bp, params->port);
9837 /* 84833 PHY has a better feature and doesn't need to support this. */ 9839 /* 84833 PHY has a better feature and doesn't need to support this. */
9838 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823) { 9840 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823) {
9839 cms_enable = REG_RD(bp, params->shmem_base + 9841 cms_enable = REG_RD(bp, params->shmem_base +
@@ -9851,6 +9853,16 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
9851 MDIO_CTL_REG_84823_USER_CTRL_REG, val); 9853 MDIO_CTL_REG_84823_USER_CTRL_REG, val);
9852 } 9854 }
9853 9855
9856 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9857 /* Bring PHY out of super isolate mode as the final step. */
9858 bnx2x_cl45_read(bp, phy,
9859 MDIO_CTL_DEVAD,
9860 MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);
9861 val &= ~MDIO_84833_SUPER_ISOLATE;
9862 bnx2x_cl45_write(bp, phy,
9863 MDIO_CTL_DEVAD,
9864 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
9865 }
9854 return rc; 9866 return rc;
9855} 9867}
9856 9868
@@ -9988,10 +10000,11 @@ static void bnx2x_848x3_link_reset(struct bnx2x_phy *phy,
9988 } else { 10000 } else {
9989 bnx2x_cl45_read(bp, phy, 10001 bnx2x_cl45_read(bp, phy,
9990 MDIO_CTL_DEVAD, 10002 MDIO_CTL_DEVAD,
9991 0x400f, &val16); 10003 MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val16);
10004 val16 |= MDIO_84833_SUPER_ISOLATE;
9992 bnx2x_cl45_write(bp, phy, 10005 bnx2x_cl45_write(bp, phy,
9993 MDIO_PMA_DEVAD, 10006 MDIO_CTL_DEVAD,
9994 MDIO_PMA_REG_CTRL, 0x800); 10007 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val16);
9995 } 10008 }
9996} 10009}
9997 10010
@@ -11516,6 +11529,19 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp,
11516 } 11529 }
11517 phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port); 11530 phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port);
11518 11531
11532 if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) &&
11533 (phy->ver_addr)) {
11534 /*
11535 * Remove 100Mb link supported for BCM84833 when phy fw
11536 * version lower than or equal to 1.39
11537 */
11538 u32 raw_ver = REG_RD(bp, phy->ver_addr);
11539 if (((raw_ver & 0x7F) <= 39) &&
11540 (((raw_ver & 0xF80) >> 7) <= 1))
11541 phy->supported &= ~(SUPPORTED_100baseT_Half |
11542 SUPPORTED_100baseT_Full);
11543 }
11544
11519 /* 11545 /*
11520 * In case mdc/mdio_access of the external phy is different than the 11546 * In case mdc/mdio_access of the external phy is different than the
11521 * mdc/mdio access of the XGXS, a HW lock must be taken in each access 11547 * mdc/mdio access of the XGXS, a HW lock must be taken in each access
@@ -12333,55 +12359,69 @@ static int bnx2x_84833_common_init_phy(struct bnx2x *bp,
12333 u32 chip_id) 12359 u32 chip_id)
12334{ 12360{
12335 u8 reset_gpios; 12361 u8 reset_gpios;
12336 struct bnx2x_phy phy;
12337 u32 shmem_base, shmem2_base, cnt;
12338 s8 port = 0;
12339 u16 val;
12340
12341 reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id); 12362 reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id);
12342 bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_LOW); 12363 bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_LOW);
12343 udelay(10); 12364 udelay(10);
12344 bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_HIGH); 12365 bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_HIGH);
12345 DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n", 12366 DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
12346 reset_gpios); 12367 reset_gpios);
12347 for (port = PORT_MAX - 1; port >= PORT_0; port--) { 12368 return 0;
12348 /* This PHY is for E2 and E3. */ 12369}
12349 shmem_base = shmem_base_path[port];
12350 shmem2_base = shmem2_base_path[port];
12351 /* Extract the ext phy address for the port */
12352 if (bnx2x_populate_phy(bp, phy_index, shmem_base, shmem2_base,
12353 0, &phy) !=
12354 0) {
12355 DP(NETIF_MSG_LINK, "populate_phy failed\n");
12356 return -EINVAL;
12357 }
12358 12370
12359 /* Wait for FW completing its initialization. */ 12371static int bnx2x_84833_pre_init_phy(struct bnx2x *bp,
12360 for (cnt = 0; cnt < 1000; cnt++) { 12372 struct bnx2x_phy *phy)
12361 bnx2x_cl45_read(bp, &phy, 12373{
12374 u16 val, cnt;
12375 /* Wait for FW completing its initialization. */
12376 for (cnt = 0; cnt < 1500; cnt++) {
12377 bnx2x_cl45_read(bp, phy,
12362 MDIO_PMA_DEVAD, 12378 MDIO_PMA_DEVAD,
12363 MDIO_PMA_REG_CTRL, &val); 12379 MDIO_PMA_REG_CTRL, &val);
12364 if (!(val & (1<<15))) 12380 if (!(val & (1<<15)))
12365 break; 12381 break;
12366 msleep(1); 12382 msleep(1);
12367 } 12383 }
12368 if (cnt >= 1000) 12384 if (cnt >= 1500) {
12369 DP(NETIF_MSG_LINK, 12385 DP(NETIF_MSG_LINK, "84833 reset timeout\n");
12370 "84833 Cmn reset timeout (%d)\n", port); 12386 return -EINVAL;
12371
12372 /* Put the port in super isolate mode. */
12373 bnx2x_cl45_read(bp, &phy,
12374 MDIO_CTL_DEVAD,
12375 MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);
12376 val |= MDIO_84833_SUPER_ISOLATE;
12377 bnx2x_cl45_write(bp, &phy,
12378 MDIO_CTL_DEVAD,
12379 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
12380 } 12387 }
12381 12388
12389 /* Put the port in super isolate mode. */
12390 bnx2x_cl45_read(bp, phy,
12391 MDIO_CTL_DEVAD,
12392 MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);
12393 val |= MDIO_84833_SUPER_ISOLATE;
12394 bnx2x_cl45_write(bp, phy,
12395 MDIO_CTL_DEVAD,
12396 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
12397
12398 /* Save spirom version */
12399 bnx2x_save_848xx_spirom_version(phy, bp, PORT_0);
12382 return 0; 12400 return 0;
12383} 12401}
12384 12402
12403int bnx2x_pre_init_phy(struct bnx2x *bp,
12404 u32 shmem_base,
12405 u32 shmem2_base,
12406 u32 chip_id)
12407{
12408 int rc = 0;
12409 struct bnx2x_phy phy;
12410 bnx2x_set_mdio_clk(bp, chip_id, PORT_0);
12411 if (bnx2x_populate_phy(bp, EXT_PHY1, shmem_base, shmem2_base,
12412 PORT_0, &phy)) {
12413 DP(NETIF_MSG_LINK, "populate_phy failed\n");
12414 return -EINVAL;
12415 }
12416 switch (phy.type) {
12417 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
12418 rc = bnx2x_84833_pre_init_phy(bp, &phy);
12419 break;
12420 default:
12421 break;
12422 }
12423 return rc;
12424}
12385 12425
12386static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], 12426static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[],
12387 u32 shmem2_base_path[], u8 phy_index, 12427 u32 shmem2_base_path[], u8 phy_index,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
index 44609de4e5d..dddbcf6e154 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
@@ -2176,6 +2176,7 @@
2176 * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to 2176 * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to
2177 * accommodate the 9 input clients to ETS arbiter. */ 2177 * accommodate the 9 input clients to ETS arbiter. */
2178#define NIG_REG_P0_TX_ARB_PRIORITY_CLIENT2_MSB 0x18684 2178#define NIG_REG_P0_TX_ARB_PRIORITY_CLIENT2_MSB 0x18684
2179#define NIG_REG_P1_HWPFC_ENABLE 0x181d0
2179#define NIG_REG_P1_MAC_IN_EN 0x185c0 2180#define NIG_REG_P1_MAC_IN_EN 0x185c0
2180/* [RW 1] Output enable for TX MAC interface */ 2181/* [RW 1] Output enable for TX MAC interface */
2181#define NIG_REG_P1_MAC_OUT_EN 0x185c4 2182#define NIG_REG_P1_MAC_OUT_EN 0x185c4
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 076e02a415a..d529af99157 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8846,9 +8846,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
8846 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); 8846 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
8847 udelay(100); 8847 udelay(100);
8848 8848
8849 if (tg3_flag(tp, USING_MSIX) && tp->irq_cnt > 1) { 8849 if (tg3_flag(tp, USING_MSIX)) {
8850 val = tr32(MSGINT_MODE); 8850 val = tr32(MSGINT_MODE);
8851 val |= MSGINT_MODE_MULTIVEC_EN | MSGINT_MODE_ENABLE; 8851 val |= MSGINT_MODE_ENABLE;
8852 if (tp->irq_cnt > 1)
8853 val |= MSGINT_MODE_MULTIVEC_EN;
8852 if (!tg3_flag(tp, 1SHOT_MSI)) 8854 if (!tg3_flag(tp, 1SHOT_MSI))
8853 val |= MSGINT_MODE_ONE_SHOT_DISABLE; 8855 val |= MSGINT_MODE_ONE_SHOT_DISABLE;
8854 tw32(MSGINT_MODE, val); 8856 tw32(MSGINT_MODE, val);
@@ -9548,19 +9550,18 @@ static int tg3_request_firmware(struct tg3 *tp)
9548 9550
9549static bool tg3_enable_msix(struct tg3 *tp) 9551static bool tg3_enable_msix(struct tg3 *tp)
9550{ 9552{
9551 int i, rc, cpus = num_online_cpus(); 9553 int i, rc;
9552 struct msix_entry msix_ent[tp->irq_max]; 9554 struct msix_entry msix_ent[tp->irq_max];
9553 9555
9554 if (cpus == 1) 9556 tp->irq_cnt = num_online_cpus();
9555 /* Just fallback to the simpler MSI mode. */ 9557 if (tp->irq_cnt > 1) {
9556 return false; 9558 /* We want as many rx rings enabled as there are cpus.
9557 9559 * In multiqueue MSI-X mode, the first MSI-X vector
9558 /* 9560 * only deals with link interrupts, etc, so we add
9559 * We want as many rx rings enabled as there are cpus. 9561 * one to the number of vectors we are requesting.
9560 * The first MSIX vector only deals with link interrupts, etc, 9562 */
9561 * so we add one to the number of vectors we are requesting. 9563 tp->irq_cnt = min_t(unsigned, tp->irq_cnt + 1, tp->irq_max);
9562 */ 9564 }
9563 tp->irq_cnt = min_t(unsigned, cpus + 1, tp->irq_max);
9564 9565
9565 for (i = 0; i < tp->irq_max; i++) { 9566 for (i = 0; i < tp->irq_max; i++) {
9566 msix_ent[i].entry = i; 9567 msix_ent[i].entry = i;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
index 05b7359bde8..6bdd8e36e56 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
@@ -263,7 +263,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
263 data[i++] = atomic_read(&port->port_res[k].swqe_avail); 263 data[i++] = atomic_read(&port->port_res[k].swqe_avail);
264} 264}
265 265
266const struct ethtool_ops ehea_ethtool_ops = { 266static const struct ethtool_ops ehea_ethtool_ops = {
267 .get_settings = ehea_get_settings, 267 .get_settings = ehea_get_settings,
268 .get_drvinfo = ehea_get_drvinfo, 268 .get_drvinfo = ehea_get_drvinfo,
269 .get_msglevel = ehea_get_msglevel, 269 .get_msglevel = ehea_get_msglevel,
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 3554414eb5e..5d5fb262718 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -94,8 +94,8 @@ static int port_name_cnt;
94static LIST_HEAD(adapter_list); 94static LIST_HEAD(adapter_list);
95static unsigned long ehea_driver_flags; 95static unsigned long ehea_driver_flags;
96static DEFINE_MUTEX(dlpar_mem_lock); 96static DEFINE_MUTEX(dlpar_mem_lock);
97struct ehea_fw_handle_array ehea_fw_handles; 97static struct ehea_fw_handle_array ehea_fw_handles;
98struct ehea_bcmc_reg_array ehea_bcmc_regs; 98static struct ehea_bcmc_reg_array ehea_bcmc_regs;
99 99
100 100
101static int __devinit ehea_probe_adapter(struct platform_device *dev, 101static int __devinit ehea_probe_adapter(struct platform_device *dev,
@@ -133,7 +133,7 @@ void ehea_dump(void *adr, int len, char *msg)
133 } 133 }
134} 134}
135 135
136void ehea_schedule_port_reset(struct ehea_port *port) 136static void ehea_schedule_port_reset(struct ehea_port *port)
137{ 137{
138 if (!test_bit(__EHEA_DISABLE_PORT_RESET, &port->flags)) 138 if (!test_bit(__EHEA_DISABLE_PORT_RESET, &port->flags))
139 schedule_work(&port->reset_task); 139 schedule_work(&port->reset_task);
@@ -1404,7 +1404,7 @@ out:
1404 return ret; 1404 return ret;
1405} 1405}
1406 1406
1407int ehea_gen_smrs(struct ehea_port_res *pr) 1407static int ehea_gen_smrs(struct ehea_port_res *pr)
1408{ 1408{
1409 int ret; 1409 int ret;
1410 struct ehea_adapter *adapter = pr->port->adapter; 1410 struct ehea_adapter *adapter = pr->port->adapter;
@@ -1426,7 +1426,7 @@ out:
1426 return -EIO; 1426 return -EIO;
1427} 1427}
1428 1428
1429int ehea_rem_smrs(struct ehea_port_res *pr) 1429static int ehea_rem_smrs(struct ehea_port_res *pr)
1430{ 1430{
1431 if ((ehea_rem_mr(&pr->send_mr)) || 1431 if ((ehea_rem_mr(&pr->send_mr)) ||
1432 (ehea_rem_mr(&pr->recv_mr))) 1432 (ehea_rem_mr(&pr->recv_mr)))
@@ -2190,7 +2190,7 @@ out:
2190 return err; 2190 return err;
2191} 2191}
2192 2192
2193int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) 2193static int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
2194{ 2194{
2195 int ret = -EIO; 2195 int ret = -EIO;
2196 u64 hret; 2196 u64 hret;
@@ -2531,7 +2531,7 @@ static void ehea_flush_sq(struct ehea_port *port)
2531 } 2531 }
2532} 2532}
2533 2533
2534int ehea_stop_qps(struct net_device *dev) 2534static int ehea_stop_qps(struct net_device *dev)
2535{ 2535{
2536 struct ehea_port *port = netdev_priv(dev); 2536 struct ehea_port *port = netdev_priv(dev);
2537 struct ehea_adapter *adapter = port->adapter; 2537 struct ehea_adapter *adapter = port->adapter;
@@ -2600,7 +2600,7 @@ out:
2600 return ret; 2600 return ret;
2601} 2601}
2602 2602
2603void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res *pr) 2603static void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res *pr)
2604{ 2604{
2605 struct ehea_qp qp = *orig_qp; 2605 struct ehea_qp qp = *orig_qp;
2606 struct ehea_qp_init_attr *init_attr = &qp.init_attr; 2606 struct ehea_qp_init_attr *init_attr = &qp.init_attr;
@@ -2633,7 +2633,7 @@ void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res *pr)
2633 } 2633 }
2634} 2634}
2635 2635
2636int ehea_restart_qps(struct net_device *dev) 2636static int ehea_restart_qps(struct net_device *dev)
2637{ 2637{
2638 struct ehea_port *port = netdev_priv(dev); 2638 struct ehea_port *port = netdev_priv(dev);
2639 struct ehea_adapter *adapter = port->adapter; 2639 struct ehea_adapter *adapter = port->adapter;
@@ -2824,7 +2824,7 @@ static void ehea_tx_watchdog(struct net_device *dev)
2824 ehea_schedule_port_reset(port); 2824 ehea_schedule_port_reset(port);
2825} 2825}
2826 2826
2827int ehea_sense_adapter_attr(struct ehea_adapter *adapter) 2827static int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
2828{ 2828{
2829 struct hcp_query_ehea *cb; 2829 struct hcp_query_ehea *cb;
2830 u64 hret; 2830 u64 hret;
@@ -2852,7 +2852,7 @@ out:
2852 return ret; 2852 return ret;
2853} 2853}
2854 2854
2855int ehea_get_jumboframe_status(struct ehea_port *port, int *jumbo) 2855static int ehea_get_jumboframe_status(struct ehea_port *port, int *jumbo)
2856{ 2856{
2857 struct hcp_ehea_port_cb4 *cb4; 2857 struct hcp_ehea_port_cb4 *cb4;
2858 u64 hret; 2858 u64 hret;
@@ -2966,7 +2966,7 @@ static const struct net_device_ops ehea_netdev_ops = {
2966 .ndo_tx_timeout = ehea_tx_watchdog, 2966 .ndo_tx_timeout = ehea_tx_watchdog,
2967}; 2967};
2968 2968
2969struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, 2969static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
2970 u32 logical_port_id, 2970 u32 logical_port_id,
2971 struct device_node *dn) 2971 struct device_node *dn)
2972{ 2972{
@@ -3237,7 +3237,7 @@ static ssize_t ehea_remove_port(struct device *dev,
3237static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port); 3237static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port);
3238static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port); 3238static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port);
3239 3239
3240int ehea_create_device_sysfs(struct platform_device *dev) 3240static int ehea_create_device_sysfs(struct platform_device *dev)
3241{ 3241{
3242 int ret = device_create_file(&dev->dev, &dev_attr_probe_port); 3242 int ret = device_create_file(&dev->dev, &dev_attr_probe_port);
3243 if (ret) 3243 if (ret)
@@ -3248,7 +3248,7 @@ out:
3248 return ret; 3248 return ret;
3249} 3249}
3250 3250
3251void ehea_remove_device_sysfs(struct platform_device *dev) 3251static void ehea_remove_device_sysfs(struct platform_device *dev)
3252{ 3252{
3253 device_remove_file(&dev->dev, &dev_attr_probe_port); 3253 device_remove_file(&dev->dev, &dev_attr_probe_port);
3254 device_remove_file(&dev->dev, &dev_attr_remove_port); 3254 device_remove_file(&dev->dev, &dev_attr_remove_port);
@@ -3379,7 +3379,7 @@ static int __devexit ehea_remove(struct platform_device *dev)
3379 return 0; 3379 return 0;
3380} 3380}
3381 3381
3382void ehea_crash_handler(void) 3382static void ehea_crash_handler(void)
3383{ 3383{
3384 int i; 3384 int i;
3385 3385
@@ -3491,7 +3491,7 @@ static ssize_t ehea_show_capabilities(struct device_driver *drv,
3491static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH, 3491static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
3492 ehea_show_capabilities, NULL); 3492 ehea_show_capabilities, NULL);
3493 3493
3494int __init ehea_module_init(void) 3494static int __init ehea_module_init(void)
3495{ 3495{
3496 int ret; 3496 int ret;
3497 3497
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
index 95b9f4fa811..c25b05b94da 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
@@ -34,9 +34,7 @@
34#include "ehea_phyp.h" 34#include "ehea_phyp.h"
35#include "ehea_qmr.h" 35#include "ehea_qmr.h"
36 36
37struct ehea_bmap *ehea_bmap = NULL; 37static struct ehea_bmap *ehea_bmap;
38
39
40 38
41static void *hw_qpageit_get_inc(struct hw_queue *queue) 39static void *hw_qpageit_get_inc(struct hw_queue *queue)
42{ 40{
@@ -212,7 +210,7 @@ out_nomem:
212 return NULL; 210 return NULL;
213} 211}
214 212
215u64 ehea_destroy_cq_res(struct ehea_cq *cq, u64 force) 213static u64 ehea_destroy_cq_res(struct ehea_cq *cq, u64 force)
216{ 214{
217 u64 hret; 215 u64 hret;
218 u64 adapter_handle = cq->adapter->handle; 216 u64 adapter_handle = cq->adapter->handle;
@@ -337,7 +335,7 @@ struct ehea_eqe *ehea_poll_eq(struct ehea_eq *eq)
337 return eqe; 335 return eqe;
338} 336}
339 337
340u64 ehea_destroy_eq_res(struct ehea_eq *eq, u64 force) 338static u64 ehea_destroy_eq_res(struct ehea_eq *eq, u64 force)
341{ 339{
342 u64 hret; 340 u64 hret;
343 unsigned long flags; 341 unsigned long flags;
@@ -381,7 +379,7 @@ int ehea_destroy_eq(struct ehea_eq *eq)
381/** 379/**
382 * allocates memory for a queue and registers pages in phyp 380 * allocates memory for a queue and registers pages in phyp
383 */ 381 */
384int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue, 382static int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue,
385 int nr_pages, int wqe_size, int act_nr_sges, 383 int nr_pages, int wqe_size, int act_nr_sges,
386 struct ehea_adapter *adapter, int h_call_q_selector) 384 struct ehea_adapter *adapter, int h_call_q_selector)
387{ 385{
@@ -516,7 +514,7 @@ out_freemem:
516 return NULL; 514 return NULL;
517} 515}
518 516
519u64 ehea_destroy_qp_res(struct ehea_qp *qp, u64 force) 517static u64 ehea_destroy_qp_res(struct ehea_qp *qp, u64 force)
520{ 518{
521 u64 hret; 519 u64 hret;
522 struct ehea_qp_init_attr *qp_attr = &qp->init_attr; 520 struct ehea_qp_init_attr *qp_attr = &qp->init_attr;
@@ -976,7 +974,7 @@ int ehea_gen_smr(struct ehea_adapter *adapter, struct ehea_mr *old_mr,
976 return 0; 974 return 0;
977} 975}
978 976
979void print_error_data(u64 *data) 977static void print_error_data(u64 *data)
980{ 978{
981 int length; 979 int length;
982 u64 type = EHEA_BMASK_GET(ERROR_DATA_TYPE, data[2]); 980 u64 type = EHEA_BMASK_GET(ERROR_DATA_TYPE, data[2]);
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 6ece4295d78..813d41c4a84 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1703,7 +1703,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
1703 mdp->mii_bus->name = "sh_mii"; 1703 mdp->mii_bus->name = "sh_mii";
1704 mdp->mii_bus->parent = &ndev->dev; 1704 mdp->mii_bus->parent = &ndev->dev;
1705 snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", 1705 snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
1706 mdp->pdev->name, pdid); 1706 mdp->pdev->name, id);
1707 1707
1708 /* PHY IRQ */ 1708 /* PHY IRQ */
1709 mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); 1709 mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
index 88c81c5706b..09b8c9dbf78 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
@@ -557,10 +557,11 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
557 rxs->rs_status |= ATH9K_RXERR_DECRYPT; 557 rxs->rs_status |= ATH9K_RXERR_DECRYPT;
558 else if (rxsp->status11 & AR_MichaelErr) 558 else if (rxsp->status11 & AR_MichaelErr)
559 rxs->rs_status |= ATH9K_RXERR_MIC; 559 rxs->rs_status |= ATH9K_RXERR_MIC;
560 if (rxsp->status11 & AR_KeyMiss)
561 rxs->rs_status |= ATH9K_RXERR_KEYMISS;
562 } 560 }
563 561
562 if (rxsp->status11 & AR_KeyMiss)
563 rxs->rs_status |= ATH9K_RXERR_KEYMISS;
564
564 return 0; 565 return 0;
565} 566}
566EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); 567EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma);
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index fd3f19c2e55..e196aba77ac 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -618,10 +618,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
618 rs->rs_status |= ATH9K_RXERR_DECRYPT; 618 rs->rs_status |= ATH9K_RXERR_DECRYPT;
619 else if (ads.ds_rxstatus8 & AR_MichaelErr) 619 else if (ads.ds_rxstatus8 & AR_MichaelErr)
620 rs->rs_status |= ATH9K_RXERR_MIC; 620 rs->rs_status |= ATH9K_RXERR_MIC;
621 if (ads.ds_rxstatus8 & AR_KeyMiss)
622 rs->rs_status |= ATH9K_RXERR_KEYMISS;
623 } 621 }
624 622
623 if (ads.ds_rxstatus8 & AR_KeyMiss)
624 rs->rs_status |= ATH9K_RXERR_KEYMISS;
625
625 return 0; 626 return 0;
626} 627}
627EXPORT_SYMBOL(ath9k_hw_rxprocdesc); 628EXPORT_SYMBOL(ath9k_hw_rxprocdesc);
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 1c6f19393ef..b91f28ef103 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4852,6 +4852,9 @@ static void b43_op_stop(struct ieee80211_hw *hw)
4852 4852
4853 cancel_work_sync(&(wl->beacon_update_trigger)); 4853 cancel_work_sync(&(wl->beacon_update_trigger));
4854 4854
4855 if (!dev)
4856 goto out;
4857
4855 mutex_lock(&wl->mutex); 4858 mutex_lock(&wl->mutex);
4856 if (b43_status(dev) >= B43_STAT_STARTED) { 4859 if (b43_status(dev) >= B43_STAT_STARTED) {
4857 dev = b43_wireless_core_stop(dev); 4860 dev = b43_wireless_core_stop(dev);
@@ -4863,7 +4866,7 @@ static void b43_op_stop(struct ieee80211_hw *hw)
4863 4866
4864out_unlock: 4867out_unlock:
4865 mutex_unlock(&wl->mutex); 4868 mutex_unlock(&wl->mutex);
4866 4869out:
4867 cancel_work_sync(&(wl->txpower_adjust_work)); 4870 cancel_work_sync(&(wl->txpower_adjust_work));
4868} 4871}
4869 4872
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index f23b0c3e4ea..bf11850a20f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -2475,7 +2475,7 @@ static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
2475 return err; 2475 return err;
2476} 2476}
2477 2477
2478static void brcmf_delay(u32 ms) 2478static __always_inline void brcmf_delay(u32 ms)
2479{ 2479{
2480 if (ms < 1000 / HZ) { 2480 if (ms < 1000 / HZ) {
2481 cond_resched(); 2481 cond_resched();
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index d106576ce33..448ab9c4eb4 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1128,14 +1128,7 @@ static int __devinit brcms_bcma_probe(struct bcma_device *pdev)
1128 return 0; 1128 return 0;
1129} 1129}
1130 1130
1131static int brcms_pci_suspend(struct pci_dev *pdev) 1131static int brcms_suspend(struct bcma_device *pdev)
1132{
1133 pci_save_state(pdev);
1134 pci_disable_device(pdev);
1135 return pci_set_power_state(pdev, PCI_D3hot);
1136}
1137
1138static int brcms_suspend(struct bcma_device *pdev, pm_message_t state)
1139{ 1132{
1140 struct brcms_info *wl; 1133 struct brcms_info *wl;
1141 struct ieee80211_hw *hw; 1134 struct ieee80211_hw *hw;
@@ -1153,40 +1146,15 @@ static int brcms_suspend(struct bcma_device *pdev, pm_message_t state)
1153 wl->pub->hw_up = false; 1146 wl->pub->hw_up = false;
1154 spin_unlock_bh(&wl->lock); 1147 spin_unlock_bh(&wl->lock);
1155 1148
1156 /* temporarily do suspend ourselves */ 1149 pr_debug("brcms_suspend ok\n");
1157 return brcms_pci_suspend(pdev->bus->host_pci);
1158}
1159
1160static int brcms_pci_resume(struct pci_dev *pdev)
1161{
1162 int err = 0;
1163 uint val;
1164
1165 err = pci_set_power_state(pdev, PCI_D0);
1166 if (err)
1167 return err;
1168
1169 pci_restore_state(pdev);
1170
1171 err = pci_enable_device(pdev);
1172 if (err)
1173 return err;
1174
1175 pci_set_master(pdev);
1176
1177 pci_read_config_dword(pdev, 0x40, &val);
1178 if ((val & 0x0000ff00) != 0)
1179 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
1180 1150
1181 return 0; 1151 return 0;
1182} 1152}
1183 1153
1184static int brcms_resume(struct bcma_device *pdev) 1154static int brcms_resume(struct bcma_device *pdev)
1185{ 1155{
1186 /* 1156 pr_debug("brcms_resume ok\n");
1187 * just do pci resume for now until bcma supports it. 1157 return 0;
1188 */
1189 return brcms_pci_resume(pdev->bus->host_pci);
1190} 1158}
1191 1159
1192static struct bcma_driver brcms_bcma_driver = { 1160static struct bcma_driver brcms_bcma_driver = {
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 018a8deb88a..4fcdac63a30 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -7848,7 +7848,7 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7848 * more efficiently than we can parse it. ORDER MATTERS HERE */ 7848 * more efficiently than we can parse it. ORDER MATTERS HERE */
7849 struct ipw_rt_hdr *ipw_rt; 7849 struct ipw_rt_hdr *ipw_rt;
7850 7850
7851 short len = le16_to_cpu(pkt->u.frame.length); 7851 unsigned short len = le16_to_cpu(pkt->u.frame.length);
7852 7852
7853 /* We received data from the HW, so stop the watchdog */ 7853 /* We received data from the HW, so stop the watchdog */
7854 dev->trans_start = jiffies; 7854 dev->trans_start = jiffies;
@@ -8023,7 +8023,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8023 s8 signal = frame->rssi_dbm - IPW_RSSI_TO_DBM; 8023 s8 signal = frame->rssi_dbm - IPW_RSSI_TO_DBM;
8024 s8 noise = (s8) le16_to_cpu(frame->noise); 8024 s8 noise = (s8) le16_to_cpu(frame->noise);
8025 u8 rate = frame->rate; 8025 u8 rate = frame->rate;
8026 short len = le16_to_cpu(pkt->u.frame.length); 8026 unsigned short len = le16_to_cpu(pkt->u.frame.length);
8027 struct sk_buff *skb; 8027 struct sk_buff *skb;
8028 int hdr_only = 0; 8028 int hdr_only = 0;
8029 u16 filter = priv->prom_priv->filter; 8029 u16 filter = priv->prom_priv->filter;
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 084aa2c4ccf..a6454726737 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -569,7 +569,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
569 struct iwl_scan_cmd *scan; 569 struct iwl_scan_cmd *scan;
570 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 570 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
571 u32 rate_flags = 0; 571 u32 rate_flags = 0;
572 u16 cmd_len; 572 u16 cmd_len = 0;
573 u16 rx_chain = 0; 573 u16 rx_chain = 0;
574 enum ieee80211_band band; 574 enum ieee80211_band band;
575 u8 n_probes = 0; 575 u8 n_probes = 0;
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 7becea3dec6..dd5aeaff44b 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2777,7 +2777,7 @@ static int mwl8k_cmd_tx_power(struct ieee80211_hw *hw,
2777 else if (channel->band == IEEE80211_BAND_5GHZ) 2777 else if (channel->band == IEEE80211_BAND_5GHZ)
2778 cmd->band = cpu_to_le16(0x4); 2778 cmd->band = cpu_to_le16(0x4);
2779 2779
2780 cmd->channel = channel->hw_value; 2780 cmd->channel = cpu_to_le16(channel->hw_value);
2781 2781
2782 if (conf->channel_type == NL80211_CHAN_NO_HT || 2782 if (conf->channel_type == NL80211_CHAN_NO_HT ||
2783 conf->channel_type == NL80211_CHAN_HT20) { 2783 conf->channel_type == NL80211_CHAN_HT20) {
@@ -4066,7 +4066,7 @@ static int mwl8k_cmd_encryption_remove_key(struct ieee80211_hw *hw,
4066 goto done; 4066 goto done;
4067 4067
4068 if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || 4068 if (key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
4069 WLAN_CIPHER_SUITE_WEP104) 4069 key->cipher == WLAN_CIPHER_SUITE_WEP104)
4070 mwl8k_vif->wep_key_conf[key->keyidx].enabled = 0; 4070 mwl8k_vif->wep_key_conf[key->keyidx].enabled = 0;
4071 4071
4072 cmd->action = cpu_to_le32(MWL8K_ENCR_REMOVE_KEY); 4072 cmd->action = cpu_to_le32(MWL8K_ENCR_REMOVE_KEY);
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 4941a1a2321..dc88baefa72 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -422,7 +422,6 @@ static int rt2800pci_init_queues(struct rt2x00_dev *rt2x00dev)
422static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, 422static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
423 enum dev_state state) 423 enum dev_state state)
424{ 424{
425 int mask = (state == STATE_RADIO_IRQ_ON);
426 u32 reg; 425 u32 reg;
427 unsigned long flags; 426 unsigned long flags;
428 427
@@ -436,25 +435,14 @@ static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
436 } 435 }
437 436
438 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 437 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags);
439 rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, &reg); 438 reg = 0;
440 rt2x00_set_field32(&reg, INT_MASK_CSR_RXDELAYINT, 0); 439 if (state == STATE_RADIO_IRQ_ON) {
441 rt2x00_set_field32(&reg, INT_MASK_CSR_TXDELAYINT, 0); 440 rt2x00_set_field32(&reg, INT_MASK_CSR_RX_DONE, 1);
442 rt2x00_set_field32(&reg, INT_MASK_CSR_RX_DONE, mask); 441 rt2x00_set_field32(&reg, INT_MASK_CSR_TBTT, 1);
443 rt2x00_set_field32(&reg, INT_MASK_CSR_AC0_DMA_DONE, 0); 442 rt2x00_set_field32(&reg, INT_MASK_CSR_PRE_TBTT, 1);
444 rt2x00_set_field32(&reg, INT_MASK_CSR_AC1_DMA_DONE, 0); 443 rt2x00_set_field32(&reg, INT_MASK_CSR_TX_FIFO_STATUS, 1);
445 rt2x00_set_field32(&reg, INT_MASK_CSR_AC2_DMA_DONE, 0); 444 rt2x00_set_field32(&reg, INT_MASK_CSR_AUTO_WAKEUP, 1);
446 rt2x00_set_field32(&reg, INT_MASK_CSR_AC3_DMA_DONE, 0); 445 }
447 rt2x00_set_field32(&reg, INT_MASK_CSR_HCCA_DMA_DONE, 0);
448 rt2x00_set_field32(&reg, INT_MASK_CSR_MGMT_DMA_DONE, 0);
449 rt2x00_set_field32(&reg, INT_MASK_CSR_MCU_COMMAND, 0);
450 rt2x00_set_field32(&reg, INT_MASK_CSR_RXTX_COHERENT, 0);
451 rt2x00_set_field32(&reg, INT_MASK_CSR_TBTT, mask);
452 rt2x00_set_field32(&reg, INT_MASK_CSR_PRE_TBTT, mask);
453 rt2x00_set_field32(&reg, INT_MASK_CSR_TX_FIFO_STATUS, mask);
454 rt2x00_set_field32(&reg, INT_MASK_CSR_AUTO_WAKEUP, mask);
455 rt2x00_set_field32(&reg, INT_MASK_CSR_GPTIMER, 0);
456 rt2x00_set_field32(&reg, INT_MASK_CSR_RX_COHERENT, 0);
457 rt2x00_set_field32(&reg, INT_MASK_CSR_TX_COHERENT, 0);
458 rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); 446 rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg);
459 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 447 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags);
460 448
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 882a51fe7b3..9dab1f51dd4 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -856,9 +856,9 @@ static const struct file_operations vhost_net_fops = {
856}; 856};
857 857
858static struct miscdevice vhost_net_misc = { 858static struct miscdevice vhost_net_misc = {
859 MISC_DYNAMIC_MINOR, 859 .minor = VHOST_NET_MINOR,
860 "vhost-net", 860 .name = "vhost-net",
861 &vhost_net_fops, 861 .fops = &vhost_net_fops,
862}; 862};
863 863
864static int vhost_net_init(void) 864static int vhost_net_init(void)
@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
879MODULE_LICENSE("GPL v2"); 879MODULE_LICENSE("GPL v2");
880MODULE_AUTHOR("Michael S. Tsirkin"); 880MODULE_AUTHOR("Michael S. Tsirkin");
881MODULE_DESCRIPTION("Host kernel accelerator for virtio net"); 881MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
882MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
883MODULE_ALIAS("devname:vhost-net");
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index f4b8346b1a3..83c209f3949 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -162,7 +162,7 @@ struct bcma_driver {
162 162
163 int (*probe)(struct bcma_device *dev); 163 int (*probe)(struct bcma_device *dev);
164 void (*remove)(struct bcma_device *dev); 164 void (*remove)(struct bcma_device *dev);
165 int (*suspend)(struct bcma_device *dev, pm_message_t state); 165 int (*suspend)(struct bcma_device *dev);
166 int (*resume)(struct bcma_device *dev); 166 int (*resume)(struct bcma_device *dev);
167 void (*shutdown)(struct bcma_device *dev); 167 void (*shutdown)(struct bcma_device *dev);
168 168
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 32085249e9c..0549d211550 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -42,6 +42,7 @@
42#define AUTOFS_MINOR 235 42#define AUTOFS_MINOR 235
43#define MAPPER_CTRL_MINOR 236 43#define MAPPER_CTRL_MINOR 236
44#define LOOP_CTRL_MINOR 237 44#define LOOP_CTRL_MINOR 237
45#define VHOST_NET_MINOR 238
45#define MISC_DYNAMIC_MINOR 255 46#define MISC_DYNAMIC_MINOR 255
46 47
47struct device; 48struct device;
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 9e3a2838291..0d3dd66322e 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -83,10 +83,6 @@ enum ip_conntrack_status {
83 /* Conntrack is a fake untracked entry */ 83 /* Conntrack is a fake untracked entry */
84 IPS_UNTRACKED_BIT = 12, 84 IPS_UNTRACKED_BIT = 12,
85 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT), 85 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
86
87 /* Conntrack has a userspace helper. */
88 IPS_USERSPACE_HELPER_BIT = 13,
89 IPS_USERSPACE_HELPER = (1 << IPS_USERSPACE_HELPER_BIT),
90}; 86};
91 87
92/* Connection tracking event types */ 88/* Connection tracking event types */
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h
index 6390f0992f3..b56e76811c0 100644
--- a/include/linux/netfilter/xt_CT.h
+++ b/include/linux/netfilter/xt_CT.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define XT_CT_NOTRACK 0x1 6#define XT_CT_NOTRACK 0x1
7#define XT_CT_USERSPACE_HELPER 0x2
8 7
9struct xt_ct_target_info { 8struct xt_ct_target_info {
10 __u16 flags; 9 __u16 flags;
diff --git a/include/net/flow.h b/include/net/flow.h
index da1f064a81b..9b582437fbe 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -78,7 +78,7 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
78 __u32 mark, __u8 tos, __u8 scope, 78 __u32 mark, __u8 tos, __u8 scope,
79 __u8 proto, __u8 flags, 79 __u8 proto, __u8 flags,
80 __be32 daddr, __be32 saddr, 80 __be32 daddr, __be32 saddr,
81 __be16 dport, __be32 sport) 81 __be16 dport, __be16 sport)
82{ 82{
83 fl4->flowi4_oif = oif; 83 fl4->flowi4_oif = oif;
84 fl4->flowi4_iif = 0; 84 fl4->flowi4_iif = 0;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 602207be985..3dbff4dcde3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -373,7 +373,6 @@ static void mem_cgroup_put(struct mem_cgroup *memcg);
373 373
374/* Writing them here to avoid exposing memcg's inner layout */ 374/* Writing them here to avoid exposing memcg's inner layout */
375#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM 375#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
376#ifdef CONFIG_INET
377#include <net/sock.h> 376#include <net/sock.h>
378#include <net/ip.h> 377#include <net/ip.h>
379 378
@@ -420,6 +419,7 @@ void sock_release_memcg(struct sock *sk)
420 } 419 }
421} 420}
422 421
422#ifdef CONFIG_INET
423struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg) 423struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg)
424{ 424{
425 if (!memcg || mem_cgroup_is_root(memcg)) 425 if (!memcg || mem_cgroup_is_root(memcg))
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index f963f6b1884..5ba0c844d50 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -146,7 +146,7 @@ void br_fdb_cleanup(unsigned long _data)
146 unsigned long next_timer = jiffies + br->ageing_time; 146 unsigned long next_timer = jiffies + br->ageing_time;
147 int i; 147 int i;
148 148
149 spin_lock_bh(&br->hash_lock); 149 spin_lock(&br->hash_lock);
150 for (i = 0; i < BR_HASH_SIZE; i++) { 150 for (i = 0; i < BR_HASH_SIZE; i++) {
151 struct net_bridge_fdb_entry *f; 151 struct net_bridge_fdb_entry *f;
152 struct hlist_node *h, *n; 152 struct hlist_node *h, *n;
@@ -162,7 +162,7 @@ void br_fdb_cleanup(unsigned long _data)
162 next_timer = this_timer; 162 next_timer = this_timer;
163 } 163 }
164 } 164 }
165 spin_unlock_bh(&br->hash_lock); 165 spin_unlock(&br->hash_lock);
166 166
167 mod_timer(&br->gc_timer, round_jiffies_up(next_timer)); 167 mod_timer(&br->gc_timer, round_jiffies_up(next_timer));
168} 168}
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index 61570ee76fe..673728add60 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -146,15 +146,17 @@ void caif_flow_cb(struct sk_buff *skb)
146 spin_lock_bh(&caifd->flow_lock); 146 spin_lock_bh(&caifd->flow_lock);
147 send_xoff = caifd->xoff; 147 send_xoff = caifd->xoff;
148 caifd->xoff = 0; 148 caifd->xoff = 0;
149 if (!WARN_ON(caifd->xoff_skb_dtor == NULL)) { 149 dtor = caifd->xoff_skb_dtor;
150 WARN_ON(caifd->xoff_skb != skb); 150
151 dtor = caifd->xoff_skb_dtor; 151 if (WARN_ON(caifd->xoff_skb != skb))
152 caifd->xoff_skb = NULL; 152 skb = NULL;
153 caifd->xoff_skb_dtor = NULL; 153
154 } 154 caifd->xoff_skb = NULL;
155 caifd->xoff_skb_dtor = NULL;
156
155 spin_unlock_bh(&caifd->flow_lock); 157 spin_unlock_bh(&caifd->flow_lock);
156 158
157 if (dtor) 159 if (dtor && skb)
158 dtor(skb); 160 dtor(skb);
159 161
160 if (send_xoff) 162 if (send_xoff)
diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
index 5fc9eca8cd4..fd7cbf5aa89 100644
--- a/net/caif/caif_usb.c
+++ b/net/caif/caif_usb.c
@@ -11,7 +11,6 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/netdevice.h> 12#include <linux/netdevice.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/netdevice.h>
15#include <linux/mii.h> 14#include <linux/mii.h>
16#include <linux/usb.h> 15#include <linux/usb.h>
17#include <linux/usb/usbnet.h> 16#include <linux/usb/usbnet.h>
@@ -27,7 +26,7 @@ MODULE_LICENSE("GPL");
27#define CFUSB_ALIGNMENT 4 /* Number of bytes to align. */ 26#define CFUSB_ALIGNMENT 4 /* Number of bytes to align. */
28#define CFUSB_MAX_HEADLEN (CFUSB_PAD_DESCR_SZ + CFUSB_ALIGNMENT-1) 27#define CFUSB_MAX_HEADLEN (CFUSB_PAD_DESCR_SZ + CFUSB_ALIGNMENT-1)
29#define STE_USB_VID 0x04cc /* USB Product ID for ST-Ericsson */ 28#define STE_USB_VID 0x04cc /* USB Product ID for ST-Ericsson */
30#define STE_USB_PID_CAIF 0x2306 /* Product id for CAIF Modems */ 29#define STE_USB_PID_CAIF 0x230f /* Product id for CAIF Modems */
31 30
32struct cfusbl { 31struct cfusbl {
33 struct cflayer layer; 32 struct cflayer layer;
diff --git a/net/core/dev.c b/net/core/dev.c
index f494675471a..115dee1d985 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1887,6 +1887,23 @@ void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1887EXPORT_SYMBOL(skb_set_dev); 1887EXPORT_SYMBOL(skb_set_dev);
1888#endif /* CONFIG_NET_NS */ 1888#endif /* CONFIG_NET_NS */
1889 1889
1890static void skb_warn_bad_offload(const struct sk_buff *skb)
1891{
1892 static const netdev_features_t null_features = 0;
1893 struct net_device *dev = skb->dev;
1894 const char *driver = "";
1895
1896 if (dev && dev->dev.parent)
1897 driver = dev_driver_string(dev->dev.parent);
1898
1899 WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d gso_size=%d "
1900 "gso_type=%d ip_summed=%d\n",
1901 driver, dev ? &dev->features : &null_features,
1902 skb->sk ? &skb->sk->sk_route_caps : &null_features,
1903 skb->len, skb->data_len, skb_shinfo(skb)->gso_size,
1904 skb_shinfo(skb)->gso_type, skb->ip_summed);
1905}
1906
1890/* 1907/*
1891 * Invalidate hardware checksum when packet is to be mangled, and 1908 * Invalidate hardware checksum when packet is to be mangled, and
1892 * complete checksum manually on outgoing path. 1909 * complete checksum manually on outgoing path.
@@ -1900,8 +1917,8 @@ int skb_checksum_help(struct sk_buff *skb)
1900 goto out_set_summed; 1917 goto out_set_summed;
1901 1918
1902 if (unlikely(skb_shinfo(skb)->gso_size)) { 1919 if (unlikely(skb_shinfo(skb)->gso_size)) {
1903 /* Let GSO fix up the checksum. */ 1920 skb_warn_bad_offload(skb);
1904 goto out_set_summed; 1921 return -EINVAL;
1905 } 1922 }
1906 1923
1907 offset = skb_checksum_start_offset(skb); 1924 offset = skb_checksum_start_offset(skb);
@@ -1961,16 +1978,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb,
1961 __skb_pull(skb, skb->mac_len); 1978 __skb_pull(skb, skb->mac_len);
1962 1979
1963 if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { 1980 if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
1964 struct net_device *dev = skb->dev; 1981 skb_warn_bad_offload(skb);
1965 struct ethtool_drvinfo info = {};
1966
1967 if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo)
1968 dev->ethtool_ops->get_drvinfo(dev, &info);
1969
1970 WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d ip_summed=%d\n",
1971 info.driver, dev ? &dev->features : NULL,
1972 skb->sk ? &skb->sk->sk_route_caps : NULL,
1973 skb->len, skb->data_len, skb->ip_summed);
1974 1982
1975 if (skb_header_cloned(skb) && 1983 if (skb_header_cloned(skb) &&
1976 (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) 1984 (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index f3dbd4f596a..a1727cda03d 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -929,7 +929,7 @@ static ssize_t bql_show_inflight(struct netdev_queue *queue,
929} 929}
930 930
931static struct netdev_queue_attribute bql_inflight_attribute = 931static struct netdev_queue_attribute bql_inflight_attribute =
932 __ATTR(inflight, S_IRUGO | S_IWUSR, bql_show_inflight, NULL); 932 __ATTR(inflight, S_IRUGO, bql_show_inflight, NULL);
933 933
934#define BQL_ATTR(NAME, FIELD) \ 934#define BQL_ATTR(NAME, FIELD) \
935static ssize_t bql_show_ ## NAME(struct netdev_queue *queue, \ 935static ssize_t bql_show_ ## NAME(struct netdev_queue *queue, \
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c
index 6fd44606fdd..99b2596531b 100644
--- a/net/core/secure_seq.c
+++ b/net/core/secure_seq.c
@@ -46,7 +46,7 @@ __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr,
46 46
47 memcpy(hash, saddr, 16); 47 memcpy(hash, saddr, 16);
48 for (i = 0; i < 4; i++) 48 for (i = 0; i < 4; i++)
49 secret[i] = net_secret[i] + daddr[i]; 49 secret[i] = net_secret[i] + (__force u32)daddr[i];
50 secret[4] = net_secret[4] + 50 secret[4] = net_secret[4] +
51 (((__force u16)sport << 16) + (__force u16)dport); 51 (((__force u16)sport << 16) + (__force u16)dport);
52 for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++) 52 for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++)
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 86f13c67ea8..bf4a9c4808e 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -136,7 +136,7 @@ static int addr_compare(const struct inetpeer_addr *a,
136 for (i = 0; i < n; i++) { 136 for (i = 0; i < n; i++) {
137 if (a->addr.a6[i] == b->addr.a6[i]) 137 if (a->addr.a6[i] == b->addr.a6[i])
138 continue; 138 continue;
139 if (a->addr.a6[i] < b->addr.a6[i]) 139 if ((__force u32)a->addr.a6[i] < (__force u32)b->addr.a6[i])
140 return -1; 140 return -1;
141 return 1; 141 return 1;
142 } 142 }
@@ -447,6 +447,7 @@ relookup:
447 p->rate_last = 0; 447 p->rate_last = 0;
448 p->pmtu_expires = 0; 448 p->pmtu_expires = 0;
449 p->pmtu_orig = 0; 449 p->pmtu_orig = 0;
450 p->redirect_genid = 0;
450 memset(&p->redirect_learned, 0, sizeof(p->redirect_learned)); 451 memset(&p->redirect_learned, 0, sizeof(p->redirect_learned));
451 452
452 453
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 7e4ec9fc2ce..6e412a60a91 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -141,7 +141,7 @@ __be32 ic_servaddr = NONE; /* Boot server IP address */
141__be32 root_server_addr = NONE; /* Address of NFS server */ 141__be32 root_server_addr = NONE; /* Address of NFS server */
142u8 root_server_path[256] = { 0, }; /* Path to mount as root */ 142u8 root_server_path[256] = { 0, }; /* Path to mount as root */
143 143
144u32 ic_dev_xid; /* Device under configuration */ 144__be32 ic_dev_xid; /* Device under configuration */
145 145
146/* vendor class identifier */ 146/* vendor class identifier */
147static char vendor_class_identifier[253] __initdata; 147static char vendor_class_identifier[253] __initdata;
@@ -859,9 +859,9 @@ static int __init ic_bootp_string(char *dest, char *src, int len, int max)
859 */ 859 */
860static void __init ic_do_bootp_ext(u8 *ext) 860static void __init ic_do_bootp_ext(u8 *ext)
861{ 861{
862 u8 servers; 862 u8 servers;
863 int i; 863 int i;
864 u16 mtu; 864 __be16 mtu;
865 865
866#ifdef IPCONFIG_DEBUG 866#ifdef IPCONFIG_DEBUG
867 u8 *c; 867 u8 *c;
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 43d4c3b2236..aea5a199c37 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -140,13 +140,14 @@ static void ping_v4_unhash(struct sock *sk)
140 write_lock_bh(&ping_table.lock); 140 write_lock_bh(&ping_table.lock);
141 hlist_nulls_del(&sk->sk_nulls_node); 141 hlist_nulls_del(&sk->sk_nulls_node);
142 sock_put(sk); 142 sock_put(sk);
143 isk->inet_num = isk->inet_sport = 0; 143 isk->inet_num = 0;
144 isk->inet_sport = 0;
144 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 145 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
145 write_unlock_bh(&ping_table.lock); 146 write_unlock_bh(&ping_table.lock);
146 } 147 }
147} 148}
148 149
149static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr, 150static struct sock *ping_v4_lookup(struct net *net, __be32 saddr, __be32 daddr,
150 u16 ident, int dif) 151 u16 ident, int dif)
151{ 152{
152 struct hlist_nulls_head *hslot = ping_hashslot(&ping_table, net, ident); 153 struct hlist_nulls_head *hslot = ping_hashslot(&ping_table, net, ident);
@@ -154,15 +155,15 @@ static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr,
154 struct inet_sock *isk; 155 struct inet_sock *isk;
155 struct hlist_nulls_node *hnode; 156 struct hlist_nulls_node *hnode;
156 157
157 pr_debug("try to find: num = %d, daddr = %ld, dif = %d\n", 158 pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n",
158 (int)ident, (unsigned long)daddr, dif); 159 (int)ident, &daddr, dif);
159 read_lock_bh(&ping_table.lock); 160 read_lock_bh(&ping_table.lock);
160 161
161 ping_portaddr_for_each_entry(sk, hnode, hslot) { 162 ping_portaddr_for_each_entry(sk, hnode, hslot) {
162 isk = inet_sk(sk); 163 isk = inet_sk(sk);
163 164
164 pr_debug("found: %p: num = %d, daddr = %ld, dif = %d\n", sk, 165 pr_debug("found: %p: num = %d, daddr = %pI4, dif = %d\n", sk,
165 (int)isk->inet_num, (unsigned long)isk->inet_rcv_saddr, 166 (int)isk->inet_num, &isk->inet_rcv_saddr,
166 sk->sk_bound_dev_if); 167 sk->sk_bound_dev_if);
167 168
168 pr_debug("iterate\n"); 169 pr_debug("iterate\n");
@@ -254,7 +255,7 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
254 sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); 255 sk, addr->sin_addr.s_addr, ntohs(addr->sin_port));
255 256
256 chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); 257 chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
257 if (addr->sin_addr.s_addr == INADDR_ANY) 258 if (addr->sin_addr.s_addr == htonl(INADDR_ANY))
258 chk_addr_ret = RTN_LOCAL; 259 chk_addr_ret = RTN_LOCAL;
259 260
260 if ((sysctl_ip_nonlocal_bind == 0 && 261 if ((sysctl_ip_nonlocal_bind == 0 &&
@@ -278,9 +279,9 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
278 goto out; 279 goto out;
279 } 280 }
280 281
281 pr_debug("after bind(): num = %d, daddr = %ld, dif = %d\n", 282 pr_debug("after bind(): num = %d, daddr = %pI4, dif = %d\n",
282 (int)isk->inet_num, 283 (int)isk->inet_num,
283 (unsigned long) isk->inet_rcv_saddr, 284 &isk->inet_rcv_saddr,
284 (int)sk->sk_bound_dev_if); 285 (int)sk->sk_bound_dev_if);
285 286
286 err = 0; 287 err = 0;
@@ -407,7 +408,7 @@ out:
407struct pingfakehdr { 408struct pingfakehdr {
408 struct icmphdr icmph; 409 struct icmphdr icmph;
409 struct iovec *iov; 410 struct iovec *iov;
410 u32 wcheck; 411 __wsum wcheck;
411}; 412};
412 413
413static int ping_getfrag(void *from, char * to, 414static int ping_getfrag(void *from, char * to,
@@ -459,7 +460,7 @@ static int ping_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
459 struct rtable *rt = NULL; 460 struct rtable *rt = NULL;
460 struct ip_options_data opt_copy; 461 struct ip_options_data opt_copy;
461 int free = 0; 462 int free = 0;
462 u32 saddr, daddr, faddr; 463 __be32 saddr, daddr, faddr;
463 u8 tos; 464 u8 tos;
464 int err; 465 int err;
465 466
@@ -696,8 +697,8 @@ void ping_rcv(struct sk_buff *skb)
696 struct net *net = dev_net(skb->dev); 697 struct net *net = dev_net(skb->dev);
697 struct iphdr *iph = ip_hdr(skb); 698 struct iphdr *iph = ip_hdr(skb);
698 struct icmphdr *icmph = icmp_hdr(skb); 699 struct icmphdr *icmph = icmp_hdr(skb);
699 u32 saddr = iph->saddr; 700 __be32 saddr = iph->saddr;
700 u32 daddr = iph->daddr; 701 __be32 daddr = iph->daddr;
701 702
702 /* We assume the packet has already been checked by icmp_rcv */ 703 /* We assume the packet has already been checked by icmp_rcv */
703 704
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index e5e18cb8a58..8a949f19deb 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -15,7 +15,6 @@
15#include <linux/udp.h> 15#include <linux/udp.h>
16#include <net/udp.h> 16#include <net/udp.h>
17#include <net/udplite.h> 17#include <net/udplite.h>
18#include <linux/inet_diag.h>
19#include <linux/sock_diag.h> 18#include <linux/sock_diag.h>
20 19
21static int sk_diag_dump(struct sock *sk, struct sk_buff *skb, 20static int sk_diag_dump(struct sock *sk, struct sk_buff *skb,
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index ae08aee1773..251e7cd75e8 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -575,7 +575,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
575 } 575 }
576 if (np->rxopt.bits.rxorigdstaddr) { 576 if (np->rxopt.bits.rxorigdstaddr) {
577 struct sockaddr_in6 sin6; 577 struct sockaddr_in6 sin6;
578 u16 *ports = (u16 *) skb_transport_header(skb); 578 __be16 *ports = (__be16 *) skb_transport_header(skb);
579 579
580 if (skb_transport_offset(skb) + 4 <= skb->len) { 580 if (skb_transport_offset(skb) + 4 <= skb->len) {
581 /* All current transport protocols have the port numbers in the 581 /* All current transport protocols have the port numbers in the
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index fdeb6d03da8..da2e92d05c1 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -237,8 +237,8 @@ static int snmp6_dev_seq_show(struct seq_file *seq, void *v)
237 struct inet6_dev *idev = (struct inet6_dev *)seq->private; 237 struct inet6_dev *idev = (struct inet6_dev *)seq->private;
238 238
239 seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex); 239 seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex);
240 snmp6_seq_show_item(seq, (void __percpu **)idev->stats.ipv6, NULL, 240 snmp6_seq_show_item64(seq, (void __percpu **)idev->stats.ipv6,
241 snmp6_ipstats_list); 241 snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp));
242 snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs, 242 snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs,
243 snmp6_icmp6_list); 243 snmp6_icmp6_list);
244 snmp6_seq_show_icmpv6msg(seq, idev->stats.icmpv6msgdev->mibs); 244 snmp6_seq_show_icmpv6msg(seq, idev->stats.icmpv6msgdev->mibs);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 07361dfa808..8c2e3ab58f2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1091,6 +1091,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
1091 else { 1091 else {
1092 neigh = ip6_neigh_lookup(&rt->dst, &fl6->daddr); 1092 neigh = ip6_neigh_lookup(&rt->dst, &fl6->daddr);
1093 if (IS_ERR(neigh)) { 1093 if (IS_ERR(neigh)) {
1094 in6_dev_put(idev);
1094 dst_free(&rt->dst); 1095 dst_free(&rt->dst);
1095 return ERR_CAST(neigh); 1096 return ERR_CAST(neigh);
1096 } 1097 }
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index e60df48fa4d..296620d6ca0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -791,7 +791,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
791 if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) 791 if (set & BIT(NL80211_STA_FLAG_AUTHORIZED))
792 ret = sta_info_move_state_checked(sta, 792 ret = sta_info_move_state_checked(sta,
793 IEEE80211_STA_AUTHORIZED); 793 IEEE80211_STA_AUTHORIZED);
794 else 794 else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
795 ret = sta_info_move_state_checked(sta, 795 ret = sta_info_move_state_checked(sta,
796 IEEE80211_STA_ASSOC); 796 IEEE80211_STA_ASSOC);
797 if (ret) 797 if (ret)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f407427c642..75140912076 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1979,6 +1979,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1979 mesh_path_error_tx(ifmsh->mshcfg.element_ttl, fwd_hdr->addr3, 1979 mesh_path_error_tx(ifmsh->mshcfg.element_ttl, fwd_hdr->addr3,
1980 0, reason, fwd_hdr->addr2, sdata); 1980 0, reason, fwd_hdr->addr2, sdata);
1981 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route); 1981 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
1982 kfree_skb(fwd_skb);
1982 return RX_DROP_MONITOR; 1983 return RX_DROP_MONITOR;
1983 } 1984 }
1984 1985
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 3c428d4839c..ff11f6bf826 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -238,9 +238,11 @@ static void sta_unblock(struct work_struct *wk)
238 if (sta->dead) 238 if (sta->dead)
239 return; 239 return;
240 240
241 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) 241 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) {
242 local_bh_disable();
242 ieee80211_sta_ps_deliver_wakeup(sta); 243 ieee80211_sta_ps_deliver_wakeup(sta);
243 else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) { 244 local_bh_enable();
245 } else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) {
244 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); 246 clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
245 247
246 local_bh_disable(); 248 local_bh_disable();
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index edcd1c7ab83..e05667cd5e7 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1001,8 +1001,6 @@ ieee80211_tx_h_stats(struct ieee80211_tx_data *tx)
1001static ieee80211_tx_result debug_noinline 1001static ieee80211_tx_result debug_noinline
1002ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) 1002ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx)
1003{ 1003{
1004 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
1005
1006 if (!tx->key) 1004 if (!tx->key)
1007 return TX_CONTINUE; 1005 return TX_CONTINUE;
1008 1006
@@ -1017,13 +1015,7 @@ ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx)
1017 case WLAN_CIPHER_SUITE_AES_CMAC: 1015 case WLAN_CIPHER_SUITE_AES_CMAC:
1018 return ieee80211_crypto_aes_cmac_encrypt(tx); 1016 return ieee80211_crypto_aes_cmac_encrypt(tx);
1019 default: 1017 default:
1020 /* handle hw-only algorithm */ 1018 return ieee80211_crypto_hw_encrypt(tx);
1021 if (info->control.hw_key) {
1022 ieee80211_tx_set_protected(tx);
1023 return TX_CONTINUE;
1024 }
1025 break;
1026
1027 } 1019 }
1028 1020
1029 return TX_DROP; 1021 return TX_DROP;
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 422b79851ec..b758350919f 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -643,3 +643,22 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)
643 643
644 return RX_CONTINUE; 644 return RX_CONTINUE;
645} 645}
646
647ieee80211_tx_result
648ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx)
649{
650 struct sk_buff *skb;
651 struct ieee80211_tx_info *info = NULL;
652
653 skb_queue_walk(&tx->skbs, skb) {
654 info = IEEE80211_SKB_CB(skb);
655
656 /* handle hw-only algorithm */
657 if (!info->control.hw_key)
658 return TX_DROP;
659 }
660
661 ieee80211_tx_set_protected(tx);
662
663 return TX_CONTINUE;
664}
diff --git a/net/mac80211/wpa.h b/net/mac80211/wpa.h
index baba0608313..07e33f899c7 100644
--- a/net/mac80211/wpa.h
+++ b/net/mac80211/wpa.h
@@ -32,5 +32,7 @@ ieee80211_tx_result
32ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx); 32ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx);
33ieee80211_rx_result 33ieee80211_rx_result
34ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx); 34ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx);
35ieee80211_tx_result
36ieee80211_crypto_hw_encrypt(struct ieee80211_tx_data *tx);
35 37
36#endif /* WPA_H */ 38#endif /* WPA_H */
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 86137b558f4..32dbf0fa89d 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -77,35 +77,42 @@ find_set_type(const char *name, u8 family, u8 revision)
77} 77}
78 78
79/* Unlock, try to load a set type module and lock again */ 79/* Unlock, try to load a set type module and lock again */
80static int 80static bool
81try_to_load_type(const char *name) 81load_settype(const char *name)
82{ 82{
83 nfnl_unlock(); 83 nfnl_unlock();
84 pr_debug("try to load ip_set_%s\n", name); 84 pr_debug("try to load ip_set_%s\n", name);
85 if (request_module("ip_set_%s", name) < 0) { 85 if (request_module("ip_set_%s", name) < 0) {
86 pr_warning("Can't find ip_set type %s\n", name); 86 pr_warning("Can't find ip_set type %s\n", name);
87 nfnl_lock(); 87 nfnl_lock();
88 return -IPSET_ERR_FIND_TYPE; 88 return false;
89 } 89 }
90 nfnl_lock(); 90 nfnl_lock();
91 return -EAGAIN; 91 return true;
92} 92}
93 93
94/* Find a set type and reference it */ 94/* Find a set type and reference it */
95#define find_set_type_get(name, family, revision, found) \
96 __find_set_type_get(name, family, revision, found, false)
97
95static int 98static int
96find_set_type_get(const char *name, u8 family, u8 revision, 99__find_set_type_get(const char *name, u8 family, u8 revision,
97 struct ip_set_type **found) 100 struct ip_set_type **found, bool retry)
98{ 101{
99 struct ip_set_type *type; 102 struct ip_set_type *type;
100 int err; 103 int err;
101 104
105 if (retry && !load_settype(name))
106 return -IPSET_ERR_FIND_TYPE;
107
102 rcu_read_lock(); 108 rcu_read_lock();
103 *found = find_set_type(name, family, revision); 109 *found = find_set_type(name, family, revision);
104 if (*found) { 110 if (*found) {
105 err = !try_module_get((*found)->me) ? -EFAULT : 0; 111 err = !try_module_get((*found)->me) ? -EFAULT : 0;
106 goto unlock; 112 goto unlock;
107 } 113 }
108 /* Make sure the type is loaded but we don't support the revision */ 114 /* Make sure the type is already loaded
115 * but we don't support the revision */
109 list_for_each_entry_rcu(type, &ip_set_type_list, list) 116 list_for_each_entry_rcu(type, &ip_set_type_list, list)
110 if (STREQ(type->name, name)) { 117 if (STREQ(type->name, name)) {
111 err = -IPSET_ERR_FIND_TYPE; 118 err = -IPSET_ERR_FIND_TYPE;
@@ -113,7 +120,8 @@ find_set_type_get(const char *name, u8 family, u8 revision,
113 } 120 }
114 rcu_read_unlock(); 121 rcu_read_unlock();
115 122
116 return try_to_load_type(name); 123 return retry ? -IPSET_ERR_FIND_TYPE :
124 __find_set_type_get(name, family, revision, found, true);
117 125
118unlock: 126unlock:
119 rcu_read_unlock(); 127 rcu_read_unlock();
@@ -124,12 +132,19 @@ unlock:
124 * If we succeeded, the supported minimal and maximum revisions are 132 * If we succeeded, the supported minimal and maximum revisions are
125 * filled out. 133 * filled out.
126 */ 134 */
135#define find_set_type_minmax(name, family, min, max) \
136 __find_set_type_minmax(name, family, min, max, false)
137
127static int 138static int
128find_set_type_minmax(const char *name, u8 family, u8 *min, u8 *max) 139__find_set_type_minmax(const char *name, u8 family, u8 *min, u8 *max,
140 bool retry)
129{ 141{
130 struct ip_set_type *type; 142 struct ip_set_type *type;
131 bool found = false; 143 bool found = false;
132 144
145 if (retry && !load_settype(name))
146 return -IPSET_ERR_FIND_TYPE;
147
133 *min = 255; *max = 0; 148 *min = 255; *max = 0;
134 rcu_read_lock(); 149 rcu_read_lock();
135 list_for_each_entry_rcu(type, &ip_set_type_list, list) 150 list_for_each_entry_rcu(type, &ip_set_type_list, list)
@@ -145,7 +160,8 @@ find_set_type_minmax(const char *name, u8 family, u8 *min, u8 *max)
145 if (found) 160 if (found)
146 return 0; 161 return 0;
147 162
148 return try_to_load_type(name); 163 return retry ? -IPSET_ERR_FIND_TYPE :
164 __find_set_type_minmax(name, family, min, max, true);
149} 165}
150 166
151#define family_name(f) ((f) == AF_INET ? "inet" : \ 167#define family_name(f) ((f) == AF_INET ? "inet" : \
@@ -1126,6 +1142,7 @@ release_refcount:
1126 if (ret || !cb->args[2]) { 1142 if (ret || !cb->args[2]) {
1127 pr_debug("release set %s\n", ip_set_list[index]->name); 1143 pr_debug("release set %s\n", ip_set_list[index]->name);
1128 ip_set_put_byindex(index); 1144 ip_set_put_byindex(index);
1145 cb->args[2] = 0;
1129 } 1146 }
1130out: 1147out:
1131 if (nlh) { 1148 if (nlh) {
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
index 299fec91f74..bbe23baa19b 100644
--- a/net/netfilter/nf_conntrack_helper.c
+++ b/net/netfilter/nf_conntrack_helper.c
@@ -121,18 +121,6 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
121 int ret = 0; 121 int ret = 0;
122 122
123 if (tmpl != NULL) { 123 if (tmpl != NULL) {
124 /* we've got a userspace helper. */
125 if (tmpl->status & IPS_USERSPACE_HELPER) {
126 help = nf_ct_helper_ext_add(ct, flags);
127 if (help == NULL) {
128 ret = -ENOMEM;
129 goto out;
130 }
131 rcu_assign_pointer(help->helper, NULL);
132 __set_bit(IPS_USERSPACE_HELPER_BIT, &ct->status);
133 ret = 0;
134 goto out;
135 }
136 help = nfct_help(tmpl); 124 help = nfct_help(tmpl);
137 if (help != NULL) 125 if (help != NULL)
138 helper = help->helper; 126 helper = help->helper;
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 2a4834b8333..9307b033c0c 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2042,10 +2042,6 @@ ctnetlink_create_expect(struct net *net, u16 zone,
2042 } 2042 }
2043 help = nfct_help(ct); 2043 help = nfct_help(ct);
2044 if (!help) { 2044 if (!help) {
2045 err = -EOPNOTSUPP;
2046 goto out;
2047 }
2048 if (test_bit(IPS_USERSPACE_HELPER_BIT, &ct->status)) {
2049 if (!cda[CTA_EXPECT_TIMEOUT]) { 2045 if (!cda[CTA_EXPECT_TIMEOUT]) {
2050 err = -EINVAL; 2046 err = -EINVAL;
2051 goto out; 2047 goto out;
diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index 8e87123f137..0221d10de75 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -62,8 +62,8 @@ static int xt_ct_tg_check(const struct xt_tgchk_param *par)
62 int ret = 0; 62 int ret = 0;
63 u8 proto; 63 u8 proto;
64 64
65 if (info->flags & ~(XT_CT_NOTRACK | XT_CT_USERSPACE_HELPER)) 65 if (info->flags & ~XT_CT_NOTRACK)
66 return -EOPNOTSUPP; 66 return -EINVAL;
67 67
68 if (info->flags & XT_CT_NOTRACK) { 68 if (info->flags & XT_CT_NOTRACK) {
69 ct = nf_ct_untracked_get(); 69 ct = nf_ct_untracked_get();
@@ -92,9 +92,7 @@ static int xt_ct_tg_check(const struct xt_tgchk_param *par)
92 GFP_KERNEL)) 92 GFP_KERNEL))
93 goto err3; 93 goto err3;
94 94
95 if (info->flags & XT_CT_USERSPACE_HELPER) { 95 if (info->helper[0]) {
96 __set_bit(IPS_USERSPACE_HELPER_BIT, &ct->status);
97 } else if (info->helper[0]) {
98 ret = -ENOENT; 96 ret = -ENOENT;
99 proto = xt_ct_find_proto(par); 97 proto = xt_ct_find_proto(par);
100 if (!proto) { 98 if (!proto) {
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 8e499210187..d95f9c963cd 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -445,7 +445,6 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
445{ 445{
446 __be16 _ports[2], *ports; 446 __be16 _ports[2], *ports;
447 u8 nexthdr; 447 u8 nexthdr;
448 __be16 frag_off;
449 int poff; 448 int poff;
450 449
451 memset(dst, 0, sizeof(*dst)); 450 memset(dst, 0, sizeof(*dst));
@@ -466,6 +465,9 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
466 break; 465 break;
467#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 466#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
468 case NFPROTO_IPV6: 467 case NFPROTO_IPV6:
468 {
469 __be16 frag_off;
470
469 if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) { 471 if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) {
470 memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr, 472 memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr,
471 sizeof(dst->ip6.dst)); 473 sizeof(dst->ip6.dst));
@@ -485,6 +487,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
485 if ((int)protoff < 0) 487 if ((int)protoff < 0)
486 return -1; 488 return -1;
487 break; 489 break;
490 }
488#endif 491#endif
489 default: 492 default:
490 BUG(); 493 BUG();
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 9a2725114e9..ce64c18b8c7 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2007-2011 Nicira Networks. 2 * Copyright (c) 2007-2012 Nicira Networks.
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public 5 * modify it under the terms of version 2 of the GNU General Public
@@ -36,7 +36,6 @@
36#include <linux/rcupdate.h> 36#include <linux/rcupdate.h>
37#include <linux/tcp.h> 37#include <linux/tcp.h>
38#include <linux/udp.h> 38#include <linux/udp.h>
39#include <linux/version.h>
40#include <linux/ethtool.h> 39#include <linux/ethtool.h>
41#include <linux/wait.h> 40#include <linux/wait.h>
42#include <asm/system.h> 41#include <asm/system.h>
@@ -1397,9 +1396,8 @@ static int ovs_dp_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
1397 int i = 0; 1396 int i = 0;
1398 1397
1399 list_for_each_entry(dp, &dps, list_node) { 1398 list_for_each_entry(dp, &dps, list_node) {
1400 if (i < skip) 1399 if (i >= skip &&
1401 continue; 1400 ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).pid,
1402 if (ovs_dp_cmd_fill_info(dp, skb, NETLINK_CB(cb->skb).pid,
1403 cb->nlh->nlmsg_seq, NLM_F_MULTI, 1401 cb->nlh->nlmsg_seq, NLM_F_MULTI,
1404 OVS_DP_CMD_NEW) < 0) 1402 OVS_DP_CMD_NEW) < 0)
1405 break; 1403 break;
diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h
index 5b9f884b705..c73370cc1f0 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -25,7 +25,6 @@
25#include <linux/netdevice.h> 25#include <linux/netdevice.h>
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <linux/u64_stats_sync.h> 27#include <linux/u64_stats_sync.h>
28#include <linux/version.h>
29 28
30#include "flow.h" 29#include "flow.h"
31 30
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index fe7f020a843..1252c3081ef 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -32,7 +32,6 @@
32#include <linux/in.h> 32#include <linux/in.h>
33#include <linux/rcupdate.h> 33#include <linux/rcupdate.h>
34#include <linux/if_arp.h> 34#include <linux/if_arp.h>
35#include <linux/if_ether.h>
36#include <linux/ip.h> 35#include <linux/ip.h>
37#include <linux/ipv6.h> 36#include <linux/ipv6.h>
38#include <linux/tcp.h> 37#include <linux/tcp.h>
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 8fc28b86f2b..322b8d20669 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -23,7 +23,6 @@
23#include <linux/etherdevice.h> 23#include <linux/etherdevice.h>
24#include <linux/ethtool.h> 24#include <linux/ethtool.h>
25#include <linux/skbuff.h> 25#include <linux/skbuff.h>
26#include <linux/version.h>
27 26
28#include "datapath.h" 27#include "datapath.h"
29#include "vport-internal_dev.h" 28#include "vport-internal_dev.h"
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 7f0ef3794c5..6c066ba25dc 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -27,7 +27,6 @@
27#include <linux/rcupdate.h> 27#include <linux/rcupdate.h>
28#include <linux/rtnetlink.h> 28#include <linux/rtnetlink.h>
29#include <linux/compat.h> 29#include <linux/compat.h>
30#include <linux/version.h>
31 30
32#include "vport.h" 31#include "vport.h"
33#include "vport-internal_dev.h" 32#include "vport-internal_dev.h"