summaryrefslogtreecommitdiff
path: root/drivers/net/pcs
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-05-23 13:16:08 +0300
committerJakub Kicinski <kuba@kernel.org>2023-05-24 19:13:22 +0300
commit3f0360e09c8d92bb0a99c6eeeb2f3f6e7732955e (patch)
treea9d22fa04fd0be41314fbaae00f6d2ef9c8d0061 /drivers/net/pcs
parent6f7b89b45f1e9d8bdf8b4c4dcb8029633905ea85 (diff)
downloadlinux-3f0360e09c8d92bb0a99c6eeeb2f3f6e7732955e.tar.xz
net: pcs: xpcs: use mii_c73_to_linkmode() helper
Convert xpcs clause 73 reading to use the newly introduced mii_c73_to_linkmode() helper to translate the link partner advertisement to an ethtool bitmap. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/pcs')
-rw-r--r--drivers/net/pcs/pcs-xpcs.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 5723abfc6fc8..2165859a063c 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -529,18 +529,7 @@ static int xpcs_read_lpa_c73(struct dw_xpcs *xpcs,
lpa[i] = ret;
}
- if (lpa[2] & DW_C73_2500KX)
- phylink_set(state->lp_advertising, 2500baseX_Full);
- if (lpa[1] & DW_C73_1000KX)
- phylink_set(state->lp_advertising, 1000baseKX_Full);
- if (lpa[1] & DW_C73_10000KX4)
- phylink_set(state->lp_advertising, 10000baseKX4_Full);
- if (lpa[1] & DW_C73_10000KR)
- phylink_set(state->lp_advertising, 10000baseKR_Full);
- if (lpa[0] & DW_C73_PAUSE)
- phylink_set(state->lp_advertising, Pause);
- if (lpa[0] & DW_C73_ASYM_PAUSE)
- phylink_set(state->lp_advertising, Asym_Pause);
+ mii_c73_mod_linkmode(state->lp_advertising, lpa);
linkmode_and(state->lp_advertising, state->lp_advertising,
state->advertising);