@@ -390,14 +390,24 @@ static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv, u32 queue)
return dirty;
}
-static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)
+static void stmmac_disable_hw_lpi_timer(struct stmmac_priv *priv)
+{
+ stmmac_set_eee_lpi_timer(priv, priv->hw, 0);
+}
+
+static void stmmac_enable_hw_lpi_timer(struct stmmac_priv *priv)
{
- u32 tx_lpi_timer;
+ stmmac_set_eee_lpi_timer(priv, priv->hw, priv->tx_lpi_timer);
+}
+static void stmmac_lpi_entry_timer_config(struct stmmac_priv *priv, bool en)
+{
/* Clear/set the SW EEE timer flag based on LPI ET enablement */
priv->eee_sw_timer_en = en ? 0 : 1;
- tx_lpi_timer = en ? priv->tx_lpi_timer : 0;
- stmmac_set_eee_lpi_timer(priv, priv->hw, tx_lpi_timer);
+ if (en)
+ stmmac_enable_hw_lpi_timer(priv);
+ else
+ stmmac_disable_hw_lpi_timer(priv);
}
/**