wlan_platform: Add CONFIG_CNSS_OUT_OF_TREE flag

Use CONFIG_CNSS_OUT_OF_TREE to control if CNSS family drivers are
built from in-kernel-tree source or out-of-kernel-tree source since
the exposed header files will be in different paths. This is also
for backward compatibility.

Change-Id: I24111fdb76607bf911c29e415d42d25609f9b26c
This commit is contained in:
Yue Ma
2021-10-06 21:01:24 -07:00
parent 5b29459b17
commit 7e3754303f
8 changed files with 36 additions and 1 deletions

View File

@@ -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

View File

@@ -19,7 +19,11 @@
#include <linux/pm_qos.h>
#include <linux/platform_device.h>
#include <linux/time64.h>
#ifdef CONFIG_CNSS_OUT_OF_TREE
#include "cnss2.h"
#else
#include <net/cnss2.h>
#endif
#if IS_ENABLED(CONFIG_QCOM_MEMORY_DUMP_V2)
#include <soc/qcom/memory_dump.h>
#endif

View File

@@ -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

View File

@@ -2,7 +2,11 @@
/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */
#include <net/genetlink.h>
#ifdef CONFIG_CNSS_OUT_OF_TREE
#include "cnss_nl.h"
#else
#include <net/cnss_nl.h>
#endif
#include <linux/module.h>
#include <linux/of.h>

View File

@@ -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

View File

@@ -7,7 +7,11 @@
#include <linux/mm.h>
#include <linux/err.h>
#include <linux/of.h>
#ifdef CONFIG_CNSS_OUT_OF_TREE
#include "cnss_prealloc.h"
#else
#include <net/cnss_prealloc.h>
#endif
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("CNSS prealloc driver");

View File

@@ -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

View File

@@ -9,7 +9,11 @@
#include <linux/etherdevice.h>
#include <linux/debugfs.h>
#include <linux/of.h>
#ifdef CONFIG_CNSS_OUT_OF_TREE
#include "cnss_utils.h"
#else
#include <net/cnss_utils.h>
#endif
#define CNSS_MAX_CH_NUM 157
struct cnss_unsafe_channel_list {