[][MAC80211][hostapd][Add zwdfs setting in mac80211.sh]

[Description]
Add zwdfs setting in mac80211.sh

Need to add 'radar_backgroud' under corresponding wifi-device in /etc/config/wireless

[Release-log]
N/A

Change-Id: Ia26cef2d64d5ebbf97412bd0b656011461887888
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6087169
diff --git a/autobuild_mac80211_release/0001-master-mac80211-generate-hostapd-setting-from-ap-cap.patch b/autobuild_mac80211_release/0001-master-mac80211-generate-hostapd-setting-from-ap-cap.patch
index 1bd0a91..f1b7421 100644
--- a/autobuild_mac80211_release/0001-master-mac80211-generate-hostapd-setting-from-ap-cap.patch
+++ b/autobuild_mac80211_release/0001-master-mac80211-generate-hostapd-setting-from-ap-cap.patch
@@ -1,8 +1,23 @@
 diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
-index 27eecf3..318de3a 100644
+index 27eecf3..0124d89 100644
 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
 +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
-@@ -141,9 +141,6 @@ mac80211_hostapd_setup_base() {
+@@ -61,7 +61,8 @@ drv_mac80211_init_device_config() {
+ 		rx_stbc \
+ 		tx_stbc \
+ 		he_bss_color \
+-		he_spr_non_srg_obss_pd_max_offset
++		he_spr_non_srg_obss_pd_max_offset \
++		radar_background
+ 	config_add_boolean \
+ 		ldpc \
+ 		greenfield \
+@@ -137,13 +138,10 @@ mac80211_hostapd_setup_base() {
+ 	[ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] &&
+ 		append base_cfg "acs_exclude_dfs=1" "$N"
+ 
+-	json_get_vars noscan ht_coex
++	json_get_vars noscan ht_coex radar_background:0
  	json_get_values ht_capab_list ht_capab tx_burst
  	json_get_values channel_list channels
  
@@ -12,7 +27,7 @@
  	set_default noscan 0
  
  	[ "$noscan" -gt 0 ] && hostapd_noscan=1
-@@ -413,9 +410,9 @@ mac80211_hostapd_setup_base() {
+@@ -413,9 +411,9 @@ mac80211_hostapd_setup_base() {
  			he_spr_non_srg_obss_pd_max_offset:1 \
  			he_bss_color
  
@@ -24,6 +39,15 @@
  		he_mac_cap=${he_mac_cap:2}
  
  		append base_cfg "ieee80211ax=1" "$N"
+@@ -462,6 +460,8 @@ mac80211_hostapd_setup_base() {
+ 		append base_cfg "he_mu_edca_ac_vo_timer=255" "$N"
+ 	fi
+ 
++	append base_cfg "enable_background_radar=$radar_background" "$N"
++
+ 	hostapd_prepare_device_config "$hostapd_conf_file" nl80211
+ 	cat >> "$hostapd_conf_file" <<EOF
+ ${channel:+channel=$channel}
 -- 
 2.29.2
 
diff --git a/autobuild_mac80211_release/package/network/services/hostapd/patches/812-DFS-Rdd0-fail-to-rollback-non-DFS-channel-when-DFS-channels-under-NOP.patch b/autobuild_mac80211_release/package/network/services/hostapd/patches/812-DFS-Rdd0-fail-to-rollback-non-DFS-channel-when-DFS-channels-under-NOP.patch
new file mode 100644
index 0000000..68935df
--- /dev/null
+++ b/autobuild_mac80211_release/package/network/services/hostapd/patches/812-DFS-Rdd0-fail-to-rollback-non-DFS-channel-when-DFS-channels-under-NOP.patch
@@ -0,0 +1,44 @@
+diff --git a/src/ap/dfs.c b/src/ap/dfs.c
+index 55b7188..6af0ef2 100644
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -1048,7 +1048,7 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
+ }
+ 
+ 
+-static void hostpad_dfs_update_background_chain(struct hostapd_iface *iface)
++static int hostpad_dfs_update_background_chain(struct hostapd_iface *iface)
+ {
+ 	int sec = 0;
+ 	enum dfs_channel_type channel_type = DFS_NO_CAC_YET;
+@@ -1084,7 +1084,7 @@ static void hostpad_dfs_update_background_chain(struct hostapd_iface *iface)
+ 				  oper_centr_freq_seg1_idx, true)) {
+ 		wpa_printf(MSG_ERROR, "DFS failed to start CAC offchannel");
+ 		iface->radar_background.channel = -1;
+-		return;
++		return -1;
+ 	}
+ 
+ 	iface->radar_background.channel = channel->chan;
+@@ -1096,6 +1096,8 @@ static void hostpad_dfs_update_background_chain(struct hostapd_iface *iface)
+ 	wpa_printf(MSG_ERROR,
+ 		   "%s: setting background chain to chan %d (%d MHz)",
+ 		   __func__, channel->chan, channel->freq);
++
++	return 0;
+ }
+ 
+ 
+@@ -1320,8 +1322,7 @@ hostapd_dfs_background_start_channel_switch(struct hostapd_iface *iface,
+ 		 * Just select a new random channel according to the
+ 		 * regulations for monitoring.
+ 		 */
+-		hostpad_dfs_update_background_chain(iface);
+-		return 0;
++		return hostpad_dfs_update_background_chain(iface);
+ 	}
+ 
+ 	/*
+-- 
+2.29.2
+