diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-02-25 19:19:25 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-02-26 15:44:28 +0300 |
commit | 79fda660bdbba839f434cf8674ff4a20d88fbeb2 (patch) | |
tree | 046521b64ed941825932b4a36f40323ea47bc7a8 /drivers | |
parent | 3e120e45801809ee25cab90690ea633bf20875ba (diff) | |
download | linux-79fda660bdbba839f434cf8674ff4a20d88fbeb2.tar.xz |
net: dsa: ocelot: populate supported_interfaces
Populate the supported interfaces bitmap for the Ocelot DSA switches.
Since all sub-drivers only support a single interface mode, defined by
ocelot_port->phy_mode, we can handle this in the main driver code
without reference to the sub-driver.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dsa/ocelot/felix.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 9959407fede8..a1a6ace39aab 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -778,6 +778,15 @@ static int felix_vlan_del(struct dsa_switch *ds, int port, return ocelot_vlan_del(ocelot, port, vlan->vid); } +static void felix_phylink_get_caps(struct dsa_switch *ds, int port, + struct phylink_config *config) +{ + struct ocelot *ocelot = ds->priv; + + __set_bit(ocelot->ports[port]->phy_mode, + config->supported_interfaces); +} + static void felix_phylink_validate(struct dsa_switch *ds, int port, unsigned long *supported, struct phylink_link_state *state) @@ -1587,6 +1596,7 @@ const struct dsa_switch_ops felix_switch_ops = { .get_ethtool_stats = felix_get_ethtool_stats, .get_sset_count = felix_get_sset_count, .get_ts_info = felix_get_ts_info, + .phylink_get_caps = felix_phylink_get_caps, .phylink_validate = felix_phylink_validate, .phylink_mac_config = felix_phylink_mac_config, .phylink_mac_link_down = felix_phylink_mac_link_down, |