tools/elfutils: refresh portability patch for macOS
[openwrt/openwrt.git] / package / kernel / ath10k-ct / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ath10k-ct
4 PKG_RELEASE:=1
5
6 PKG_LICENSE:=GPLv2
7 PKG_LICENSE_FILES:=
8
9 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
10 PKG_SOURCE_PROTO:=git
11 PKG_SOURCE_DATE:=2023-06-05
12 PKG_SOURCE_VERSION:=fadd0768cbd22248a60efbb219ccefc9d86cd78c
13 PKG_MIRROR_HASH:=caaa373ae2cc6e443e8a31e43e5e2caca4f4ba2b9614efd3e5c9df401056d307
14
15 # Build the 6.4 ath10k-ct driver version.
16 # Probably this should match as closely as
17 # possible to whatever mac80211 backports version is being used.
18 CT_KVER="-6.4"
19
20 PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
21 PKG_BUILD_PARALLEL:=1
22 PKG_EXTMOD_SUBDIRS:=ath10k$(CT_KVER)
23
24 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
25
26 include $(INCLUDE_DIR)/kernel.mk
27 include $(INCLUDE_DIR)/package.mk
28
29 define KernelPackage/ath10k-ct
30 SUBMENU:=Wireless Drivers
31 TITLE:=ath10k-ct driver optimized for CT ath10k firmware
32 DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core
33 FILES:=\
34 $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
35 $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
36 AUTOLOAD:=$(call AutoProbe,ath10k_pci)
37 PROVIDES:=kmod-ath10k
38 VARIANT:=regular
39 endef
40
41 define KernelPackage/ath10k-ct/config
42
43 config ATH10K-CT_LEDS
44 bool "Enable LED support"
45 default y
46 depends on PACKAGE_kmod-ath10k-ct || PACKAGE_kmod-ath10k-ct-smallbuffers
47 endef
48
49 define KernelPackage/ath10k-ct-smallbuffers
50 $(call KernelPackage/ath10k-ct)
51 TITLE+= (small buffers for low-RAM devices)
52 VARIANT:=smallbuffers
53 endef
54
55 NOSTDINC_FLAGS := \
56 $(KERNEL_NOSTDINC_FLAGS) \
57 -I$(PKG_BUILD_DIR) \
58 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
59 -I$(STAGING_DIR)/usr/include/mac80211-backport \
60 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
61 -I$(STAGING_DIR)/usr/include/mac80211 \
62 -include backport/autoconf.h \
63 -include backport/backport.h
64
65 ifdef CONFIG_PACKAGE_MAC80211_MESH
66 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
67 endif
68
69 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m CONFIG_ATH10K_CE=y
70
71 # This AHB logic is needed for IPQ4019 radios
72 CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
73 NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
74
75 NOSTDINC_FLAGS += -DSTANDALONE_CT
76
77 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
78 CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
79 NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
80 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
81 endif
82
83 ifdef CONFIG_PACKAGE_ATH_DEBUG
84 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
85 endif
86
87 ifdef CONFIG_PACKAGE_ATH_DFS
88 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED
89 endif
90
91 ifdef CONFIG_PACKAGE_ATH_SPECTRAL
92 CT_MAKEDEFS += CONFIG_ATH10K_SPECTRAL=y
93 NOSTDINC_FLAGS += -DCONFIG_ATH10K_SPECTRAL
94 endif
95
96 ifeq ($(CONFIG_ATH10K-CT_LEDS),y)
97 CT_MAKEDEFS += CONFIG_ATH10K_LEDS=y
98 NOSTDINC_FLAGS += -DCONFIG_ATH10K_LEDS
99 endif
100
101 ifeq ($(BUILD_VARIANT),smallbuffers)
102 NOSTDINC_FLAGS += -DCONFIG_ATH10K_SMALLBUFFERS
103 endif
104
105 define Build/Configure
106 cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
107 endef
108
109 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
110 CT_MAKEDEFS += V=1
111 endif
112
113 define Build/Compile
114 +$(KERNEL_MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) \
115 M="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
116 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
117 modules
118 endef
119
120 $(eval $(call KernelPackage,ath10k-ct))
121 $(eval $(call KernelPackage,ath10k-ct-smallbuffers))