[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230907092407.647139-8-maxime.chevallier@bootlin.com>
Date: Thu, 7 Sep 2023 11:24:05 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: davem@...emloft.net
Cc: Maxime Chevallier <maxime.chevallier@...tlin.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Vladimir Oltean <vladimir.oltean@....com>,
Oleksij Rempel <linux@...pel-privat.de>,
Nicolò Veronese <nicveronese@...il.com>,
thomas.petazzoni@...tlin.com,
Christophe Leroy <christophe.leroy@...roup.eu>
Subject: [RFC PATCH net-next 7/7] netlink: specs: add command to show individual phy information
With the ETHTOOL_CMD_PHY_LIST_GET command, we can obtain a list of PHYs
on a link, addressable through their phyindex. This index can be used to
issue PHY-specific commands. The phy_get command allows querying per-PHY
information. The information reported so-far is minimal (driver name,
phy id (for C22), upstream PHY type (real PHY, SFP phy), but we can
imagine extending this in the future to report PHY offloading
capabilities, status, and much more.
Example usage :
./cli.py --spec specs/ethtool.yaml --schema genetlink-legacy.yaml \
--do phy-list-get --json '{"header" : {"dev-name" : "eth0"}}'
{'header': {'dev-index': 2, 'dev-name': 'eth0'},
'phy-count': 2,
'phy-indices': b'\x02\x00\x00\x00\x01\x00\x00\x00'}
./cli.py --spec specs/ethtool.yaml --schema genetlink-legacy.yaml \
--do phy-get \
--json '{"header" : {"dev-name" : "eth0"}, "phy-index" : 1}'
{'drvname': 'mv88x3310',
'header': {'dev-index': 2, 'dev-name': 'eth0'},
'phy-id': 0,
'phy-index': 1,
'phy-upstream-type': 0}
./cli.py --spec specs/ethtool.yaml --schema genetlink-legacy.yaml \
--do phy-get \
--json '{"header" : {"dev-name" : "eth0"}, "phy-index" : 2}'
{'drvname': 'Marvell 88E1111',
'header': {'dev-index': 2, 'dev-name': 'eth0'},
'phy-id': 21040322,
'phy-index': 2,
'phy-upstream-type': 2}
Signed-off-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
---
Documentation/netlink/specs/ethtool.yaml | 37 ++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index 1139c88ed65c..708a77423286 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -955,6 +955,25 @@ attribute-sets:
-
name: phy-indices
type: binary
+ -
+ name: phy
+ attributes:
+ -
+ name: header
+ type: nest
+ nested-attributes: header
+ -
+ name: phy-index
+ type: u32
+ -
+ name: drvname
+ type: string
+ -
+ name: phy-upstream-type
+ type: u8
+ -
+ name: phy-id
+ type: u32
operations:
enum-model: directional
@@ -1720,3 +1739,21 @@ operations:
- header
- phy-count
- phy-indices
+ -
+ name: phy-get
+ doc: Get a PHY's information
+
+ attribute-set: phy
+
+ do: &phy-get-op
+ request:
+ attributes:
+ - header
+ - phy-index
+ reply:
+ attributes:
+ - header
+ - phy-index
+ - drvname
+ - phy-upstream-type
+ - phy-id
--
2.41.0
Powered by blists - more mailing lists