[][MAC80211][hostapd][Fix the issue of AP and STA starting on DFS channel conccurrently]

[Description]
Fix AP no beacon when start_disabled is set to 1.
Fix STA cannot connect to AP when start_disbaled is set to 0.
Add AP CAC skip when STA is already associated to another AP
on the same DFS channel.

[Release-log]
N/A

Change-Id: I63486fe7e7cad22dc2511a2e4bf25e687ed3cbf2
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6607300
Build: srv_hbgsm110
diff --git a/autobuild_mac80211_release/package/network/services/hostapd/patches/99916-hostapd-mtk-Add-hostapd-iBF-control.patch b/autobuild_mac80211_release/package/network/services/hostapd/patches/99916-hostapd-mtk-Add-hostapd-iBF-control.patch
index 740afab..c9ea6b5 100644
--- a/autobuild_mac80211_release/package/network/services/hostapd/patches/99916-hostapd-mtk-Add-hostapd-iBF-control.patch
+++ b/autobuild_mac80211_release/package/network/services/hostapd/patches/99916-hostapd-mtk-Add-hostapd-iBF-control.patch
@@ -1,7 +1,7 @@
-From 23b44ac3bf0c536873ce11d058a7ea7241f6ec95 Mon Sep 17 00:00:00 2001
+From e80a9ee61fc2f7a2e9de1cae3b81ee7be0e8a80b Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:41:51 -0700
-Subject: [PATCH 99916/99916] Add hostapd iBF control
+Subject: [PATCH 99916/99920] Add hostapd iBF control
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
@@ -21,7 +21,7 @@
  13 files changed, 224 insertions(+), 1 deletion(-)
 
 diff --git a/hostapd/config_file.c b/hostapd/config_file.c
-index 0bf8b6c72..9b79be198 100644
+index 0bf8b6c..9b79be1 100644
 --- a/hostapd/config_file.c
 +++ b/hostapd/config_file.c
 @@ -4786,6 +4786,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
@@ -35,7 +35,7 @@
  		wpa_printf(MSG_ERROR,
  			   "Line %d: unknown configuration item '%s'",
 diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
-index 60c1fb44e..a010e7fe8 100644
+index 60c1fb4..a010e7f 100644
 --- a/hostapd/ctrl_iface.c
 +++ b/hostapd/ctrl_iface.c
 @@ -3471,6 +3471,30 @@ hostapd_ctrl_iface_get_hemu(struct hostapd_data *hapd, char *buf,
@@ -79,7 +79,7 @@
  		os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
  		reply_len = 16;
 diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
-index 0d364773b..c2a123a8c 100644
+index 0d36477..c2a123a 100644
 --- a/hostapd/hostapd_cli.c
 +++ b/hostapd/hostapd_cli.c
 @@ -1586,6 +1586,13 @@ static int hostapd_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
@@ -106,7 +106,7 @@
  };
  
 diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
-index 2d720095a..14b21cb46 100644
+index 2d72009..14b21cb 100644
 --- a/src/ap/ap_config.c
 +++ b/src/ap/ap_config.c
 @@ -298,6 +298,7 @@ struct hostapd_config * hostapd_config_defaults(void)
@@ -118,7 +118,7 @@
  	return conf;
  }
 diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
-index 8b9e8873d..2a74e09fe 100644
+index 8b9e887..2a74e09 100644
 --- a/src/ap/ap_config.h
 +++ b/src/ap/ap_config.h
 @@ -1157,6 +1157,7 @@ struct hostapd_config {
@@ -138,7 +138,7 @@
  static inline enum oper_chan_width
  hostapd_get_oper_chwidth(struct hostapd_config *conf)
 diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
-index 77d5f8990..0b9b4101c 100644
+index 77d5f89..0b9b410 100644
 --- a/src/ap/ap_drv_ops.c
 +++ b/src/ap/ap_drv_ops.c
 @@ -1049,3 +1049,17 @@ int hostapd_drv_three_wire_ctrl(struct hostapd_data *hapd)
@@ -161,7 +161,7 @@
 +}
 \ No newline at end of file
 diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
-index 0a8bf0c7e..da8238249 100644
+index 0a8bf0c..da82382 100644
 --- a/src/ap/ap_drv_ops.h
 +++ b/src/ap/ap_drv_ops.h
 @@ -142,6 +142,8 @@ int hostapd_drv_configure_edcca_threshold(struct hostapd_data *hapd);
@@ -174,7 +174,7 @@
  #include "drivers/driver.h"
  
 diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
-index 32b75dca7..f095fe42f 100644
+index 32b75dc..f095fe4 100644
 --- a/src/ap/hostapd.c
 +++ b/src/ap/hostapd.c
 @@ -2301,6 +2301,8 @@ dfs_offload:
@@ -187,7 +187,7 @@
  	wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
  		   iface->bss[0]->conf->iface);
 diff --git a/src/common/mtk_vendor.h b/src/common/mtk_vendor.h
-index 99a4d7f94..d6d04de95 100644
+index 99a4d7f..d6d04de 100644
 --- a/src/common/mtk_vendor.h
 +++ b/src/common/mtk_vendor.h
 @@ -13,7 +13,8 @@ enum mtk_nl80211_vendor_subcmds {
@@ -240,7 +240,7 @@
  #define CSI_MAX_COUNT 256
  #define ETH_ALEN 6
 diff --git a/src/drivers/driver.h b/src/drivers/driver.h
-index a137ffc14..f9f29d8d1 100644
+index e725433..dab37f9 100644
 --- a/src/drivers/driver.h
 +++ b/src/drivers/driver.h
 @@ -1628,6 +1628,11 @@ struct wpa_driver_ap_params {
@@ -255,9 +255,9 @@
  };
  
  struct wpa_driver_mesh_bss_params {
-@@ -4692,6 +4697,20 @@ struct wpa_driver_ops {
- 	 int (*hemu_ctrl)(void *priv, u8 hemu_onoff);
- 	 int (*hemu_dump)(void *priv, u8 *hemu_onoff);
+@@ -4699,6 +4704,20 @@ struct wpa_driver_ops {
+ 	 *
+ 	 */
  	 int (*three_wire_ctrl)(void *priv, u8 three_wire_enable);
 +
 +	/**
@@ -277,7 +277,7 @@
  
  /**
 diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
-index 03babd8a2..1c065d458 100644
+index 03babd8..1c065d4 100644
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
 @@ -12549,6 +12549,112 @@ static int nl80211_enable_three_wire(void *priv, const u8 three_wire_enable)
@@ -401,7 +401,7 @@
 +	.ibf_dump = nl80211_ibf_dump,
  };
 diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
-index 9fe7811b9..607592ceb 100644
+index 9fe7811..607592c 100644
 --- a/src/drivers/driver_nl80211.h
 +++ b/src/drivers/driver_nl80211.h
 @@ -184,6 +184,7 @@ struct wpa_driver_nl80211_data {
@@ -413,7 +413,7 @@
  	u64 vendor_scan_cookie;
  	u64 remain_on_chan_cookie;
 diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
-index 04bc54e77..9ecc0ff9a 100644
+index 04bc54e..9ecc0ff 100644
 --- a/src/drivers/driver_nl80211_capa.c
 +++ b/src/drivers/driver_nl80211_capa.c
 @@ -1062,6 +1062,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
@@ -427,5 +427,5 @@
  			}
  
 -- 
-2.25.1
+2.18.0