aboutsummaryrefslogtreecommitdiff
path: root/pkgs/patches-linux-5.15/781-v5.17-1-net-dsa-populate-supported_interfaces-member.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/patches-linux-5.15/781-v5.17-1-net-dsa-populate-supported_interfaces-member.patch')
-rw-r--r--pkgs/patches-linux-5.15/781-v5.17-1-net-dsa-populate-supported_interfaces-member.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/patches-linux-5.15/781-v5.17-1-net-dsa-populate-supported_interfaces-member.patch b/pkgs/patches-linux-5.15/781-v5.17-1-net-dsa-populate-supported_interfaces-member.patch
new file mode 100644
index 0000000..d4bcbb3
--- /dev/null
+++ b/pkgs/patches-linux-5.15/781-v5.17-1-net-dsa-populate-supported_interfaces-member.patch
@@ -0,0 +1,72 @@
+From e89cf45caa992df5baee7ce07431d9598ac1defc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
+Date: Thu, 28 Oct 2021 18:00:14 +0100
+Subject: [PATCH 1/6] net: dsa: populate supported_interfaces member
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add a new DSA switch operation, phylink_get_interfaces, which should
+fill in which PHY_INTERFACE_MODE_* are supported by given port.
+
+Use this before phylink_create() to fill phylinks supported_interfaces
+member, allowing phylink to determine which PHY_INTERFACE_MODEs are
+supported.
+
+Signed-off-by: Marek BehĂșn <kabel@kernel.org>
+[tweaked patch and description to add more complete support -- rmk]
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ include/net/dsa.h | 2 ++
+ net/dsa/port.c | 4 ++++
+ net/dsa/slave.c | 4 ++++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/include/net/dsa.h b/include/net/dsa.h
+index 206ff3c4ce47..77d0d9a8e2ab 100644
+--- a/include/net/dsa.h
++++ b/include/net/dsa.h
+@@ -636,6 +636,8 @@ struct dsa_switch_ops {
+ /*
+ * PHYLINK integration
+ */
++ void (*phylink_get_interfaces)(struct dsa_switch *ds, int port,
++ unsigned long *supported_interfaces);
+ 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 a21015d6bd36..d1502403aeb8 100644
+--- a/net/dsa/port.c
++++ b/net/dsa/port.c
+@@ -1172,6 +1172,10 @@ static int dsa_port_phylink_register(struct dsa_port *dp)
+ dp->pl_config.type = PHYLINK_DEV;
+ dp->pl_config.pcs_poll = ds->pcs_poll;
+
++ if (ds->ops->phylink_get_interfaces)
++ ds->ops->phylink_get_interfaces(ds, dp->index,
++ dp->pl_config.supported_interfaces);
++
+ dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn),
+ mode, &dsa_port_phylink_mac_ops);
+ if (IS_ERR(dp->pl)) {
+diff --git a/net/dsa/slave.c b/net/dsa/slave.c
+index 4d581bd22cd5..525140370950 100644
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -1837,6 +1837,10 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
+ dp->pl_config.poll_fixed_state = true;
+ }
+
++ if (ds->ops->phylink_get_interfaces)
++ ds->ops->phylink_get_interfaces(ds, dp->index,
++ dp->pl_config.supported_interfaces);
++
+ dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn), mode,
+ &dsa_port_phylink_mac_ops);
+ if (IS_ERR(dp->pl)) {
+--
+2.35.1
+