From: Ben Hutchings <bhutchings@solarflare.com>
To: Andy Fleming <afleming@freescale.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [RFC 2/2] phylib: Convert MDIO bitbang to new MDIO 45 format
Date: Fri, 23 Apr 2010 11:22:08 +0100 [thread overview]
Message-ID: <1272018128.11697.37.camel@localhost> (raw)
In-Reply-To: <1271997497-6896-3-git-send-email-afleming@freescale.com>
On Thu, 2010-04-22 at 23:38 -0500, Andy Fleming wrote:
> Now that we've added somewhat more complete MDIO 45 support to the PHY
> Lib, convert the MDIO bitbang driver to use this new infrastructure.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> drivers/net/phy/mdio-bitbang.c | 23 +++++++++++------------
> 1 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c
> index 2f6f02e..4c0c89b 100644
> --- a/drivers/net/phy/mdio-bitbang.c
> +++ b/drivers/net/phy/mdio-bitbang.c
[...]
> @@ -157,9 +154,10 @@ static int mdiobb_read(struct mii_bus *bus, int phy, int devad, int reg)
> struct mdiobb_ctrl *ctrl = bus->priv;
> int ret, i;
>
> - if (reg & MII_ADDR_C45) {
> - reg = mdiobb_cmd_addr(ctrl, phy, reg);
> - mdiobb_cmd(ctrl, MDIO_C45_READ, phy, reg);
> + /* Clause 22 PHYs only use devad = 0, and Clause 45 only use nonzero */
> + if (devad) {
> + mdiobb_cmd_addr(ctrl, phy, devad, reg);
> + mdiobb_cmd(ctrl, MDIO_C45_READ, phy, devad);
> } else
> mdiobb_cmd(ctrl, MDIO_READ, phy, reg);
>
[...]
I don't believe there's any protocol requirement in clause 45 that
devad != 0 (although the address is not allocated). In the mdio module
I played safe and defined MDIO_DEVAD_NONE == -1 to indicate a clause 22
request.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2010-04-23 10:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-23 4:38 [RFC 0/2] phylib: Add support for MDIO clause 45 Andy Fleming
2010-04-23 4:38 ` [RFC 1/2] phylib: Convert MDIO and PHY Lib drivers to support 10G Andy Fleming
2010-04-23 4:38 ` [RFC 2/2] phylib: Convert MDIO bitbang to new MDIO 45 format Andy Fleming
2010-04-23 10:22 ` Ben Hutchings [this message]
2010-04-23 19:39 ` Andy Fleming
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=1272018128.11697.37.camel@localhost \
--to=bhutchings@solarflare.com \
--cc=afleming@freescale.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).