Skip to content

Commit db1a6ad

Browse files
Josua-SRdavem330
authored andcommitted
net: sfp: handle 100G/25G active optical cables in sfp_parse_support
Handle extended compliance code 0x1 (SFF8024_ECC_100G_25GAUI_C2M_AOC) for active optical cables supporting 25G and 100G speeds. Since the specification makes no statement about transmitter range, and as the specific sfp module that had been tested features only 2m fiber - short-range (SR) modes are selected. The 100G speed is irrelevant because it would require multiple fibers / multiple SFP28 modules combined under one netdev. sfp-bus.c only handles a single module per netdev, so only 25Gbps modes are selected. sfp_parse_support already handles SFF8024_ECC_100GBASE_SR4_25GBASE_SR with compatible properties, however that entry is a contradiction in itself since with SFP(28) 100GBASE_SR4 is impossible - that would likely be a mode for qsfp modules only. Add a case for SFF8024_ECC_100G_25GAUI_C2M_AOC selecting 25gbase-r interface mode and 25000baseSR link mode. Also enforce SFP28 bitrate limits on the values read from sfp eeprom as requested by Russell King. Tested with fs.com S28-AO02 AOC SFP28 module. Signed-off-by: Josua Mayer <josua@solid-run.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2572ce6 commit db1a6ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/phy/sfp-bus.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,16 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
258258
switch (id->base.extended_cc) {
259259
case SFF8024_ECC_UNSPEC:
260260
break;
261+
case SFF8024_ECC_100G_25GAUI_C2M_AOC:
262+
if (br_min <= 28000 && br_max >= 25000) {
263+
/* 25GBASE-R, possibly with FEC */
264+
__set_bit(PHY_INTERFACE_MODE_25GBASER, interfaces);
265+
/* There is currently no link mode for 25000base
266+
* with unspecified range, reuse SR.
267+
*/
268+
phylink_set(modes, 25000baseSR_Full);
269+
}
270+
break;
261271
case SFF8024_ECC_100GBASE_SR4_25GBASE_SR:
262272
phylink_set(modes, 100000baseSR4_Full);
263273
phylink_set(modes, 25000baseSR_Full);

0 commit comments

Comments
 (0)