From 59c428e36d2326b535a4b3fc86eb354c596fb50d Mon Sep 17 00:00:00 2001 From: Marek BehĂșn Date: Tue, 20 Oct 2020 19:09:11 +0200 Subject: net: dsa: fill phylink's config 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 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 --- net/dsa/slave.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/dsa/slave.c') diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 4a0498bf6c65..2c8a833467e8 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1694,6 +1694,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)) { -- cgit