diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2020-01-03 23:13:28 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-04-04 14:40:02 +0100 |
commit | 1bcf2fce41ccba2ba47df351f75648fecf34d4bc (patch) | |
tree | a18ded72b4d35efe0a11b76e4b79be71e714dcc7 | |
parent | 88505eee7e8ed2566e65dfd9b8c6f701f8a0e96f (diff) |
net: phy: add resolved pause support [*not for mainline*]
Allow phylib drivers to pass the hardware-resolved pause state to MAC
drivers, rather than using the software-based pause resolution code.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/phy/phy_device.c | 6 | ||||
-rw-r--r-- | include/linux/phy.h | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index d5c71308b966..4e5cfc93f1b2 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3103,6 +3103,12 @@ void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause) return; } + if (phydev->resolved_pause_valid) { + *tx_pause = phydev->resolved_tx_pause; + *rx_pause = phydev->resolved_rx_pause; + return; + } + return linkmode_resolve_pause(phydev->advertising, phydev->lp_advertising, tx_pause, rx_pause); diff --git a/include/linux/phy.h b/include/linux/phy.h index 19f076a71f94..8415b10e68fc 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -716,6 +716,15 @@ struct phy_device { u8 master_slave_set; u8 master_slave_state; + /* + * private to phylib: the resolved pause state - only valid if + * resolved_pause_valid is true. only phy drivers and phylib + * should touch this. + */ + bool resolved_pause_valid; + bool resolved_tx_pause; + bool resolved_rx_pause; + /* Union of PHY and Attached devices' supported link modes */ /* See ethtool.h for more info */ __ETHTOOL_DECLARE_LINK_MODE_MASK(supported); |