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]
Date:	Wed, 12 Feb 2014 18:43:38 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
CC:	davem@...emloft.net
Subject: Re: [PATCH 04/10] net: phy: add genphy_aneg_done()

Hello.

On 12-02-2014 5:27, Florian Fainelli wrote:

> In preparation for allowing PHY drivers to potentially override their
> auto-negotiation done callback, move the contents of phy_aneg_done() to
> genphy_aneg_done() since that function really is the generic
> implementation based on the BMSR_ANEGCOMPLETE status.

> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
[...]

> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 82514e7..4e7db72 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -865,6 +865,22 @@ int genphy_config_aneg(struct phy_device *phydev)
>   }
>   EXPORT_SYMBOL(genphy_config_aneg);
>
> +/**
> + * genphy_aneg_done - return auto-negotiation status
> + * @phydev: target phy_device struct
> + *
> + * Description: Reads the status register and returns 0 either if
> + *   auto-negotiation is incomplete, or if there was an error.
> + *   Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
> + */
> +int genphy_aneg_done(struct phy_device *phydev)
> +{
> +	int retval = phy_read(phydev, MII_BMSR);
> +
> +	return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);

    I doubt parens are needed here.

WBR, Sergei

--
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