summaryrefslogtreecommitdiff
path: root/include/linux/sfp.h
diff options
context:
space:
mode:
authorMaxime Chevallier <maxime.chevallier@bootlin.com>2024-04-04 11:29:54 +0200
committerDavid S. Miller <davem@davemloft.net>2024-04-06 18:25:14 +0100
commitfdd353965b52de7580795824de7010a73ff98f30 (patch)
treec8824bfae17f902b7d255a757fbb522207721776 /include/linux/sfp.h
parente75e4e074c4475a3a6145593ecf2dcaf3995fa50 (diff)
downloadlwn-fdd353965b52de7580795824de7010a73ff98f30.tar.gz
lwn-fdd353965b52de7580795824de7010a73ff98f30.zip
net: sfp: Add helper to return the SFP bus name
Knowing the bus name is helpful when we want to expose the link topology to userspace, add a helper to return the SFP bus name. Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/sfp.h')
-rw-r--r--include/linux/sfp.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index 0573e53b0c11..55c0ab17c9e2 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -570,6 +570,7 @@ struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode);
int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
const struct sfp_upstream_ops *ops);
void sfp_bus_del_upstream(struct sfp_bus *bus);
+const char *sfp_get_name(struct sfp_bus *bus);
#else
static inline int sfp_parse_port(struct sfp_bus *bus,
const struct sfp_eeprom_id *id,
@@ -648,6 +649,11 @@ static inline int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
static inline void sfp_bus_del_upstream(struct sfp_bus *bus)
{
}
+
+static inline const char *sfp_get_name(struct sfp_bus *bus)
+{
+ return NULL;
+}
#endif
#endif