@@ -457,13 +457,16 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t)
457
457
/**
458
458
* stmmac_eee_init - init EEE
459
459
* @priv: driver private structure
460
+ * @active: indicates whether EEE should be enabled.
460
461
* Description:
461
462
* if the GMAC supports the EEE (from the HW cap reg) and the phy device
462
463
* can also manage EEE, this function enable the LPI state and start related
463
464
* timer.
464
465
*/
465
- static void stmmac_eee_init (struct stmmac_priv * priv )
466
+ static void stmmac_eee_init (struct stmmac_priv * priv , bool active )
466
467
{
468
+ priv -> eee_active = active ;
469
+
467
470
/* Check if MAC core supports the EEE feature. */
468
471
if (!priv -> dma_cap .eee ) {
469
472
priv -> eee_enabled = false;
@@ -970,8 +973,7 @@ static void stmmac_mac_link_down(struct phylink_config *config,
970
973
struct stmmac_priv * priv = netdev_priv (to_net_dev (config -> dev ));
971
974
972
975
stmmac_mac_set (priv , priv -> ioaddr , false);
973
- priv -> eee_active = false;
974
- stmmac_eee_init (priv );
976
+ stmmac_eee_init (priv , false);
975
977
stmmac_set_eee_pls (priv , priv -> hw , false);
976
978
977
979
if (stmmac_fpe_supported (priv ))
@@ -1083,8 +1085,7 @@ static void stmmac_mac_link_up(struct phylink_config *config,
1083
1085
phy_eee_rx_clock_stop (phy , !(priv -> plat -> flags &
1084
1086
STMMAC_FLAG_RX_CLK_RUNS_IN_LPI ));
1085
1087
priv -> tx_lpi_timer = phy -> eee_cfg .tx_lpi_timer ;
1086
- priv -> eee_active = phy -> enable_tx_lpi ;
1087
- stmmac_eee_init (priv );
1088
+ stmmac_eee_init (priv , phy -> enable_tx_lpi );
1088
1089
stmmac_set_eee_pls (priv , priv -> hw , true);
1089
1090
}
1090
1091
0 commit comments