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

Merge branch 'add-100-base-x-mode'

Bjarni Jonasson says:

====================
Add 100 base-x mode

Adding support for 100 base-x in phylink.
The Sparx5 switch supports 100 base-x pcs (IEEE 802.3 Clause 24) 4b5b encoded.
These patches adds phylink support for that mode.

Tested in Sparx5, using sfp modules:
Axcen 100fx AXFE-1314-0521 (base-fx)
Axcen 100lx AXFE-1314-0551 (base-lx)
HP SFP 100FX J9054C (bx-10)
Excom SFP-SX-M1002 (base-lx)

v1 -> v2:
Added description to Documentation/networking/phy.rst
Moved PHY_INTERFACE_MODE_100BASEX to above 1000BASEX
Patching against net-next
====================

Link: https://lore.kernel.org/r/20210113115626.17381-1-bjarni.jonasson@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+18
+5
Documentation/networking/phy.rst
··· 286 286 Note: due to legacy usage, some 10GBASE-R usage incorrectly makes 287 287 use of this definition. 288 288 289 + ``PHY_INTERFACE_MODE_100BASEX`` 290 + This defines IEEE 802.3 Clause 24. The link operates at a fixed data 291 + rate of 125Mpbs using a 4B/5B encoding scheme, resulting in an underlying 292 + data rate of 100Mpbs. 293 + 289 294 Pause frames / flow control 290 295 =========================== 291 296
+9
drivers/net/phy/sfp-bus.c
··· 265 265 br_min <= 1300 && br_max >= 1200) 266 266 phylink_set(modes, 1000baseX_Full); 267 267 268 + /* 100Base-FX, 100Base-LX, 100Base-PX, 100Base-BX10 */ 269 + if (id->base.e100_base_fx || id->base.e100_base_lx) 270 + phylink_set(modes, 100baseFX_Full); 271 + if ((id->base.e_base_px || id->base.e_base_bx10) && br_nom == 100) 272 + phylink_set(modes, 100baseFX_Full); 273 + 268 274 /* For active or passive cables, select the link modes 269 275 * based on the bit rates and the cable compliance bytes. 270 276 */ ··· 394 388 395 389 if (phylink_test(link_modes, 1000baseX_Full)) 396 390 return PHY_INTERFACE_MODE_1000BASEX; 391 + 392 + if (phylink_test(link_modes, 100baseFX_Full)) 393 + return PHY_INTERFACE_MODE_100BASEX; 397 394 398 395 dev_warn(bus->sfp_dev, "Unable to ascertain link mode\n"); 399 396
+4
include/linux/phy.h
··· 104 104 * @PHY_INTERFACE_MODE_MOCA: Multimedia over Coax 105 105 * @PHY_INTERFACE_MODE_QSGMII: Quad SGMII 106 106 * @PHY_INTERFACE_MODE_TRGMII: Turbo RGMII 107 + * @PHY_INTERFACE_MODE_100BASEX: 100 BaseX 107 108 * @PHY_INTERFACE_MODE_1000BASEX: 1000 BaseX 108 109 * @PHY_INTERFACE_MODE_2500BASEX: 2500 BaseX 109 110 * @PHY_INTERFACE_MODE_RXAUI: Reduced XAUI ··· 136 135 PHY_INTERFACE_MODE_MOCA, 137 136 PHY_INTERFACE_MODE_QSGMII, 138 137 PHY_INTERFACE_MODE_TRGMII, 138 + PHY_INTERFACE_MODE_100BASEX, 139 139 PHY_INTERFACE_MODE_1000BASEX, 140 140 PHY_INTERFACE_MODE_2500BASEX, 141 141 PHY_INTERFACE_MODE_RXAUI, ··· 219 217 return "usxgmii"; 220 218 case PHY_INTERFACE_MODE_10GKR: 221 219 return "10gbase-kr"; 220 + case PHY_INTERFACE_MODE_100BASEX: 221 + return "100base-x"; 222 222 default: 223 223 return "unknown"; 224 224 }