summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-12-23 12:22:58 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2019-07-09 11:44:26 +0100
commitacb17643eb18dc05c72f0a46a532c149879cb9e3 (patch)
tree9de45fbb5dda4753555b5b99c2f04016e9f1673e
parentcba7f7ebc902eab09229bc2a1b0ad64ecefbd079 (diff)
sfp: more cotsworks fixes
Cotsworks also gets the date code wrong. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/sfp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 3ced1837cba2..8a21294d1ce8 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1571,9 +1571,9 @@ static int sfp_sm_mod_probe(struct sfp *sfp)
return -EAGAIN;
}
- /* Cotsworks do not seem to update the checksums when they
- * do the final programming with the final module part number,
- * serial number and date code.
+ /* Cotsworks do not seem to update the checksums when they update the
+ * module part number, serial number and date code. They also format
+ * the date code incorrectly.
*/
cotsworks = !memcmp(id.base.vendor_name, "COTSWORKS ", 16);
@@ -1612,11 +1612,12 @@ static int sfp_sm_mod_probe(struct sfp *sfp)
sfp->id = id;
- date[0] = sfp->id.ext.datecode[4];
- date[1] = sfp->id.ext.datecode[5];
+ /* Cotsworks also gets the date code wrong. */
+ date[0] = sfp->id.ext.datecode[4 - 2 * cotsworks];
+ date[1] = sfp->id.ext.datecode[5 - 2 * cotsworks];
date[2] = '-';
- date[3] = sfp->id.ext.datecode[2];
- date[4] = sfp->id.ext.datecode[3];
+ date[3] = sfp->id.ext.datecode[2 + 2 * cotsworks];
+ date[4] = sfp->id.ext.datecode[3 + 2 * cotsworks];
date[5] = '-';
date[6] = sfp->id.ext.datecode[0];
date[7] = sfp->id.ext.datecode[1];