[rdkb][common][hal][Refactor setRadioExtChannel and pushRadioChannel2]
[Description]
Refactor setRadioExtChannel and pushRadioChannel2
1. If someone set STBC disable and set channel again, STBC will be enabled
[Release-log]
diff --git a/src/wifi/wifi_hal.c b/src/wifi/wifi_hal.c
index ed97992..8543f94 100644
--- a/src/wifi/wifi_hal.c
+++ b/src/wifi/wifi_hal.c
@@ -134,9 +134,7 @@
#define DEF_RADIO_PARAM_CONF "/usr/ccsp/wifi/radio_param_def.cfg"
#define LM_DHCP_CLIENT_FORMAT "%63d %17s %63s %63s"
-#define HOSTAPD_HT_CAPAB_20 "[SHORT-GI-20]"
-#define HOSTAPD_HT_CAPAB_40 "[SHORT-GI-20][SHORT-GI-40]"
-#define HOSTAPD_HT_CAPAB "[LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935]"
+#define HOSTAPD_HT_CAPAB "[LDPC][SHORT-GI-20][SHORT-GI-40][MAX-AMSDU-7935]"
#define BW_FNAME "/nvram/bw_file.txt"
@@ -8231,6 +8229,9 @@
char ht_mode[16] = ""; // HT20|HT40|HT80|HT160
int sec_chan_offset;
int width;
+ char config_file[64] = {0};
+ BOOL stbcEnable = FALSE;
+ snprintf(config_file, sizeof(config_file), "%s%d.conf", CONFIG_PREFIX, radioIndex);
WIFI_ENTRY_EXIT_DEBUG("Inside %s:%d\n",__func__, __LINE__);
@@ -8276,6 +8277,11 @@
wifi_setRadioChannel(radioIndex, channel);
+ snprintf(cmd, sizeof(cmd), "cat %s | grep STBC", config_file);
+ _syscmd(cmd, buf, sizeof(buf));
+ if (strlen(buf) != 0)
+ stbcEnable = TRUE;
+
char *ext_str = "None";
if (sec_chan_offset == 1) ext_str = "Above";
else if (sec_chan_offset == -1) ext_str = "Below";
@@ -8283,6 +8289,8 @@
wifi_setRadioCenterChannel(radioIndex, center_chan);
+ wifi_setRadioSTBCEnable(radioIndex, stbcEnable);
+
char mhz_str[16];
snprintf(mhz_str, sizeof(mhz_str), "%dMHz", width);
wifi_setRadioOperatingChannelBandwidth(radioIndex, mhz_str);