aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r--drivers/net/igb/igb_main.c74
1 files changed, 71 insertions, 3 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 3666b967846a..b4f92b06f2ac 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -50,7 +50,12 @@
50#endif 50#endif
51#include "igb.h" 51#include "igb.h"
52 52
53#define DRV_VERSION "2.4.13-k2" 53#define MAJ 3
54#define MIN 0
55#define BUILD 6
56#define KFIX 2
57#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
58__stringify(BUILD) "-k" __stringify(KFIX)
54char igb_driver_name[] = "igb"; 59char igb_driver_name[] = "igb";
55char igb_driver_version[] = DRV_VERSION; 60char igb_driver_version[] = DRV_VERSION;
56static const char igb_driver_string[] = 61static const char igb_driver_string[] =
@@ -1674,7 +1679,58 @@ void igb_reset(struct igb_adapter *adapter)
1674 1679
1675 if (hw->mac.ops.init_hw(hw)) 1680 if (hw->mac.ops.init_hw(hw))
1676 dev_err(&pdev->dev, "Hardware Error\n"); 1681 dev_err(&pdev->dev, "Hardware Error\n");
1682 if (hw->mac.type > e1000_82580) {
1683 if (adapter->flags & IGB_FLAG_DMAC) {
1684 u32 reg;
1677 1685
1686 /*
1687 * DMA Coalescing high water mark needs to be higher
1688 * than * the * Rx threshold. The Rx threshold is
1689 * currently * pba - 6, so we * should use a high water
1690 * mark of pba * - 4. */
1691 hwm = (pba - 4) << 10;
1692
1693 reg = (((pba-6) << E1000_DMACR_DMACTHR_SHIFT)
1694 & E1000_DMACR_DMACTHR_MASK);
1695
1696 /* transition to L0x or L1 if available..*/
1697 reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK);
1698
1699 /* watchdog timer= +-1000 usec in 32usec intervals */
1700 reg |= (1000 >> 5);
1701 wr32(E1000_DMACR, reg);
1702
1703 /* no lower threshold to disable coalescing(smart fifb)
1704 * -UTRESH=0*/
1705 wr32(E1000_DMCRTRH, 0);
1706
1707 /* set hwm to PBA - 2 * max frame size */
1708 wr32(E1000_FCRTC, hwm);
1709
1710 /*
1711 * This sets the time to wait before requesting tran-
1712 * sition to * low power state to number of usecs needed
1713 * to receive 1 512 * byte frame at gigabit line rate
1714 */
1715 reg = rd32(E1000_DMCTLX);
1716 reg |= IGB_DMCTLX_DCFLUSH_DIS;
1717
1718 /* Delay 255 usec before entering Lx state. */
1719 reg |= 0xFF;
1720 wr32(E1000_DMCTLX, reg);
1721
1722 /* free space in Tx packet buffer to wake from DMAC */
1723 wr32(E1000_DMCTXTH,
1724 (IGB_MIN_TXPBSIZE -
1725 (IGB_TX_BUF_4096 + adapter->max_frame_size))
1726 >> 6);
1727
1728 /* make low power state decision controlled by DMAC */
1729 reg = rd32(E1000_PCIEMISC);
1730 reg |= E1000_PCIEMISC_LX_DECISION;
1731 wr32(E1000_PCIEMISC, reg);
1732 } /* end if IGB_FLAG_DMAC set */
1733 }
1678 if (hw->mac.type == e1000_82580) { 1734 if (hw->mac.type == e1000_82580) {
1679 u32 reg = rd32(E1000_PCIEMISC); 1735 u32 reg = rd32(E1000_PCIEMISC);
1680 wr32(E1000_PCIEMISC, 1736 wr32(E1000_PCIEMISC,
@@ -1884,7 +1940,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1884 hw->mac.ops.reset_hw(hw); 1940 hw->mac.ops.reset_hw(hw);
1885 1941
1886 /* make sure the NVM is good */ 1942 /* make sure the NVM is good */
1887 if (igb_validate_nvm_checksum(hw) < 0) { 1943 if (hw->nvm.ops.validate(hw) < 0) {
1888 dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n"); 1944 dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n");
1889 err = -EIO; 1945 err = -EIO;
1890 goto err_eeprom; 1946 goto err_eeprom;
@@ -2014,7 +2070,13 @@ static int __devinit igb_probe(struct pci_dev *pdev,
2014 adapter->msix_entries ? "MSI-X" : 2070 adapter->msix_entries ? "MSI-X" :
2015 (adapter->flags & IGB_FLAG_HAS_MSI) ? "MSI" : "legacy", 2071 (adapter->flags & IGB_FLAG_HAS_MSI) ? "MSI" : "legacy",
2016 adapter->num_rx_queues, adapter->num_tx_queues); 2072 adapter->num_rx_queues, adapter->num_tx_queues);
2017 2073 switch (hw->mac.type) {
2074 case e1000_i350:
2075 igb_set_eee_i350(hw);
2076 break;
2077 default:
2078 break;
2079 }
2018 return 0; 2080 return 0;
2019 2081
2020err_register: 2082err_register:
@@ -2151,6 +2213,9 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
2151 random_ether_addr(mac_addr); 2213 random_ether_addr(mac_addr);
2152 igb_set_vf_mac(adapter, i, mac_addr); 2214 igb_set_vf_mac(adapter, i, mac_addr);
2153 } 2215 }
2216 /* DMA Coalescing is not supported in IOV mode. */
2217 if (adapter->flags & IGB_FLAG_DMAC)
2218 adapter->flags &= ~IGB_FLAG_DMAC;
2154 } 2219 }
2155#endif /* CONFIG_PCI_IOV */ 2220#endif /* CONFIG_PCI_IOV */
2156} 2221}
@@ -2325,6 +2390,9 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
2325 /* Explicitly disable IRQ since the NIC can be in any state. */ 2390 /* Explicitly disable IRQ since the NIC can be in any state. */
2326 igb_irq_disable(adapter); 2391 igb_irq_disable(adapter);
2327 2392
2393 if (hw->mac.type == e1000_i350)
2394 adapter->flags &= ~IGB_FLAG_DMAC;
2395
2328 set_bit(__IGB_DOWN, &adapter->state); 2396 set_bit(__IGB_DOWN, &adapter->state);
2329 return 0; 2397 return 0;
2330} 2398}