aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/82571.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000e/82571.c')
-rw-r--r--drivers/net/e1000e/82571.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index ca663f19d7df..7236f1a53ba0 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -52,6 +52,10 @@
52 (ID_LED_DEF1_DEF2)) 52 (ID_LED_DEF1_DEF2))
53 53
54#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 54#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
55#define E1000_BASE1000T_STATUS 10
56#define E1000_IDLE_ERROR_COUNT_MASK 0xFF
57#define E1000_RECEIVE_ERROR_COUNTER 21
58#define E1000_RECEIVE_ERROR_MAX 0xFFFF
55 59
56#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */ 60#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
57 61
@@ -1243,6 +1247,39 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw)
1243} 1247}
1244 1248
1245/** 1249/**
1250 * e1000_check_phy_82574 - check 82574 phy hung state
1251 * @hw: pointer to the HW structure
1252 *
1253 * Returns whether phy is hung or not
1254 **/
1255bool e1000_check_phy_82574(struct e1000_hw *hw)
1256{
1257 u16 status_1kbt = 0;
1258 u16 receive_errors = 0;
1259 bool phy_hung = false;
1260 s32 ret_val = 0;
1261
1262 /*
1263 * Read PHY Receive Error counter first, if its is max - all F's then
1264 * read the Base1000T status register If both are max then PHY is hung.
1265 */
1266 ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors);
1267
1268 if (ret_val)
1269 goto out;
1270 if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
1271 ret_val = e1e_rphy(hw, E1000_BASE1000T_STATUS, &status_1kbt);
1272 if (ret_val)
1273 goto out;
1274 if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
1275 E1000_IDLE_ERROR_COUNT_MASK)
1276 phy_hung = true;
1277 }
1278out:
1279 return phy_hung;
1280}
1281
1282/**
1246 * e1000_setup_link_82571 - Setup flow control and link settings 1283 * e1000_setup_link_82571 - Setup flow control and link settings
1247 * @hw: pointer to the HW structure 1284 * @hw: pointer to the HW structure
1248 * 1285 *
@@ -1859,6 +1896,7 @@ struct e1000_info e1000_82574_info = {
1859 | FLAG_HAS_SMART_POWER_DOWN 1896 | FLAG_HAS_SMART_POWER_DOWN
1860 | FLAG_HAS_AMT 1897 | FLAG_HAS_AMT
1861 | FLAG_HAS_CTRLEXT_ON_LOAD, 1898 | FLAG_HAS_CTRLEXT_ON_LOAD,
1899 .flags2 = FLAG2_CHECK_PHY_HANG,
1862 .pba = 36, 1900 .pba = 36,
1863 .max_hw_frame_size = DEFAULT_JUMBO, 1901 .max_hw_frame_size = DEFAULT_JUMBO,
1864 .get_variants = e1000_get_variants_82571, 1902 .get_variants = e1000_get_variants_82571,