net: sparx5: update PCS driver to use neg_mode
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 16 Jun 2023 12:07:19 +0000 (13:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Jun 2023 02:41:02 +0000 (19:41 -0700)
Update Sparx5's embedded PCS driver to use neg_mode rather than the
mode argument. As there is no pcs_link_up() method, this only affects
the pcs_config() method.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1qA8EZ-00EaGF-6F@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_main.c
drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c

index a7edf52..dc9af48 100644 (file)
@@ -281,6 +281,7 @@ static int sparx5_create_port(struct sparx5 *sparx5,
        spx5_port->custom_etype = 0x8880; /* Vitesse */
        spx5_port->phylink_pcs.poll = true;
        spx5_port->phylink_pcs.ops = &sparx5_phylink_pcs_ops;
+       spx5_port->phylink_pcs.neg_mode = true;
        spx5_port->is_mrouter = false;
        INIT_LIST_HEAD(&spx5_port->tc_templates);
        sparx5->ports[config->portno] = spx5_port;
index bb97d27..f8562c1 100644 (file)
@@ -91,8 +91,7 @@ static void sparx5_pcs_get_state(struct phylink_pcs *pcs,
        state->pause = status.pause;
 }
 
-static int sparx5_pcs_config(struct phylink_pcs *pcs,
-                            unsigned int mode,
+static int sparx5_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
                             phy_interface_t interface,
                             const unsigned long *advertising,
                             bool permit_pause_to_mac)
@@ -104,8 +103,9 @@ static int sparx5_pcs_config(struct phylink_pcs *pcs,
        conf = port->conf;
        conf.power_down = false;
        conf.portmode = interface;
-       conf.inband = phylink_autoneg_inband(mode);
-       conf.autoneg = phylink_test(advertising, Autoneg);
+       conf.inband = neg_mode == PHYLINK_PCS_NEG_INBAND_DISABLED ||
+                     neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
+       conf.autoneg = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
        conf.pause_adv = 0;
        if (phylink_test(advertising, Pause))
                conf.pause_adv |= ADVERTISE_1000XPAUSE;