Skip to content
Snippets Groups Projects
Commit 3c221af3 authored by Dan Murphy's avatar Dan Murphy Committed by Joe Hershberger
Browse files

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: default avatarDan Murphy <dmurphy@ti.com>
Reviewed-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: default avatarMichal Simek <michal.simek@xilinx.com>
Tested-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent 3ab72fe8
No related branches found
No related tags found
No related merge requests found
...@@ -289,6 +289,17 @@ static inline bool phy_interface_is_rgmii(struct phy_device *phydev) ...@@ -289,6 +289,17 @@ static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID; phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
} }
/**
* phy_interface_is_sgmii - Convenience function for testing if a PHY interface
* is SGMII (all variants)
* @phydev: the phy_device struct
*/
static inline bool phy_interface_is_sgmii(struct phy_device *phydev)
{
return phydev->interface >= PHY_INTERFACE_MODE_SGMII &&
phydev->interface <= PHY_INTERFACE_MODE_QSGMII;
}
/* PHY UIDs for various PHYs that are referenced in external code */ /* PHY UIDs for various PHYs that are referenced in external code */
#define PHY_UID_CS4340 0x13e51002 #define PHY_UID_CS4340 0x13e51002
#define PHY_UID_TN2020 0x00a19410 #define PHY_UID_TN2020 0x00a19410
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment