[rdk-b][mt7986][wifi-hal][Add setRadioSTBCEnable]

[Description]
Add setRadioSTBCEnable

[Release-log]
N/A

diff --git a/src/wifi/wifi_hal.c b/src/wifi/wifi_hal.c
index 265d5f2..a29a5b7 100644
--- a/src/wifi/wifi_hal.c
+++ b/src/wifi/wifi_hal.c
@@ -4031,8 +4031,65 @@
 // 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