8f9a8dd70f043c480900714dad14c09af329bd1b
[openwrt/openwrt.git] / package / kernel / ath10k-ct / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ath10k-ct
4 PKG_RELEASE=2
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:=2017-06-13
12 PKG_SOURCE_VERSION:=e1edd74d5f0c5291b0be72c81033e74e267929d4
13 PKG_MIRROR_HASH:=945dc7110017a80c33cac20d9d2a9beda0a6a98b50178319403568098534e60a
14
15 PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
16 PKG_BUILD_PARALLEL:=1
17 PKG_EXTMOD_SUBDIRS:=ath10k
18
19 # Build the 4.13 ath10k-ct driver version. Other options are "-4.9", or
20 # leave un-defined for 4.7 kernel. Probably this should match as closely as
21 # possible to whatever mac80211 backports version is being used.
22 CT_KVER="-4.13"
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 +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,mac80211 ath ath10k_pci)
37 endef
38
39 NOSTDINC_FLAGS = \
40 -I$(PKG_BUILD_DIR) \
41 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
42 -I$(STAGING_DIR)/usr/include/mac80211-backport \
43 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
44 -I$(STAGING_DIR)/usr/include/mac80211 \
45 -include backport/autoconf.h \
46 -include backport/backport.h
47
48 ifdef CONFIG_PACKAGE_MAC80211_MESH
49 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
50 endif
51
52 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
53
54 # This AHB logic is needed for IPQ4019 radios
55 CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
56 NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
57
58 NOSTDINC_FLAGS += -DSTANDALONE_CT
59
60 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
61 CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
62 NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
63 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
64 endif
65
66 ifdef CONFIG_PACKAGE_ATH_DEBUG
67 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
68 endif
69
70 ifdef CONFIG_PACKAGE_ATH_DFS
71 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED
72 endif
73
74 ifdef CONFIG_PACKAGE_ATH_SPECTRAL
75 CT_MAKEDEFS += CONFIG_ATH10K_SPECTRAL=y
76 NOSTDINC_FLAGS += -DCONFIG_ATH10K_SPECTRAL
77 endif
78
79 define Build/Configure
80 cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
81 endef
82
83 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
84 CT_MAKEDEFS += V=1
85 endif
86
87 define Build/Compile
88 +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
89 $(KERNEL_MAKE_FLAGS) \
90 SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
91 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
92 modules
93 endef
94
95 $(eval $(call KernelPackage,ath10k-ct))