From 03f6cb25eb35816873cf5c27b66cc5afec097dcd Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Fri, 30 May 2025 14:35:29 -0400 Subject: [PATCH] nss-drv: Limit arch specific NSS features Prevent selecting or building NSS features that are ipq806x specific These include: - Port ID (nss_portid.c) - OAM (nss_oam.c) - Timestamping (nss_tstamp.c) - Legacy WiFi Offload (nss_wifi.c) Signed-off-by: Sean Khan --- qca-nss-drv/Config.in | 4 +- ...Makefile-set-rearrange-arch-features.patch | 75 +++++++++++++++++++ ...Makefile-set-rearrange-arch-features.patch | 75 +++++++++++++++++++ 3 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 qca-nss-drv/patches-11.4/0027-Makefile-set-rearrange-arch-features.patch create mode 100644 qca-nss-drv/patches/0027-Makefile-set-rearrange-arch-features.patch diff --git a/qca-nss-drv/Config.in b/qca-nss-drv/Config.in index 9798dcb..4334fe6 100644 --- a/qca-nss-drv/Config.in +++ b/qca-nss-drv/Config.in @@ -133,12 +133,13 @@ config NSS_DRV_OAM_ENABLE bool default n prompt "Enable OAM" - depends on TARGET_qualcommax_ipq806x + depends on TARGET_ipq806x config NSS_DRV_PORTID_ENABLE bool default n prompt "Enable PORTID" + depends on TARGET_ipq806x config NSS_DRV_LSO_RX_ENABLE bool @@ -215,6 +216,7 @@ config NSS_DRV_TSTAMP_ENABLE bool default n prompt "Enable TSTAMP" + depends on TARGET_ipq806x config NSS_DRV_TUN6RD_ENABLE bool diff --git a/qca-nss-drv/patches-11.4/0027-Makefile-set-rearrange-arch-features.patch b/qca-nss-drv/patches-11.4/0027-Makefile-set-rearrange-arch-features.patch new file mode 100644 index 0000000..8a71b97 --- /dev/null +++ b/qca-nss-drv/patches-11.4/0027-Makefile-set-rearrange-arch-features.patch @@ -0,0 +1,75 @@ +--- a/Makefile ++++ b/Makefile +@@ -123,12 +123,14 @@ qca-nss-drv-objs += \ + endif + endif + ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n" + ccflags-y += -DNSS_DRV_TSTAMP_ENABLE + qca-nss-drv-objs += \ + nss_tstamp.o \ + nss_tstamp_stats.o + endif ++endif + + ifneq "$(NSS_DRV_GRE_ENABLE)" "n" + ccflags-y += -DNSS_DRV_GRE_ENABLE +@@ -248,6 +250,7 @@ qca-nss-drv-objs += \ + nss_rmnet_rx_stats.o + endif + ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ifneq "$(NSS_DRV_PORTID_ENABLE)" "n" + ccflags-y += -DNSS_DRV_PORTID_ENABLE + qca-nss-drv-objs += \ +@@ -255,6 +258,7 @@ qca-nss-drv-objs += \ + nss_portid_log.o \ + nss_portid_stats.o + endif ++endif + + ifneq "$(NSS_DRV_IGS_ENABLE)" "n" + ccflags-y += -DNSS_DRV_IGS_ENABLE +@@ -263,12 +267,14 @@ qca-nss-drv-objs += \ + nss_igs_stats.o + endif + ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ifneq "$(NSS_DRV_OAM_ENABLE)" "n" + ccflags-y += -DNSS_DRV_OAM_ENABLE + qca-nss-drv-objs += \ + nss_oam.o \ + nss_oam_log.o + endif ++endif + + ifneq "$(NSS_DRV_CLMAP_ENABLE)" "n" + ccflags-y += -DNSS_DRV_CLMAP_ENABLE +@@ -343,16 +349,13 @@ endif + + ifneq "$(NSS_DRV_WIFIOFFLOAD_ENABLE)" "n" + ccflags-y += -DNSS_DRV_WIFIOFFLOAD_ENABLE +-ifneq "$(NSS_DRV_WIFI_LEGACY_ENABLE)" "n" +-ccflags-y += -DNSS_DRV_WIFI_LEGACY_ENABLE ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + qca-nss-drv-objs += \ + nss_wifi.o \ + nss_wifi_log.o \ + nss_wifi_stats.o +-ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ccflags-y += -DNSS_HAL_IPQ806x_SUPPORT +-endif +-endif ++else + qca-nss-drv-objs += \ + nss_wifi_vdev.o \ + nss_wifili.o \ +@@ -361,6 +364,7 @@ qca-nss-drv-objs += \ + nss_wifili_strings.o \ + nss_wifi_mac_db.o + endif ++endif + + ifneq "$(NSS_DRV_VLAN_ENABLE)" "n" + ccflags-y += -DNSS_DRV_VLAN_ENABLE diff --git a/qca-nss-drv/patches/0027-Makefile-set-rearrange-arch-features.patch b/qca-nss-drv/patches/0027-Makefile-set-rearrange-arch-features.patch new file mode 100644 index 0000000..29976ca --- /dev/null +++ b/qca-nss-drv/patches/0027-Makefile-set-rearrange-arch-features.patch @@ -0,0 +1,75 @@ +--- a/Makefile ++++ b/Makefile +@@ -122,12 +122,14 @@ qca-nss-drv-objs += \ + endif + endif + ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n" + ccflags-y += -DNSS_DRV_TSTAMP_ENABLE + qca-nss-drv-objs += \ + nss_tstamp.o \ + nss_tstamp_stats.o + endif ++endif + + ifneq "$(NSS_DRV_GRE_ENABLE)" "n" + ccflags-y += -DNSS_DRV_GRE_ENABLE +@@ -255,6 +257,7 @@ qca-nss-drv-objs += \ + nss_rmnet_rx_stats.o + endif + ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ifneq "$(NSS_DRV_PORTID_ENABLE)" "n" + ccflags-y += -DNSS_DRV_PORTID_ENABLE + qca-nss-drv-objs += \ +@@ -262,6 +265,7 @@ qca-nss-drv-objs += \ + nss_portid_log.o \ + nss_portid_stats.o + endif ++endif + + ifneq "$(NSS_DRV_IGS_ENABLE)" "n" + ccflags-y += -DNSS_DRV_IGS_ENABLE +@@ -270,12 +274,14 @@ qca-nss-drv-objs += \ + nss_igs_stats.o + endif + ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ifneq "$(NSS_DRV_OAM_ENABLE)" "n" + ccflags-y += -DNSS_DRV_OAM_ENABLE + qca-nss-drv-objs += \ + nss_oam.o \ + nss_oam_log.o + endif ++endif + + ifneq "$(NSS_DRV_CLMAP_ENABLE)" "n" + ccflags-y += -DNSS_DRV_CLMAP_ENABLE +@@ -350,16 +356,13 @@ endif + + ifneq "$(NSS_DRV_WIFIOFFLOAD_ENABLE)" "n" + ccflags-y += -DNSS_DRV_WIFIOFFLOAD_ENABLE +-ifneq "$(NSS_DRV_WIFI_LEGACY_ENABLE)" "n" +-ccflags-y += -DNSS_DRV_WIFI_LEGACY_ENABLE ++ifeq ($(SoC),$(filter $(SoC),ipq806x)) + qca-nss-drv-objs += \ + nss_wifi.o \ + nss_wifi_log.o \ + nss_wifi_stats.o +-ifeq ($(SoC),$(filter $(SoC),ipq806x)) + ccflags-y += -DNSS_HAL_IPQ806x_SUPPORT +-endif +-endif ++else + qca-nss-drv-objs += \ + nss_wifi_vdev.o \ + nss_wifili.o \ +@@ -368,6 +371,7 @@ qca-nss-drv-objs += \ + nss_wifili_strings.o \ + nss_wifi_mac_db.o + endif ++endif + + ifneq "$(NSS_DRV_VLAN_ENABLE)" "n" + ccflags-y += -DNSS_DRV_VLAN_ENABLE