mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
cxgb4: fix eeprom len when diagnostics not implemented
[ Upstream commit4ca110bf8d] Ensure diagnostics monitoring support is implemented for the SFF 8472 compliant port module and set the correct length for ethtool port module eeprom read. Fixes:f56ec6766d("cxgb4: Add support for ethtool i2c dump") Signed-off-by: Manoj Malviya <manojmalviya@chelsio.com> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
93bc3ef607
commit
8b215edb7a
|
|
@ -2011,12 +2011,15 @@ static int cxgb4_get_module_info(struct net_device *dev,
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (!sff8472_comp || (sff_diag_type & 4)) {
|
if (!sff8472_comp || (sff_diag_type & SFP_DIAG_ADDRMODE)) {
|
||||||
modinfo->type = ETH_MODULE_SFF_8079;
|
modinfo->type = ETH_MODULE_SFF_8079;
|
||||||
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
|
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
|
||||||
} else {
|
} else {
|
||||||
modinfo->type = ETH_MODULE_SFF_8472;
|
modinfo->type = ETH_MODULE_SFF_8472;
|
||||||
|
if (sff_diag_type & SFP_DIAG_IMPLEMENTED)
|
||||||
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
|
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
|
||||||
|
else
|
||||||
|
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN / 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,8 @@ enum {
|
||||||
#define I2C_PAGE_SIZE 0x100
|
#define I2C_PAGE_SIZE 0x100
|
||||||
#define SFP_DIAG_TYPE_ADDR 0x5c
|
#define SFP_DIAG_TYPE_ADDR 0x5c
|
||||||
#define SFP_DIAG_TYPE_LEN 0x1
|
#define SFP_DIAG_TYPE_LEN 0x1
|
||||||
|
#define SFP_DIAG_ADDRMODE BIT(2)
|
||||||
|
#define SFP_DIAG_IMPLEMENTED BIT(6)
|
||||||
#define SFF_8472_COMP_ADDR 0x5e
|
#define SFF_8472_COMP_ADDR 0x5e
|
||||||
#define SFF_8472_COMP_LEN 0x1
|
#define SFF_8472_COMP_LEN 0x1
|
||||||
#define SFF_REV_ADDR 0x1
|
#define SFF_REV_ADDR 0x1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user