diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-06-02 11:51:53 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-04-04 14:40:00 +0100 |
commit | 88505eee7e8ed2566e65dfd9b8c6f701f8a0e96f (patch) | |
tree | 5be59ea2966235ffb532db6357f46aa7d81e2ce8 | |
parent | a782f3d91b8c727082665de32ce2b8a7a142bc0f (diff) |
net: phylink: handle MDIO_USXGMII_LINK when decoding USXGMII
If MDIO_USXGMII_LINK is not set, it means that the PHYs media side
link is down. Indicate back to phylink that the link as a whole is
down.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/phy/phylink.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 91506ed192e8..90594829df0a 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3976,12 +3976,18 @@ static void phylink_decode_sgmii_word(struct phylink_link_state *state, * @lpa: a 16 bit value which stores the USXGMII auto-negotiation word * * Helper for MAC PCS supporting the USXGMII protocol and the auto-negotiation - * code word. Decode the USXGMII code word and populate the corresponding fields - * (speed, duplex) into the phylink_link_state structure. + * code word. Decode the USXGMII code word and populate the corresponding fields + * (speed, duplex) into the phylink_link_state structure. If the code word + * indicates link is down, or we are unable to decode it, set the link down. */ void phylink_decode_usxgmii_word(struct phylink_link_state *state, uint16_t lpa) { + if (!(lpa & MDIO_USXGMII_LINK)) { + state->link = false; + return; + } + switch (lpa & MDIO_USXGMII_SPD_MASK) { case MDIO_USXGMII_10: state->speed = SPEED_10; |