diff mbox

[uboot,v5,6/7] net: phy: Add phy_interface_is_sgmii to phy.h

Message ID 1460377108-19262-6-git-send-email-dmurphy@ti.com
State Superseded
Headers show

Commit Message

Dan Murphy April 11, 2016, 12:18 p.m. UTC
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>

---

v5 - No change

 include/phy.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
2.8.0.rc3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Dan Murphy April 13, 2016, 1:38 p.m. UTC | #1
Adding Joe

On 04/11/2016 07:18 AM, Dan Murphy wrote:
> 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>

> ---

>

> v5 - No change

>

>  include/phy.h | 11 +++++++++++

>  1 file changed, 11 insertions(+)

>

> diff --git a/include/phy.h b/include/phy.h

> index 7b2d1ff..ef3eb51 100644

> --- a/include/phy.h

> +++ b/include/phy.h

> @@ -288,6 +288,17 @@ static inline bool phy_interface_is_rgmii(struct phy_device *phydev)

>  		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 */

>  #define PHY_UID_CS4340  0x13e51002

>  #define PHY_UID_TN2020	0x00a19410



-- 
------------------
Dan Murphy

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/include/phy.h b/include/phy.h
index 7b2d1ff..ef3eb51 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -288,6 +288,17 @@  static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
 		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 */
 #define PHY_UID_CS4340  0x13e51002
 #define PHY_UID_TN2020	0x00a19410