diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 028bfb20412c..2a12e97d5efe 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -68,6 +68,8 @@ static struct pci_device_id ixgbe_pci_tbl[] = { | |||
68 | board_82598 }, | 68 | board_82598 }, |
69 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT), | 69 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT), |
70 | board_82598 }, | 70 | board_82598 }, |
71 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT), | ||
72 | board_82598 }, | ||
71 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4), | 73 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4), |
72 | board_82598 }, | 74 | board_82598 }, |
73 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_CX4_DUAL_PORT), | 75 | {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_CX4_DUAL_PORT), |
@@ -904,6 +906,17 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector) | |||
904 | return; | 906 | return; |
905 | } | 907 | } |
906 | 908 | ||
909 | static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr) | ||
910 | { | ||
911 | struct ixgbe_hw *hw = &adapter->hw; | ||
912 | |||
913 | if ((adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) && | ||
914 | (eicr & IXGBE_EICR_GPI_SDP1)) { | ||
915 | DPRINTK(PROBE, CRIT, "Fan has stopped, replace the adapter\n"); | ||
916 | /* write to clear the interrupt */ | ||
917 | IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); | ||
918 | } | ||
919 | } | ||
907 | 920 | ||
908 | static void ixgbe_check_lsc(struct ixgbe_adapter *adapter) | 921 | static void ixgbe_check_lsc(struct ixgbe_adapter *adapter) |
909 | { | 922 | { |
@@ -928,6 +941,8 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data) | |||
928 | if (eicr & IXGBE_EICR_LSC) | 941 | if (eicr & IXGBE_EICR_LSC) |
929 | ixgbe_check_lsc(adapter); | 942 | ixgbe_check_lsc(adapter); |
930 | 943 | ||
944 | ixgbe_check_fan_failure(adapter, eicr); | ||
945 | |||
931 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | 946 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) |
932 | IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); | 947 | IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); |
933 | 948 | ||
@@ -1316,6 +1331,8 @@ static irqreturn_t ixgbe_intr(int irq, void *data) | |||
1316 | if (eicr & IXGBE_EICR_LSC) | 1331 | if (eicr & IXGBE_EICR_LSC) |
1317 | ixgbe_check_lsc(adapter); | 1332 | ixgbe_check_lsc(adapter); |
1318 | 1333 | ||
1334 | ixgbe_check_fan_failure(adapter, eicr); | ||
1335 | |||
1319 | if (netif_rx_schedule_prep(netdev, &adapter->q_vector[0].napi)) { | 1336 | if (netif_rx_schedule_prep(netdev, &adapter->q_vector[0].napi)) { |
1320 | adapter->tx_ring[0].total_packets = 0; | 1337 | adapter->tx_ring[0].total_packets = 0; |
1321 | adapter->tx_ring[0].total_bytes = 0; | 1338 | adapter->tx_ring[0].total_bytes = 0; |
@@ -1418,6 +1435,8 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) | |||
1418 | { | 1435 | { |
1419 | u32 mask; | 1436 | u32 mask; |
1420 | mask = IXGBE_EIMS_ENABLE_MASK; | 1437 | mask = IXGBE_EIMS_ENABLE_MASK; |
1438 | if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) | ||
1439 | mask |= IXGBE_EIMS_GPI_SDP1; | ||
1421 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); | 1440 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); |
1422 | IXGBE_WRITE_FLUSH(&adapter->hw); | 1441 | IXGBE_WRITE_FLUSH(&adapter->hw); |
1423 | } | 1442 | } |
@@ -1927,6 +1946,13 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
1927 | IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); | 1946 | IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); |
1928 | } | 1947 | } |
1929 | 1948 | ||
1949 | /* Enable fan failure interrupt if media type is copper */ | ||
1950 | if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) { | ||
1951 | gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); | ||
1952 | gpie |= IXGBE_SDP1_GPIEN; | ||
1953 | IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); | ||
1954 | } | ||
1955 | |||
1930 | mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); | 1956 | mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); |
1931 | if (max_frame != (mhadd >> IXGBE_MHADD_MFS_SHIFT)) { | 1957 | if (max_frame != (mhadd >> IXGBE_MHADD_MFS_SHIFT)) { |
1932 | mhadd &= ~IXGBE_MHADD_MFS_MASK; | 1958 | mhadd &= ~IXGBE_MHADD_MFS_MASK; |
@@ -2564,6 +2590,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
2564 | rss = min(IXGBE_MAX_RSS_INDICES, (int)num_online_cpus()); | 2590 | rss = min(IXGBE_MAX_RSS_INDICES, (int)num_online_cpus()); |
2565 | adapter->ring_feature[RING_F_RSS].indices = rss; | 2591 | adapter->ring_feature[RING_F_RSS].indices = rss; |
2566 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 2592 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
2593 | if (hw->mac.ops.get_media_type && | ||
2594 | (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper)) | ||
2595 | adapter->flags |= IXGBE_FLAG_FAN_FAIL_CAPABLE; | ||
2567 | 2596 | ||
2568 | /* default flow control settings */ | 2597 | /* default flow control settings */ |
2569 | hw->fc.original_type = ixgbe_fc_none; | 2598 | hw->fc.original_type = ixgbe_fc_none; |
@@ -3691,6 +3720,10 @@ static int ixgbe_link_config(struct ixgbe_hw *hw) | |||
3691 | /* must always autoneg for both 1G and 10G link */ | 3720 | /* must always autoneg for both 1G and 10G link */ |
3692 | hw->mac.autoneg = true; | 3721 | hw->mac.autoneg = true; |
3693 | 3722 | ||
3723 | if ((hw->mac.type == ixgbe_mac_82598EB) && | ||
3724 | (hw->phy.media_type == ixgbe_media_type_copper)) | ||
3725 | autoneg = IXGBE_LINK_SPEED_82598_AUTONEG; | ||
3726 | |||
3694 | return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); | 3727 | return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); |
3695 | } | 3728 | } |
3696 | 3729 | ||