summaryrefslogtreecommitdiff
path: root/drivers/net/phy/sfp.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-09-13 20:06:37 +0100
committerJakub Kicinski <kuba@kernel.org>2022-09-20 07:54:13 -0700
commit275416754e9a262c97a1ad6f806a4bc6e0464aa2 (patch)
tree0cb601adbc09491de7097d5ba61f81c17dbff0f6 /drivers/net/phy/sfp.c
parent23571c7b96437483d28a990c906cc81f5f66374e (diff)
net: sfp: move Alcatel Lucent 3FE46541AA fixup
Add a new fixup mechanism to the SFP quirks, and use it for this module. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/sfp.c')
-rw-r--r--drivers/net/phy/sfp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 3901919e4a3f..2ef7bb4c00d1 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -311,6 +311,11 @@ static const struct of_device_id sfp_of_match[] = {
};
MODULE_DEVICE_TABLE(of, sfp_of_match);
+static void sfp_fixup_long_startup(struct sfp *sfp)
+{
+ sfp->module_t_start_up = T_START_UP_BAD_GPON;
+}
+
static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,
unsigned long *modes)
{
@@ -341,6 +346,7 @@ static const struct sfp_quirk sfp_quirks[] = {
.vendor = "ALCATELLUCENT",
.part = "3FE46541AA",
.modes = sfp_quirk_2500basex,
+ .fixup = sfp_fixup_long_startup,
}, {
// Huawei MA5671A can operate at 2500base-X, but report 1.2GBd
// NRZ in their EEPROM
@@ -2003,11 +2009,7 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report)
if (sfp->gpio[GPIO_LOS])
sfp->state_hw_mask |= SFP_F_LOS;
- if (!memcmp(id.base.vendor_name, "ALCATELLUCENT ", 16) &&
- !memcmp(id.base.vendor_pn, "3FE46541AA ", 16))
- sfp->module_t_start_up = T_START_UP_BAD_GPON;
- else
- sfp->module_t_start_up = T_START_UP;
+ sfp->module_t_start_up = T_START_UP;
if (!memcmp(id.base.vendor_name, "HUAWEI ", 16) &&
!memcmp(id.base.vendor_pn, "MA5671A ", 16))
@@ -2016,6 +2018,8 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report)
sfp->tx_fault_ignore = false;
sfp->quirk = sfp_lookup_quirk(&id);
+ if (sfp->quirk && sfp->quirk->fixup)
+ sfp->quirk->fixup(sfp);
return 0;
}