|
@@ -2548,11 +2548,13 @@ s32 igb_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data)
|
|
/**
|
|
/**
|
|
* igb_set_eee_i350 - Enable/disable EEE support
|
|
* igb_set_eee_i350 - Enable/disable EEE support
|
|
* @hw: pointer to the HW structure
|
|
* @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 based on setting in dev_spec structure.
|
|
*
|
|
*
|
|
**/
|
|
**/
|
|
-s32 igb_set_eee_i350(struct e1000_hw *hw)
|
|
|
|
|
|
+s32 igb_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M)
|
|
{
|
|
{
|
|
u32 ipcnfg, eeer;
|
|
u32 ipcnfg, eeer;
|
|
|
|
|
|
@@ -2566,7 +2568,16 @@ s32 igb_set_eee_i350(struct e1000_hw *hw)
|
|
if (!(hw->dev_spec._82575.eee_disable)) {
|
|
if (!(hw->dev_spec._82575.eee_disable)) {
|
|
u32 eee_su = rd32(E1000_EEE_SU);
|
|
u32 eee_su = rd32(E1000_EEE_SU);
|
|
|
|
|
|
- ipcnfg |= (E1000_IPCNFG_EEE_1G_AN | E1000_IPCNFG_EEE_100M_AN);
|
|
|
|
|
|
+ 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 |
|
|
eeer |= (E1000_EEER_TX_LPI_EN | E1000_EEER_RX_LPI_EN |
|
|
E1000_EEER_LPI_FC);
|
|
E1000_EEER_LPI_FC);
|
|
|
|
|
|
@@ -2593,11 +2604,13 @@ out:
|
|
/**
|
|
/**
|
|
* igb_set_eee_i354 - Enable/disable EEE support
|
|
* igb_set_eee_i354 - Enable/disable EEE support
|
|
* @hw: pointer to the HW structure
|
|
* @hw: pointer to the HW structure
|
|
|
|
+ * @adv1G: boolean flag enabling 1G EEE advertisement
|
|
|
|
+ * @adv100m: boolean flag enabling 100M EEE advertisement
|
|
*
|
|
*
|
|
* Enable/disable EEE legacy mode based on setting in dev_spec structure.
|
|
* Enable/disable EEE legacy mode based on setting in dev_spec structure.
|
|
*
|
|
*
|
|
**/
|
|
**/
|
|
-s32 igb_set_eee_i354(struct e1000_hw *hw)
|
|
|
|
|
|
+s32 igb_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M)
|
|
{
|
|
{
|
|
struct e1000_phy_info *phy = &hw->phy;
|
|
struct e1000_phy_info *phy = &hw->phy;
|
|
s32 ret_val = 0;
|
|
s32 ret_val = 0;
|
|
@@ -2636,8 +2649,16 @@ s32 igb_set_eee_i354(struct e1000_hw *hw)
|
|
if (ret_val)
|
|
if (ret_val)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
- phy_data |= E1000_EEE_ADV_100_SUPPORTED |
|
|
|
|
- E1000_EEE_ADV_1000_SUPPORTED;
|
|
|
|
|
|
+ if (adv100M)
|
|
|
|
+ phy_data |= E1000_EEE_ADV_100_SUPPORTED;
|
|
|
|
+ else
|
|
|
|
+ phy_data &= ~E1000_EEE_ADV_100_SUPPORTED;
|
|
|
|
+
|
|
|
|
+ if (adv1G)
|
|
|
|
+ phy_data |= E1000_EEE_ADV_1000_SUPPORTED;
|
|
|
|
+ else
|
|
|
|
+ phy_data &= ~E1000_EEE_ADV_1000_SUPPORTED;
|
|
|
|
+
|
|
ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354,
|
|
ret_val = igb_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354,
|
|
E1000_EEE_ADV_DEV_I354,
|
|
E1000_EEE_ADV_DEV_I354,
|
|
phy_data);
|
|
phy_data);
|