aboutsummaryrefslogtreecommitdiff
path: root/package/kernel/mac80211
diff options
context:
space:
mode:
authorEneas U de Queiroz <cotequeiroz@gmail.com>2023-10-10 16:36:12 -0300
committerRobert Marko <robimarko@gmail.com>2024-02-23 14:02:53 +0100
commit375dd230111c277820d2c5802d8c1d271061b31a (patch)
tree8814fcfbb1f2c10fa547f1b33b896f6182f60823 /package/kernel/mac80211
parent4390ea484d7d9159a0a41f0cb71840346a7e3b4f (diff)
mac80211: only build ath10k with smallbuffers
When both variants of ath10k drivers are selected, any driver that is selected along is being built twice, one for each ath10k variant. Avoid these redundant builds by introducing an optional second parameter to config_package that lists the variants for which the package is to be built. If the symbol is to be set for all of the variants, $(ALL_VARIANTS) can be used. This is the case for the mac80211 and cfg80211 modules. If the parameter is empty, then the module will be selected and thus built when the first variant is compiled. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Diffstat (limited to 'package/kernel/mac80211')
-rw-r--r--package/kernel/mac80211/Makefile12
-rw-r--r--package/kernel/mac80211/ath.mk6
2 files changed, 12 insertions, 6 deletions
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index b9c82c51cc..54a2bf4499 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -47,7 +47,13 @@ define KernelPackage/mac80211/Default
MAINTAINER:=Felix Fietkau <nbd@nbd.name>
endef
-config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
+# config_pacakge:
+# 1 = OpenWrt KernelPackage name
+# 2 = Optional list of variants for which the module may be selected:
+# If empty, the module is only selected with the first variant
+# Use $(ALL_VARIANTS) to allow module selection in all variants
+config_package=$(if $(and $(CONFIG_PACKAGE_kmod-$(1)),$(call mac80211_variant_check,$(2))),m)
+mac80211_variant_check=$(if $(ALL_VARIANTS),$(filter $(BUILD_VARIANT),$(if $(1),$(1),$(firstword $(ALL_VARIANTS)))),y)
config-y:= \
WLAN \
@@ -72,10 +78,10 @@ config-y:= \
WLAN_VENDOR_TI \
WLAN_VENDOR_ZYDAS \
-config-$(call config_package,cfg80211) += CFG80211
+config-$(call config_package,cfg80211,$(ALL_VARIANTS)) += CFG80211
config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE
-config-$(call config_package,mac80211) += MAC80211
+config-$(call config_package,mac80211,$(ALL_VARIANTS)) += MAC80211
config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
include ath.mk
diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk
index 881c89db25..dd200a89d4 100644
--- a/package/kernel/mac80211/ath.mk
+++ b/package/kernel/mac80211/ath.mk
@@ -37,7 +37,7 @@ ifdef CONFIG_PACKAGE_MAC80211_TRACING
WIL6210_TRACING
endif
-config-$(call config_package,ath) += ATH_CARDS ATH_COMMON
+config-$(call config_package,ath,regular smallbuffers) += ATH_CARDS ATH_COMMON
config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH11K_DEBUG ATH9K_STATION_STATISTICS
config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL ATH11K_SPECTRAL
@@ -58,8 +58,8 @@ config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
config-$(CONFIG_ATH11K_THERMAL) += ATH11K_THERMAL
config-$(call config_package,ath9k-htc) += ATH9K_HTC
-config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
-config-$(call config_package,ath10k-smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS
+config-$(call config_package,ath10k,regular) += ATH10K ATH10K_PCI
+config-$(call config_package,ath10k-smallbuffers,smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS
config-$(call config_package,ath11k) += ATH11K
config-$(call config_package,ath11k-ahb) += ATH11K_AHB
config-$(call config_package,ath11k-pci) += ATH11K_PCI