diff options
author | Igor Russkikh <irusskikh@marvell.com> | 2020-10-05 17:39:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-06 15:16:01 +0200 |
commit | 60db5e408e432d57f93e1eaec8fc9d7a05caa1f9 (patch) | |
tree | 6464701adb7436481e0df986de6f52897d31e352 /drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c | |
parent | net: atlantic: implement phy downshift feature (diff) | |
download | linux-60db5e408e432d57f93e1eaec8fc9d7a05caa1f9.tar.xz linux-60db5e408e432d57f93e1eaec8fc9d7a05caa1f9.zip |
net: atlantic: implement media detect feature via phy tunables
Mediadetect is another name for the EDPD (energy detect power down).
This feature allows device to save extra power when no link is available.
PHY goes into the extreme power saving mode and only periodically wakes up
and checks for the link.
AQC devices has fixed check period of 6 seconds
The feature may increase linkup time.
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c index 3f87cc6e2538..de2a9348bc3f 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c @@ -923,6 +923,12 @@ static int aq_ethtool_get_phy_tunable(struct net_device *ndev, struct aq_nic_s *aq_nic = netdev_priv(ndev); switch (tuna->id) { + case ETHTOOL_PHY_EDPD: { + u16 *val = data; + + *val = aq_nic->aq_nic_cfg.is_media_detect ? AQ_HW_MEDIA_DETECT_CNT : 0; + break; + } case ETHTOOL_PHY_DOWNSHIFT: { u8 *val = data; @@ -943,6 +949,12 @@ static int aq_ethtool_set_phy_tunable(struct net_device *ndev, struct aq_nic_s *aq_nic = netdev_priv(ndev); switch (tuna->id) { + case ETHTOOL_PHY_EDPD: { + const u16 *val = data; + + err = aq_nic_set_media_detect(aq_nic, *val); + break; + } case ETHTOOL_PHY_DOWNSHIFT: { const u8 *val = data; |