[PATCH net-next] drivers: net: xgene: Check all RGMII phy mode variants
Andrew Lunn
andrew at lunn.ch
Thu May 18 06:02:20 PDT 2017
> 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
More information about the linux-arm-kernel
mailing list