[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
13482d3 [MAC80211][hostapd][Add interworking uci config]
2447dde [MAC80211][hostapd][rebase patch based on 2023-03-29]

[Release-log]

Change-Id: Id9b655408884293a1cab3791c8c60a4c832038e9
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/432-missing-typedef.patch b/recipes-wifi/hostapd/files/patches-2.10.3/432-missing-typedef.patch
deleted file mode 100644
index 7a100f1..0000000
--- a/recipes-wifi/hostapd/files/patches-2.10.3/432-missing-typedef.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/drivers/linux_wext.h
-+++ b/src/drivers/linux_wext.h
-@@ -26,6 +26,7 @@ typedef int32_t __s32;
- typedef uint16_t __u16;
- typedef int16_t __s16;
- typedef uint8_t __u8;
-+typedef int8_t __s8;
- #ifndef __user
- #define __user
- #endif /* __user */
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0101-hostapd-mtk-Fix-CCA-issue.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-CCA-issue.patch
similarity index 88%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0101-hostapd-mtk-Fix-CCA-issue.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-CCA-issue.patch
index 9b46d70..e4667e4 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0101-hostapd-mtk-Fix-CCA-issue.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0029-hostapd-mtk-Fix-CCA-issue.patch
@@ -1,12 +1,12 @@
-From 39a0dd44653f12ce13af68de81bfae683669623a Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Thu, 11 May 2023 14:08:59 +0800
-Subject: [PATCH 101/103] hostapd: mtk: Fix CCA issue
+From c92a1e50abdad2bf3e961c9d5aa34baea81f025b Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 3 May 2023 14:55:18 +0800
+Subject: [PATCH] hostapd: mtk: Fix CCA issue
 
-When receiving CCA related nl80211 command, hostapd used to work on
+When receiving CCA-related nl80211 commands, hostapd used to work on
 struct wpa_driver_nl80211_data, whose ctx always points to
-hostpad_iface->bss[0]. However, CCA command is sent on per-BSS based.
-This patch makes hostapd handle CCA related commands on per-BSS based.
+hostpad_iface->bss[0]. However, CCA commands are sent on a per-BSS based.
+This patch makes hostapd handle CCA-related commands on a per-BSS based.
 
 Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
 ---
@@ -93,5 +93,5 @@
  #endif /* CONFIG_IEEE80211AX */
  	default:
 -- 
-2.18.0
+2.25.1
 
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0030-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
similarity index 66%
rename from recipes-wifi/hostapd/files/patches-2.10.3/mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
rename to recipes-wifi/hostapd/files/patches-2.10.3/mtk-0030-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
index 4075531..f9c4714 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/mtk-0030-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch
@@ -1,15 +1,14 @@
-From 097b204ffed838a4bbf7649fb23310f64ace22ad Mon Sep 17 00:00:00 2001
-From: Evelyn Tsai <evelyn.tsai@mediatek.com>
-Date: Thu, 11 May 2023 14:12:44 +0800
-Subject: [PATCH 102/103] hostapd: mtk: Fix unexpected AP beacon state
- transition
+From c4d3890bbf1bd8c8ac8bfaa56fd16e2391e05181 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Wed, 3 May 2023 16:10:57 +0800
+Subject: [PATCH] hostapd: mtk: Fix unexpected AP beacon state transition
 
-When AP fails setting the beacon, it assigns bss->beacon_set to 0 no
+When AP fails to set the beacon, it assigns bss->beacon_set to 0 no
 matter what the error number is.
 However, in the case that the error number is -EBUSY, the driver might
 not free the beacon and expect a later beacon re-setting. If hostapd set
-a new beacon under this case, driver will return -EALREADY.
-This patch checks the error number after hostapd fails setting the
+a new beacon under this case, the driver will return -EALREADY.
+This patch checks the error number after hostapd fails to set the
 beacon. If the error number is -EBUSY, bss->beacon_set will not be
 assigned to 0.
 
@@ -19,7 +18,7 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 8400e57..ccfc2d0 100644
+index 8400e57..5013207 100644
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
 @@ -5126,7 +5126,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
@@ -33,5 +32,5 @@
  		bss->flink->beacon_set = 1;
  		nl80211_set_bss(bss, params->cts_protect, params->preamble,
 -- 
-2.18.0
+2.25.1
 
diff --git a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
index a71c43f..38ca4d8 100644
--- a/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
+++ b/recipes-wifi/hostapd/files/patches-2.10.3/patches.inc
@@ -36,7 +36,6 @@
     file://420-indicate-features.patch \
     file://430-hostapd_cli_ifdef.patch \
     file://431-wpa_cli_ifdef.patch \
-    file://432-missing-typedef.patch \
     file://450-scan_wait.patch;apply=no \
     file://460-wpa_supplicant-add-new-config-params-to-be-used-with.patch \
     file://463-add-mcast_rate-to-11s.patch \
@@ -87,8 +86,8 @@
     file://mtk-0026-hostapd-mtk-avoid-setting-beacon-after-wpa_supplican.patch \
     file://mtk-0027-hostapd-mtk-Fix-setting-wrong-seg0-index-for-5G-cent.patch \
     file://mtk-0028-hostapd-mtk-Add-muru-user-number-debug-command.patch \
+    file://mtk-0029-hostapd-mtk-Fix-CCA-issue.patch \
+    file://mtk-0030-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch \
     file://mtk-0100-hostapd-mtk-update-eht-operation-element.patch \
-    file://mtk-0101-hostapd-mtk-Fix-CCA-issue.patch \
-    file://mtk-0102-hostapd-mtk-Fix-unexpected-AP-beacon-state-transitio.patch \
     file://mtk-0103-hostapd-mtk-Add-BW320-channel-switch-command.patch \
     "
diff --git a/recipes-wifi/hostapd/hostapd_2.10.3.bb b/recipes-wifi/hostapd/hostapd_2.10.3.bb
index 68cb4c2..06874d3 100644
--- a/recipes-wifi/hostapd/hostapd_2.10.3.bb
+++ b/recipes-wifi/hostapd/hostapd_2.10.3.bb
@@ -68,6 +68,7 @@
     echo "CONFIG_WEP=y" >> ${B}/.config
     echo "CONFIG_FILS=y" >> ${B}/.config
     echo "CONFIG_IEEE80211BE=y" >> ${B}/.config
+    echo "CONFIG_TESTING_OPTIONS=y" >> ${B}/.config
 }
 
 do_filogic_patches() {
diff --git a/recipes-wifi/hostapd/hostapd_2.10.bb b/recipes-wifi/hostapd/hostapd_2.10.bb
index 8f54916..e83d34e 100644
--- a/recipes-wifi/hostapd/hostapd_2.10.bb
+++ b/recipes-wifi/hostapd/hostapd_2.10.bb
@@ -67,6 +67,7 @@
     echo "CONFIG_MESH=y" >> ${B}/.config
     echo "CONFIG_WEP=y" >> ${B}/.config
     echo "CONFIG_FILS=y" >> ${B}/.config
+    echo "CONFIG_TESTING_OPTIONS=y" >> ${B}/.config
 }
 
 do_filogic_patches() {