Commit 76649fc9 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: stmmac: convert half-duplex support to positive logic

Rather than detecting when half-duplex is not supported, and clearing
the MAC capabilities, reverse the if() condition and use it to set the
capabilities instead.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1qZAXn-005pUb-SP@rmk-PC.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 64961f1b
...@@ -1223,16 +1223,17 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) ...@@ -1223,16 +1223,17 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
priv->phylink_config.supported_interfaces); priv->phylink_config.supported_interfaces);
priv->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | priv->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000; MAC_10FD | MAC_100FD |
MAC_1000FD;
/* Half-Duplex can only work with single queue */
if (priv->plat->tx_queues_to_use <= 1)
priv->phylink_config.mac_capabilities |= MAC_10HD | MAC_100HD |
MAC_1000HD;
/* Get the MAC specific capabilities */ /* Get the MAC specific capabilities */
stmmac_mac_phylink_get_caps(priv); stmmac_mac_phylink_get_caps(priv);
/* Half-Duplex can only work with single queue */
if (priv->plat->tx_queues_to_use > 1)
priv->phylink_config.mac_capabilities &=
~(MAC_10HD | MAC_100HD | MAC_1000HD);
max_speed = priv->plat->max_speed; max_speed = priv->plat->max_speed;
if (max_speed) if (max_speed)
phylink_limit_mac_speed(&priv->phylink_config, max_speed); phylink_limit_mac_speed(&priv->phylink_config, max_speed);
......
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