linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: isubramanian@apm.com (Iyappan Subramanian)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next] drivers: net: xgene: Check all RGMII phy mode variants
Date: Wed, 17 May 2017 14:29:59 -0700	[thread overview]
Message-ID: <CAKh23FkpYd0vC-AjqQu9ZStsRNp=kFh90eRfTU5WCC6Ln7E2AA@mail.gmail.com> (raw)
In-Reply-To: <20170517202633.GA14413@lunn.ch>

On Wed, May 17, 2017 at 1:26 PM, Andrew Lunn <andrew@lunn.ch> wrote:
>> +bool is_xgene_enet_phy_mode_rgmii(struct net_device *ndev)
>> +{
>> +     struct xgene_enet_pdata *pdata = netdev_priv(ndev);
>> +     int phy_mode = pdata->phy_mode;
>> +     bool ret;
>> +
>> +     ret = phy_mode == PHY_INTERFACE_MODE_RGMII ||
>> +           phy_mode == PHY_INTERFACE_MODE_RGMII_ID ||
>> +           phy_mode == PHY_INTERFACE_MODE_RGMII_RXID ||
>> +           phy_mode == PHY_INTERFACE_MODE_RGMII_TXID;
>> +
>> +     return ret;
>> +}
>
> include/linux/phy.h:
>
> /**
>  * phy_interface_is_rgmii - Convenience function for testing if a PHY interface
>  * is RGMII (all variants)
>  * @phydev: the phy_device struct
>  */
> static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
> {
>         return phydev->interface >= PHY_INTERFACE_MODE_RGMII &&
>                 phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
> };

Thanks.  I'll use this helper function.

>
>         Andrew

  reply	other threads:[~2017-05-17 21:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 20:05 [PATCH net-next] drivers: net: xgene: Check all RGMII phy mode variants Iyappan Subramanian
2017-05-17 20:26 ` Andrew Lunn
2017-05-17 21:29   ` Iyappan Subramanian [this message]
2017-05-17 21:33     ` Florian Fainelli
2017-05-18  4:39   ` Quan Nguyen
2017-05-18 13:02     ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKh23FkpYd0vC-AjqQu9ZStsRNp=kFh90eRfTU5WCC6Ln7E2AA@mail.gmail.com' \
    --to=isubramanian@apm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).