diff mbox series

[V2,7/7] brcmfmac: introduce BRCMFMAC exported symbols namespace

Message ID 20221129135446.151065-8-arend.vanspriel@broadcom.com
State New
Headers show
Series brcmfmac: support devices from multiple vendors | expand

Commit Message

Arend van Spriel Nov. 29, 2022, 1:54 p.m. UTC
Using a namespace variant to make clear it is only intended to be used
by the vendor-specific modules. The symbol will only truly export the
symbols when the driver and consequently the vendor-specific part are
built as kernel modules.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 .../net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c   | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h     | 6 ++++++
 .../net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c   | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c    | 4 ++--
 .../net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c   | 1 +
 5 files changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c
index 790116a735c7..d55f3271d619 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c
@@ -21,6 +21,7 @@  static void __exit brcmf_bca_exit(void)
 }
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_IMPORT_NS(BRCMFMAC);
 
 module_init(brcmf_bca_init);
 module_exit(brcmf_bca_exit);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
index a98b86982502..e4f911dd414b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
@@ -13,6 +13,12 @@ 
 #include <net/cfg80211.h>
 #include "fweh.h"
 
+#if IS_MODULE(CONFIG_BRCMFMAC)
+#define BRCMF_EXPORT_SYMBOL_GPL(__sym)	EXPORT_SYMBOL_NS_GPL(__sym, BRCMFMAC)
+#else
+#define BRCMF_EXPORT_SYMBOL_GPL(__sym)
+#endif
+
 #define TOE_TX_CSUM_OL		0x00000001
 #define TOE_RX_CSUM_OL		0x00000002
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c
index 34294724a1f8..f82fbbe3ecef 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c
@@ -21,6 +21,7 @@  static void __exit brcmf_cyw_exit(void)
 }
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_IMPORT_NS(BRCMFMAC);
 
 module_init(brcmf_cyw_init);
 module_exit(brcmf_cyw_exit);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c
index 6f16157a8a4e..86eafdb40541 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c
@@ -109,7 +109,7 @@  int brcmf_fwvid_register_vendor(enum brcmf_fwvendor fwvid, struct module *vmod,
 
 	return 0;
 }
-EXPORT_SYMBOL(brcmf_fwvid_register_vendor);
+BRCMF_EXPORT_SYMBOL_GPL(brcmf_fwvid_register_vendor);
 
 int brcmf_fwvid_unregister_vendor(enum brcmf_fwvendor fwvid, struct module *mod)
 {
@@ -142,7 +142,7 @@  int brcmf_fwvid_unregister_vendor(enum brcmf_fwvendor fwvid, struct module *mod)
 
 	return 0;
 }
-EXPORT_SYMBOL(brcmf_fwvid_unregister_vendor);
+BRCMF_EXPORT_SYMBOL_GPL(brcmf_fwvid_unregister_vendor);
 #else
 static inline int brcmf_fwvid_request_module(enum brcmf_fwvendor fwvid)
 {
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c
index 23e3a4557880..02918d434556 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c
@@ -21,6 +21,7 @@  static void __exit brcmf_wcc_exit(void)
 }
 
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_IMPORT_NS(BRCMFMAC);
 
 module_init(brcmf_wcc_init);
 module_exit(brcmf_wcc_exit);