Subject: Re: [PATCH net-next] drivers: net: xgene: Check all RGMII phy mode variants

From: Andrew Lunn <[email-masked]>
Date: Thu, 18 May 2017 15:02:20 +0200

> Hi Andrew,
> 
> Our purpose is to handle our internal pdata->phy_mode, so
> phy_interface_is_rgmii(phydev) seems not to fit.
> Instead, we're working on the below:
> 
> +bool is_xgene_enet_phy_mode_rgmii(struct net_device *ndev)
> +{
> +       struct xgene_enet_pdata *pdata = netdev_priv(ndev);
> +
> +       return pdata->phy_mode >= PHY_INTERFACE_MODE_RGMII &&
> +              pdata->phy_mode <= PHY_INTERFACE_MODE_RGMII_TXID;
> +}
> +

This is very generic, can could be used by other drivers. I prefer
what Florian suggested, have a generic helper which takes phy_mode as
a parameters. And then modify phy_interface_is_rgmii() to use this
helper.

	Andrew