[rdk-b][common][bsp][Refactor and sync kernel/wifi from Openwrt]

[Description]
Refactor and sync kernel/wifi from Openwrt
1. wifi release from mt76 openwrt 2022/12/19

[Release-log]
N/A

diff --git a/recipes-wifi/hostapd/files/patches/760-dynamic_own_ip.patch b/recipes-wifi/hostapd/files/patches/760-dynamic_own_ip.patch
new file mode 100644
index 0000000..3d2b59e
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches/760-dynamic_own_ip.patch
@@ -0,0 +1,109 @@
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -311,6 +311,7 @@ struct hostapd_bss_config {
+ 	unsigned int eap_sim_db_timeout;
+ 	int eap_server_erp; /* Whether ERP is enabled on internal EAP server */
+ 	struct hostapd_ip_addr own_ip_addr;
++	int dynamic_own_ip_addr;
+ 	char *nas_identifier;
+ 	struct hostapd_radius_servers *radius;
+ 	int acct_interim_interval;
+--- a/src/radius/radius_client.c
++++ b/src/radius/radius_client.c
+@@ -163,6 +163,8 @@ struct radius_client_data {
+ 	 */
+ 	void *ctx;
+ 
++	struct hostapd_ip_addr local_ip;
++
+ 	/**
+ 	 * conf - RADIUS client configuration (list of RADIUS servers to use)
+ 	 */
+@@ -720,6 +722,30 @@ static void radius_client_list_add(struc
+ 
+ 
+ /**
++ * radius_client_send - Get local address for the RADIUS auth socket
++ * @radius: RADIUS client context from radius_client_init()
++ * @addr: pointer to store the address
++ *
++ * This function returns the local address for the connection to the RADIUS
++ * auth server. It also opens the socket if it's not available yet.
++ */
++int radius_client_get_local_addr(struct radius_client_data *radius,
++				 struct hostapd_ip_addr *addr)
++{
++	struct hostapd_radius_servers *conf = radius->conf;
++
++	if (conf->auth_server && radius->auth_sock < 0)
++		radius_client_init_auth(radius);
++
++	if (radius->auth_sock < 0)
++		return -1;
++
++	memcpy(addr, &radius->local_ip, sizeof(*addr));
++
++	return 0;
++}
++
++/**
+  * radius_client_send - Send a RADIUS request
+  * @radius: RADIUS client context from radius_client_init()
+  * @msg: RADIUS message to be sent
+@@ -1238,6 +1264,10 @@ radius_change_server(struct radius_clien
+ 			wpa_printf(MSG_DEBUG, "RADIUS local address: %s:%u",
+ 				   inet_ntoa(claddr.sin_addr),
+ 				   ntohs(claddr.sin_port));
++			if (auth) {
++				radius->local_ip.af = AF_INET;
++				radius->local_ip.u.v4 = claddr.sin_addr;
++			}
+ 		}
+ 		break;
+ #ifdef CONFIG_IPV6
+@@ -1249,6 +1279,10 @@ radius_change_server(struct radius_clien
+ 				   inet_ntop(AF_INET6, &claddr6.sin6_addr,
+ 					     abuf, sizeof(abuf)),
+ 				   ntohs(claddr6.sin6_port));
++			if (auth) {
++				radius->local_ip.af = AF_INET6;
++				radius->local_ip.u.v6 = claddr6.sin6_addr;
++			}
+ 		}
+ 		break;
+ 	}
+--- a/src/radius/radius_client.h
++++ b/src/radius/radius_client.h
+@@ -249,6 +249,8 @@ int radius_client_register(struct radius
+ void radius_client_set_interim_error_cb(struct radius_client_data *radius,
+ 					void (*cb)(const u8 *addr, void *ctx),
+ 					void *ctx);
++int radius_client_get_local_addr(struct radius_client_data *radius,
++				 struct hostapd_ip_addr * addr);
+ int radius_client_send(struct radius_client_data *radius,
+ 		       struct radius_msg *msg,
+ 		       RadiusType msg_type, const u8 *addr);
+--- a/src/ap/ieee802_1x.c
++++ b/src/ap/ieee802_1x.c
+@@ -535,6 +535,10 @@ int add_common_radius_attr(struct hostap
+ 	struct hostapd_radius_attr *attr;
+ 	int len;
+ 
++	if (hapd->conf->dynamic_own_ip_addr)
++		radius_client_get_local_addr(hapd->radius,
++					     &hapd->conf->own_ip_addr);
++
+ 	if (!hostapd_config_get_radius_attr(req_attr,
+ 					    RADIUS_ATTR_NAS_IP_ADDRESS) &&
+ 	    hapd->conf->own_ip_addr.af == AF_INET &&
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -2681,6 +2681,8 @@ static int hostapd_config_fill(struct ho
+ 	} else if (os_strcmp(buf, "iapp_interface") == 0) {
+ 		wpa_printf(MSG_INFO, "DEPRECATED: iapp_interface not used");
+ #endif /* CONFIG_IAPP */
++	} else if (os_strcmp(buf, "dynamic_own_ip_addr") == 0) {
++		bss->dynamic_own_ip_addr = atoi(pos);
+ 	} else if (os_strcmp(buf, "own_ip_addr") == 0) {
+ 		if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) {
+ 			wpa_printf(MSG_ERROR,
diff --git a/recipes-wifi/hostapd/files/patches/99900-hostapd-mtk-Add-neighbor-report-and-BSS-Termination.patch b/recipes-wifi/hostapd/files/patches/99900-hostapd-mtk-Add-neighbor-report-and-BSS-Termination.patch
index 28af8ef..f790577 100644
--- a/recipes-wifi/hostapd/files/patches/99900-hostapd-mtk-Add-neighbor-report-and-BSS-Termination.patch
+++ b/recipes-wifi/hostapd/files/patches/99900-hostapd-mtk-Add-neighbor-report-and-BSS-Termination.patch
@@ -1,7 +1,7 @@
-From af1bd5256cc764fb222f9809996851ff3d879699 Mon Sep 17 00:00:00 2001
+From 4791a374c9861b0d90db7fbdefe509f4e7d12247 Mon Sep 17 00:00:00 2001
 From: "howard.hsu" <howard-yh.hsu@mediatek.com>
 Date: Wed, 19 Jan 2022 19:18:07 +0800
-Subject: [PATCH 99900/99909] hostapd: mtk: Add neighbor report and BSS
+Subject: [PATCH 99900/99910] hostapd: mtk: Add neighbor report and BSS
  Termination for MBO certification
 
 1. Add hostapd_neighbor_count() and hostapd_neighbor_insert_buffer ()
diff --git a/recipes-wifi/hostapd/files/patches/99901-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch b/recipes-wifi/hostapd/files/patches/99901-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
index 054dfb0..3c5137d 100644
--- a/recipes-wifi/hostapd/files/patches/99901-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches/99901-hostapd-mtk-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,7 +1,7 @@
-From f5c37c459c33bb8e228a88ba8efdea68bb75abd3 Mon Sep 17 00:00:00 2001
+From 6d95c027c13fba5404fa8d096d55b4a072b2ec59 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Tue, 20 Sep 2022 19:33:45 +0800
-Subject: [PATCH 99901/99909] hostapd: mtk: print sae groups by hostapd ctrl
+Subject: [PATCH 99901/99910] hostapd: mtk: print sae groups by hostapd ctrl
 
 ---
  hostapd/ctrl_iface.c | 13 +++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches/99902-hostapd-mtk-add-support-for-runtime-set-in-band-dis.patch b/recipes-wifi/hostapd/files/patches/99902-hostapd-mtk-add-support-for-runtime-set-in-band-dis.patch
index 6fa23c0..885c6c9 100644
--- a/recipes-wifi/hostapd/files/patches/99902-hostapd-mtk-add-support-for-runtime-set-in-band-dis.patch
+++ b/recipes-wifi/hostapd/files/patches/99902-hostapd-mtk-add-support-for-runtime-set-in-band-dis.patch
@@ -1,7 +1,7 @@
-From ce684a1adac0b5b699482924eb86f8f1b8205e57 Mon Sep 17 00:00:00 2001
+From 7a84545afb1f5bc2784eb5a046d56d869fb52067 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Tue, 31 May 2022 21:15:54 +0800
-Subject: [PATCH 99902/99909] hostapd: mtk: add support for runtime set in-band
+Subject: [PATCH 99902/99910] hostapd: mtk: add support for runtime set in-band
  discovery
 
 Usage:
diff --git a/recipes-wifi/hostapd/files/patches/99903-hostapd-mtk-Add-mtk_vendor.h.patch b/recipes-wifi/hostapd/files/patches/99903-hostapd-mtk-Add-mtk_vendor.h.patch
index a15287e..d108ca3 100644
--- a/recipes-wifi/hostapd/files/patches/99903-hostapd-mtk-Add-mtk_vendor.h.patch
+++ b/recipes-wifi/hostapd/files/patches/99903-hostapd-mtk-Add-mtk_vendor.h.patch
@@ -1,7 +1,7 @@
-From e4b9b5847090d25009a4cf104052ba0490e95ffe Mon Sep 17 00:00:00 2001
+From 8694400211d08019e4c495fc98ca3e3783465044 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 15:04:57 +0800
-Subject: [PATCH 99903/99909] hostapd: mtk: Add mtk_vendor.h
+Subject: [PATCH 99903/99910] hostapd: mtk: Add mtk_vendor.h
 
 ---
  src/common/mtk_vendor.h | 195 ++++++++++++++++++++++++++++++++++++++++
diff --git a/recipes-wifi/hostapd/files/patches/99904-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch b/recipes-wifi/hostapd/files/patches/99904-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
index 40dded6..e9bb053 100644
--- a/recipes-wifi/hostapd/files/patches/99904-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
+++ b/recipes-wifi/hostapd/files/patches/99904-hostapd-mtk-Support-EDCCA-hostapd-configuration.patch
@@ -1,7 +1,7 @@
-From cef7f515eafeeaa99933cc9e66c79b705e3ab065 Mon Sep 17 00:00:00 2001
+From d3d5b514064036fb17729743fa13e25646f468e9 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Mon, 30 May 2022 16:31:34 +0800
-Subject: [PATCH 99904/99909] hostapd: mtk: Support EDCCA hostapd configuration
+Subject: [PATCH 99904/99910] hostapd: mtk: Support EDCCA hostapd configuration
 
 edcca_enable and edcca_compensation and implement edcca related handlers.
 ---
diff --git a/recipes-wifi/hostapd/files/patches/99905-hostapd-mtk-Add-hostapd-HEMU-SET-GET-control.patch b/recipes-wifi/hostapd/files/patches/99905-hostapd-mtk-Add-hostapd-HEMU-SET-GET-control.patch
index 18617be..1a622f3 100644
--- a/recipes-wifi/hostapd/files/patches/99905-hostapd-mtk-Add-hostapd-HEMU-SET-GET-control.patch
+++ b/recipes-wifi/hostapd/files/patches/99905-hostapd-mtk-Add-hostapd-HEMU-SET-GET-control.patch
@@ -1,7 +1,7 @@
-From a288f97e708bc579e285b509f7c0655c2f27a76c Mon Sep 17 00:00:00 2001
+From 893c5f92257a7313a179dc728ba51a74efbfc74a Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Tue, 9 Aug 2022 10:23:44 -0700
-Subject: [PATCH 99905/99909] hostapd: mtk: Add hostapd HEMU SET/GET control
+Subject: [PATCH 99905/99910] hostapd: mtk: Add hostapd HEMU SET/GET control
 
 ---
  hostapd/config_file.c             |   9 +++
diff --git a/recipes-wifi/hostapd/files/patches/99906-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-.patch b/recipes-wifi/hostapd/files/patches/99906-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-.patch
index fc81ed1..594e476 100644
--- a/recipes-wifi/hostapd/files/patches/99906-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-.patch
+++ b/recipes-wifi/hostapd/files/patches/99906-hostapd-mtk-Add-three-wire-PTA-ctrl-hostapd-vendor-.patch
@@ -1,7 +1,7 @@
-From 26c6be11e7597490ccc4d7704542c78dec6c4cd1 Mon Sep 17 00:00:00 2001
+From c91612769eba54821da1136d5959a40438c02824 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 2 Sep 2022 01:03:23 +0800
-Subject: [PATCH 99906/99909] hostapd: mtk: Add three wire PTA ctrl hostapd
+Subject: [PATCH 99906/99910] hostapd: mtk: Add three wire PTA ctrl hostapd
  vendor command
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/recipes-wifi/hostapd/files/patches/99907-hostapd-mtk-Add-hostapd-iBF-control.patch b/recipes-wifi/hostapd/files/patches/99907-hostapd-mtk-Add-hostapd-iBF-control.patch
index 50a08ba..c37cb40 100644
--- a/recipes-wifi/hostapd/files/patches/99907-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/recipes-wifi/hostapd/files/patches/99907-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 1f60afd21c6dd7dfe3d504dee7507654a981033b Mon Sep 17 00:00:00 2001
+From 4971762bfaba906054d43bd2d042c436a1ac97b2 Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 99907/99909] hostapd: mtk: Add hostapd iBF control
+Subject: [PATCH 99907/99910] hostapd: mtk: Add hostapd iBF control
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
diff --git a/recipes-wifi/hostapd/files/patches/99908-hostapd-mtk-Do-not-include-HE-capab-IE-if-associate.patch b/recipes-wifi/hostapd/files/patches/99908-hostapd-mtk-Do-not-include-HE-capab-IE-if-associate.patch
index 9b96d98..47628d7 100644
--- a/recipes-wifi/hostapd/files/patches/99908-hostapd-mtk-Do-not-include-HE-capab-IE-if-associate.patch
+++ b/recipes-wifi/hostapd/files/patches/99908-hostapd-mtk-Do-not-include-HE-capab-IE-if-associate.patch
@@ -1,7 +1,7 @@
-From 28228a96980512f30c8c8aac0f819c36f7241b68 Mon Sep 17 00:00:00 2001
+From f96a62568fb3c419e71f8d7469d485dce55f4da6 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Thu, 22 Sep 2022 16:08:09 +0800
-Subject: [PATCH 99908/99909] hostapd: mtk: Do not include HE capab IE if
+Subject: [PATCH 99908/99910] hostapd: mtk: Do not include HE capab IE if
  associated sta's HE capab IE is invalid
 
 ---
diff --git a/recipes-wifi/hostapd/files/patches/99909-hostapd-mtk-Add-DFS-and-ZWDFS-support.patch b/recipes-wifi/hostapd/files/patches/99909-hostapd-mtk-Add-DFS-and-ZWDFS-support.patch
index 8da9b5f..c1fc3f1 100644
--- a/recipes-wifi/hostapd/files/patches/99909-hostapd-mtk-Add-DFS-and-ZWDFS-support.patch
+++ b/recipes-wifi/hostapd/files/patches/99909-hostapd-mtk-Add-DFS-and-ZWDFS-support.patch
@@ -1,7 +1,7 @@
-From 737d21c64ab0ac49e9cce7185f1f79bb0b71f50e Mon Sep 17 00:00:00 2001
+From 782f38f2eec27e438e55cb09e824a6ffc1c3eb18 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 7 Oct 2022 10:46:29 +0800
-Subject: [PATCH 99909/99909] hostapd: mtk: Add DFS and ZWDFS support
+Subject: [PATCH 99909/99910] hostapd: mtk: Add DFS and ZWDFS support
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
diff --git a/recipes-wifi/hostapd/files/patches/99910-hostapd-mtk-Add-amsdu-set-get-ctrl.patch b/recipes-wifi/hostapd/files/patches/99910-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
index db334ed..c05a444 100644
--- a/recipes-wifi/hostapd/files/patches/99910-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
+++ b/recipes-wifi/hostapd/files/patches/99910-hostapd-mtk-Add-amsdu-set-get-ctrl.patch
@@ -1,7 +1,7 @@
-From 41664bc1e66af23e0c664cd67c04bf1dd7985704 Mon Sep 17 00:00:00 2001
-From: TomLiu <tomml.liu@mediatek.com>
-Date: Wed, 14 Dec 2022 01:08:56 -0800
-Subject: [PATCH] [hostapd]amsdu-config-set-and-hostapd_cli-get-commands
+From 6cf5ec59e09945a075909b8070d9795869db081e Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Fri, 16 Dec 2022 03:57:11 +0800
+Subject: [PATCH 99910/99910] hostapd: mtk: Add amsdu set get ctrl
 
 ---
  hostapd/config_file.c             |   9 +++
@@ -240,7 +240,7 @@
  
  /**
 diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 7472542..6702384 100644
+index 003adc4..5c04284 100644
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
 @@ -12804,6 +12804,118 @@ fail:
@@ -396,5 +396,5 @@
  			}
  
 -- 
-2.32.0
+2.36.1
 
diff --git a/recipes-wifi/hostapd/files/patches/patches.inc b/recipes-wifi/hostapd/files/patches/patches.inc
index 1cce1d8..7665ce6 100644
--- a/recipes-wifi/hostapd/files/patches/patches.inc
+++ b/recipes-wifi/hostapd/files/patches/patches.inc
@@ -50,6 +50,7 @@
     file://740-snoop_iface.patch \
     file://750-qos_map_set_without_interworking.patch \
     file://751-qos_map_ignore_when_unsupported.patch \
+    file://760-dynamic_own_ip.patch \
     file://800-acs-don-t-select-indoor-channel-on-outdoor-operation.patch \
     file://990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch \
     file://992-openssl-include-rsa.patch \