From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next] drivers: net: xgene: Check all RGMII phy mode variants
Date: Thu, 18 May 2017 15:02:20 +0200 [thread overview]
Message-ID: <20170518130220.GA32503@lunn.ch> (raw)
In-Reply-To: <CAFopSPTP07TFcgc8pACQDF4ZXHOftUMBqBCgF4hVpAmUt0cCWw@mail.gmail.com>
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Quan Nguyen <qnguyen@apm.com>
Cc: Iyappan Subramanian <isubramanian@apm.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>,
linux-arm-kernel@lists.infradead.org, patches <patches@apm.com>
Subject: Re: [PATCH net-next] drivers: net: xgene: Check all RGMII phy mode variants
Date: Thu, 18 May 2017 15:02:20 +0200 [thread overview]
Message-ID: <20170518130220.GA32503@lunn.ch> (raw)
In-Reply-To: <CAFopSPTP07TFcgc8pACQDF4ZXHOftUMBqBCgF4hVpAmUt0cCWw@mail.gmail.com>
> 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
next prev parent reply other threads:[~2017-05-18 13:02 UTC|newest]
Thread overview: 12+ 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:05 ` Iyappan Subramanian
2017-05-17 20:26 ` Andrew Lunn
2017-05-17 20:26 ` Andrew Lunn
2017-05-17 21:29 ` Iyappan Subramanian
2017-05-17 21:29 ` Iyappan Subramanian
2017-05-17 21:33 ` Florian Fainelli
2017-05-17 21:33 ` Florian Fainelli
2017-05-18 4:39 ` Quan Nguyen
2017-05-18 4:39 ` Quan Nguyen
2017-05-18 13:02 ` Andrew Lunn [this message]
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=20170518130220.GA32503@lunn.ch \
--to=andrew@lunn.ch \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.