Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-net-add-negotiation-of-in-band-capabilities-remainder'

Russell King says:

====================
net: net: add negotiation of in-band capabilities (remainder)

Here are the last three patches which were not included in the non-RFC
posting, but were in the RFC posting. These add the .pcs_inband()
method to the Lynx, MTK Lynx and XPCS drivers.
====================

Link: https://patch.msgid.link/Z1F1b8eh8s8T627j@shell.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+66
+22
drivers/net/pcs/pcs-lynx.c
··· 35 35 #define phylink_pcs_to_lynx(pl_pcs) container_of((pl_pcs), struct lynx_pcs, pcs) 36 36 #define lynx_to_phylink_pcs(lynx) (&(lynx)->pcs) 37 37 38 + static unsigned int lynx_pcs_inband_caps(struct phylink_pcs *pcs, 39 + phy_interface_t interface) 40 + { 41 + switch (interface) { 42 + case PHY_INTERFACE_MODE_1000BASEX: 43 + case PHY_INTERFACE_MODE_SGMII: 44 + case PHY_INTERFACE_MODE_QSGMII: 45 + return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE; 46 + 47 + case PHY_INTERFACE_MODE_10GBASER: 48 + case PHY_INTERFACE_MODE_2500BASEX: 49 + return LINK_INBAND_DISABLE; 50 + 51 + case PHY_INTERFACE_MODE_USXGMII: 52 + return LINK_INBAND_ENABLE; 53 + 54 + default: 55 + return 0; 56 + } 57 + } 58 + 38 59 static void lynx_pcs_get_state_usxgmii(struct mdio_device *pcs, 39 60 struct phylink_link_state *state) 40 61 { ··· 327 306 } 328 307 329 308 static const struct phylink_pcs_ops lynx_pcs_phylink_ops = { 309 + .pcs_inband_caps = lynx_pcs_inband_caps, 330 310 .pcs_get_state = lynx_pcs_get_state, 331 311 .pcs_config = lynx_pcs_config, 332 312 .pcs_an_restart = lynx_pcs_an_restart,
+16
drivers/net/pcs/pcs-mtk-lynxi.c
··· 88 88 return container_of(pcs, struct mtk_pcs_lynxi, pcs); 89 89 } 90 90 91 + static unsigned int mtk_pcs_lynxi_inband_caps(struct phylink_pcs *pcs, 92 + phy_interface_t interface) 93 + { 94 + switch (interface) { 95 + case PHY_INTERFACE_MODE_1000BASEX: 96 + case PHY_INTERFACE_MODE_2500BASEX: 97 + case PHY_INTERFACE_MODE_SGMII: 98 + case PHY_INTERFACE_MODE_QSGMII: 99 + return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE; 100 + 101 + default: 102 + return 0; 103 + } 104 + } 105 + 91 106 static void mtk_pcs_lynxi_get_state(struct phylink_pcs *pcs, 92 107 struct phylink_link_state *state) 93 108 { ··· 256 241 } 257 242 258 243 static const struct phylink_pcs_ops mtk_pcs_lynxi_ops = { 244 + .pcs_inband_caps = mtk_pcs_lynxi_inband_caps, 259 245 .pcs_get_state = mtk_pcs_lynxi_get_state, 260 246 .pcs_config = mtk_pcs_lynxi_config, 261 247 .pcs_an_restart = mtk_pcs_lynxi_restart_an,
+28
drivers/net/pcs/pcs-xpcs.c
··· 567 567 return 0; 568 568 } 569 569 570 + static unsigned int xpcs_inband_caps(struct phylink_pcs *pcs, 571 + phy_interface_t interface) 572 + { 573 + struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); 574 + const struct dw_xpcs_compat *compat; 575 + 576 + compat = xpcs_find_compat(xpcs, interface); 577 + if (!compat) 578 + return 0; 579 + 580 + switch (compat->an_mode) { 581 + case DW_AN_C73: 582 + return LINK_INBAND_ENABLE; 583 + 584 + case DW_AN_C37_SGMII: 585 + case DW_AN_C37_1000BASEX: 586 + return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE; 587 + 588 + case DW_10GBASER: 589 + case DW_2500BASEX: 590 + return LINK_INBAND_DISABLE; 591 + 592 + default: 593 + return 0; 594 + } 595 + } 596 + 570 597 void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) 571 598 { 572 599 const struct dw_xpcs_compat *compat; ··· 1333 1306 1334 1307 static const struct phylink_pcs_ops xpcs_phylink_ops = { 1335 1308 .pcs_validate = xpcs_validate, 1309 + .pcs_inband_caps = xpcs_inband_caps, 1336 1310 .pcs_pre_config = xpcs_pre_config, 1337 1311 .pcs_config = xpcs_config, 1338 1312 .pcs_get_state = xpcs_get_state,