Skip to content

Commit 8110633

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: sfp-bus: allow SFP quirks to override Autoneg and pause bits
Allow SFP quirks to override the Autoneg, Pause and Asym_Pause bits in the support mask. Some modules have an inaccessible PHY on which is only accessible via 2500base-X without Autonegotiation. We therefore want to be able to clear the Autoneg bit. Rearrange sfp_parse_support() to allow a SFP modes quirk to override this bit. 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 cad052e commit 8110633

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-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

0 commit comments

Comments
 (0)