path: root/net
diff options
authorMarek BehĂșn <>2020-10-20 19:09:11 +0200
committerRussell King (Oracle) <>2021-06-29 14:23:10 +0100
commit75581b999a3b8c62307f2637209f22f3b643767f (patch)
tree34040313c36389de67dcc0c5794337c8a078e39c /net
parent8b0a69b80684f8e9f973e7e350cf8201c10a68b1 (diff)
net: dsa: fill phylink's config supported_interfaces member
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 phylink's config supported_interfaces member. This allows for phylink to determine which PHY_INTERFACE_MODE to use with SFP modules. Signed-off-by: Marek BehĂșn <> Signed-off-by: Russell King <>
Diffstat (limited to 'net')
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index d4756b920108..0052c7cede31 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1788,6 +1788,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,
if (IS_ERR(dp->pl)) {