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

net: sfp: relax bitrate-derived mode check

Do not check the encoding when deriving 1000BASE-X from the bitrate
when no other modes are discovered. Some GPON modules (VSOL V2801F
and CarlitoxxPro CPGOS03-0490 v2.0) indicate NRZ encoding with a
1200Mbaud bitrate, but should be driven with 1000BASE-X on the host
side.

Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Russell King and committed by
David S. Miller
7a77233e 0d035bed

+5 -6
+5 -6
drivers/net/phy/sfp-bus.c
··· 334 334 } 335 335 336 336 /* If we haven't discovered any modes that this module supports, try 337 - * the encoding and bitrate to determine supported modes. Some BiDi 338 - * modules (eg, 1310nm/1550nm) are not 1000BASE-BX compliant due to 339 - * the differing wavelengths, so do not set any transceiver bits. 337 + * the bitrate to determine supported modes. Some BiDi modules (eg, 338 + * 1310nm/1550nm) are not 1000BASE-BX compliant due to the differing 339 + * wavelengths, so do not set any transceiver bits. 340 340 */ 341 341 if (bitmap_empty(modes, __ETHTOOL_LINK_MODE_MASK_NBITS)) { 342 - /* If the encoding and bit rate allows 1000baseX */ 343 - if (id->base.encoding == SFF8024_ENCODING_8B10B && br_nom && 344 - br_min <= 1300 && br_max >= 1200) 342 + /* If the bit rate allows 1000baseX */ 343 + if (br_nom && br_min <= 1300 && br_max >= 1200) 345 344 phylink_set(modes, 1000baseX_Full); 346 345 } 347 346