[PATCH net-next v5 15/23] net: phy: add phy_has_smarteee() helper

Oleksij Rempel posted 23 patches 2 years, 7 months ago
There is a newer version of this series
[PATCH net-next v5 15/23] net: phy: add phy_has_smarteee() helper
Posted by Oleksij Rempel 2 years, 7 months ago
Add helper to identify PHYs with SmartEEE support.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 include/linux/phy.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 7b50cf099b2d..2378b81321df 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1407,6 +1407,15 @@ static inline bool phy_polling_mode(struct phy_device *phydev)
 	return phydev->irq == PHY_POLL;
 }
 
+/**
+ * phy_has_rxtstamp - Tests whether a PHY supports SmartEEE.
+ * @phydev: the phy_device struct
+ */
+static inline bool phy_has_smarteee(struct phy_device *phydev)
+{
+	return phydev && phydev->drv && !!(phydev->drv->flags & PHY_SMART_EEE);
+}
+
 /**
  * phy_has_hwtstamp - Tests whether a PHY time stamp configuration.
  * @phydev: the phy_device struct
-- 
2.30.2
Re: [PATCH net-next v5 15/23] net: phy: add phy_has_smarteee() helper
Posted by Jakub Kicinski 2 years, 7 months ago
On Mon,  6 Feb 2023 14:50:42 +0100 Oleksij Rempel wrote:
> +/**
> + * phy_has_rxtstamp - Tests whether a PHY supports SmartEEE.

Function name needs to be updated

> + * @phydev: the phy_device struct
> + */
> +static inline bool phy_has_smarteee(struct phy_device *phydev)
> +{
> +	return phydev && phydev->drv && !!(phydev->drv->flags & PHY_SMART_EEE);
> +}