Commit 4aef02ae authored by Hao Lan's avatar Hao Lan Committed by Jiantao Xiao
Browse files

net: hns3: Add support for some CMIS transceiver modules

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9A3QT


CVE: NA

----------------------------------------------------------------------

Add two more SFF-8024 Identifier Values that according to the standard
support the Common Management Interface Specification (CMIS) memory map
so the hns3 driver will be able to dump, parse and print their EEPROM
contents.This two SFF-8024 Identifier Values are SFF8024_ID_QSFP_DD (0x18)
and SFF8024_ID_QSFP_PLUS_CMIS (0x1E).

Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent d5797eb9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1830,6 +1830,14 @@ static int hns3_get_module_info(struct net_device *netdev,
		modinfo->type = ETH_MODULE_SFF_8636;
		modinfo->eeprom_len = ETH_MODULE_SFF_8636_MAX_LEN;
		break;
	case SFF8024_ID_QSFP_DD:
	case SFF8024_ID_QSFP_PLUS_CMIS:
		modinfo->type = ETH_MODULE_SFF_8636;
		if (sfp_type.flat_mem & HNS3_CMIS_FLAT_MEMORY)
			modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN;
		else
			modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
		break;
	default:
		netdev_err(netdev, "Optical module unknown: %#x\n",
			   sfp_type.type);
+2 −0
Original line number Diff line number Diff line
@@ -12,9 +12,11 @@ struct hns3_stats {
	int stats_offset;
};

#define HNS3_CMIS_FLAT_MEMORY	BIT(7)
struct hns3_sfp_type {
	u8 type;
	u8 ext_type;
	u8 flat_mem;
};

struct hns3_pflag_desc {