This commit adds a framework to support querying CMIS module information category: Feature bugzilla: https://gitee.com/src-openeuler/ethtool/issues/I9VV62
101 lines
3.4 KiB
Diff
101 lines
3.4 KiB
Diff
From e54061aec49839249b00562b812f8dd6912bdef5 Mon Sep 17 00:00:00 2001
|
|
From: Ido Schimmel <idosch@nvidia.com>
|
|
Date: Tue, 12 Oct 2021 16:25:16 +0300
|
|
Subject: [PATCH 11/26] sff-8636: Rename SFF-8636 parsing functions
|
|
|
|
Currently, there are two SFF-8636 parsing functions. sff8636_show_all()
|
|
and sff8636_show_all_paged(). The former is called from the IOCTL path
|
|
with a buffer containing EEPROM contents and the latter is called from
|
|
the netlink path with pointer to individual EEPROM pages.
|
|
|
|
Rename them with '_ioctl' and '_nl' suffixes to make the distinction
|
|
clear.
|
|
|
|
In subsequent patches, these two functions will only differ in the way
|
|
they initialize the SFF-8636 memory map for parsing, while the parsing
|
|
code itself will be shared between the two.
|
|
|
|
commit: d7d15f7
|
|
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=d7d15f737ab7
|
|
|
|
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
|
|
---
|
|
ethtool.c | 4 ++--
|
|
internal.h | 6 +++---
|
|
netlink/module-eeprom.c | 2 +-
|
|
qsfp.c | 6 +++---
|
|
4 files changed, 9 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/ethtool.c b/ethtool.c
|
|
index 7652440..fa5a347 100644
|
|
--- a/ethtool.c
|
|
+++ b/ethtool.c
|
|
@@ -4909,8 +4909,8 @@ static int do_getmodule(struct cmd_context *ctx)
|
|
break;
|
|
case ETH_MODULE_SFF_8436:
|
|
case ETH_MODULE_SFF_8636:
|
|
- sff8636_show_all(eeprom->data,
|
|
- modinfo.eeprom_len);
|
|
+ sff8636_show_all_ioctl(eeprom->data,
|
|
+ modinfo.eeprom_len);
|
|
break;
|
|
#endif
|
|
default:
|
|
diff --git a/internal.h b/internal.h
|
|
index a30f76e..ed4f180 100644
|
|
--- a/internal.h
|
|
+++ b/internal.h
|
|
@@ -393,9 +393,9 @@ void sff8079_show_all(const __u8 *id);
|
|
void sff8472_show_all(const __u8 *id);
|
|
|
|
/* QSFP Optics diagnostics */
|
|
-void sff8636_show_all(const __u8 *id, __u32 eeprom_len);
|
|
-void sff8636_show_all_paged(const struct ethtool_module_eeprom *page_zero,
|
|
- const struct ethtool_module_eeprom *page_three);
|
|
+void sff8636_show_all_ioctl(const __u8 *id, __u32 eeprom_len);
|
|
+void sff8636_show_all_nl(const struct ethtool_module_eeprom *page_zero,
|
|
+ const struct ethtool_module_eeprom *page_three);
|
|
|
|
/* FUJITSU Extended Socket network device */
|
|
int fjes_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
|
|
diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
|
|
index fc4ef1a..18b1abb 100644
|
|
--- a/netlink/module-eeprom.c
|
|
+++ b/netlink/module-eeprom.c
|
|
@@ -328,7 +328,7 @@ static void decoder_print(void)
|
|
case SFF8024_ID_QSFP:
|
|
case SFF8024_ID_QSFP28:
|
|
case SFF8024_ID_QSFP_PLUS:
|
|
- sff8636_show_all_paged(page_zero, page_three);
|
|
+ sff8636_show_all_nl(page_zero, page_three);
|
|
break;
|
|
case SFF8024_ID_QSFP_DD:
|
|
case SFF8024_ID_DSFP:
|
|
diff --git a/qsfp.c b/qsfp.c
|
|
index 27fdd3b..dc6407d 100644
|
|
--- a/qsfp.c
|
|
+++ b/qsfp.c
|
|
@@ -853,7 +853,7 @@ static void sff8636_show_page_zero(const __u8 *id)
|
|
|
|
}
|
|
|
|
-void sff8636_show_all(const __u8 *id, __u32 eeprom_len)
|
|
+void sff8636_show_all_ioctl(const __u8 *id, __u32 eeprom_len)
|
|
{
|
|
if (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_DD) {
|
|
cmis_show_all_ioctl(id);
|
|
@@ -871,8 +871,8 @@ void sff8636_show_all(const __u8 *id, __u32 eeprom_len)
|
|
}
|
|
}
|
|
|
|
-void sff8636_show_all_paged(const struct ethtool_module_eeprom *page_zero,
|
|
- const struct ethtool_module_eeprom *page_three)
|
|
+void sff8636_show_all_nl(const struct ethtool_module_eeprom *page_zero,
|
|
+ const struct ethtool_module_eeprom *page_three)
|
|
{
|
|
sff8636_show_identifier(page_zero->data);
|
|
sff8636_show_page_zero(page_zero->data);
|
|
--
|
|
2.30.0
|
|
|