diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-18 01:26:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-18 01:26:41 -0500 |
commit | ccb19d263fd1c9e34948e2158c53eacbff369344 (patch) | |
tree | 6683e55f183920dcbf3e1a5b749e7f9780c465b3 /drivers | |
parent | 6a488979f574cb4287880db2dbc8b13cee30c5be (diff) | |
parent | c3b5003b628d8e373262bee42c7260d6a799c73e (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
...
Diffstat (limited to 'drivers')
21 files changed, 290 insertions, 264 deletions
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index fda56bde36b8..0def898a1d15 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 |
22 | int bcma_bus_suspend(struct bcma_bus *bus); | ||
22 | int bcma_bus_resume(struct bcma_bus *bus); | 23 | int 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 443b83a2fd7a..f59244e33971 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 |
238 | static int bcma_host_pci_suspend(struct pci_dev *dev, pm_message_t state) | 238 | static 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 | ||
248 | static int bcma_host_pci_resume(struct pci_dev *dev) | 248 | static 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 */ | 256 | static 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 | ||
272 | static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = { | 266 | static 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 | ||
291 | int __init bcma_host_pci_init(void) | 284 | int __init bcma_host_pci_init(void) |
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 10f92b371e58..febbc0a1222a 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 |
244 | int 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 | |||
244 | int bcma_bus_resume(struct bcma_bus *bus) | 259 | int 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 a688b9d975a2..f99c6e312a5d 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 4df9505b67b6..2091e5dbbcdd 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 | /******************************************************************/ |
9268 | static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, | 9278 | static 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 | |||
9325 | static void bnx2x_848xx_set_led(struct bnx2x *bp, | 9341 | static 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. */ | 12371 | static 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 | ||
12403 | int 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 | ||
12386 | static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], | 12426 | static 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 44609de4e5dc..dddbcf6e154e 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 076e02a415a0..d529af99157d 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 | ||
9549 | static bool tg3_enable_msix(struct tg3 *tp) | 9551 | static 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 05b7359bde8d..6bdd8e36e564 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 | ||
266 | const struct ethtool_ops ehea_ethtool_ops = { | 266 | static 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 3554414eb5e2..5d5fb2627184 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; | |||
94 | static LIST_HEAD(adapter_list); | 94 | static LIST_HEAD(adapter_list); |
95 | static unsigned long ehea_driver_flags; | 95 | static unsigned long ehea_driver_flags; |
96 | static DEFINE_MUTEX(dlpar_mem_lock); | 96 | static DEFINE_MUTEX(dlpar_mem_lock); |
97 | struct ehea_fw_handle_array ehea_fw_handles; | 97 | static struct ehea_fw_handle_array ehea_fw_handles; |
98 | struct ehea_bcmc_reg_array ehea_bcmc_regs; | 98 | static struct ehea_bcmc_reg_array ehea_bcmc_regs; |
99 | 99 | ||
100 | 100 | ||
101 | static int __devinit ehea_probe_adapter(struct platform_device *dev, | 101 | static 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 | ||
136 | void ehea_schedule_port_reset(struct ehea_port *port) | 136 | static 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 | ||
1407 | int ehea_gen_smrs(struct ehea_port_res *pr) | 1407 | static 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 | ||
1429 | int ehea_rem_smrs(struct ehea_port_res *pr) | 1429 | static 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 | ||
2193 | int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | 2193 | static 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 | ||
2534 | int ehea_stop_qps(struct net_device *dev) | 2534 | static 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 | ||
2603 | void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res *pr) | 2603 | static 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 | ||
2636 | int ehea_restart_qps(struct net_device *dev) | 2636 | static 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 | ||
2827 | int ehea_sense_adapter_attr(struct ehea_adapter *adapter) | 2827 | static 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 | ||
2855 | int ehea_get_jumboframe_status(struct ehea_port *port, int *jumbo) | 2855 | static 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 | ||
2969 | struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | 2969 | static 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, | |||
3237 | static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port); | 3237 | static DEVICE_ATTR(probe_port, S_IWUSR, NULL, ehea_probe_port); |
3238 | static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port); | 3238 | static DEVICE_ATTR(remove_port, S_IWUSR, NULL, ehea_remove_port); |
3239 | 3239 | ||
3240 | int ehea_create_device_sysfs(struct platform_device *dev) | 3240 | static 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 | ||
3251 | void ehea_remove_device_sysfs(struct platform_device *dev) | 3251 | static 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 | ||
3382 | void ehea_crash_handler(void) | 3382 | static 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, | |||
3491 | static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH, | 3491 | static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH, |
3492 | ehea_show_capabilities, NULL); | 3492 | ehea_show_capabilities, NULL); |
3493 | 3493 | ||
3494 | int __init ehea_module_init(void) | 3494 | static 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 95b9f4fa811e..c25b05b94daa 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 | ||
37 | struct ehea_bmap *ehea_bmap = NULL; | 37 | static struct ehea_bmap *ehea_bmap; |
38 | |||
39 | |||
40 | 38 | ||
41 | static void *hw_qpageit_get_inc(struct hw_queue *queue) | 39 | static 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 | ||
215 | u64 ehea_destroy_cq_res(struct ehea_cq *cq, u64 force) | 213 | static 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 | ||
340 | u64 ehea_destroy_eq_res(struct ehea_eq *eq, u64 force) | 338 | static 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 | */ |
384 | int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue, | 382 | static 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 | ||
519 | u64 ehea_destroy_qp_res(struct ehea_qp *qp, u64 force) | 517 | static 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 | ||
979 | void print_error_data(u64 *data) | 977 | static 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 6ece4295d78f..813d41c4a845 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 88c81c5706b2..09b8c9dbf78f 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 | } |
566 | EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); | 567 | EXPORT_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 fd3f19c2e550..e196aba77acf 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 | } |
627 | EXPORT_SYMBOL(ath9k_hw_rxprocdesc); | 628 | EXPORT_SYMBOL(ath9k_hw_rxprocdesc); |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 1c6f19393efa..b91f28ef1032 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 | ||
4864 | out_unlock: | 4867 | out_unlock: |
4865 | mutex_unlock(&wl->mutex); | 4868 | mutex_unlock(&wl->mutex); |
4866 | 4869 | out: | |
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 f23b0c3e4ea3..bf11850a20f1 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 | ||
2478 | static void brcmf_delay(u32 ms) | 2478 | static __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 d106576ce338..448ab9c4eb47 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 | ||
1131 | static int brcms_pci_suspend(struct pci_dev *pdev) | 1131 | static 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 | |||
1138 | static 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 | |||
1160 | static 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 | ||
1184 | static int brcms_resume(struct bcma_device *pdev) | 1154 | static 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 | ||
1192 | static struct bcma_driver brcms_bcma_driver = { | 1160 | static struct bcma_driver brcms_bcma_driver = { |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 018a8deb88a8..4fcdac63a300 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 084aa2c4ccfb..a6454726737e 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 7becea3dec65..dd5aeaff44ba 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 4941a1a23219..dc88baefa72e 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) | |||
422 | static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, | 422 | static 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, ®); | 438 | reg = 0; |
440 | rt2x00_set_field32(®, INT_MASK_CSR_RXDELAYINT, 0); | 439 | if (state == STATE_RADIO_IRQ_ON) { |
441 | rt2x00_set_field32(®, INT_MASK_CSR_TXDELAYINT, 0); | 440 | rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, 1); |
442 | rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, mask); | 441 | rt2x00_set_field32(®, INT_MASK_CSR_TBTT, 1); |
443 | rt2x00_set_field32(®, INT_MASK_CSR_AC0_DMA_DONE, 0); | 442 | rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, 1); |
444 | rt2x00_set_field32(®, INT_MASK_CSR_AC1_DMA_DONE, 0); | 443 | rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, 1); |
445 | rt2x00_set_field32(®, INT_MASK_CSR_AC2_DMA_DONE, 0); | 444 | rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, 1); |
446 | rt2x00_set_field32(®, INT_MASK_CSR_AC3_DMA_DONE, 0); | 445 | } |
447 | rt2x00_set_field32(®, INT_MASK_CSR_HCCA_DMA_DONE, 0); | ||
448 | rt2x00_set_field32(®, INT_MASK_CSR_MGMT_DMA_DONE, 0); | ||
449 | rt2x00_set_field32(®, INT_MASK_CSR_MCU_COMMAND, 0); | ||
450 | rt2x00_set_field32(®, INT_MASK_CSR_RXTX_COHERENT, 0); | ||
451 | rt2x00_set_field32(®, INT_MASK_CSR_TBTT, mask); | ||
452 | rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, mask); | ||
453 | rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, mask); | ||
454 | rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, mask); | ||
455 | rt2x00_set_field32(®, INT_MASK_CSR_GPTIMER, 0); | ||
456 | rt2x00_set_field32(®, INT_MASK_CSR_RX_COHERENT, 0); | ||
457 | rt2x00_set_field32(®, 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 882a51fe7b3c..9dab1f51dd43 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 | ||
858 | static struct miscdevice vhost_net_misc = { | 858 | static 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 | ||
864 | static int vhost_net_init(void) | 864 | static int vhost_net_init(void) |
@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1"); | |||
879 | MODULE_LICENSE("GPL v2"); | 879 | MODULE_LICENSE("GPL v2"); |
880 | MODULE_AUTHOR("Michael S. Tsirkin"); | 880 | MODULE_AUTHOR("Michael S. Tsirkin"); |
881 | MODULE_DESCRIPTION("Host kernel accelerator for virtio net"); | 881 | MODULE_DESCRIPTION("Host kernel accelerator for virtio net"); |
882 | MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR); | ||
883 | MODULE_ALIAS("devname:vhost-net"); | ||