netdevices.mk: add hwmon to IGB and IXGBE drivers
[openwrt/staging/wigyori.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:=bded1823912549017d819d1796273b3134c3de20
13 PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
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 @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 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 # No AHB support enabled yet. Could conditionally enable it later.
54 #CT_MAKEDEFS += CONFIG_ATH10K_AHB=y
55 #NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
56 NOSTDINC_FLAGS += -DSTANDALONE_CT
57
58 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
59 CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
60 NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
61 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
62 endif
63
64 ifdef CONFIG_PACKAGE_ATH_DEBUG
65 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
66 endif
67
68 ifdef CONFIG_PACKAGE_ATH_DFS
69 NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED
70 endif
71
72 ifdef CONFIG_PACKAGE_ATH_SPECTRAL
73 CT_MAKEDEFS += CONFIG_ATH10K_SPECTRAL=y
74 NOSTDINC_FLAGS += -DCONFIG_ATH10K_SPECTRAL
75 endif
76
77 define Build/Configure
78 cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
79 endef
80
81 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
82 CT_MAKEDEFS += V=1
83 endif
84
85 define Build/Compile
86 +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
87 $(KERNEL_MAKE_FLAGS) \
88 SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
89 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
90 modules
91 endef
92
93 $(eval $(call KernelPackage,ath10k-ct))