Skip to content

Commit

Permalink
mac80211: only build ath10k with smallbuffers
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cotequeiroz authored and robimarko committed Feb 23, 2024
1 parent 4390ea4 commit 375dd23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions package/kernel/mac80211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ define KernelPackage/mac80211/Default
MAINTAINER:=Felix Fietkau <[email protected]>
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 \
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions package/kernel/mac80211/ath.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 375dd23

Please sign in to comment.