aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/phy.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/phy.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index 35b45578c604..bd5ef64b3003 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -718,7 +718,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
718 * 1 - Enabled 718 * 1 - Enabled
719 */ 719 */
720 phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL; 720 phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL;
721 if (phy->disable_polarity_correction == 1) 721 if (phy->disable_polarity_correction)
722 phy_data |= M88E1000_PSCR_POLARITY_REVERSAL; 722 phy_data |= M88E1000_PSCR_POLARITY_REVERSAL;
723 723
724 /* Enable downshift on BM (disabled by default) */ 724 /* Enable downshift on BM (disabled by default) */
@@ -1090,7 +1090,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
1090 * If autoneg_advertised is zero, we assume it was not defaulted 1090 * If autoneg_advertised is zero, we assume it was not defaulted
1091 * by the calling code so we set to advertise full capability. 1091 * by the calling code so we set to advertise full capability.
1092 */ 1092 */
1093 if (phy->autoneg_advertised == 0) 1093 if (!phy->autoneg_advertised)
1094 phy->autoneg_advertised = phy->autoneg_mask; 1094 phy->autoneg_advertised = phy->autoneg_mask;
1095 1095
1096 e_dbg("Reconfiguring auto-neg advertisement params\n"); 1096 e_dbg("Reconfiguring auto-neg advertisement params\n");
@@ -1596,7 +1596,7 @@ s32 e1000e_check_downshift(struct e1000_hw *hw)
1596 ret_val = e1e_rphy(hw, offset, &phy_data); 1596 ret_val = e1e_rphy(hw, offset, &phy_data);
1597 1597
1598 if (!ret_val) 1598 if (!ret_val)
1599 phy->speed_downgraded = (phy_data & mask); 1599 phy->speed_downgraded = !!(phy_data & mask);
1600 1600
1601 return ret_val; 1601 return ret_val;
1602} 1602}
@@ -1925,8 +1925,8 @@ s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
1925 if (ret_val) 1925 if (ret_val)
1926 return ret_val; 1926 return ret_val;
1927 1927
1928 phy->polarity_correction = (phy_data & 1928 phy->polarity_correction = !!(phy_data &
1929 M88E1000_PSCR_POLARITY_REVERSAL); 1929 M88E1000_PSCR_POLARITY_REVERSAL);
1930 1930
1931 ret_val = e1000_check_polarity_m88(hw); 1931 ret_val = e1000_check_polarity_m88(hw);
1932 if (ret_val) 1932 if (ret_val)
@@ -1936,7 +1936,7 @@ s32 e1000e_get_phy_info_m88(struct e1000_hw *hw)
1936 if (ret_val) 1936 if (ret_val)
1937 return ret_val; 1937 return ret_val;
1938 1938
1939 phy->is_mdix = (phy_data & M88E1000_PSSR_MDIX); 1939 phy->is_mdix = !!(phy_data & M88E1000_PSSR_MDIX);
1940 1940
1941 if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) { 1941 if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS) {
1942 ret_val = e1000_get_cable_length(hw); 1942 ret_val = e1000_get_cable_length(hw);
@@ -1999,7 +1999,7 @@ s32 e1000e_get_phy_info_igp(struct e1000_hw *hw)
1999 if (ret_val) 1999 if (ret_val)
2000 return ret_val; 2000 return ret_val;
2001 2001
2002 phy->is_mdix = (data & IGP01E1000_PSSR_MDIX); 2002 phy->is_mdix = !!(data & IGP01E1000_PSSR_MDIX);
2003 2003
2004 if ((data & IGP01E1000_PSSR_SPEED_MASK) == 2004 if ((data & IGP01E1000_PSSR_SPEED_MASK) ==
2005 IGP01E1000_PSSR_SPEED_1000MBPS) { 2005 IGP01E1000_PSSR_SPEED_1000MBPS) {
@@ -2052,8 +2052,7 @@ s32 e1000_get_phy_info_ife(struct e1000_hw *hw)
2052 ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data); 2052 ret_val = e1e_rphy(hw, IFE_PHY_SPECIAL_CONTROL, &data);
2053 if (ret_val) 2053 if (ret_val)
2054 return ret_val; 2054 return ret_val;
2055 phy->polarity_correction = (data & IFE_PSC_AUTO_POLARITY_DISABLE) 2055 phy->polarity_correction = !(data & IFE_PSC_AUTO_POLARITY_DISABLE);
2056 ? false : true;
2057 2056
2058 if (phy->polarity_correction) { 2057 if (phy->polarity_correction) {
2059 ret_val = e1000_check_polarity_ife(hw); 2058 ret_val = e1000_check_polarity_ife(hw);
@@ -2070,7 +2069,7 @@ s32 e1000_get_phy_info_ife(struct e1000_hw *hw)
2070 if (ret_val) 2069 if (ret_val)
2071 return ret_val; 2070 return ret_val;
2072 2071
2073 phy->is_mdix = (data & IFE_PMC_MDIX_STATUS) ? true : false; 2072 phy->is_mdix = !!(data & IFE_PMC_MDIX_STATUS);
2074 2073
2075 /* The following parameters are undefined for 10/100 operation. */ 2074 /* The following parameters are undefined for 10/100 operation. */
2076 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED; 2075 phy->cable_length = E1000_CABLE_LENGTH_UNDEFINED;
@@ -2979,7 +2978,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
2979 if ((hw->phy.type == e1000_phy_82578) && 2978 if ((hw->phy.type == e1000_phy_82578) &&
2980 (hw->phy.revision >= 1) && 2979 (hw->phy.revision >= 1) &&
2981 (hw->phy.addr == 2) && 2980 (hw->phy.addr == 2) &&
2982 ((MAX_PHY_REG_ADDRESS & reg) == 0) && (data & (1 << 11))) { 2981 !(MAX_PHY_REG_ADDRESS & reg) && (data & (1 << 11))) {
2983 u16 data2 = 0x7EFF; 2982 u16 data2 = 0x7EFF;
2984 ret_val = e1000_access_phy_debug_regs_hv(hw, 2983 ret_val = e1000_access_phy_debug_regs_hv(hw,
2985 (1 << 6) | 0x3, 2984 (1 << 6) | 0x3,
@@ -3265,7 +3264,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
3265 if (ret_val) 3264 if (ret_val)
3266 return ret_val; 3265 return ret_val;
3267 3266
3268 phy->is_mdix = (data & I82577_PHY_STATUS2_MDIX) ? true : false; 3267 phy->is_mdix = !!(data & I82577_PHY_STATUS2_MDIX);
3269 3268
3270 if ((data & I82577_PHY_STATUS2_SPEED_MASK) == 3269 if ((data & I82577_PHY_STATUS2_SPEED_MASK) ==
3271 I82577_PHY_STATUS2_SPEED_1000MBPS) { 3270 I82577_PHY_STATUS2_SPEED_1000MBPS) {