qca-nss-drv: disable additional module not used

Add patch to permit more modularization and disable
additional module not used. PPPOE is disabled by default.
Will be enabled later if PPPOE offload will be reintroduced.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
This commit is contained in:
Ansuel Smith 2022-05-17 21:40:05 +02:00
parent 882ea0ee5a
commit d442d1328e
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
2 changed files with 181 additions and 2 deletions

View File

@ -66,7 +66,8 @@ endif
DRV_MAKE_OPTS:=
ifeq ($(LOW_MEM_PROFILE_MAKE_OPTS),y)
DRV_MAKE_OPTS+=NSS_DRV_C2C_ENABLE=n \
DRV_MAKE_OPTS+= \
NSS_DRV_C2C_ENABLE=n \
NSS_DRV_CAPWAP_ENABLE=n \
NSS_DRV_CLMAP_ENABLE=n \
NSS_DRV_CRYPTO_ENABLE=y \
@ -95,7 +96,13 @@ DRV_MAKE_OPTS+=NSS_DRV_C2C_ENABLE=n \
NSS_DRV_TUNIPIP6_ENABLE=n \
NSS_DRV_VXLAN_ENABLE=n \
NSS_DRV_MATCH_ENABLE=n \
NSS_DRV_MIRROR_ENABLE=n
NSS_DRV_MIRROR_ENABLE=n \
NSS_DRV_PPPOE_ENABLE=n \
NSS_DRV_VIRT_IF_ENABLE=n \
NSS_DRV_VLAN_ENABLE=n \
NSS_DRV_BRIDGE_ENABLE=n \
NSS_DRV_WIFI_EXT_VDEV_ENABLE=n \
NSS_DRV_WIFI_MESH_ENABLE=n
endif
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")

View File

@ -0,0 +1,172 @@
From 895de8e4119afe3cbad2aa81566b1ebcb2b39dcd Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Tue, 17 May 2022 20:23:19 +0200
Subject: [PATCH] Makefile: modularize driver even more
Permit to disable even more module.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
Makefile | 56 ++++++++++++++++++++++++++++++++---------------
nss_hal/nss_hal.c | 6 +++++
nss_init.c | 4 ++++
3 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
index f5c4b90..0194dbd 100644
--- a/Makefile
+++ b/Makefile
@@ -39,35 +39,55 @@ qca-nss-drv-objs := \
nss_pm.o \
nss_profiler.o \
nss_project.o \
- nss_pppoe.o \
- nss_pppoe_log.o \
- nss_pppoe_stats.o \
- nss_pppoe_strings.o \
nss_rps.o \
nss_stats.o \
nss_strings.o \
nss_tx_msg_sync.o \
nss_unaligned.o \
nss_unaligned_log.o \
- nss_unaligned_stats.o \
- nss_virt_if.o \
- nss_virt_if_stats.o \
- nss_vlan.o \
- nss_vlan_log.o \
- nss_wifi.o \
- nss_wifi_log.o \
- nss_wifi_stats.o \
- nss_wifi_vdev.o \
- nss_wifili.o \
- nss_wifili_log.o \
- nss_wifili_stats.o \
- nss_wifili_strings.o \
- nss_wifi_mac_db.o
+ nss_unaligned_stats.o
# Base NSS data plane/HAL support
qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
qca-nss-drv-objs += nss_hal/nss_hal.o
+ifneq "$(NSS_DRV_PPPOE_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_PPPOE_ENABLE
+qca-nss-drv-objs += \
+ nss_pppoe.o \
+ nss_pppoe_log.o \
+ nss_pppoe_stats.o \
+ nss_pppoe_strings.o
+endif
+
+ifneq "$(NSS_DRV_VIRT_IF_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_VIRT_IF_ENABLE
+qca-nss-drv-objs += \
+ nss_virt_if.o \
+ nss_virt_if_stats.o
+endif
+
+ifneq "$(NSS_DRV_VLAN_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_VLAN_ENABLE
+qca-nss-drv-objs += \
+ nss_vlan.o \
+ nss_vlan_log.o
+endif
+
+ifneq "$(NSS_DRV_WIFI_ENABLE)" "n"
+ccflags-y += -DNSS_DRV_WIFI_ENABLE
+qca-nss-drv-objs += \
+ nss_wifi.o \
+ nss_wifi_log.o \
+ nss_wifi_stats.o \
+ nss_wifi_vdev.o \
+ nss_wifili.o \
+ nss_wifili_log.o \
+ nss_wifili_stats.o \
+ nss_wifili_strings.o \
+ nss_wifi_mac_db.o
+endif
+
ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n"
ccflags-y += -DNSS_DRV_BRIDGE_ENABLE
qca-nss-drv-objs += \
diff --git a/nss_hal/nss_hal.c b/nss_hal/nss_hal.c
index 7e9a044..c0051e4 100644
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -460,10 +460,12 @@ int nss_hal_probe(struct platform_device *nss_dev)
}
#endif
+#ifdef NSS_DRV_PPPOE_ENABLE
if (npd->pppoe_enabled == NSS_FEATURE_ENABLED) {
nss_top->pppoe_handler_id = nss_dev->id;
nss_pppoe_register_handler();
}
+#endif
#ifdef NSS_DRV_PPE_ENABLE
if (npd->ppe_enabled == NSS_FEATURE_ENABLED) {
@@ -558,6 +560,7 @@ int nss_hal_probe(struct platform_device *nss_dev)
}
#endif
+#ifdef NSS_DRV_WIFI_ENABLE
if (npd->wifioffload_enabled == NSS_FEATURE_ENABLED) {
nss_top->wifi_handler_id = nss_dev->id;
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id;
@@ -585,6 +588,7 @@ int nss_hal_probe(struct platform_device *nss_dev)
*/
nss_wifili_thread_scheme_db_init(nss_dev->id);
}
+#endif
#ifdef NSS_DRV_OAM_ENABLE
if (npd->oam_enabled == NSS_FEATURE_ENABLED) {
@@ -601,11 +605,13 @@ int nss_hal_probe(struct platform_device *nss_dev)
}
#endif
+#ifdef NSS_DRV_VLAN_ENABLE
if (npd->vlan_enabled == NSS_FEATURE_ENABLED) {
nss_top->vlan_handler_id = nss_dev->id;
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VLAN] = nss_dev->id;
nss_vlan_register_handler();
}
+#endif
#ifdef NSS_DRV_QVPN_ENABLE
#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT)
diff --git a/nss_init.c b/nss_init.c
index ebd2a12..40e9351 100644
--- a/nss_init.c
+++ b/nss_init.c
@@ -775,10 +775,12 @@ static int __init nss_init(void)
*/
nss_project_register_sysctl();
+#ifdef NSS_DRV_PPPOE_ENABLE
/*
* Registering sysctl for pppoe specific config.
*/
nss_pppoe_register_sysctl();
+#endif
/*
* Setup Runtime Sample values
@@ -913,10 +915,12 @@ static void __exit nss_cleanup(void)
nss_c2c_tx_unregister_sysctl();
#endif
+#ifdef NSS_DRV_PPPOE_ENABLE
/*
* Unregister pppoe specific sysctl
*/
nss_pppoe_unregister_sysctl();
+#endif
/*
* Unregister ipv4/6 specific sysctl and free allocated to connection tables
--
2.34.1