[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3447c2b-4b43-4c09-b89e-d6a44971b923@lunn.ch>
Date: Sat, 3 Feb 2024 17:25:23 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Frank Rowand <frowand.list@...il.com>,
Robert Marko <robert.marko@...tura.hr>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org
Subject: Re: [net-next PATCH v5 7/9] net: phy: qcom: add support for QCA807x
PHY Family
On Fri, Feb 02, 2024 at 06:44:22PM +0100, Christian Marangi wrote:
> On Fri, Feb 02, 2024 at 02:35:11AM +0100, Andrew Lunn wrote:
> > > +static int qca807x_read_fiber_status(struct phy_device *phydev)
> > > +{
> > > + int ss, err, lpa, old_link = phydev->link;
> > > +
> > > + /* Update the link, but return if there was an error */
> > > + err = genphy_update_link(phydev);
> > > + if (err)
> > > + return err;
> > > +
> > > + /* why bother the PHY if nothing can have changed */
> > > + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
> > > + return 0;
> > > +
> > > + phydev->speed = SPEED_UNKNOWN;
> > > + phydev->duplex = DUPLEX_UNKNOWN;
> > > + phydev->pause = 0;
> > > + phydev->asym_pause = 0;
> > > +
> > > + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
> > > + lpa = phy_read(phydev, MII_LPA);
> > > + if (lpa < 0)
> > > + return lpa;
> > > +
> > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
> > > + phydev->lp_advertising, lpa & LPA_LPACK);
> > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
> > > + phydev->lp_advertising, lpa & LPA_1000XFULL);
> > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT,
> > > + phydev->lp_advertising, lpa & LPA_1000XPAUSE);
> > > + linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> > > + phydev->lp_advertising,
> > > + lpa & LPA_1000XPAUSE_ASYM);
> > > +
> > > + phy_resolve_aneg_linkmode(phydev);
> > > + }
> >
> > This looks a lot like genphy_c37_read_status(). Can it be used?
> >
>
> Yes but I had to expand genphy_c37_read_status. Hope it will be OK.
You can expand it, but please keep to what is defined within 802.3. We
don't want any vendor extensions in this common code. Vendor things
should be kept in the vendor driver. So you can call
genphy_c37_read_status() and then do any vendor specific fixups
needed.
Andrew
Powered by blists - more mailing lists