nvethernet: Add support for EEE LPI

1. Add statistics for keeping track of EEE LPI entry/exit.
Invoke the API to configure EEE LPI in HW based on the PHY link
status and EEE support in PHY.

2. Add support to enable/disable EEE from ethtool.

Bug 2594864

Change-Id: Ib7703e087eb83269a351689f8d406564f799709a
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160786
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Srinivas Ramachandran
2019-07-24 17:46:43 -07:00
committed by Revanth Kumar Uppala
parent 610e2b6a21
commit 7fb9f30e28
3 changed files with 311 additions and 0 deletions

View File

@@ -308,6 +308,14 @@ struct ether_priv_data {
bool clks_enable;
/** Delayed work queue to read RMON counters periodically */
struct delayed_work ether_stats_work;
/** Flag to check if EEE LPI is enabled for the MAC */
unsigned int eee_enabled;
/** Flag to check if EEE LPI is active currently */
unsigned int eee_active;
/** Flag to check if EEE LPI is enabled for MAC transmitter */
unsigned int tx_lpi_enabled;
/** Time (usec) MAC waits to enter LPI after Tx complete */
unsigned int tx_lpi_timer;
};
/**
@@ -381,4 +389,5 @@ int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata,
struct ifreq *ifr);
int ether_handle_priv_ts_ioctl(struct ether_priv_data *pdata,
struct ifreq *ifr);
int ether_conf_eee(struct ether_priv_data *pdata, unsigned int tx_lpi_enable);
#endif /* ETHER_LINUX_H */