/* Polarity is determined on the polarity reversal feature being enabled.  */
s32 e1000_check_polarity_ife(struct e1000_hw *hw)
/* Polarity is determined on the polarity reversal feature being enabled.  */
s32 e1000_check_polarity_ife(struct e1000_hw *hw)
{
	struct e1000_phy_info *phy = &hw->phy;
	s32 ret_val;
	u16 phy_data, offset, mask;
	if (phy->polarity_correction) {
		offset = IFE_PHY_EXTENDED_STATUS_CONTROL;
		mask = IFE_PESC_POLARITY_REVERSED;
	} else {
		offset = IFE_PHY_SPECIAL_CONTROL;
		mask = IFE_PSC_FORCE_POLARITY;
	}
	ret_val = e1e_rphy(hw, offset, &phy_data);
	if (!ret_val)
		phy->cable_polarity = (phy_data & mask)
		                       ? e1000_rev_polarity_reversed
		                       : e1000_rev_polarity_normal;
	return ret_val;
}