ath10k-ct driver: use dma_alloc_coherent, 4.13 based driver
[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:=2017-06-13
12 PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
13 PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
14
15 PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
16 PKG_BUILD_PARALLEL:=1
17
18 # Build the 4.13 ath10k-ct driver version. Other options are "-4.9", or
19 # leave un-defined for 4.7 kernel. Probably this should match as closely as
20 # possible to whatever mac80211 backports version is being used.
21 CT_KVER="-4.13"
22
23 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
24
25 include $(INCLUDE_DIR)/kernel.mk
26 include $(INCLUDE_DIR)/package.mk
27
28 define KernelPackage/ath10k-ct
29 SUBMENU:=Wireless Drivers
30 TITLE:=ath10k-ct driver optimized for CT ath10k firmware
31 DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +@KERNEL_RELAY +kmod-hwmon-core
32 FILES:=\
33 $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
34 $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
35 AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
36 endef
37
38 NOSTDINC_FLAGS = \
39 -I$(PKG_BUILD_DIR) \
40 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
41 -I$(STAGING_DIR)/usr/include/mac80211-backport \
42 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
43 -I$(STAGING_DIR)/usr/include/mac80211 \
44 -include backport/autoconf.h \
45 -include backport/backport.h
46
47 ifdef CONFIG_PACKAGE_MAC80211_MESH
48 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
49 endif
50
51 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
52 # No AHB support enabled yet. Could conditionally enable it later.
53 #CT_MAKEDEFS += CONFIG_ATH10K_AHB=y
54 #NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
55 NOSTDINC_FLAGS += -DSTANDALONE_CT
56
57 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
58 CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
59 NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
60 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
61 endif
62
63 ifdef CONFIG_PACKAGE_ATH_DEBUG
64 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
65 endif
66
67 ifdef CONFIG_PACKAGE_ATH_DFS
68 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED
69 endif
70
71 define Build/Configure
72 cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
73 endef
74
75 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
76 CT_MAKEDEFS += V=1
77 endif
78
79 define Build/Compile
80 +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
81 ARCH="$(LINUX_KARCH)" \
82 CROSS_COMPILE="$(TARGET_CROSS)" \
83 SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
84 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
85 modules
86 endef
87
88 $(eval $(call KernelPackage,ath10k-ct))