Commit 3c221af3c3bb4eadc0899f611c8b25bb95a1e09f
Committed by
Joe Hershberger
1 parent
3ab72fe807
Exists in
v2017.01-smarct4x
and in
25 other branches
net: phy: Add phy_interface_is_sgmii to phy.h
Add a helper to phy.h to identify whether the phy is configured for SGMII all variables. Signed-off-by: Dan Murphy <dmurphy@ti.com> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Showing 1 changed file with 11 additions and 0 deletions Side-by-side Diff
include/phy.h
... | ... | @@ -289,6 +289,17 @@ |
289 | 289 | phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID; |
290 | 290 | } |
291 | 291 | |
292 | +/** | |
293 | + * phy_interface_is_sgmii - Convenience function for testing if a PHY interface | |
294 | + * is SGMII (all variants) | |
295 | + * @phydev: the phy_device struct | |
296 | + */ | |
297 | +static inline bool phy_interface_is_sgmii(struct phy_device *phydev) | |
298 | +{ | |
299 | + return phydev->interface >= PHY_INTERFACE_MODE_SGMII && | |
300 | + phydev->interface <= PHY_INTERFACE_MODE_QSGMII; | |
301 | +} | |
302 | + | |
292 | 303 | /* PHY UIDs for various PHYs that are referenced in external code */ |
293 | 304 | #define PHY_UID_CS4340 0x13e51002 |
294 | 305 | #define PHY_UID_TN2020 0x00a19410 |