[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZoVlnLkXuJ0J/da3@shell.armlinux.org.uk>
Date: Wed, 3 Jul 2024 15:52:12 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com,
Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
linux-arm-kernel@...ts.infradead.org,
Christophe Leroy <christophe.leroy@...roup.eu>,
Herve Codina <herve.codina@...tlin.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Köry Maincent <kory.maincent@...tlin.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Marek Behún <kabel@...nel.org>,
Piergiorgio Beruto <piergiorgio.beruto@...il.com>,
Oleksij Rempel <o.rempel@...gutronix.de>,
Nicolò Veronese <nicveronese@...il.com>,
Simon Horman <horms@...nel.org>, mwojtas@...omium.org,
Nathan Chancellor <nathan@...nel.org>,
Antoine Tenart <atenart@...nel.org>,
Marc Kleine-Budde <mkl@...gutronix.de>,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH net-next v15 07/14] net: ethtool: Introduce a command to
list PHYs on an interface
On Wed, Jul 03, 2024 at 04:07:57PM +0200, Maxime Chevallier wrote:
> +static int
> +ethnl_phy_fill_reply(const struct ethnl_req_info *req_base, struct sk_buff *skb)
> +{
> + struct phy_req_info *req_info = PHY_REQINFO(req_base);
> + struct phy_device_node *pdn = req_info->pdn;
> + struct phy_device *phydev = pdn->phy;
> + enum phy_upstream ptype;
> +
> + ptype = pdn->upstream_type;
> +
> + if (nla_put_u32(skb, ETHTOOL_A_PHY_INDEX, phydev->phyindex) ||
> + nla_put_string(skb, ETHTOOL_A_PHY_NAME, dev_name(&phydev->mdio.dev)) ||
> + nla_put_u32(skb, ETHTOOL_A_PHY_UPSTREAM_TYPE, ptype) ||
> + nla_put_u32(skb, ETHTOOL_A_PHY_ID, phydev->phy_id))
> + return -EMSGSIZE;
I'm really not sure that it is a good idea to export phydev->phy_id
through this API.
Clause 45-only PHYs don't have a phy_id, they have a whole bunch of
IDs (actually, two per MMD - a device ID and a package ID. I think
the package ID is supposed to be the same for all MMDs, but in
practice it isn't.
For example, 88x3310 uses:
MMD devid pkgid
1 002b09aa 002b09aa
3 002b09aa 002b09aa
4 01410daa 01410daa
7 002b09aa 002b09aa
So, if we want to report the ID of the PHY, then really we need to
report the clause 22 ID, and at least all the devids of each MMD in
a clause 45 PHY. Alternatively, we may decide it isn't worth the
effort of reporting any of these IDs.
However, reporting just the clause 22 ID would be a design error
IMHO.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists