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.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 2c28621eb30b..d6c4bd8438ec 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -54,9 +54,8 @@
54#define MAJ 3 54#define MAJ 3
55#define MIN 0 55#define MIN 0
56#define BUILD 6 56#define BUILD 6
57#define KFIX 2
58#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ 57#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
59__stringify(BUILD) "-k" __stringify(KFIX) 58__stringify(BUILD) "-k"
60char igb_driver_name[] = "igb"; 59char igb_driver_name[] = "igb";
61char igb_driver_version[] = DRV_VERSION; 60char igb_driver_version[] = DRV_VERSION;
62static const char igb_driver_string[] = 61static const char igb_driver_string[] =
@@ -1749,6 +1748,21 @@ void igb_reset(struct igb_adapter *adapter)
1749 igb_get_phy_info(hw); 1748 igb_get_phy_info(hw);
1750} 1749}
1751 1750
1751static int igb_set_features(struct net_device *netdev, u32 features)
1752{
1753 struct igb_adapter *adapter = netdev_priv(netdev);
1754 int i;
1755
1756 for (i = 0; i < adapter->num_rx_queues; i++) {
1757 if (features & NETIF_F_RXCSUM)
1758 adapter->rx_ring[i]->flags |= IGB_RING_FLAG_RX_CSUM;
1759 else
1760 adapter->rx_ring[i]->flags &= ~IGB_RING_FLAG_RX_CSUM;
1761 }
1762
1763 return 0;
1764}
1765
1752static const struct net_device_ops igb_netdev_ops = { 1766static const struct net_device_ops igb_netdev_ops = {
1753 .ndo_open = igb_open, 1767 .ndo_open = igb_open,
1754 .ndo_stop = igb_close, 1768 .ndo_stop = igb_close,
@@ -1771,6 +1785,7 @@ static const struct net_device_ops igb_netdev_ops = {
1771#ifdef CONFIG_NET_POLL_CONTROLLER 1785#ifdef CONFIG_NET_POLL_CONTROLLER
1772 .ndo_poll_controller = igb_netpoll, 1786 .ndo_poll_controller = igb_netpoll,
1773#endif 1787#endif
1788 .ndo_set_features = igb_set_features,
1774}; 1789};
1775 1790
1776/** 1791/**
@@ -1910,17 +1925,18 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1910 dev_info(&pdev->dev, 1925 dev_info(&pdev->dev,
1911 "PHY reset is blocked due to SOL/IDER session.\n"); 1926 "PHY reset is blocked due to SOL/IDER session.\n");
1912 1927
1913 netdev->features = NETIF_F_SG | 1928 netdev->hw_features = NETIF_F_SG |
1914 NETIF_F_IP_CSUM | 1929 NETIF_F_IP_CSUM |
1930 NETIF_F_IPV6_CSUM |
1931 NETIF_F_TSO |
1932 NETIF_F_TSO6 |
1933 NETIF_F_RXCSUM;
1934
1935 netdev->features = netdev->hw_features |
1915 NETIF_F_HW_VLAN_TX | 1936 NETIF_F_HW_VLAN_TX |
1916 NETIF_F_HW_VLAN_RX | 1937 NETIF_F_HW_VLAN_RX |
1917 NETIF_F_HW_VLAN_FILTER; 1938 NETIF_F_HW_VLAN_FILTER;
1918 1939
1919 netdev->features |= NETIF_F_IPV6_CSUM;
1920 netdev->features |= NETIF_F_TSO;
1921 netdev->features |= NETIF_F_TSO6;
1922 netdev->features |= NETIF_F_GRO;
1923
1924 netdev->vlan_features |= NETIF_F_TSO; 1940 netdev->vlan_features |= NETIF_F_TSO;
1925 netdev->vlan_features |= NETIF_F_TSO6; 1941 netdev->vlan_features |= NETIF_F_TSO6;
1926 netdev->vlan_features |= NETIF_F_IP_CSUM; 1942 netdev->vlan_features |= NETIF_F_IP_CSUM;
@@ -1932,8 +1948,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1932 netdev->vlan_features |= NETIF_F_HIGHDMA; 1948 netdev->vlan_features |= NETIF_F_HIGHDMA;
1933 } 1949 }
1934 1950
1935 if (hw->mac.type >= e1000_82576) 1951 if (hw->mac.type >= e1000_82576) {
1952 netdev->hw_features |= NETIF_F_SCTP_CSUM;
1936 netdev->features |= NETIF_F_SCTP_CSUM; 1953 netdev->features |= NETIF_F_SCTP_CSUM;
1954 }
1937 1955
1938 adapter->en_mng_pt = igb_enable_mng_pass_thru(hw); 1956 adapter->en_mng_pt = igb_enable_mng_pass_thru(hw);
1939 1957
@@ -6249,7 +6267,7 @@ s32 igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
6249 struct igb_adapter *adapter = hw->back; 6267 struct igb_adapter *adapter = hw->back;
6250 u16 cap_offset; 6268 u16 cap_offset;
6251 6269
6252 cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP); 6270 cap_offset = adapter->pdev->pcie_cap;
6253 if (!cap_offset) 6271 if (!cap_offset)
6254 return -E1000_ERR_CONFIG; 6272 return -E1000_ERR_CONFIG;
6255 6273
@@ -6263,7 +6281,7 @@ s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
6263 struct igb_adapter *adapter = hw->back; 6281 struct igb_adapter *adapter = hw->back;
6264 u16 cap_offset; 6282 u16 cap_offset;
6265 6283
6266 cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP); 6284 cap_offset = adapter->pdev->pcie_cap;
6267 if (!cap_offset) 6285 if (!cap_offset)
6268 return -E1000_ERR_CONFIG; 6286 return -E1000_ERR_CONFIG;
6269 6287