wifi: iwlwifi: fix iwlmld-test link failure
PATCH 1/1 wifi: iwlwifi: fix iwlmld-test link failure
From: Arnd Bergmann <[email protected]>
If the driver is built-in but the test is in a loadable module, the symbols are not exported, resulting in a link failure:
ERROR: modpost: "iwl_get_cmd_string" [drivers/net/wireless/intel/iwlwifi/mld/tests/iwlmld-tests.ko] undefined!
ERROR: modpost: "__iwl_dbg" [drivers/net/wireless/intel/iwlwifi/mld/tests/iwlmld-tests.ko] undefined!
Enable CONFIG_IWLWIFI_OPMODE_MODULAR in this configuration, to make those symbols visible.
--- drivers/net/wireless/intel/iwlwifi/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/Kconfig +1 -0
@@ -97,6 +97,7 @@ config IWLWIFI_OPMODE_MODULAR default y if IWLDVM=m default y if IWLMVM=m default y if IWLMLD=m + default y if IWLWIFI_KUNIT_TESTS=m comment "WARNING: iwlwifi is useless without IWLDVM or IWLMVM or IWLMLD" depends on IWLDVM=n && IWLMVM=n && IWLMLD=n
Signature · 1 line
2.39.5
Quoted 10 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
If the driver is built-in but the test is in a loadable module, the symbols are not exported, resulting in a link failure:
ERROR: modpost: "
iwl_get_cmd_string" [drivers/net/wireless/intel/iwlwifi/mld/tests/iwlmld-tests.ko] undefined!
ERROR: modpost: "__iwl_dbg" [drivers/net/wireless/intel/iwlwifi/mld/tests/iwlmld-tests.ko] undefined!Enable
CONFIG_IWLWIFI_OPMODE_MODULARin this configuration, to make those symbols visible.
Hah, thanks. We were just debating exactly this fix, but I think if CONFIG_INET is _also_ turned off, we still have another link issue, so what we have now is actually the below (maybe the Fixes: is wrong then though)
commit 800fe085168e073910d8a0b758df0399d3c38323
Author: Benjamin Berg <[email protected]> Date: Mon May 12 14:04:33 2025 +0200
[BUGFIX] wifi: iwlwifi: ensure iwl_average_neg_dbm is available for kunit
The function was not compiled if CONFIG_INET was not enabled. Change it to always be compiled in. Also update the IWLWIFI_OPMODE_MODULAR check so that the symbol is exported even if only the kunit tests are build as a module.
drivers/net/wireless/intel/iwlwifi/Kconfig +1 -0
@@ -105,6 +105,7 @@ config IWLWIFI_OPMODE_MODULAR default y if IWLMVM=m default y if IWLXVT=m default y if IWLMLD=m + default y if IWLWIFI_KUNIT_TESTS=m comment "WARNING: iwlwifi is useless without IWLDVM or IWLMVM or IWLMLD" depends on IWLDVM=n && IWLMVM=n && IWLMLD=n
drivers/net/wireless/intel/iwlwifi/iwl-utils.c +1 -2
@@ -82,6 +82,7 @@ int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, return 0; }IWL_EXPORT_SYMBOL (iwl_tx_tso_segment); +#endif /* CONFIG_INET */ static u32 iwl_div_by_db (u32 value,u8 db) {
@@ -193,5 +194,3 @@ s8 iwl_average_neg_dbm(const u8 *neg_dbm_values, u8 len)return clamp (average_magnitude - i,-128 ,0 ); }IWL_EXPORT_SYMBOL (iwl_average_neg_dbm); - -#endif /* CONFIG_INET */