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