ath10k-ct: Update to 2018-12-11 and use version based on 4.19
[openwrt/openwrt.git] / package / kernel / ath10k-ct / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ath10k-ct
4 PKG_RELEASE=3
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:=2018-12-11
12 PKG_SOURCE_VERSION:=812d90c08ca8ce8dcbd1b2281e89ff562c7096e1
13 PKG_MIRROR_HASH:=986feafd27a828801be96ce4177886204998beea305cda40aafe92a9636db852
14
15 # Build the 4.19 ath10k-ct driver version. Other options are "-4.16", or
16 # leave un-defined for 4.7 kernel. Probably this should match as closely as
17 # possible to whatever mac80211 backports version is being used.
18 CT_KVER="-4.19"
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_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_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 endef
39
40 define KernelPackage/ath10k-ct/config
41
42 config ATH10K-CT_LEDS
43 bool "Enable LED support"
44 default y
45 depends on PACKAGE_kmod-ath10k-ct
46 endef
47
48 NOSTDINC_FLAGS = \
49 -I$(PKG_BUILD_DIR) \
50 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
51 -I$(STAGING_DIR)/usr/include/mac80211-backport \
52 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
53 -I$(STAGING_DIR)/usr/include/mac80211 \
54 -include backport/autoconf.h \
55 -include backport/backport.h
56
57 ifdef CONFIG_PACKAGE_MAC80211_MESH
58 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
59 endif
60
61 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m CONFIG_ATH10K_CE=y
62
63 # This AHB logic is needed for IPQ4019 radios
64 CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
65 NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
66
67 NOSTDINC_FLAGS += -DSTANDALONE_CT
68
69 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
70 CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
71 NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
72 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
73 endif
74
75 ifdef CONFIG_PACKAGE_ATH_DEBUG
76 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
77 endif
78
79 ifdef CONFIG_PACKAGE_ATH_DFS
80 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED
81 endif
82
83 ifdef CONFIG_PACKAGE_ATH_SPECTRAL
84 CT_MAKEDEFS += CONFIG_ATH10K_SPECTRAL=y
85 NOSTDINC_FLAGS += -DCONFIG_ATH10K_SPECTRAL
86 endif
87
88 ifeq ($(CONFIG_ATH10K-CT_LEDS),y)
89 CT_MAKEDEFS += CONFIG_ATH10K_LEDS=y
90 NOSTDINC_FLAGS += -DCONFIG_ATH10K_LEDS
91 endif
92
93 define Build/Configure
94 cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
95 endef
96
97 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
98 CT_MAKEDEFS += V=1
99 endif
100
101 define Build/Compile
102 +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
103 $(KERNEL_MAKE_FLAGS) \
104 SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
105 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
106 modules
107 endef
108
109 $(eval $(call KernelPackage,ath10k-ct))