From: Eneas U de Queiroz Date: Tue, 10 Oct 2023 19:36:12 +0000 (-0300) Subject: mac80211: only build ath10k with smallbuffers X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=375dd230111c277820d2c5802d8c1d271061b31a;p=openwrt%2Fstaging%2Frmilecki.git 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 --- diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index b9c82c51cc4..54a2bf44992 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -47,7 +47,13 @@ define KernelPackage/mac80211/Default MAINTAINER:=Felix Fietkau 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 881c89db253..dd200a89d42 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