lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1272018128.11697.37.camel@localhost>
Date:	Fri, 23 Apr 2010 11:22:08 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Andy Fleming <afleming@...escale.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [RFC 2/2] phylib: Convert MDIO bitbang to new MDIO 45 format

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@...escale.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.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ