Skip to content

Commit 6e4a93b

Browse files
committed
Merge branch 'quirk-for-oem-sfp-2-5g-t-copper-module'
Russell King says: ==================== Quirk for OEM SFP-2.5G-T copper module Frank Wunderlich reports that this copper module requires a quirk in order to function - in that the module needs to use 2500base-X. Moreover, negotiation must be disabled. An example of this device would be: https://www.optcore.net/product/sfp-2g-t-gen ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents cad052e + 50e96ac commit 6e4a93b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

drivers/net/phy/sfp-bus.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
151151
unsigned int br_min, br_nom, br_max;
152152
__ETHTOOL_DECLARE_LINK_MODE_MASK(modes) = { 0, };
153153

154+
phylink_set(modes, Autoneg);
155+
phylink_set(modes, Pause);
156+
phylink_set(modes, Asym_Pause);
157+
154158
/* Decode the bitrate information to MBd */
155159
br_min = br_nom = br_max = 0;
156160
if (id->base.br_nominal) {
@@ -329,10 +333,6 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
329333
bus->sfp_quirk->modes(id, modes, interfaces);
330334

331335
linkmode_or(support, support, modes);
332-
333-
phylink_set(support, Autoneg);
334-
phylink_set(support, Pause);
335-
phylink_set(support, Asym_Pause);
336336
}
337337
EXPORT_SYMBOL_GPL(sfp_parse_support);
338338

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)