[rdk-b][mt7986][wifi-hal][Add Obss coexistence enable]
[Description]
Add Obss coexistence enable function with mt76 vendor command.
[Release-log]
N/A
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
new file mode 100644
index 0000000..8bf3957
--- /dev/null
+++ b/recipes-ccsp/hal/hal-wifi-patches/0036-HAL-add-Obss-Coexistence-Enable-function.patch
@@ -0,0 +1,41 @@
+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
+