diff options
Diffstat (limited to 'drivers/net')
47 files changed, 620 insertions, 157 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index f749b40f954..11f143f4adf 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -2010,9 +2010,13 @@ config IGB_LRO | |||
| 2010 | If in doubt, say N. | 2010 | If in doubt, say N. |
| 2011 | 2011 | ||
| 2012 | config IGB_DCA | 2012 | config IGB_DCA |
| 2013 | bool "Enable DCA" | 2013 | bool "Direct Cache Access (DCA) Support" |
| 2014 | default y | 2014 | default y |
| 2015 | depends on IGB && DCA && !(IGB=y && DCA=m) | 2015 | depends on IGB && DCA && !(IGB=y && DCA=m) |
| 2016 | ---help--- | ||
| 2017 | Say Y here if you want to use Direct Cache Access (DCA) in the | ||
| 2018 | driver. DCA is a method for warming the CPU cache before data | ||
| 2019 | is used, with the intent of lessening the impact of cache misses. | ||
| 2016 | 2020 | ||
| 2017 | source "drivers/net/ixp2000/Kconfig" | 2021 | source "drivers/net/ixp2000/Kconfig" |
| 2018 | 2022 | ||
| @@ -2437,9 +2441,13 @@ config IXGBE | |||
| 2437 | will be called ixgbe. | 2441 | will be called ixgbe. |
| 2438 | 2442 | ||
| 2439 | config IXGBE_DCA | 2443 | config IXGBE_DCA |
| 2440 | bool | 2444 | bool "Direct Cache Access (DCA) Support" |
| 2441 | default y | 2445 | default y |
| 2442 | depends on IXGBE && DCA && !(IXGBE=y && DCA=m) | 2446 | depends on IXGBE && DCA && !(IXGBE=y && DCA=m) |
| 2447 | ---help--- | ||
| 2448 | Say Y here if you want to use Direct Cache Access (DCA) in the | ||
| 2449 | driver. DCA is a method for warming the CPU cache before data | ||
| 2450 | is used, with the intent of lessening the impact of cache misses. | ||
| 2443 | 2451 | ||
| 2444 | config IXGB | 2452 | config IXGB |
| 2445 | tristate "Intel(R) PRO/10GbE support" | 2453 | tristate "Intel(R) PRO/10GbE support" |
| @@ -2489,9 +2497,13 @@ config MYRI10GE | |||
| 2489 | will be called myri10ge. | 2497 | will be called myri10ge. |
| 2490 | 2498 | ||
| 2491 | config MYRI10GE_DCA | 2499 | config MYRI10GE_DCA |
| 2492 | bool | 2500 | bool "Direct Cache Access (DCA) Support" |
| 2493 | default y | 2501 | default y |
| 2494 | depends on MYRI10GE && DCA && !(MYRI10GE=y && DCA=m) | 2502 | depends on MYRI10GE && DCA && !(MYRI10GE=y && DCA=m) |
| 2503 | ---help--- | ||
| 2504 | Say Y here if you want to use Direct Cache Access (DCA) in the | ||
| 2505 | driver. DCA is a method for warming the CPU cache before data | ||
| 2506 | is used, with the intent of lessening the impact of cache misses. | ||
| 2495 | 2507 | ||
| 2496 | config NETXEN_NIC | 2508 | config NETXEN_NIC |
| 2497 | tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC" | 2509 | tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC" |
diff --git a/drivers/net/atl1e/atl1e.h b/drivers/net/atl1e/atl1e.h index b645fa0f3f6..c49550d507a 100644 --- a/drivers/net/atl1e/atl1e.h +++ b/drivers/net/atl1e/atl1e.h | |||
| @@ -46,7 +46,6 @@ | |||
| 46 | #include <linux/vmalloc.h> | 46 | #include <linux/vmalloc.h> |
| 47 | #include <linux/pagemap.h> | 47 | #include <linux/pagemap.h> |
| 48 | #include <linux/tcp.h> | 48 | #include <linux/tcp.h> |
| 49 | #include <linux/mii.h> | ||
| 50 | #include <linux/ethtool.h> | 49 | #include <linux/ethtool.h> |
| 51 | #include <linux/if_vlan.h> | 50 | #include <linux/if_vlan.h> |
| 52 | #include <linux/workqueue.h> | 51 | #include <linux/workqueue.h> |
diff --git a/drivers/net/atl1e/atl1e_hw.c b/drivers/net/atl1e/atl1e_hw.c index 8cbc1b59bd6..4a770062011 100644 --- a/drivers/net/atl1e/atl1e_hw.c +++ b/drivers/net/atl1e/atl1e_hw.c | |||
| @@ -163,9 +163,6 @@ int atl1e_read_mac_addr(struct atl1e_hw *hw) | |||
| 163 | * atl1e_hash_mc_addr | 163 | * atl1e_hash_mc_addr |
| 164 | * purpose | 164 | * purpose |
| 165 | * set hash value for a multicast address | 165 | * set hash value for a multicast address |
| 166 | * hash calcu processing : | ||
| 167 | * 1. calcu 32bit CRC for multicast address | ||
| 168 | * 2. reverse crc with MSB to LSB | ||
| 169 | */ | 166 | */ |
| 170 | u32 atl1e_hash_mc_addr(struct atl1e_hw *hw, u8 *mc_addr) | 167 | u32 atl1e_hash_mc_addr(struct atl1e_hw *hw, u8 *mc_addr) |
| 171 | { | 168 | { |
| @@ -174,7 +171,6 @@ u32 atl1e_hash_mc_addr(struct atl1e_hw *hw, u8 *mc_addr) | |||
| 174 | int i; | 171 | int i; |
| 175 | 172 | ||
| 176 | crc32 = ether_crc_le(6, mc_addr); | 173 | crc32 = ether_crc_le(6, mc_addr); |
| 177 | crc32 = ~crc32; | ||
| 178 | for (i = 0; i < 32; i++) | 174 | for (i = 0; i < 32; i++) |
| 179 | value |= (((crc32 >> i) & 1) << (31 - i)); | 175 | value |= (((crc32 >> i) & 1) << (31 - i)); |
| 180 | 176 | ||
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 246d92b4263..aef403d299e 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
| @@ -3404,14 +3404,8 @@ static void atl1_get_wol(struct net_device *netdev, | |||
| 3404 | { | 3404 | { |
| 3405 | struct atl1_adapter *adapter = netdev_priv(netdev); | 3405 | struct atl1_adapter *adapter = netdev_priv(netdev); |
| 3406 | 3406 | ||
| 3407 | wol->supported = WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC; | 3407 | wol->supported = WAKE_MAGIC; |
| 3408 | wol->wolopts = 0; | 3408 | wol->wolopts = 0; |
| 3409 | if (adapter->wol & ATLX_WUFC_EX) | ||
| 3410 | wol->wolopts |= WAKE_UCAST; | ||
| 3411 | if (adapter->wol & ATLX_WUFC_MC) | ||
| 3412 | wol->wolopts |= WAKE_MCAST; | ||
| 3413 | if (adapter->wol & ATLX_WUFC_BC) | ||
| 3414 | wol->wolopts |= WAKE_BCAST; | ||
| 3415 | if (adapter->wol & ATLX_WUFC_MAG) | 3409 | if (adapter->wol & ATLX_WUFC_MAG) |
| 3416 | wol->wolopts |= WAKE_MAGIC; | 3410 | wol->wolopts |= WAKE_MAGIC; |
| 3417 | return; | 3411 | return; |
| @@ -3422,15 +3416,10 @@ static int atl1_set_wol(struct net_device *netdev, | |||
| 3422 | { | 3416 | { |
| 3423 | struct atl1_adapter *adapter = netdev_priv(netdev); | 3417 | struct atl1_adapter *adapter = netdev_priv(netdev); |
| 3424 | 3418 | ||
| 3425 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) | 3419 | if (wol->wolopts & (WAKE_PHY | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | |
| 3420 | WAKE_ARP | WAKE_MAGICSECURE)) | ||
| 3426 | return -EOPNOTSUPP; | 3421 | return -EOPNOTSUPP; |
| 3427 | adapter->wol = 0; | 3422 | adapter->wol = 0; |
| 3428 | if (wol->wolopts & WAKE_UCAST) | ||
| 3429 | adapter->wol |= ATLX_WUFC_EX; | ||
| 3430 | if (wol->wolopts & WAKE_MCAST) | ||
| 3431 | adapter->wol |= ATLX_WUFC_MC; | ||
| 3432 | if (wol->wolopts & WAKE_BCAST) | ||
| 3433 | adapter->wol |= ATLX_WUFC_BC; | ||
| 3434 | if (wol->wolopts & WAKE_MAGIC) | 3423 | if (wol->wolopts & WAKE_MAGIC) |
| 3435 | adapter->wol |= ATLX_WUFC_MAG; | 3424 | adapter->wol |= ATLX_WUFC_MAG; |
| 3436 | return 0; | 3425 | return 0; |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 430d430bce2..d07e3f14895 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
| @@ -7204,10 +7204,13 @@ static void | |||
| 7204 | poll_bnx2(struct net_device *dev) | 7204 | poll_bnx2(struct net_device *dev) |
| 7205 | { | 7205 | { |
| 7206 | struct bnx2 *bp = netdev_priv(dev); | 7206 | struct bnx2 *bp = netdev_priv(dev); |
| 7207 | int i; | ||
| 7207 | 7208 | ||
| 7208 | disable_irq(bp->pdev->irq); | 7209 | for (i = 0; i < bp->irq_nvecs; i++) { |
| 7209 | bnx2_interrupt(bp->pdev->irq, dev); | 7210 | disable_irq(bp->irq_tbl[i].vector); |
| 7210 | enable_irq(bp->pdev->irq); | 7211 | bnx2_interrupt(bp->irq_tbl[i].vector, &bp->bnx2_napi[i]); |
| 7212 | enable_irq(bp->irq_tbl[i].vector); | ||
| 7213 | } | ||
| 7211 | } | 7214 | } |
| 7212 | #endif | 7215 | #endif |
| 7213 | 7216 | ||
diff --git a/drivers/net/bnx2x_init.h b/drivers/net/bnx2x_init.h index 130927cfc75..a6c0b3abba2 100644 --- a/drivers/net/bnx2x_init.h +++ b/drivers/net/bnx2x_init.h | |||
| @@ -564,14 +564,15 @@ static const struct arb_line write_arb_addr[NUM_WR_Q-1] = { | |||
| 564 | 564 | ||
| 565 | static void bnx2x_init_pxp(struct bnx2x *bp) | 565 | static void bnx2x_init_pxp(struct bnx2x *bp) |
| 566 | { | 566 | { |
| 567 | u16 devctl; | ||
| 567 | int r_order, w_order; | 568 | int r_order, w_order; |
| 568 | u32 val, i; | 569 | u32 val, i; |
| 569 | 570 | ||
| 570 | pci_read_config_word(bp->pdev, | 571 | pci_read_config_word(bp->pdev, |
| 571 | bp->pcie_cap + PCI_EXP_DEVCTL, (u16 *)&val); | 572 | bp->pcie_cap + PCI_EXP_DEVCTL, &devctl); |
| 572 | DP(NETIF_MSG_HW, "read 0x%x from devctl\n", (u16)val); | 573 | DP(NETIF_MSG_HW, "read 0x%x from devctl\n", devctl); |
| 573 | w_order = ((val & PCI_EXP_DEVCTL_PAYLOAD) >> 5); | 574 | w_order = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5); |
| 574 | r_order = ((val & PCI_EXP_DEVCTL_READRQ) >> 12); | 575 | r_order = ((devctl & PCI_EXP_DEVCTL_READRQ) >> 12); |
| 575 | 576 | ||
| 576 | if (r_order > MAX_RD_ORD) { | 577 | if (r_order > MAX_RD_ORD) { |
| 577 | DP(NETIF_MSG_HW, "read order of %d order adjusted to %d\n", | 578 | DP(NETIF_MSG_HW, "read order of %d order adjusted to %d\n", |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index fce745148ff..600210d7eff 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
| @@ -59,8 +59,8 @@ | |||
| 59 | #include "bnx2x.h" | 59 | #include "bnx2x.h" |
| 60 | #include "bnx2x_init.h" | 60 | #include "bnx2x_init.h" |
| 61 | 61 | ||
| 62 | #define DRV_MODULE_VERSION "1.45.22" | 62 | #define DRV_MODULE_VERSION "1.45.23" |
| 63 | #define DRV_MODULE_RELDATE "2008/09/09" | 63 | #define DRV_MODULE_RELDATE "2008/11/03" |
| 64 | #define BNX2X_BC_VER 0x040200 | 64 | #define BNX2X_BC_VER 0x040200 |
| 65 | 65 | ||
| 66 | /* Time in jiffies before concluding the transmitter is hung */ | 66 | /* Time in jiffies before concluding the transmitter is hung */ |
| @@ -6481,6 +6481,7 @@ load_int_disable: | |||
| 6481 | bnx2x_free_irq(bp); | 6481 | bnx2x_free_irq(bp); |
| 6482 | load_error: | 6482 | load_error: |
| 6483 | bnx2x_free_mem(bp); | 6483 | bnx2x_free_mem(bp); |
| 6484 | bp->port.pmf = 0; | ||
| 6484 | 6485 | ||
| 6485 | /* TBD we really need to reset the chip | 6486 | /* TBD we really need to reset the chip |
| 6486 | if we want to recover from this */ | 6487 | if we want to recover from this */ |
| @@ -6791,6 +6792,7 @@ unload_error: | |||
| 6791 | /* Report UNLOAD_DONE to MCP */ | 6792 | /* Report UNLOAD_DONE to MCP */ |
| 6792 | if (!BP_NOMCP(bp)) | 6793 | if (!BP_NOMCP(bp)) |
| 6793 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); | 6794 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); |
| 6795 | bp->port.pmf = 0; | ||
| 6794 | 6796 | ||
| 6795 | /* Free SKBs, SGEs, TPA pool and driver internals */ | 6797 | /* Free SKBs, SGEs, TPA pool and driver internals */ |
| 6796 | bnx2x_free_skbs(bp); | 6798 | bnx2x_free_skbs(bp); |
| @@ -10204,8 +10206,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
| 10204 | return -ENOMEM; | 10206 | return -ENOMEM; |
| 10205 | } | 10207 | } |
| 10206 | 10208 | ||
| 10207 | netif_carrier_off(dev); | ||
| 10208 | |||
| 10209 | bp = netdev_priv(dev); | 10209 | bp = netdev_priv(dev); |
| 10210 | bp->msglevel = debug; | 10210 | bp->msglevel = debug; |
| 10211 | 10211 | ||
| @@ -10229,6 +10229,8 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
| 10229 | goto init_one_exit; | 10229 | goto init_one_exit; |
| 10230 | } | 10230 | } |
| 10231 | 10231 | ||
| 10232 | netif_carrier_off(dev); | ||
| 10233 | |||
| 10232 | bp->common.name = board_info[ent->driver_data].name; | 10234 | bp->common.name = board_info[ent->driver_data].name; |
| 10233 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," | 10235 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," |
| 10234 | " IRQ %d, ", dev->name, bp->common.name, | 10236 | " IRQ %d, ", dev->name, bp->common.name, |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 1ace41a13ac..2c341f83d32 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
| @@ -1307,8 +1307,10 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | |||
| 1307 | u32 fw_vers = 0; | 1307 | u32 fw_vers = 0; |
| 1308 | u32 tp_vers = 0; | 1308 | u32 tp_vers = 0; |
| 1309 | 1309 | ||
| 1310 | spin_lock(&adapter->stats_lock); | ||
| 1310 | t3_get_fw_version(adapter, &fw_vers); | 1311 | t3_get_fw_version(adapter, &fw_vers); |
| 1311 | t3_get_tp_version(adapter, &tp_vers); | 1312 | t3_get_tp_version(adapter, &tp_vers); |
| 1313 | spin_unlock(&adapter->stats_lock); | ||
| 1312 | 1314 | ||
| 1313 | strcpy(info->driver, DRV_NAME); | 1315 | strcpy(info->driver, DRV_NAME); |
| 1314 | strcpy(info->version, DRV_VERSION); | 1316 | strcpy(info->version, DRV_VERSION); |
| @@ -2699,7 +2701,7 @@ static void set_nqsets(struct adapter *adap) | |||
| 2699 | int hwports = adap->params.nports; | 2701 | int hwports = adap->params.nports; |
| 2700 | int nqsets = SGE_QSETS; | 2702 | int nqsets = SGE_QSETS; |
| 2701 | 2703 | ||
| 2702 | if (adap->params.rev > 0) { | 2704 | if (adap->params.rev > 0 && adap->flags & USING_MSIX) { |
| 2703 | if (hwports == 2 && | 2705 | if (hwports == 2 && |
| 2704 | (hwports * nqsets > SGE_QSETS || | 2706 | (hwports * nqsets > SGE_QSETS || |
| 2705 | num_cpus >= nqsets / hwports)) | 2707 | num_cpus >= nqsets / hwports)) |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index 968f64be374..9a0898b0dbc 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
| @@ -572,7 +572,7 @@ struct t3_vpd { | |||
| 572 | u32 pad; /* for multiple-of-4 sizing and alignment */ | 572 | u32 pad; /* for multiple-of-4 sizing and alignment */ |
| 573 | }; | 573 | }; |
| 574 | 574 | ||
| 575 | #define EEPROM_MAX_POLL 4 | 575 | #define EEPROM_MAX_POLL 40 |
| 576 | #define EEPROM_STAT_ADDR 0x4000 | 576 | #define EEPROM_STAT_ADDR 0x4000 |
| 577 | #define VPD_BASE 0xc00 | 577 | #define VPD_BASE 0xc00 |
| 578 | 578 | ||
| @@ -3690,6 +3690,12 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, | |||
| 3690 | ; | 3690 | ; |
| 3691 | 3691 | ||
| 3692 | pti = &port_types[adapter->params.vpd.port_type[j]]; | 3692 | pti = &port_types[adapter->params.vpd.port_type[j]]; |
| 3693 | if (!pti->phy_prep) { | ||
| 3694 | CH_ALERT(adapter, "Invalid port type index %d\n", | ||
| 3695 | adapter->params.vpd.port_type[j]); | ||
| 3696 | return -EINVAL; | ||
| 3697 | } | ||
| 3698 | |||
| 3693 | ret = pti->phy_prep(&p->phy, adapter, ai->phy_base_addr + j, | 3699 | ret = pti->phy_prep(&p->phy, adapter, ai->phy_base_addr + j, |
| 3694 | ai->mdio_ops); | 3700 | ai->mdio_ops); |
| 3695 | if (ret) | 3701 | if (ret) |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 3d69fae781c..e8bfcce6b31 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
| @@ -166,7 +166,7 @@ | |||
| 166 | 166 | ||
| 167 | #define DRV_NAME "e100" | 167 | #define DRV_NAME "e100" |
| 168 | #define DRV_EXT "-NAPI" | 168 | #define DRV_EXT "-NAPI" |
| 169 | #define DRV_VERSION "3.5.23-k4"DRV_EXT | 169 | #define DRV_VERSION "3.5.23-k6"DRV_EXT |
| 170 | #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" | 170 | #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" |
| 171 | #define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation" | 171 | #define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation" |
| 172 | #define PFX DRV_NAME ": " | 172 | #define PFX DRV_NAME ": " |
| @@ -1804,7 +1804,7 @@ static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) | |||
| 1804 | struct rfd *prev_rfd = (struct rfd *)rx->prev->skb->data; | 1804 | struct rfd *prev_rfd = (struct rfd *)rx->prev->skb->data; |
| 1805 | put_unaligned_le32(rx->dma_addr, &prev_rfd->link); | 1805 | put_unaligned_le32(rx->dma_addr, &prev_rfd->link); |
| 1806 | pci_dma_sync_single_for_device(nic->pdev, rx->prev->dma_addr, | 1806 | pci_dma_sync_single_for_device(nic->pdev, rx->prev->dma_addr, |
| 1807 | sizeof(struct rfd), PCI_DMA_TODEVICE); | 1807 | sizeof(struct rfd), PCI_DMA_BIDIRECTIONAL); |
| 1808 | } | 1808 | } |
| 1809 | 1809 | ||
| 1810 | return 0; | 1810 | return 0; |
| @@ -1823,7 +1823,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
| 1823 | 1823 | ||
| 1824 | /* Need to sync before taking a peek at cb_complete bit */ | 1824 | /* Need to sync before taking a peek at cb_complete bit */ |
| 1825 | pci_dma_sync_single_for_cpu(nic->pdev, rx->dma_addr, | 1825 | pci_dma_sync_single_for_cpu(nic->pdev, rx->dma_addr, |
| 1826 | sizeof(struct rfd), PCI_DMA_FROMDEVICE); | 1826 | sizeof(struct rfd), PCI_DMA_BIDIRECTIONAL); |
| 1827 | rfd_status = le16_to_cpu(rfd->status); | 1827 | rfd_status = le16_to_cpu(rfd->status); |
| 1828 | 1828 | ||
| 1829 | DPRINTK(RX_STATUS, DEBUG, "status=0x%04X\n", rfd_status); | 1829 | DPRINTK(RX_STATUS, DEBUG, "status=0x%04X\n", rfd_status); |
| @@ -1850,7 +1850,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
| 1850 | 1850 | ||
| 1851 | /* Get data */ | 1851 | /* Get data */ |
| 1852 | pci_unmap_single(nic->pdev, rx->dma_addr, | 1852 | pci_unmap_single(nic->pdev, rx->dma_addr, |
| 1853 | RFD_BUF_LEN, PCI_DMA_FROMDEVICE); | 1853 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); |
| 1854 | 1854 | ||
| 1855 | /* If this buffer has the el bit, but we think the receiver | 1855 | /* If this buffer has the el bit, but we think the receiver |
| 1856 | * is still running, check to see if it really stopped while | 1856 | * is still running, check to see if it really stopped while |
| @@ -1943,7 +1943,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done, | |||
| 1943 | new_before_last_rfd->command |= cpu_to_le16(cb_el); | 1943 | new_before_last_rfd->command |= cpu_to_le16(cb_el); |
| 1944 | pci_dma_sync_single_for_device(nic->pdev, | 1944 | pci_dma_sync_single_for_device(nic->pdev, |
| 1945 | new_before_last_rx->dma_addr, sizeof(struct rfd), | 1945 | new_before_last_rx->dma_addr, sizeof(struct rfd), |
| 1946 | PCI_DMA_TODEVICE); | 1946 | PCI_DMA_BIDIRECTIONAL); |
| 1947 | 1947 | ||
| 1948 | /* Now that we have a new stopping point, we can clear the old | 1948 | /* Now that we have a new stopping point, we can clear the old |
| 1949 | * stopping point. We must sync twice to get the proper | 1949 | * stopping point. We must sync twice to get the proper |
| @@ -1951,11 +1951,11 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done, | |||
| 1951 | old_before_last_rfd->command &= ~cpu_to_le16(cb_el); | 1951 | old_before_last_rfd->command &= ~cpu_to_le16(cb_el); |
| 1952 | pci_dma_sync_single_for_device(nic->pdev, | 1952 | pci_dma_sync_single_for_device(nic->pdev, |
| 1953 | old_before_last_rx->dma_addr, sizeof(struct rfd), | 1953 | old_before_last_rx->dma_addr, sizeof(struct rfd), |
| 1954 | PCI_DMA_TODEVICE); | 1954 | PCI_DMA_BIDIRECTIONAL); |
| 1955 | old_before_last_rfd->size = cpu_to_le16(VLAN_ETH_FRAME_LEN); | 1955 | old_before_last_rfd->size = cpu_to_le16(VLAN_ETH_FRAME_LEN); |
| 1956 | pci_dma_sync_single_for_device(nic->pdev, | 1956 | pci_dma_sync_single_for_device(nic->pdev, |
| 1957 | old_before_last_rx->dma_addr, sizeof(struct rfd), | 1957 | old_before_last_rx->dma_addr, sizeof(struct rfd), |
| 1958 | PCI_DMA_TODEVICE); | 1958 | PCI_DMA_BIDIRECTIONAL); |
| 1959 | } | 1959 | } |
| 1960 | 1960 | ||
| 1961 | if(restart_required) { | 1961 | if(restart_required) { |
| @@ -1978,7 +1978,7 @@ static void e100_rx_clean_list(struct nic *nic) | |||
| 1978 | for(rx = nic->rxs, i = 0; i < count; rx++, i++) { | 1978 | for(rx = nic->rxs, i = 0; i < count; rx++, i++) { |
| 1979 | if(rx->skb) { | 1979 | if(rx->skb) { |
| 1980 | pci_unmap_single(nic->pdev, rx->dma_addr, | 1980 | pci_unmap_single(nic->pdev, rx->dma_addr, |
| 1981 | RFD_BUF_LEN, PCI_DMA_FROMDEVICE); | 1981 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); |
| 1982 | dev_kfree_skb(rx->skb); | 1982 | dev_kfree_skb(rx->skb); |
| 1983 | } | 1983 | } |
| 1984 | } | 1984 | } |
| @@ -2021,7 +2021,7 @@ static int e100_rx_alloc_list(struct nic *nic) | |||
| 2021 | before_last->command |= cpu_to_le16(cb_el); | 2021 | before_last->command |= cpu_to_le16(cb_el); |
| 2022 | before_last->size = 0; | 2022 | before_last->size = 0; |
| 2023 | pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, | 2023 | pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, |
| 2024 | sizeof(struct rfd), PCI_DMA_TODEVICE); | 2024 | sizeof(struct rfd), PCI_DMA_BIDIRECTIONAL); |
| 2025 | 2025 | ||
| 2026 | nic->rx_to_use = nic->rx_to_clean = nic->rxs; | 2026 | nic->rx_to_use = nic->rx_to_clean = nic->rxs; |
| 2027 | nic->ru_running = RU_SUSPENDED; | 2027 | nic->ru_running = RU_SUSPENDED; |
| @@ -2222,7 +2222,7 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode) | |||
| 2222 | msleep(10); | 2222 | msleep(10); |
| 2223 | 2223 | ||
| 2224 | pci_dma_sync_single_for_cpu(nic->pdev, nic->rx_to_clean->dma_addr, | 2224 | pci_dma_sync_single_for_cpu(nic->pdev, nic->rx_to_clean->dma_addr, |
| 2225 | RFD_BUF_LEN, PCI_DMA_FROMDEVICE); | 2225 | RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL); |
| 2226 | 2226 | ||
| 2227 | if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd), | 2227 | if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd), |
| 2228 | skb->data, ETH_DATA_LEN)) | 2228 | skb->data, ETH_DATA_LEN)) |
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index 6a3893acfe0..c854c96f5ab 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
| @@ -1774,7 +1774,8 @@ static void e1000_get_wol(struct net_device *netdev, | |||
| 1774 | 1774 | ||
| 1775 | /* this function will set ->supported = 0 and return 1 if wol is not | 1775 | /* this function will set ->supported = 0 and return 1 if wol is not |
| 1776 | * supported by this hardware */ | 1776 | * supported by this hardware */ |
| 1777 | if (e1000_wol_exclusion(adapter, wol)) | 1777 | if (e1000_wol_exclusion(adapter, wol) || |
| 1778 | !device_can_wakeup(&adapter->pdev->dev)) | ||
| 1778 | return; | 1779 | return; |
| 1779 | 1780 | ||
| 1780 | /* apply any specific unsupported masks here */ | 1781 | /* apply any specific unsupported masks here */ |
| @@ -1811,7 +1812,8 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 1811 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) | 1812 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) |
| 1812 | return -EOPNOTSUPP; | 1813 | return -EOPNOTSUPP; |
| 1813 | 1814 | ||
| 1814 | if (e1000_wol_exclusion(adapter, wol)) | 1815 | if (e1000_wol_exclusion(adapter, wol) || |
| 1816 | !device_can_wakeup(&adapter->pdev->dev)) | ||
| 1815 | return wol->wolopts ? -EOPNOTSUPP : 0; | 1817 | return wol->wolopts ? -EOPNOTSUPP : 0; |
| 1816 | 1818 | ||
| 1817 | switch (hw->device_id) { | 1819 | switch (hw->device_id) { |
| @@ -1838,6 +1840,8 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 1838 | if (wol->wolopts & WAKE_MAGIC) | 1840 | if (wol->wolopts & WAKE_MAGIC) |
| 1839 | adapter->wol |= E1000_WUFC_MAG; | 1841 | adapter->wol |= E1000_WUFC_MAG; |
| 1840 | 1842 | ||
| 1843 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 1844 | |||
| 1841 | return 0; | 1845 | return 0; |
| 1842 | } | 1846 | } |
| 1843 | 1847 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index fac82152e4c..872799b746f 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
| @@ -1179,6 +1179,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
| 1179 | 1179 | ||
| 1180 | /* initialize the wol settings based on the eeprom settings */ | 1180 | /* initialize the wol settings based on the eeprom settings */ |
| 1181 | adapter->wol = adapter->eeprom_wol; | 1181 | adapter->wol = adapter->eeprom_wol; |
| 1182 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 1182 | 1183 | ||
| 1183 | /* print bus type/speed/width info */ | 1184 | /* print bus type/speed/width info */ |
| 1184 | DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ", | 1185 | DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ", |
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index c55de1c027a..c55fd6fdb91 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
| @@ -299,6 +299,7 @@ struct e1000_adapter { | |||
| 299 | unsigned long led_status; | 299 | unsigned long led_status; |
| 300 | 300 | ||
| 301 | unsigned int flags; | 301 | unsigned int flags; |
| 302 | unsigned int flags2; | ||
| 302 | struct work_struct downshift_task; | 303 | struct work_struct downshift_task; |
| 303 | struct work_struct update_phy_task; | 304 | struct work_struct update_phy_task; |
| 304 | }; | 305 | }; |
| @@ -306,6 +307,7 @@ struct e1000_adapter { | |||
| 306 | struct e1000_info { | 307 | struct e1000_info { |
| 307 | enum e1000_mac_type mac; | 308 | enum e1000_mac_type mac; |
| 308 | unsigned int flags; | 309 | unsigned int flags; |
| 310 | unsigned int flags2; | ||
| 309 | u32 pba; | 311 | u32 pba; |
| 310 | s32 (*get_variants)(struct e1000_adapter *); | 312 | s32 (*get_variants)(struct e1000_adapter *); |
| 311 | struct e1000_mac_operations *mac_ops; | 313 | struct e1000_mac_operations *mac_ops; |
| @@ -347,6 +349,9 @@ struct e1000_info { | |||
| 347 | #define FLAG_RX_RESTART_NOW (1 << 30) | 349 | #define FLAG_RX_RESTART_NOW (1 << 30) |
| 348 | #define FLAG_MSI_TEST_FAILED (1 << 31) | 350 | #define FLAG_MSI_TEST_FAILED (1 << 31) |
| 349 | 351 | ||
| 352 | /* CRC Stripping defines */ | ||
| 353 | #define FLAG2_CRC_STRIPPING (1 << 0) | ||
| 354 | |||
| 350 | #define E1000_RX_DESC_PS(R, i) \ | 355 | #define E1000_RX_DESC_PS(R, i) \ |
| 351 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) | 356 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) |
| 352 | #define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) | 357 | #define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) |
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 70c11c811a0..62421ce9631 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
| @@ -1713,7 +1713,8 @@ static void e1000_get_wol(struct net_device *netdev, | |||
| 1713 | wol->supported = 0; | 1713 | wol->supported = 0; |
| 1714 | wol->wolopts = 0; | 1714 | wol->wolopts = 0; |
| 1715 | 1715 | ||
| 1716 | if (!(adapter->flags & FLAG_HAS_WOL)) | 1716 | if (!(adapter->flags & FLAG_HAS_WOL) || |
| 1717 | !device_can_wakeup(&adapter->pdev->dev)) | ||
| 1717 | return; | 1718 | return; |
| 1718 | 1719 | ||
| 1719 | wol->supported = WAKE_UCAST | WAKE_MCAST | | 1720 | wol->supported = WAKE_UCAST | WAKE_MCAST | |
| @@ -1751,7 +1752,8 @@ static int e1000_set_wol(struct net_device *netdev, | |||
| 1751 | if (wol->wolopts & WAKE_MAGICSECURE) | 1752 | if (wol->wolopts & WAKE_MAGICSECURE) |
| 1752 | return -EOPNOTSUPP; | 1753 | return -EOPNOTSUPP; |
| 1753 | 1754 | ||
| 1754 | if (!(adapter->flags & FLAG_HAS_WOL)) | 1755 | if (!(adapter->flags & FLAG_HAS_WOL) || |
| 1756 | !device_can_wakeup(&adapter->pdev->dev)) | ||
| 1755 | return wol->wolopts ? -EOPNOTSUPP : 0; | 1757 | return wol->wolopts ? -EOPNOTSUPP : 0; |
| 1756 | 1758 | ||
| 1757 | /* these settings will always override what we currently have */ | 1759 | /* these settings will always override what we currently have */ |
| @@ -1770,6 +1772,8 @@ static int e1000_set_wol(struct net_device *netdev, | |||
| 1770 | if (wol->wolopts & WAKE_ARP) | 1772 | if (wol->wolopts & WAKE_ARP) |
| 1771 | adapter->wol |= E1000_WUFC_ARP; | 1773 | adapter->wol |= E1000_WUFC_ARP; |
| 1772 | 1774 | ||
| 1775 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 1776 | |||
| 1773 | return 0; | 1777 | return 0; |
| 1774 | } | 1778 | } |
| 1775 | 1779 | ||
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index abd492b7336..91795f78c3e 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
| @@ -499,6 +499,10 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
| 499 | goto next_desc; | 499 | goto next_desc; |
| 500 | } | 500 | } |
| 501 | 501 | ||
| 502 | /* adjust length to remove Ethernet CRC */ | ||
| 503 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | ||
| 504 | length -= 4; | ||
| 505 | |||
| 502 | total_rx_bytes += length; | 506 | total_rx_bytes += length; |
| 503 | total_rx_packets++; | 507 | total_rx_packets++; |
| 504 | 508 | ||
| @@ -804,6 +808,10 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
| 804 | pci_dma_sync_single_for_device(pdev, ps_page->dma, | 808 | pci_dma_sync_single_for_device(pdev, ps_page->dma, |
| 805 | PAGE_SIZE, PCI_DMA_FROMDEVICE); | 809 | PAGE_SIZE, PCI_DMA_FROMDEVICE); |
| 806 | 810 | ||
| 811 | /* remove the CRC */ | ||
| 812 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | ||
| 813 | l1 -= 4; | ||
| 814 | |||
| 807 | skb_put(skb, l1); | 815 | skb_put(skb, l1); |
| 808 | goto copydone; | 816 | goto copydone; |
| 809 | } /* if */ | 817 | } /* if */ |
| @@ -825,6 +833,12 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
| 825 | skb->truesize += length; | 833 | skb->truesize += length; |
| 826 | } | 834 | } |
| 827 | 835 | ||
| 836 | /* strip the ethernet crc, problem is we're using pages now so | ||
| 837 | * this whole operation can get a little cpu intensive | ||
| 838 | */ | ||
| 839 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | ||
| 840 | pskb_trim(skb, skb->len - 4); | ||
| 841 | |||
| 828 | copydone: | 842 | copydone: |
| 829 | total_rx_bytes += skb->len; | 843 | total_rx_bytes += skb->len; |
| 830 | total_rx_packets++; | 844 | total_rx_packets++; |
| @@ -2301,8 +2315,12 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
| 2301 | else | 2315 | else |
| 2302 | rctl |= E1000_RCTL_LPE; | 2316 | rctl |= E1000_RCTL_LPE; |
| 2303 | 2317 | ||
| 2304 | /* Enable hardware CRC frame stripping */ | 2318 | /* Some systems expect that the CRC is included in SMBUS traffic. The |
| 2305 | rctl |= E1000_RCTL_SECRC; | 2319 | * hardware strips the CRC before sending to both SMBUS (BMC) and to |
| 2320 | * host memory when this is enabled | ||
| 2321 | */ | ||
| 2322 | if (adapter->flags2 & FLAG2_CRC_STRIPPING) | ||
| 2323 | rctl |= E1000_RCTL_SECRC; | ||
| 2306 | 2324 | ||
| 2307 | /* Setup buffer sizes */ | 2325 | /* Setup buffer sizes */ |
| 2308 | rctl &= ~E1000_RCTL_SZ_4096; | 2326 | rctl &= ~E1000_RCTL_SZ_4096; |
| @@ -4766,6 +4784,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
| 4766 | adapter->ei = ei; | 4784 | adapter->ei = ei; |
| 4767 | adapter->pba = ei->pba; | 4785 | adapter->pba = ei->pba; |
| 4768 | adapter->flags = ei->flags; | 4786 | adapter->flags = ei->flags; |
| 4787 | adapter->flags2 = ei->flags2; | ||
| 4769 | adapter->hw.adapter = adapter; | 4788 | adapter->hw.adapter = adapter; |
| 4770 | adapter->hw.mac.type = ei->mac; | 4789 | adapter->hw.mac.type = ei->mac; |
| 4771 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; | 4790 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; |
| @@ -4970,6 +4989,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
| 4970 | 4989 | ||
| 4971 | /* initialize the wol settings based on the eeprom settings */ | 4990 | /* initialize the wol settings based on the eeprom settings */ |
| 4972 | adapter->wol = adapter->eeprom_wol; | 4991 | adapter->wol = adapter->eeprom_wol; |
| 4992 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 4973 | 4993 | ||
| 4974 | /* reset the hardware with the new settings */ | 4994 | /* reset the hardware with the new settings */ |
| 4975 | e1000e_reset(adapter); | 4995 | e1000e_reset(adapter); |
| @@ -5008,6 +5028,7 @@ err_hw_init: | |||
| 5008 | err_sw_init: | 5028 | err_sw_init: |
| 5009 | if (adapter->hw.flash_address) | 5029 | if (adapter->hw.flash_address) |
| 5010 | iounmap(adapter->hw.flash_address); | 5030 | iounmap(adapter->hw.flash_address); |
| 5031 | e1000e_reset_interrupt_capability(adapter); | ||
| 5011 | err_flashmap: | 5032 | err_flashmap: |
| 5012 | iounmap(adapter->hw.hw_addr); | 5033 | iounmap(adapter->hw.hw_addr); |
| 5013 | err_ioremap: | 5034 | err_ioremap: |
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c index 77a3d7207a5..e909f96698e 100644 --- a/drivers/net/e1000e/param.c +++ b/drivers/net/e1000e/param.c | |||
| @@ -151,6 +151,16 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); | |||
| 151 | */ | 151 | */ |
| 152 | E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]"); | 152 | E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]"); |
| 153 | 153 | ||
| 154 | /* | ||
| 155 | * Enable CRC Stripping | ||
| 156 | * | ||
| 157 | * Valid Range: 0, 1 | ||
| 158 | * | ||
| 159 | * Default Value: 1 (enabled) | ||
| 160 | */ | ||
| 161 | E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \ | ||
| 162 | "the CRC"); | ||
| 163 | |||
| 154 | struct e1000_option { | 164 | struct e1000_option { |
| 155 | enum { enable_option, range_option, list_option } type; | 165 | enum { enable_option, range_option, list_option } type; |
| 156 | const char *name; | 166 | const char *name; |
| @@ -404,6 +414,21 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
| 404 | adapter->flags |= FLAG_SMART_POWER_DOWN; | 414 | adapter->flags |= FLAG_SMART_POWER_DOWN; |
| 405 | } | 415 | } |
| 406 | } | 416 | } |
| 417 | { /* CRC Stripping */ | ||
| 418 | const struct e1000_option opt = { | ||
| 419 | .type = enable_option, | ||
| 420 | .name = "CRC Stripping", | ||
| 421 | .err = "defaulting to enabled", | ||
| 422 | .def = OPTION_ENABLED | ||
| 423 | }; | ||
| 424 | |||
| 425 | if (num_CrcStripping > bd) { | ||
| 426 | unsigned int crc_stripping = CrcStripping[bd]; | ||
| 427 | e1000_validate_option(&crc_stripping, &opt, adapter); | ||
| 428 | if (crc_stripping == OPTION_ENABLED) | ||
| 429 | adapter->flags2 |= FLAG2_CRC_STRIPPING; | ||
| 430 | } | ||
| 431 | } | ||
| 407 | { /* Kumeran Lock Loss Workaround */ | 432 | { /* Kumeran Lock Loss Workaround */ |
| 408 | const struct e1000_option opt = { | 433 | const struct e1000_option opt = { |
| 409 | .type = enable_option, | 434 | .type = enable_option, |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index cb51c1fb033..a6f49d02578 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
| @@ -1099,7 +1099,9 @@ static int __devinit fs_enet_probe(struct of_device *ofdev, | |||
| 1099 | ndev->stop = fs_enet_close; | 1099 | ndev->stop = fs_enet_close; |
| 1100 | ndev->get_stats = fs_enet_get_stats; | 1100 | ndev->get_stats = fs_enet_get_stats; |
| 1101 | ndev->set_multicast_list = fs_set_multicast_list; | 1101 | ndev->set_multicast_list = fs_set_multicast_list; |
| 1102 | 1102 | #ifdef CONFIG_NET_POLL_CONTROLLER | |
| 1103 | ndev->poll_controller = fs_enet_netpoll; | ||
| 1104 | #endif | ||
| 1103 | if (fpi->use_napi) | 1105 | if (fpi->use_napi) |
| 1104 | netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi, | 1106 | netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi, |
| 1105 | fpi->napi_weight); | 1107 | fpi->napi_weight); |
| @@ -1209,7 +1211,7 @@ static void __exit fs_cleanup(void) | |||
| 1209 | static void fs_enet_netpoll(struct net_device *dev) | 1211 | static void fs_enet_netpoll(struct net_device *dev) |
| 1210 | { | 1212 | { |
| 1211 | disable_irq(dev->irq); | 1213 | disable_irq(dev->irq); |
| 1212 | fs_enet_interrupt(dev->irq, dev, NULL); | 1214 | fs_enet_interrupt(dev->irq, dev); |
| 1213 | enable_irq(dev->irq); | 1215 | enable_irq(dev->irq); |
| 1214 | } | 1216 | } |
| 1215 | #endif | 1217 | #endif |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 83a5cb6aa23..c4af949bf86 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
| @@ -1407,6 +1407,10 @@ static int gfar_clean_tx_ring(struct net_device *dev) | |||
| 1407 | if (bdp->status & TXBD_DEF) | 1407 | if (bdp->status & TXBD_DEF) |
| 1408 | dev->stats.collisions++; | 1408 | dev->stats.collisions++; |
| 1409 | 1409 | ||
| 1410 | /* Unmap the DMA memory */ | ||
| 1411 | dma_unmap_single(&priv->dev->dev, bdp->bufPtr, | ||
| 1412 | bdp->length, DMA_TO_DEVICE); | ||
| 1413 | |||
| 1410 | /* Free the sk buffer associated with this TxBD */ | 1414 | /* Free the sk buffer associated with this TxBD */ |
| 1411 | dev_kfree_skb_irq(priv->tx_skbuff[priv->skb_dirtytx]); | 1415 | dev_kfree_skb_irq(priv->tx_skbuff[priv->skb_dirtytx]); |
| 1412 | 1416 | ||
| @@ -1666,6 +1670,9 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) | |||
| 1666 | 1670 | ||
| 1667 | skb = priv->rx_skbuff[priv->skb_currx]; | 1671 | skb = priv->rx_skbuff[priv->skb_currx]; |
| 1668 | 1672 | ||
| 1673 | dma_unmap_single(&priv->dev->dev, bdp->bufPtr, | ||
| 1674 | priv->rx_buffer_size, DMA_FROM_DEVICE); | ||
| 1675 | |||
| 1669 | /* We drop the frame if we failed to allocate a new buffer */ | 1676 | /* We drop the frame if we failed to allocate a new buffer */ |
| 1670 | if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || | 1677 | if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || |
| 1671 | bdp->status & RXBD_ERR)) { | 1678 | bdp->status & RXBD_ERR)) { |
| @@ -1674,14 +1681,8 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) | |||
| 1674 | if (unlikely(!newskb)) | 1681 | if (unlikely(!newskb)) |
| 1675 | newskb = skb; | 1682 | newskb = skb; |
| 1676 | 1683 | ||
| 1677 | if (skb) { | 1684 | if (skb) |
| 1678 | dma_unmap_single(&priv->dev->dev, | ||
| 1679 | bdp->bufPtr, | ||
| 1680 | priv->rx_buffer_size, | ||
| 1681 | DMA_FROM_DEVICE); | ||
| 1682 | |||
| 1683 | dev_kfree_skb_any(skb); | 1685 | dev_kfree_skb_any(skb); |
| 1684 | } | ||
| 1685 | } else { | 1686 | } else { |
| 1686 | /* Increment the number of packets */ | 1687 | /* Increment the number of packets */ |
| 1687 | dev->stats.rx_packets++; | 1688 | dev->stats.rx_packets++; |
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 58906c984be..89964fa739a 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
| @@ -1776,7 +1776,8 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 1776 | 1776 | ||
| 1777 | /* this function will set ->supported = 0 and return 1 if wol is not | 1777 | /* this function will set ->supported = 0 and return 1 if wol is not |
| 1778 | * supported by this hardware */ | 1778 | * supported by this hardware */ |
| 1779 | if (igb_wol_exclusion(adapter, wol)) | 1779 | if (igb_wol_exclusion(adapter, wol) || |
| 1780 | !device_can_wakeup(&adapter->pdev->dev)) | ||
| 1780 | return; | 1781 | return; |
| 1781 | 1782 | ||
| 1782 | /* apply any specific unsupported masks here */ | 1783 | /* apply any specific unsupported masks here */ |
| @@ -1805,7 +1806,8 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 1805 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) | 1806 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) |
| 1806 | return -EOPNOTSUPP; | 1807 | return -EOPNOTSUPP; |
| 1807 | 1808 | ||
| 1808 | if (igb_wol_exclusion(adapter, wol)) | 1809 | if (igb_wol_exclusion(adapter, wol) || |
| 1810 | !device_can_wakeup(&adapter->pdev->dev)) | ||
| 1809 | return wol->wolopts ? -EOPNOTSUPP : 0; | 1811 | return wol->wolopts ? -EOPNOTSUPP : 0; |
| 1810 | 1812 | ||
| 1811 | switch (hw->device_id) { | 1813 | switch (hw->device_id) { |
| @@ -1825,6 +1827,8 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
| 1825 | if (wol->wolopts & WAKE_MAGIC) | 1827 | if (wol->wolopts & WAKE_MAGIC) |
| 1826 | adapter->wol |= E1000_WUFC_MAG; | 1828 | adapter->wol |= E1000_WUFC_MAG; |
| 1827 | 1829 | ||
| 1830 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 1831 | |||
| 1828 | return 0; | 1832 | return 0; |
| 1829 | } | 1833 | } |
| 1830 | 1834 | ||
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 1f397cd9941..1cbae85b142 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
| @@ -1019,10 +1019,9 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
| 1019 | state &= ~PCIE_LINK_STATE_L0S; | 1019 | state &= ~PCIE_LINK_STATE_L0S; |
| 1020 | pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL, | 1020 | pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL, |
| 1021 | state); | 1021 | state); |
| 1022 | printk(KERN_INFO "Disabling ASPM L0s upstream switch " | 1022 | dev_info(&pdev->dev, |
| 1023 | "port %x:%x.%x\n", us_dev->bus->number, | 1023 | "Disabling ASPM L0s upstream switch port %s\n", |
| 1024 | PCI_SLOT(us_dev->devfn), | 1024 | pci_name(us_dev)); |
| 1025 | PCI_FUNC(us_dev->devfn)); | ||
| 1026 | } | 1025 | } |
| 1027 | default: | 1026 | default: |
| 1028 | break; | 1027 | break; |
| @@ -1244,6 +1243,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
| 1244 | 1243 | ||
| 1245 | /* initialize the wol settings based on the eeprom settings */ | 1244 | /* initialize the wol settings based on the eeprom settings */ |
| 1246 | adapter->wol = adapter->eeprom_wol; | 1245 | adapter->wol = adapter->eeprom_wol; |
| 1246 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
| 1247 | 1247 | ||
| 1248 | /* reset the hardware with the new settings */ | 1248 | /* reset the hardware with the new settings */ |
| 1249 | igb_reset(adapter); | 1249 | igb_reset(adapter); |
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index a339afbeed3..96e709d6440 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
| @@ -656,10 +656,10 @@ static int mlx4_en_start_port(struct net_device *dev) | |||
| 656 | /* Configure port */ | 656 | /* Configure port */ |
| 657 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, | 657 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, |
| 658 | priv->rx_skb_size + ETH_FCS_LEN, | 658 | priv->rx_skb_size + ETH_FCS_LEN, |
| 659 | mdev->profile.tx_pause, | 659 | priv->prof->tx_pause, |
| 660 | mdev->profile.tx_ppp, | 660 | priv->prof->tx_ppp, |
| 661 | mdev->profile.rx_pause, | 661 | priv->prof->rx_pause, |
| 662 | mdev->profile.rx_ppp); | 662 | priv->prof->rx_ppp); |
| 663 | if (err) { | 663 | if (err) { |
| 664 | mlx4_err(mdev, "Failed setting port general configurations" | 664 | mlx4_err(mdev, "Failed setting port general configurations" |
| 665 | " for port %d, with error %d\n", priv->port, err); | 665 | " for port %d, with error %d\n", priv->port, err); |
| @@ -706,7 +706,7 @@ tx_err: | |||
| 706 | mlx4_en_release_rss_steer(priv); | 706 | mlx4_en_release_rss_steer(priv); |
| 707 | rx_err: | 707 | rx_err: |
| 708 | for (i = 0; i < priv->rx_ring_num; i++) | 708 | for (i = 0; i < priv->rx_ring_num; i++) |
| 709 | mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[rx_index]); | 709 | mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]); |
| 710 | cq_err: | 710 | cq_err: |
| 711 | while (rx_index--) | 711 | while (rx_index--) |
| 712 | mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]); | 712 | mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]); |
diff --git a/drivers/net/mlx4/en_params.c b/drivers/net/mlx4/en_params.c index c2e69b1bcd0..95706ee1c01 100644 --- a/drivers/net/mlx4/en_params.c +++ b/drivers/net/mlx4/en_params.c | |||
| @@ -90,6 +90,7 @@ MLX4_EN_PARM_INT(rx_ring_size2, MLX4_EN_AUTO_CONF, "Rx ring size for port 2"); | |||
| 90 | int mlx4_en_get_profile(struct mlx4_en_dev *mdev) | 90 | int mlx4_en_get_profile(struct mlx4_en_dev *mdev) |
| 91 | { | 91 | { |
| 92 | struct mlx4_en_profile *params = &mdev->profile; | 92 | struct mlx4_en_profile *params = &mdev->profile; |
| 93 | int i; | ||
| 93 | 94 | ||
| 94 | params->rx_moder_cnt = min_t(int, rx_moder_cnt, MLX4_EN_AUTO_CONF); | 95 | params->rx_moder_cnt = min_t(int, rx_moder_cnt, MLX4_EN_AUTO_CONF); |
| 95 | params->rx_moder_time = min_t(int, rx_moder_time, MLX4_EN_AUTO_CONF); | 96 | params->rx_moder_time = min_t(int, rx_moder_time, MLX4_EN_AUTO_CONF); |
| @@ -97,11 +98,13 @@ int mlx4_en_get_profile(struct mlx4_en_dev *mdev) | |||
| 97 | params->rss_xor = (rss_xor != 0); | 98 | params->rss_xor = (rss_xor != 0); |
| 98 | params->rss_mask = rss_mask & 0x1f; | 99 | params->rss_mask = rss_mask & 0x1f; |
| 99 | params->num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS); | 100 | params->num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS); |
| 100 | params->rx_pause = pprx; | 101 | for (i = 1; i <= MLX4_MAX_PORTS; i++) { |
| 101 | params->rx_ppp = pfcrx; | 102 | params->prof[i].rx_pause = pprx; |
| 102 | params->tx_pause = pptx; | 103 | params->prof[i].rx_ppp = pfcrx; |
| 103 | params->tx_ppp = pfctx; | 104 | params->prof[i].tx_pause = pptx; |
| 104 | if (params->rx_ppp || params->tx_ppp) { | 105 | params->prof[i].tx_ppp = pfctx; |
| 106 | } | ||
| 107 | if (pfcrx || pfctx) { | ||
| 105 | params->prof[1].tx_ring_num = MLX4_EN_TX_RING_NUM; | 108 | params->prof[1].tx_ring_num = MLX4_EN_TX_RING_NUM; |
| 106 | params->prof[2].tx_ring_num = MLX4_EN_TX_RING_NUM; | 109 | params->prof[2].tx_ring_num = MLX4_EN_TX_RING_NUM; |
| 107 | } else { | 110 | } else { |
| @@ -407,14 +410,14 @@ static int mlx4_en_set_pauseparam(struct net_device *dev, | |||
| 407 | struct mlx4_en_dev *mdev = priv->mdev; | 410 | struct mlx4_en_dev *mdev = priv->mdev; |
| 408 | int err; | 411 | int err; |
| 409 | 412 | ||
| 410 | mdev->profile.tx_pause = pause->tx_pause != 0; | 413 | priv->prof->tx_pause = pause->tx_pause != 0; |
| 411 | mdev->profile.rx_pause = pause->rx_pause != 0; | 414 | priv->prof->rx_pause = pause->rx_pause != 0; |
| 412 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, | 415 | err = mlx4_SET_PORT_general(mdev->dev, priv->port, |
| 413 | priv->rx_skb_size + ETH_FCS_LEN, | 416 | priv->rx_skb_size + ETH_FCS_LEN, |
| 414 | mdev->profile.tx_pause, | 417 | priv->prof->tx_pause, |
| 415 | mdev->profile.tx_ppp, | 418 | priv->prof->tx_ppp, |
| 416 | mdev->profile.rx_pause, | 419 | priv->prof->rx_pause, |
| 417 | mdev->profile.rx_ppp); | 420 | priv->prof->rx_ppp); |
| 418 | if (err) | 421 | if (err) |
| 419 | mlx4_err(mdev, "Failed setting pause params to\n"); | 422 | mlx4_err(mdev, "Failed setting pause params to\n"); |
| 420 | 423 | ||
| @@ -425,10 +428,9 @@ static void mlx4_en_get_pauseparam(struct net_device *dev, | |||
| 425 | struct ethtool_pauseparam *pause) | 428 | struct ethtool_pauseparam *pause) |
| 426 | { | 429 | { |
| 427 | struct mlx4_en_priv *priv = netdev_priv(dev); | 430 | struct mlx4_en_priv *priv = netdev_priv(dev); |
| 428 | struct mlx4_en_dev *mdev = priv->mdev; | ||
| 429 | 431 | ||
| 430 | pause->tx_pause = mdev->profile.tx_pause; | 432 | pause->tx_pause = priv->prof->tx_pause; |
| 431 | pause->rx_pause = mdev->profile.rx_pause; | 433 | pause->rx_pause = priv->prof->rx_pause; |
| 432 | } | 434 | } |
| 433 | 435 | ||
| 434 | static void mlx4_en_get_ringparam(struct net_device *dev, | 436 | static void mlx4_en_get_ringparam(struct net_device *dev, |
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index fa431fad0ee..56a2e213fe6 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h | |||
| @@ -87,6 +87,9 @@ enum { | |||
| 87 | 87 | ||
| 88 | #ifdef CONFIG_MLX4_DEBUG | 88 | #ifdef CONFIG_MLX4_DEBUG |
| 89 | extern int mlx4_debug_level; | 89 | extern int mlx4_debug_level; |
| 90 | #else /* CONFIG_MLX4_DEBUG */ | ||
| 91 | #define mlx4_debug_level (0) | ||
| 92 | #endif /* CONFIG_MLX4_DEBUG */ | ||
| 90 | 93 | ||
| 91 | #define mlx4_dbg(mdev, format, arg...) \ | 94 | #define mlx4_dbg(mdev, format, arg...) \ |
| 92 | do { \ | 95 | do { \ |
| @@ -94,12 +97,6 @@ extern int mlx4_debug_level; | |||
| 94 | dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \ | 97 | dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \ |
| 95 | } while (0) | 98 | } while (0) |
| 96 | 99 | ||
| 97 | #else /* CONFIG_MLX4_DEBUG */ | ||
| 98 | |||
| 99 | #define mlx4_dbg(mdev, format, arg...) do { (void) mdev; } while (0) | ||
| 100 | |||
| 101 | #endif /* CONFIG_MLX4_DEBUG */ | ||
| 102 | |||
| 103 | #define mlx4_err(mdev, format, arg...) \ | 100 | #define mlx4_err(mdev, format, arg...) \ |
| 104 | dev_err(&mdev->pdev->dev, format, ## arg) | 101 | dev_err(&mdev->pdev->dev, format, ## arg) |
| 105 | #define mlx4_info(mdev, format, arg...) \ | 102 | #define mlx4_info(mdev, format, arg...) \ |
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h index 11fb17c6e97..98ddc0811f9 100644 --- a/drivers/net/mlx4/mlx4_en.h +++ b/drivers/net/mlx4/mlx4_en.h | |||
| @@ -322,6 +322,10 @@ struct mlx4_en_port_profile { | |||
| 322 | u32 rx_ring_num; | 322 | u32 rx_ring_num; |
| 323 | u32 tx_ring_size; | 323 | u32 tx_ring_size; |
| 324 | u32 rx_ring_size; | 324 | u32 rx_ring_size; |
| 325 | u8 rx_pause; | ||
| 326 | u8 rx_ppp; | ||
| 327 | u8 tx_pause; | ||
| 328 | u8 tx_ppp; | ||
| 325 | }; | 329 | }; |
| 326 | 330 | ||
| 327 | struct mlx4_en_profile { | 331 | struct mlx4_en_profile { |
| @@ -333,10 +337,6 @@ struct mlx4_en_profile { | |||
| 333 | int rx_moder_cnt; | 337 | int rx_moder_cnt; |
| 334 | int rx_moder_time; | 338 | int rx_moder_time; |
| 335 | int auto_moder; | 339 | int auto_moder; |
| 336 | u8 rx_pause; | ||
| 337 | u8 rx_ppp; | ||
| 338 | u8 tx_pause; | ||
| 339 | u8 tx_ppp; | ||
| 340 | u8 no_reset; | 340 | u8 no_reset; |
| 341 | struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1]; | 341 | struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1]; |
| 342 | }; | 342 | }; |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index a9c8c08044b..b9dcdbd369f 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
| @@ -1066,9 +1066,12 @@ static int smi_wait_ready(struct mv643xx_eth_shared_private *msp) | |||
| 1066 | return 0; | 1066 | return 0; |
| 1067 | } | 1067 | } |
| 1068 | 1068 | ||
| 1069 | if (!wait_event_timeout(msp->smi_busy_wait, smi_is_done(msp), | 1069 | if (!smi_is_done(msp)) { |
| 1070 | msecs_to_jiffies(100))) | 1070 | wait_event_timeout(msp->smi_busy_wait, smi_is_done(msp), |
| 1071 | return -ETIMEDOUT; | 1071 | msecs_to_jiffies(100)); |
| 1072 | if (!smi_is_done(msp)) | ||
| 1073 | return -ETIMEDOUT; | ||
| 1074 | } | ||
| 1072 | 1075 | ||
| 1073 | return 0; | 1076 | return 0; |
| 1074 | } | 1077 | } |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index a5f428bcc0e..b3786709730 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
| @@ -75,7 +75,7 @@ | |||
| 75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
| 76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
| 77 | 77 | ||
| 78 | #define MYRI10GE_VERSION_STR "1.4.3-1.375" | 78 | #define MYRI10GE_VERSION_STR "1.4.3-1.378" |
| 79 | 79 | ||
| 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
| 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
| @@ -1393,6 +1393,7 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index) | |||
| 1393 | if (tx->req == tx->done) { | 1393 | if (tx->req == tx->done) { |
| 1394 | tx->queue_active = 0; | 1394 | tx->queue_active = 0; |
| 1395 | put_be32(htonl(1), tx->send_stop); | 1395 | put_be32(htonl(1), tx->send_stop); |
| 1396 | mb(); | ||
| 1396 | mmiowb(); | 1397 | mmiowb(); |
| 1397 | } | 1398 | } |
| 1398 | __netif_tx_unlock(dev_queue); | 1399 | __netif_tx_unlock(dev_queue); |
| @@ -2865,6 +2866,7 @@ again: | |||
| 2865 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { | 2866 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { |
| 2866 | tx->queue_active = 1; | 2867 | tx->queue_active = 1; |
| 2867 | put_be32(htonl(1), tx->send_go); | 2868 | put_be32(htonl(1), tx->send_go); |
| 2869 | mb(); | ||
| 2868 | mmiowb(); | 2870 | mmiowb(); |
| 2869 | } | 2871 | } |
| 2870 | tx->pkt_start++; | 2872 | tx->pkt_start++; |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index ebc81270290..1b6f548c441 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
| @@ -33,8 +33,8 @@ | |||
| 33 | 33 | ||
| 34 | #define DRV_MODULE_NAME "niu" | 34 | #define DRV_MODULE_NAME "niu" |
| 35 | #define PFX DRV_MODULE_NAME ": " | 35 | #define PFX DRV_MODULE_NAME ": " |
| 36 | #define DRV_MODULE_VERSION "0.9" | 36 | #define DRV_MODULE_VERSION "1.0" |
| 37 | #define DRV_MODULE_RELDATE "May 4, 2008" | 37 | #define DRV_MODULE_RELDATE "Nov 14, 2008" |
| 38 | 38 | ||
| 39 | static char version[] __devinitdata = | 39 | static char version[] __devinitdata = |
| 40 | DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | 40 | DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; |
| @@ -51,8 +51,7 @@ MODULE_VERSION(DRV_MODULE_VERSION); | |||
| 51 | #ifndef readq | 51 | #ifndef readq |
| 52 | static u64 readq(void __iomem *reg) | 52 | static u64 readq(void __iomem *reg) |
| 53 | { | 53 | { |
| 54 | return (((u64)readl(reg + 0x4UL) << 32) | | 54 | return ((u64) readl(reg)) | (((u64) readl(reg + 4UL)) << 32); |
| 55 | (u64)readl(reg)); | ||
| 56 | } | 55 | } |
| 57 | 56 | ||
| 58 | static void writeq(u64 val, void __iomem *reg) | 57 | static void writeq(u64 val, void __iomem *reg) |
| @@ -407,7 +406,7 @@ static int esr2_set_rx_cfg(struct niu *np, unsigned long channel, u32 val) | |||
| 407 | } | 406 | } |
| 408 | 407 | ||
| 409 | /* Mode is always 10G fiber. */ | 408 | /* Mode is always 10G fiber. */ |
| 410 | static int serdes_init_niu(struct niu *np) | 409 | static int serdes_init_niu_10g_fiber(struct niu *np) |
| 411 | { | 410 | { |
| 412 | struct niu_link_config *lp = &np->link_config; | 411 | struct niu_link_config *lp = &np->link_config; |
| 413 | u32 tx_cfg, rx_cfg; | 412 | u32 tx_cfg, rx_cfg; |
| @@ -444,6 +443,223 @@ static int serdes_init_niu(struct niu *np) | |||
| 444 | return 0; | 443 | return 0; |
| 445 | } | 444 | } |
| 446 | 445 | ||
| 446 | static int serdes_init_niu_1g_serdes(struct niu *np) | ||
| 447 | { | ||
| 448 | struct niu_link_config *lp = &np->link_config; | ||
| 449 | u16 pll_cfg, pll_sts; | ||
| 450 | int max_retry = 100; | ||
| 451 | u64 sig, mask, val; | ||
| 452 | u32 tx_cfg, rx_cfg; | ||
| 453 | unsigned long i; | ||
| 454 | int err; | ||
| 455 | |||
| 456 | tx_cfg = (PLL_TX_CFG_ENTX | PLL_TX_CFG_SWING_1375MV | | ||
| 457 | PLL_TX_CFG_RATE_HALF); | ||
| 458 | rx_cfg = (PLL_RX_CFG_ENRX | PLL_RX_CFG_TERM_0P8VDDT | | ||
| 459 | PLL_RX_CFG_ALIGN_ENA | PLL_RX_CFG_LOS_LTHRESH | | ||
| 460 | PLL_RX_CFG_RATE_HALF); | ||
| 461 | |||
| 462 | if (np->port == 0) | ||
| 463 | rx_cfg |= PLL_RX_CFG_EQ_LP_ADAPTIVE; | ||
| 464 | |||
| 465 | if (lp->loopback_mode == LOOPBACK_PHY) { | ||
| 466 | u16 test_cfg = PLL_TEST_CFG_LOOPBACK_CML_DIS; | ||
| 467 | |||
| 468 | mdio_write(np, np->port, NIU_ESR2_DEV_ADDR, | ||
| 469 | ESR2_TI_PLL_TEST_CFG_L, test_cfg); | ||
| 470 | |||
| 471 | tx_cfg |= PLL_TX_CFG_ENTEST; | ||
| 472 | rx_cfg |= PLL_RX_CFG_ENTEST; | ||
| 473 | } | ||
| 474 | |||
| 475 | /* Initialize PLL for 1G */ | ||
| 476 | pll_cfg = (PLL_CFG_ENPLL | PLL_CFG_MPY_8X); | ||
| 477 | |||
| 478 | err = mdio_write(np, np->port, NIU_ESR2_DEV_ADDR, | ||
| 479 | ESR2_TI_PLL_CFG_L, pll_cfg); | ||
| 480 | if (err) { | ||
| 481 | dev_err(np->device, PFX "NIU Port %d " | ||
| 482 | "serdes_init_niu_1g_serdes: " | ||
| 483 | "mdio write to ESR2_TI_PLL_CFG_L failed", np->port); | ||
| 484 | return err; | ||
| 485 | } | ||
| 486 | |||
| 487 | pll_sts = PLL_CFG_ENPLL; | ||
| 488 | |||
| 489 | err = mdio_write(np, np->port, NIU_ESR2_DEV_ADDR, | ||
| 490 | ESR2_TI_PLL_STS_L, pll_sts); | ||
| 491 | if (err) { | ||
| 492 | dev_err(np->device, PFX "NIU Port %d " | ||
| 493 | "serdes_init_niu_1g_serdes: " | ||
| 494 | "mdio write to ESR2_TI_PLL_STS_L failed", np->port); | ||
| 495 | return err; | ||
| 496 | } | ||
| 497 | |||
| 498 | udelay(200); | ||
| 499 | |||
| 500 | /* Initialize all 4 lanes of the SERDES. */ | ||
| 501 | for (i = 0; i < 4; i++) { | ||
| 502 | err = esr2_set_tx_cfg(np, i, tx_cfg); | ||
| 503 | if (err) | ||
| 504 | return err; | ||
| 505 | } | ||
| 506 | |||
| 507 | for (i = 0; i < 4; i++) { | ||
| 508 | err = esr2_set_rx_cfg(np, i, rx_cfg); | ||
| 509 | if (err) | ||
| 510 | return err; | ||
| 511 | } | ||
| 512 | |||
| 513 | switch (np->port) { | ||
| 514 | case 0: | ||
| 515 | val = (ESR_INT_SRDY0_P0 | ESR_INT_DET0_P0); | ||
| 516 | mask = val; | ||
| 517 | break; | ||
| 518 | |||
| 519 | case 1: | ||
| 520 | val = (ESR_INT_SRDY0_P1 | ESR_INT_DET0_P1); | ||
| 521 | mask = val; | ||
| 522 | break; | ||
| 523 | |||
| 524 | default: | ||
| 525 | return -EINVAL; | ||
| 526 | } | ||
| 527 | |||
| 528 | while (max_retry--) { | ||
| 529 | sig = nr64(ESR_INT_SIGNALS); | ||
| 530 | if ((sig & mask) == val) | ||
| 531 | break; | ||
| 532 | |||
| 533 | mdelay(500); | ||
| 534 | } | ||
| 535 | |||
| 536 | if ((sig & mask) != val) { | ||
| 537 | dev_err(np->device, PFX "Port %u signal bits [%08x] are not " | ||
| 538 | "[%08x]\n", np->port, (int) (sig & mask), (int) val); | ||
| 539 | return -ENODEV; | ||
| 540 | } | ||
| 541 | |||
| 542 | return 0; | ||
| 543 | } | ||
| 544 | |||
| 545 | static int serdes_init_niu_10g_serdes(struct niu *np) | ||
| 546 | { | ||
| 547 | struct niu_link_config *lp = &np->link_config; | ||
| 548 | u32 tx_cfg, rx_cfg, pll_cfg, pll_sts; | ||
| 549 | int max_retry = 100; | ||
| 550 | u64 sig, mask, val; | ||
| 551 | unsigned long i; | ||
| 552 | int err; | ||
| 553 | |||
| 554 | tx_cfg = (PLL_TX_CFG_ENTX | PLL_TX_CFG_SWING_1375MV); | ||
| 555 | rx_cfg = (PLL_RX_CFG_ENRX | PLL_RX_CFG_TERM_0P8VDDT | | ||
| 556 | PLL_RX_CFG_ALIGN_ENA | PLL_RX_CFG_LOS_LTHRESH | | ||
| 557 | PLL_RX_CFG_EQ_LP_ADAPTIVE); | ||
| 558 | |||
| 559 | if (lp->loopback_mode == LOOPBACK_PHY) { | ||
| 560 | u16 test_cfg = PLL_TEST_CFG_LOOPBACK_CML_DIS; | ||
| 561 | |||
| 562 | mdio_write(np, np->port, NIU_ESR2_DEV_ADDR, | ||
| 563 | ESR2_TI_PLL_TEST_CFG_L, test_cfg); | ||
| 564 | |||
| 565 | tx_cfg |= PLL_TX_CFG_ENTEST; | ||
| 566 | rx_cfg |= PLL_RX_CFG_ENTEST; | ||
| 567 | } | ||
| 568 | |||
| 569 | /* Initialize PLL for 10G */ | ||
| 570 | pll_cfg = (PLL_CFG_ENPLL | PLL_CFG_MPY_10X); | ||
| 571 | |||
| 572 | err = mdio_write(np, np->port, NIU_ESR2_DEV_ADDR, | ||
| 573 | ESR2_TI_PLL_CFG_L, pll_cfg & 0xffff); | ||
| 574 | if (err) { | ||
| 575 | dev_err(np->device, PFX "NIU Port %d " | ||
| 576 | "serdes_init_niu_10g_serdes: " | ||
| 577 | "mdio write to ESR2_TI_PLL_CFG_L failed", np->port); | ||
| 578 | return err; | ||
| 579 | } | ||
| 580 | |||
| 581 | pll_sts = PLL_CFG_ENPLL; | ||
| 582 | |||
| 583 | err = mdio_write(np, np->port, NIU_ESR2_DEV_ADDR, | ||
| 584 | ESR2_TI_PLL_STS_L, pll_sts & 0xffff); | ||
| 585 | if (err) { | ||
| 586 | dev_err(np->device, PFX "NIU Port %d " | ||
| 587 | "serdes_init_niu_10g_serdes: " | ||
| 588 | "mdio write to ESR2_TI_PLL_STS_L failed", np->port); | ||
| 589 | return err; | ||
| 590 | } | ||
| 591 | |||
| 592 | udelay(200); | ||
| 593 | |||
| 594 | /* Initialize all 4 lanes of the SERDES. */ | ||
| 595 | for (i = 0; i < 4; i++) { | ||
| 596 | err = esr2_set_tx_cfg(np, i, tx_cfg); | ||
| 597 | if (err) | ||
| 598 | return err; | ||
| 599 | } | ||
| 600 | |||
| 601 | for (i = 0; i < 4; i++) { | ||
| 602 | err = esr2_set_rx_cfg(np, i, rx_cfg); | ||
| 603 | if (err) | ||
| 604 | return err; | ||
| 605 | } | ||
| 606 | |||
| 607 | /* check if serdes is ready */ | ||
| 608 | |||
| 609 | switch (np->port) { | ||
| 610 | case 0: | ||
| 611 | mask = ESR_INT_SIGNALS_P0_BITS; | ||
| 612 | val = (ESR_INT_SRDY0_P0 | | ||
| 613 | ESR_INT_DET0_P0 | | ||
| 614 | ESR_INT_XSRDY_P0 | | ||
| 615 | ESR_INT_XDP_P0_CH3 | | ||
| 616 | ESR_INT_XDP_P0_CH2 | | ||
| 617 | ESR_INT_XDP_P0_CH1 | | ||
| 618 | ESR_INT_XDP_P0_CH0); | ||
| 619 | break; | ||
| 620 | |||
| 621 | case 1: | ||
| 622 | mask = ESR_INT_SIGNALS_P1_BITS; | ||
| 623 | val = (ESR_INT_SRDY0_P1 | | ||
| 624 | ESR_INT_DET0_P1 | | ||
| 625 | ESR_INT_XSRDY_P1 | | ||
| 626 | ESR_INT_XDP_P1_CH3 | | ||
| 627 | ESR_INT_XDP_P1_CH2 | | ||
| 628 | ESR_INT_XDP_P1_CH1 | | ||
| 629 | ESR_INT_XDP_P1_CH0); | ||
| 630 | break; | ||
| 631 | |||
| 632 | default: | ||
| 633 | return -EINVAL; | ||
| 634 | } | ||
| 635 | |||
| 636 | while (max_retry--) { | ||
| 637 | sig = nr64(ESR_INT_SIGNALS); | ||
| 638 | if ((sig & mask) == val) | ||
| 639 | break; | ||
| 640 | |||
| 641 | mdelay(500); | ||
| 642 | } | ||
| 643 | |||
| 644 | if ((sig & mask) != val) { | ||
| 645 | pr_info(PFX "NIU Port %u signal bits [%08x] are not " | ||
| 646 | "[%08x] for 10G...trying 1G\n", | ||
| 647 | np->port, (int) (sig & mask), (int) val); | ||
| 648 | |||
| 649 | /* 10G failed, try initializing at 1G */ | ||
| 650 | err = serdes_init_niu_1g_serdes(np); | ||
| 651 | if (!err) { | ||
| 652 | np->flags &= ~NIU_FLAGS_10G; | ||
| 653 | np->mac_xcvr = MAC_XCVR_PCS; | ||
| 654 | } else { | ||
| 655 | dev_err(np->device, PFX "Port %u 10G/1G SERDES " | ||
| 656 | "Link Failed \n", np->port); | ||
| 657 | return -ENODEV; | ||
| 658 | } | ||
| 659 | } | ||
| 660 | return 0; | ||
| 661 | } | ||
| 662 | |||
| 447 | static int esr_read_rxtx_ctrl(struct niu *np, unsigned long chan, u32 *val) | 663 | static int esr_read_rxtx_ctrl(struct niu *np, unsigned long chan, u32 *val) |
| 448 | { | 664 | { |
| 449 | int err; | 665 | int err; |
| @@ -1955,13 +2171,23 @@ static const struct niu_phy_ops phy_ops_10g_serdes = { | |||
| 1955 | .link_status = link_status_10g_serdes, | 2171 | .link_status = link_status_10g_serdes, |
| 1956 | }; | 2172 | }; |
| 1957 | 2173 | ||
| 2174 | static const struct niu_phy_ops phy_ops_10g_serdes_niu = { | ||
| 2175 | .serdes_init = serdes_init_niu_10g_serdes, | ||
| 2176 | .link_status = link_status_10g_serdes, | ||
| 2177 | }; | ||
| 2178 | |||
| 2179 | static const struct niu_phy_ops phy_ops_1g_serdes_niu = { | ||
| 2180 | .serdes_init = serdes_init_niu_1g_serdes, | ||
| 2181 | .link_status = link_status_1g_serdes, | ||
| 2182 | }; | ||
| 2183 | |||
| 1958 | static const struct niu_phy_ops phy_ops_1g_rgmii = { | 2184 | static const struct niu_phy_ops phy_ops_1g_rgmii = { |
| 1959 | .xcvr_init = xcvr_init_1g_rgmii, | 2185 | .xcvr_init = xcvr_init_1g_rgmii, |
| 1960 | .link_status = link_status_1g_rgmii, | 2186 | .link_status = link_status_1g_rgmii, |
| 1961 | }; | 2187 | }; |
| 1962 | 2188 | ||
| 1963 | static const struct niu_phy_ops phy_ops_10g_fiber_niu = { | 2189 | static const struct niu_phy_ops phy_ops_10g_fiber_niu = { |
| 1964 | .serdes_init = serdes_init_niu, | 2190 | .serdes_init = serdes_init_niu_10g_fiber, |
| 1965 | .xcvr_init = xcvr_init_10g, | 2191 | .xcvr_init = xcvr_init_10g, |
| 1966 | .link_status = link_status_10g, | 2192 | .link_status = link_status_10g, |
| 1967 | }; | 2193 | }; |
| @@ -1999,11 +2225,21 @@ struct niu_phy_template { | |||
| 1999 | u32 phy_addr_base; | 2225 | u32 phy_addr_base; |
| 2000 | }; | 2226 | }; |
| 2001 | 2227 | ||
| 2002 | static const struct niu_phy_template phy_template_niu = { | 2228 | static const struct niu_phy_template phy_template_niu_10g_fiber = { |
| 2003 | .ops = &phy_ops_10g_fiber_niu, | 2229 | .ops = &phy_ops_10g_fiber_niu, |
| 2004 | .phy_addr_base = 16, | 2230 | .phy_addr_base = 16, |
| 2005 | }; | 2231 | }; |
| 2006 | 2232 | ||
| 2233 | static const struct niu_phy_template phy_template_niu_10g_serdes = { | ||
| 2234 | .ops = &phy_ops_10g_serdes_niu, | ||
| 2235 | .phy_addr_base = 0, | ||
| 2236 | }; | ||
| 2237 | |||
| 2238 | static const struct niu_phy_template phy_template_niu_1g_serdes = { | ||
| 2239 | .ops = &phy_ops_1g_serdes_niu, | ||
| 2240 | .phy_addr_base = 0, | ||
| 2241 | }; | ||
| 2242 | |||
| 2007 | static const struct niu_phy_template phy_template_10g_fiber = { | 2243 | static const struct niu_phy_template phy_template_10g_fiber = { |
| 2008 | .ops = &phy_ops_10g_fiber, | 2244 | .ops = &phy_ops_10g_fiber, |
| 2009 | .phy_addr_base = 8, | 2245 | .phy_addr_base = 8, |
| @@ -2183,8 +2419,25 @@ static int niu_determine_phy_disposition(struct niu *np) | |||
| 2183 | u32 phy_addr_off = 0; | 2419 | u32 phy_addr_off = 0; |
| 2184 | 2420 | ||
| 2185 | if (plat_type == PLAT_TYPE_NIU) { | 2421 | if (plat_type == PLAT_TYPE_NIU) { |
| 2186 | tp = &phy_template_niu; | 2422 | switch (np->flags & |
| 2187 | phy_addr_off += np->port; | 2423 | (NIU_FLAGS_10G | |
| 2424 | NIU_FLAGS_FIBER | | ||
| 2425 | NIU_FLAGS_XCVR_SERDES)) { | ||
| 2426 | case NIU_FLAGS_10G | NIU_FLAGS_XCVR_SERDES: | ||
| 2427 | /* 10G Serdes */ | ||
| 2428 | tp = &phy_template_niu_10g_serdes; | ||
| 2429 | break; | ||
| 2430 | case NIU_FLAGS_XCVR_SERDES: | ||
| 2431 | /* 1G Serdes */ | ||
| 2432 | tp = &phy_template_niu_1g_serdes; | ||
| 2433 | break; | ||
| 2434 | case NIU_FLAGS_10G | NIU_FLAGS_FIBER: | ||
| 2435 | /* 10G Fiber */ | ||
| 2436 | default: | ||
| 2437 | tp = &phy_template_niu_10g_fiber; | ||
| 2438 | phy_addr_off += np->port; | ||
| 2439 | break; | ||
| 2440 | } | ||
| 2188 | } else { | 2441 | } else { |
| 2189 | switch (np->flags & | 2442 | switch (np->flags & |
| 2190 | (NIU_FLAGS_10G | | 2443 | (NIU_FLAGS_10G | |
| @@ -7214,6 +7467,12 @@ static int __devinit niu_phy_type_prop_decode(struct niu *np, | |||
| 7214 | np->flags |= NIU_FLAGS_10G; | 7467 | np->flags |= NIU_FLAGS_10G; |
| 7215 | np->flags &= ~NIU_FLAGS_FIBER; | 7468 | np->flags &= ~NIU_FLAGS_FIBER; |
| 7216 | np->mac_xcvr = MAC_XCVR_XPCS; | 7469 | np->mac_xcvr = MAC_XCVR_XPCS; |
| 7470 | } else if (!strcmp(phy_prop, "xgsd") || !strcmp(phy_prop, "gsd")) { | ||
| 7471 | /* 10G Serdes or 1G Serdes, default to 10G */ | ||
| 7472 | np->flags |= NIU_FLAGS_10G; | ||
| 7473 | np->flags &= ~NIU_FLAGS_FIBER; | ||
| 7474 | np->flags |= NIU_FLAGS_XCVR_SERDES; | ||
| 7475 | np->mac_xcvr = MAC_XCVR_XPCS; | ||
| 7217 | } else { | 7476 | } else { |
| 7218 | return -EINVAL; | 7477 | return -EINVAL; |
| 7219 | } | 7478 | } |
| @@ -7742,6 +8001,8 @@ static int __devinit walk_phys(struct niu *np, struct niu_parent *parent) | |||
| 7742 | u32 val; | 8001 | u32 val; |
| 7743 | int err; | 8002 | int err; |
| 7744 | 8003 | ||
| 8004 | num_10g = num_1g = 0; | ||
| 8005 | |||
| 7745 | if (!strcmp(np->vpd.model, NIU_ALONSO_MDL_STR) || | 8006 | if (!strcmp(np->vpd.model, NIU_ALONSO_MDL_STR) || |
| 7746 | !strcmp(np->vpd.model, NIU_KIMI_MDL_STR)) { | 8007 | !strcmp(np->vpd.model, NIU_KIMI_MDL_STR)) { |
| 7747 | num_10g = 0; | 8008 | num_10g = 0; |
| @@ -7758,6 +8019,16 @@ static int __devinit walk_phys(struct niu *np, struct niu_parent *parent) | |||
| 7758 | parent->num_ports = 2; | 8019 | parent->num_ports = 2; |
| 7759 | val = (phy_encode(PORT_TYPE_10G, 0) | | 8020 | val = (phy_encode(PORT_TYPE_10G, 0) | |
| 7760 | phy_encode(PORT_TYPE_10G, 1)); | 8021 | phy_encode(PORT_TYPE_10G, 1)); |
| 8022 | } else if ((np->flags & NIU_FLAGS_XCVR_SERDES) && | ||
| 8023 | (parent->plat_type == PLAT_TYPE_NIU)) { | ||
| 8024 | /* this is the Monza case */ | ||
| 8025 | if (np->flags & NIU_FLAGS_10G) { | ||
| 8026 | val = (phy_encode(PORT_TYPE_10G, 0) | | ||
| 8027 | phy_encode(PORT_TYPE_10G, 1)); | ||
| 8028 | } else { | ||
| 8029 | val = (phy_encode(PORT_TYPE_1G, 0) | | ||
| 8030 | phy_encode(PORT_TYPE_1G, 1)); | ||
| 8031 | } | ||
| 7761 | } else { | 8032 | } else { |
| 7762 | err = fill_phy_probe_info(np, parent, info); | 8033 | err = fill_phy_probe_info(np, parent, info); |
| 7763 | if (err) | 8034 | if (err) |
| @@ -8657,7 +8928,9 @@ static void __devinit niu_device_announce(struct niu *np) | |||
| 8657 | dev->name, | 8928 | dev->name, |
| 8658 | (np->flags & NIU_FLAGS_XMAC ? "XMAC" : "BMAC"), | 8929 | (np->flags & NIU_FLAGS_XMAC ? "XMAC" : "BMAC"), |
| 8659 | (np->flags & NIU_FLAGS_10G ? "10G" : "1G"), | 8930 | (np->flags & NIU_FLAGS_10G ? "10G" : "1G"), |
| 8660 | (np->flags & NIU_FLAGS_FIBER ? "FIBER" : "COPPER"), | 8931 | (np->flags & NIU_FLAGS_FIBER ? "FIBER" : |
| 8932 | (np->flags & NIU_FLAGS_XCVR_SERDES ? "SERDES" : | ||
| 8933 | "COPPER")), | ||
| 8661 | (np->mac_xcvr == MAC_XCVR_MII ? "MII" : | 8934 | (np->mac_xcvr == MAC_XCVR_MII ? "MII" : |
| 8662 | (np->mac_xcvr == MAC_XCVR_PCS ? "PCS" : "XPCS")), | 8935 | (np->mac_xcvr == MAC_XCVR_PCS ? "PCS" : "XPCS")), |
| 8663 | np->vpd.phy_type); | 8936 | np->vpd.phy_type); |
| @@ -8667,7 +8940,6 @@ static void __devinit niu_device_announce(struct niu *np) | |||
| 8667 | static int __devinit niu_pci_init_one(struct pci_dev *pdev, | 8940 | static int __devinit niu_pci_init_one(struct pci_dev *pdev, |
| 8668 | const struct pci_device_id *ent) | 8941 | const struct pci_device_id *ent) |
| 8669 | { | 8942 | { |
| 8670 | unsigned long niureg_base, niureg_len; | ||
| 8671 | union niu_parent_id parent_id; | 8943 | union niu_parent_id parent_id; |
| 8672 | struct net_device *dev; | 8944 | struct net_device *dev; |
| 8673 | struct niu *np; | 8945 | struct niu *np; |
| @@ -8758,10 +9030,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev, | |||
| 8758 | 9030 | ||
| 8759 | dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM); | 9031 | dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM); |
| 8760 | 9032 | ||
| 8761 | niureg_base = pci_resource_start(pdev, 0); | 9033 | np->regs = pci_ioremap_bar(pdev, 0); |
| 8762 | niureg_len = pci_resource_len(pdev, 0); | ||
| 8763 | |||
| 8764 | np->regs = ioremap_nocache(niureg_base, niureg_len); | ||
| 8765 | if (!np->regs) { | 9034 | if (!np->regs) { |
| 8766 | dev_err(&pdev->dev, PFX "Cannot map device registers, " | 9035 | dev_err(&pdev->dev, PFX "Cannot map device registers, " |
| 8767 | "aborting.\n"); | 9036 | "aborting.\n"); |
diff --git a/drivers/net/niu.h b/drivers/net/niu.h index c6fa883daa2..180ca8ae93d 100644 --- a/drivers/net/niu.h +++ b/drivers/net/niu.h | |||
| @@ -1048,6 +1048,13 @@ | |||
| 1048 | #define PLL_CFG_LD_SHIFT 8 | 1048 | #define PLL_CFG_LD_SHIFT 8 |
| 1049 | #define PLL_CFG_MPY 0x0000001e | 1049 | #define PLL_CFG_MPY 0x0000001e |
| 1050 | #define PLL_CFG_MPY_SHIFT 1 | 1050 | #define PLL_CFG_MPY_SHIFT 1 |
| 1051 | #define PLL_CFG_MPY_4X 0x0 | ||
| 1052 | #define PLL_CFG_MPY_5X 0x00000002 | ||
| 1053 | #define PLL_CFG_MPY_6X 0x00000004 | ||
| 1054 | #define PLL_CFG_MPY_8X 0x00000008 | ||
| 1055 | #define PLL_CFG_MPY_10X 0x0000000a | ||
| 1056 | #define PLL_CFG_MPY_12X 0x0000000c | ||
| 1057 | #define PLL_CFG_MPY_12P5X 0x0000000e | ||
| 1051 | #define PLL_CFG_ENPLL 0x00000001 | 1058 | #define PLL_CFG_ENPLL 0x00000001 |
| 1052 | 1059 | ||
| 1053 | #define ESR2_TI_PLL_STS_L (ESR2_BASE + 0x002) | 1060 | #define ESR2_TI_PLL_STS_L (ESR2_BASE + 0x002) |
| @@ -1093,6 +1100,9 @@ | |||
| 1093 | #define PLL_TX_CFG_INVPAIR 0x00000080 | 1100 | #define PLL_TX_CFG_INVPAIR 0x00000080 |
| 1094 | #define PLL_TX_CFG_RATE 0x00000060 | 1101 | #define PLL_TX_CFG_RATE 0x00000060 |
| 1095 | #define PLL_TX_CFG_RATE_SHIFT 5 | 1102 | #define PLL_TX_CFG_RATE_SHIFT 5 |
| 1103 | #define PLL_TX_CFG_RATE_FULL 0x0 | ||
| 1104 | #define PLL_TX_CFG_RATE_HALF 0x20 | ||
| 1105 | #define PLL_TX_CFG_RATE_QUAD 0x40 | ||
| 1096 | #define PLL_TX_CFG_BUSWIDTH 0x0000001c | 1106 | #define PLL_TX_CFG_BUSWIDTH 0x0000001c |
| 1097 | #define PLL_TX_CFG_BUSWIDTH_SHIFT 2 | 1107 | #define PLL_TX_CFG_BUSWIDTH_SHIFT 2 |
| 1098 | #define PLL_TX_CFG_ENTEST 0x00000002 | 1108 | #define PLL_TX_CFG_ENTEST 0x00000002 |
| @@ -1132,6 +1142,9 @@ | |||
| 1132 | #define PLL_RX_CFG_INVPAIR 0x00000080 | 1142 | #define PLL_RX_CFG_INVPAIR 0x00000080 |
| 1133 | #define PLL_RX_CFG_RATE 0x00000060 | 1143 | #define PLL_RX_CFG_RATE 0x00000060 |
| 1134 | #define PLL_RX_CFG_RATE_SHIFT 5 | 1144 | #define PLL_RX_CFG_RATE_SHIFT 5 |
| 1145 | #define PLL_RX_CFG_RATE_FULL 0x0 | ||
| 1146 | #define PLL_RX_CFG_RATE_HALF 0x20 | ||
| 1147 | #define PLL_RX_CFG_RATE_QUAD 0x40 | ||
| 1135 | #define PLL_RX_CFG_BUSWIDTH 0x0000001c | 1148 | #define PLL_RX_CFG_BUSWIDTH 0x0000001c |
| 1136 | #define PLL_RX_CFG_BUSWIDTH_SHIFT 2 | 1149 | #define PLL_RX_CFG_BUSWIDTH_SHIFT 2 |
| 1137 | #define PLL_RX_CFG_ENTEST 0x00000002 | 1150 | #define PLL_RX_CFG_ENTEST 0x00000002 |
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 4aa54794704..eb6411c4694 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
| @@ -227,6 +227,59 @@ static int m88e1111_config_init(struct phy_device *phydev) | |||
| 227 | return 0; | 227 | return 0; |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | static int m88e1118_config_aneg(struct phy_device *phydev) | ||
| 231 | { | ||
| 232 | int err; | ||
| 233 | |||
| 234 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); | ||
| 235 | if (err < 0) | ||
| 236 | return err; | ||
| 237 | |||
| 238 | err = phy_write(phydev, MII_M1011_PHY_SCR, | ||
| 239 | MII_M1011_PHY_SCR_AUTO_CROSS); | ||
| 240 | if (err < 0) | ||
| 241 | return err; | ||
| 242 | |||
| 243 | err = genphy_config_aneg(phydev); | ||
| 244 | return 0; | ||
| 245 | } | ||
| 246 | |||
| 247 | static int m88e1118_config_init(struct phy_device *phydev) | ||
| 248 | { | ||
| 249 | int err; | ||
| 250 | |||
| 251 | /* Change address */ | ||
| 252 | err = phy_write(phydev, 0x16, 0x0002); | ||
| 253 | if (err < 0) | ||
| 254 | return err; | ||
| 255 | |||
| 256 | /* Enable 1000 Mbit */ | ||
| 257 | err = phy_write(phydev, 0x15, 0x1070); | ||
| 258 | if (err < 0) | ||
| 259 | return err; | ||
| 260 | |||
| 261 | /* Change address */ | ||
| 262 | err = phy_write(phydev, 0x16, 0x0003); | ||
| 263 | if (err < 0) | ||
| 264 | return err; | ||
| 265 | |||
| 266 | /* Adjust LED Control */ | ||
| 267 | err = phy_write(phydev, 0x10, 0x021e); | ||
| 268 | if (err < 0) | ||
| 269 | return err; | ||
| 270 | |||
| 271 | /* Reset address */ | ||
| 272 | err = phy_write(phydev, 0x16, 0x0); | ||
| 273 | if (err < 0) | ||
| 274 | return err; | ||
| 275 | |||
| 276 | err = phy_write(phydev, MII_BMCR, BMCR_RESET); | ||
| 277 | if (err < 0) | ||
| 278 | return err; | ||
| 279 | |||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | |||
| 230 | static int m88e1145_config_init(struct phy_device *phydev) | 283 | static int m88e1145_config_init(struct phy_device *phydev) |
| 231 | { | 284 | { |
| 232 | int err; | 285 | int err; |
| @@ -416,6 +469,19 @@ static struct phy_driver marvell_drivers[] = { | |||
| 416 | .driver = { .owner = THIS_MODULE }, | 469 | .driver = { .owner = THIS_MODULE }, |
| 417 | }, | 470 | }, |
| 418 | { | 471 | { |
| 472 | .phy_id = 0x01410e10, | ||
| 473 | .phy_id_mask = 0xfffffff0, | ||
| 474 | .name = "Marvell 88E1118", | ||
| 475 | .features = PHY_GBIT_FEATURES, | ||
| 476 | .flags = PHY_HAS_INTERRUPT, | ||
| 477 | .config_init = &m88e1118_config_init, | ||
| 478 | .config_aneg = &m88e1118_config_aneg, | ||
| 479 | .read_status = &genphy_read_status, | ||
| 480 | .ack_interrupt = &marvell_ack_interrupt, | ||
| 481 | .config_intr = &marvell_config_intr, | ||
| 482 | .driver = {.owner = THIS_MODULE,}, | ||
| 483 | }, | ||
| 484 | { | ||
| 419 | .phy_id = 0x01410cd0, | 485 | .phy_id = 0x01410cd0, |
| 420 | .phy_id_mask = 0xfffffff0, | 486 | .phy_id_mask = 0xfffffff0, |
| 421 | .name = "Marvell 88E1145", | 487 | .name = "Marvell 88E1145", |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index d0ed1ef284a..536bda1f428 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -136,7 +136,7 @@ void mdiobus_unregister(struct mii_bus *bus) | |||
| 136 | BUG_ON(bus->state != MDIOBUS_REGISTERED); | 136 | BUG_ON(bus->state != MDIOBUS_REGISTERED); |
| 137 | bus->state = MDIOBUS_UNREGISTERED; | 137 | bus->state = MDIOBUS_UNREGISTERED; |
| 138 | 138 | ||
| 139 | device_unregister(&bus->dev); | 139 | device_del(&bus->dev); |
| 140 | for (i = 0; i < PHY_MAX_ADDR; i++) { | 140 | for (i = 0; i < PHY_MAX_ADDR; i++) { |
| 141 | if (bus->phy_map[i]) | 141 | if (bus->phy_map[i]) |
| 142 | device_unregister(&bus->phy_map[i]->dev); | 142 | device_unregister(&bus->phy_map[i]->dev); |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index e11b03b2b25..8fb1faca883 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -227,8 +227,8 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr) | |||
| 227 | if (r) | 227 | if (r) |
| 228 | return ERR_PTR(r); | 228 | return ERR_PTR(r); |
| 229 | 229 | ||
| 230 | /* If the phy_id is all Fs, there is no device there */ | 230 | /* If the phy_id is all Fs or all 0s, there is no device there */ |
| 231 | if (0xffffffff == phy_id) | 231 | if ((0xffff == phy_id) || (0x00 == phy_id)) |
| 232 | return NULL; | 232 | return NULL; |
| 233 | 233 | ||
| 234 | dev = phy_device_create(bus, addr, phy_id); | 234 | dev = phy_device_create(bus, addr, phy_id); |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 3cdd07c45b6..508452c0215 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
| @@ -1515,9 +1515,6 @@ static u32 ql_get_link_state(struct ql3_adapter *qdev) | |||
| 1515 | linkState = LS_UP; | 1515 | linkState = LS_UP; |
| 1516 | } else { | 1516 | } else { |
| 1517 | linkState = LS_DOWN; | 1517 | linkState = LS_DOWN; |
| 1518 | if (netif_msg_link(qdev)) | ||
| 1519 | printk(KERN_WARNING PFX | ||
| 1520 | "%s: Link is down.\n", qdev->ndev->name); | ||
| 1521 | } | 1518 | } |
| 1522 | return linkState; | 1519 | return linkState; |
| 1523 | } | 1520 | } |
| @@ -1581,10 +1578,6 @@ static int ql_finish_auto_neg(struct ql3_adapter *qdev) | |||
| 1581 | ql_mac_enable(qdev, 1); | 1578 | ql_mac_enable(qdev, 1); |
| 1582 | } | 1579 | } |
| 1583 | 1580 | ||
| 1584 | if (netif_msg_link(qdev)) | ||
| 1585 | printk(KERN_DEBUG PFX | ||
| 1586 | "%s: Change port_link_state LS_DOWN to LS_UP.\n", | ||
| 1587 | qdev->ndev->name); | ||
| 1588 | qdev->port_link_state = LS_UP; | 1581 | qdev->port_link_state = LS_UP; |
| 1589 | netif_start_queue(qdev->ndev); | 1582 | netif_start_queue(qdev->ndev); |
| 1590 | netif_carrier_on(qdev->ndev); | 1583 | netif_carrier_on(qdev->ndev); |
| @@ -1655,14 +1648,9 @@ static void ql_link_state_machine_work(struct work_struct *work) | |||
| 1655 | /* Fall Through */ | 1648 | /* Fall Through */ |
| 1656 | 1649 | ||
| 1657 | case LS_DOWN: | 1650 | case LS_DOWN: |
| 1658 | if (netif_msg_link(qdev)) | ||
| 1659 | printk(KERN_DEBUG PFX | ||
| 1660 | "%s: port_link_state = LS_DOWN.\n", | ||
| 1661 | qdev->ndev->name); | ||
| 1662 | if (curr_link_state == LS_UP) { | 1651 | if (curr_link_state == LS_UP) { |
| 1663 | if (netif_msg_link(qdev)) | 1652 | if (netif_msg_link(qdev)) |
| 1664 | printk(KERN_DEBUG PFX | 1653 | printk(KERN_INFO PFX "%s: Link is up.\n", |
| 1665 | "%s: curr_link_state = LS_UP.\n", | ||
| 1666 | qdev->ndev->name); | 1654 | qdev->ndev->name); |
| 1667 | if (ql_is_auto_neg_complete(qdev)) | 1655 | if (ql_is_auto_neg_complete(qdev)) |
| 1668 | ql_finish_auto_neg(qdev); | 1656 | ql_finish_auto_neg(qdev); |
| @@ -1670,6 +1658,7 @@ static void ql_link_state_machine_work(struct work_struct *work) | |||
| 1670 | if (qdev->port_link_state == LS_UP) | 1658 | if (qdev->port_link_state == LS_UP) |
| 1671 | ql_link_down_detect_clear(qdev); | 1659 | ql_link_down_detect_clear(qdev); |
| 1672 | 1660 | ||
| 1661 | qdev->port_link_state = LS_UP; | ||
| 1673 | } | 1662 | } |
| 1674 | break; | 1663 | break; |
| 1675 | 1664 | ||
| @@ -1678,12 +1667,14 @@ static void ql_link_state_machine_work(struct work_struct *work) | |||
| 1678 | * See if the link is currently down or went down and came | 1667 | * See if the link is currently down or went down and came |
| 1679 | * back up | 1668 | * back up |
| 1680 | */ | 1669 | */ |
| 1681 | if ((curr_link_state == LS_DOWN) || ql_link_down_detect(qdev)) { | 1670 | if (curr_link_state == LS_DOWN) { |
| 1682 | if (netif_msg_link(qdev)) | 1671 | if (netif_msg_link(qdev)) |
| 1683 | printk(KERN_INFO PFX "%s: Link is down.\n", | 1672 | printk(KERN_INFO PFX "%s: Link is down.\n", |
| 1684 | qdev->ndev->name); | 1673 | qdev->ndev->name); |
| 1685 | qdev->port_link_state = LS_DOWN; | 1674 | qdev->port_link_state = LS_DOWN; |
| 1686 | } | 1675 | } |
| 1676 | if (ql_link_down_detect(qdev)) | ||
| 1677 | qdev->port_link_state = LS_DOWN; | ||
| 1687 | break; | 1678 | break; |
| 1688 | } | 1679 | } |
| 1689 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1680 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index fa98af58223..cd0d0873d97 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
| @@ -174,8 +174,8 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = { | |||
| 174 | 174 | ||
| 175 | /* EEPROM range with gPXE configuration */ | 175 | /* EEPROM range with gPXE configuration */ |
| 176 | #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB | 176 | #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB |
| 177 | #define EFX_ETHTOOL_EEPROM_MIN 0x100U | 177 | #define EFX_ETHTOOL_EEPROM_MIN 0x800U |
| 178 | #define EFX_ETHTOOL_EEPROM_MAX 0x400U | 178 | #define EFX_ETHTOOL_EEPROM_MAX 0x1800U |
| 179 | 179 | ||
| 180 | /************************************************************************** | 180 | /************************************************************************** |
| 181 | * | 181 | * |
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index f59c7772f34..1f26ab0e798 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
| @@ -499,7 +499,7 @@ static void smc911x_hardware_send_pkt(struct net_device *dev) | |||
| 499 | #else | 499 | #else |
| 500 | SMC_PUSH_DATA(lp, buf, len); | 500 | SMC_PUSH_DATA(lp, buf, len); |
| 501 | dev->trans_start = jiffies; | 501 | dev->trans_start = jiffies; |
| 502 | dev_kfree_skb(skb); | 502 | dev_kfree_skb_irq(skb); |
| 503 | #endif | 503 | #endif |
| 504 | if (!lp->tx_throttle) { | 504 | if (!lp->tx_throttle) { |
| 505 | netif_wake_queue(dev); | 505 | netif_wake_queue(dev); |
| @@ -2050,7 +2050,9 @@ err_out: | |||
| 2050 | */ | 2050 | */ |
| 2051 | static int smc911x_drv_probe(struct platform_device *pdev) | 2051 | static int smc911x_drv_probe(struct platform_device *pdev) |
| 2052 | { | 2052 | { |
| 2053 | #ifdef SMC_DYNAMIC_BUS_CONFIG | ||
| 2053 | struct smc911x_platdata *pd = pdev->dev.platform_data; | 2054 | struct smc911x_platdata *pd = pdev->dev.platform_data; |
| 2055 | #endif | ||
| 2054 | struct net_device *ndev; | 2056 | struct net_device *ndev; |
| 2055 | struct resource *res; | 2057 | struct resource *res; |
| 2056 | struct smc911x_local *lp; | 2058 | struct smc911x_local *lp; |
| @@ -2182,9 +2184,9 @@ static int smc911x_drv_resume(struct platform_device *dev) | |||
| 2182 | 2184 | ||
| 2183 | if (netif_running(ndev)) { | 2185 | if (netif_running(ndev)) { |
| 2184 | smc911x_reset(ndev); | 2186 | smc911x_reset(ndev); |
| 2185 | smc911x_enable(ndev); | ||
| 2186 | if (lp->phy_type != 0) | 2187 | if (lp->phy_type != 0) |
| 2187 | smc911x_phy_configure(&lp->phy_configure); | 2188 | smc911x_phy_configure(&lp->phy_configure); |
| 2189 | smc911x_enable(ndev); | ||
| 2188 | netif_device_attach(ndev); | 2190 | netif_device_attach(ndev); |
| 2189 | } | 2191 | } |
| 2190 | } | 2192 | } |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 6f9895d4e5b..fc80f250da3 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
| @@ -2060,6 +2060,7 @@ static int smc_request_attrib(struct platform_device *pdev, | |||
| 2060 | struct net_device *ndev) | 2060 | struct net_device *ndev) |
| 2061 | { | 2061 | { |
| 2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
| 2063 | struct smc_local *lp __maybe_unused = netdev_priv(ndev); | ||
| 2063 | 2064 | ||
| 2064 | if (!res) | 2065 | if (!res) |
| 2065 | return 0; | 2066 | return 0; |
| @@ -2074,6 +2075,7 @@ static void smc_release_attrib(struct platform_device *pdev, | |||
| 2074 | struct net_device *ndev) | 2075 | struct net_device *ndev) |
| 2075 | { | 2076 | { |
| 2076 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2077 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
| 2078 | struct smc_local *lp __maybe_unused = netdev_priv(ndev); | ||
| 2077 | 2079 | ||
| 2078 | if (res) | 2080 | if (res) |
| 2079 | release_mem_region(res->start, ATTRIB_SIZE); | 2081 | release_mem_region(res->start, ATTRIB_SIZE); |
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c index cfbbfee5583..68a7f541413 100644 --- a/drivers/net/ucc_geth_ethtool.c +++ b/drivers/net/ucc_geth_ethtool.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
| 38 | #include <asm/uaccess.h> | 38 | #include <asm/uaccess.h> |
| 39 | #include <asm/types.h> | 39 | #include <asm/types.h> |
| 40 | #include <asm/uaccess.h> | ||
| 41 | 40 | ||
| 42 | #include "ucc_geth.h" | 41 | #include "ucc_geth.h" |
| 43 | #include "ucc_geth_mii.h" | 42 | #include "ucc_geth_mii.h" |
| @@ -324,17 +323,17 @@ static void uec_get_ethtool_stats(struct net_device *netdev, | |||
| 324 | if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE) { | 323 | if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE) { |
| 325 | base = (u32 __iomem *)&ugeth->ug_regs->tx64; | 324 | base = (u32 __iomem *)&ugeth->ug_regs->tx64; |
| 326 | for (i = 0; i < UEC_HW_STATS_LEN; i++) | 325 | for (i = 0; i < UEC_HW_STATS_LEN; i++) |
| 327 | data[j++] = (u64)in_be32(&base[i]); | 326 | data[j++] = in_be32(&base[i]); |
| 328 | } | 327 | } |
| 329 | if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX) { | 328 | if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX) { |
| 330 | base = (u32 __iomem *)ugeth->p_tx_fw_statistics_pram; | 329 | base = (u32 __iomem *)ugeth->p_tx_fw_statistics_pram; |
| 331 | for (i = 0; i < UEC_TX_FW_STATS_LEN; i++) | 330 | for (i = 0; i < UEC_TX_FW_STATS_LEN; i++) |
| 332 | data[j++] = (u64)in_be32(&base[i]); | 331 | data[j++] = base ? in_be32(&base[i]) : 0; |
| 333 | } | 332 | } |
| 334 | if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) { | 333 | if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) { |
| 335 | base = (u32 __iomem *)ugeth->p_rx_fw_statistics_pram; | 334 | base = (u32 __iomem *)ugeth->p_rx_fw_statistics_pram; |
| 336 | for (i = 0; i < UEC_RX_FW_STATS_LEN; i++) | 335 | for (i = 0; i < UEC_RX_FW_STATS_LEN; i++) |
| 337 | data[j++] = (u64)in_be32(&base[i]); | 336 | data[j++] = base ? in_be32(&base[i]) : 0; |
| 338 | } | 337 | } |
| 339 | } | 338 | } |
| 340 | 339 | ||
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 37ecf845edf..e12cdb4543b 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
| @@ -1444,6 +1444,10 @@ static const struct usb_device_id products [] = { | |||
| 1444 | // Apple USB Ethernet Adapter | 1444 | // Apple USB Ethernet Adapter |
| 1445 | USB_DEVICE(0x05ac, 0x1402), | 1445 | USB_DEVICE(0x05ac, 0x1402), |
| 1446 | .driver_info = (unsigned long) &ax88772_info, | 1446 | .driver_info = (unsigned long) &ax88772_info, |
| 1447 | }, { | ||
| 1448 | // Cables-to-Go USB Ethernet Adapter | ||
| 1449 | USB_DEVICE(0x0b95, 0x772a), | ||
| 1450 | .driver_info = (unsigned long) &ax88772_info, | ||
| 1447 | }, | 1451 | }, |
| 1448 | { }, // END | 1452 | { }, // END |
| 1449 | }; | 1453 | }; |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 1164c52e2c0..8e90891f0e4 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -2184,19 +2184,20 @@ static void hso_create_rfkill(struct hso_device *hso_dev, | |||
| 2184 | struct usb_interface *interface) | 2184 | struct usb_interface *interface) |
| 2185 | { | 2185 | { |
| 2186 | struct hso_net *hso_net = dev2net(hso_dev); | 2186 | struct hso_net *hso_net = dev2net(hso_dev); |
| 2187 | struct device *dev = hso_dev->dev; | 2187 | struct device *dev = &hso_net->net->dev; |
| 2188 | char *rfkn; | 2188 | char *rfkn; |
| 2189 | 2189 | ||
| 2190 | hso_net->rfkill = rfkill_allocate(&interface_to_usbdev(interface)->dev, | 2190 | hso_net->rfkill = rfkill_allocate(&interface_to_usbdev(interface)->dev, |
| 2191 | RFKILL_TYPE_WLAN); | 2191 | RFKILL_TYPE_WWAN); |
| 2192 | if (!hso_net->rfkill) { | 2192 | if (!hso_net->rfkill) { |
| 2193 | dev_err(dev, "%s - Out of memory", __func__); | 2193 | dev_err(dev, "%s - Out of memory\n", __func__); |
| 2194 | return; | 2194 | return; |
| 2195 | } | 2195 | } |
| 2196 | rfkn = kzalloc(20, GFP_KERNEL); | 2196 | rfkn = kzalloc(20, GFP_KERNEL); |
| 2197 | if (!rfkn) { | 2197 | if (!rfkn) { |
| 2198 | rfkill_free(hso_net->rfkill); | 2198 | rfkill_free(hso_net->rfkill); |
| 2199 | dev_err(dev, "%s - Out of memory", __func__); | 2199 | hso_net->rfkill = NULL; |
| 2200 | dev_err(dev, "%s - Out of memory\n", __func__); | ||
| 2200 | return; | 2201 | return; |
| 2201 | } | 2202 | } |
| 2202 | snprintf(rfkn, 20, "hso-%d", | 2203 | snprintf(rfkn, 20, "hso-%d", |
| @@ -2209,7 +2210,8 @@ static void hso_create_rfkill(struct hso_device *hso_dev, | |||
| 2209 | kfree(rfkn); | 2210 | kfree(rfkn); |
| 2210 | hso_net->rfkill->name = NULL; | 2211 | hso_net->rfkill->name = NULL; |
| 2211 | rfkill_free(hso_net->rfkill); | 2212 | rfkill_free(hso_net->rfkill); |
| 2212 | dev_err(dev, "%s - Failed to register rfkill", __func__); | 2213 | hso_net->rfkill = NULL; |
| 2214 | dev_err(dev, "%s - Failed to register rfkill\n", __func__); | ||
| 2213 | return; | 2215 | return; |
| 2214 | } | 2216 | } |
| 2215 | } | 2217 | } |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 3590ea5a902..11cb3e504e1 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
| @@ -2296,7 +2296,7 @@ static void velocity_set_multi(struct net_device *dev) | |||
| 2296 | } | 2296 | } |
| 2297 | 2297 | ||
| 2298 | mac_set_cam_mask(regs, vptr->mCAMmask); | 2298 | mac_set_cam_mask(regs, vptr->mCAMmask); |
| 2299 | rx_mode = (RCR_AM | RCR_AB); | 2299 | rx_mode = RCR_AM | RCR_AB | RCR_AP; |
| 2300 | } | 2300 | } |
| 2301 | if (dev->mtu > 1500) | 2301 | if (dev->mtu > 1500) |
| 2302 | rx_mode |= RCR_AL; | 2302 | rx_mode |= RCR_AL; |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 9e47d727e22..cfd4d052d66 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
| @@ -2942,8 +2942,10 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
| 2942 | sc->opmode != NL80211_IFTYPE_MESH_POINT && | 2942 | sc->opmode != NL80211_IFTYPE_MESH_POINT && |
| 2943 | test_bit(ATH_STAT_PROMISC, sc->status)) | 2943 | test_bit(ATH_STAT_PROMISC, sc->status)) |
| 2944 | rfilt |= AR5K_RX_FILTER_PROM; | 2944 | rfilt |= AR5K_RX_FILTER_PROM; |
| 2945 | if (sc->opmode == NL80211_IFTYPE_ADHOC) | 2945 | if (sc->opmode == NL80211_IFTYPE_STATION || |
| 2946 | sc->opmode == NL80211_IFTYPE_ADHOC) { | ||
| 2946 | rfilt |= AR5K_RX_FILTER_BEACON; | 2947 | rfilt |= AR5K_RX_FILTER_BEACON; |
| 2948 | } | ||
| 2947 | 2949 | ||
| 2948 | /* Set filters */ | 2950 | /* Set filters */ |
| 2949 | ath5k_hw_set_rx_filter(ah,rfilt); | 2951 | ath5k_hw_set_rx_filter(ah,rfilt); |
diff --git a/drivers/net/wireless/ath5k/desc.c b/drivers/net/wireless/ath5k/desc.c index dd1374052ba..5e362a7a362 100644 --- a/drivers/net/wireless/ath5k/desc.c +++ b/drivers/net/wireless/ath5k/desc.c | |||
| @@ -531,10 +531,10 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, | |||
| 531 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 531 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
| 532 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 532 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
| 533 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); | 533 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); |
| 534 | rs->rs_antenna = rx_status->rx_status_0 & | 534 | rs->rs_antenna = AR5K_REG_MS(rx_status->rx_status_0, |
| 535 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 535 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA); |
| 536 | rs->rs_more = rx_status->rx_status_0 & | 536 | rs->rs_more = !!(rx_status->rx_status_0 & |
| 537 | AR5K_5210_RX_DESC_STATUS0_MORE; | 537 | AR5K_5210_RX_DESC_STATUS0_MORE); |
| 538 | /* TODO: this timestamp is 13 bit, later on we assume 15 bit */ | 538 | /* TODO: this timestamp is 13 bit, later on we assume 15 bit */ |
| 539 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 539 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
| 540 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 540 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
| @@ -607,10 +607,10 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, | |||
| 607 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 607 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
| 608 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 608 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
| 609 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); | 609 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); |
| 610 | rs->rs_antenna = rx_status->rx_status_0 & | 610 | rs->rs_antenna = AR5K_REG_MS(rx_status->rx_status_0, |
| 611 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 611 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA); |
| 612 | rs->rs_more = rx_status->rx_status_0 & | 612 | rs->rs_more = !!(rx_status->rx_status_0 & |
| 613 | AR5K_5212_RX_DESC_STATUS0_MORE; | 613 | AR5K_5212_RX_DESC_STATUS0_MORE); |
| 614 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 614 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
| 615 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 615 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
| 616 | rs->rs_status = 0; | 616 | rs->rs_status = 0; |
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h index ffdf4876121..a68f97c3935 100644 --- a/drivers/net/wireless/hostap/hostap_wlan.h +++ b/drivers/net/wireless/hostap/hostap_wlan.h | |||
| @@ -918,9 +918,12 @@ struct hostap_interface { | |||
| 918 | 918 | ||
| 919 | /* | 919 | /* |
| 920 | * TX meta data - stored in skb->cb buffer, so this must not be increased over | 920 | * TX meta data - stored in skb->cb buffer, so this must not be increased over |
| 921 | * the 40-byte limit | 921 | * the 48-byte limit. |
| 922 | * THE PADDING THIS STARTS WITH IS A HORRIBLE HACK THAT SHOULD NOT LIVE | ||
| 923 | * TO SEE THE DAY. | ||
| 922 | */ | 924 | */ |
| 923 | struct hostap_skb_tx_data { | 925 | struct hostap_skb_tx_data { |
| 926 | unsigned int __padding_for_default_qdiscs; | ||
| 924 | u32 magic; /* HOSTAP_SKB_TX_DATA_MAGIC */ | 927 | u32 magic; /* HOSTAP_SKB_TX_DATA_MAGIC */ |
| 925 | u8 rate; /* transmit rate */ | 928 | u8 rate; /* transmit rate */ |
| 926 | #define HOSTAP_TX_FLAGS_WDS BIT(0) | 929 | #define HOSTAP_TX_FLAGS_WDS BIT(0) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 321dbc8c034..8d690a0eb1a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
| @@ -3252,7 +3252,11 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
| 3252 | return; | 3252 | return; |
| 3253 | } | 3253 | } |
| 3254 | 3254 | ||
| 3255 | iwl_scan_cancel_timeout(priv, 100); | 3255 | if (iwl_scan_cancel(priv)) { |
| 3256 | /* cancel scan failed, just live w/ bad key and rely | ||
| 3257 | briefly on SW decryption */ | ||
| 3258 | return; | ||
| 3259 | } | ||
| 3256 | 3260 | ||
| 3257 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | 3261 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); |
| 3258 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | 3262 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 3b0bee331a3..c89365e2ca5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
| @@ -896,6 +896,13 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
| 896 | return; | 896 | return; |
| 897 | 897 | ||
| 898 | done: | 898 | done: |
| 899 | /* Cannot perform scan. Make sure we clear scanning | ||
| 900 | * bits from status so next scan request can be performed. | ||
| 901 | * If we don't clear scanning status bit here all next scan | ||
| 902 | * will fail | ||
| 903 | */ | ||
| 904 | clear_bit(STATUS_SCAN_HW, &priv->status); | ||
| 905 | clear_bit(STATUS_SCANNING, &priv->status); | ||
| 899 | /* inform mac80211 scan aborted */ | 906 | /* inform mac80211 scan aborted */ |
| 900 | queue_work(priv->workqueue, &priv->scan_completed); | 907 | queue_work(priv->workqueue, &priv->scan_completed); |
| 901 | mutex_unlock(&priv->mutex); | 908 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d15a2c99795..285b53e7e26 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
| @@ -5768,7 +5768,6 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) | |||
| 5768 | if (priv->error_recovering) | 5768 | if (priv->error_recovering) |
| 5769 | iwl3945_error_recovery(priv); | 5769 | iwl3945_error_recovery(priv); |
| 5770 | 5770 | ||
| 5771 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
| 5772 | return; | 5771 | return; |
| 5773 | 5772 | ||
| 5774 | restart: | 5773 | restart: |
| @@ -6013,6 +6012,7 @@ static void iwl3945_bg_alive_start(struct work_struct *data) | |||
| 6013 | mutex_lock(&priv->mutex); | 6012 | mutex_lock(&priv->mutex); |
| 6014 | iwl3945_alive_start(priv); | 6013 | iwl3945_alive_start(priv); |
| 6015 | mutex_unlock(&priv->mutex); | 6014 | mutex_unlock(&priv->mutex); |
| 6015 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
| 6016 | } | 6016 | } |
| 6017 | 6017 | ||
| 6018 | static void iwl3945_bg_rf_kill(struct work_struct *work) | 6018 | static void iwl3945_bg_rf_kill(struct work_struct *work) |
| @@ -6256,6 +6256,11 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
| 6256 | n_probes, | 6256 | n_probes, |
| 6257 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); | 6257 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); |
| 6258 | 6258 | ||
| 6259 | if (scan->channel_count == 0) { | ||
| 6260 | IWL_DEBUG_SCAN("channel count %d\n", scan->channel_count); | ||
| 6261 | goto done; | ||
| 6262 | } | ||
| 6263 | |||
| 6259 | cmd.len += le16_to_cpu(scan->tx_cmd.len) + | 6264 | cmd.len += le16_to_cpu(scan->tx_cmd.len) + |
| 6260 | scan->channel_count * sizeof(struct iwl3945_scan_channel); | 6265 | scan->channel_count * sizeof(struct iwl3945_scan_channel); |
| 6261 | cmd.data = scan; | 6266 | cmd.data = scan; |
| @@ -6273,6 +6278,14 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
| 6273 | return; | 6278 | return; |
| 6274 | 6279 | ||
| 6275 | done: | 6280 | done: |
| 6281 | /* can not perform scan make sure we clear scanning | ||
| 6282 | * bits from status so next scan request can be performed. | ||
| 6283 | * if we dont clear scanning status bit here all next scan | ||
| 6284 | * will fail | ||
| 6285 | */ | ||
| 6286 | clear_bit(STATUS_SCAN_HW, &priv->status); | ||
| 6287 | clear_bit(STATUS_SCANNING, &priv->status); | ||
| 6288 | |||
| 6276 | /* inform mac80211 scan aborted */ | 6289 | /* inform mac80211 scan aborted */ |
| 6277 | queue_work(priv->workqueue, &priv->scan_completed); | 6290 | queue_work(priv->workqueue, &priv->scan_completed); |
| 6278 | mutex_unlock(&priv->mutex); | 6291 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index 431e3c78bf2..69eb0132593 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c | |||
| @@ -48,6 +48,9 @@ static struct usb_device_id rtl8187_table[] __devinitdata = { | |||
| 48 | {USB_DEVICE(0x03f0, 0xca02), .driver_info = DEVICE_RTL8187}, | 48 | {USB_DEVICE(0x03f0, 0xca02), .driver_info = DEVICE_RTL8187}, |
| 49 | /* Sitecom */ | 49 | /* Sitecom */ |
| 50 | {USB_DEVICE(0x0df6, 0x000d), .driver_info = DEVICE_RTL8187}, | 50 | {USB_DEVICE(0x0df6, 0x000d), .driver_info = DEVICE_RTL8187}, |
| 51 | {USB_DEVICE(0x0df6, 0x0028), .driver_info = DEVICE_RTL8187B}, | ||
| 52 | /* Abocom */ | ||
| 53 | {USB_DEVICE(0x13d1, 0xabe6), .driver_info = DEVICE_RTL8187}, | ||
| 51 | {} | 54 | {} |
| 52 | }; | 55 | }; |
| 53 | 56 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index a60ae86bd5c..a3ccd8c1c71 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
| @@ -61,6 +61,7 @@ static struct usb_device_id usb_ids[] = { | |||
| 61 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, | 61 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, |
| 62 | /* ZD1211B */ | 62 | /* ZD1211B */ |
| 63 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, | 63 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, |
| 64 | { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, | ||
| 64 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, | 65 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, |
| 65 | { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, | 66 | { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, |
| 66 | { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, | 67 | { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, |
| @@ -82,6 +83,7 @@ static struct usb_device_id usb_ids[] = { | |||
| 82 | { USB_DEVICE(0x0cde, 0x001a), .driver_info = DEVICE_ZD1211B }, | 83 | { USB_DEVICE(0x0cde, 0x001a), .driver_info = DEVICE_ZD1211B }, |
| 83 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, | 84 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, |
| 84 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, | 85 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, |
| 86 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, | ||
| 85 | /* "Driverless" devices that need ejecting */ | 87 | /* "Driverless" devices that need ejecting */ |
| 86 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 88 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
| 87 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | 89 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, |
