Skip to content

Commit

Permalink
sfp: warn about modules requiring address change sequence
Browse files Browse the repository at this point in the history
We do not support SFP modules which require the address change sequence
as detailed by SFF 8472 revision 1.22 section 8.9.  Warn when these
modules are inserted, and treat them as SFF8079 modules for ethtool.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Russell King authored and David S. Miller committed Dec 1, 2017
1 parent 710dfbb commit ec7681b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/phy/sfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ static int sfp_sm_mod_probe(struct sfp *sfp)
return -EINVAL;
}

/* If the module requires address swap mode, warn about it */
if (sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE)
dev_warn(sfp->dev,
"module address swap to access page 0xA2 is not supported.\n");

return sfp_module_insert(sfp->sfp_bus, &sfp->id);
}

Expand Down Expand Up @@ -652,7 +657,8 @@ static int sfp_module_info(struct sfp *sfp, struct ethtool_modinfo *modinfo)
{
/* locking... and check module is present */

if (sfp->id.ext.sff8472_compliance) {
if (sfp->id.ext.sff8472_compliance &&
!(sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE)) {
modinfo->type = ETH_MODULE_SFF_8472;
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
} else {
Expand Down

0 comments on commit ec7681b

Please sign in to comment.