d70b9aa6a47195f651d9d2b7825ac9070a870211
[openwrt/staging/blogic.git] /
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
5 phylink_get_caps()
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
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
14 as well.
15
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>
20 ---
21 include/net/dsa.h | 4 ++--
22 net/dsa/port.c | 5 ++---
23 2 files changed, 4 insertions(+), 5 deletions(-)
24
25 --- a/include/net/dsa.h
26 +++ b/include/net/dsa.h
27 @@ -626,8 +626,8 @@ struct dsa_switch_ops {
28 /*
29 * PHYLINK integration
30 */
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);
38 --- a/net/dsa/port.c
39 +++ b/net/dsa/port.c
40 @@ -1111,9 +1111,8 @@ int dsa_port_phylink_create(struct dsa_p
41 if (err)
42 mode = PHY_INTERFACE_MODE_NA;
43
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);
49
50 dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
51 mode, &dsa_port_phylink_mac_ops);