ramips: Add support for TEW-714TRU
[oweals/openwrt.git] / package / kernel / ath10k-ct / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ath10k-ct
4 PKG_VERSION:=2016-07-21
5 PKG_RELEASE=1
6
7 PKG_LICENSE:=GPLv2
8 PKG_LICENSE_FILES:=
9
10 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
11 PKG_SOURCE_PROTO:=git
12 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
13 PKG_SOURCE_VERSION:=a142524abc8eef3ba30b12f9b5ac74385c8ddc39
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
15
16 PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
17 PKG_BUILD_PARALLEL:=1
18
19 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
20
21 include $(INCLUDE_DIR)/kernel.mk
22 include $(INCLUDE_DIR)/package.mk
23
24 define KernelPackage/ath10k-ct
25   SUBMENU:=Wireless Drivers
26   TITLE:=ath10k-ct driver optimized for CT ath10k firmware
27   DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT @PCI_SUPPORT
28   FILES:=\
29         $(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
30         $(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
31   AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
32 endef
33
34 NOSTDINC_FLAGS = \
35         -I$(PKG_BUILD_DIR) \
36         -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
37         -I$(STAGING_DIR)/usr/include/mac80211-backport \
38         -I$(STAGING_DIR)/usr/include/mac80211/uapi \
39         -I$(STAGING_DIR)/usr/include/mac80211 \
40         -include backport/autoconf.h \
41         -include backport/backport.h
42
43 ifdef CONFIG_PACKAGE_MAC80211_MESH
44   NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
45 endif
46
47 CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m
48 # No AHB support enabled yet.  Could conditionally enable it later.
49 #CT_MAKEDEFS += CONFIG_ATH10K_AHB=y
50 #NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
51 NOSTDINC_FLAGS += -DSTANDALONE_CT
52
53 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
54   CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
55   NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
56   NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
57 endif
58
59 ifdef CONFIG_PACKAGE_ATH_DEBUG
60   NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
61 endif
62
63 define Build/Configure
64         cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
65 endef
66
67 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
68   CT_MAKEDEFS += V=1
69 endif
70
71 define Build/Compile
72         +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
73                 ARCH="$(LINUX_KARCH)" \
74                 CROSS_COMPILE="$(TARGET_CROSS)" \
75                 SUBDIRS="$(PKG_BUILD_DIR)/ath10k" \
76                 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
77                 modules
78 endef
79
80 $(eval $(call KernelPackage,ath10k-ct))