1 From 072eea6c22b2af680c3949e64f9adde278c71e68 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Tue, 30 Nov 2021 13:10:01 +0000
4 Subject: [PATCH] net: dsa: replace phylink_get_interfaces() with
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Phylink needs slightly more information than phylink_get_interfaces()
11 allows us to get from the DSA drivers - we need the MAC capabilities.
12 Replace the phylink_get_interfaces() method with phylink_get_caps() to
13 allow DSA drivers to fill in the phylink_config MAC capabilities field
16 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
17 Reviewed-by: Marek BehĂșn <kabel@kernel.org>
18 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
19 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
21 include/net/dsa.h | 4 ++--
22 net/dsa/port.c | 5 ++---
23 2 files changed, 4 insertions(+), 5 deletions(-)
25 --- a/include/net/dsa.h
26 +++ b/include/net/dsa.h
27 @@ -626,8 +626,8 @@ struct dsa_switch_ops {
31 - void (*phylink_get_interfaces)(struct dsa_switch *ds, int port,
32 - unsigned long *supported_interfaces);
33 + void (*phylink_get_caps)(struct dsa_switch *ds, int port,
34 + struct phylink_config *config);
35 void (*phylink_validate)(struct dsa_switch *ds, int port,
36 unsigned long *supported,
37 struct phylink_link_state *state);
40 @@ -1111,9 +1111,8 @@ int dsa_port_phylink_create(struct dsa_p
42 mode = PHY_INTERFACE_MODE_NA;
44 - if (ds->ops->phylink_get_interfaces)
45 - ds->ops->phylink_get_interfaces(ds, dp->index,
46 - dp->pl_config.supported_interfaces);
47 + if (ds->ops->phylink_get_caps)
48 + ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
50 dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
51 mode, &dsa_port_phylink_mac_ops);