diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2010-11-16 22:27:17 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2010-11-16 22:27:17 -0500 |
commit | b93a22260f6f4bcf6c92c54de8530a97d3e921f0 (patch) | |
tree | 33c1c6dbb1854ecc91d8d8a36d61b85f4ef22aa7 /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | fe15e8e1c78521e0b4e375d6ed415b82265419c9 (diff) |
ixgbe: add support for x540 MAC
This patch adds support for the x540 MAC which is the next MAC in the
82598/82599 line.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index b884f90b5805..f9b58394fbb6 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -431,15 +431,21 @@ static u32 ixgbe_get_tx_csum(struct net_device *netdev) | |||
431 | static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data) | 431 | static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data) |
432 | { | 432 | { |
433 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 433 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
434 | u32 feature_list; | ||
434 | 435 | ||
435 | if (data) { | 436 | feature_list = (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); |
436 | netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 437 | switch (adapter->hw.mac.type) { |
437 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | 438 | case ixgbe_mac_82599EB: |
438 | netdev->features |= NETIF_F_SCTP_CSUM; | 439 | case ixgbe_mac_X540: |
439 | } else { | 440 | feature_list |= NETIF_F_SCTP_CSUM; |
440 | netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 441 | break; |
441 | NETIF_F_SCTP_CSUM); | 442 | default: |
443 | break; | ||
442 | } | 444 | } |
445 | if (data) | ||
446 | netdev->features |= feature_list; | ||
447 | else | ||
448 | netdev->features &= ~feature_list; | ||
443 | 449 | ||
444 | return 0; | 450 | return 0; |
445 | } | 451 | } |
@@ -1250,6 +1256,7 @@ static int ixgbe_reg_test(struct ixgbe_adapter *adapter, u64 *data) | |||
1250 | test = reg_test_82598; | 1256 | test = reg_test_82598; |
1251 | break; | 1257 | break; |
1252 | case ixgbe_mac_82599EB: | 1258 | case ixgbe_mac_82599EB: |
1259 | case ixgbe_mac_X540: | ||
1253 | toggle = 0x7FFFF30F; | 1260 | toggle = 0x7FFFF30F; |
1254 | test = reg_test_82599; | 1261 | test = reg_test_82599; |
1255 | break; | 1262 | break; |
@@ -1476,6 +1483,7 @@ static void ixgbe_free_desc_rings(struct ixgbe_adapter *adapter) | |||
1476 | 1483 | ||
1477 | switch (hw->mac.type) { | 1484 | switch (hw->mac.type) { |
1478 | case ixgbe_mac_82599EB: | 1485 | case ixgbe_mac_82599EB: |
1486 | case ixgbe_mac_X540: | ||
1479 | reg_ctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); | 1487 | reg_ctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); |
1480 | reg_ctl &= ~IXGBE_DMATXCTL_TE; | 1488 | reg_ctl &= ~IXGBE_DMATXCTL_TE; |
1481 | IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg_ctl); | 1489 | IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg_ctl); |
@@ -1512,6 +1520,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter) | |||
1512 | 1520 | ||
1513 | switch (adapter->hw.mac.type) { | 1521 | switch (adapter->hw.mac.type) { |
1514 | case ixgbe_mac_82599EB: | 1522 | case ixgbe_mac_82599EB: |
1523 | case ixgbe_mac_X540: | ||
1515 | reg_data = IXGBE_READ_REG(&adapter->hw, IXGBE_DMATXCTL); | 1524 | reg_data = IXGBE_READ_REG(&adapter->hw, IXGBE_DMATXCTL); |
1516 | reg_data |= IXGBE_DMATXCTL_TE; | 1525 | reg_data |= IXGBE_DMATXCTL_TE; |
1517 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DMATXCTL, reg_data); | 1526 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DMATXCTL, reg_data); |
@@ -2198,6 +2207,22 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
2198 | case ixgbe_mac_82599EB: | 2207 | case ixgbe_mac_82599EB: |
2199 | need_reset = true; | 2208 | need_reset = true; |
2200 | break; | 2209 | break; |
2210 | case ixgbe_mac_X540: { | ||
2211 | int i; | ||
2212 | for (i = 0; i < adapter->num_rx_queues; i++) { | ||
2213 | struct ixgbe_ring *ring = | ||
2214 | adapter->rx_ring[i]; | ||
2215 | if (adapter->flags2 & | ||
2216 | IXGBE_FLAG2_RSC_ENABLED) { | ||
2217 | ixgbe_configure_rscctl(adapter, | ||
2218 | ring); | ||
2219 | } else { | ||
2220 | ixgbe_clear_rscctl(adapter, | ||
2221 | ring); | ||
2222 | } | ||
2223 | } | ||
2224 | } | ||
2225 | break; | ||
2201 | default: | 2226 | default: |
2202 | break; | 2227 | break; |
2203 | } | 2228 | } |