|
|
2a1b01 |
From 56c6dc7ab5f9170c6d399c12a87bbdb4c8de8958 Mon Sep 17 00:00:00 2001
|
|
|
2a1b01 |
From: Ido Schimmel <idosch@nvidia.com>
|
|
|
2a1b01 |
Date: Tue, 12 Oct 2021 16:25:12 +0300
|
|
|
2a1b01 |
Subject: [PATCH 13/35] cmis: Rename CMIS parsing functions
|
|
|
2a1b01 |
|
|
|
2a1b01 |
Currently, there are two CMIS parsing functions. qsfp_dd_show_all() and
|
|
|
2a1b01 |
cmis_show_all(). The former is called from the IOCTL path with a buffer
|
|
|
2a1b01 |
containing EEPROM contents and the latter is called from the netlink
|
|
|
2a1b01 |
path with pointer to individual EEPROM pages.
|
|
|
2a1b01 |
|
|
|
2a1b01 |
Rename them with '_ioctl' and '_nl' suffixes to make the distinction
|
|
|
2a1b01 |
clear.
|
|
|
2a1b01 |
|
|
|
2a1b01 |
In subsequent patches, these two functions will only differ in the way
|
|
|
2a1b01 |
they initialize the CMIS memory map for parsing, while the parsing code
|
|
|
2a1b01 |
itself will be shared between the two.
|
|
|
2a1b01 |
|
|
|
2a1b01 |
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
|
|
|
2a1b01 |
---
|
|
|
2a1b01 |
cmis.c | 6 +++---
|
|
|
2a1b01 |
cmis.h | 6 +++---
|
|
|
2a1b01 |
netlink/module-eeprom.c | 2 +-
|
|
|
2a1b01 |
qsfp.c | 2 +-
|
|
|
2a1b01 |
4 files changed, 8 insertions(+), 8 deletions(-)
|
|
|
2a1b01 |
|
|
|
2a1b01 |
diff --git a/cmis.c b/cmis.c
|
|
|
2a1b01 |
index 591cc72953b7..68c5b2d3277b 100644
|
|
|
2a1b01 |
--- a/cmis.c
|
|
|
2a1b01 |
+++ b/cmis.c
|
|
|
2a1b01 |
@@ -326,7 +326,7 @@ static void cmis_show_vendor_info(const __u8 *id)
|
|
|
2a1b01 |
"CLEI code");
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
|
|
|
2a1b01 |
-void qsfp_dd_show_all(const __u8 *id)
|
|
|
2a1b01 |
+void cmis_show_all_ioctl(const __u8 *id)
|
|
|
2a1b01 |
{
|
|
|
2a1b01 |
cmis_show_identifier(id);
|
|
|
2a1b01 |
cmis_show_power_info(id);
|
|
|
2a1b01 |
@@ -340,8 +340,8 @@ void qsfp_dd_show_all(const __u8 *id)
|
|
|
2a1b01 |
cmis_show_rev_compliance(id);
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
|
|
|
2a1b01 |
-void cmis_show_all(const struct ethtool_module_eeprom *page_zero,
|
|
|
2a1b01 |
- const struct ethtool_module_eeprom *page_one)
|
|
|
2a1b01 |
+void cmis_show_all_nl(const struct ethtool_module_eeprom *page_zero,
|
|
|
2a1b01 |
+ const struct ethtool_module_eeprom *page_one)
|
|
|
2a1b01 |
{
|
|
|
2a1b01 |
const __u8 *page_zero_data = page_zero->data;
|
|
|
2a1b01 |
|
|
|
2a1b01 |
diff --git a/cmis.h b/cmis.h
|
|
|
2a1b01 |
index e3012ccfdd79..734b90f4ddb4 100644
|
|
|
2a1b01 |
--- a/cmis.h
|
|
|
2a1b01 |
+++ b/cmis.h
|
|
|
2a1b01 |
@@ -120,9 +120,9 @@
|
|
|
2a1b01 |
#define YESNO(x) (((x) != 0) ? "Yes" : "No")
|
|
|
2a1b01 |
#define ONOFF(x) (((x) != 0) ? "On" : "Off")
|
|
|
2a1b01 |
|
|
|
2a1b01 |
-void qsfp_dd_show_all(const __u8 *id);
|
|
|
2a1b01 |
+void cmis_show_all_ioctl(const __u8 *id);
|
|
|
2a1b01 |
|
|
|
2a1b01 |
-void cmis_show_all(const struct ethtool_module_eeprom *page_zero,
|
|
|
2a1b01 |
- const struct ethtool_module_eeprom *page_one);
|
|
|
2a1b01 |
+void cmis_show_all_nl(const struct ethtool_module_eeprom *page_zero,
|
|
|
2a1b01 |
+ const struct ethtool_module_eeprom *page_one);
|
|
|
2a1b01 |
|
|
|
2a1b01 |
#endif /* CMIS_H__ */
|
|
|
2a1b01 |
diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
|
|
|
2a1b01 |
index 48cd2cc55bee..fc4ef1a53aff 100644
|
|
|
2a1b01 |
--- a/netlink/module-eeprom.c
|
|
|
2a1b01 |
+++ b/netlink/module-eeprom.c
|
|
|
2a1b01 |
@@ -332,7 +332,7 @@ static void decoder_print(void)
|
|
|
2a1b01 |
break;
|
|
|
2a1b01 |
case SFF8024_ID_QSFP_DD:
|
|
|
2a1b01 |
case SFF8024_ID_DSFP:
|
|
|
2a1b01 |
- cmis_show_all(page_zero, page_one);
|
|
|
2a1b01 |
+ cmis_show_all_nl(page_zero, page_one);
|
|
|
2a1b01 |
break;
|
|
|
2a1b01 |
default:
|
|
|
2a1b01 |
dump_hex(stdout, page_zero->data, page_zero->length, page_zero->offset);
|
|
|
2a1b01 |
diff --git a/qsfp.c b/qsfp.c
|
|
|
2a1b01 |
index 3f37f1036e96..27fdd3bd1771 100644
|
|
|
2a1b01 |
--- a/qsfp.c
|
|
|
2a1b01 |
+++ b/qsfp.c
|
|
|
2a1b01 |
@@ -856,7 +856,7 @@ static void sff8636_show_page_zero(const __u8 *id)
|
|
|
2a1b01 |
void sff8636_show_all(const __u8 *id, __u32 eeprom_len)
|
|
|
2a1b01 |
{
|
|
|
2a1b01 |
if (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_DD) {
|
|
|
2a1b01 |
- qsfp_dd_show_all(id);
|
|
|
2a1b01 |
+ cmis_show_all_ioctl(id);
|
|
|
2a1b01 |
return;
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
|
|
|
2a1b01 |
--
|
|
|
2a1b01 |
2.35.1
|
|
|
2a1b01 |
|