Skip to contentSkip to conversation

net: dsa: Add ndo_get_phys_port_name() for CPU port

PATCH Applied Florian Fainelli 2 participants 2 messages Jan 15, 2019 – Jan 17, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: Add ndo_get_phys_port_name() for CPU port

There is not currently way to infer the port number through sysfs that is being used as the CPU port number. Overlay a ndo_get_phys_port_name() operation onto the DSA master network device in order to retrieve that information.

---
 include/net/dsa.h |  5 +++++
 net/dsa/master.c  | 56 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 60 insertions(+), 1 deletion(-)
include/net/dsa.h +5 -0
index b3eefe8e18fd..2f1daf29131a 100644
@@ -208,6 +208,11 @@ struct dsa_port {
 	 * Original copy of the master netdev ethtool_ops
 	 */
 	const struct ethtool_ops *orig_ethtool_ops;
+
+	/*
+	 * Original copy of the master netdev net_device_ops
+	 */
+	const struct net_device_ops *orig_ndo_ops;
 };
 
 struct dsa_switch {
net/dsa/master.c +55 -1

83 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Tue, 15 Jan 2019 14:43:04 -0800

Quoted 6 lines

There is not currently way to infer the port number through sysfs that is being used as the CPU port number. Overlay a ndo_get_phys_port_name() operation onto the DSA master network device in order to retrieve that information.

Applied.