diff --git a/cnss2/Makefile b/cnss2/Makefile index c031c5c90b..a2b48e94d5 100644 --- a/cnss2/Makefile +++ b/cnss2/Makefile @@ -1,8 +1,14 @@ # SPDX-License-Identifier: GPL-2.0-only +ifeq ($(CONFIG_CNSS_OUT_OF_TREE),y) +ccflags-y += -I$(WLAN_PLATFORM_ROOT)/cnss_utils +ccflags-y += -I$(WLAN_PLATFORM_ROOT)/inc +else +ccflags-y += -I$(srctree)/drivers/net/wireless/cnss_utils +endif + obj-$(CONFIG_CNSS2) += cnss2.o -ccflags-y += -I$(srctree)/drivers/net/wireless/cnss_utils/ cnss2-y := main.o cnss2-y += bus.o cnss2-y += debug.o diff --git a/cnss2/main.h b/cnss2/main.h index d053f12c9f..b75b84a762 100644 --- a/cnss2/main.h +++ b/cnss2/main.h @@ -19,7 +19,11 @@ #include #include #include +#ifdef CONFIG_CNSS_OUT_OF_TREE +#include "cnss2.h" +#else #include +#endif #if IS_ENABLED(CONFIG_QCOM_MEMORY_DUMP_V2) #include #endif diff --git a/cnss_genl/Makefile b/cnss_genl/Makefile index 59844a479d..84d964a0a9 100644 --- a/cnss_genl/Makefile +++ b/cnss_genl/Makefile @@ -1,3 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only +ifeq ($(CONFIG_CNSS_OUT_OF_TREE),y) +ccflags-y += -I$(WLAN_PLATFORM_ROOT)/inc +endif + obj-$(CONFIG_CNSS_GENL) := cnss_nl.o diff --git a/cnss_genl/cnss_nl.c b/cnss_genl/cnss_nl.c index 0c67e4370c..188a770cf0 100644 --- a/cnss_genl/cnss_nl.c +++ b/cnss_genl/cnss_nl.c @@ -2,7 +2,11 @@ /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */ #include +#ifdef CONFIG_CNSS_OUT_OF_TREE +#include "cnss_nl.h" +#else #include +#endif #include #include diff --git a/cnss_prealloc/Makefile b/cnss_prealloc/Makefile index a8b0695644..aa6476769d 100644 --- a/cnss_prealloc/Makefile +++ b/cnss_prealloc/Makefile @@ -1,3 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only +ifeq ($(CONFIG_CNSS_OUT_OF_TREE),y) +ccflags-y += -I$(WLAN_PLATFORM_ROOT)/inc +endif + obj-$(CONFIG_WCNSS_MEM_PRE_ALLOC) += cnss_prealloc.o diff --git a/cnss_prealloc/cnss_prealloc.c b/cnss_prealloc/cnss_prealloc.c index 05e7aea589..1a29d916e9 100644 --- a/cnss_prealloc/cnss_prealloc.c +++ b/cnss_prealloc/cnss_prealloc.c @@ -7,7 +7,11 @@ #include #include #include +#ifdef CONFIG_CNSS_OUT_OF_TREE +#include "cnss_prealloc.h" +#else #include +#endif MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("CNSS prealloc driver"); diff --git a/cnss_utils/Makefile b/cnss_utils/Makefile index 59ee7edf65..7d0100e5bb 100644 --- a/cnss_utils/Makefile +++ b/cnss_utils/Makefile @@ -1,6 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-only +ifeq ($(CONFIG_CNSS_OUT_OF_TREE),y) +ccflags-y += -I$(WLAN_PLATFORM_ROOT)/inc +endif + obj-$(CONFIG_CNSS_UTILS) += cnss_utils.o + obj-$(CONFIG_CNSS_QMI_SVC) += wlan_firmware_service.o wlan_firmware_service-y := wlan_firmware_service_v01.o device_management_service_v01.o diff --git a/cnss_utils/cnss_utils.c b/cnss_utils/cnss_utils.c index 6bb7dfcd61..ef94c65323 100644 --- a/cnss_utils/cnss_utils.c +++ b/cnss_utils/cnss_utils.c @@ -9,7 +9,11 @@ #include #include #include +#ifdef CONFIG_CNSS_OUT_OF_TREE +#include "cnss_utils.h" +#else #include +#endif #define CNSS_MAX_CH_NUM 157 struct cnss_unsafe_channel_list {