mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-24 22:30:32 +00:00
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 <frank-w@public-files.de> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
cad052e64a
commit
8110633db4
@ -151,6 +151,10 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
|
|||||||
unsigned int br_min, br_nom, br_max;
|
unsigned int br_min, br_nom, br_max;
|
||||||
__ETHTOOL_DECLARE_LINK_MODE_MASK(modes) = { 0, };
|
__ETHTOOL_DECLARE_LINK_MODE_MASK(modes) = { 0, };
|
||||||
|
|
||||||
|
phylink_set(modes, Autoneg);
|
||||||
|
phylink_set(modes, Pause);
|
||||||
|
phylink_set(modes, Asym_Pause);
|
||||||
|
|
||||||
/* Decode the bitrate information to MBd */
|
/* Decode the bitrate information to MBd */
|
||||||
br_min = br_nom = br_max = 0;
|
br_min = br_nom = br_max = 0;
|
||||||
if (id->base.br_nominal) {
|
if (id->base.br_nominal) {
|
||||||
@ -329,10 +333,6 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
|
|||||||
bus->sfp_quirk->modes(id, modes, interfaces);
|
bus->sfp_quirk->modes(id, modes, interfaces);
|
||||||
|
|
||||||
linkmode_or(support, support, modes);
|
linkmode_or(support, support, modes);
|
||||||
|
|
||||||
phylink_set(support, Autoneg);
|
|
||||||
phylink_set(support, Pause);
|
|
||||||
phylink_set(support, Asym_Pause);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(sfp_parse_support);
|
EXPORT_SYMBOL_GPL(sfp_parse_support);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user