summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorJiawen Wu <jiawenwu@trustnetic.com>2024-11-15 10:35:08 +0300
committerJakub Kicinski <kuba@kernel.org>2024-11-19 05:45:18 +0300
commit2160428bcb20f2f70a72ee84aba91a1264dc4ff3 (patch)
treefd0111a8cb5e1759bc4c7007d279af728254bf18 /drivers/net/ethernet
parent62e9c00ea868ceb71156c517747dc69316c25bf1 (diff)
downloadlinux-2160428bcb20f2f70a72ee84aba91a1264dc4ff3.tar.xz
net: txgbe: fix null pointer to pcs
For 1000BASE-X or SGMII interface mode, the PCS also need to be selected. Only return null pointer when there is a copper NIC with external PHY. Fixes: 02b2a6f91b90 ("net: txgbe: support copper NIC with external PHY") Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Link: https://patch.msgid.link/20241115073508.1130046-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 67b61afdde96..2e666f65aa82 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -162,7 +162,7 @@ static struct phylink_pcs *txgbe_phylink_mac_select(struct phylink_config *confi
struct wx *wx = phylink_to_wx(config);
struct txgbe *txgbe = wx->priv;
- if (interface == PHY_INTERFACE_MODE_10GBASER)
+ if (wx->media_type != sp_media_copper)
return &txgbe->xpcs->pcs;
return NULL;