Commit 072eea6c authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: dsa: replace phylink_get_interfaces() with phylink_get_caps()

Phylink needs slightly more information than phylink_get_interfaces()
allows us to get from the DSA drivers - we need the MAC capabilities.
Replace the phylink_get_interfaces() method with phylink_get_caps() to
allow DSA drivers to fill in the phylink_config MAC capabilities field
as well.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 21bd64bd
...@@ -645,8 +645,8 @@ struct dsa_switch_ops { ...@@ -645,8 +645,8 @@ struct dsa_switch_ops {
/* /*
* PHYLINK integration * PHYLINK integration
*/ */
void (*phylink_get_interfaces)(struct dsa_switch *ds, int port, void (*phylink_get_caps)(struct dsa_switch *ds, int port,
unsigned long *supported_interfaces); struct phylink_config *config);
void (*phylink_validate)(struct dsa_switch *ds, int port, void (*phylink_validate)(struct dsa_switch *ds, int port,
unsigned long *supported, unsigned long *supported,
struct phylink_link_state *state); struct phylink_link_state *state);
......
...@@ -1091,9 +1091,8 @@ int dsa_port_phylink_create(struct dsa_port *dp) ...@@ -1091,9 +1091,8 @@ int dsa_port_phylink_create(struct dsa_port *dp)
if (err) if (err)
mode = PHY_INTERFACE_MODE_NA; mode = PHY_INTERFACE_MODE_NA;
if (ds->ops->phylink_get_interfaces) if (ds->ops->phylink_get_caps)
ds->ops->phylink_get_interfaces(ds, dp->index, ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
dp->pl_config.supported_interfaces);
dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn), dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
mode, &dsa_port_phylink_mac_ops); mode, &dsa_port_phylink_mac_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment