[qca-nss-clients] Fix on insmod of netlink module.
Disabling modules on unsupported chipset(s)
Change-Id: I79210362e3973ec8b824f77f3bb23d6da3874283
Signed-off-by: Pavithra R <pavir@codeaurora.org>
diff --git a/netlink/Makefile b/netlink/Makefile
index 5c0c2a8..cbd5eec 100644
--- a/netlink/Makefile
+++ b/netlink/Makefile
@@ -13,11 +13,8 @@
ccflags-y += -DCONFIG_NSS_NLOAM=1
ccflags-y += -DCONFIG_NSS_NLGRE_REDIR_FAMILY=1
ccflags-y += -DCONFIG_NSS_NLETHRX=1
-ccflags-y += -DCONFIG_NSS_NLEDMA=1
ccflags-y += -DCONFIG_NSS_NLDYNAMIC_INTERFACE=1
ccflags-y += -DCONFIG_NSS_NLN2H=1
-ccflags-y += -DCONFIG_NSS_NLC2C_TX=1
-ccflags-y += -DCONFIG_NSS_NLC2C_RX=1
ccflags-y += -DCONFIG_NSS_NLIPV4_REASM=1
ccflags-y += -DCONFIG_NSS_NLIPV6_REASM=1
ccflags-y += -DCONFIG_NSS_NLWIFILI=1
@@ -40,11 +37,8 @@
qca-nss-netlink-objs += nss_nlipv6.o
qca-nss-netlink-objs += nss_nloam.o
qca-nss-netlink-objs += nss_nlethrx.o
-qca-nss-netlink-objs += nss_nledma.o
qca-nss-netlink-objs += nss_nldynamic_interface.o
qca-nss-netlink-objs += nss_nln2h.o
-qca-nss-netlink-objs += nss_nlc2c_tx.o
-qca-nss-netlink-objs += nss_nlc2c_rx.o
qca-nss-netlink-objs += nss_nlipv4_reasm.o
qca-nss-netlink-objs += nss_nlipv6_reasm.o
qca-nss-netlink-objs += nss_nlwifili.o
@@ -66,4 +60,21 @@
qca-nss-netlink-objs += nss_nlipsec.o
endif
+ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
+ccflags-y += -DCONFIG_NSS_NLC2C_TX=1
+ccflags-y += -DCONFIG_NSS_NLC2C_RX=1
+qca-nss-netlink-objs += nss_nlc2c_tx.o
+qca-nss-netlink-objs += nss_nlc2c_rx.o
+else
+ccflags-y += -DCONFIG_NSS_NLC2C_TX=0
+ccflags-y += -DCONFIG_NSS_NLC2C_RX=0
+endif
+
+ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64 ipq807x ipq807x_64))
+ccflags-y += -DCONFIG_NSS_NLEDMA=1
+qca-nss-netlink-objs += nss_nledma.o
+else
+ccflags-y += -DCONFIG_NSS_NLEDMA=0
+endif
+
obj-m += qca-nss-netlink.o
diff --git a/netlink/nss_nlc2c_rx.h b/netlink/nss_nlc2c_rx.h
index a7edf12..0d16921 100644
--- a/netlink/nss_nlc2c_rx.h
+++ b/netlink/nss_nlc2c_rx.h
@@ -23,10 +23,10 @@
#ifndef __NSS_NLC2C_RX_H
#define __NSS_NLC2C_RX_H
+#if (CONFIG_NSS_NLC2C_RX == 1)
bool nss_nlc2c_rx_init(void);
bool nss_nlc2c_rx_exit(void);
-#if defined(CONFIG_NSS_NLC2C_RX)
#define NSS_NLC2C_RX_INIT nss_nlc2c_rx_init
#define NSS_NLC2C_RX_EXIT nss_nlc2c_rx_exit
#else
diff --git a/netlink/nss_nlc2c_tx.h b/netlink/nss_nlc2c_tx.h
index 239d239..cfb6da8 100644
--- a/netlink/nss_nlc2c_tx.h
+++ b/netlink/nss_nlc2c_tx.h
@@ -23,10 +23,10 @@
#ifndef __NSS_NLC2C_TX_H
#define __NSS_NLC2C_TX_H
+#if (CONFIG_NSS_NLC2C_TX == 1)
bool nss_nlc2c_tx_init(void);
bool nss_nlc2c_tx_exit(void);
-#if defined(CONFIG_NSS_NLC2C_TX)
#define NSS_NLC2C_TX_INIT nss_nlc2c_tx_init
#define NSS_NLC2C_TX_EXIT nss_nlc2c_tx_exit
#else
diff --git a/netlink/nss_nledma.h b/netlink/nss_nledma.h
index 0d96617..746c1ab 100644
--- a/netlink/nss_nledma.h
+++ b/netlink/nss_nledma.h
@@ -23,10 +23,10 @@
#ifndef __NSS_NLEDMA_H
#define __NSS_NLEDMA_H
+#if (CONFIG_NSS_NLEDMA == 1)
bool nss_nledma_init(void);
bool nss_nledma_exit(void);
-#if defined(CONFIG_NSS_NLEDMA)
#define NSS_NLEDMA_INIT nss_nledma_init
#define NSS_NLEDMA_EXIT nss_nledma_exit
#else