[rdk-b][mt7986][wifi-hal][Add tri-band support]

[Description]
Add hal tri-band support, and the function transform radio index to band by checking frequency.
After this patch the hal function should consider tri-band and transform index to band if needed.
And some previous hal may need to be refactored with the change. This will be done after short-term target finished.
WiFi-agent also use hal to determine which index present in which band. WiFi-agent will still work with this change.

[Release-log]
N/A

Change-Id: I4f44f4db61ba1006796834f1223bace56d94cbb3
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
new file mode 100644
index 0000000..e36fbec
--- /dev/null
+++ b/recipes-ccsp/hal/hal-wifi-patches/0038-HAL-add-tri-band-support-and-index-to-band.patch
@@ -0,0 +1,53 @@
+From 3d455f415b25ba719445281c208575d086b907b3 Mon Sep 17 00:00:00 2001
+From: "Allen.Ye" <allen.ye@mediatek.com>
+Date: Wed, 17 Aug 2022 17:24:41 +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 1d7833d..f4430ba 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}");
++    _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
+