Message ID | 20201020170912.25959-2-kabel@kernel.org |
---|---|
State | Awaiting Upstream |
Delegated to: | David Miller |
Headers | show |
Series | net: dsa: mv88e6xxx: fill phylink's supported interfaces to make SFP modules work under DSA ports | expand |
Context | Check | Description |
---|---|---|
jkicinski/cover_letter | success | Link |
jkicinski/fixes_present | fail | Series targets non-next tree, but doesn't contain any Fixes tags |
jkicinski/patch_count | success | Link |
jkicinski/tree_selection | success | Clearly marked for net |
jkicinski/subject_prefix | success | Link |
jkicinski/source_inline | success | Was 0 now: 0 |
jkicinski/verify_signedoff | success | Link |
jkicinski/module_param | success | Was 0 now: 0 |
jkicinski/build_32bit | fail | Errors and warnings before: 19 this patch: 23 |
jkicinski/kdoc | success | Errors and warnings before: 0 this patch: 0 |
jkicinski/verify_fixes | success | Link |
jkicinski/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 18 lines checked |
jkicinski/build_allmodconfig_warn | fail | Errors and warnings before: 19 this patch: 23 |
jkicinski/header_inline | success | Link |
jkicinski/stable | success | Stable not CCed |
diff --git a/include/net/dsa.h b/include/net/dsa.h index 75c8fac82017..710900b6019b 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -438,6 +438,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/slave.c b/net/dsa/slave.c index 16e5f98d4882..0f24d2f28737 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1639,6 +1639,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)) {
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 <kabel@kernel.org> --- include/net/dsa.h | 2 ++ net/dsa/slave.c | 4 ++++ 2 files changed, 6 insertions(+)