netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-arm-msm@vger.kernel.org, "Marek Beh__n" <kabel@kernel.org>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net-next 4/7] net: sfp: provide sfp_get_module_caps()
Date: Tue, 16 Sep 2025 22:46:51 +0100	[thread overview]
Message-ID: <E1uydVj-000000061WQ-3q47@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aMnaoPjIuzEAsESZ@shell.armlinux.org.uk>

Provide a function to retrieve the current sfp_module_caps structure
so that upstreams can get the entire module support in one go.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/sfp-bus.c | 6 ++++++
 include/linux/sfp.h       | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index b77190494b04..e8cf411396fa 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -33,6 +33,12 @@ struct sfp_bus {
 	struct sfp_module_caps caps;
 };
 
+const struct sfp_module_caps *sfp_get_module_caps(struct sfp_bus *bus)
+{
+	return &bus->caps;
+}
+EXPORT_SYMBOL_GPL(sfp_get_module_caps);
+
 /**
  * sfp_parse_port() - Parse the EEPROM base ID, setting the port type
  * @bus: a pointer to the &struct sfp_bus structure for the sfp module
diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index 5fb59cf49882..9f29fcad52be 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -576,6 +576,7 @@ struct sfp_upstream_ops {
 };
 
 #if IS_ENABLED(CONFIG_SFP)
+const struct sfp_module_caps *sfp_get_module_caps(struct sfp_bus *bus);
 int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
 		   unsigned long *support);
 bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);
@@ -600,6 +601,12 @@ int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
 void sfp_bus_del_upstream(struct sfp_bus *bus);
 const char *sfp_get_name(struct sfp_bus *bus);
 #else
+static inline const struct sfp_module_caps *
+sfp_get_module_caps(struct sfp_bus *bus)
+{
+	return NULL;
+}
+
 static inline int sfp_parse_port(struct sfp_bus *bus,
 				 const struct sfp_eeprom_id *id,
 				 unsigned long *support)
-- 
2.47.3


  parent reply	other threads:[~2025-09-16 21:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 21:46 [PATCH net-next v2 0/7] net: rework SFP capability parsing and quirks Russell King (Oracle)
2025-09-16 21:46 ` [PATCH net-next 1/7] net: phy: add phy_interface_copy() Russell King (Oracle)
2025-09-16 21:46 ` [PATCH net-next 2/7] net: sfp: pre-parse the module support Russell King (Oracle)
2025-09-16 21:46 ` [PATCH net-next 3/7] net: sfp: convert sfp quirks to modify struct sfp_module_support Russell King (Oracle)
2025-09-16 21:46 ` Russell King (Oracle) [this message]
2025-09-16 21:46 ` [PATCH net-next 5/7] net: phylink: use sfp_get_module_caps() Russell King (Oracle)
2025-09-16 21:47 ` [PATCH net-next 6/7] net: phy: update all PHYs to " Russell King (Oracle)
2025-09-16 21:47 ` [PATCH net-next 7/7] net: sfp: remove old sfp_parse_* functions Russell King (Oracle)
2025-09-18  9:11   ` Paolo Abeni
2025-09-22 23:30 ` [PATCH net-next v2 0/7] net: rework SFP capability parsing and quirks patchwork-bot+netdevbpf
2025-09-24  6:42 ` Maxime Chevallier
  -- strict thread matches above, loose matches on Subject: below --
2025-09-15 13:16 [PATCH net-next " Russell King (Oracle)
2025-09-15 13:32 ` [PATCH net-next 4/7] net: sfp: provide sfp_get_module_caps() Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1uydVj-000000061WQ-3q47@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).