src/dpdk/drivers/net/e1000/base/e1000_82575.c
s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M)
{
	u32 ipcnfg, eeer;

	DEBUGFUNC("e1000_set_eee_i350");

	if ((hw->mac.type < e1000_i350) ||
	    (hw->phy.media_type != e1000_media_type_copper))
		goto out;
	ipcnfg = E1000_READ_REG(hw, E1000_IPCNFG);
	eeer = E1000_READ_REG(hw, E1000_EEER);

	/* enable or disable per user setting */
	if (!(hw->dev_spec._82575.eee_disable)) {
		u32 eee_su = E1000_READ_REG(hw, E1000_EEE_SU);

		if (adv100M)
			ipcnfg |= E1000_IPCNFG_EEE_100M_AN;
		else
			ipcnfg &= ~E1000_IPCNFG_EEE_100M_AN;

		if (adv1G)
			ipcnfg |= E1000_IPCNFG_EEE_1G_AN;
		else
			ipcnfg &= ~E1000_IPCNFG_EEE_1G_AN;

		eeer |= (E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN |
			 E1000_EEER_LPI_FC);

		/* This bit should not be set in normal operation. */
		if (eee_su & E1000_EEE_SU_LPI_CLK_STP)
			DEBUGOUT("LPI Clock Stop Bit should not be set!\n");
	} else {
		ipcnfg &= ~(E1000_IPCNFG_EEE_1G_AN | E1000_IPCNFG_EEE_100M_AN);
		eeer &= ~(E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN |
			  E1000_EEER_LPI_FC);
	}
	E1000_WRITE_REG(hw, E1000_IPCNFG, ipcnfg);
	E1000_WRITE_REG(hw, E1000_EEER, eeer);
	E1000_READ_REG(hw, E1000_IPCNFG);
	E1000_READ_REG(hw, E1000_EEER);
out:

	return E1000_SUCCESS;
}
/**
 *  e1000_set_eee_i350 - Enable/disable EEE support
 *  @hw: pointer to the HW structure
 *  @adv1G: boolean flag enabling 1G EEE advertisement
 *  @adv100M: boolean flag enabling 100M EEE advertisement
 *
 *  Enable/disable EEE based on setting in dev_spec structure.
 *
 **/
Enable/disable EEE support
@hw: pointer to the HW structure
@adv1G: boolean flag enabling 1G EEE advertisement
@adv100M: boolean flag enabling 100M EEE advertisement

Enable/disable EEE based on setting in dev_spec structure.
Enable / disable EEE support @hw : pointer to the HW structure @adv1G : boolean flag enabling 1G EEE advertisement @adv100M : boolean flag enabling 100M EEE advertisement Enable / disable EEE based on setting in dev_spec structure .
s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M)
{
	u32 ipcnfg, eeer;
	DEBUGFUNC("e1000_set_eee_i350");
	if ((hw->mac.type < e1000_i350) ||
	    (hw->phy.media_type != e1000_media_type_copper))
		goto out;
	ipcnfg = E1000_READ_REG(hw, E1000_IPCNFG);
	eeer = E1000_READ_REG(hw, E1000_EEER);
	if (!(hw->dev_spec._82575.eee_disable)) {
		u32 eee_su = E1000_READ_REG(hw, E1000_EEE_SU);
		if (adv100M)
			ipcnfg |= E1000_IPCNFG_EEE_100M_AN;
		else
			ipcnfg &= ~E1000_IPCNFG_EEE_100M_AN;
		if (adv1G)
			ipcnfg |= E1000_IPCNFG_EEE_1G_AN;
		else
			ipcnfg &= ~E1000_IPCNFG_EEE_1G_AN;
		eeer |= (E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN |
			 E1000_EEER_LPI_FC);
		if (eee_su & E1000_EEE_SU_LPI_CLK_STP)
			DEBUGOUT("LPI Clock Stop Bit should not be set!\n");
	} else {
		ipcnfg &= ~(E1000_IPCNFG_EEE_1G_AN | E1000_IPCNFG_EEE_100M_AN);
		eeer &= ~(E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN |
			  E1000_EEER_LPI_FC);
	}
	E1000_WRITE_REG(hw, E1000_IPCNFG, ipcnfg);
	E1000_WRITE_REG(hw, E1000_EEER, eeer);
	E1000_READ_REG(hw, E1000_IPCNFG);
	E1000_READ_REG(hw, E1000_EEER);
out:
	return E1000_SUCCESS;
}
s32 e1000_set_eee_i350 ( struct e1000_hw * hw , bool adv1G , bool adv100M ) { u32 ipcnfg , eeer ; DEBUGFUNC ( " " ) ; if ( ( hw -> mac . type < e1000_i350 ) || ( hw -> phy . media_type != e1000_media_type_copper ) ) goto out ; ipcnfg = E1000_READ_REG ( hw , E1000_IPCNFG ) ; eeer = E1000_READ_REG ( hw , E1000_EEER ) ; if ( ! ( hw -> dev_spec . _82575 . eee_disable ) ) { u32 eee_su = E1000_READ_REG ( hw , E1000_EEE_SU ) ; if ( adv100M ) ipcnfg |= E1000_IPCNFG_EEE_100M_AN ; else ipcnfg &= ~ E1000_IPCNFG_EEE_100M_AN ; if ( adv1G ) ipcnfg |= E1000_IPCNFG_EEE_1G_AN ; else ipcnfg &= ~ E1000_IPCNFG_EEE_1G_AN ; eeer |= ( E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN | E1000_EEER_LPI_FC ) ; if ( eee_su & E1000_EEE_SU_LPI_CLK_STP ) DEBUGOUT ( " \n " ) ; } else { ipcnfg &= ~ ( E1000_IPCNFG_EEE_1G_AN | E1000_IPCNFG_EEE_100M_AN ) ; eeer &= ~ ( E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN | E1000_EEER_LPI_FC ) ; } E1000_WRITE_REG ( hw , E1000_IPCNFG , ipcnfg ) ; E1000_WRITE_REG ( hw , E1000_EEER , eeer ) ; E1000_READ_REG ( hw , E1000_IPCNFG ) ; E1000_READ_REG ( hw , E1000_EEER ) ; out : return E1000_SUCCESS ; }
e1000_set_eee_i350 - Enable/disable EEE support
  @hw: pointer to the HW structure
  @adv1G: boolean flag enabling 1G EEE advertisement
  @adv100M: boolean flag enabling 100M EEE advertisement
e1000_set_eee_i350 - Enable / disable EEE support @hw : pointer to the HW structure @adv1G : boolean flag enabling 1G EEE advertisement @adv100M : boolean flag enabling 100M EEE advertisement
/* enable or disable per user setting */ /* This bit should not be set in normal operation. */