Mercurial > illumos > illumos-gate
changeset 10605:4086dd59e147
6820747 kstat output incorrect for MMF version of e1000g making it impossible to troubleshoot
6847888 HW initialization updates for 82541 and 82547 chips
author | Miles Xu, Sun Microsystems <Min.Xu@Sun.COM> |
---|---|
date | Tue, 22 Sep 2009 17:57:33 +0800 |
parents | 4dab88fc294c |
children | 438ded3d6917 |
files | usr/src/uts/common/io/e1000g/README usr/src/uts/common/io/e1000g/e1000_82541.c usr/src/uts/common/io/e1000g/e1000g_main.c |
diffstat | 3 files changed, 230 insertions(+), 102 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/e1000g/README Tue Sep 22 14:06:23 2009 +0800 +++ b/usr/src/uts/common/io/e1000g/README Tue Sep 22 17:57:33 2009 +0800 @@ -690,6 +690,13 @@ 6870404 e1000g_reset can call e1000g_start after releasing dma resources 5.3.13 +==== This version has the following fixes: 6681751 e1000g minor_perm inconsistent between package postinstall script and default minor_perm file 6855964 e1000g driver corrupting LSO packets causes chipset hang and significant performance regression + +5.3.14 +==== + This version has the following fix: + 6820747 kstat output incorrect for MMF version of e1000g making it impossible to troubleshoot + 6847888 HW initialization updates for 82541 and 82547 chips
--- a/usr/src/uts/common/io/e1000g/e1000_82541.c Tue Sep 22 14:06:23 2009 +0800 +++ b/usr/src/uts/common/io/e1000g/e1000_82541.c Tue Sep 22 17:57:33 2009 +0800 @@ -391,6 +391,16 @@ /* This is not fatal and we should not stop init due to this */ } + /* + * workaround - Store Default value in dev_spec->spd_default for + * later use + */ + ret_val = hw->phy.ops.read_reg(hw, + IGP01E1000_GMII_FIFO, + &dev_spec->spd_default); + if (ret_val) + goto out; + pba = E1000_READ_REG(hw, E1000_PBA); dev_spec->tx_fifo_start = (pba & 0x0000FFFF) * E1000_FIFO_MULTIPLIER; dev_spec->tx_fifo_size = (pba & 0xFFFF0000) >> 6; @@ -431,6 +441,7 @@ */ e1000_clear_hw_cntrs_82541(hw); +out: return (ret_val); }
--- a/usr/src/uts/common/io/e1000g/e1000g_main.c Tue Sep 22 14:06:23 2009 +0800 +++ b/usr/src/uts/common/io/e1000g/e1000g_main.c Tue Sep 22 17:57:33 2009 +0800 @@ -46,7 +46,7 @@ static char ident[] = "Intel PRO/1000 Ethernet"; static char e1000g_string[] = "Intel(R) PRO/1000 Network Connection"; -static char e1000g_version[] = "Driver Ver. 5.3.13"; +static char e1000g_version[] = "Driver Ver. 5.3.14"; /* * Proto types for DDI entry points @@ -1361,11 +1361,7 @@ * Restore LED settings to the default from EEPROM * to meet the standard for Sun platforms. */ - if ((hw->mac.type != e1000_82541) && - (hw->mac.type != e1000_82541_rev_2) && - (hw->mac.type != e1000_82547) && - (hw->mac.type != e1000_82547_rev_2)) - (void) e1000_cleanup_led(hw); + (void) e1000_cleanup_led(hw); /* Disable Smart Power Down */ phy_spd_state(hw, B_FALSE); @@ -3001,6 +2997,7 @@ struct e1000g *Adapter = arg; struct e1000_mac_info *mac = &Adapter->shared.mac; struct e1000_phy_info *phy = &Adapter->shared.phy; + struct e1000_hw *hw = &Adapter->shared; struct e1000_fc_info *fc = &Adapter->shared.fc; int err = 0; link_flowctrl_t flowctrl; @@ -3026,26 +3023,50 @@ switch (pr_num) { case MAC_PROP_EN_1000FDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) { + err = ENOTSUP; + break; + } Adapter->param_en_1000fdx = *(uint8_t *)pr_val; Adapter->param_adv_1000fdx = *(uint8_t *)pr_val; goto reset; case MAC_PROP_EN_100FDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) { + err = ENOTSUP; + break; + } Adapter->param_en_100fdx = *(uint8_t *)pr_val; Adapter->param_adv_100fdx = *(uint8_t *)pr_val; goto reset; case MAC_PROP_EN_100HDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) { + err = ENOTSUP; + break; + } Adapter->param_en_100hdx = *(uint8_t *)pr_val; Adapter->param_adv_100hdx = *(uint8_t *)pr_val; goto reset; case MAC_PROP_EN_10FDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) { + err = ENOTSUP; + break; + } Adapter->param_en_10fdx = *(uint8_t *)pr_val; Adapter->param_adv_10fdx = *(uint8_t *)pr_val; goto reset; case MAC_PROP_EN_10HDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) { + err = ENOTSUP; + break; + } Adapter->param_en_10hdx = *(uint8_t *)pr_val; Adapter->param_adv_10hdx = *(uint8_t *)pr_val; goto reset; case MAC_PROP_AUTONEG: + if (hw->phy.media_type != e1000_media_type_copper) { + err = ENOTSUP; + break; + } Adapter->param_adv_autoneg = *(uint8_t *)pr_val; goto reset; case MAC_PROP_FLOWCTRL: @@ -3146,6 +3167,7 @@ { struct e1000g *Adapter = arg; struct e1000_fc_info *fc = &Adapter->shared.fc; + struct e1000_hw *hw = &Adapter->shared; int err = 0; link_flowctrl_t flowctrl; uint64_t tmp = 0; @@ -3179,6 +3201,8 @@ err = EINVAL; break; case MAC_PROP_AUTONEG: + if (hw->phy.media_type != e1000_media_type_copper) + *perm = MAC_PROP_PERM_READ; *(uint8_t *)pr_val = Adapter->param_adv_autoneg; break; case MAC_PROP_FLOWCTRL: @@ -3206,6 +3230,8 @@ *(uint8_t *)pr_val = Adapter->param_adv_1000fdx; break; case MAC_PROP_EN_1000FDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) + *perm = MAC_PROP_PERM_READ; *(uint8_t *)pr_val = Adapter->param_en_1000fdx; break; case MAC_PROP_ADV_1000HDX_CAP: @@ -3221,6 +3247,8 @@ *(uint8_t *)pr_val = Adapter->param_adv_100fdx; break; case MAC_PROP_EN_100FDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) + *perm = MAC_PROP_PERM_READ; *(uint8_t *)pr_val = Adapter->param_en_100fdx; break; case MAC_PROP_ADV_100HDX_CAP: @@ -3228,6 +3256,8 @@ *(uint8_t *)pr_val = Adapter->param_adv_100hdx; break; case MAC_PROP_EN_100HDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) + *perm = MAC_PROP_PERM_READ; *(uint8_t *)pr_val = Adapter->param_en_100hdx; break; case MAC_PROP_ADV_10FDX_CAP: @@ -3235,6 +3265,8 @@ *(uint8_t *)pr_val = Adapter->param_adv_10fdx; break; case MAC_PROP_EN_10FDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) + *perm = MAC_PROP_PERM_READ; *(uint8_t *)pr_val = Adapter->param_en_10fdx; break; case MAC_PROP_ADV_10HDX_CAP: @@ -3242,6 +3274,8 @@ *(uint8_t *)pr_val = Adapter->param_adv_10hdx; break; case MAC_PROP_EN_10HDX_CAP: + if (hw->phy.media_type != e1000_media_type_copper) + *perm = MAC_PROP_PERM_READ; *(uint8_t *)pr_val = Adapter->param_en_10hdx; break; case MAC_PROP_ADV_100T4_CAP: @@ -3925,12 +3959,17 @@ { struct e1000_mac_info *mac; struct e1000_phy_info *phy; + struct e1000_hw *hw; boolean_t invalid; mac = &Adapter->shared.mac; phy = &Adapter->shared.phy; + hw = &Adapter->shared; invalid = B_FALSE; + if (hw->phy.media_type != e1000_media_type_copper) + goto out; + if (Adapter->param_adv_autoneg == 1) { mac->autoneg = B_TRUE; phy->autoneg_advertised = 0; @@ -3959,7 +3998,8 @@ mac->autoneg = B_FALSE; /* - * 1000fdx and 1000hdx are not supported for forced link + * For Intel copper cards, 1000fdx and 1000hdx are not + * supported for forced link */ if (Adapter->param_adv_100fdx == 1) mac->forced_speed_duplex = ADVERTISE_100_FULL; @@ -3984,6 +4024,7 @@ ADVERTISE_10_FULL | ADVERTISE_10_HALF; } +out: return (e1000_setup_link(&Adapter->shared)); } @@ -5753,83 +5794,130 @@ { struct e1000_hw *hw = &Adapter->shared; - (void) e1000_read_phy_reg(hw, PHY_CONTROL, &Adapter->phy_ctrl); - (void) e1000_read_phy_reg(hw, PHY_STATUS, &Adapter->phy_status); - (void) e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &Adapter->phy_an_adv); - (void) e1000_read_phy_reg(hw, PHY_AUTONEG_EXP, &Adapter->phy_an_exp); - (void) e1000_read_phy_reg(hw, PHY_EXT_STATUS, &Adapter->phy_ext_status); - (void) e1000_read_phy_reg(hw, PHY_1000T_CTRL, &Adapter->phy_1000t_ctrl); - (void) e1000_read_phy_reg(hw, PHY_1000T_STATUS, - &Adapter->phy_1000t_status); - (void) e1000_read_phy_reg(hw, PHY_LP_ABILITY, &Adapter->phy_lp_able); - - Adapter->param_autoneg_cap = - (Adapter->phy_status & MII_SR_AUTONEG_CAPS) ? 1 : 0; - Adapter->param_pause_cap = - (Adapter->phy_an_adv & NWAY_AR_PAUSE) ? 1 : 0; - Adapter->param_asym_pause_cap = - (Adapter->phy_an_adv & NWAY_AR_ASM_DIR) ? 1 : 0; - Adapter->param_1000fdx_cap = - ((Adapter->phy_ext_status & IEEE_ESR_1000T_FD_CAPS) || - (Adapter->phy_ext_status & IEEE_ESR_1000X_FD_CAPS)) ? 1 : 0; - Adapter->param_1000hdx_cap = - ((Adapter->phy_ext_status & IEEE_ESR_1000T_HD_CAPS) || - (Adapter->phy_ext_status & IEEE_ESR_1000X_HD_CAPS)) ? 1 : 0; - Adapter->param_100t4_cap = - (Adapter->phy_status & MII_SR_100T4_CAPS) ? 1 : 0; - Adapter->param_100fdx_cap = - ((Adapter->phy_status & MII_SR_100X_FD_CAPS) || - (Adapter->phy_status & MII_SR_100T2_FD_CAPS)) ? 1 : 0; - Adapter->param_100hdx_cap = - ((Adapter->phy_status & MII_SR_100X_HD_CAPS) || - (Adapter->phy_status & MII_SR_100T2_HD_CAPS)) ? 1 : 0; - Adapter->param_10fdx_cap = - (Adapter->phy_status & MII_SR_10T_FD_CAPS) ? 1 : 0; - Adapter->param_10hdx_cap = - (Adapter->phy_status & MII_SR_10T_HD_CAPS) ? 1 : 0; - - Adapter->param_adv_autoneg = hw->mac.autoneg; - Adapter->param_adv_pause = - (Adapter->phy_an_adv & NWAY_AR_PAUSE) ? 1 : 0; - Adapter->param_adv_asym_pause = - (Adapter->phy_an_adv & NWAY_AR_ASM_DIR) ? 1 : 0; - Adapter->param_adv_1000hdx = - (Adapter->phy_1000t_ctrl & CR_1000T_HD_CAPS) ? 1 : 0; - Adapter->param_adv_100t4 = - (Adapter->phy_an_adv & NWAY_AR_100T4_CAPS) ? 1 : 0; - if (Adapter->param_adv_autoneg == 1) { - Adapter->param_adv_1000fdx = - (Adapter->phy_1000t_ctrl & CR_1000T_FD_CAPS) ? 1 : 0; - Adapter->param_adv_100fdx = - (Adapter->phy_an_adv & NWAY_AR_100TX_FD_CAPS) ? 1 : 0; - Adapter->param_adv_100hdx = - (Adapter->phy_an_adv & NWAY_AR_100TX_HD_CAPS) ? 1 : 0; - Adapter->param_adv_10fdx = - (Adapter->phy_an_adv & NWAY_AR_10T_FD_CAPS) ? 1 : 0; - Adapter->param_adv_10hdx = - (Adapter->phy_an_adv & NWAY_AR_10T_HD_CAPS) ? 1 : 0; - } - - Adapter->param_lp_autoneg = - (Adapter->phy_an_exp & NWAY_ER_LP_NWAY_CAPS) ? 1 : 0; - Adapter->param_lp_pause = - (Adapter->phy_lp_able & NWAY_LPAR_PAUSE) ? 1 : 0; - Adapter->param_lp_asym_pause = - (Adapter->phy_lp_able & NWAY_LPAR_ASM_DIR) ? 1 : 0; - Adapter->param_lp_1000fdx = - (Adapter->phy_1000t_status & SR_1000T_LP_FD_CAPS) ? 1 : 0; - Adapter->param_lp_1000hdx = - (Adapter->phy_1000t_status & SR_1000T_LP_HD_CAPS) ? 1 : 0; - Adapter->param_lp_100t4 = - (Adapter->phy_lp_able & NWAY_LPAR_100T4_CAPS) ? 1 : 0; - Adapter->param_lp_100fdx = - (Adapter->phy_lp_able & NWAY_LPAR_100TX_FD_CAPS) ? 1 : 0; - Adapter->param_lp_100hdx = - (Adapter->phy_lp_able & NWAY_LPAR_100TX_HD_CAPS) ? 1 : 0; - Adapter->param_lp_10fdx = - (Adapter->phy_lp_able & NWAY_LPAR_10T_FD_CAPS) ? 1 : 0; - Adapter->param_lp_10hdx = - (Adapter->phy_lp_able & NWAY_LPAR_10T_HD_CAPS) ? 1 : 0; + if (hw->phy.media_type == e1000_media_type_copper) { + (void) e1000_read_phy_reg(hw, PHY_CONTROL, &Adapter->phy_ctrl); + (void) e1000_read_phy_reg(hw, PHY_STATUS, &Adapter->phy_status); + (void) e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, + &Adapter->phy_an_adv); + (void) e1000_read_phy_reg(hw, PHY_AUTONEG_EXP, + &Adapter->phy_an_exp); + (void) e1000_read_phy_reg(hw, PHY_EXT_STATUS, + &Adapter->phy_ext_status); + (void) e1000_read_phy_reg(hw, PHY_1000T_CTRL, + &Adapter->phy_1000t_ctrl); + (void) e1000_read_phy_reg(hw, PHY_1000T_STATUS, + &Adapter->phy_1000t_status); + (void) e1000_read_phy_reg(hw, PHY_LP_ABILITY, + &Adapter->phy_lp_able); + + Adapter->param_autoneg_cap = + (Adapter->phy_status & MII_SR_AUTONEG_CAPS) ? 1 : 0; + Adapter->param_pause_cap = + (Adapter->phy_an_adv & NWAY_AR_PAUSE) ? 1 : 0; + Adapter->param_asym_pause_cap = + (Adapter->phy_an_adv & NWAY_AR_ASM_DIR) ? 1 : 0; + Adapter->param_1000fdx_cap = + ((Adapter->phy_ext_status & IEEE_ESR_1000T_FD_CAPS) || + (Adapter->phy_ext_status & IEEE_ESR_1000X_FD_CAPS)) ? 1 : 0; + Adapter->param_1000hdx_cap = + ((Adapter->phy_ext_status & IEEE_ESR_1000T_HD_CAPS) || + (Adapter->phy_ext_status & IEEE_ESR_1000X_HD_CAPS)) ? 1 : 0; + Adapter->param_100t4_cap = + (Adapter->phy_status & MII_SR_100T4_CAPS) ? 1 : 0; + Adapter->param_100fdx_cap = + ((Adapter->phy_status & MII_SR_100X_FD_CAPS) || + (Adapter->phy_status & MII_SR_100T2_FD_CAPS)) ? 1 : 0; + Adapter->param_100hdx_cap = + ((Adapter->phy_status & MII_SR_100X_HD_CAPS) || + (Adapter->phy_status & MII_SR_100T2_HD_CAPS)) ? 1 : 0; + Adapter->param_10fdx_cap = + (Adapter->phy_status & MII_SR_10T_FD_CAPS) ? 1 : 0; + Adapter->param_10hdx_cap = + (Adapter->phy_status & MII_SR_10T_HD_CAPS) ? 1 : 0; + + Adapter->param_adv_autoneg = hw->mac.autoneg; + Adapter->param_adv_pause = + (Adapter->phy_an_adv & NWAY_AR_PAUSE) ? 1 : 0; + Adapter->param_adv_asym_pause = + (Adapter->phy_an_adv & NWAY_AR_ASM_DIR) ? 1 : 0; + Adapter->param_adv_1000hdx = + (Adapter->phy_1000t_ctrl & CR_1000T_HD_CAPS) ? 1 : 0; + Adapter->param_adv_100t4 = + (Adapter->phy_an_adv & NWAY_AR_100T4_CAPS) ? 1 : 0; + if (Adapter->param_adv_autoneg == 1) { + Adapter->param_adv_1000fdx = + (Adapter->phy_1000t_ctrl & CR_1000T_FD_CAPS) + ? 1 : 0; + Adapter->param_adv_100fdx = + (Adapter->phy_an_adv & NWAY_AR_100TX_FD_CAPS) + ? 1 : 0; + Adapter->param_adv_100hdx = + (Adapter->phy_an_adv & NWAY_AR_100TX_HD_CAPS) + ? 1 : 0; + Adapter->param_adv_10fdx = + (Adapter->phy_an_adv & NWAY_AR_10T_FD_CAPS) ? 1 : 0; + Adapter->param_adv_10hdx = + (Adapter->phy_an_adv & NWAY_AR_10T_HD_CAPS) ? 1 : 0; + } + + Adapter->param_lp_autoneg = + (Adapter->phy_an_exp & NWAY_ER_LP_NWAY_CAPS) ? 1 : 0; + Adapter->param_lp_pause = + (Adapter->phy_lp_able & NWAY_LPAR_PAUSE) ? 1 : 0; + Adapter->param_lp_asym_pause = + (Adapter->phy_lp_able & NWAY_LPAR_ASM_DIR) ? 1 : 0; + Adapter->param_lp_1000fdx = + (Adapter->phy_1000t_status & SR_1000T_LP_FD_CAPS) ? 1 : 0; + Adapter->param_lp_1000hdx = + (Adapter->phy_1000t_status & SR_1000T_LP_HD_CAPS) ? 1 : 0; + Adapter->param_lp_100t4 = + (Adapter->phy_lp_able & NWAY_LPAR_100T4_CAPS) ? 1 : 0; + Adapter->param_lp_100fdx = + (Adapter->phy_lp_able & NWAY_LPAR_100TX_FD_CAPS) ? 1 : 0; + Adapter->param_lp_100hdx = + (Adapter->phy_lp_able & NWAY_LPAR_100TX_HD_CAPS) ? 1 : 0; + Adapter->param_lp_10fdx = + (Adapter->phy_lp_able & NWAY_LPAR_10T_FD_CAPS) ? 1 : 0; + Adapter->param_lp_10hdx = + (Adapter->phy_lp_able & NWAY_LPAR_10T_HD_CAPS) ? 1 : 0; + } else { + /* + * 1Gig Fiber adapter only offers 1Gig Full Duplex. Meaning, + * it can only work with 1Gig Full Duplex Link Partner. + */ + Adapter->param_autoneg_cap = 0; + Adapter->param_pause_cap = 1; + Adapter->param_asym_pause_cap = 1; + Adapter->param_1000fdx_cap = 1; + Adapter->param_1000hdx_cap = 0; + Adapter->param_100t4_cap = 0; + Adapter->param_100fdx_cap = 0; + Adapter->param_100hdx_cap = 0; + Adapter->param_10fdx_cap = 0; + Adapter->param_10hdx_cap = 0; + + Adapter->param_adv_autoneg = 0; + Adapter->param_adv_pause = 1; + Adapter->param_adv_asym_pause = 1; + Adapter->param_adv_1000fdx = 1; + Adapter->param_adv_1000hdx = 0; + Adapter->param_adv_100t4 = 0; + Adapter->param_adv_100fdx = 0; + Adapter->param_adv_100hdx = 0; + Adapter->param_adv_10fdx = 0; + Adapter->param_adv_10hdx = 0; + + Adapter->param_lp_autoneg = 0; + Adapter->param_lp_pause = 0; + Adapter->param_lp_asym_pause = 0; + Adapter->param_lp_1000fdx = 0; + Adapter->param_lp_1000hdx = 0; + Adapter->param_lp_100t4 = 0; + Adapter->param_lp_100fdx = 0; + Adapter->param_lp_100hdx = 0; + Adapter->param_lp_10fdx = 0; + Adapter->param_lp_10hdx = 0; + } } /* @@ -5997,13 +6085,18 @@ uint_t pr_valsize, void *pr_val) { link_flowctrl_t fl; + struct e1000_hw *hw = &Adapter->shared; int err = 0; ASSERT(pr_valsize > 0); switch (pr_num) { case MAC_PROP_AUTONEG: - *(uint8_t *)pr_val = - ((Adapter->phy_status & MII_SR_AUTONEG_CAPS) ? 1 : 0); + if (hw->phy.media_type != e1000_media_type_copper) + *(uint8_t *)pr_val = 0; + else + *(uint8_t *)pr_val = + ((Adapter->phy_status & MII_SR_AUTONEG_CAPS) + ? 1 : 0); break; case MAC_PROP_FLOWCTRL: if (pr_valsize < sizeof (link_flowctrl_t)) @@ -6013,37 +6106,54 @@ break; case MAC_PROP_ADV_1000FDX_CAP: case MAC_PROP_EN_1000FDX_CAP: - *(uint8_t *)pr_val = - ((Adapter->phy_ext_status & IEEE_ESR_1000T_FD_CAPS) || - (Adapter->phy_ext_status & IEEE_ESR_1000X_FD_CAPS)) ? 1 : 0; + if (hw->phy.media_type != e1000_media_type_copper) + *(uint8_t *)pr_val = 1; + else + *(uint8_t *)pr_val = + ((Adapter->phy_ext_status & + IEEE_ESR_1000T_FD_CAPS) || + (Adapter->phy_ext_status & IEEE_ESR_1000X_FD_CAPS)) + ? 1 : 0; break; case MAC_PROP_ADV_1000HDX_CAP: case MAC_PROP_EN_1000HDX_CAP: - *(uint8_t *)pr_val = - ((Adapter->phy_ext_status & IEEE_ESR_1000T_HD_CAPS) || - (Adapter->phy_ext_status & IEEE_ESR_1000X_HD_CAPS)) ? 1 : 0; + *(uint8_t *)pr_val = 0; break; case MAC_PROP_ADV_100FDX_CAP: case MAC_PROP_EN_100FDX_CAP: - *(uint8_t *)pr_val = - ((Adapter->phy_status & MII_SR_100X_FD_CAPS) || - (Adapter->phy_status & MII_SR_100T2_FD_CAPS)) ? 1 : 0; + if (hw->phy.media_type != e1000_media_type_copper) + *(uint8_t *)pr_val = 0; + else + *(uint8_t *)pr_val = + ((Adapter->phy_status & MII_SR_100X_FD_CAPS) || + (Adapter->phy_status & MII_SR_100T2_FD_CAPS)) + ? 1 : 0; break; case MAC_PROP_ADV_100HDX_CAP: case MAC_PROP_EN_100HDX_CAP: - *(uint8_t *)pr_val = - ((Adapter->phy_status & MII_SR_100X_HD_CAPS) || - (Adapter->phy_status & MII_SR_100T2_HD_CAPS)) ? 1 : 0; + if (hw->phy.media_type != e1000_media_type_copper) + *(uint8_t *)pr_val = 0; + else + *(uint8_t *)pr_val = + ((Adapter->phy_status & MII_SR_100X_HD_CAPS) || + (Adapter->phy_status & MII_SR_100T2_HD_CAPS)) + ? 1 : 0; break; case MAC_PROP_ADV_10FDX_CAP: case MAC_PROP_EN_10FDX_CAP: - *(uint8_t *)pr_val = - (Adapter->phy_status & MII_SR_10T_FD_CAPS) ? 1 : 0; + if (hw->phy.media_type != e1000_media_type_copper) + *(uint8_t *)pr_val = 0; + else + *(uint8_t *)pr_val = + (Adapter->phy_status & MII_SR_10T_FD_CAPS) ? 1 : 0; break; case MAC_PROP_ADV_10HDX_CAP: case MAC_PROP_EN_10HDX_CAP: - *(uint8_t *)pr_val = - (Adapter->phy_status & MII_SR_10T_HD_CAPS) ? 1 : 0; + if (hw->phy.media_type != e1000_media_type_copper) + *(uint8_t *)pr_val = 0; + else + *(uint8_t *)pr_val = + (Adapter->phy_status & MII_SR_10T_HD_CAPS) ? 1 : 0; break; default: err = ENOTSUP;