All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	Jakub Kicinski <kuba@kernel.org>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>
Subject: [PATCH net-next 2/5] net: dsa: replace phylink_get_interfaces() with phylink_get_caps()
Date: Tue, 30 Nov 2021 13:10:01 +0000	[thread overview]
Message-ID: <E1ms2tV-00ECJA-2v@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <YaYiiU9nvmVugqnJ@shell.armlinux.org.uk>

Phylink needs slightly more information than phylink_get_interfaces()
allows us to get from the DSA drivers - we need the MAC capabilities.
Replace the phylink_get_interfaces() method with phylink_get_caps() to
allow DSA drivers to fill in the phylink_config MAC capabilities field
as well.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 include/net/dsa.h | 4 ++--
 net/dsa/port.c    | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index eff5c44ba377..8ca9d50cbbc2 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -645,8 +645,8 @@ struct dsa_switch_ops {
 	/*
 	 * PHYLINK integration
 	 */
-	void	(*phylink_get_interfaces)(struct dsa_switch *ds, int port,
-					  unsigned long *supported_interfaces);
+	void	(*phylink_get_caps)(struct dsa_switch *ds, int port,
+				    struct phylink_config *config);
 	void	(*phylink_validate)(struct dsa_switch *ds, int port,
 				    unsigned long *supported,
 				    struct phylink_link_state *state);
diff --git a/net/dsa/port.c b/net/dsa/port.c
index eaa66114924b..ef0acf005f8f 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -1091,9 +1091,8 @@ int dsa_port_phylink_create(struct dsa_port *dp)
 	if (err)
 		mode = PHY_INTERFACE_MODE_NA;
 
-	if (ds->ops->phylink_get_interfaces)
-		ds->ops->phylink_get_interfaces(ds, dp->index,
-					dp->pl_config.supported_interfaces);
+	if (ds->ops->phylink_get_caps)
+		ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
 
 	dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
 				mode, &dsa_port_phylink_mac_ops);
-- 
2.30.2


  parent reply	other threads:[~2021-11-30 13:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 13:09 [PATCH net-next 0/5] net: dsa: convert two drivers to phylink_generic_validate() Russell King (Oracle)
2021-11-30 13:09 ` [PATCH net-next 1/5] net: dsa: consolidate phylink creation Russell King (Oracle)
2021-11-30 15:41   ` Marek Behún
2021-11-30 15:43   ` Andrew Lunn
2021-11-30 13:10 ` Russell King (Oracle) [this message]
2021-11-30 15:42   ` [PATCH net-next 2/5] net: dsa: replace phylink_get_interfaces() with phylink_get_caps() Marek Behún
2021-11-30 15:48   ` Andrew Lunn
2021-11-30 13:10 ` [PATCH net-next 3/5] net: dsa: support use of phylink_generic_validate() Russell King (Oracle)
2021-11-30 15:43   ` Marek Behún
2021-11-30 15:49   ` Andrew Lunn
2021-11-30 13:10 ` [PATCH net-next 4/5] net: dsa: hellcreek: convert to phylink_generic_validate() Russell King (Oracle)
2021-11-30 13:10 ` [PATCH net-next 5/5] net: dsa: lantiq: " Russell King (Oracle)
2021-12-02  3:20 ` [PATCH net-next 0/5] net: dsa: convert two drivers " patchwork-bot+netdevbpf

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=E1ms2tV-00ECJA-2v@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.