[rdk-b][mt7986][wifi-hal][Refactor wifi hal bb file]

[Description]
Refactor wifi hal source from github to internal gerrit repo.

[Release-log]
N/A

Change-Id: I04507f76f26ce45226898b4d08ac49e1197bfb3e
diff --git a/recipes-ccsp/hal/hal-wifi-cfg80211_git.bbappend b/recipes-ccsp/hal/hal-wifi-cfg80211_git.bbappend
index 3d38d48..d380851 100644
--- a/recipes-ccsp/hal/hal-wifi-cfg80211_git.bbappend
+++ b/recipes-ccsp/hal/hal-wifi-cfg80211_git.bbappend
@@ -1,21 +1,10 @@
+SRC_URI += "git://gerrit.mediatek.inc/gateway/rdk-b/rdkb_hal;protocol=https;destsuffix=git/source/wifi/rdkb_hal"
 
-BRANCH_MTK_IMPL= "master"
+SRCREV = "${AUTOREV}"
 
-SRC_URI = "${CMF_GITHUB_ROOT}/hal-wifi-cfg80211;protocol=${CMF_GIT_PROTOCOL};branch=${BRANCH_MTK_IMPL};name=wifihal"
-SRCREV_wifihal_remove = "${AUTOREV}"
-SRCREV_wifihal = "16a86d50a6485b74f646355925ae64957bcca4ad"
-FILESEXTRAPATHS_remove := "${THISDIR}/files:"
-FILESEXTRAPATHS_prepend := "${THISDIR}/hal-wifi-patches:"
-
-SRC_URI += "file://*.patch;apply=no"
+CFLAGS_append = " -DWIFI_HAL_VERSION_3"
 
-do_mtk_patches() {
-	cd ${S}/../../
-	if [ ! -e mtk_wifi_patch_applied ]; then
-		for i in ${WORKDIR}/*.patch; do patch -p1 < $i; done
-	fi
-	touch mtk_wifi_patch_applied
+do_configure_prepend(){
+    rm ${S}/wifi_hal.c
+    ln -sf ${S}/rdkb_hal/src/wifi/wifi_hal.c ${S}/wifi_hal.c
 }
-addtask mtk_patches after do_unpack before do_compile
-
-CFLAGS_append = " -DWIFI_HAL_VERSION_3"
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0001-patch-HAL-implement-wifi_setRadioCountryCode-wifi_ge.patch b/recipes-ccsp/hal/hal-wifi-patches/0001-patch-HAL-implement-wifi_setRadioCountryCode-wifi_ge.patch
deleted file mode 100644
index 9fc54a1..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0001-patch-HAL-implement-wifi_setRadioCountryCode-wifi_ge.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From f804c8f10fc057308def2fb70c9c94922b03f161 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Mon, 11 Jul 2022 17:47:56 +0800
-Subject: [PATCH] [patch] HAL: implement wifi_setRadioCountryCode() &
- wifi_getRadioCountryCode()
-
----
- source/wifi/wifi_hal.c | 37 +++++++++++++++++++++++++++++++++++--
- 1 file changed, 35 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 51f25c6..23572ac 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -929,9 +929,16 @@ INT wifi_createInitialConfigFiles()
- // outputs the country code to a max 64 character string
- INT wifi_getRadioCountryCode(INT radioIndex, CHAR *output_string)
- {
--    if (NULL == output_string)
-+    char buf[MAX_BUF_SIZE] = {0}, cmd[MAX_CMD_SIZE] = {0}, *value;
-+    if(!output_string || !(radioIndex==0 || radioIndex==1))
-+        return RETURN_ERR;
-+
-+    sprintf(cmd,"hostapd_cli -i %s%d status driver | grep country | cut -d '=' -f2", AP_PREFIX, radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    if(strlen(buf) > 0)
-+        snprintf(output_string, 64, "%s", buf);
-+    else
-         return RETURN_ERR;
--    snprintf(output_string, 64, "US");
- 
-     return RETURN_OK;
- }
-@@ -939,6 +946,32 @@ INT wifi_getRadioCountryCode(INT radioIndex, CHAR *output_string)
- INT wifi_setRadioCountryCode(INT radioIndex, CHAR *CountryCode)
- {
-     //Set wifi config. Wait for wifi reset to apply
-+    char str[MAX_BUF_SIZE]={'\0'};
-+    char cmd[MAX_CMD_SIZE]={'\0'};
-+    struct params params;
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(NULL == CountryCode || strlen(CountryCode) >= 32 )
-+        return RETURN_ERR;
-+
-+    params.name = "country_code";
-+    params.value = CountryCode;
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX, radioIndex);
-+    int ret = wifi_hostapdWrite(config_file, &params, 1);
-+    if (ret) {
-+        WIFI_ENTRY_EXIT_DEBUG("Inside %s: wifi_hostapdWrite() return %d\n"
-+                ,__func__, ret);
-+    }
-+
-+    ret = wifi_hostapdProcessUpdate(radioIndex, &params, 1);
-+    if (ret) {
-+        WIFI_ENTRY_EXIT_DEBUG("Inside %s: wifi_hostapdProcessUpdate() return %d\n"
-+                ,__func__, ret);
-+    }
-+    wifi_reloadAp(radioIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0002-patch-HAL-refactor-wifi_getRadioChannel.patch b/recipes-ccsp/hal/hal-wifi-patches/0002-patch-HAL-refactor-wifi_getRadioChannel.patch
deleted file mode 100644
index 89e9eef..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0002-patch-HAL-refactor-wifi_getRadioChannel.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 22612dd89f434aac2383f0601e3a5d921896eb11 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 23 Feb 2022 11:40:41 +0800
-Subject: [PATCH 02/18] [patch] HAL: refactor wifi_getRadioChannel()
-
-Change-Id: Idf011ea57255837f1cdd1ee62ef3dc9d391090d0
----
- source/wifi/wifi_hal.c | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 14452dd4..19f7508c 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -29,7 +29,7 @@ Copyright (c) 2007        Mike Kershaw
- Copyright (c) 2008-2009        Luis R. Rodriguez
- Licensed under the ISC license
- */
--
-+#define MTK_IMPL
- #define HAL_NETLINK_IMPL
- 
- #include <stdio.h>
-@@ -1593,6 +1593,12 @@ INT wifi_getRadioChannelsInUse(INT radioIndex, CHAR *output_string)	//RDKB
- //Get the running channel number 
- INT wifi_getRadioChannel(INT radioIndex,ULONG *output_ulong)	//RDKB
- {
-+#ifdef MTK_IMPL
-+    if(!wifi_getApChannel(radioIndex, output_ulong))
-+        return RETURN_OK;
-+    else
-+        return RETURN_ERR;
-+#else
-     char cmd[1024] = {0}, buf[5] = {0};
-     char interface_name[50] = {0};
- 
-@@ -1613,6 +1619,7 @@ INT wifi_getRadioChannel(INT radioIndex,ULONG *output_ulong)	//RDKB
- 
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
-+#endif
- }
- 
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0003-patch-HAL-implement-wifi_reset.patch b/recipes-ccsp/hal/hal-wifi-patches/0003-patch-HAL-implement-wifi_reset.patch
deleted file mode 100644
index 01512c6..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0003-patch-HAL-implement-wifi_reset.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 0d63e3eeb35f082a51f03517ad2dcff2609c5a4f Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 23 Feb 2022 14:33:12 +0800
-Subject: [PATCH 03/18] [patch] HAL: implement wifi_reset()
-
-Change-Id: I8e969e2f167c96852c02374b463bf9567de40365
----
- source/wifi/wifi_hal.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 19f7508c..be9d4f67 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -848,6 +848,10 @@ INT wifi_init()                            //RDKB
- INT wifi_reset()
- {
-     //TODO: resets the wifi subsystem, deletes all APs
-+    system("systemctl stop hostapd.service");
-+    sleep(2);
-+    system("systemctl start hostapd.service");
-+    sleep(5);
-     return RETURN_OK;
- }
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0005-patch-HAL-implement-wifi_down.patch b/recipes-ccsp/hal/hal-wifi-patches/0005-patch-HAL-implement-wifi_down.patch
deleted file mode 100644
index bbab9ce..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0005-patch-HAL-implement-wifi_down.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From c838f621e562f77ef9e659c317951540410a0741 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 2 Mar 2022 15:43:20 +0800
-Subject: [PATCH 05/18] [patch] HAL: implement wifi_down()
-
-Change-Id: I578a2afd5aa6c9b7fe2ad3c114d62bbfe800ac1c
----
- source/wifi/wifi_hal.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index ed26dbff..187de56c 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -877,6 +877,8 @@ INT wifi_reset()
- INT wifi_down()
- {
-     //TODO: turns off transmit power for the entire Wifi subsystem, for all radios
-+    system("systemctl stop hostapd.service");
-+    sleep(2);
-     return RETURN_OK;
- }
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0006-patch-HAL-implement-wifi_getApSecurityMFPConfig.patch b/recipes-ccsp/hal/hal-wifi-patches/0006-patch-HAL-implement-wifi_getApSecurityMFPConfig.patch
deleted file mode 100644
index 1a8a51e..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0006-patch-HAL-implement-wifi_getApSecurityMFPConfig.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From de6ce6e2bffdd24772903f13161f1784fd739f09 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Fri, 4 Mar 2022 18:02:33 +0800
-Subject: [PATCH 06/18] [patch] HAL: implement wifi_getApSecurityMFPConfig()
-
-Change-Id: I778dfabf00408f75109e122742894acf82fff799
----
- source/wifi/wifi_hal.c | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 187de56c..090db60f 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -6187,6 +6187,29 @@ INT wifi_getApSecurityWpaRekeyInterval(INT apIndex, INT *output_int)
- //To-do
- INT wifi_getApSecurityMFPConfig(INT apIndex, CHAR *output_string)
- {
-+    char output[16]={'\0'};
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    if (!output_string)
-+        return RETURN_ERR;
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdRead(config_file, "ieee80211w", output, sizeof(output));
-+
-+    if (strlen(output) == 0)
-+        snprintf(output_string, 64, "Disabled");
-+    else if (strncmp(output, "0", 1) == 0)
-+        snprintf(output_string, 64, "Disabled");
-+    else if (strncmp(output, "1", 1) == 0)
-+        snprintf(output_string, 64, "Optional");
-+    else if (strncmp(output, "2", 1) == 0)
-+        snprintf(output_string, 64, "Required");
-+    else {
-+        wifi_dbg_printf("\n[%s]: Unexpected ieee80211w=%s", __func__, output);
-+        return RETURN_ERR;
-+    }
-+
-+    wifi_dbg_printf("\n[%s]: ieee80211w is : %s", __func__, output);
-     return RETURN_OK;
- }
- INT wifi_setApSecurityMFPConfig(INT apIndex, CHAR *MfpConfig)
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0007-patch-HAL-implement-wifi_setApSecurityMFPConfig.patch b/recipes-ccsp/hal/hal-wifi-patches/0007-patch-HAL-implement-wifi_setApSecurityMFPConfig.patch
deleted file mode 100644
index 17dad1f..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0007-patch-HAL-implement-wifi_setApSecurityMFPConfig.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From a99b5bf7bcae0aa2d2f161cd28ef0f34c52b31ad Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 7 Mar 2022 10:50:32 +0800
-Subject: [PATCH 07/18] [patch] HAL: implement wifi_setApSecurityMFPConfig()
-
-Change-Id: If05c3550c2f9a152cfea2b8323c6c23973a881ca
----
- source/wifi/wifi_hal.c | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 090db60f..4f54626b 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -6214,6 +6214,29 @@ INT wifi_getApSecurityMFPConfig(INT apIndex, CHAR *output_string)
- }
- INT wifi_setApSecurityMFPConfig(INT apIndex, CHAR *MfpConfig)
- {
-+    char str[MAX_BUF_SIZE]={'\0'};
-+    char cmd[MAX_CMD_SIZE]={'\0'};
-+    struct params params;
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(NULL == MfpConfig || strlen(MfpConfig) >= 32 )
-+        return RETURN_ERR;
-+
-+    params.name = "ieee80211w";
-+    if (strncmp(MfpConfig, "Disabled", strlen("Disabled")) == 0)
-+        params.value = "0";
-+    else if (strncmp(MfpConfig, "Optional", strlen("Optional")) == 0)
-+        params.value = "1";
-+    else if (strncmp(MfpConfig, "Required", strlen("Required")) == 0)
-+        params.value = "2";
-+    else{
-+        wifi_dbg_printf("%s: invalid MfpConfig. Input has to be Disabled, Optional or Required \n", __func__);
-+        return RETURN_ERR;
-+    }
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n", __func__, __LINE__);
-     return RETURN_OK;
- }
- INT wifi_getRadioAutoChannelEnable(INT radioIndex, BOOL *output_bool)
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0008-patch-HAL-implement-ApMaxAssociatedDevice-and-WaterM.patch b/recipes-ccsp/hal/hal-wifi-patches/0008-patch-HAL-implement-ApMaxAssociatedDevice-and-WaterM.patch
deleted file mode 100644
index 4891c35..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0008-patch-HAL-implement-ApMaxAssociatedDevice-and-WaterM.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From 3a8aee661b87ff9bd9f4d8c38334d74b947e75bb Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 7 Mar 2022 17:48:02 +0800
-Subject: [PATCH 08/18] [patch] HAL: implement ApMaxAssociatedDevice() and
- WaterMarkThreshold()
-
-Change-Id: Ieae8fb5003b01eb4a13471c7f2a2d788dcf981a8
----
- source/wifi/wifi_hal.c | 57 +++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 54 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 4f54626b..3ddbc802 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -93,6 +93,7 @@ Licensed under the ISC license
- 
- #define MAX_BUF_SIZE 128
- #define MAX_CMD_SIZE 1024
-+#define MAX_ASSOCIATED_STA_NUM 2007
- 
- //Uncomment to enable debug logs
- //#define WIFI_DEBUG
-@@ -4536,14 +4537,60 @@ INT wifi_getApMaxAssociatedDevices(INT apIndex, UINT *output_uint)
-     //get the running status from driver
-     if(!output_uint)
-         return RETURN_ERR;
--    *output_uint = 5;
-+
-+    char output[16]={'\0'};
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdRead(config_file, "max_num_sta", output, sizeof(output));
-+    if (strlen(output) == 0) *output_uint = MAX_ASSOCIATED_STA_NUM;
-+    else {
-+        int device_num = atoi(output);
-+        if (device_num > MAX_ASSOCIATED_STA_NUM || device_num < 0) {
-+            wifi_dbg_printf("\n[%s]: get max_num_sta error: %d", __func__, device_num);
-+            return RETURN_ERR;
-+        }
-+        else {
-+            *output_uint = device_num;
-+        }
-+    }
-+
-     return RETURN_OK;
- }
- 
- INT wifi_setApMaxAssociatedDevices(INT apIndex, UINT number)
- {
-     //store to wifi config, apply instantly
--    return RETURN_ERR;
-+    char str[MAX_BUF_SIZE]={'\0'};
-+    char cmd[MAX_CMD_SIZE]={'\0'};
-+    struct params params;
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (number > MAX_ASSOCIATED_STA_NUM || number < 0) {
-+        WIFI_ENTRY_EXIT_DEBUG("%s: Invalid input\n",__func__);
-+        return RETURN_ERR;
-+    }
-+    sprintf(str, "%d", number);
-+    params.name = "max_num_sta";
-+    params.value = str;
-+
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX, apIndex);
-+    int ret = wifi_hostapdWrite(config_file, &params, 1);
-+    if (ret) {
-+        WIFI_ENTRY_EXIT_DEBUG("Inside %s: wifi_hostapdWrite() return %d\n"
-+                ,__func__, ret);
-+    }
-+
-+    ret = wifi_hostapdProcessUpdate(apIndex, &params, 1);
-+    if (ret) {
-+        WIFI_ENTRY_EXIT_DEBUG("Inside %s: wifi_hostapdProcessUpdate() return %d\n"
-+                ,__func__, ret);
-+    }
-+    wifi_reloadAp(apIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
- }
- 
- //The HighWatermarkThreshold value that is lesser than or equal to MaxAssociatedDevices. Setting this parameter does not actually limit the number of clients that can associate with this access point as that is controlled by MaxAssociatedDevices.	MaxAssociatedDevices or 50. The default value of this parameter should be equal to MaxAssociatedDevices. In case MaxAssociatedDevices is 0 (zero), the default value of this parameter should be 50. A value of 0 means that there is no specific limit and Watermark calculation algorithm should be turned off.
-@@ -4552,13 +4599,17 @@ INT wifi_getApAssociatedDevicesHighWatermarkThreshold(INT apIndex, UINT *output_
-     //get the current threshold
-     if(!output_uint)
-         return RETURN_ERR;
--    *output_uint = 50;
-+    wifi_getApMaxAssociatedDevices(apIndex, output_uint);
-+    if (*output_uint == 0)
-+        *output_uint = 50;
-     return RETURN_OK;
- }
- 
- INT wifi_setApAssociatedDevicesHighWatermarkThreshold(INT apIndex, UINT Threshold)
- {
-     //store the config, reset threshold, reset AssociatedDevicesHighWatermarkThresholdReached, reset AssociatedDevicesHighWatermarkDate to current time
-+    if (!wifi_setApMaxAssociatedDevices(apIndex, Threshold))
-+        return RETURN_OK;
-     return RETURN_ERR;
- }
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0009-patch-HAL-implement-wifi_getApWmmUapsdEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0009-patch-HAL-implement-wifi_getApWmmUapsdEnable.patch
deleted file mode 100644
index 2319aeb..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0009-patch-HAL-implement-wifi_getApWmmUapsdEnable.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 5e446b7ed3ee1040ccacc90747f69879fec5f4d6 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 7 Mar 2022 19:11:24 +0800
-Subject: [PATCH 09/18] [patch] HAL: implement wifi_getApWmmUapsdEnable()
-
-Change-Id: I4127956b14d984dc8470d66423f4b7560e48708f
----
- source/wifi/wifi_hal.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 3ddbc802..680b4283 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4513,7 +4513,17 @@ INT wifi_getApWmmUapsdEnable(INT apIndex, BOOL *output)
-     //get the running status from driver
-     if(!output)
-         return RETURN_ERR;
--    *output=TRUE;
-+
-+    char config_file[MAX_BUF_SIZE] = {0};
-+    char buf[16] = {0};
-+
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,apIndex);
-+    wifi_hostapdRead(config_file, "uapsd_advertisement_enabled", buf, sizeof(buf));
-+    if (strncmp("1",buf,1) == 0)
-+        *output = TRUE;
-+    else
-+        *output = FALSE;
-+
-     return RETURN_OK;
- }
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0010-patch-HAL-implement-wifi_getApWmmEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0010-patch-HAL-implement-wifi_getApWmmEnable.patch
deleted file mode 100644
index a901c8f..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0010-patch-HAL-implement-wifi_getApWmmEnable.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 22017539d25420018d654e8f92ae517eacb08335 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 7 Mar 2022 19:12:13 +0800
-Subject: [PATCH 10/18] [patch] HAL: implement wifi_getApWmmEnable()
-
-Change-Id: I5baf1c0402fac4795ff52e58bce8be92b9fbf13d
----
- source/wifi/wifi_hal.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 680b4283..4e220ed6 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4496,7 +4496,17 @@ INT wifi_getApWmmEnable(INT apIndex, BOOL *output)
-     //get the running status from driver
-     if(!output)
-         return RETURN_ERR;
--    *output=TRUE;
-+
-+    char config_file[MAX_BUF_SIZE] = {0};
-+    char buf[16] = {0};
-+
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,apIndex);
-+    wifi_hostapdRead(config_file, "wmm_enabled", buf, sizeof(buf));
-+    if (strncmp("1",buf,1) == 0)
-+        *output = TRUE;
-+    else
-+        *output = FALSE;
-+
-     return RETURN_OK;
- }
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0011-patch-HAL-implement-wifi_setApWmmEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0011-patch-HAL-implement-wifi_setApWmmEnable.patch
deleted file mode 100644
index 7e6d7c8..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0011-patch-HAL-implement-wifi_setApWmmEnable.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From bd22b8ef61e88e1e379925aecb6224bc3cd43963 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 7 Mar 2022 19:17:56 +0800
-Subject: [PATCH 11/18] [patch] HAL: implement wifi_setApWmmEnable()
-
-Change-Id: Ifee29de1c42ef26528d26996937db7c959d8fd06
----
- source/wifi/wifi_hal.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 4e220ed6..62350c1b 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4514,7 +4514,20 @@ INT wifi_getApWmmEnable(INT apIndex, BOOL *output)
- INT wifi_setApWmmEnable(INT apIndex, BOOL enable)
- {
-     //Save config and apply instantly.
--    return RETURN_ERR;
-+    char config_file[MAX_BUF_SIZE] = {0};
-+    struct params list;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    list.name = "wmm_enabled";
-+    list.value = enable?"1":"0";
-+
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,apIndex);
-+    wifi_hostapdWrite(config_file, &list, 1);
-+    wifi_hostapdProcessUpdate(apIndex, &list, 1);
-+    wifi_reloadAp(apIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
- }
- 
- //Whether U-APSD support is currently enabled. When enabled, this is indicated in beacon frames. Note: U-APSD can only be enabled if WMM is also enabled.
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0012-patch-HAL-implement-wifi_setApWmmUapsdEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0012-patch-HAL-implement-wifi_setApWmmUapsdEnable.patch
deleted file mode 100644
index bdb7ac5..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0012-patch-HAL-implement-wifi_setApWmmUapsdEnable.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 10e72bb7444664bfcd111713bfbfe2701772c8d5 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 7 Mar 2022 19:18:56 +0800
-Subject: [PATCH 12/18] [patch] HAL: implement wifi_setApWmmUapsdEnable()
-
-Change-Id: I9d3d86f06d9b276ca3624e3679356aa6da3ea591
----
- source/wifi/wifi_hal.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 62350c1b..cb5c6109 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4554,7 +4554,20 @@ INT wifi_getApWmmUapsdEnable(INT apIndex, BOOL *output)
- INT wifi_setApWmmUapsdEnable(INT apIndex, BOOL enable)
- {
-     //save config and apply instantly.
--    return RETURN_ERR;
-+    char config_file[MAX_BUF_SIZE] = {0};
-+    struct params list;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    list.name = "uapsd_advertisement_enabled";
-+    list.value = enable?"1":"0";
-+
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,apIndex);
-+    wifi_hostapdWrite(config_file, &list, 1);
-+    wifi_hostapdProcessUpdate(apIndex, &list, 1);
-+    wifi_reloadAp(apIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
- }
- 
- // Sets the WMM ACK polity on the hardware. AckPolicy false means do not acknowledge, true means acknowledge
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0013-patch-HAL-implement-wifi_getProxyArp.patch b/recipes-ccsp/hal/hal-wifi-patches/0013-patch-HAL-implement-wifi_getProxyArp.patch
deleted file mode 100644
index f687b02..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0013-patch-HAL-implement-wifi_getProxyArp.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 3d2602233dc6190f9627fe48beb6ed05b5546783 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Tue, 8 Mar 2022 16:33:44 +0800
-Subject: [PATCH 13/18] [patch] HAL: implement wifi_getProxyArp()
-
-Change-Id: I9e1d04eac09fe7ae1d43600a6c8549feb0ea7858
----
- source/wifi/wifi_hal.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index cb5c6109..f10e16ab 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -8957,3 +8957,25 @@ INT wifi_getApAssociatedDevice(INT ap_index, CHAR *output_buf, INT output_buf_si
-      return RETURN_OK;
- }
- #endif
-+
-+INT wifi_getProxyArp(INT apIndex, BOOL *enable)
-+{
-+    char output[16]={'\0'};
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    if (!enable)
-+        return RETURN_ERR;
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdRead(config_file, "proxy_arp", output, sizeof(output));
-+
-+    if (strlen(output) == 0)
-+        *enable = FALSE;
-+    else if (strncmp(output, "1", 1) == 0)
-+        *enable = TRUE;
-+    else
-+        *enable = FALSE;
-+
-+    wifi_dbg_printf("\n[%s]: proxy_arp is : %s", __func__, output);
-+    return RETURN_OK;
-+}
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0014-PATCH-HAL-Specify-MTK-driver.patch b/recipes-ccsp/hal/hal-wifi-patches/0014-PATCH-HAL-Specify-MTK-driver.patch
deleted file mode 100644
index bf00326..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0014-PATCH-HAL-Specify-MTK-driver.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From cc12618b6c8ba2fb49209f87feadf33f45d766c7 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 16 Mar 2022 15:31:36 +0800
-Subject: [PATCH 14/18] [PATCH] HAL: Specify MTK driver
-
-Change-Id: Icdafb2cca3bbf5cbe5378f656590fc4261aebec0
----
- source/wifi/wifi_hal.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index f10e16ab..533226b5 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -65,8 +65,13 @@ Licensed under the ISC license
- //#define ACL_PREFIX "/tmp/wifi_acl_list" //RDKB convention
- #define SOCK_PREFIX "/var/run/hostapd/wifi"
- #define VAP_STATUS_FILE "/tmp/vap-status"
-+#ifdef MTK_IMPL
-+#define DRIVER_2GHZ "mt7915e"
-+#define DRIVER_5GHZ "mt7915e"
-+#else
- #define DRIVER_2GHZ "ath9k"
- #define DRIVER_5GHZ "ath10k_pci"
-+#endif
- 
- /*
-    MAX_APS - Number of all AP available in system
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0015-patch-HAL-refactor-wifi_getApMacAddressControlMode.patch b/recipes-ccsp/hal/hal-wifi-patches/0015-patch-HAL-refactor-wifi_getApMacAddressControlMode.patch
deleted file mode 100644
index 31fa49c..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0015-patch-HAL-refactor-wifi_getApMacAddressControlMode.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 522c439c6253be13a508464bb9e9676a057c09f1 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 14 Mar 2022 19:06:29 +0800
-Subject: [PATCH 15/18] [patch] HAL: refactor wifi_getApMacAddressControlMode()
-
-Change-Id: I612e055e60ef9a48f2f7d719cb9baf486644b5be
----
- source/wifi/wifi_hal.c | 19 ++++++++++++++++++-
- 1 file changed, 18 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 533226b5..05413f5e 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -6736,7 +6736,24 @@ INT wifi_getApMacAddressControlMode(INT apIndex, INT *output_filterMode)
-     //_syscmd(cmd, buf, sizeof(buf));
-     sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
-     wifi_hostapdRead(config_file, "macaddr_acl", buf, sizeof(buf));
--    *output_filterMode = atoi(buf);
-+    if(strlen(buf) == 0) {
-+        *output_filterMode = 0;
-+    }
-+    else {
-+        int macaddr_acl_mode = atoi(buf);
-+        if (macaddr_acl_mode == 1) {
-+            *output_filterMode = 1;
-+        } else if (macaddr_acl_mode == 0) {
-+            wifi_hostapdRead(config_file, "deny_mac_file", buf, sizeof(buf));
-+            if (strlen(buf) == 0) {
-+                *output_filterMode = 0;
-+            } else {
-+                *output_filterMode = 2;
-+            }
-+        } else {
-+            return RETURN_ERR;
-+        }
-+    }
- 
-     return RETURN_OK;
- }
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0016-PATCH-HAL-refactor-wifi_setApMacAddressControlMode.patch b/recipes-ccsp/hal/hal-wifi-patches/0016-PATCH-HAL-refactor-wifi_setApMacAddressControlMode.patch
deleted file mode 100644
index 98f23c9..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0016-PATCH-HAL-refactor-wifi_setApMacAddressControlMode.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 5175e19e0a628baff0aad73d2397e9a23bc3dc7d Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 14 Mar 2022 19:40:08 +0800
-Subject: [PATCH] HAL: refactor wifi_setApMacAddressControlMode()
-
-Change-Id: Ia9bdb3b6ac683a8634bd726b6d472eb133d258d0
----
- source/wifi/wifi_hal.c | 31 ++++++++++++++++++++++++++++---
- 1 file changed, 28 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 5f5ac68..0ed1e85 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -68,6 +68,7 @@ Licensed under the ISC license
- #define IF_NAME_SIZE 50
- #define CONFIG_PREFIX "/nvram/hostapd"
- #define ACL_PREFIX "/tmp/hostapd-acl"
-+#define DENY_PREFIX "/tmp/hostapd-deny"
- //#define ACL_PREFIX "/tmp/wifi_acl_list" //RDKB convention
- #define SOCK_PREFIX "/var/run/hostapd/wifi"
- #define VAP_STATUS_FILE "/tmp/vap-status"
-@@ -4308,17 +4309,41 @@ INT wifi_setApMacAddressControlMode(INT apIndex, INT filterMode)
-     struct params list[2];
-     char buf[MAX_BUF_SIZE] = {0};
-     char config_file[MAX_BUF_SIZE] = {0}, acl_file[MAX_BUF_SIZE] = {0};
-+    char deny_file[MAX_BUF_SIZE] = {0};
- 
-     list[0].name = "macaddr_acl";
--    sprintf(buf, "%d", filterMode);
--    list[0].value = buf ;
- 
--    if (filterMode == 1 || filterMode == 2) {//TODO: check for filterMode(2)
-+    if (filterMode == 0) {
-+        sprintf(buf, "%d", 0);
-+        list[0].value = buf;
-+
-+        char cmd[128], rtn[128];
-+        snprintf(cmd, sizeof(cmd), "hostapd_cli -i %s%d deny_acl CLEAR", AP_PREFIX, apIndex);
-+        _syscmd(cmd, rtn, sizeof(rtn));
-+        memset(cmd,0,sizeof(cmd));
-+        // Delete deny_mac_file in hostapd configuration
-+        snprintf(cmd, sizeof(cmd), "sed -i '/deny_mac_file=/d' %s%d.conf ", CONFIG_PREFIX, apIndex);
-+        _syscmd(cmd, rtn, sizeof(rtn));
-+    }
-+    else if (filterMode == 1) {
-+        sprintf(buf, "%d", filterMode);
-+        list[0].value = buf;
-         sprintf(acl_file,"%s%d",ACL_PREFIX,apIndex);
-         list[1].name = "accept_mac_file";
-         list[1].value = acl_file;
-         items = 2;
-+    } else if (filterMode == 2) {
-+        //TODO: deny_mac_file
-+        sprintf(buf, "%d", 0);
-+        list[0].value = buf;
-+        list[1].name = "deny_mac_file";
-+        sprintf(deny_file,"%s%d", DENY_PREFIX,apIndex);
-+        list[1].value = deny_file;
-+        items = 2;
-+    } else {
-+        return RETURN_ERR;
-     }
-+
-     sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,apIndex);
-     wifi_hostapdWrite(config_file, list, items);
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0017-PATCH-HAL-refactor-wifi_setApSsidAdvertisementEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0017-PATCH-HAL-refactor-wifi_setApSsidAdvertisementEnable.patch
deleted file mode 100644
index 055943a..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0017-PATCH-HAL-refactor-wifi_setApSsidAdvertisementEnable.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From df5ff0159878e1b71cb6c2e223226cf7b5644a3a Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Mon, 14 Mar 2022 20:43:14 +0800
-Subject: [PATCH 17/18] [PATCH] HAL: refactor
- wifi_setApSsidAdvertisementEnable()
-
-Change-Id: I5d17d443e0763b6728561548117c8a5b047ed882
----
- source/wifi/wifi_hal.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 6be09577..e44a9d02 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4481,6 +4481,7 @@ INT wifi_setApSsidAdvertisementEnable(INT apIndex, BOOL enable)
-     wifi_hostapdWrite(config_file, &list, 1);
-     wifi_hostapdProcessUpdate(apIndex, &list, 1);
-     //TODO: call hostapd_cli for dynamic_config_control
-+    wifi_reloadAp(apIndex);
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- 
-     return RETURN_OK;
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0018-patch-HAL-enhance-wifi_getApWpsConfigurationState.patch b/recipes-ccsp/hal/hal-wifi-patches/0018-patch-HAL-enhance-wifi_getApWpsConfigurationState.patch
deleted file mode 100644
index c50a2ac..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0018-patch-HAL-enhance-wifi_getApWpsConfigurationState.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 969e24609034a30bb45321e3098ac7ed49d9ca6c Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 23 Feb 2022 11:27:47 +0800
-Subject: [PATCH 18/18] [patch] HAL: enhance wifi_getApWpsConfigurationState()
-
-Change-Id: Ibecd442a3884d6b4f17b623ee5c696d04a7b9754
----
- source/wifi/wifi_hal.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index e44a9d02..13af7e36 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -5181,7 +5181,7 @@ INT wifi_getApWpsConfigurationState(INT apIndex, CHAR *output_string)
-     snprintf(cmd, sizeof(cmd), "hostapd_cli -i %s%d get_config | grep wps_state | cut -d'=' -f2", AP_PREFIX, apIndex);
-     _syscmd(cmd, buf, sizeof(buf));
- 
--    if(!strcmp(buf, "configured"))
-+    if(!strncmp(buf, "configured", 10))
-         snprintf(output_string, 32, "Configured");
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- 
--- 
-2.29.2
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0019-patch-HAL-refactor-wifi_getRadioEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0019-patch-HAL-refactor-wifi_getRadioEnable.patch
deleted file mode 100644
index e2a4720..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0019-patch-HAL-refactor-wifi_getRadioEnable.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 801018bbcf3427713997b1ead85fec6c9acaf2bb Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 6 Apr 2022 09:20:37 +0800
-Subject: [PATCH] HAL: refactor wifi_getRadioEnable()
-
----
- source/wifi/wifi_hal.c | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 1d07d19..c753d99 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -1025,13 +1025,18 @@ INT wifi_getRadioEnable(INT radioIndex, BOOL *output_bool)      //RDKB
- 
-     snprintf(interface_path, sizeof(interface_path), "/sys/class/net/%s%d/address", RADIO_PREFIX, radioIndex);
-     fp = fopen(interface_path, "r");
--    if(fp)
-+    if(!fp)
-     {
--        *output_bool = TRUE;
--        fclose(fp);
-+		return RETURN_OK;
-     }
-     //TODO: check if hostapd with config is running
-+	char buf[MAX_BUF_SIZE] = {0}, cmd[MAX_CMD_SIZE] = {0};
-+	sprintf(cmd, "hostapd_cli -i %s%d status | grep state | cut -d '=' -f2", AP_PREFIX, radioIndex);
-+	_syscmd(cmd, buf, sizeof(buf));
- 
-+	if(!strncmp(buf, "ENABLED", 7))
-+		*output_bool = TRUE;
-+	fclose(fp);
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0020-HAL-add-wifi_getApDenyAclDevics-and-refactor-wifi_ki.patch b/recipes-ccsp/hal/hal-wifi-patches/0020-HAL-add-wifi_getApDenyAclDevics-and-refactor-wifi_ki.patch
deleted file mode 100644
index 9990695..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0020-HAL-add-wifi_getApDenyAclDevics-and-refactor-wifi_ki.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From b0ea47cacafdc1aa512afd04129a23267d7d3533 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 6 Apr 2022 16:34:31 +0800
-Subject: [PATCH 1/2] HAL: add wifi_getApDenyAclDevics() and refactor
- wifi_kickApAclAssociatedDevices()
-
-According to the description of wifi_kickApAclAssociatedDevice(), wifi_kickApAclAssociatedDevices()
-have to kicks the devices written in the deny mac lsit. But current Implementation
-kicks the devices in the accept list. This commit is created to refactor this API.
----
- source/wifi/wifi_hal.c | 26 +++++++++++++++++---------
- 1 file changed, 17 insertions(+), 9 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index c753d99..6427a43 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4068,6 +4068,20 @@ INT wifi_getApAclDevices(INT apIndex, CHAR *macArray, UINT buf_size)
-     return RETURN_OK;
- }
- 
-+INT wifi_getApDenyAclDevices(INT apIndex, CHAR *macArray, UINT buf_size)
-+{
-+    char cmd[MAX_CMD_SIZE]={'\0'};
-+    int ret = 0;
-+
-+    sprintf(cmd, "hostapd_cli -i %s%d deny_acl SHOW | awk '{print $1}'", AP_PREFIX,apIndex);
-+    ret = _syscmd(cmd,macArray,buf_size);
-+    if (ret != 0)
-+        return RETURN_ERR;
-+
-+    return RETURN_OK;
-+}
-+
-+
- // Get the list of stations associated per AP
- INT wifi_getApDevicesAssociated(INT apIndex, CHAR *macArray, UINT buf_size)
- {
-@@ -4159,7 +4173,7 @@ INT wifi_kickApAclAssociatedDevices(INT apIndex, BOOL enable)
-     char aclArray[512] = {0}, *acl = NULL;
-     char assocArray[512] = {0}, *asso = NULL;
- 
--    wifi_getApAclDevices(apIndex, aclArray, sizeof(aclArray));
-+    wifi_getApDenyAclDevices(apIndex, aclArray, sizeof(aclArray));
-     wifi_getApDevicesAssociated(apIndex, assocArray, sizeof(assocArray));
- 
-     // if there are no devices connected there is nothing to do
-@@ -4176,17 +4190,11 @@ INT wifi_kickApAclAssociatedDevices(INT apIndex, BOOL enable)
- 
-             acl = strtok(NULL, "\r\n");
-         }
-+		wifi_setApMacAddressControlMode(apIndex, 2);
-     }
-     else
-     {
--        //kick off the MAC which is not in ACL array (allow list)
--        asso = strtok(assocArray, "\r\n");
--        while (asso != NULL) {
--            if (strlen(asso) >= 17 && !strcasestr(aclArray, asso))
--                wifi_kickApAssociatedDevice(apIndex, asso);
--
--            asso = strtok(NULL, "\r\n");
--        }
-+		wifi_setApMacAddressControlMode(apIndex, 0);
-     }
- 
- #if 0
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0021-HAL-add-wifi_getRadioStatsEnable.patch b/recipes-ccsp/hal/hal-wifi-patches/0021-HAL-add-wifi_getRadioStatsEnable.patch
deleted file mode 100644
index 4f70998..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0021-HAL-add-wifi_getRadioStatsEnable.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d8375d65c9a32bef94c44f8ec4fc689aaebc70d5 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Fri, 8 Apr 2022 14:37:43 +0800
-Subject: [PATCH] HAL: add wifi_getRadioStatsEnable()
-
----
- source/wifi/wifi_hal.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 2e60367..a70ff15 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -9652,3 +9652,11 @@ INT wifi_getProxyArp(INT apIndex, BOOL *enable)
-     wifi_dbg_printf("\n[%s]: proxy_arp is : %s", __func__, output);
-     return RETURN_OK;
- }
-+
-+INT wifi_getRadioStatsEnable(INT radioIndex, BOOL *output_enable)
-+{
-+    if (NULL == output_enable || !(radioIndex==0 || radioIndex==1))
-+        return RETURN_ERR;
-+    *output_enable=TRUE;
-+    return RETURN_OK;
-+}
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0023-HAL-refactor-wifi_setRadioGuardInterval-and-wifi_get.patch b/recipes-ccsp/hal/hal-wifi-patches/0023-HAL-refactor-wifi_setRadioGuardInterval-and-wifi_get.patch
deleted file mode 100644
index c772b95..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0023-HAL-refactor-wifi_setRadioGuardInterval-and-wifi_get.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From f0445f4769576791d5085f3db54411afacd5f755 Mon Sep 17 00:00:00 2001
-From: "howard.hsu" <howard-yh.hsu@mediatek.com>
-Date: Wed, 13 Apr 2022 19:43:53 +0800
-Subject: [PATCH] HAL: refactor wifi_setRadioGuardInterval() and
- wifi_getRadioGuardInterval()
-
----
- source/wifi/wifi_hal.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index f4ee248..e5b551f 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2169,7 +2169,7 @@ INT wifi_getRadioGuardInterval(INT radioIndex, CHAR *output_string)	//Tr181
-     //save config and apply instantly
-     if (NULL == output_string)
-         return RETURN_ERR;
--    snprintf(output_string, 64, (radioIndex == 0) ? "400nsec" : "400nsec");
-+    snprintf(output_string, 64, "Auto");
- 
-     return RETURN_OK;
- }
-@@ -2178,7 +2178,7 @@ INT wifi_getRadioGuardInterval(INT radioIndex, CHAR *output_string)	//Tr181
- INT wifi_setRadioGuardInterval(INT radioIndex, CHAR *string)	//Tr181
- {
-     //Apply setting instantly
--    return RETURN_ERR;
-+    return RETURN_OK;
- }
- 
- //Get the Modulation Coding Scheme index, eg: "-1", "1", "15"
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0024-HAL-refactor-wifi_factoryResetRadio.patch b/recipes-ccsp/hal/hal-wifi-patches/0024-HAL-refactor-wifi_factoryResetRadio.patch
deleted file mode 100644
index 953123b..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0024-HAL-refactor-wifi_factoryResetRadio.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From fe9452e2d7c27c7ae680b32a4db9f92f90d4ca4b Mon Sep 17 00:00:00 2001
-From: Allen Ye <allen.ye@mediatek.com>
-Date: Thu, 14 Apr 2022 19:10:15 +0800
-Subject: [PATCH] HAL: refactor wifi_factoryResetRadio()
-
----
- source/wifi/wifi_hal.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index bfa7b01..8b302d5 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -726,15 +726,17 @@ INT wifi_factoryResetRadios()
- */
- INT wifi_factoryResetRadio(int radioIndex) 	//RDKB
- {
-+    system("systemctl stop hostapd.service");
-+
-     WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-     if(radioIndex == 0)
--        system("cp /etc/hostapd-2G.conf /nvram/hostapd0.conf");
-+        system("rm /nvram/hostapd0.conf");
-     else if(radioIndex == 1)
--        system("cp /etc/hostapd-5G.conf /nvram/hostapd1.conf");
-+        system("rm /nvram/hostapd1.conf");
-     else
-          return RETURN_ERR;
- 
--    system("systemctl restart hostapd.service");
-+    system("systemctl start hostapd.service");
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0026-HAL-refactor-RadioIEEE80211hEnabled-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0026-HAL-refactor-RadioIEEE80211hEnabled-function.patch
deleted file mode 100644
index 3ab8442..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0026-HAL-refactor-RadioIEEE80211hEnabled-function.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 3efd6b24e39dd13b0fbbbd97d7be129df438d0de Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Mon, 23 May 2022 15:15:31 +0800
-Subject: [PATCH] HAL: refactor RadioIEEE80211hEnabled function
-
----
- source/wifi/wifi_hal.c | 35 ++++++++++++++++++++++++++++++++---
- 1 file changed, 32 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index ea400bf..af7cb10 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2260,17 +2260,46 @@ INT wifi_getRadioIEEE80211hSupported(INT radioIndex, BOOL *Supported)  //Tr181
- //Get 80211h feature enable
- INT wifi_getRadioIEEE80211hEnabled(INT radioIndex, BOOL *enable) //Tr181
- {
--    if (NULL == enable)
-+    char cmd[MAX_BUF_SIZE]={'\0'};
-+    char buf[MAX_CMD_SIZE]={'\0'};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(enable == NULL)
-         return RETURN_ERR;
--    *enable = FALSE;
- 
-+    snprintf(cmd, sizeof(cmd),  "hostapd_cli -i %s%d status | grep ieee80211h | cut -d '=' -f2", AP_PREFIX, radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    if (strncmp(buf, "1", 1) == 0)
-+        *enable = true;
-+    else
-+        *enable = false;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
- //Set 80211h feature enable
- INT wifi_setRadioIEEE80211hEnabled(INT radioIndex, BOOL enable)  //Tr181
- {
--    return RETURN_ERR;
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    struct params params={'\0'};
-+    char config_file[MAX_BUF_SIZE] = {0};
-+
-+    params.name = "ieee80211h";
-+
-+    if (enable) {
-+        params.value = "1";
-+    } else {
-+        params.value = "0";
-+    }
-+
-+    sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,radioIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    
-+    wifi_hostapdProcessUpdate(radioIndex, &params, 1);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- //Indicates the Carrier Sense ranges supported by the radio. It is measured in dBm. Refer section A.2.3.2 of CableLabs Wi-Fi MGMT Specification.
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0027-HAL-refactor-wifi_getRadioPossibleChannels.patch b/recipes-ccsp/hal/hal-wifi-patches/0027-HAL-refactor-wifi_getRadioPossibleChannels.patch
deleted file mode 100644
index 7ffc662..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0027-HAL-refactor-wifi_getRadioPossibleChannels.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 404109f913afc751127ccba752b7dbba98e5ba8b Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Tue, 30 Aug 2022 18:34:17 +0800
-Subject: [PATCH 1/2] HAL: refactor wifi_getRadioPossibleChannels
-
----
- source/wifi/wifi_hal.c | 18 ++++++++++++++++--
- 1 file changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index d2f0c3b..d44eab0 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -1925,10 +1925,24 @@ INT wifi_setRadioMode(INT radioIndex, CHAR *channelMode, UINT pureMode)
- //The output_string is a max length 64 octet string that is allocated by the RDKB code.  Implementations must ensure that strings are not longer than this.
- INT wifi_getRadioPossibleChannels(INT radioIndex, CHAR *output_string)	//RDKB
- {
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-     if (NULL == output_string) 
-         return RETURN_ERR;
--    //TODO:read this from iw phy phyX info |grep MHz
--    snprintf(output_string, 64, (radioIndex == 0)?"1,2,3,4,5,6,7,8,9,10,11":"36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140");
-+    char cmd[256] = {0};
-+    char buf[128] = {0};
-+    BOOL dfs_enable = false;
-+    // Parse possible channel number and separate them with commas.
-+    wifi_getRadioDfsEnable(radioIndex, &dfs_enable);
-+    if (dfs_enable)
-+        snprintf(cmd, sizeof(cmd), "iw phy phy%d info | grep -e '\\*.*MHz .*dBm' | cut -d '[' -f2 | cut -d ']' -f1 | tr '\\n' ',' | sed 's/.$//'", radioIndex);
-+    else 
-+        snprintf(cmd, sizeof(cmd), "iw phy phy%d info | grep -e '\\*.*MHz .*dBm' | grep -v 'radar' | cut -d '[' -f2 | cut -d ']' -f1 | tr '\\n' ',' | sed 's/.$//'", radioIndex);
-+
-+    _syscmd(cmd,buf,sizeof(buf));
-+    strncpy(output_string, buf, sizeof(buf));
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- #if 0
-     char IFName[50] ={0};
-     char buf[MAX_BUF_SIZE] = {0};
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0028-HAL-refactor-wifi_acl-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0028-HAL-refactor-wifi_acl-function.patch
deleted file mode 100644
index 2b1474a..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0028-HAL-refactor-wifi_acl-function.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 4523c7caabe32b1d99ade410f7353371caeb471a Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 16 Jun 2022 17:29:02 +0800
-Subject: [PATCH] HAL: refactor wifi_acl function
-
----
- source/wifi/wifi_hal.c | 31 ++++++++++++++++++++-----------
- 1 file changed, 20 insertions(+), 11 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 98e5681..5cad1e7 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4181,10 +4181,20 @@ INT wifi_delApAclDevice(INT apIndex, CHAR *DeviceMacAddress)
- // outputs the number of devices in the filter list
- INT wifi_getApAclDeviceNum(INT apIndex, UINT *output_uint)
- {
--    if (NULL == output_uint)
-+    char cmd[MAX_BUF_SIZE]={0};
-+    char buf[MAX_CMD_SIZE]={0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(output_uint == NULL)
-         return RETURN_ERR;
--    *output_uint = 0;
--    return RETURN_ERR;
-+
-+    snprintf(cmd, sizeof(cmd), "cat %s%d | wc -l | tr -d '\\n'", ACL_PREFIX, apIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    *output_uint = atoi(buf);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- INT apply_rules(INT apIndex, CHAR *client_mac,CHAR *action,CHAR *interface)
-@@ -7722,15 +7732,14 @@ INT wifi_delApAclDevices(INT apIndex)
-     if(_syscmd(cmd,buf,sizeof(buf)))
-         return RETURN_ERR;
- #endif
--    char fname[100];
--    FILE *fp;
-+    char cmd[MAX_CMD_SIZE]={0};
-+    char buf[MAX_BUF_SIZE]={0};
- 
--    snprintf(fname, sizeof(fname), "%s%d", ACL_PREFIX, apIndex);
--    fp = fopen(fname, "w");
--    if (!fp) {
--            return RETURN_ERR;
--    }
--    fclose(fp);
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    sprintf(cmd, "rm %s%d 2>&1 && touch %s%d", ACL_PREFIX, apIndex, ACL_PREFIX, apIndex);
-+    if(_syscmd(cmd, buf, sizeof(buf)))
-+        return RETURN_ERR;
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- 
-     return RETURN_OK;
- }
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0029-HAL-refactor-beacon-period-interval-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0029-HAL-refactor-beacon-period-interval-function.patch
deleted file mode 100644
index 0a743d9..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0029-HAL-refactor-beacon-period-interval-function.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 9018c4fda0ef0dd03d20983311186a1a6788f899 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Fri, 17 Jun 2022 09:51:36 +0800
-Subject: [PATCH] HAL: refactor beacon period/interval function
-
----
- source/wifi/wifi_hal.c | 45 +++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 40 insertions(+), 5 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 5cad1e7..5c12139 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2344,16 +2344,38 @@ INT wifi_setRadioCarrierSenseThresholdInUse(INT radioIndex, INT threshold)	//P3
- //Time interval between transmitting beacons (expressed in milliseconds). This parameter is based ondot11BeaconPeriod from [802.11-2012].
- INT wifi_getRadioBeaconPeriod(INT radioIndex, UINT *output)
- {
--    if (NULL == output)
-+    char cmd[MAX_BUF_SIZE]={'\0'};
-+    char buf[MAX_CMD_SIZE]={'\0'};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(output == NULL)
-         return RETURN_ERR;
--    *output = 100;
- 
-+    snprintf(cmd, sizeof(cmd),  "hostapd_cli -i %s%d status | grep beacon_int | cut -d '=' -f2 | tr -d '\n'", AP_PREFIX, radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    *output = atoi(buf);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
-  
- INT wifi_setRadioBeaconPeriod(INT radioIndex, UINT BeaconPeriod)
- {
--    return RETURN_ERR;
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    struct params params={'\0'};
-+    char buf[MAX_BUF_SIZE] = {'\0'};
-+    char config_file[MAX_BUF_SIZE] = {'\0'};
-+
-+    params.name = "beacon_int";
-+    snprintf(buf, sizeof(buf), "%u", BeaconPeriod);
-+    params.value = buf;
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    
-+    wifi_hostapdProcessUpdate(radioIndex, &params, 1);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- //Comma-separated list of strings. The set of data rates, in Mbps, that have to be supported by all stations that desire to join this BSS. The stations have to be able to receive and transmit at each of the data rates listed inBasicDataTransmitRates. For example, a value of "1,2", indicates that stations support 1 Mbps and 2 Mbps. Most control packets use a data rate in BasicDataTransmitRates.
-@@ -3825,8 +3847,21 @@ INT wifi_setApBeaconType(INT apIndex, CHAR *beaconTypeString)
- // sets the beacon interval on the hardware for this AP
- INT wifi_setApBeaconInterval(INT apIndex, INT beaconInterval)
- {
--    //save config and apply instantly
--    return RETURN_ERR;
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    struct params params={'\0'};
-+    char buf[MAX_BUF_SIZE] = {'\0'};
-+    char config_file[MAX_BUF_SIZE] = {'\0'};
-+
-+    params.name = "beacon_int";
-+    snprintf(buf, sizeof(buf), "%u", beaconInterval);
-+    params.value = buf;
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    
-+    wifi_hostapdProcessUpdate(apIndex, &params, 1);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- INT wifi_setDTIMInterval(INT apIndex, INT dtimInterval)
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0030-HAL-refactor-setApDTIMInterval.patch b/recipes-ccsp/hal/hal-wifi-patches/0030-HAL-refactor-setApDTIMInterval.patch
deleted file mode 100644
index 1e1609a..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0030-HAL-refactor-setApDTIMInterval.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From c0c3e7efb51a66544b5b222c352cc6b43bb5368d Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Wed, 27 Jul 2022 17:46:24 +0800
-Subject: [PATCH] HAL: refactor setApDTIMInterval
-
----
- source/wifi/wifi_hal.c | 21 ++++++++++++++++++++-
- 1 file changed, 20 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 1365b11..6596cfc 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -1882,7 +1882,26 @@ INT wifi_setBandSteeringApGroup(char *ApGroup)
- 
- INT wifi_setApDTIMInterval(INT apIndex, INT dtimInterval)
- {
--   return RETURN_OK;
-+    struct params params={0};
-+    char config_file[MAX_BUF_SIZE] = {'\0'};
-+    char buf[MAX_BUF_SIZE] = {'\0'};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (dtimInterval < 1 || dtimInterval > 255) {
-+        return RETURN_ERR;
-+        WIFI_ENTRY_EXIT_DEBUG("Invalid dtimInterval: %d\n", dtimInterval);
-+    }
-+    
-+    params.name = "dtim_period";
-+    snprintf(buf, sizeof(buf), "%d", dtimInterval);
-+    params.value = buf;
-+
-+    sprintf(config_file,"%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    wifi_hostapdProcessUpdate(apIndex, &params, 1);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- //Check if the driver support the Dfs
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0031-HAL-refactor-set-and-get-Beacon-Rate-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0031-HAL-refactor-set-and-get-Beacon-Rate-function.patch
deleted file mode 100644
index 8156eb3..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0031-HAL-refactor-set-and-get-Beacon-Rate-function.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From c47c87b8412a219286e6f80cd8234aa506465be3 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 28 Jul 2022 10:52:36 +0800
-Subject: [PATCH] HAL: refactor set and get Beacon Rate function
-
----
- source/wifi/wifi_hal.c | 52 ++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 50 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 6596cfc..0e047fc 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -618,14 +618,62 @@ static int readBandWidth(int radioIndex,char *bw_value)
-     return RETURN_OK;
- }
- 
-+// Input must be "1Mbps"; "5.5Mbps"; "6Mbps"; "2Mbps"; "11Mbps"; "12Mbps"; "24Mbps"
- INT wifi_setApBeaconRate(INT radioIndex,CHAR *beaconRate)
- {
--    return 0;
-+    struct params params={'\0'};
-+    char config_file[MAX_BUF_SIZE] = {0};
-+    char buf[MAX_BUF_SIZE] = {'\0'};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (strlen (beaconRate) < 5)
-+        return RETURN_ERR;
-+    // Copy the numeric value
-+    strncpy(buf, beaconRate, strlen(beaconRate) - 4);
-+    buf[strlen(beaconRate) - 4] = '\0';
-+
-+    params.name = "beacon_rate";
-+    // hostapd config unit is 100 kbps. To convert Mbps to 100kbps, the value need to multiply 10.
-+    if (strncmp(buf, "5.5", 3) == 0) {
-+        snprintf(buf, sizeof(buf), "55");
-+        params.value = buf;
-+    } else {
-+        strcat(buf, "0");
-+        params.value = buf;
-+    }
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    wifi_hostapdProcessUpdate(radioIndex, &params, 1);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
- }
- 
- INT wifi_getApBeaconRate(INT radioIndex, CHAR *beaconRate)
- {
--    return 0;
-+    char config_file[MAX_BUF_SIZE] = {'\0'};
-+    char temp_output[MAX_BUF_SIZE] = {'\0'};
-+    char buf[MAX_BUF_SIZE] = {'\0'};
-+    float rate = 0;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (NULL == beaconRate)
-+        return RETURN_ERR;
-+
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+    wifi_hostapdRead(config_file, "beacon_rate", buf, sizeof(buf));
-+    // Hostapd unit is 100kbps. To convert to 100kbps to Mbps, the value need to divide 10.
-+    if(strlen(buf) > 0) {
-+        rate = atof(buf)/10;
-+        snprintf(temp_output, sizeof(temp_output), "%.1fMbps", rate);
-+    } else {
-+        snprintf(temp_output, sizeof(temp_output), "1Mbps");   // default value
-+    }
-+    strncpy(beaconRate, temp_output, sizeof(temp_output));
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
- }
- 
- INT wifi_setLED(INT radioIndex, BOOL enable)
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0032-HAL-refactor-SSIDTrafficStats2-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0032-HAL-refactor-SSIDTrafficStats2-function.patch
deleted file mode 100644
index 8c003b6..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0032-HAL-refactor-SSIDTrafficStats2-function.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-From 31bc9c1435e62e442d0dbd68a4445d3b4d8f862f Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Wed, 7 Sep 2022 14:17:50 +0800
-Subject: [PATCH] HAL: refactor SSIDTrafficStats2 function
-
----
- source/wifi/wifi_hal.c | 77 +++++++++++++++++++++++++++++++++++-------
- 1 file changed, 64 insertions(+), 13 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index e8c9acf..33259dd 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -8288,38 +8288,89 @@ INT wifi_getSSIDTrafficStats2(INT ssidIndex,wifi_ssidTrafficStats2_t *output_str
- 
-     sprintf(HConf_file,"%s%d%s","/nvram/hostapd",ssidIndex,".conf");
-     GetInterfaceName(interface_name,HConf_file);
--    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f11 | tr -d '\n'");
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f11 | tr -d '\\n'");
-     fp = popen(pipeCmd, "r");
-     fgets(str, MAX_BUF_SIZE,fp);
-     out->ssid_BytesSent = atol(str);
-     pclose(fp);
- 
--    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f3 | tr -d '\n'");
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f3 | tr -d '\\n'");
-     fp = popen(pipeCmd, "r");
-     fgets(str, MAX_BUF_SIZE,fp);
-     out->ssid_BytesReceived = atol(str);
-     pclose(fp);
- 
--    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f12 | tr -d '\n'");
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f12 | tr -d '\\n'");
-     fp = popen(pipeCmd, "r");
-     fgets(str, MAX_BUF_SIZE,fp);
-     out->ssid_PacketsSent = atol(str);
-     pclose(fp);
- 
--    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f4 | tr -d '\n'");
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f4 | tr -d '\\n'");
-     fp = popen(pipeCmd, "r");
-     fgets(str, MAX_BUF_SIZE,fp);
-     out->ssid_PacketsReceived = atol(str);
-     pclose(fp);
--    /*
--       //TODO:
--       out->ssid_UnicastPacketsSent        = uni->ims_tx_data_packets;
--       out->ssid_UnicastPacketsReceived    = uni->ims_rx_data_packets;
--       out->ssid_MulticastPacketsSent      = multi->ims_tx_data_packets - multi->ims_tx_bcast_data_packets;
--       out->ssid_MulticastPacketsReceived  = multi->ims_rx_data_packets - multi->ims_rx_bcast_data_packets;
--       out->ssid_BroadcastPacketsSent      = multi->ims_tx_bcast_data_packets;
--       out->ssid_BroadcastPacketsRecevied  = multi->ims_rx_bcast_data_packets; 
--    */
-+
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f13 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_ErrorsSent = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f5 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_ErrorsReceived = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f14 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_DiscardedPacketsSent = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s%s%s","cat /proc/net/dev | grep ",interface_name," |  tr -s ' '  | cut -d  ' ' -f6 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_DiscardedPacketsReceived = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s","tail -n1 /proc/net/netstat | cut -d  ' ' -f5 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_MulticastPacketsSent = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s","tail -n1 /proc/net/netstat | cut -d  ' ' -f4 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_MulticastPacketsReceived = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s","tail -n1 /proc/net/netstat | cut -d  ' ' -f7 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_BroadcastPacketsSent = atol(str);
-+    pclose(fp);
-+
-+    sprintf(pipeCmd,"%s","tail -n1 /proc/net/netstat | cut -d  ' ' -f6 | tr -d '\\n'");
-+    fp = popen(pipeCmd, "r");
-+    fgets(str, MAX_BUF_SIZE,fp);
-+    out->ssid_BroadcastPacketsRecevied = atol(str);
-+    pclose(fp);
-+
-+    out->ssid_UnicastPacketsSent = out->ssid_PacketsSent - out->ssid_MulticastPacketsSent - out->ssid_BroadcastPacketsSent - out->ssid_DiscardedPacketsSent;
-+    out->ssid_UnicastPacketsReceived = out->ssid_PacketsReceived - out->ssid_MulticastPacketsReceived - out->ssid_BroadcastPacketsRecevied - out->ssid_DiscardedPacketsReceived;
-+
-+    // Not supported
-+    output_struct->ssid_RetransCount = 0;
-+    output_struct->ssid_FailedRetransCount = 0;
-+    output_struct->ssid_RetryCount = 0;
-+    output_struct->ssid_MultipleRetryCount = 0;
-+    output_struct->ssid_ACKFailureCount = 0;
-+    output_struct->ssid_AggregatedPacketCount = 0;
-+
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0033-HAL-refactor-set-Fragmentation-Threshold-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0033-HAL-refactor-set-Fragmentation-Threshold-function.patch
deleted file mode 100644
index 9614726..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0033-HAL-refactor-set-Fragmentation-Threshold-function.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a87dd56b40faca3bc78a626a5bdb3c45b9723b20 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Tue, 2 Aug 2022 10:03:46 +0800
-Subject: [PATCH] HAL: refactor set Fragmentation Threshold function
-
----
- source/wifi/wifi_hal.c | 25 +++++++++++++++----------
- 1 file changed, 15 insertions(+), 10 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 556c73f..e49f22f 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -3623,17 +3623,22 @@ INT wifi_setRadioObssCoexistenceEnable(INT apIndex, BOOL enable)
- //P3 // sets the fragmentation threshold in bytes for the radio used by this ap
- INT wifi_setRadioFragmentationThreshold(INT apIndex, UINT threshold)
- {
--    char cmd[64];
--    char buf[512];
--    //save config and apply instantly
-+    char config_file[MAX_BUF_SIZE] = {'\0'};
-+    char buf[MAX_BUF_SIZE] = {'\0'};
-+    struct params list;
- 
--    //zqiu:TODO: save config
--    if (threshold > 0)  {
--        snprintf(cmd, sizeof(cmd),  "iwconfig %s%d frag %d", AP_PREFIX, apIndex, threshold);
--    } else {
--        snprintf(cmd, sizeof(cmd),  "iwconfig %s%d frag off", AP_PREFIX, apIndex );
--    }
--    _syscmd(cmd,buf, sizeof(buf));
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (threshold < 256 || threshold > 2346 )
-+        return RETURN_ERR;
-+    list.name = "fragm_threshold";
-+    snprintf(buf, sizeof(buf), "%d", threshold);
-+    list.value = buf;
-+
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdWrite(config_file, &list, 1);
-+    wifi_hostapdProcessUpdate(apIndex, &list, 1);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- 
-     return RETURN_OK;
- }
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0034-HAL-refactor-NeighboringWiFiDiagnosticResult2-scan-p.patch b/recipes-ccsp/hal/hal-wifi-patches/0034-HAL-refactor-NeighboringWiFiDiagnosticResult2-scan-p.patch
deleted file mode 100644
index 4f862e8..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0034-HAL-refactor-NeighboringWiFiDiagnosticResult2-scan-p.patch
+++ /dev/null
@@ -1,339 +0,0 @@
-From 4592e371528abdf4804c116760059b0a0fb4dbc6 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Tue, 2 Aug 2022 17:23:06 +0800
-Subject: [PATCH] HAL: refactor NeighboringWiFiDiagnosticResult2 scan part and
- add scan filter function
-
----
- source/wifi/wifi_hal.c | 289 ++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 259 insertions(+), 30 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index e49f22f..44f167b 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -73,6 +73,8 @@ Licensed under the ISC license
- //#define ACL_PREFIX "/tmp/wifi_acl_list" //RDKB convention
- #define SOCK_PREFIX "/var/run/hostapd/wifi"
- #define VAP_STATUS_FILE "/tmp/vap-status"
-+#define ESSID_FILE "/tmp/essid"
-+
- #ifdef MTK_IMPL
- #define DRIVER_2GHZ "mt7915e"
- #define DRIVER_5GHZ "mt7915e"
-@@ -3037,47 +3039,243 @@ INT wifi_applySSIDSettings(INT ssidIndex)
-     return ret;
- }
- 
-+struct channels_noise {
-+    int channel;
-+    int noise;
-+};
-+
-+// Return noise array for each channel
-+int get_noise(int radioIndex, struct channels_noise *channels_noise_arr, int channels_num)
-+{
-+    FILE *f = NULL;
-+    char cmd[128] = {0};
-+    char *line = NULL;
-+    size_t len = 0;
-+    ssize_t read = 0;
-+    int tmp = 0, arr_index = -1;
-+
-+    sprintf(cmd, "iw dev %s%d survey dump | grep 'frequency\\|noise' | awk '{print $2}'", AP_PREFIX, radioIndex);
-+
-+    if ((f = popen(cmd, "r")) == NULL) {
-+        wifi_dbg_printf("%s: popen %s error\n", __func__, cmd);
-+        return RETURN_ERR;
-+    }
-+    
-+    while((read = getline(&line, &len, f)) != -1) {
-+        sscanf(line, "%d", &tmp);
-+        if (tmp > 0) {      // channel frequency, the first line must be frequency
-+            arr_index++;
-+            channels_noise_arr[arr_index].channel = ieee80211_frequency_to_channel(tmp);
-+        } else {            // noise
-+            channels_noise_arr[arr_index].noise = tmp;
-+        }
-+    }
-+    free(line);
-+    pclose(f);
-+    return RETURN_OK;
-+}
-+
- //Start the wifi scan and get the result into output buffer for RDKB to parser. The result will be used to manage endpoint list
- //HAL funciton should allocate an data structure array, and return to caller with "neighbor_ap_array"
- INT wifi_getNeighboringWiFiDiagnosticResult2(INT radioIndex, wifi_neighbor_ap2_t **neighbor_ap_array, UINT *output_array_size) //Tr181	
- {
--    INT status = RETURN_ERR;
--    UINT index;
--    wifi_neighbor_ap2_t *pt=NULL;
--    char cmd[128]={0};
--    char buf[8192]={0};
-+    int index = -1;
-+    wifi_neighbor_ap2_t *scan_array = NULL;
-+    char cmd[256]={0};
-+    char buf[128]={0};
-+    char file_name[32] = {0};
-+    char filter_SSID[32] = {0};
-+    int freq=0;
-+    FILE *f = NULL;
-+    size_t len=0;
-+    ssize_t read = 0;
-+    char *line =NULL;
-+    // int noise_arr[channels_num] = {0};
-+    int channels_num = 0;
-+    int vht_channel_width = 0;
-+    bool get_nosie_ret = false;
-+    bool filter_enable = false;
-+    bool filter_BSS = false;     // The flag determine whether the BSS information need to be filterd.
- 
-     WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
--    sprintf(cmd, "iwlist %s%d scan",AP_PREFIX,(radioIndex==0)?0:1);	//suppose ap0 mapping to radio0
-+
-+    snprintf(file_name, sizeof(file_name), "%s%d.txt", ESSID_FILE, radioIndex);
-+    f = fopen(file_name, "r");
-+    if (f != NULL) {
-+        fgets(filter_SSID, sizeof(file_name), f);
-+        if (strlen(filter_SSID) != 0)
-+            filter_enable = true;
-+        fclose(f);
-+    }
-+
-+    snprintf(cmd, sizeof(cmd), "iw phy phy%d channels | grep * | grep -v disable | wc -l", radioIndex);
-     _syscmd(cmd, buf, sizeof(buf));
-+    channels_num = atoi(buf);
- 
-+    struct channels_noise *channels_noise_arr = calloc(channels_num, sizeof(struct channels_noise));
-+    get_nosie_ret = get_noise(radioIndex, channels_noise_arr, channels_num);
-+    
-+    sprintf(cmd, "iw dev %s%d scan | grep '%s%d\\|SSID\\|freq\\|beacon interval\\|capabilities\\|signal\\|Supported rates\\|DTIM\\| \
-+    // WPA\\|RSN\\|Group cipher\\|HT operation\\|secondary channel offset\\|channel width\\|HE160' | grep -v -e '*.*BSS'", AP_PREFIX, radioIndex, AP_PREFIX, radioIndex);
-+    fprintf(stderr, "cmd: %s\n", cmd);
-+    if ((f = popen(cmd, "r")) == NULL) {
-+        wifi_dbg_printf("%s: popen %s error\n", __func__, cmd);
-+        return RETURN_ERR;
-+    }
- 
--    *output_array_size=2;
--    //zqiu: HAL alloc the array and return to caller. Caller response to free it.
--    *neighbor_ap_array=(wifi_neighbor_ap2_t *)calloc(sizeof(wifi_neighbor_ap2_t), *output_array_size);
--    for (index = 0, pt=*neighbor_ap_array; index < *output_array_size; index++, pt++) {
--        strcpy(pt->ap_SSID,"");
--        strcpy(pt->ap_BSSID,"");
--        strcpy(pt->ap_Mode,"");
--        pt->ap_Channel=1;
--        pt->ap_SignalStrength=0;
--        strcpy(pt->ap_SecurityModeEnabled,"");
--        strcpy(pt->ap_EncryptionMode,"");
--        strcpy(pt->ap_OperatingFrequencyBand,"");
--        strcpy(pt->ap_SupportedStandards,"");
--        strcpy(pt->ap_OperatingStandards,"");
--        strcpy(pt->ap_OperatingChannelBandwidth,"");
--        pt->ap_BeaconPeriod=1;
--        pt->ap_Noise=0;
--        strcpy(pt->ap_BasicDataTransferRates,"");
--        strcpy(pt->ap_SupportedDataTransferRates,"");
--        pt->ap_DTIMPeriod=1;
--        pt->ap_ChannelUtilization=0;
-+    while ((read = getline(&line, &len, f)) != -1) {
-+        if(strstr(line, "BSS") != NULL) {    // new neighbor info
-+            // The SSID field is not in the first field. So, we should store whole BSS informations and the filter flag. 
-+            // And we will determine whether we need the previous BSS infomation when parsing the next BSS field or end of while loop.
-+            // If we don't want the BSS info, we don't realloc more space, and just clean the previous BSS.
-+
-+            if (!filter_BSS) {
-+                index++;
-+                wifi_neighbor_ap2_t *tmp;
-+                tmp = realloc(scan_array, sizeof(wifi_neighbor_ap2_t)*(index+1));
-+                if (tmp == NULL) {              // no more memory to use
-+                    index--;
-+                    wifi_dbg_printf("%s: realloc failed\n", __func__);
-+                    break;
-+                }
-+                scan_array = tmp;
-+            }
-+            memset(&(scan_array[index]), 0, sizeof(wifi_neighbor_ap2_t));
-+
-+            filter_BSS = false;
-+            sscanf(line, "BSS %17s", scan_array[index].ap_BSSID);
-+            strncpy(scan_array[index].ap_Mode, "Infrastructure", strlen("Infrastructure"));
-+            strncpy(scan_array[index].ap_SecurityModeEnabled, "None", strlen("None"));
-+            strncpy(scan_array[index].ap_EncryptionMode, "None", strlen("None"));
-+        } else if (strstr(line, "freq") != NULL) {
-+            sscanf(line,"	freq: %d", &freq);
-+            scan_array[index].ap_Channel = ieee80211_frequency_to_channel(freq);
-+
-+            if (freq >= 2412 && freq <= 2484) {
-+                strncpy(scan_array[index].ap_OperatingFrequencyBand, "2.4GHz", strlen("2.4GHz"));
-+                strncpy(scan_array[index].ap_SupportedStandards, "b,g", strlen("b,g"));
-+                strncpy(scan_array[index].ap_OperatingStandards, "g", strlen("g"));
-+            }
-+            else if (freq >= 5160 && freq <= 5805) {
-+                strncpy(scan_array[index].ap_OperatingFrequencyBand, "5GHz", strlen("5GHz"));
-+                strncpy(scan_array[index].ap_SupportedStandards, "a", strlen("a"));
-+                strncpy(scan_array[index].ap_OperatingStandards, "a", strlen("a"));
-+            }
-+
-+            scan_array[index].ap_Noise = 0;
-+            if (get_nosie_ret) {
-+                for (int i = 0; i < channels_num; i++) {
-+                    if (scan_array[index].ap_Channel == channels_noise_arr[i].channel) {
-+                        scan_array[index].ap_Noise = channels_noise_arr[i].noise;
-+                        break;
-+                    }
-+                }
-+            }
-+        } else if (strstr(line, "beacon interval") != NULL) {
-+            sscanf(line,"	beacon interval: %d TUs", &(scan_array[index].ap_BeaconPeriod));
-+        } else if (strstr(line, "signal") != NULL) {
-+            sscanf(line,"	signal: %d", &(scan_array[index].ap_SignalStrength));
-+        } else if (strstr(line,"SSID") != NULL) {
-+            sscanf(line,"	SSID: %s", scan_array[index].ap_SSID);
-+            if (filter_enable && strcmp(scan_array[index].ap_SSID, filter_SSID) != 0) {
-+                filter_BSS = true;
-+            }
-+        } else if (strstr(line, "Supported rates") != NULL) {
-+            char SRate[64] = {0}, *tmp = NULL;
-+            memset(buf, 0, sizeof(buf));
-+            strcpy(SRate, line);
-+            tmp = strtok(SRate, ":");
-+            tmp = strtok(NULL, ":");
-+            strcpy(buf, tmp);
-+            memset(SRate, 0, sizeof(SRate));
-+
-+            tmp = strtok(buf, " \n");
-+            while (tmp != NULL) {
-+                strcat(SRate, tmp);
-+                if (SRate[strlen(SRate) - 1] == '*') {
-+                    SRate[strlen(SRate) - 1] = '\0';
-+                }
-+                strcat(SRate, ",");
-+
-+                tmp = strtok(NULL, " \n");
-+            }
-+            SRate[strlen(SRate) - 1] = '\0';
-+            strcpy(scan_array[index].ap_SupportedDataTransferRates, SRate);
-+        } else if (strstr(line, "DTIM") != NULL) {
-+            sscanf(line,"DTIM Period %d", scan_array[index].ap_DTIMPeriod, buf);
-+        } else if (strstr(line, "VHT capabilities") != NULL) {
-+            strcat(scan_array[index].ap_SupportedStandards, ",ac");
-+            strcpy(scan_array[index].ap_OperatingStandards, "ac");
-+        } else if (strstr(line, "HT capabilities") != NULL) {
-+            strcat(scan_array[index].ap_SupportedStandards, ",n");
-+            strcpy(scan_array[index].ap_OperatingStandards, "n");
-+        } else if (strstr(line, "VHT operation") != NULL) {
-+            read = getline(&line, &len, f);
-+            sscanf(line,"		 * channel width: %d", &vht_channel_width);
-+            if(vht_channel_width == 1) {
-+                snprintf(scan_array[index].ap_OperatingChannelBandwidth, sizeof(scan_array[index].ap_OperatingChannelBandwidth), "11AC_VHT80");
-+            } else {
-+                snprintf(scan_array[index].ap_OperatingChannelBandwidth, sizeof(scan_array[index].ap_OperatingChannelBandwidth), "11AC_VHT40");
-+            }
-+            if (strstr(line, "BSS") != NULL)   // prevent to get the next neighbor information
-+                continue;
-+        } else if (strstr(line, "HT operation") != NULL) {
-+            read = getline(&line, &len, f);
-+            sscanf(line,"		 * secondary channel offset: %s", &buf);
-+            if (!strcmp(buf, "above")) {
-+                //40Mhz +
-+                snprintf(scan_array[index].ap_OperatingChannelBandwidth, sizeof(scan_array[index].ap_OperatingChannelBandwidth), "11N%s_HT40PLUS", radioIndex%1 ? "A": "G");
-+            }
-+            else if (!strcmp(buf, "below")) {
-+                //40Mhz -
-+                snprintf(scan_array[index].ap_OperatingChannelBandwidth, sizeof(scan_array[index].ap_OperatingChannelBandwidth), "11N%s_HT40MINUS", radioIndex%1 ? "A": "G");
-+            } else {
-+                //20Mhz
-+                snprintf(scan_array[index].ap_OperatingChannelBandwidth, sizeof(scan_array[index].ap_OperatingChannelBandwidth), "11N%s_HT20", radioIndex%1 ? "A": "G");
-+            }
-+            if (strstr(line, "BSS") != NULL)   // prevent to get the next neighbor information
-+                continue;
-+        } else if (strstr(line, "HE capabilities") != NULL) {
-+            strncat(scan_array[index].ap_SupportedStandards, ",ax", strlen(",ax"));
-+            strncpy(scan_array[index].ap_OperatingStandards, "ax", strlen("ax"));
-+        } else if (strstr(line, "HE PHY Capabilities") != NULL) {
-+            if (strncmp(scan_array[index].ap_OperatingFrequencyBand, "2.4GHz", strlen("2.4GHz")) == 0) {
-+                if (strstr(line, "HE40/2.4GHz") != NULL)
-+                    strncpy(scan_array[index].ap_OperatingChannelBandwidth, "11AXHE40PLUS", strlen("11AXHE40PLUS"));
-+                else
-+                    strncpy(scan_array[index].ap_OperatingChannelBandwidth, "11AXHE20", strlen("11AXHE20"));
-+                
-+            } else if (strncmp(scan_array[index].ap_OperatingFrequencyBand, "5GHz", strlen("5GHz")) == 0) {
-+                strncpy(scan_array[index].ap_OperatingChannelBandwidth, "11AXHE80", strlen("11AXHE80"));    // AP must always support
-+                read = getline(&line, &len, f);
-+                if (strstr(line, "HE160/5GHz") != NULL)
-+                    strncpy(scan_array[index].ap_OperatingChannelBandwidth, "11AXHE160", strlen("11AXHE160"));
-+            }
-+            if (strstr(line, "BSS") != NULL)   // prevent to get the next neighbor information
-+                continue;
-+        } else if (strstr(line, "WPA") != NULL) {
-+            strcpy(scan_array[index].ap_SecurityModeEnabled, "WPA");
-+        } else if (strstr(line, "RSN") != NULL) {
-+            strcpy(scan_array[index].ap_SecurityModeEnabled, "RSN");
-+        } else if (strstr(line, "Group cipher") != NULL) {
-+            sscanf(line, "		 * Group cipher: %s", scan_array[index].ap_EncryptionMode);
-+            if (strncmp(scan_array[index].ap_EncryptionMode, "CCMP", strlen("CCMP")) == 0) {
-+                strcpy(scan_array[index].ap_EncryptionMode, "AES");
-+            }
-+        }
-     }
- 
--    status = RETURN_OK;
-+    if (!filter_BSS) {
-+        *output_array_size = index + 1;
-+    } else {
-+        memset(&(scan_array[index]), 0, sizeof(wifi_neighbor_ap2_t));
-+        *output_array_size = index;
-+    }
-+    *neighbor_ap_array = scan_array;
-+    free(line);
-+    pclose(f);
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
--    return status;
-+    return RETURN_OK;
- }
- 
- //>> Deprecated: used for old RDKB code.
-@@ -7635,7 +7833,38 @@ INT wifi_setApCsaDeauth(INT apIndex, INT mode)
- 
- INT wifi_setApScanFilter(INT apIndex, INT mode, CHAR *essid)
- {
--    // TODO Implement me!
-+    char file_name[128] = {0};
-+    char buf[128] = {0};
-+    FILE *f = NULL;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if (essid == NULL || strlen(essid) == 0 || apIndex == -1) {
-+        for (int index = 0; index < NUMBER_OF_RADIOS; index++) {
-+            snprintf(file_name, sizeof(file_name), "%s%d.txt", ESSID_FILE, index);
-+            f = fopen(file_name, "w");
-+            if (f == NULL) 
-+                return RETURN_ERR;
-+            // For mode == 0 is to disable filter, just don't write to the file.
-+            if (mode)
-+                fprintf(f, "%s", essid);
-+
-+            fclose(f);
-+        }
-+    } else {        // special case, need to set AP's SSID as filter for each radio.
-+        snprintf(file_name, sizeof(file_name), "%s%d.txt", ESSID_FILE, apIndex);
-+        f = fopen(file_name, "w");
-+        if (f == NULL) 
-+            return RETURN_ERR;
-+
-+        // For mode == 0 is to disable filter, just don't write to the file.
-+        if (mode)
-+            fprintf(f, "%s", essid);
-+
-+        fclose(f);
-+    }
-+    
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0035-HAL-add-igmp-snooping-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0035-HAL-add-igmp-snooping-function.patch
deleted file mode 100644
index bc97b5e..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0035-HAL-add-igmp-snooping-function.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From b633c0262c070dfe0de5c2e880115082a1b266f2 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Fri, 5 Aug 2022 09:54:14 +0800
-Subject: [PATCH] HAL: add igmp snooping function
-
----
- source/wifi/wifi_hal.c | 43 +++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 40 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 44f167b..b0c42bd 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -82,6 +82,7 @@ Licensed under the ISC license
- #define DRIVER_2GHZ "ath9k"
- #define DRIVER_5GHZ "ath10k_pci"
- #endif
-+#define BRIDGE_NAME "brlan0"
- 
- /*
-    MAX_APS - Number of all AP available in system
-@@ -3971,16 +3972,52 @@ INT wifi_setRadio11nGreenfieldEnable(INT radioIndex, BOOL enable)
- //Get radio IGMP snooping enable setting
- INT wifi_getRadioIGMPSnoopingEnable(INT radioIndex, BOOL *output_bool)
- {
--    if (NULL == output_bool)
-+    char cmd[128]={0};
-+    char buf[4]={0};
-+    bool bridge = FALSE, mac80211 = FALSE;
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if(output_bool == NULL)
-         return RETURN_ERR;
--    *output_bool = TRUE;
-+
-+    *output_bool = FALSE;
-+
-+    snprintf(cmd, sizeof(cmd),  "cat /sys/devices/virtual/net/%s/bridge/multicast_snooping", BRIDGE_NAME);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    if (strncmp(buf, "1", 1) == 0)
-+        bridge = TRUE;
-+
-+    snprintf(cmd, sizeof(cmd),  "cat /sys/devices/virtual/net/%s/brif/%s%d/multicast_to_unicast", BRIDGE_NAME, AP_PREFIX, radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    if (strncmp(buf, "1", 1) == 0)
-+        mac80211 = TRUE;
-+
-+    if (bridge && mac80211)
-+        *output_bool = TRUE;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
- //Set radio IGMP snooping enable setting
- INT wifi_setRadioIGMPSnoopingEnable(INT radioIndex, BOOL enable)
- {
--    return RETURN_ERR;
-+    char cmd[128]={0};
-+    char buf[4]={0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    // bridge
-+    snprintf(cmd, sizeof(cmd),  "echo %d > /sys/devices/virtual/net/%s/bridge/multicast_snooping", enable, BRIDGE_NAME);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    // mac80211
-+    for (int i = 0; i < NUMBER_OF_RADIOS; i++) {
-+        snprintf(cmd, sizeof(cmd),  "echo %d > /sys/devices/virtual/net/%s/brif/%s%d/multicast_to_unicast", enable, BRIDGE_NAME, AP_PREFIX, i);
-+        _syscmd(cmd, buf, sizeof(buf));
-+    }
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- //Get the Reset count of radio
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0036-HAL-add-Obss-Coexistence-Enable-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0036-HAL-add-Obss-Coexistence-Enable-function.patch
deleted file mode 100644
index 8bf3957..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0036-HAL-add-Obss-Coexistence-Enable-function.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 7e38f393db902a6ed31c284d7a61336c836a3344 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 4 Aug 2022 18:15:29 +0800
-Subject: [PATCH] HAL: add Obss Coexistence Enable function
-
----
- source/wifi/wifi_hal.c | 18 ++++++++++++++++--
- 1 file changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index be72a31..72f925c 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -3815,8 +3815,22 @@ INT wifi_setRadioCtsProtectionEnable(INT apIndex, BOOL enable)
- // enables OBSS Coexistence - fall back to 20MHz if necessary for the radio used by this ap
- INT wifi_setRadioObssCoexistenceEnable(INT apIndex, BOOL enable)
- {
--    //save config and Apply instantly
--    return RETURN_ERR;
-+    char config_file[64] = {'\0'};
-+    char buf[64] = {'\0'};
-+    struct params list;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    list.name = "ht_coex";
-+    snprintf(buf, sizeof(buf), "%d", enable);
-+    list.value = buf;
-+
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdWrite(config_file, &list, 1);
-+    wifi_hostapdProcessUpdate(apIndex, &list, 1);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
- }
- 
- //P3 // sets the fragmentation threshold in bytes for the radio used by this ap
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0037-HAL-add-get-and-set-radio-mode.patch b/recipes-ccsp/hal/hal-wifi-patches/0037-HAL-add-get-and-set-radio-mode.patch
deleted file mode 100644
index 657ba17..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0037-HAL-add-get-and-set-radio-mode.patch
+++ /dev/null
@@ -1,157 +0,0 @@
-From 47094ac819aba0809c899fe8ad1083b319617813 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 8 Sep 2022 10:31:06 +0800
-Subject: [PATCH] HAL: add get and set radio mode
-
----
- source/wifi/wifi_hal.c | 120 ++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 119 insertions(+), 1 deletion(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index fa1af2e..9e17de6 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -170,6 +170,15 @@ typedef enum
-     band_6 = 2,
- } wifi_band;
- 
-+typedef enum {
-+    WIFI_MODE_A = 0x01,
-+    WIFI_MODE_B = 0x02,
-+    WIFI_MODE_G = 0x04,
-+    WIFI_MODE_N = 0x08,
-+    WIFI_MODE_AC = 0x10,
-+    WIFI_MODE_AX = 0x20,
-+} wifi_ieee80211_Mode;
-+
- #ifdef WIFI_HAL_VERSION_3
- 
- // Return number of elements in array
-@@ -1696,7 +1705,63 @@ INT wifi_getRadioStandard(INT radioIndex, CHAR *output_string, BOOL *gOnly, BOOL
- #endif
- }
- 
--//Set the radio operating mode, and pure mode flag. 
-+INT wifi_getRadioMode(INT radioIndex, CHAR *output_string, UINT *pureMode)
-+{
-+    char cmd[128] = {0};
-+    char buf[64] = {0};
-+    char config_file[64] = {0};
-+    wifi_band band;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(NULL == output_string || NULL == pureMode)
-+        return RETURN_ERR;
-+
-+    // grep all of the ieee80211 protocol config set to 1
-+    snprintf(config_file, sizeof(cmd), "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+    snprintf(cmd, sizeof(cmd), "cat %s | grep -E\"^ieee.*=1\" | cut -d '=' -f1 | tr -d 'ieee80211'", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    band = wifi_index_to_band(radioIndex);
-+    // puremode is a bit map
-+    *pureMode = 0;
-+    if (band == band_2_4) {
-+        strcat(output_string, "b,g");
-+        *pureMode |= WIFI_MODE_B | WIFI_MODE_G;
-+        if (strstr(buf, "n") != NULL) {
-+            strcat(output_string, ",n");
-+            *pureMode |= WIFI_MODE_N;
-+        }
-+        if (strstr(buf, "ax") != NULL) {
-+            strcat(output_string, ",ax");
-+            *pureMode |= WIFI_MODE_AX;
-+        }
-+    } else if (band == band_5) {
-+        strcat(output_string, "a");
-+        *pureMode |= WIFI_MODE_A;
-+        if (strstr(buf, "n") != NULL) {
-+            strcat(output_string, ",n");
-+            *pureMode |= WIFI_MODE_N;
-+        }
-+        if (strstr(buf, "ac") != NULL) {
-+            strcat(output_string, ",ac");
-+            *pureMode |= WIFI_MODE_AC;
-+        }
-+        if (strstr(buf, "ax") != NULL) {
-+            strcat(output_string, ",ax");
-+            *pureMode |= WIFI_MODE_AX;
-+        }
-+    } else if (band == band_6) {
-+        if (strstr(buf, "ax") != NULL) {
-+            strcat(output_string, "ax");
-+            *pureMode |= WIFI_MODE_AX;
-+        }
-+    }
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
-+// Set the radio operating mode, and pure mode flag.
- INT wifi_setRadioChannelMode(INT radioIndex, CHAR *channelMode, BOOL gOnlyFlag, BOOL nOnlyFlag, BOOL acOnlyFlag)	//RDKB
- {
-     WIFI_ENTRY_EXIT_DEBUG("Inside %s_%s_%d_%d:%d\n",__func__,channelMode,nOnlyFlag,gOnlyFlag,__LINE__);  
-@@ -1791,6 +1856,59 @@ INT wifi_setRadioChannelMode(INT radioIndex, CHAR *channelMode, BOOL gOnlyFlag,
-     return RETURN_OK;
- }
- 
-+// Set the radio operating mode, and pure mode flag.
-+INT wifi_setRadioMode(INT radioIndex, CHAR *channelMode, UINT pureMode)
-+{
-+    int num_hostapd_support_mode = 3;   // n, ac, ax
-+    struct params list[num_hostapd_support_mode];
-+    char config_file[64] = {0};
-+    char bandwidth[16] = {0};
-+    int mode_check_bit = 1 << 3;    // n mode
-+    wifi_ieee80211_Mode mode = (wifi_ieee80211_Mode)pureMode;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s_%d:%d\n", __func__, channelMode, pureMode, __LINE__);
-+    // Set radio mode
-+    list[0].name = "ieee80211n";
-+    list[1].name = "ieee80211ac";
-+    list[2].name = "ieee80211ax";
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+
-+    // check the bit map from n to ax, and set hostapd config
-+    if (mode & WIFI_MODE_N)
-+        list[0].value = "1";
-+    else
-+        list[0].value = "0";
-+    if (mode & WIFI_MODE_AC)
-+        list[1].value = "1";
-+    else
-+        list[1].value = "0";
-+    if (mode & WIFI_MODE_AX)
-+        list[2].value = "1";
-+    else
-+        list[2].value = "0";
-+    wifi_hostapdWrite(config_file, list, num_hostapd_support_mode);
-+
-+    if (channelMode == NULL || strlen(channelMode) == 0)
-+        return RETURN_OK;
-+    // Set bandwidth
-+    if (strstr(channelMode, "40") != NULL)
-+        strcpy(bandwidth, "40MHz");
-+    else if (strstr(channelMode, "80") != NULL)
-+        strcpy(bandwidth, "80MHz");
-+    else if (strstr(channelMode, "160") != NULL)
-+        strcpy(bandwidth, "160MHz");
-+    else    // 11A, 11B, 11G....
-+        strcpy(bandwidth, "20MHz");
-+
-+    writeBandWidth(radioIndex, bandwidth);
-+    wifi_setRadioOperatingChannelBandwidth(radioIndex, bandwidth);
-+
-+    wifi_reloadAp(radioIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-+    return RETURN_OK;
-+}
-+
- //Get the list of supported channel. eg: "1-11"
- //The output_string is a max length 64 octet string that is allocated by the RDKB code.  Implementations must ensure that strings are not longer than this.
- INT wifi_getRadioPossibleChannels(INT radioIndex, CHAR *output_string)	//RDKB
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0038-HAL-add-tri-band-support-and-index-to-band.patch b/recipes-ccsp/hal/hal-wifi-patches/0038-HAL-add-tri-band-support-and-index-to-band.patch
deleted file mode 100644
index a58ee34..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0038-HAL-add-tri-band-support-and-index-to-band.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 575fbc6a67f1c7f30bbe0db9ff60ed1817260d85 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Fri, 19 Aug 2022 10:50:01 +0800
-Subject: [PATCH] HAL: add tri-band support and index to band
-
----
- source/wifi/wifi_hal.c | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index b4628c9..bde3349 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -164,6 +164,7 @@ typedef enum
-     band_invalid = -1,
-     band_2_4 = 0,
-     band_5 = 1,
-+    band_6 = 2,
- } wifi_band;
- 
- #ifdef WIFI_HAL_VERSION_3
-@@ -425,6 +426,28 @@ static int _syscmd(char *cmd, char *retBuf, int retBufSize)
-     return cmd_ret >> 8;
- }
- 
-+wifi_band wifi_index_to_band(int radioIndex)
-+{
-+    char cmd[64] = {0};
-+    char buf[64] = {0};
-+    int freq = 0;
-+    wifi_band band = band_invalid;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    snprintf(cmd, sizeof(cmd), "iw dev %s%d info | grep MHz | awk '{print $9}'", AP_PREFIX, radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    freq = atoi(buf);
-+    if (freq > 2401 && freq < 2495)
-+        band = band_2_4;
-+    else if (freq > 5160 && freq < 5915)
-+        band = band_5;
-+    else if (freq > 5955 && freq < 7125)
-+        band = band_6;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return band;
-+}
-+
- static int wifi_hostapdRead(char *conf_file, char *param, char *output, int output_size)
- {
-     char cmd[MAX_CMD_SIZE]={'\0'};
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0039-HAL-add-get-and-set-guard-interval-functions.patch b/recipes-ccsp/hal/hal-wifi-patches/0039-HAL-add-get-and-set-guard-interval-functions.patch
deleted file mode 100644
index 87d684a..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0039-HAL-add-get-and-set-guard-interval-functions.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 9fe2a7b984e3b008bbb1605eb33f7937d43cf018 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Wed, 17 Aug 2022 09:55:10 +0800
-Subject: [PATCH] HAL: add get and set guard interval functions
-
----
- source/wifi/wifi_hal.c | 132 +++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 128 insertions(+), 4 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index dd5e8d4..19aa67e 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -74,6 +74,7 @@ Licensed under the ISC license
- #define SOCK_PREFIX "/var/run/hostapd/wifi"
- #define VAP_STATUS_FILE "/tmp/vap-status"
- #define ESSID_FILE "/tmp/essid"
-+#define GUARD_INTERVAL_FILE "/tmp/guard-interval"
- 
- #ifdef MTK_IMPL
- #define DRIVER_2GHZ "mt7915e"
-@@ -2409,18 +2410,53 @@ INT wifi_setRadioExtChannel(INT radioIndex, CHAR *string) //Tr181	//AP only
- //The output_string is a max length 64 octet string that is allocated by the RDKB code.  Implementations must ensure that strings are not longer than this.
- INT wifi_getRadioGuardInterval(INT radioIndex, CHAR *output_string)	//Tr181
- {
--    //save config and apply instantly
--    if (NULL == output_string)
-+    wifi_guard_interval_t GI;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if (output_string == NULL || wifi_getGuardInterval(radioIndex, &GI) == RETURN_ERR)
-         return RETURN_ERR;
--    snprintf(output_string, 64, "Auto");
- 
-+    if (GI == wifi_guard_interval_400)
-+        strcpy(output_string, "400nsec");
-+    else if (GI == wifi_guard_interval_800)
-+        strcpy(output_string, "800nsec");
-+    else if (GI == wifi_guard_interval_1600)
-+        strcpy(output_string, "1600nsec");
-+    else if (GI == wifi_guard_interval_3200)
-+        strcpy(output_string, "3200nsec");
-+    else
-+        strcpy(output_string, "auto");
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
- //Set the guard interval value.
- INT wifi_setRadioGuardInterval(INT radioIndex, CHAR *string)	//Tr181
- {
--    //Apply setting instantly
-+    wifi_guard_interval_t GI;
-+    int ret = 0;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if (strcmp(string, "400nsec") == 0)
-+        GI = wifi_guard_interval_400;
-+    else if (strcmp(string , "800nsec") == 0 || strcmp(string, "auto") == 0)
-+        GI = wifi_guard_interval_800;
-+    else if (strcmp(string , "1600nsec") == 0)
-+        GI = wifi_guard_interval_1600;
-+    else if (strcmp(string , "3200nsec") == 0)
-+        GI = wifi_guard_interval_3200;
-+
-+    ret = wifi_setGuardInterval(radioIndex, GI);
-+
-+    if (ret == RETURN_ERR) {
-+        wifi_dbg_printf("%s: wifi_setGuardInterval return error\n", __func__);
-+        return RETURN_ERR;
-+    }
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
-@@ -9456,6 +9492,94 @@ INT wifi_isZeroDFSSupported(UINT radioIndex, BOOL *supported)
-      return RETURN_OK;
- }
- 
-+INT wifi_setGuardInterval(INT radio_index, wifi_guard_interval_t guard_interval)
-+{
-+    char cmd[128] = {0};
-+    char buf[64] = {0};
-+    char band_str[8] = {0};
-+    char GI[8] = {0};
-+    int tmp = 0;
-+    BOOL ax_mode = FALSE;
-+    BOOL short_GI = FALSE;
-+    FILE *f = NULL;
-+    wifi_band band;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if (wifi_getRadioMode(radio_index, buf, &tmp) == RETURN_ERR) {
-+        wifi_dbg_printf("%s: wifi_getRadioMode return error\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    if (strstr(buf, "ax") != NULL)
-+        ax_mode = TRUE;
-+
-+    if (guard_interval == wifi_guard_interval_400 && ax_mode != TRUE) {
-+        short_GI = TRUE;
-+        strcpy(GI, "0.4");
-+    } else if (guard_interval == wifi_guard_interval_1600 && ax_mode == TRUE)
-+        strcpy(GI, "1.6");
-+    else if (guard_interval == wifi_guard_interval_3200 && ax_mode == TRUE)
-+        strcpy(GI, "3.2");
-+    else        // default
-+        strcpy(GI, "0.8");
-+
-+    band = wifi_index_to_band(radio_index);
-+    if (band == band_2_4)
-+        strcpy(band_str, "2.4");
-+    else if (band == band_5)
-+        strcpy(band_str, "5");
-+    else if (band == band_6)
-+        strcpy(band_str, "6");
-+    else {
-+        wifi_dbg_printf("%s: invalid band\n");
-+        return RETURN_ERR;
-+    }
-+
-+    if (ax_mode == TRUE)
-+        snprintf(cmd, sizeof(cmd), "iw dev %s%d set bitrates he-gi-%s %s", AP_PREFIX, radio_index, band_str, GI);
-+    else
-+        snprintf(cmd, sizeof(cmd), "iw dev %s%d set bitrates %sgi-%s", AP_PREFIX, radio_index, (short_GI)?"s":"l", band_str);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    // Record GI for get GI function
-+    snprintf(buf, sizeof(buf), "%s%d.txt", GUARD_INTERVAL_FILE, radio_index);
-+    f = fopen(buf, "w");
-+    if (f != NULL) {
-+        fprintf(f, "%s", GI);
-+    }
-+    fclose(f);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
-+INT wifi_getGuardInterval(INT radio_index, wifi_guard_interval_t *guard_interval)
-+{
-+    char buf[32] = {0};
-+    char cmd[64] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if (guard_interval == NULL)
-+        return RETURN_ERR;
-+
-+    snprintf(cmd, sizeof(cmd), "cat %s%d.txt", GUARD_INTERVAL_FILE, radio_index);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    if (strcmp(buf, "0.4") == 0)
-+        *guard_interval = wifi_guard_interval_400;
-+    else if (strcmp(buf, "0.8") == 0)
-+        *guard_interval = wifi_guard_interval_800;
-+    else if (strcmp(buf, "1.6") == 0)
-+        *guard_interval = wifi_guard_interval_1600;
-+    else if (strcmp(buf, "3.2") == 0)
-+        *guard_interval = wifi_guard_interval_3200;
-+    else
-+        *guard_interval = wifi_guard_interval_auto;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
- /* multi-psk support */
- INT wifi_getMultiPskClientKey(INT apIndex, mac_address_t mac, wifi_key_multi_psk_t *key)
- {
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0040-HAL-refactor-set-and-get-radius-server-functions.patch b/recipes-ccsp/hal/hal-wifi-patches/0040-HAL-refactor-set-and-get-radius-server-functions.patch
deleted file mode 100644
index 443f006..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0040-HAL-refactor-set-and-get-radius-server-functions.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 019d55137b9c3a0c033675f55cc098bb472d677c Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 18 Aug 2022 15:22:24 +0800
-Subject: [PATCH] HAL: refactor set and get radius server functions
-
----
- source/wifi/wifi_hal.c | 137 ++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 127 insertions(+), 10 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 7a137f7..6c00ceb 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -5624,35 +5624,152 @@ INT wifi_setApSecurityReset(INT apIndex)
- //The IP Address and port number of the RADIUS server used for WLAN security. RadiusServerIPAddr is only applicable when ModeEnabled is an Enterprise type (i.e. WPA-Enterprise, WPA2-Enterprise or WPA-WPA2-Enterprise).
- INT wifi_getApSecurityRadiusServer(INT apIndex, CHAR *IP_output, UINT *Port_output, CHAR *RadiusSecret_output)
- {
-+    char config_file[64] = {0};
-+    char buf[64] = {0};
-+    char cmd[256] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-     if(!IP_output || !Port_output || !RadiusSecret_output)
-         return RETURN_ERR;
--    snprintf(IP_output, 64, "75.56.77.78");
--    *Port_output = 123;
--    snprintf(RadiusSecret_output, 64, "12345678");
- 
-+    // Read the first matched config
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    sprintf(cmd, "cat %s | grep \"^auth_server_addr=\" | cut -d \"=\" -f 2 | head -n1 | tr -d \"\\n\"", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    strncpy(IP_output, buf, 64);
-+
-+    memset(buf, 0, sizeof(buf));
-+    sprintf(cmd, "cat %s | grep \"^auth_server_port=\" | cut -d \"=\" -f 2 | head -n1 | tr -d \"\\n\"", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    *Port_output = atoi(buf);
-+
-+    memset(buf, 0, sizeof(buf));
-+    sprintf(cmd, "cat %s | grep \"^auth_server_shared_secret=\" | cut -d \"=\" -f 2 | head -n1 | tr -d \"\\n\"", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    strncpy(RadiusSecret_output, buf, 64);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
- INT wifi_setApSecurityRadiusServer(INT apIndex, CHAR *IPAddress, UINT port, CHAR *RadiusSecret)
- {
--    //store the paramters, and apply instantly
--    return RETURN_ERR;
-+    char config_file[64] = {0};
-+    char port_str[8] = {0};
-+    char cmd[256] = {0};
-+    char buf[128] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+
-+    snprintf(cmd, sizeof(cmd), "cat %s | grep '# radius 1'", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    memset(cmd, 0, sizeof(cmd));
-+
-+    snprintf(port_str, sizeof(port_str), "%d", port);
-+    if (strlen(buf) == 0)
-+        // Append
-+        snprintf(cmd, sizeof(cmd), "echo -e '# radius 1\\n"
-+                                "auth_server_addr=%s\\n"
-+                                "auth_server_port=%s\\n"
-+                                "auth_server_shared_secret=%s' >> %s", IPAddress, port_str, RadiusSecret, config_file);
-+    else {
-+        // Delete the three lines setting after the "# radius 1" comment
-+        snprintf(cmd, sizeof(cmd), "sed -i '/# radius 1/{n;N;N;d}' %s", config_file);
-+        _syscmd(cmd, buf, sizeof(buf));
-+        memset(cmd, 0, sizeof(cmd));
-+        // Use "# radius 1" comment to find the location to insert the radius setting
-+        snprintf(cmd, sizeof(cmd), "sed -i 's/# radius 1/"
-+                                "# radius 1\\n"
-+                                "auth_server_addr=%s\\n"
-+                                "auth_server_port=%s\\n"
-+                                "auth_server_shared_secret=%s/' %s", IPAddress, port_str, RadiusSecret, config_file);
-+    }
-+    if(_syscmd(cmd, buf, sizeof(buf))) {
-+        wifi_dbg_printf("%s: command failed, cmd: %s\n", __func__, cmd);
-+        return RETURN_ERR;
-+    }
-+
-+    wifi_reloadAp(apIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- INT wifi_getApSecuritySecondaryRadiusServer(INT apIndex, CHAR *IP_output, UINT *Port_output, CHAR *RadiusSecret_output)
- {
-+    char config_file[64] = {0};
-+    char buf[64] = {0};
-+    char cmd[256] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-     if(!IP_output || !Port_output || !RadiusSecret_output)
-         return RETURN_ERR;
--    snprintf(IP_output, 64, "75.56.77.78");
--    *Port_output = 123;
--    snprintf(RadiusSecret_output, 64, "12345678");
-+
-+    // Read the second matched config
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    sprintf(cmd, "cat %s | grep \"^auth_server_addr=\" | cut -d \"=\" -f 2 | tail -n +2 | head -n1 | tr -d \"\\n\"", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    strncpy(IP_output, buf, 64);
-+
-+    memset(buf, 0, sizeof(buf));
-+    sprintf(cmd, "cat %s | grep \"^auth_server_port=\" | cut -d \"=\" -f 2 | tail -n +2 | head -n1 | tr -d \"\\n\"", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    *Port_output = atoi(buf);
-+
-+    memset(buf, 0, sizeof(buf));
-+    sprintf(cmd, "cat %s | grep \"^auth_server_shared_secret=\" | cut -d \"=\" -f 2 | tail -n +2 | head -n1 | tr -d \"\\n\"", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    strncpy(RadiusSecret_output, buf, 64);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
- INT wifi_setApSecuritySecondaryRadiusServer(INT apIndex, CHAR *IPAddress, UINT port, CHAR *RadiusSecret)
- {
--    //store the paramters, and apply instantly
--    return RETURN_ERR;
-+    char config_file[64] = {0};
-+    char port_str[8] = {0};
-+    char cmd[256] = {0};
-+    char buf[128] = {0};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+
-+    snprintf(cmd, sizeof(cmd), "cat %s | grep '# radius 2'", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    memset(cmd, 0, sizeof(cmd));
-+
-+    snprintf(port_str, sizeof(port_str), "%d", port);
-+    if (strlen(buf) == 0)
-+        // Append
-+        snprintf(cmd, sizeof(cmd), "echo -e '# radius 2\\n"
-+                                "auth_server_addr=%s\\n"
-+                                "auth_server_port=%s\\n"
-+                                "auth_server_shared_secret=%s' >> %s", IPAddress, port_str, RadiusSecret, config_file);
-+    else {
-+        // Delete the three lines setting after the "# radius 2" comment
-+        snprintf(cmd, sizeof(cmd), "sed -i '/# radius 2/{n;N;N;d}' %s", config_file);
-+        _syscmd(cmd, buf, sizeof(buf));
-+        memset(cmd, 0, sizeof(cmd));
-+        // Use "# radius 2" comment to find the location to insert the radius setting
-+        snprintf(cmd, sizeof(cmd), "sed -i 's/# radius 2/"
-+                                "# radius 2\\n"
-+                                "auth_server_addr=%s\\n"
-+                                "auth_server_port=%s\\n"
-+                                "auth_server_shared_secret=%s/' %s", IPAddress, port_str, RadiusSecret, config_file);
-+    }
-+    if(_syscmd(cmd, buf, sizeof(buf))) {
-+        wifi_dbg_printf("%s: command failed, cmd: %s\n", __func__, cmd);
-+        return RETURN_ERR;
-+    }
-+
-+    wifi_reloadAp(apIndex);
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- //RadiusSettings
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0041-HAL-refactor-get-Basic-Data-TransmitRates.patch b/recipes-ccsp/hal/hal-wifi-patches/0041-HAL-refactor-get-Basic-Data-TransmitRates.patch
deleted file mode 100644
index fbe1d15..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0041-HAL-refactor-get-Basic-Data-TransmitRates.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 7dc63d195649ea3012fae3577f9b4ee7a50278bf Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 25 Aug 2022 13:58:05 +0800
-Subject: [PATCH] HAL: refactor get Basic Data TransmitRates
-
----
- source/wifi/wifi_hal.c | 48 ++++++++++++++++++++----------------------
- 1 file changed, 23 insertions(+), 25 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 8ec1d0e..419b5d1 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2643,42 +2643,40 @@ INT wifi_setRadioBeaconPeriod(INT radioIndex, UINT BeaconPeriod)
- //Comma-separated list of strings. The set of data rates, in Mbps, that have to be supported by all stations that desire to join this BSS. The stations have to be able to receive and transmit at each of the data rates listed inBasicDataTransmitRates. For example, a value of "1,2", indicates that stations support 1 Mbps and 2 Mbps. Most control packets use a data rate in BasicDataTransmitRates.
- INT wifi_getRadioBasicDataTransmitRates(INT radioIndex, CHAR *output)
- {
--    if (NULL == output)
--        return RETURN_ERR;
--    snprintf(output, 64, (radioIndex == 0) ? "1,2" : "1.5,150");
--#if 0
-     //TODO: need to revisit below implementation
-     char *temp;
--    char temp_output[128];
--    char temp_TransmitRates[512];
--    char config_file[MAX_BUF_SIZE] = {0};
-+    char temp_output[128] = {0};
-+    char temp_TransmitRates[64] = {0};
-+    char config_file[64] = {0};
- 
-     WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-     if (NULL == output)
-         return RETURN_ERR;
-     sprintf(config_file,"%s%d.conf",CONFIG_PREFIX,radioIndex);
--    wifi_hostapdRead(config_file,"basic_rates",output,64);
--
--    strcpy(temp_TransmitRates,output);
--    strcpy(temp_output,"");
--    temp = strtok(temp_TransmitRates," ");
--    while(temp!=NULL)
--    {
--        temp[strlen(temp)-1]=0;
--        if((temp[0]=='5') && (temp[1]=='\0'))
--        {
--            temp="5.5";
--        }
--        strcat(temp_output,temp);
--        temp = strtok(NULL," ");
--        if(temp!=NULL)
-+    wifi_hostapdRead(config_file,"basic_rates",temp_TransmitRates,64);
-+ 
-+    if (strlen(temp_TransmitRates) == 0) {  // config not set, use supported rate
-+        wifi_getRadioSupportedDataTransmitRates(radioIndex, output);
-+    } else {
-+        temp = strtok(temp_TransmitRates," ");
-+        while(temp!=NULL)
-         {
--            strcat(temp_output,",");
-+            // Convert 100 kbps to Mbps
-+            temp[strlen(temp)-1]=0;
-+            if((temp[0]=='5') && (temp[1]=='\0'))
-+            {
-+                temp="5.5";
-+            }
-+            strcat(temp_output,temp);
-+            temp = strtok(NULL," ");
-+            if(temp!=NULL)
-+            {
-+                strcat(temp_output,",");
-+            }
-         }
-+        strcpy(output,temp_output);
-     }
--    strcpy(output,temp_output);
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
--#endif
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0042-HAL-add-set-STBC-enable-function.patch b/recipes-ccsp/hal/hal-wifi-patches/0042-HAL-add-set-STBC-enable-function.patch
deleted file mode 100644
index dc435f8..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0042-HAL-add-set-STBC-enable-function.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 10e5cdcde26b21026db4460ded6e0b11c045a96a Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 25 Aug 2022 17:27:06 +0800
-Subject: [PATCH] HAL: add set STBC enable function
-
----
- source/wifi/wifi_hal.c | 61 ++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 59 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 8ec1d0e..34989ea 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -4049,8 +4049,65 @@ INT wifi_setRadioFragmentationThreshold(INT apIndex, UINT threshold)
- // enable STBC mode in the hardwarwe, 0 == not enabled, 1 == enabled
- INT wifi_setRadioSTBCEnable(INT radioIndex, BOOL STBC_Enable)
- {
--    //Save config and Apply instantly
--    return RETURN_ERR;
-+    char config_file[64] = {'\0'};
-+    char cmd[128] = {'\0'};
-+    char buf[64] = {'\0'};
-+    char stbc_config[16] = {'\0'};
-+    wifi_band band;
-+    int iterator = 0;
-+    BOOL current_stbc = FALSE;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    band = wifi_index_to_band(radioIndex);
-+    if (band == band_invalid)
-+        return RETURN_ERR;
-+
-+    if (band == band_2_4)
-+        iterator = 1;
-+    else if (band == band_5)
-+        iterator = 2;
-+    else
-+        return RETURN_OK;
-+
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+
-+    // set ht and vht config
-+    for (int i = 0; i < iterator; i++) {
-+        memset(stbc_config, 0, sizeof(stbc_config));
-+        memset(cmd, 0, sizeof(cmd));
-+        memset(buf, 0, sizeof(buf));
-+        snprintf(stbc_config, sizeof(stbc_config), "%sht_capab", (i == 0)?"":"v");
-+        snprintf(cmd, sizeof(cmd), "cat %s | grep -E '^%s' | grep 'STBC'", config_file, stbc_config);
-+        _syscmd(cmd, buf, sizeof(buf));
-+        if (strlen(buf) != 0)
-+            current_stbc = TRUE;
-+        if (current_stbc == STBC_Enable)
-+            continue;
-+
-+        if (STBC_Enable == TRUE) {
-+            // Append the STBC flags in capab config
-+            memset(cmd, 0, sizeof(cmd));
-+            if (i == 0)
-+                snprintf(cmd, sizeof(cmd), "sed -E -i '/^ht_capab=.*/s/$/[TX-STBC][RX-STBC1]/' %s", config_file);
-+            else
-+                snprintf(cmd, sizeof(cmd), "sed -E -i '/^vht_capab=.*/s/$/[TX-STBC-2BY1][RX-STBC-1]/' %s", config_file);
-+            _syscmd(cmd, buf, sizeof(buf));
-+        } else if (STBC_Enable == FALSE) {
-+            // Remove the STBC flags and remain other flags in capab
-+            memset(cmd, 0, sizeof(cmd));
-+            snprintf(cmd, sizeof(cmd), "sed -E -i 's/\\[TX-STBC(-2BY1)?*\\]//' %s", config_file);
-+            _syscmd(cmd, buf, sizeof(buf));
-+            memset(cmd, 0, sizeof(cmd));
-+            snprintf(cmd, sizeof(cmd), "sed -E -i 's/\\[RX-STBC-?[1-3]*\\]//' %s", config_file);
-+            _syscmd(cmd, buf, sizeof(buf));
-+        }
-+    }
-+
-+    wifi_reloadAp(radioIndex);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
- }
- 
- // outputs A-MSDU enable status, 0 == not enabled, 1 == enabled
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0043-HAL-Refactor-get-and-set-power-functions.patch b/recipes-ccsp/hal/hal-wifi-patches/0043-HAL-Refactor-get-and-set-power-functions.patch
deleted file mode 100644
index 8f6d034..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0043-HAL-Refactor-get-and-set-power-functions.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-From 976808df0118205583d30079ba87b7e25aeeaa6f Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 25 Aug 2022 20:03:10 +0800
-Subject: [PATCH] HAL: Refactor get and set power functions
-
----
- source/wifi/wifi_hal.c | 92 +++++++++++++++++++++++++++++++++++-------
- 1 file changed, 77 insertions(+), 15 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 9be6a11..3aa1938 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2486,25 +2486,23 @@ INT wifi_getRadioTransmitPowerSupported(INT radioIndex, CHAR *output_list) //Tr1
-         return RETURN_OK;
- }
- 
--//Get current Transmit Power, eg "75", "100"
-+//Get current Transmit Power in dBm units.
- //The transmite power level is in units of full power for this radio.
- INT wifi_getRadioTransmitPower(INT radioIndex, ULONG *output_ulong)	//RDKB
- {
-     char cmd[128]={0};
--    char buf[256]={0};
--    INT apIndex;
--    //save config and apply instantly
-+    char buf[16]={0};
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
- 
--    if (NULL == output_ulong) 
-+    if(output_ulong == NULL)
-         return RETURN_ERR;
- 
--    //zqiu:TODO:save config
--    apIndex = (radioIndex==0) ?0 :1;
--
--    snprintf(cmd, sizeof(cmd),  "iwlist %s%d txpower | grep Tx-Power | cut -d'=' -f2", AP_PREFIX, apIndex);
-+    snprintf(cmd, sizeof(cmd),  "iw %s%d info | grep txpower | awk '{print $2}' | cut -d '.' -f1 | tr -d '\\n'", AP_PREFIX, radioIndex);
-     _syscmd(cmd, buf, sizeof(buf));
--    *output_ulong = atol(buf);
- 
-+    *output_ulong = strtol(buf, NULL, 10);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
-@@ -2512,12 +2510,38 @@ INT wifi_getRadioTransmitPower(INT radioIndex, ULONG *output_ulong)	//RDKB
- //The transmite power level is in units of full power for this radio.
- INT wifi_setRadioTransmitPower(INT radioIndex, ULONG TransmitPower)	//RDKB
- {
-+    char *support;
-     char cmd[128]={0};
--    char buf[256]={0};
--    INT apIndex;
-+    char buf[128]={0};
-+    char txpower_str[64] = {0};
-+    int txpower = 0;
-+    int maximum_tx = 0;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
- 
--    snprintf(cmd, sizeof(cmd),  "iwconfig %s%d txpower %lu", AP_PREFIX, radioIndex, TransmitPower);
-+    snprintf(cmd, sizeof(cmd),  "hostapd_cli -i %s%d status | grep max_txpower | cut -d '=' -f2 | tr -d '\n'", AP_PREFIX, radioIndex);
-     _syscmd(cmd, buf, sizeof(buf));
-+    maximum_tx = strtol(buf, NULL, 10);
-+
-+    // Get the Tx power supported list and check that is the input in the list
-+    snprintf(txpower_str, sizeof(txpower_str), "%lu", TransmitPower);
-+    wifi_getRadioTransmitPowerSupported(radioIndex, buf);
-+    support = strtok(buf, ",");
-+    while(true)
-+    {
-+        if(support == NULL) {   // input not in the list
-+            wifi_dbg_printf("Input value is invalid.\n");
-+            return RETURN_ERR;
-+        }
-+        if (strncmp(txpower_str, support, strlen(support)) == 0) {
-+            break;
-+        }
-+        support = strtok(NULL, ",");
-+    }
-+    txpower = TransmitPower*maximum_tx/100;
-+    snprintf(cmd, sizeof(cmd),  "iw phy phy%d set txpower fixed %d00", radioIndex, txpower);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- 
-     return RETURN_OK;
- }
-@@ -9586,8 +9610,46 @@ INT wifi_switchBand(char *interface_name,INT radioIndex,char *freqBand)
- 
- INT wifi_getRadioPercentageTransmitPower(INT apIndex, ULONG *txpwr_pcntg)
- {
--    //TO-Do Implement this
--    txpwr_pcntg = 0;
-+    char cmd[128]={'\0'};
-+    char buf[128]={'\0'};
-+    char *support;
-+    int maximum_tx = 0, current_tx = 0;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if(txpwr_pcntg == NULL)
-+        return RETURN_ERR;
-+
-+    // Get the maximum tx power of the device
-+    snprintf(cmd, sizeof(cmd),  "hostapd_cli -i %s%d status | grep max_txpower | cut -d '=' -f2 | tr -d '\n'", AP_PREFIX, apIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    maximum_tx = strtol(buf, NULL, 10);
-+
-+    // Get the current tx power
-+    memset(cmd, 0, sizeof(cmd));
-+    memset(buf, 0, sizeof(buf));
-+    snprintf(cmd, sizeof(cmd),  "iw %s%d info | grep txpower | awk '{print $2}' | cut -d '.' -f1 | tr -d '\\n'", AP_PREFIX, apIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    current_tx = strtol(buf, NULL, 10);
-+
-+    // Get the power supported list and find the current power percentage in supported list
-+    memset(buf, 0, sizeof(buf));
-+    wifi_getRadioTransmitPowerSupported(apIndex, buf);
-+    support = strtok(buf, ",");
-+    while(true)
-+    {
-+        if(support == NULL) {       // current power is not in supported list, this should not happen if the power is set by hal.
-+            *txpwr_pcntg = 0;
-+            wifi_dbg_printf("current power is not in supported list\n");
-+            return RETURN_ERR;
-+        }
-+        int tmp = maximum_tx*strtol(support, NULL, 10)/100;
-+        if (tmp == current_tx) {
-+            *txpwr_pcntg = strtol(support, NULL, 10);
-+            break;
-+        }
-+        support = strtok(NULL, ",");
-+    }
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0044-HAL-refactor-getApEnable-and-getRadioOperatingChanne.patch b/recipes-ccsp/hal/hal-wifi-patches/0044-HAL-refactor-getApEnable-and-getRadioOperatingChanne.patch
deleted file mode 100644
index a0eff13..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0044-HAL-refactor-getApEnable-and-getRadioOperatingChanne.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 66b11922d4bcf3f4b689b51516beef1f530d908f Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Mon, 29 Aug 2022 13:20:52 +0800
-Subject: [PATCH] HAL: refactor getApEnable and
- getRadioOperatingChannelBandwidth
-
----
- source/wifi/wifi_hal.c | 21 +++++++++++++--------
- 1 file changed, 13 insertions(+), 8 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index ebbe4b0..2ae34d9 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2200,18 +2200,23 @@ INT wifi_setRadioDfsRefreshPeriod(INT radioIndex, ULONG seconds) //Tr181
- //The output_string is a max length 64 octet string that is allocated by the RDKB code.  Implementations must ensure that strings are not longer than this.
- INT wifi_getRadioOperatingChannelBandwidth(INT radioIndex, CHAR *output_string) //Tr181
- {
-+    char cmd[128] = {0}, buf[64] = {0};
-+    char interface_name[64] = {0};
-+    int ret = 0, len=0;
-+    BOOL radio_enable = FALSE;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-     if (NULL == output_string)
-         return RETURN_ERR;
- 
--    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
--    char cmd[1024] = {0}, buf[64] = {0};
--    int ret = 0, len=0;
-+    if (wifi_getRadioEnable(radioIndex, &radio_enable) == RETURN_ERR)
-+        return RETURN_ERR;
- 
--    snprintf(cmd, sizeof(cmd),
--        "ls -1 /sys/class/net/%s%d/device/ieee80211/phy*/device/net/ | "
--        "xargs -I {} iw dev {} info | grep width | head -n1 | "
--        "cut -d ' ' -f6", RADIO_PREFIX, radioIndex);
-+    if (radio_enable != TRUE)
-+        return RETURN_OK;
- 
-+    snprintf(cmd, sizeof(cmd),"iw dev %s%d info | grep 'width' | cut -d  ' ' -f6", AP_PREFIX, radioIndex);
-     ret = _syscmd(cmd, buf, sizeof(buf));
-     len = strlen(buf);
-     if((ret != 0) || (len == 0))
-@@ -5209,7 +5214,7 @@ INT wifi_getApEnable(INT apIndex, BOOL *output_bool)
- 
-     if((apIndex >= 0) && (apIndex < MAX_APS))//Handling 6 APs
-     {
--        sprintf(cmd, "%s%s%d%s", "ifconfig ", AP_PREFIX, apIndex, " | grep UP");
-+        sprintf(cmd, "ifconfig %s%d 2> /dev/null | grep UP", AP_PREFIX, apIndex);
-         *output_bool = _syscmd(cmd,buf,sizeof(buf))?0:1;
-     }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0045-HAL-add-get-channel-stats.patch b/recipes-ccsp/hal/hal-wifi-patches/0045-HAL-add-get-channel-stats.patch
deleted file mode 100644
index 8e0dcc3..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0045-HAL-add-get-channel-stats.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 9e4545526749cc1d7b2eec18020d8329cf278dc0 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Fri, 26 Aug 2022 16:12:05 +0800
-Subject: [PATCH] HAL add get channel stats
-
----
- source/wifi/wifi_hal.c | 76 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 76 insertions(+)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 453e551..f9639a2 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -75,6 +75,7 @@ Licensed under the ISC license
- #define VAP_STATUS_FILE "/tmp/vap-status"
- #define ESSID_FILE "/tmp/essid"
- #define GUARD_INTERVAL_FILE "/tmp/guard-interval"
-+#define CHANNEL_STATS_FILE "/tmp/channel_stats"
- 
- #ifdef MTK_IMPL
- #define DRIVER_2GHZ "mt7915e"
-@@ -1065,6 +1066,81 @@ INT wifi_setRadioCountryCode(INT radioIndex, CHAR *CountryCode)
-     return RETURN_OK;
- }
- 
-+INT wifi_getRadioChannelStats2(INT radioIndex, wifi_channelStats2_t *outputChannelStats2)
-+{
-+    char channel_util_file[64] = {0};
-+    char cmd[128] =  {0};
-+    char buf[128] = {0};
-+    char *line = NULL, *param = NULL, *value = NULL;
-+    int read = 0;
-+    unsigned int ActiveTime = 0, BusyTime = 0, TransmitTime = 0;
-+    unsigned int preActiveTime = 0, preBusyTime = 0, preTransmitTime = 0;
-+    size_t len = 0;
-+    FILE *f = NULL;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    snprintf(cmd, sizeof(cmd), "iw %s%d scan | grep signal | awk '{print $2}' | sort -n | tail -n1", AP_PREFIX, radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    outputChannelStats2->ch_Max80211Rssi = strtol(buf, NULL, 10);
-+
-+    memset(cmd, 0, sizeof(cmd));
-+    memset(buf, 0, sizeof(buf));
-+    snprintf(cmd, sizeof(cmd), "iw %s%d survey dump | grep 'in use' -A6", AP_PREFIX, radioIndex);
-+    if ((f = popen(cmd, "r")) == NULL) {
-+        wifi_dbg_printf("%s: popen %s error\n", __func__, cmd);
-+        return RETURN_ERR;
-+    }
-+
-+    read = getline(&line, &len, f);
-+    while (read != -1) {
-+        param = strtok(line, ":\t");
-+        value = strtok(NULL, " ");
-+        if(strstr(param, "frequency") != NULL) {
-+            outputChannelStats2->ch_Frequency = strtol(value, NULL, 10);
-+        }
-+        if(strstr(param, "noise") != NULL) {
-+            outputChannelStats2->ch_NoiseFloor = strtol(value, NULL, 10);
-+            outputChannelStats2->ch_Non80211Noise = strtol(value, NULL, 10);
-+        }
-+        if(strstr(param, "channel active time") != NULL) {
-+            ActiveTime = strtol(value, NULL, 10);
-+        }
-+        if(strstr(param, "channel busy time") != NULL) {
-+            BusyTime = strtol(value, NULL, 10);
-+        }
-+        if(strstr(param, "channel transmit time") != NULL) {
-+            TransmitTime = strtol(value, NULL, 10);
-+        }
-+        read = getline(&line, &len, f);
-+    }
-+    pclose(f);
-+
-+    // The file should store the last active, busy and transmit time
-+    snprintf(channel_util_file, sizeof(channel_util_file), "%s%d.txt", CHANNEL_STATS_FILE, radioIndex);
-+    f = fopen(channel_util_file, "r");
-+    if (f != NULL) {
-+        read = getline(&line, &len, f);
-+        preActiveTime = strtol(line, NULL, 10);
-+        read = getline(&line, &len, f);
-+        preBusyTime = strtol(line, NULL, 10);
-+        read = getline(&line, &len, f);
-+        preTransmitTime = strtol(line, NULL, 10);
-+        fclose(f);
-+    }
-+
-+    outputChannelStats2->ch_ObssUtil = (BusyTime - preBusyTime)*100/(ActiveTime - preActiveTime);
-+    outputChannelStats2->ch_SelfBssUtil = (TransmitTime - preTransmitTime)*100/(ActiveTime - preActiveTime);
-+
-+    f = fopen(channel_util_file, "w");
-+    if (f != NULL) {
-+        fprintf(f, "%u\n%u\n%u\n", ActiveTime, BusyTime, TransmitTime);
-+        fclose(f);
-+    }
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
- /**********************************************************************************
-  *
-  *  Wifi radio level function prototypes
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0046-HAL-refactor-get-supported-frequency-band-and-suppor.patch b/recipes-ccsp/hal/hal-wifi-patches/0046-HAL-refactor-get-supported-frequency-band-and-suppor.patch
deleted file mode 100644
index 77d8149..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0046-HAL-refactor-get-supported-frequency-band-and-suppor.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From a0d672a77db5281d5001184fec64417560d57187 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Fri, 26 Aug 2022 17:54:48 +0800
-Subject: [PATCH] HAL: refactor get supported frequency band and supported
- standard
-
----
- source/wifi/wifi_hal.c | 57 ++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 55 insertions(+), 2 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 27c8886..76d47cf 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -1276,10 +1276,23 @@ INT wifi_getRadioMaxBitRate(INT radioIndex, CHAR *output_string)	//RDKB
- //The output_string is a max length 64 octet string that is allocated by the RDKB code.  Implementations must ensure that strings are not longer than this.
- INT wifi_getRadioSupportedFrequencyBands(INT radioIndex, CHAR *output_string)	//RDKB
- {
-+    char cmd[128] = {0};
-+    char buf[64] = {0};
-+
-     WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-     if (NULL == output_string)
-         return RETURN_ERR;
--    snprintf(output_string, 64, (radioIndex == 0)?"2.4GHz":"5GHz");
-+
-+    snprintf(cmd, sizeof(cmd), "iw phy%d info | grep 'Band ' | awk '{print $2}' | tr -d ':\n'", radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+
-+    // The value behind Band in phy infomation is an enum, nl80211_band, iw let the value + 1 and print out.
-+    if (strcmp(buf, "1") == 0)
-+        strcpy(output_string, "2.4GHz");
-+    else if (strcmp(buf, "2") == 0)
-+        strcpy(output_string, "5GHz");
-+    else if (strcmp(buf, "4") == 0)     // "3" is for 60GHz
-+        strcpy(output_string, "6GHz");
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- 
-     return RETURN_OK;
-@@ -1455,10 +1468,50 @@ INT wifi_getRadioOperatingFrequencyBand(INT radioIndex, CHAR *output_string) //T
- //The output_string is a max length 64 octet string that is allocated by the RDKB code.  Implementations must ensure that strings are not longer than this.
- INT wifi_getRadioSupportedStandards(INT radioIndex, CHAR *output_string) //Tr181
- {
-+    char cmd[128]={0};
-+    char buf[128]={0};
-+    char temp_output[128] = {0};
-+    wifi_band band;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-     if (NULL == output_string) 
-         return RETURN_ERR;
--    snprintf(output_string, 64, (radioIndex==0)?"b,g,n":"a,n,ac");
- 
-+    band = wifi_index_to_band(radioIndex);
-+    if (band == band_2_4) {
-+        strcat(temp_output, "b,g,");
-+    } else if (band == band_5) {
-+        strcat(temp_output, "a,");
-+    }
-+
-+    // ht capabilities
-+    snprintf(cmd, sizeof(cmd),  "iw phy%d info | grep '[^PHY|MAC|VHT].Capabilities' | head -n 1 | cut -d ':' -f2 | sed 's/^.//' | tr -d '\\n'", radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    if (strncmp(buf, "0x00", 4) != 0) {
-+        strcat(temp_output, "n,");
-+    }
-+
-+    // vht capabilities
-+    if (band == band_5) {
-+        snprintf(cmd, sizeof(cmd),  "iw phy%d info | grep 'VHT Capabilities' | cut -d '(' -f2 | cut -c1-10 | tr -d '\\n'", radioIndex);
-+        _syscmd(cmd, buf, sizeof(buf));
-+        if (strncmp(buf, "0x00000000", 10) != 0) {
-+            strcat(temp_output, "ac,");
-+        }
-+    }
-+
-+    // he capabilities
-+    snprintf(cmd, sizeof(cmd),  "iw phy%d info | grep 'HE MAC Capabilities' | head -n 2 | tail -n 1 | cut -d '(' -f2 | cut -c1-6 | tr -d '\\n'", radioIndex);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    if (strncmp (buf, "0x0000", 6) != 0) {
-+        strcat(temp_output, "ax,");
-+    }
-+
-+    // Remove the last comma
-+    if (strlen(temp_output) != 0)
-+        temp_output[strlen(temp_output)-1] = '\0';
-+    strncpy(output_string, temp_output, strlen(temp_output));
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0047-HAL-add-get-and-set-dfs-enable-and-refactor-dfs-supp.patch b/recipes-ccsp/hal/hal-wifi-patches/0047-HAL-add-get-and-set-dfs-enable-and-refactor-dfs-supp.patch
deleted file mode 100644
index d16d2f9..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0047-HAL-add-get-and-set-dfs-enable-and-refactor-dfs-supp.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 7b736ee3ec6acebeb4fccef1a59afe6d87912935 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Mon, 5 Sep 2022 09:55:10 +0800
-Subject: [PATCH] HAL: add get and set dfs enable and refactor dfs support
-
----
- source/wifi/wifi_hal.c | 50 +++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 47 insertions(+), 3 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 9b7ac7e..05029a3 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -76,6 +76,7 @@ Licensed under the ISC license
- #define ESSID_FILE "/tmp/essid"
- #define GUARD_INTERVAL_FILE "/tmp/guard-interval"
- #define CHANNEL_STATS_FILE "/tmp/channel_stats"
-+#define DFS_ENABLE_FILE "/tmp/dfs_enable.txt"
- 
- #ifdef MTK_IMPL
- #define DRIVER_2GHZ "mt7915e"
-@@ -2264,7 +2265,7 @@ INT wifi_getRadioDfsSupport(INT radioIndex, BOOL *output_bool) //Tr181
- {
-     if (NULL == output_bool) 
-         return RETURN_ERR;
--    *output_bool=FALSE;
-+    *output_bool=TRUE;
-     return RETURN_OK;
- }
- 
-@@ -2306,17 +2307,60 @@ INT wifi_setRadioDCSScanTime(INT radioIndex, INT interval_seconds, INT dwell_mil
- //Get the Dfs enable status
- INT wifi_getRadioDfsEnable(INT radioIndex, BOOL *output_bool)	//Tr181
- {
-+    char buf[16] = {0};
-+    FILE *f = NULL;
-+    wifi_band band;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    *output_bool = TRUE;        // default
-     if (NULL == output_bool) 
-         return RETURN_ERR;
--    *output_bool = FALSE;
- 
-+    band = wifi_index_to_band(radioIndex);
-+    if (band != band_5)
-+        return RETURN_OK;
-+
-+    f = fopen(DFS_ENABLE_FILE, "r");
-+    if (f != NULL) {
-+        fgets(buf, 2, f);
-+        if (strncmp(buf, "0", 0) == 0)
-+            *output_bool = FALSE;
-+        fclose(f);
-+    }
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
- }
- 
- //Set the Dfs enable status
- INT wifi_setRadioDfsEnable(INT radioIndex, BOOL enable)	//Tr181
- {
--    return RETURN_ERR;
-+    char buf[128] = {0};
-+    char config_file[128] = {0};
-+    FILE *f = NULL;
-+    struct params params={0};
-+    wifi_band band;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    band = wifi_index_to_band(radioIndex);
-+    if (band != band_5)
-+        return RETURN_OK;
-+
-+    f = fopen(DFS_ENABLE_FILE, "w");
-+    if (f == NULL)
-+        return RETURN_ERR;
-+    fprintf(f, "%d", enable);
-+    fclose(f);
-+
-+    params.name = "acs_exclude_dfs";
-+    sprintf(buf, "%d", enable?"1":"0");
-+    params.value = buf;
-+    sprintf(config_file, "%s%d.conf", CONFIG_PREFIX, radioIndex);
-+    wifi_hostapdWrite(config_file, &params, 1);
-+    wifi_reloadAp(radioIndex);
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
- }
- 
- //Check if the driver support the AutoChannelRefreshPeriod
--- 
-2.18.0
-
diff --git a/recipes-ccsp/hal/hal-wifi-patches/0048-HAL-refactor-OperatingParameters.patch b/recipes-ccsp/hal/hal-wifi-patches/0048-HAL-refactor-OperatingParameters.patch
deleted file mode 100644
index 662b14a..0000000
--- a/recipes-ccsp/hal/hal-wifi-patches/0048-HAL-refactor-OperatingParameters.patch
+++ /dev/null
@@ -1,509 +0,0 @@
-From bdb9047c372c2ffa801df4be27be075e20e48084 Mon Sep 17 00:00:00 2001
-From: "Allen.Ye" <allen.ye@mediatek.com>
-Date: Thu, 8 Sep 2022 10:07:20 +0800
-Subject: [PATCH] HAL: refactor OperatingParameters
-
----
- source/wifi/wifi_hal.c | 399 +++++++++++++++++++++++++++++++++++++----
- 1 file changed, 360 insertions(+), 39 deletions(-)
-
-diff --git a/source/wifi/wifi_hal.c b/source/wifi/wifi_hal.c
-index 414b60a..d87fd99 100644
---- a/source/wifi/wifi_hal.c
-+++ b/source/wifi/wifi_hal.c
-@@ -2223,6 +2223,28 @@ INT wifi_setBandSteeringApGroup(char *ApGroup)
-     return RETURN_OK;
- }
- 
-+INT wifi_getApDTIMInterval(INT apIndex, INT *dtimInterval)
-+{
-+    char config_file[128] = {'\0'};
-+    char buf[128] = {'\0'};
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (dtimInterval == NULL)
-+        return RETURN_ERR;
-+
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, apIndex);
-+    wifi_hostapdRead(config_file, "dtime_period", buf, sizeof(buf));
-+
-+    if (strlen(buf) == 0) {
-+        *dtimInterval = 2;
-+    } else {
-+        *dtimInterval = strtoul(buf, NULL, 10);
-+    }
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
- INT wifi_setApDTIMInterval(INT apIndex, INT dtimInterval)
- {
-     struct params params={0};
-@@ -10530,79 +10552,371 @@ int main(int argc,char **argv)
- 
- #ifdef WIFI_HAL_VERSION_3
- 
-+INT BitMapToTransmitRates(UINT bitMap, char *BasicRate)
-+{
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    if (bitMap & WIFI_BITRATE_1MBPS)
-+        strcat(BasicRate, "1,");
-+    if (bitMap & WIFI_BITRATE_2MBPS)
-+        strcat(BasicRate, "2,");
-+    if (bitMap & WIFI_BITRATE_5_5MBPS)
-+        strcat(BasicRate, "5.5,");
-+    if (bitMap & WIFI_BITRATE_6MBPS)
-+        strcat(BasicRate, "6,");
-+    if (bitMap & WIFI_BITRATE_9MBPS)
-+        strcat(BasicRate, "9,");
-+    if (bitMap & WIFI_BITRATE_11MBPS)
-+        strcat(BasicRate, "11,");
-+    if (bitMap & WIFI_BITRATE_12MBPS)
-+        strcat(BasicRate, "12,");
-+    if (bitMap & WIFI_BITRATE_18MBPS)
-+        strcat(BasicRate, "18,");
-+    if (bitMap & WIFI_BITRATE_24MBPS)
-+        strcat(BasicRate, "24,");
-+    if (bitMap & WIFI_BITRATE_36MBPS)
-+        strcat(BasicRate, "36,");
-+    if (bitMap & WIFI_BITRATE_48MBPS)
-+        strcat(BasicRate, "48,");
-+    if (bitMap & WIFI_BITRATE_54MBPS)
-+        strcat(BasicRate, "54,");
-+    if (strlen(BasicRate) != 0)     // remove last comma
-+        BasicRate[strlen(BasicRate) - 1] = '\0';
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
-+INT TransmitRatesToBitMap (char *BasicRatesList, UINT *basicRateBitMap)
-+{
-+    UINT BitMap = 0;
-+    char *rate;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+    rate = strtok(BasicRatesList, ",");
-+    while(rate != NULL)
-+    {
-+        if (strcmp(rate, "1") == 0)
-+            BitMap |= WIFI_BITRATE_1MBPS;
-+        else if (strcmp(rate, "2") == 0)
-+            BitMap |= WIFI_BITRATE_2MBPS;
-+        else if (strcmp(rate, "5.5") == 0)
-+            BitMap |= WIFI_BITRATE_5_5MBPS;
-+        else if (strcmp(rate, "6") == 0)
-+            BitMap |= WIFI_BITRATE_6MBPS;
-+        else if (strcmp(rate, "9") == 0)
-+            BitMap |= WIFI_BITRATE_9MBPS;
-+        else if (strcmp(rate, "11") == 0)
-+            BitMap |= WIFI_BITRATE_11MBPS;
-+        else if (strcmp(rate, "12") == 0)
-+            BitMap |= WIFI_BITRATE_12MBPS;
-+        else if (strcmp(rate, "18") == 0)
-+            BitMap |= WIFI_BITRATE_18MBPS;
-+        else if (strcmp(rate, "24") == 0)
-+            BitMap |= WIFI_BITRATE_24MBPS;
-+        else if (strcmp(rate, "36") == 0)
-+            BitMap |= WIFI_BITRATE_36MBPS;
-+        else if (strcmp(rate, "48") == 0)
-+            BitMap |= WIFI_BITRATE_48MBPS;
-+        else if (strcmp(rate, "54") == 0)
-+            BitMap |= WIFI_BITRATE_54MBPS;
-+        rate = strtok(NULL, ",");
-+    }
-+    *basicRateBitMap = BitMap;
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+    return RETURN_OK;
-+}
-+
-+// This API is used to configured all radio operation parameter in a single set. it includes channel number, channelWidth, mode and auto chammel configuration.
- INT wifi_setRadioOperatingParameters(wifi_radio_index_t index, wifi_radio_operationParam_t *operationParam)
- {
--    // The only par-radio parameter is a channel number, however there's a 'dynamic' API
--    // to change it ("wifi_pushRadioChannel2()") that is used instead.
-+    char buf[128] = {0};
-+    char cmd[128] = {0};
-+    char config_file[64] = {0};
-+    int bandwidth;
-+    wifi_ieee80211_Mode set_mode;
-+    wifi_radio_operationParam_t current_param;
-+
-+    WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-+
-+    if (wifi_getRadioOperatingParameters(index, &current_param) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioOperatingParameters return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    if (current_param.enable != operationParam->enable) {
-+        if (wifi_setRadioEnable(index, operationParam->enable) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioEnable return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.autoChannelEnabled != operationParam->autoChannelEnabled) {
-+        if (wifi_setRadioAutoChannelEnable(index, operationParam->autoChannelEnabled) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioAutoChannelEnable return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.channelWidth != operationParam->channelWidth || (current_param.channel != operationParam->channel && !operationParam->autoChannelEnabled)) {
-+        if (operationParam->channelWidth == WIFI_CHANNELBANDWIDTH_20MHZ)
-+            bandwidth = 20;
-+        else if (operationParam->channelWidth == WIFI_CHANNELBANDWIDTH_40MHZ)
-+            bandwidth = 40;
-+        else if (operationParam->channelWidth == WIFI_CHANNELBANDWIDTH_80MHZ)
-+            bandwidth = 80;
-+        else if (operationParam->channelWidth == WIFI_CHANNELBANDWIDTH_160MHZ)
-+            bandwidth = 160;
-+        if (wifi_pushRadioChannel2(index, operationParam->channel, bandwidth, operationParam->csa_beacon_count) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_pushRadioChannel2 return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.variant != operationParam->variant) {
-+        // Two different definition bit map, so need to check every bit.
-+        if (operationParam->variant & WIFI_80211_VARIANT_A)
-+            set_mode |= WIFI_MODE_A;
-+        if (operationParam->variant & WIFI_80211_VARIANT_B)
-+            set_mode |= WIFI_MODE_B;
-+        if (operationParam->variant & WIFI_80211_VARIANT_G)
-+            set_mode |= WIFI_MODE_G;
-+        if (operationParam->variant & WIFI_80211_VARIANT_N)
-+            set_mode |= WIFI_MODE_N;
-+        if (operationParam->variant & WIFI_80211_VARIANT_AC)
-+            set_mode |= WIFI_MODE_AC;
-+        if (operationParam->variant & WIFI_80211_VARIANT_AX)
-+            set_mode |= WIFI_MODE_AX;
-+        // Second parameter is to set channel band width, it is done by wifi_pushRadioChannel2 if changed.
-+        memset(buf, 0, sizeof(buf));
-+        if (wifi_setRadioMode(index, buf, set_mode) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioMode return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.dtimPeriod != operationParam->dtimPeriod) {
-+        if (wifi_setApDTIMInterval(index, operationParam->dtimPeriod) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setApDTIMInterval return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.beaconInterval != operationParam->beaconInterval) {
-+        if (wifi_setRadioBeaconPeriod(index, operationParam->beaconInterval) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioBeaconPeriod return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.operationalDataTransmitRates != operationParam->operationalDataTransmitRates) {
-+        BitMapToTransmitRates(operationParam->operationalDataTransmitRates, buf);
-+        if (wifi_setRadioBasicDataTransmitRates(index, buf) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioBasicDataTransmitRates return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.fragmentationThreshold != operationParam->fragmentationThreshold) {
-+        if (wifi_setRadioFragmentationThreshold(index, operationParam->fragmentationThreshold) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioFragmentationThreshold return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.guardInterval != operationParam->guardInterval) {
-+        if (wifi_setGuardInterval(index, operationParam->guardInterval) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setGuardInterval return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.transmitPower != operationParam->transmitPower) {
-+        if (wifi_setRadioTransmitPower(index, operationParam->transmitPower) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioTransmitPower return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.rtsThreshold != operationParam->rtsThreshold) {
-+        if (wifi_setApRtsThreshold(index, operationParam->rtsThreshold) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setApRtsThreshold return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.obssCoex != operationParam->obssCoex) {
-+        if (wifi_setRadioObssCoexistenceEnable(index, operationParam->obssCoex) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioObssCoexistenceEnable return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.stbcEnable != operationParam->stbcEnable) {
-+        if (wifi_setRadioSTBCEnable(index, operationParam->stbcEnable) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadioSTBCEnable return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    if (current_param.greenFieldEnable != operationParam->greenFieldEnable) {
-+        if (wifi_setRadio11nGreenfieldEnable(index, operationParam->greenFieldEnable) != RETURN_OK) {
-+            fprintf(stderr, "%s: wifi_setRadio11nGreenfieldEnable return error.\n", __func__);
-+            return RETURN_ERR;
-+        }
-+    }
-+    WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-+
-     return RETURN_OK;
- }
- 
- INT wifi_getRadioOperatingParameters(wifi_radio_index_t index, wifi_radio_operationParam_t *operationParam)
- {
--    INT ret;
--    char band[128];
-+    char band[64] = {0};
-+    char buf[256] = {0};
-+    char config_file[64] = {0};
-+    char cmd[128] = {0};
-+    int ret;
-+    int mode = 0;
-+    wifi_ieee80211_Mode get_mode = 0;
-     ULONG channel;
-+    ULONG lval;
-     BOOL enabled;
--    char buf[256];
- 
-     WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
-     printf("Entering %s index = %d\n", __func__, (int)index);
- 
--    ret = wifi_getRadioEnable(index, &enabled);
--    if (ret != RETURN_OK)
-+    memset(operationParam, 0, sizeof(wifi_radio_operationParam_t));
-+    snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, index);
-+    if (wifi_getRadioEnable(index, &enabled) != RETURN_OK)
-     {
--        printf("%s: cannot get enabled state for radio index %d\n", __func__,
--                index);
-+        fprintf(stderr, "%s: wifi_getRadioEnable return error.\n", __func__);
-         return RETURN_ERR;
-     }
-     operationParam->enable = enabled;
- 
-     memset(band, 0, sizeof(band));
--    ret = wifi_getRadioOperatingFrequencyBand(index, band);
--    if (ret != RETURN_OK)
-+    if (wifi_getRadioOperatingFrequencyBand(index, band) != RETURN_OK)
-     {
--        printf("%s: cannot get radio band for radio index %d\n", __func__, index);
-+        fprintf(stderr, "%s: wifi_getRadioOperatingFrequencyBand return error.\n", __func__);
-         return RETURN_ERR;
-     }
- 
-     if (!strcmp(band, "2.4GHz"))
--    {
-         operationParam->band = WIFI_FREQUENCY_2_4_BAND;
--        operationParam->variant = WIFI_80211_VARIANT_N;
--    }
-     else if (!strcmp(band, "5GHz"))
--    {
-         operationParam->band = WIFI_FREQUENCY_5_BAND;
--        operationParam->variant = WIFI_80211_VARIANT_AC;
--    }
-+    else if (!strcmp(band, "6GHz"))
-+        operationParam->band = WIFI_FREQUENCY_6_BAND;
-     else
-     {
--        printf("%s: cannot decode band for radio index %d ('%s')\n", __func__, index,
-+        fprintf(stderr, "%s: cannot decode band for radio index %d ('%s')\n", __func__, index,
-             band);
-     }
- 
-+    wifi_hostapdRead(config_file, "channel", buf, sizeof(buf));
-+    if (strcmp(buf, "0") == 0 || strcmp(buf, "acs_survey") == 0) {
-+        operationParam->channel = 0;
-+        operationParam->autoChannelEnabled = TRUE;
-+    } else {
-+        operationParam->channel = strtol(buf, NULL, 10);
-+        operationParam->autoChannelEnabled = FALSE;
-+    }
-+
-     memset(buf, 0, sizeof(buf));
--    ret = wifi_getRadioOperatingChannelBandwidth(index, buf); // XXX: handle errors
--    // XXX: only handle 20/40/80 modes for now
-+    if (wifi_getRadioOperatingChannelBandwidth(index, buf) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioOperatingChannelBandwidth return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-     if (!strcmp(buf, "20MHz")) operationParam->channelWidth = WIFI_CHANNELBANDWIDTH_20MHZ;
-     else if (!strcmp(buf, "40MHz")) operationParam->channelWidth = WIFI_CHANNELBANDWIDTH_40MHZ;
-     else if (!strcmp(buf, "80MHz")) operationParam->channelWidth = WIFI_CHANNELBANDWIDTH_80MHZ;
-+    else if (!strcmp(buf, "160")) operationParam->channelWidth = WIFI_CHANNELBANDWIDTH_160MHZ;
-+    else if (!strcmp(buf, "80+80")) operationParam->channelWidth = WIFI_CHANNELBANDWIDTH_80_80MHZ;
-     else
-     {
--        printf("%s: Unknown HT mode: '%s'\n", __func__, buf);
--        operationParam->channelWidth = 0;
-+        fprintf(stderr, "Unknown channel bandwidth: %s\n", buf);
-+        return false;
-     }
- 
--    ret = wifi_getRadioChannel(index, &channel);
--    if (ret != RETURN_OK)
--    {
--        printf("%s: Failed to get channel number for radio index %d\n", __func__, index);
--        channel = 0;
-+    if (wifi_getRadioMode(index, buf, &mode) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioMode return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    get_mode = (wifi_ieee80211_Mode)mode;
-+    if (get_mode & WIFI_MODE_A)
-+        operationParam->variant |= WIFI_80211_VARIANT_A;
-+    if (get_mode & WIFI_MODE_B)
-+        operationParam->variant |= WIFI_80211_VARIANT_B;
-+    if (get_mode & WIFI_MODE_G)
-+        operationParam->variant |= WIFI_80211_VARIANT_G;
-+    if (get_mode & WIFI_MODE_N)
-+        operationParam->variant |= WIFI_80211_VARIANT_N;
-+    if (get_mode & WIFI_MODE_AC)
-+        operationParam->variant |= WIFI_80211_VARIANT_AC;
-+    if (get_mode & WIFI_MODE_AX)
-+        operationParam->variant |= WIFI_80211_VARIANT_AX;
-+    if (wifi_getRadioDCSEnable(index, &operationParam->DCSEnabled) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioDCSEnable return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    if (wifi_getApDTIMInterval(index, &operationParam->dtimPeriod) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getApDTIMInterval return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    if (wifi_getRadioBeaconPeriod(index, &operationParam->dtimPeriod) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioBeaconPeriod return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+
-+    memset(buf, 0, sizeof(buf));
-+    if (wifi_getRadioSupportedDataTransmitRates(index, buf) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioSupportedDataTransmitRates return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    TransmitRatesToBitMap(buf, &operationParam->basicDataTransmitRates);
-+
-+    memset(buf, 0, sizeof(buf));
-+    if (wifi_getRadioBasicDataTransmitRates(index, buf) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioBasicDataTransmitRates return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    TransmitRatesToBitMap(buf, &operationParam->operationalDataTransmitRates);
-+
-+    memset(buf, 0, sizeof(buf));
-+    wifi_hostapdRead(config_file, "fragm_threshold", buf, sizeof(buf));
-+    operationParam->fragmentationThreshold = strtoul(buf, NULL, 10);
-+
-+    if (wifi_getGuardInterval(index, &operationParam->guardInterval) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getGuardInterval return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+    if (wifi_getRadioPercentageTransmitPower(index, &operationParam->transmitPower) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadioPercentageTransmitPower return error.\n", __func__);
-+        return RETURN_ERR;
-     }
--    operationParam->channel = channel;
--    operationParam->csa_beacon_count = 15; // XXX: hardcoded for now
- 
--    operationParam->countryCode = wifi_countrycode_US; // XXX: hardcoded for now
-+    memset(buf, 0, sizeof(buf));
-+    wifi_hostapdRead(config_file, "rts_threshold", buf, sizeof(buf));
-+    if (strcmp(buf, "-1") == 0) {
-+        operationParam->rtsThreshold = (UINT)-1;    // maxuimum unsigned integer value
-+        operationParam->ctsProtection = FALSE;
-+    } else {
-+        operationParam->rtsThreshold = strtoul(buf, NULL, 10);
-+        operationParam->ctsProtection = TRUE;
-+    }
-+
-+    memset(buf, 0, sizeof(buf));
-+    wifi_hostapdRead(config_file, "ht_coex", buf, sizeof(buf));
-+    if (strcmp(buf, "0") == 0)
-+        operationParam->obssCoex = FALSE;
-+    else
-+        operationParam->obssCoex = TRUE;
-+
-+    snprintf(cmd, sizeof(cmd), "cat %s | grep STBC", config_file);
-+    _syscmd(cmd, buf, sizeof(buf));
-+    if (strlen(buf) != 0)
-+        operationParam->stbcEnable = TRUE;
-+    else
-+        operationParam->stbcEnable = FALSE;
-+
-+    if (wifi_getRadio11nGreenfieldEnable(index, &operationParam->greenFieldEnable) != RETURN_OK) {
-+        fprintf(stderr, "%s: wifi_getRadio11nGreenfieldEnable return error.\n", __func__);
-+        return RETURN_ERR;
-+    }
-+
-+    // Below value is hardcoded
-+
-+    operationParam->numSecondaryChannels = 0;
-+    for (int i = 0; i < MAXNUMSECONDARYCHANNELS; i++) {
-+        operationParam->channelSecondary[i] = 0;
-+    }
-+    operationParam->csa_beacon_count = 15;
-+    operationParam->countryCode = wifi_countrycode_US;  // need to conver string to corresponding enum
- 
-     WIFI_ENTRY_EXIT_DEBUG("Exiting %s:%d\n",__func__, __LINE__);
-     return RETURN_OK;
-@@ -10784,6 +11098,7 @@ static int getRadioCapabilities(int radioIndex, wifi_radio_capabilities_t *rcap)
-     wifi_channels_list_t *chlistp;
-     CHAR output_string[64];
-     CHAR pchannels[128];
-+    wifi_band band;
- 
-     if(rcap == NULL)
-     {
-@@ -10791,11 +11106,14 @@ static int getRadioCapabilities(int radioIndex, wifi_radio_capabilities_t *rcap)
-     }
- 
-     rcap->numSupportedFreqBand = 1;
--    if (1 == radioIndex)
--      rcap->band[0] = WIFI_FREQUENCY_5_BAND;
--    else
--      rcap->band[0] = WIFI_FREQUENCY_2_4_BAND;
-+    band = wifi_index_to_band(radioIndex);
- 
-+    if (band == band_2_4)
-+        rcap->band[0] = WIFI_FREQUENCY_2_4_BAND;
-+    else if (band == band_5)
-+        rcap->band[0] = WIFI_FREQUENCY_5_BAND;
-+    else if (band == band_6)
-+        rcap->band[0] = WIFI_FREQUENCY_6_BAND;
- 
-     chlistp = &(rcap->channel_list[0]);
-     memset(pchannels, 0, sizeof(pchannels));
-@@ -10854,7 +11172,7 @@ static int getRadioCapabilities(int radioIndex, wifi_radio_capabilities_t *rcap)
-                                 WIFI_CHANNELBANDWIDTH_40MHZ);
- 
-     }
--    else if (rcap->band[i] & (WIFI_FREQUENCY_5_BAND )) {
-+    else if (rcap->band[i] & (WIFI_FREQUENCY_5_BAND ) || rcap->band[i] & (WIFI_FREQUENCY_6_BAND)) {
-         rcap->channelWidth[i] |= (WIFI_CHANNELBANDWIDTH_20MHZ |
-                                 WIFI_CHANNELBANDWIDTH_40MHZ |
-                                 WIFI_CHANNELBANDWIDTH_80MHZ | WIFI_CHANNELBANDWIDTH_160MHZ);
-@@ -10864,10 +11182,13 @@ static int getRadioCapabilities(int radioIndex, wifi_radio_capabilities_t *rcap)
-     /* mode - all supported variants */
-     // rcap->mode[i] = WIFI_80211_VARIANT_H;
-     if (rcap->band[i] & WIFI_FREQUENCY_2_4_BAND ) {
--        rcap->mode[i] = (WIFI_80211_VARIANT_N);
-+        rcap->mode[i] = ( WIFI_80211_VARIANT_B | WIFI_80211_VARIANT_G | WIFI_80211_VARIANT_N | WIFI_80211_VARIANT_AX );
-     }
-     else if (rcap->band[i] & WIFI_FREQUENCY_5_BAND ) {
--        rcap->mode[i] = ( WIFI_80211_VARIANT_AC );
-+        rcap->mode[i] = ( WIFI_80211_VARIANT_A | WIFI_80211_VARIANT_N | WIFI_80211_VARIANT_AC | WIFI_80211_VARIANT_AX );
-+    }
-+    else if (rcap->band[i] & WIFI_FREQUENCY_6_BAND) {
-+        rcap->mode[i] = ( WIFI_80211_VARIANT_AX );
-     }
-     rcap->maxBitRate[i] = ( rcap->band[i] & WIFI_FREQUENCY_2_4_BAND ) ? 300 :
-         ((rcap->band[i] & WIFI_FREQUENCY_5_BAND) ? 1734 : 0);
-@@ -10878,7 +11199,7 @@ static int getRadioCapabilities(int radioIndex, wifi_radio_capabilities_t *rcap)
-         rcap->supportedBitRate[i] |= (WIFI_BITRATE_6MBPS | WIFI_BITRATE_9MBPS |
-                                     WIFI_BITRATE_11MBPS | WIFI_BITRATE_12MBPS);
-     }
--    else if (rcap->band[i] & (WIFI_FREQUENCY_5_BAND )) {
-+    else if (rcap->band[i] & (WIFI_FREQUENCY_5_BAND ) | rcap->band[i] & (WIFI_FREQUENCY_6_BAND )) {
-         rcap->supportedBitRate[i] |= (WIFI_BITRATE_6MBPS | WIFI_BITRATE_9MBPS |
-                                     WIFI_BITRATE_12MBPS | WIFI_BITRATE_18MBPS | WIFI_BITRATE_24MBPS |
-                                     WIFI_BITRATE_36MBPS | WIFI_BITRATE_48MBPS | WIFI_BITRATE_54MBPS);
--- 
-2.18.0
-