Jelajahi Sumber

qcacld-3.0: Enable puncture for 11be SAP when getting chan param

When getting chan param for SAP, the bandwidth is downgraded if some
channel in the bandwidth is disabled if puncture flag is not set in
chan param.

Check phymode in sap_ctx, if it is 11be, enable puncture when getting
chan param.

Change-Id: Id80a76c3fc8bb96e714b1b70159637ece876488f
CRs-Fixed: 3201043
Bing Sun 2 tahun lalu
induk
melakukan
5561932e60

+ 6 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2270,6 +2270,9 @@ hdd_update_reg_chan_info(struct hdd_adapter *adapter,
 			wlan_hdd_find_opclass(mac_handle, chan, bw_offset);
 
 		if (WLAN_REG_IS_5GHZ_CH_FREQ(freq_list[i])) {
+			if (sap_phymode_is_eht(sap_config->SapHw_mode))
+				wlan_reg_set_create_punc_bitmap(&ch_params,
+								true);
 			ch_params.ch_width = sap_config->acs_cfg.ch_width;
 			wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev,
 							     icv->freq,
@@ -13759,6 +13762,9 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
 					ap_ctx->sap_config.ch_width_orig;
 		ap_ctx->bss_stop_reason = BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN;
 
+		if (sap_phymode_is_eht(ap_ctx->sap_config.SapHw_mode))
+			wlan_reg_set_create_punc_bitmap(
+				&ap_ctx->sap_config.ch_params, true);
 		wlan_reg_set_channel_params_for_freq(
 				hdd_ctx->pdev, chan_freq,
 				ap_ctx->sap_config.sec_ch_freq,

+ 5 - 1
core/sap/src/sap_api_link_cntl.c

@@ -581,10 +581,14 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle,
 	 * should continue to operate in the same mode as it is operating
 	 * currently. For e.g. 20/40/80 MHz operation
 	 */
-	if (mac_ctx->sap.SapDfsInfo.target_chan_freq)
+	if (mac_ctx->sap.SapDfsInfo.target_chan_freq) {
+		if (sap_phymode_is_eht(sap_ctx->phyMode))
+			wlan_reg_set_create_punc_bitmap(&sap_ctx->ch_params,
+							true);
 		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
 				mac_ctx->sap.SapDfsInfo.target_chan_freq,
 				0, &sap_ctx->ch_params);
+	}
 
 	/*
 	 * Fetch the number of SAP interfaces. If the number of sap Interface

+ 11 - 0
core/sap/src/sap_fsm.c

@@ -252,6 +252,8 @@ static qdf_freq_t sap_random_channel_sel(struct sap_context *sap_ctx)
 	    sap_ctx->chan_freq != sap_ctx->candidate_freq &&
 	    !utils_dfs_is_freq_in_nol(pdev, sap_ctx->candidate_freq)) {
 		chan_freq = sap_ctx->candidate_freq;
+		if (sap_phymode_is_eht(sap_ctx->phyMode))
+			wlan_reg_set_create_punc_bitmap(ch_params, true);
 		wlan_reg_set_channel_params_for_freq(pdev, chan_freq, 0,
 						     ch_params);
 		sap_debug("random chan select candidate freq=%d", chan_freq);
@@ -2850,6 +2852,9 @@ static QDF_STATUS sap_validate_dfs_nol(struct sap_context *sap_ctx,
 			  sap_ctx->chan_freq, chan_freq);
 
 		sap_ctx->chan_freq = chan_freq;
+		if (sap_phymode_is_eht(sap_ctx->phyMode))
+			wlan_reg_set_create_punc_bitmap(&sap_ctx->ch_params,
+							true);
 		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
 						     sap_ctx->chan_freq,
 						     sap_ctx->sec_ch_freq,
@@ -2960,6 +2965,9 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
 		     wlan_reg_is_dfs_for_freq(mac_ctx->pdev,
 					      con_ch_freq)) {
 			sap_ctx->chan_freq = con_ch_freq;
+			if (sap_phymode_is_eht(sap_ctx->phyMode))
+				wlan_reg_set_create_punc_bitmap(
+					&sap_ctx->ch_params, true);
 			wlan_reg_set_channel_params_for_freq(
 						    mac_ctx->pdev,
 						    con_ch_freq, 0,
@@ -3153,6 +3161,9 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
 	uint8_t intf;
 
 	if (mac_ctx->sap.SapDfsInfo.target_chan_freq) {
+		if (sap_phymode_is_eht(sap_ctx->phyMode))
+			wlan_reg_set_create_punc_bitmap(&sap_ctx->ch_params,
+							true);
 		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
 				    mac_ctx->sap.SapDfsInfo.target_chan_freq, 0,
 				    &sap_ctx->ch_params);

+ 11 - 0
core/sap/src/sap_module.c

@@ -1258,6 +1258,8 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
 			ch_width = QDF_MIN(ch_width, tgt_ch_params->ch_width);
 	}
 	ch_params.ch_width = ch_width;
+	if (sap_phymode_is_eht(sap_context->phyMode))
+		wlan_reg_set_create_punc_bitmap(&ch_params, true);
 	wlan_reg_set_channel_params_for_freq(mac->pdev, chan_freq, 0,
 					     &ch_params);
 	ch_width = ch_params.ch_width;
@@ -1382,6 +1384,8 @@ wlansap_set_chan_params_for_csa(struct mac_context *mac,
 			QDF_MIN(mac->sap.SapDfsInfo.new_ch_params.ch_width,
 				target_bw);
 	}
+	if (sap_phymode_is_eht(sap_ctx->phyMode))
+		wlan_reg_set_create_punc_bitmap(&sap_ctx->ch_params, true);
 	wlan_reg_set_channel_params_for_freq(
 		mac->pdev, target_chan_freq, 0,
 		&mac->sap.SapDfsInfo.new_ch_params);
@@ -1450,6 +1454,8 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
 			       tmp_ch_params.ch_width);
 	}
 
+	if (sap_phymode_is_eht(sap_ctx->phyMode))
+		wlan_reg_set_create_punc_bitmap(&tmp_ch_params, true);
 	wlan_reg_set_channel_params_for_freq(mac->pdev, target_chan_freq, 0,
 					     &tmp_ch_params);
 	if (sap_ctx->chan_freq == target_chan_freq &&
@@ -1896,6 +1902,8 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
 	 * which will result in channel width changing dynamically.
 	 */
 	ch_params = &mac_ctx->sap.SapDfsInfo.new_ch_params;
+	if (sap_phymode_is_eht(sap_ctx->phyMode))
+		wlan_reg_set_create_punc_bitmap(ch_params, true);
 	wlan_reg_set_channel_params_for_freq(mac_ctx->pdev, target_chan_freq,
 			0, ch_params);
 	sap_ctx->ch_params = *ch_params;
@@ -1974,6 +1982,9 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(struct sap_context *sap_ctx)
 
 	mac->sap.SapDfsInfo.new_ch_params.ch_width =
 				mac->sap.SapDfsInfo.new_chanWidth;
+	if (sap_phymode_is_eht(sap_ctx->phyMode))
+		wlan_reg_set_create_punc_bitmap(
+			&mac->sap.SapDfsInfo.new_ch_params, true);
 	wlan_reg_set_channel_params_for_freq(mac->pdev,
 			mac->sap.SapDfsInfo.target_chan_freq,
 			0, &mac->sap.SapDfsInfo.new_ch_params);