|
|
2a1b01 |
From 08d9f72f5e4ce12e2cc1fc47d1ffde9aa1326c8c Mon Sep 17 00:00:00 2001
|
|
|
2a1b01 |
From: Ido Schimmel <idosch@nvidia.com>
|
|
|
2a1b01 |
Date: Tue, 14 Sep 2021 14:27:38 +0300
|
|
|
2a1b01 |
Subject: [PATCH 05/35] netlink: eeprom: Fix compilation when pretty dump is
|
|
|
2a1b01 |
disabled
|
|
|
2a1b01 |
|
|
|
2a1b01 |
When pretty dump is disabled (i.e., configure --disable-pretty-dump),
|
|
|
2a1b01 |
the following errors are emitted:
|
|
|
2a1b01 |
|
|
|
2a1b01 |
/usr/bin/ld: netlink/module-eeprom.o: in function `decoder_print':
|
|
|
2a1b01 |
netlink/module-eeprom.c:330: undefined reference to `sff8636_show_all_paged'
|
|
|
2a1b01 |
netlink/module-eeprom.c:334: undefined reference to `cmis_show_all'
|
|
|
2a1b01 |
netlink/module-eeprom.c:325: undefined reference to `sff8079_show_all'
|
|
|
2a1b01 |
|
|
|
2a1b01 |
The else clause is unreachable when pretty dump is disabled, so wrap it
|
|
|
2a1b01 |
with ifdef directive.
|
|
|
2a1b01 |
|
|
|
2a1b01 |
This will be re-worked in future patches where the netlink code only
|
|
|
2a1b01 |
queries the SFF-8024 Identifier Value and defers page requests to
|
|
|
2a1b01 |
individual parsers.
|
|
|
2a1b01 |
|
|
|
2a1b01 |
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
|
|
|
2a1b01 |
---
|
|
|
2a1b01 |
netlink/module-eeprom.c | 4 ++++
|
|
|
2a1b01 |
1 file changed, 4 insertions(+)
|
|
|
2a1b01 |
|
|
|
2a1b01 |
diff --git a/netlink/module-eeprom.c b/netlink/module-eeprom.c
|
|
|
2a1b01 |
index e9a122df3259..48cd2cc55bee 100644
|
|
|
2a1b01 |
--- a/netlink/module-eeprom.c
|
|
|
2a1b01 |
+++ b/netlink/module-eeprom.c
|
|
|
2a1b01 |
@@ -275,6 +275,7 @@ static int page_fetch(struct nl_context *nlctx, const struct ethtool_module_eepr
|
|
|
2a1b01 |
return nlsock_process_reply(nlsock, nomsg_reply_cb, NULL);
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
|
|
|
2a1b01 |
+#ifdef ETHTOOL_ENABLE_PRETTY_DUMP
|
|
|
2a1b01 |
static int decoder_prefetch(struct nl_context *nlctx)
|
|
|
2a1b01 |
{
|
|
|
2a1b01 |
struct ethtool_module_eeprom *page_zero_lower = cache_get(0, 0, ETH_I2C_ADDRESS_LOW);
|
|
|
2a1b01 |
@@ -338,6 +339,7 @@ static void decoder_print(void)
|
|
|
2a1b01 |
break;
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
+#endif
|
|
|
2a1b01 |
|
|
|
2a1b01 |
int nl_getmodule(struct cmd_context *ctx)
|
|
|
2a1b01 |
{
|
|
|
2a1b01 |
@@ -414,10 +416,12 @@ int nl_getmodule(struct cmd_context *ctx)
|
|
|
2a1b01 |
else
|
|
|
2a1b01 |
dump_hex(stdout, eeprom_data, dump_length, request.offset);
|
|
|
2a1b01 |
} else {
|
|
|
2a1b01 |
+#ifdef ETHTOOL_ENABLE_PRETTY_DUMP
|
|
|
2a1b01 |
ret = decoder_prefetch(nlctx);
|
|
|
2a1b01 |
if (ret)
|
|
|
2a1b01 |
goto cleanup;
|
|
|
2a1b01 |
decoder_print();
|
|
|
2a1b01 |
+#endif
|
|
|
2a1b01 |
}
|
|
|
2a1b01 |
|
|
|
2a1b01 |
cleanup:
|
|
|
2a1b01 |
--
|
|
|
2a1b01 |
2.35.1
|
|
|
2a1b01 |
|