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: <20080918122045.GA9157@xi.wantstofly.org>
Date:	Thu, 18 Sep 2008 14:20:45 +0200
From:	Lennert Buytenhek <buytenh@...tstofly.org>
To:	Andy Fleming <afleming@...escale.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 2/3] phylib: add missing _{check_gmii_support,link_ok,nway_restart}

On Mon, Sep 15, 2008 at 06:03:24PM -0500, Andy Fleming wrote:

> >drivers/net/mii.c provides a couple of routines which currently have
> >no phylib equivalents.  This patch provides those phylib equivalents.
> >
> >Signed-off-by: Lennert Buytenhek <buytenh@...vell.com>
> 
> I think all of this functionality is provided by other parts of the  
> phylib.  See below.
> 
> 
> >/**
> >+ * phy_check_gmii_support - check if the PHY supports (R)GMII
> >+ * @phydev: the phy_device struct
> >+ */
> >+int phy_check_gmii_support(struct phy_device *phydev)
> >+{
> >+	int retval;
> >+
> >+	retval = phy_read(phydev, MII_BMSR);
> >+	if (retval < 0 || (retval & BMSR_ESTATEN) == 0)
> >+		return 0;
> >+
> >+	retval = phy_read(phydev, MII_ESTATUS);
> >+	if (retval < 0)
> >+		return 0;
> >+
> >+	return !!(retval & (ESTATUS_1000_TFULL | ESTATUS_1000_THALF));
> >+}
> >+EXPORT_SYMBOL(phy_check_gmii_support);
> 
> If you look in genphy_config_init() in drivers/net/phy/phy_device.c,  
> you'll see that it fills in phydev->supported based on ESTATUS.  So  
> this function could be reduced to:
> 
> return !!(phydev->supported & (SUPPORTED_1000baseT_Full |  
> SUPPORTED_1000baseT_Half));

Right.  Actually, I can probably just replace the relevant code in
mv643xx_eth with:

	phy->advertising = phy->supported | ADVERTISED_Autoneg;
--
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