Skip to content

Commit 50e96ac

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: sfp: add quirk for 2.5G copper SFP
Add a quirk for a copper SFP that identifies itself as "OEM" "SFP-2.5G-T". This module's PHY is inaccessible, and can only run at 2500base-X with the host without negotiation. Add a quirk to enable the 2500base-X interface mode with 2500base-T support, and disable autonegotiation. Reported-by: Frank Wunderlich <[email protected]> Tested-by: Frank Wunderlich <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8110633 commit 50e96ac

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/net/phy/sfp.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,23 @@ static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,
360360
__set_bit(PHY_INTERFACE_MODE_2500BASEX, interfaces);
361361
}
362362

363+
static void sfp_quirk_disable_autoneg(const struct sfp_eeprom_id *id,
364+
unsigned long *modes,
365+
unsigned long *interfaces)
366+
{
367+
linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, modes);
368+
}
369+
370+
static void sfp_quirk_oem_2_5g(const struct sfp_eeprom_id *id,
371+
unsigned long *modes,
372+
unsigned long *interfaces)
373+
{
374+
/* Copper 2.5G SFP */
375+
linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, modes);
376+
__set_bit(PHY_INTERFACE_MODE_2500BASEX, interfaces);
377+
sfp_quirk_disable_autoneg(id, modes, interfaces);
378+
}
379+
363380
static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id,
364381
unsigned long *modes,
365382
unsigned long *interfaces)
@@ -401,6 +418,7 @@ static const struct sfp_quirk sfp_quirks[] = {
401418
SFP_QUIRK_M("UBNT", "UF-INSTANT", sfp_quirk_ubnt_uf_instant),
402419

403420
SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_rollball_cc),
421+
SFP_QUIRK_M("OEM", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
404422
SFP_QUIRK_F("OEM", "RTSFP-10", sfp_fixup_rollball_cc),
405423
SFP_QUIRK_F("OEM", "RTSFP-10G", sfp_fixup_rollball_cc),
406424
SFP_QUIRK_F("Turris", "RTSFP-10", sfp_fixup_rollball),

0 commit comments

Comments
 (0)