Parcourir la source

qcacld-3.0: Replace wlan_reg_set_channel_params_for_freq

Replace all occurrences of
wlan_reg_set_channel_params_for_freq  API with new API
wlan_reg_set_channel_params_for_pwrmode.

Change-Id: I7ae94a7004803a96caeb7a77d03065096afe5f0e
CRs-Fixed: 3144793
Divyajyothi Goparaju il y a 2 ans
Parent
commit
dc01aca04d

+ 12 - 8
components/son/dispatcher/src/son_api.c

@@ -188,8 +188,9 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
 		    CHANNEL_STATE_INVALID) {
 			if (!flag_160) {
 				chan_params->ch_width = CH_WIDTH_80P80MHZ;
-				wlan_reg_set_channel_params_for_freq(
-					pdev, freq, 0, chan_params);
+				wlan_reg_set_channel_params_for_pwrmode(
+					pdev, freq, 0, chan_params,
+					REG_CURRENT_PWR_MODE);
 			}
 			if (is_he_enabled)
 				flags |= VENDOR_CHAN_FLAG2(
@@ -204,8 +205,9 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
 		    CHANNEL_STATE_INVALID) {
 			if (flag_160) {
 				chan_params->ch_width = CH_WIDTH_160MHZ;
-				wlan_reg_set_channel_params_for_freq(
-					pdev, freq, 0, chan_params);
+				wlan_reg_set_channel_params_for_pwrmode(
+					pdev, freq, 0, chan_params,
+					REG_CURRENT_PWR_MODE);
 			}
 			if (is_he_enabled)
 				flags |= VENDOR_CHAN_FLAG2(
@@ -221,8 +223,9 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
 			if (!flag_160 &&
 			    chan_params->ch_width != CH_WIDTH_80P80MHZ) {
 				chan_params->ch_width = CH_WIDTH_80MHZ;
-				wlan_reg_set_channel_params_for_freq(
-					pdev, freq, 0, chan_params);
+				wlan_reg_set_channel_params_for_pwrmode(
+					pdev, freq, 0, chan_params,
+					REG_CURRENT_PWR_MODE);
 			}
 			if (is_he_enabled)
 				flags |= VENDOR_CHAN_FLAG2(
@@ -233,8 +236,9 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
 		fallthrough;
 	case CH_WIDTH_40MHZ:
 		ch_width40_ch_params.ch_width = bandwidth;
-		wlan_reg_set_channel_params_for_freq(pdev, freq, 0,
-						     &ch_width40_ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(pdev, freq, 0,
+							&ch_width40_ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		if (ch_width40_ch_params.sec_ch_offset == LOW_PRIMARY_CH)
 			sec_freq = freq + 20;

+ 3 - 1
core/cds/src/cds_reg_service.c

@@ -94,7 +94,9 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
 	case CH_WIDTH_40MHZ:
 		qdf_mem_zero(&ch_params, sizeof(ch_params));
 		ch_params.ch_width = bandwidth;
-		wlan_reg_set_channel_params_for_freq(pdev, freq, 0, &ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(pdev, freq, 0,
+							&ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		if (ch_params.sec_ch_offset == LOW_PRIMARY_CH)
 			sec_freq = freq + 20;

+ 14 - 10
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2368,9 +2368,10 @@ hdd_update_reg_chan_info(struct hdd_adapter *adapter,
 				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,
-							     0, &ch_params);
+			wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev,
+								icv->freq,
+								0, &ch_params,
+								REG_CURRENT_PWR_MODE);
 			icv->vht_center_freq_seg0 = ch_params.center_freq_seg0;
 			icv->vht_center_freq_seg1 = ch_params.center_freq_seg1;
 		}
@@ -14495,10 +14496,11 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
 		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(
+		wlan_reg_set_channel_params_for_pwrmode(
 				hdd_ctx->pdev, chan_freq,
 				ap_ctx->sap_config.sec_ch_freq,
-				&ap_ctx->sap_config.ch_params);
+				&ap_ctx->sap_config.ch_params,
+				REG_CURRENT_PWR_MODE);
 
 		hdd_restart_sap(hostapd_adapter);
 	}
@@ -21485,8 +21487,9 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, qdf_freq_t oper_freq,
 	}
 
 	/* This call decides required channel bonding mode */
-	wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev, oper_freq,
-					     sec_ch_freq, ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev, oper_freq,
+						sec_ch_freq, ch_params,
+						REG_CURRENT_PWR_MODE);
 
 	if (cds_get_conparam() == QDF_GLOBAL_MONITOR_MODE ||
 	    policy_mgr_is_sta_mon_concurrency(hdd_ctx->psoc))
@@ -23761,9 +23764,10 @@ static int __wlan_hdd_cfg80211_set_mon_ch(struct wiphy *wiphy,
 		     QDF_MAC_ADDR_SIZE);
 
 	ch_params.ch_width = ch_width;
-	wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev,
-					     chandef->chan->center_freq,
-					     sec_ch_2g_freq, &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev,
+						chandef->chan->center_freq,
+						sec_ch_2g_freq, &ch_params,
+						REG_CURRENT_PWR_MODE);
 	if (wlan_hdd_change_hw_mode_for_given_chnl(adapter,
 						   chandef->chan->center_freq,
 						   POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN)) {

+ 10 - 8
core/hdd/src/wlan_hdd_hostapd.c

@@ -1688,11 +1688,11 @@ static QDF_STATUS hdd_hostapd_chan_change(struct hdd_adapter *adapter,
 	sap_ch_param.mhz_freq_seg1 =
 		sap_chan_selected->vht_seg1_center_ch_freq;
 
-	wlan_reg_set_channel_params_for_freq(
+	wlan_reg_set_channel_params_for_pwrmode(
 		hdd_ctx->pdev,
 		sap_chan_selected->pri_ch_freq,
 		sap_chan_selected->ht_sec_ch_freq,
-		&sap_ch_param);
+		&sap_ch_param, REG_CURRENT_PWR_MODE);
 
 	phy_mode = wlan_sap_get_phymode(
 			WLAN_HDD_GET_SAP_CTX_PTR(adapter));
@@ -6549,9 +6549,11 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 		}
 	}
 
-	wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev, config->chan_freq,
-					     config->sec_ch_freq,
-					     &config->ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev,
+						config->chan_freq,
+						config->sec_ch_freq,
+						&config->ch_params,
+						REG_CURRENT_PWR_MODE);
 	if (0 != wlan_hdd_cfg80211_update_apies(adapter)) {
 		hdd_err("SAP Not able to set AP IEs");
 		ret = -EINVAL;
@@ -7102,9 +7104,9 @@ wlan_hdd_get_sap_ch_params(struct hdd_context *hdd_ctx,
 
 	if (!wlan_sap_get_ch_params(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
 				    ch_params))
-		wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev,
-						     freq, 0,
-						     ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev, freq, 0,
+							ch_params,
+							REG_CURRENT_PWR_MODE);
 	return QDF_STATUS_SUCCESS;
 }
 

+ 6 - 4
core/hdd/src/wlan_hdd_main.c

@@ -8580,8 +8580,9 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, qdf_freq_t freq,
 		     QDF_MAC_ADDR_SIZE);
 
 	ch_params.ch_width = bandwidth;
-	wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev, freq, 0,
-					     &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev, freq, 0,
+						&ch_params,
+						REG_CURRENT_PWR_MODE);
 
 	if (ch_params.ch_width == CH_WIDTH_INVALID) {
 		hdd_err("Invalid capture channel or bandwidth for a country");
@@ -16433,10 +16434,11 @@ void wlan_hdd_start_sap(struct hdd_adapter *ap_adapter, bool reinit)
 		hdd_err("SAP Not able to set AP IEs");
 		goto end;
 	}
-	wlan_reg_set_channel_params_for_freq(
+	wlan_reg_set_channel_params_for_pwrmode(
 				hdd_ctx->pdev,
 				hdd_ap_ctx->sap_config.chan_freq,
-				0, &hdd_ap_ctx->sap_config.ch_params);
+				0, &hdd_ap_ctx->sap_config.ch_params,
+				REG_CURRENT_PWR_MODE);
 	if (QDF_IS_STATUS_ERROR(wlan_hdd_mlo_sap_reinit(hdd_ctx, sap_config,
 							ap_adapter))) {
 		hdd_err("SAP Not able to do mlo attach");

+ 2 - 2
core/hdd/src/wlan_hdd_oemdata.c

@@ -403,8 +403,8 @@ void hdd_update_channel_bw_info(struct hdd_context *hdd_ctx,
 	/* Passing CH_WIDTH_MAX will give the max bandwidth supported */
 	ch_params.ch_width = CH_WIDTH_MAX;
 
-	wlan_reg_set_channel_params_for_freq(
-		hdd_ctx->pdev, chan_freq, 0, &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(
+		hdd_ctx->pdev, chan_freq, 0, &ch_params, REG_CURRENT_PWR_MODE);
 	if (ch_params.center_freq_seg0)
 		hdd_chan_info->band_center_freq1 =
 			cds_chan_to_freq(ch_params.center_freq_seg0);

+ 4 - 3
core/hdd/src/wlan_hdd_pre_cac.c

@@ -149,9 +149,10 @@ static int wlan_set_def_pre_cac_chan(struct hdd_context *hdd_ctx,
 		return -EINVAL;
 	}
 	ch_params.ch_width = *ch_width;
-	wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev,
-					     pre_cac_ch_freq, 0,
-					     &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(hdd_ctx->pdev,
+						pre_cac_ch_freq, 0,
+						&ch_params,
+						REG_CURRENT_PWR_MODE);
 	switch (ch_params.sec_ch_offset) {
 	case HIGH_PRIMARY_CH:
 		channel_type = NL80211_CHAN_HT40MINUS;

+ 15 - 10
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -114,7 +114,7 @@ static void lim_process_ext_change_channel(struct mac_context *mac_ctx,
 /**
  * enum get_next_lower_bw - Get next higher bandwidth for a given BW.
  * This enum is used in conjunction with
- * wlan_reg_set_channel_params_for_freq API to fetch center frequencies
+ * wlan_reg_set_channel_params_for_pwrmode API to fetch center frequencies
  * for each BW starting from 20MHz upto Max BSS BW in case of non-PSD power.
  *
  */
@@ -5279,9 +5279,11 @@ void lim_parse_tpe_ie(struct mac_context *mac, struct pe_session *session,
 
 		for (i = 0; i < single_tpe.max_tx_pwr_count + 1 &&
 		     (ch_params.ch_width != CH_WIDTH_INVALID); i++) {
-			wlan_reg_set_channel_params_for_freq(mac->pdev,
-							     curr_op_freq, 0,
-							     &ch_params);
+			wlan_reg_set_channel_params_for_pwrmode(
+							mac->pdev,
+							curr_op_freq, 0,
+							&ch_params,
+							REG_CURRENT_PWR_MODE);
 			if (vdev_mlme->reg_tpc_obj.tpe[i] !=
 			    single_tpe.tx_power[i] ||
 			    vdev_mlme->reg_tpc_obj.frequency[i] !=
@@ -5304,8 +5306,9 @@ void lim_parse_tpe_ie(struct mac_context *mac, struct pe_session *session,
 		vdev_mlme->reg_tpc_obj.num_pwr_levels = num_octets;
 
 		ch_params.ch_width = session->ch_width;
-		wlan_reg_set_channel_params_for_freq(mac->pdev, curr_op_freq, 0,
-						     &ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac->pdev, curr_op_freq,
+							0, &ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		if (ch_params.mhz_freq_seg1)
 			curr_freq = ch_params.mhz_freq_seg1 - bw_val / 2 + 10;
@@ -5508,8 +5511,9 @@ void lim_calculate_tpc(struct mac_context *mac,
 
 	ch_params.ch_width = session->ch_width;
 	/* start frequency calculation */
-	wlan_reg_set_channel_params_for_freq(mac->pdev, oper_freq, 0,
-					     &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(mac->pdev, oper_freq, 0,
+						&ch_params,
+						REG_CURRENT_PWR_MODE);
 	if (ch_params.mhz_freq_seg1)
 		start_freq = ch_params.mhz_freq_seg1 - bw_val / 2 + 10;
 	else
@@ -5586,8 +5590,9 @@ void lim_calculate_tpc(struct mac_context *mac,
 				mlme_obj->reg_tpc_obj.frequency[i] =
 						start_freq + (20 * i);
 			} else {
-				wlan_reg_set_channel_params_for_freq(
-					mac->pdev, oper_freq, 0, &ch_params);
+				wlan_reg_set_channel_params_for_pwrmode(
+					mac->pdev, oper_freq, 0, &ch_params,
+					REG_CURRENT_PWR_MODE);
 				mlme_obj->reg_tpc_obj.frequency[i] =
 					ch_params.mhz_freq_seg0;
 				if (ch_params.ch_width != CH_WIDTH_INVALID)

+ 3 - 1
core/mac/src/pe/lim/lim_prop_exts_utils.c

@@ -565,7 +565,9 @@ void lim_update_ch_width_for_p2p_client(struct mac_context *mac,
 	 */
 	ch_params.ch_width = CH_WIDTH_80MHZ;
 
-	wlan_reg_set_channel_params_for_freq(mac->pdev, ch_freq, 0, &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(mac->pdev, ch_freq, 0,
+						&ch_params,
+						REG_CURRENT_PWR_MODE);
 	if (ch_params.ch_width == CH_WIDTH_20MHZ)
 		ch_params.sec_ch_offset = PHY_SINGLE_CHANNEL_CENTERED;
 

+ 30 - 18
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -1661,9 +1661,11 @@ static QDF_STATUS lim_process_csa_wbw_ie(struct mac_context *mac_ctx,
 			 fw_vht_ch_wd);
 		ap_new_ch_width = fw_vht_ch_wd;
 		ch_params.ch_width = ap_new_ch_width;
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
+		wlan_reg_set_channel_params_for_pwrmode(
+						     mac_ctx->pdev,
 						     csa_params->csa_chan_freq,
-						     0, &ch_params);
+						     0, &ch_params,
+						     REG_CURRENT_PWR_MODE);
 		ap_new_ch_width = ch_params.ch_width;
 		csa_params->new_ch_freq_seg1 = ch_params.center_freq_seg0;
 		csa_params->new_ch_freq_seg2 = ch_params.center_freq_seg1;
@@ -1817,9 +1819,11 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 		pe_debug("new freq: %u, width: %d", csa_params->csa_chan_freq,
 			 csa_params->new_ch_width);
 		ch_params.ch_width = csa_params->new_ch_width;
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
+		wlan_reg_set_channel_params_for_pwrmode(
+						     mac_ctx->pdev,
 						     csa_params->csa_chan_freq,
-						     0, &ch_params);
+						     0, &ch_params,
+						     REG_CURRENT_PWR_MODE);
 		pe_debug("idea width: %d, chn_seg0 %u chn_seg1 %u freq_seg0 %u freq_seg1 %u",
 			 ch_params.ch_width, ch_params.center_freq_seg0,
 			 ch_params.center_freq_seg1, ch_params.mhz_freq_seg0,
@@ -1856,9 +1860,11 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 			if (chnl_switch_info->newChanWidth) {
 				ch_params.ch_width =
 					chnl_switch_info->newChanWidth;
-				wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-								     csa_params->csa_chan_freq,
-								     0, &ch_params);
+				wlan_reg_set_channel_params_for_pwrmode(
+						mac_ctx->pdev,
+						csa_params->csa_chan_freq,
+						0, &ch_params,
+						REG_CURRENT_PWR_MODE);
 				lim_ch_switch->sec_ch_offset =
 					ch_params.sec_ch_offset;
 				session_entry->htSupportedChannelWidthSet =
@@ -1907,9 +1913,9 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 
 			ch_params.ch_width =
 				chnl_switch_info->newChanWidth;
-			wlan_reg_set_channel_params_for_freq(
+			wlan_reg_set_channel_params_for_pwrmode(
 				mac_ctx->pdev, csa_params->csa_chan_freq, 0,
-				&ch_params);
+				&ch_params, REG_CURRENT_PWR_MODE);
 			chnl_switch_info->newCenterChanFreq0 =
 				ch_params.center_freq_seg0;
 			/*
@@ -1927,9 +1933,11 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 			lim_ch_switch->state =
 				eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
 			ch_params.ch_width = CH_WIDTH_40MHZ;
-			wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-							     csa_params->csa_chan_freq,
-							     0, &ch_params);
+			wlan_reg_set_channel_params_for_pwrmode(
+						mac_ctx->pdev,
+						csa_params->csa_chan_freq,
+						0, &ch_params,
+						REG_CURRENT_PWR_MODE);
 			lim_ch_switch->sec_ch_offset =
 				ch_params.sec_ch_offset;
 			chnl_switch_info->newChanWidth = CH_WIDTH_40MHZ;
@@ -1962,9 +1970,11 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 					CH_WIDTH_40MHZ;
 				ch_params.ch_width =
 					chnl_switch_info->newChanWidth;
-				wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-								     csa_params->csa_chan_freq,
-								     0, &ch_params);
+				wlan_reg_set_channel_params_for_pwrmode(
+						mac_ctx->pdev,
+						csa_params->csa_chan_freq,
+						0, &ch_params,
+						REG_CURRENT_PWR_MODE);
 				lim_ch_switch->ch_center_freq_seg0 =
 					ch_params.center_freq_seg0;
 				lim_ch_switch->sec_ch_offset =
@@ -1987,9 +1997,11 @@ static void lim_handle_sta_csa_param(struct mac_context *mac_ctx,
 			lim_ch_switch->state =
 				eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
 			ch_params.ch_width = CH_WIDTH_40MHZ;
-			wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-							     csa_params->csa_chan_freq,
-							     0, &ch_params);
+			wlan_reg_set_channel_params_for_pwrmode(
+						mac_ctx->pdev,
+						csa_params->csa_chan_freq,
+						0, &ch_params,
+						REG_CURRENT_PWR_MODE);
 			lim_ch_switch->ch_center_freq_seg0 =
 				ch_params.center_freq_seg0;
 			lim_ch_switch->sec_ch_offset =

+ 4 - 2
core/mac/src/pe/lim/lim_utils.c

@@ -10444,8 +10444,10 @@ QDF_STATUS lim_pre_vdev_start(struct mac_context *mac,
 	if (IS_DOT11_MODE_EHT(session->dot11mode))
 		wlan_reg_set_create_punc_bitmap(&ch_params, true);
 
-	wlan_reg_set_channel_params_for_freq(mac->pdev, session->curr_op_freq,
-					     sec_chan_freq, &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(mac->pdev,
+						session->curr_op_freq,
+						sec_chan_freq, &ch_params,
+						REG_CURRENT_PWR_MODE);
 
 	pe_debug("vdev id %d freq %d seg0 %d seg1 %d ch_width %d cac_duration_ms %d beacon_interval %d hidden_ssid: %d dtimPeriod %d slot_time %d bcn tx rate %d mhz seg0 %d mhz seg1 %d",
 		 session->vdev_id, session->curr_op_freq,

+ 8 - 7
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -479,9 +479,9 @@ populate_dot11f_tx_power_env(struct mac_context *mac,
 
 		chan_params.ch_width = chan_width;
 		bw_val = wlan_reg_get_bw_value(chan_width);
-		wlan_reg_set_channel_params_for_freq(mac->pdev, chan_freq,
-						     chan_freq,
-						     &chan_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac->pdev, chan_freq,
+							chan_freq, &chan_params,
+							REG_CURRENT_PWR_MODE);
 
 		if (chan_params.mhz_freq_seg1)
 			psd_start_freq =
@@ -1021,9 +1021,9 @@ populate_dot11f_ht_caps(struct mac_context *mac,
 		    mac->roam.configParam.channelBondingMode24GHz) {
 			pDot11f->supportedChannelWidthSet = 1;
 			ch_params.ch_width = CH_WIDTH_40MHZ;
-			wlan_reg_set_channel_params_for_freq(
+			wlan_reg_set_channel_params_for_pwrmode(
 				mac->pdev, pe_session->curr_op_freq, 0,
-				&ch_params);
+				&ch_params, REG_CURRENT_PWR_MODE);
 			if (ch_params.ch_width != CH_WIDTH_40MHZ)
 				pDot11f->supportedChannelWidthSet = 0;
 		} else if (LIM_IS_STA_ROLE(pe_session)) {
@@ -1219,8 +1219,9 @@ ePhyChanBondState wlan_get_cb_mode(struct mac_context *mac,
 
 	if (cb_mode != PHY_SINGLE_CHANNEL_CENTERED) {
 		ch_params.ch_width = CH_WIDTH_40MHZ;
-		wlan_reg_set_channel_params_for_freq(mac->pdev, ch_freq,
-						     sec_ch_freq, &ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac->pdev, ch_freq,
+							sec_ch_freq, &ch_params,
+							REG_CURRENT_PWR_MODE);
 		if (ch_params.ch_width == CH_WIDTH_20MHZ ||
 		    ch_params.sec_ch_offset != cb_mode) {
 			pe_err("ch freq %d :: Supported HT BW %d and cbmode %d, APs HT BW %d and cbmode %d, so switch to 20Mhz",

+ 4 - 4
core/sap/src/sap_api_link_cntl.c

@@ -134,9 +134,9 @@ void sap_config_acs_result(mac_handle_t mac_handle,
 
 	ch_params.ch_width = sap_ctx->acs_cfg->ch_width;
 	sap_acs_set_puncture_support(sap_ctx, &ch_params);
-	wlan_reg_set_channel_params_for_freq(
+	wlan_reg_set_channel_params_for_pwrmode(
 			mac_ctx->pdev, sap_ctx->acs_cfg->pri_ch_freq,
-			sec_ch_freq, &ch_params);
+			sec_ch_freq, &ch_params, REG_CURRENT_PWR_MODE);
 	sap_ctx->acs_cfg->ch_width = ch_params.ch_width;
 	if (sap_ctx->acs_cfg->ch_width > CH_WIDTH_40MHZ ||
 	    WLAN_REG_IS_6GHZ_CHAN_FREQ(sap_ctx->acs_cfg->pri_ch_freq))
@@ -599,9 +599,9 @@ wlansap_roam_process_dfs_chansw_update(mac_handle_t mac_handle,
 		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,
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
 				mac_ctx->sap.SapDfsInfo.target_chan_freq,
-				0, &sap_ctx->ch_params);
+				0, &sap_ctx->ch_params, REG_CURRENT_PWR_MODE);
 	}
 
 	/*

+ 19 - 14
core/sap/src/sap_ch_select.c

@@ -1622,9 +1622,10 @@ static void sap_sort_chl_weight_80_mhz(struct mac_context *mac_ctx,
 		acs_ch_params.ch_width = CH_WIDTH_80MHZ;
 		sap_acs_set_puncture_support(sap_ctx, &acs_ch_params);
 
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-						     pSpectInfo[j].chan_freq,
-						     0, &acs_ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
+							pSpectInfo[j].chan_freq,
+							0, &acs_ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		/* Check if the freq supports 80 Mhz */
 		if (acs_ch_params.ch_width != CH_WIDTH_80MHZ) {
@@ -1756,9 +1757,10 @@ static void sap_sort_chl_weight_160_mhz(struct mac_context *mac_ctx,
 		acs_ch_params.ch_width = CH_WIDTH_160MHZ;
 		sap_acs_set_puncture_support(sap_ctx, &acs_ch_params);
 
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-						     pSpectInfo[j].chan_freq,
-						     0, &acs_ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
+							pSpectInfo[j].chan_freq,
+							0, &acs_ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		/* Check if the freq supports 160 Mhz */
 		if (acs_ch_params.ch_width != CH_WIDTH_160MHZ) {
@@ -1926,9 +1928,10 @@ static void sap_sort_chl_weight_320_mhz(struct mac_context *mac_ctx,
 		acs_ch_params.ch_width = CH_WIDTH_320MHZ;
 		sap_acs_set_puncture_support(sap_ctx, &acs_ch_params);
 
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-						     pSpectInfo[j].chan_freq,
-						     0, &acs_ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
+							pSpectInfo[j].chan_freq,
+							0, &acs_ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		/* Check if the freq supports 320 Mhz */
 		if (acs_ch_params.ch_width != CH_WIDTH_320MHZ) {
@@ -2354,9 +2357,10 @@ static void sap_sort_chl_weight_40_mhz(struct mac_context *mac_ctx,
 
 		acs_ch_params.ch_width = CH_WIDTH_40MHZ;
 
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
-						     pSpectInfo[j].chan_freq,
-						     0, &acs_ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
+							pSpectInfo[j].chan_freq,
+							0, &acs_ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		/* Check if the freq supports 40 Mhz */
 		if (acs_ch_params.ch_width != CH_WIDTH_40MHZ) {
@@ -2665,8 +2669,9 @@ next_bw:
 				continue;
 			ch_params.ch_width = pref_bw;
 			sap_acs_set_puncture_support(sap_ctx, &ch_params);
-			wlan_reg_set_channel_params_for_freq(
-				mac_ctx->pdev, cal_chan_freq, 0, &ch_params);
+			wlan_reg_set_channel_params_for_pwrmode(
+				mac_ctx->pdev, cal_chan_freq, 0, &ch_params,
+				REG_CURRENT_PWR_MODE);
 			if (ch_params.ch_width != pref_bw)
 				continue;
 			best_chan_freq = cal_chan_freq;

+ 19 - 14
core/sap/src/sap_fsm.c

@@ -254,8 +254,9 @@ static qdf_freq_t sap_random_channel_sel(struct sap_context *sap_ctx)
 		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);
+		wlan_reg_set_channel_params_for_pwrmode(pdev, chan_freq, 0,
+							ch_params,
+							REG_CURRENT_PWR_MODE);
 		sap_debug("random chan select candidate freq=%d", chan_freq);
 		sap_ctx->candidate_freq = 0;
 	} else if (QDF_IS_STATUS_ERROR(
@@ -3012,10 +3013,11 @@ static QDF_STATUS sap_validate_dfs_nol(struct sap_context *sap_ctx,
 		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,
-						     &sap_ctx->ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
+							sap_ctx->chan_freq,
+							sap_ctx->sec_ch_freq,
+							&sap_ctx->ch_params,
+							REG_CURRENT_PWR_MODE);
 	}
 
 	return QDF_STATUS_SUCCESS;
@@ -3045,17 +3047,19 @@ static void sap_validate_chanmode_and_chwidth(struct mac_context *mac_ctx,
 	     sap_ctx->phyMode == eCSR_DOT11_MODE_11g ||
 	     sap_ctx->phyMode == eCSR_DOT11_MODE_11b)) {
 		sap_ctx->ch_params.ch_width = CH_WIDTH_20MHZ;
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
 					       sap_ctx->chan_freq,
 					       sap_ctx->ch_params.sec_ch_offset,
-					       &sap_ctx->ch_params);
+					       &sap_ctx->ch_params,
+					       REG_CURRENT_PWR_MODE);
 	} else if (sap_ctx->ch_params.ch_width > CH_WIDTH_40MHZ &&
 		   sap_ctx->phyMode == eCSR_DOT11_MODE_11n) {
 		sap_ctx->ch_params.ch_width = CH_WIDTH_40MHZ;
-		wlan_reg_set_channel_params_for_freq(mac_ctx->pdev,
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
 					       sap_ctx->chan_freq,
 					       sap_ctx->ch_params.sec_ch_offset,
-					       &sap_ctx->ch_params);
+					       &sap_ctx->ch_params,
+					       REG_CURRENT_PWR_MODE);
 	}
 
 	if (orig_ch_width != sap_ctx->ch_params.ch_width ||
@@ -3182,10 +3186,11 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
 			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(
+			wlan_reg_set_channel_params_for_pwrmode(
 						    mac_ctx->pdev,
 						    con_ch_freq, 0,
-						    &sap_ctx->ch_params);
+						    &sap_ctx->ch_params,
+						    REG_CURRENT_PWR_MODE);
 		}
 	}
 
@@ -3378,9 +3383,9 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx,
 		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,
+		wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev,
 				    mac_ctx->sap.SapDfsInfo.target_chan_freq, 0,
-				    &sap_ctx->ch_params);
+				    &sap_ctx->ch_params, REG_CURRENT_PWR_MODE);
 	} else {
 		sap_err("Invalid target channel freq %d",
 			 mac_ctx->sap.SapDfsInfo.target_chan_freq);

+ 19 - 13
core/sap/src/sap_module.c

@@ -1365,8 +1365,9 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
 	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, sec_ch_freq,
-					     &ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(mac->pdev, chan_freq,
+						sec_ch_freq, &ch_params,
+						REG_CURRENT_PWR_MODE);
 	ch_width = ch_params.ch_width;
 	if (tgt_ch_params)
 		*tgt_ch_params = ch_params;
@@ -1497,9 +1498,10 @@ wlansap_set_chan_params_for_csa(struct mac_context *mac,
 	}
 	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(
+	wlan_reg_set_channel_params_for_pwrmode(
 		mac->pdev, target_chan_freq, 0,
-		&mac->sap.SapDfsInfo.new_ch_params);
+		&mac->sap.SapDfsInfo.new_ch_params,
+		REG_CURRENT_PWR_MODE);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1605,8 +1607,9 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
 
 	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);
+	wlan_reg_set_channel_params_for_pwrmode(mac->pdev, target_chan_freq, 0,
+						&tmp_ch_params,
+						REG_CURRENT_PWR_MODE);
 	if (sap_ctx->chan_freq == target_chan_freq &&
 	    sap_ctx->ch_params.ch_width == tmp_ch_params.ch_width) {
 		sap_nofl_debug("target freq and bw %d not changed",
@@ -1941,8 +1944,9 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
 	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);
+	wlan_reg_set_channel_params_for_pwrmode(mac_ctx->pdev, target_chan_freq,
+						0, ch_params,
+						REG_CURRENT_PWR_MODE);
 	sap_ctx->ch_params = *ch_params;
 	sap_ctx->freq_before_ch_switch = sap_ctx->chan_freq;
 	/* Update the channel as this will be used to
@@ -2022,9 +2026,10 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(struct sap_context *sap_ctx)
 	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,
+	wlan_reg_set_channel_params_for_pwrmode(mac->pdev,
 			mac->sap.SapDfsInfo.target_chan_freq,
-			0, &mac->sap.SapDfsInfo.new_ch_params);
+			0, &mac->sap.SapDfsInfo.new_ch_params,
+			REG_CURRENT_PWR_MODE);
 
 	sap_get_cac_dur_dfs_region(sap_ctx, &new_cac_ms, &dfs_region,
 				   mac->sap.SapDfsInfo.target_chan_freq,
@@ -2449,9 +2454,10 @@ wlansap_son_update_sap_config_phymode(struct wlan_objmgr_vdev *vdev,
 		}
 	}
 
-	wlan_reg_set_channel_params_for_freq(pdev, config->chan_freq,
-					     config->sec_ch_freq,
-					     &config->ch_params);
+	wlan_reg_set_channel_params_for_pwrmode(pdev, config->chan_freq,
+						config->sec_ch_freq,
+						&config->ch_params,
+						REG_CURRENT_PWR_MODE);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 8 - 6
core/wma/src/wma_scan_roam.c

@@ -226,9 +226,10 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
 
 		wma_update_ch_list_11be_params(&ch_params);
 
-		wlan_reg_set_channel_params_for_freq(wma_handle->pdev,
-						     chan_p->mhz, 0,
-						     &ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(wma_handle->pdev,
+							chan_p->mhz, 0,
+							&ch_params,
+							REG_CURRENT_PWR_MODE);
 
 		chan_p->max_bw_supported =
 		     wma_map_phy_ch_bw_to_wmi_channel_width(ch_params.ch_width);
@@ -680,9 +681,10 @@ static void wma_update_phymode_on_roam(tp_wma_handle wma,
 			else
 				sec_ch_2g_freq = des_chan->ch_freq - 20;
 		}
-		wlan_reg_set_channel_params_for_freq(pdev, des_chan->ch_freq,
-						     sec_ch_2g_freq,
-						     &ch_params);
+		wlan_reg_set_channel_params_for_pwrmode(pdev, des_chan->ch_freq,
+							sec_ch_2g_freq,
+							&ch_params,
+							REG_CURRENT_PWR_MODE);
 		if (ch_params.ch_width != des_chan->ch_width ||
 		    ch_params.mhz_freq_seg0 != chan->band_center_freq1 ||
 		    ch_params.mhz_freq_seg1 != chan->band_center_freq2)