Skip to content

Commit

Permalink
net: dsa/b53: use resolved link config in mac_link_up()
Browse files Browse the repository at this point in the history
Convert the B53 driver to use the finalised link parameters in
mac_link_up() rather than the parameters in mac_config(). This is
just a matter of moving the call to b53_force_port_config().

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Russell King authored and David S. Miller committed Jun 30, 2020
1 parent 3cad1c8 commit ab017b7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/net/dsa/b53/b53_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,17 +1254,9 @@ void b53_phylink_mac_config(struct dsa_switch *ds, int port,
{
struct b53_device *dev = ds->priv;

if (mode == MLO_AN_PHY)
if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED)
return;

if (mode == MLO_AN_FIXED) {
b53_force_port_config(dev, port, state->speed,
state->duplex,
!!(state->pause & MLO_PAUSE_TX),
!!(state->pause & MLO_PAUSE_RX));
return;
}

if ((phy_interface_mode_is_8023z(state->interface) ||
state->interface == PHY_INTERFACE_MODE_SGMII) &&
dev->ops->serdes_config)
Expand Down Expand Up @@ -1314,6 +1306,8 @@ void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
return;

if (mode == MLO_AN_FIXED) {
b53_force_port_config(dev, port, speed, duplex,
tx_pause, rx_pause);
b53_force_link(dev, port, true);
return;
}
Expand Down

0 comments on commit ab017b7

Please sign in to comment.