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: <20170702101914.5nk27r2h754qzthe@collins.gmr.ssr.upm.es>
Date:   Sun, 2 Jul 2017 12:19:14 +0200
From:   Alvaro Gamez Machado <alvaro.gamez@...ent.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Anirudha Sarangi <anirudh@...inx.com>,
        John Linn <John.Linn@...inx.com>,
        Michal Simek <michal.simek@...inx.com>,
        Sören Brinkmann <soren.brinkmann@...inx.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: axienet: add of_phy_connect call for
 XAE_PHY_TYPE_MII case

On Fri, Jun 30, 2017 at 10:30:38AM -0700, Florian Fainelli wrote:
> On 06/30/2017 02:25 AM, Alvaro Gamez Machado wrote:
> >  	if (lp->phy_node) {
> > -		if (lp->phy_type == XAE_PHY_TYPE_GMII) {
> > +		if (lp->phy_type == XAE_PHY_TYPE_MII) {
> > +			phydev = of_phy_connect(lp->ndev, lp->phy_node,
> > +						axienet_adjust_link, 0,
> > +						PHY_INTERFACE_MODE_MII);
> > +		} else if (lp->phy_type == XAE_PHY_TYPE_GMII) {
> >  			phydev = of_phy_connect(lp->ndev, lp->phy_node,
> >  						axienet_adjust_link, 0,
> >  						PHY_INTERFACE_MODE_GMII);
> 
> Seems like this could be simplified even further if the values of
> lp->phy_type directly mapped to those of phy_interface_t.

Sadly, that's not the case. PHY_INTERFACE_MODE_* belong to a enum of twenty
different values, of which only _MII and _GMII overlap with XAW_PHY_*
values, but XAE_PHY_TYPE_RGMII_2_0 doesn't match
PHY_INTERFACE_MODE_RGMII_ID.

Regards
-- 
Alvaro G. M.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ