1ifeq ($(obj),)
2obj := .
3endif
4
5DEPTH := ../..
6
7ifeq ($(strip ${QCA_PARTNER_MAKE_F_SUPPORT}),1)
8export QCA_PARTNER_MAKE_F_INC=1
9endif
10
11include $(obj)/$(DEPTH)/os/linux/Makefile-linux.common
12
13INCS += -I$(HAL) -I$(HAL)/$(OS) -I$(ATH) -I$(ATH_RATE) -I$(ATH_PKTLOG) -I$(WLAN) -I$(IF_WLAN) -I$(ATH_SPECTRAL) -I$(ATHEROSPATH) -I$(obj)/$(DEPTH)/../../apps/spectral/common
14INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/inc -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/obj_mgr/inc
15INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/cmn_defs/inc
16INCS += -I$(obj)/$(DEPTH)/cmn_dev/utils/nlink/inc
17INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/scan/dispatcher/inc
18INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/cmn_defs/inc
19INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/global_umac_dispatcher/lmac_if/inc
20INCS += -I$(obj)/$(DEPTH)/cmn_dev/scheduler/inc
21INCS += -I$(obj)/$(DEPTH)/cmn_dev/global_lmac_if/inc
22INCS += -I$(obj)/$(DEPTH)/umac/scan
23INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/mgmt_txrx/dispatcher/inc
24INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/regulatory/dispatcher/inc
25INCS += -I$(obj)/$(DEPTH)/umac/son/dispatcher/inc
26INCS += -I$(obj)/$(DEPTH)/umac/son/os/linux
27INCS += -I$(obj)/$(DEPTH)/umac/son/core/src
28INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/dfs/dispatcher/inc
29INCS += -I$(obj)/$(DEPTH)/cmn_dev/os_if/linux/spectral/inc
30INCS += -I$(obj)/$(DEPTH)/cmn_dev/os_if/linux/scan/inc
31INCS += -I$(obj)/$(DEPTH)/cmn_dev/spectral/core
32INCS += -I$(obj)/$(DEPTH)/component_dev/direct_attach/spectral/core
33INCS += -I$(obj)/$(DEPTH)/cmn_dev/target_if/direct_buf_rx/inc
34INCS += -I$(obj)/$(DEPTH)/cmn_dev/wbuff/inc
35INCS += -I$(obj)/$(DEPTH)/cmn_dev/cfg/inc
36INCS += -I$(obj)/$(DEPTH)/ini_cfg/inc/
37INCS += -I$(obj)/$(DEPTH)/component_dev/wmi/inc
38INCS += -I$(obj)/$(DEPTH)/pld/inc
39INCS += -I$(obj)/$(DEPTH)/component_dev/dp/inc
40INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/mlme/connection_mgr/dispatcher/inc
41INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/thermal/dispatcher/inc
42INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/mlme/connection_mgr/utf/inc
43INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/mlo_mgr/inc
44INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/wifi_pos/inc
45
46INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/crypto/inc
47INCS += -I$(obj)/$(DEPTH)/component_dev/crypto/inc
48
49ifeq ($(WLAN_SUPPORT_GREEN_AP), 1)
50INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/green_ap/dispatcher/inc
51endif
52
53INCS += -I$(obj)/$(HOST_CMN_CONVG_SRC)/ipa/core/inc \
54        -I$(obj)/$(HOST_CMN_CONVG_SRC)/ipa/core/src \
55        -I$(obj)/$(HOST_CMN_CONVG_SRC)/ipa/dispatcher/inc \
56        -I$(obj)/$(HOST_CMN_CONVG_SRC)/ipa/dispatcher/src
57
58#Start of offload related deifines
59HOST_CMN_CONVG_SRC := $(DEPTH)/cmn_dev
60HOST_CMN_CONVG_HIF_SRC := $(DEPTH)/cmn_dev/hif/src
61HOST_CMN_CONVG_HIF_INC1 := $(DEPTH)/cmn_dev/hif
62HOST_CMN_CONVG_HTC_INC := $(DEPTH)/cmn_dev/htc
63HOST_CMN_CONVG_DP_INC := $(DEPTH)/cmn_dev/dp/wifi3.0
64HOST_CMN_CONVG_CFG_INC := $(DEPTH)/cmn_dev/wlan_cfg
65HOST_CMN_CONVG_HAL_INC := $(DEPTH)/cmn_dev/hal/inc
66HOST_CMN_CONVG_HAL_WIFI_INC := $(DEPTH)/cmn_dev/hal/wifi3.0
67
68INCS += -I$(obj)/$(DEPTH)/include -I$(obj)/$(DEPTH)/umac/include \
69        -I$(obj)/$(DEPTH)/umac/crypto \
70        -I$(obj)/$(DEPTH)/umac/scan -I$(obj)/$(DEPTH)/umac/resmgr \
71        -I$(obj)/$(DEPTH)/umac/pm -I$(obj)/$(DEPTH)/umac/txrx \
72        -I$(obj)/$(DEPTH)/umac/acs -I$(obj)/$(DEPTH)/umac/txbf \
73        -I$(obj)/$(DEPTH)/umac/wnm \
74        -I$(obj)/$(DEPTH)/umac/tdls \
75        -I$(obj)/$(DEPTH)/umac/rpt_placement \
76        -I$(obj)/$(DEPTH)/umac/wifipos \
77        -I$(obj)/$(DEPTH)/umac/wds -I$(obj)/$(DEPTH)/umac/ique \
78        -I$(obj)/$(DEPTH)/umac/vi_dbg \
79        -I$(obj)/$(DEPTH)/umac/smart_antenna \
80        -I$(obj)/$(DEPTH)/umac/smart_ant \
81        -I$(obj)/$(DEPTH)/umac/ald \
82        -I$(obj)/$(DEPTH)/lmac/ath_pktlog \
83        -I$(obj)/$(DEPTH)/os/linux/mem/ \
84        -I$(obj)/$(DEPTH)/umac/base \
85        -I$(obj)/$(DEPTH)/qca_ol \
86        -I$(obj)/$(DEPTH)/cmn_dev/qdf/inc \
87        -I$(obj)/$(DEPTH)/cmn_dev/qdf/linux/src \
88        -I$(obj)/$(DEPTH)/cmn_dev/qal/inc \
89        -I$(obj)/$(DEPTH)/cmn_dev/qal/linux/src \
90        -I$(obj)/$(DEPTH)/cmn_dev/hif \
91        -I$(obj)/$(DEPTH)/cmn_dev/hif/inc \
92        -I$(obj)/$(DEPTH)/cmn_dev/hif/src \
93        -I$(obj)/$(DEPTH)/cmn_dev/hif/src/ce \
94        -I$(obj)/$(DEPTH)/cmn_dev/hif/src/pcie \
95        -I$(obj)/$(DEPTH)/cmn_dev/hif/src/snoc \
96        -I$(obj)/$(DEPTH)/cmn_dev/hif/src/dispatcher \
97        -I$(obj)/$(DEPTH)/cmn_dev/pld_stub/inc  \
98        -I$(obj)/$(DEPTH)/cmn_dev/hal/inc \
99        -I$(obj)/$(DEPTH)/cmn_dev/hal/wifi3.0 \
100        -I$(obj)/$(DEPTH)/cmn_dev/dp/inc \
101        -I$(obj)/$(DEPTH)/cmn_dev/dp/wifi3.0 \
102        -I$(obj)/$(DEPTH)/cmn_dev/wlan_cfg \
103        -I$(obj)/$(HOST_CMN_CONVG_SRC)/htc \
104        -I$(obj)/$(DEPTH)/cmn_dev/wmi/inc \
105        -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/obj_mgr/inc \
106        -I$(obj)/$(HOST_CMN_CONVG_SRC)/scheduler/inc \
107        -I$(obj)/$(HOST_CMN_CONVG_SRC)/init_deinit/dispatcher/inc \
108        -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/inc \
109        -I$(obj)/$(DEPTH)/cmn_dev/umac/global_umac_dispatcher/lmac_if/inc \
110        -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/mgmt_txrx/dispatcher/inc \
111        -I$(obj)/$(DEPTH)/cmn_dev/target_if/init_deinit/inc \
112        -I$(obj)/$(DEPTH)/cmn_dev/global_lmac_if/inc \
113        -I$(obj)/$(DEPTH)/cmn_dev/os_if/linux \
114        -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/cmn_defs/inc \
115        -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/regulatory/inc \
116        -I$(obj)/$(DEPTH)/cmn_dev/target_if/core/inc \
117        -I$(obj)/$(DEPTH)/cmn_dev/umac/scan/dispatcher/inc \
118        -I$(obj)/$(DEPTH)/umac/scan \
119        -I$(obj)/$(DEPTH)/cmn_dev/ol_if \
120        -I$(obj)/$(DEPTH)/cmn_dev/target_if/scan/inc \
121        -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/serialization/core/inc \
122        -I$(obj)/$(DEPTH)/cmn_dev/umac/regulatory/dispatcher/inc \
123        -I$(obj)/$(DEPTH)/cmn_dev/target_if/regulatory/inc \
124        -I$(obj)/$(DEPTH)/cmn_dev/umac/mlme/mlme_objmgr/dispatcher/inc/ \
125        -I$(obj)/$(DEPTH)/cmn_dev/umac/mlme/vdev_mgr/dispatcher/inc \
126        -I$(obj)/$(DEPTH)/cmn_dev/umac/mlme/pdev_mgr/dispatcher/inc \
127
128PERF_PWR_OFFLOAD_INC += -I$(PERF_PWR_OFFLOAD_DIR_PATH)/wlan/include \
129 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/wlan/ath_pktlog/include \
130 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/htt/include \
131 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/wlan/txrx/include \
132 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/include \
133 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/include \
134 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/hif/pci \
135 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/hif/pci/linux   \
136 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/os/linux/include \
137 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/wlan/regdmn \
138 -I$(PERF_PWR_OFFLOAD_DIR_PATH)/wlan/lmac_offload_if \
139 -I$(HOST_CMN_CONVG_HIF_INC1)/inc \
140 -I$(HOST_CMN_CONVG_HIF_INC1)/src \
141 -I$(HOST_CMN_CONVG_HIF_INC1)/src/pcie \
142 -I$(HOST_CMN_CONVG_HIF_INC1)/src/snoc \
143 -I$(HOST_CMN_CONVG_SRC)/pld_stub/inc \
144 -I$(HOST_CMN_CONVG_HIF_SRC)/ce \
145 -I$(HOST_CMN_CONVG_HTC_INC) \
146 -I$(HOST_CMN_CONVG_CFG_INC) \
147 -I$(HOST_CMN_CONVG_DP_INC) \
148 -I$(HOST_CMN_CONVG_HAL_INC) \
149 -I$(HOST_CMN_CONVG_HAL_WIFI_INC) \
150 -I$(PERF_PWR_OFFLOAD_WMI_SRC)/inc \
151 -I$(obj)/$(DEPTH)/offload/extra_include
152
153#Add HK/BL Fw header path required by common files
154ifeq (1, ${WIFI_TARGET_3_0})
155PERF_PWR_OFFLOAD_INC += -I$(PERF_PWR_OFFLOAD_DIR_PATH)/include/fwcommon \
156                       -I$(PERF_PWR_OFFLOAD_DIR_PATH)/include/fwcommon/htt_stats
157else
158PERF_PWR_OFFLOAD_INC += -I$(PERF_PWR_OFFLOAD_DIR_PATH)/include/legacy
159endif
160
161INCS += $(PERF_PWR_OFFLOAD_INC)
162INCS += -I$(obj)/$(DEPTH)/cmn_dev/target_if/spectral
163INCS += -I$(obj)/$(DEPTH)/cmn_dev/wmi/inc
164INCS += -I$(PERF_PWR_OFFLOAD_DIR_PATH)/hw/include
165#end of offload related defines
166
167#Start of Legacy spectral related defines
168INCS += -I$(HAL) -I$(HAL)/$(OS) -I$(ATH) -I$(ATH_RATE) -I$(ATH_PKTLOG) -I$(WLAN) -I$(IF_WLAN) -I$(ATH_SPECTRAL) -I$(ATHEROSPATH) -I$(obj)/$(DEPTH)/../../apps/spectral/common
169INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/inc -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/obj_mgr/inc
170INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/cmn_defs/inc
171INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/scan/dispatcher/inc
172INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/cmn_defs/inc
173INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/global_umac_dispatcher/lmac_if/inc
174INCS += -I$(obj)/$(DEPTH)/cmn_dev/scheduler/inc
175INCS += -I$(obj)/$(DEPTH)/umac/scan
176INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/mgmt_txrx/dispatcher/inc
177INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/regulatory/dispatcher/inc
178INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/dfs/dispatcher/inc
179
180#End of legacy spectral defines
181
182ifeq ($(QCA_AIRTIME_FAIRNESS), 1)
183ccflags-y+= -DWLAN_ATF_ENABLE
184INCS += -I$(obj)/$(DEPTH)/umac/airtime_fairness/dispatcher/inc
185endif
186
187ifeq ($(UNIFIED_SMARTANTENNA), 1)
188ccflags-y+= -DWLAN_SA_API_ENABLE
189INCS += -I$(obj)/$(DEPTH)/umac/sa_api/dispatcher/inc
190endif
191
192ifeq ($(QCA_CFR_SUPPORT), 1)
193ccflags-y+= -DWLAN_CFR_ENABLE=1
194INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cfr/dispatcher/inc
195INCS += -I$(obj)/$(DEPTH)/component_dev/qal/inc
196endif
197
198ifeq ($(strip ${QCA_DFS_COMPONENT_ENABLE}),1)
199ccflags-y+= -DDFS_COMPONENT_ENABLE
200endif
201
202obj-m += qca_spectral.o
203
204INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/twt/dispatcher/inc
205INCS += -I$(obj)/$(DEPTH)/spectral/dispatcher/inc
206
207inc_file := $(obj)/$(DEPTH)/spectral_inc_opts
208inc_var := $(shell echo $(INCS) > $(inc_file))
209var := "@$(inc_file)"
210
211ccflags-y+= $(var) $(COPTS) -DSPECTRAL_USE_NETLINK_SOCKETS=1 -DWLAN_SPECTRAL_ENABLE=1
212ccflags-y+= -DSPECTRAL_USE_NL_BCAST=1
213
214ifeq ($(strip ${QCA_PARTNER_MAKE_F_SUPPORT}),1)
215MOD_CFLAGS = -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(qca_spectral.mod)"  -D"KBUILD_MODNAME=KBUILD_STR(qca_spectral)"
216endif
217
218
219SPECTRAL_TIF_OBJS +=  $(DEPTH)/cmn_dev/target_if/spectral/target_if_spectral.o \
220                      $(DEPTH)/cmn_dev/target_if/spectral/target_if_spectral_netlink.o \
221                      $(DEPTH)/cmn_dev/target_if/spectral/target_if_spectral_phyerr.o \
222                      $(DEPTH)/cmn_dev/target_if/spectral/target_if_spectral_sim.o
223
224SPECTRAL_CMN_OBJS +=  core/spectral_offload.o \
225                      core/spectral_common.o \
226                      dispatcher/src/wlan_spectral_utils_api.o \
227                      dispatcher/src/wlan_spectral_ucfg_api.o \
228                      dispatcher/src/wlan_spectral_tgt_api.o \
229                      core/spectral_module.o \
230                      $(DEPTH)/cmn_dev/os_if/linux/spectral/src/wlan_cfg80211_spectral.o \
231                      $(DEPTH)/cmn_dev/os_if/linux/spectral/src/os_if_spectral_netlink.o
232
233qca_spectral-objs +=  ${SPECTRAL_CMN_OBJS} \
234                      ${SPECTRAL_TIF_OBJS}
235
236ifeq ($(strip ${QCA_PARTNER_MAKE_F_SUPPORT}),1)
237all: qca_spectral.ko
238
239qca_spectral.mod.o: qca_spectral.mod.c
240	${CC} -c -o $@ ${ccflags-y} ${MOD_CFLAGS} $<
241
242qca_spectral.o: ${qca_spectral-objs}
243	$(LD) -m elf32btsmip -r -o qca_spectral.o $(qca_spectral-objs)
244	$(KERNELPATH)/scripts/mod/modpost qca_spectral.o
245
246qca_spectral.ko: qca_spectral.o qca_spectral.mod.o
247	$(LD) $(LDOPTS) -o qca_spectral.ko qca_spectral.o qca_spectral.mod.o
248
249%.o: %.c
250	${CC} -c -o $@ ${ccflags-y} $<
251endif
252