[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZAdPPAL549lg1uFG@shell.armlinux.org.uk>
Date: Tue, 7 Mar 2023 14:50:36 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Sean Anderson <sean.anderson@...o.com>,
Heiner Kallweit <hkallweit1@...il.com>, netdev@...r.kernel.org,
"David S . Miller" <davem@...emloft.net>,
Vladimir Oltean <olteanv@...il.com>,
linux-kernel@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next] net: mdio: Add netlink interface
On Tue, Mar 07, 2023 at 03:22:46PM +0100, Andrew Lunn wrote:
> > + switch ((enum mdio_nl_op)insn->op) {
> > + case MDIO_NL_OP_READ:
> > + phy_id = __arg_ri(insn->arg0, regs);
> > + prtad = mdio_phy_id_prtad(phy_id);
> > + devad = mdio_phy_id_devad(phy_id);
> > + reg = __arg_ri(insn->arg1, regs);
> > +
> > + if (mdio_phy_id_is_c45(phy_id))
> > + ret = __mdiobus_c45_read(xfer->mdio, prtad,
> > + devad, reg);
> > + else
> > + ret = __mdiobus_read(xfer->mdio, phy_id, reg);
>
> The application should say if it want to do C22 or C45. As you said in
> the cover note, the ioctl interface is limiting when there is no PHY,
> so you are artificially adding the same restriction here. Also, you
> might want to do C45 on a C22 PHY, e.g. to access EEE registers. Plus
> you could consider adding C45 over C22 here.
Remembering of course that C45-over-C22 on a device that isn't a PHY
could end up causing havoc, but then if you are using this interface,
you already have the gun pointing at your foot... and if you go and
try C45-over-C22 to scan a MDIO bus, you'd definitely be pulling the
trigger too.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists