net: dsa: replace phylink_get_interfaces() with phylink_get_caps()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 30 Nov 2021 13:10:01 +0000 (13:10 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 2 Dec 2021 02:58:00 +0000 (18:58 -0800)
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: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Marek BehĂșn <kabel@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/dsa.h
net/dsa/port.c

index eff5c44ba3774a6799762f5c34f075500fd64024..8ca9d50cbbc2356c5dcced652ea14c22e03d55e2 100644 (file)
@@ -645,8 +645,8 @@ struct dsa_switch_ops {
        /*
         * PHYLINK integration
         */
-       void    (*phylink_get_interfaces)(struct dsa_switch *ds, int port,
-                                         unsigned long *supported_interfaces);
+       void    (*phylink_get_caps)(struct dsa_switch *ds, int port,
+                                   struct phylink_config *config);
        void    (*phylink_validate)(struct dsa_switch *ds, int port,
                                    unsigned long *supported,
                                    struct phylink_link_state *state);
index eaa66114924b5dd51d24b2d427c36c800406bf35..ef0acf005f8fe047813362113c121322ae7f5e13 100644 (file)
@@ -1091,9 +1091,8 @@ int dsa_port_phylink_create(struct dsa_port *dp)
        if (err)
                mode = PHY_INTERFACE_MODE_NA;
 
-       if (ds->ops->phylink_get_interfaces)
-               ds->ops->phylink_get_interfaces(ds, dp->index,
-                                       dp->pl_config.supported_interfaces);
+       if (ds->ops->phylink_get_caps)
+               ds->ops->phylink_get_caps(ds, dp->index, &dp->pl_config);
 
        dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn),
                                mode, &dsa_port_phylink_mac_ops);