summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-06-02 11:51:53 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-07 10:49:44 +0100
commit91076ef35b1ae107aa1d917e126089eec7ab2c9c (patch)
tree4016d377f9ba58664147d4dd108d65d6ac55ac89 /drivers/net/phy/phylink.c
parent19805fe05795d4a0364ddb1a74b12121607261ca (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>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index eb8dd57e30f7..57feda626b41 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -3842,12 +3842,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;