Forráskód Böngészése

qcacld-3.0: Replace wlan_reg_get_channel_state_for_freq

Replace all occurrences of
wlan_reg_get_channel_state_for_freq with
wlan_reg_get_channel_state_for_pwrmode and use extra
parameter as REG_CURRENT_PWR_MODE.

Change-Id: I7f7e4e700091918eeebc87ccbbc85ececdd9bf52
CRs-Fixed: 3145011
Divyajyothi Goparaju 2 éve
szülő
commit
3498515802

+ 7 - 4
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -2905,8 +2905,9 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero(
 	policy_mgr_debug("Set weight of DFS/passive channels to 0");
 
 	for (i = 0; i < orig_channel_count; i++) {
-		channel_state = wlan_reg_get_channel_state_for_freq(
-						pm_ctx->pdev, pcl_channels[i]);
+		channel_state = wlan_reg_get_channel_state_for_pwrmode(
+						pm_ctx->pdev, pcl_channels[i],
+						REG_CURRENT_PWR_MODE);
 		if ((channel_state == CHANNEL_STATE_DISABLE) ||
 				(channel_state == CHANNEL_STATE_INVALID))
 			/* Set weight of inactive channels to 0 */
@@ -4445,8 +4446,10 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
 		if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
 		    user_config_freq &&
 		    !WLAN_REG_IS_24GHZ_CH_FREQ(user_config_freq) &&
-		    (wlan_reg_get_channel_state_for_freq(pm_ctx->pdev,
-							 *intf_ch_freq) == CHANNEL_STATE_ENABLE)) {
+		    (wlan_reg_get_channel_state_for_pwrmode(
+			pm_ctx->pdev,
+			*intf_ch_freq,
+			REG_CURRENT_PWR_MODE) == CHANNEL_STATE_ENABLE)) {
 			status = policy_mgr_get_sap_mandatory_channel(
 							psoc, sap_ch_freq,
 							intf_ch_freq, vdev_id);

+ 4 - 3
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -7798,8 +7798,8 @@ bool policy_mgr_is_sap_allowed_on_dfs_freq(struct wlan_objmgr_pdev *pdev,
 	/* if sta_sap_scc_on_dfs_chan ini is set, DFS master capability is
 	 * assumed disabled in the driver.
 	 */
-	if ((wlan_reg_get_channel_state_for_freq(pdev, ch_freq) ==
-	    CHANNEL_STATE_DFS) &&
+	if ((wlan_reg_get_channel_state_for_pwrmode(
+		pdev, ch_freq, REG_CURRENT_PWR_MODE) == CHANNEL_STATE_DFS) &&
 	    !sta_cnt && !gc_cnt && sta_sap_scc_on_dfs_chan &&
 	    !policy_mgr_get_dfs_master_dynamic_enabled(psoc, vdev_id)) {
 		policy_mgr_err("SAP not allowed on DFS channel if no dfs master capability!!");
@@ -8261,7 +8261,8 @@ bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc,
 	sap_count = policy_mgr_mode_specific_connection_count(psoc,
 							      PM_SAP_MODE,
 							      NULL);
-	state = wlan_reg_get_channel_state_for_freq(pm_ctx->pdev, ch_freq);
+	state = wlan_reg_get_channel_state_for_pwrmode(pm_ctx->pdev, ch_freq,
+						       REG_CURRENT_PWR_MODE);
 
 	policy_mgr_debug("sta_sap_scc_on_dfs_chan %u, sap_count %u, ch freq %u, state %u",
 			 sta_sap_scc_on_dfs_chan, sap_count, ch_freq, state);

+ 3 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -416,8 +416,9 @@ policy_mgr_update_valid_ch_freq_list(struct policy_mgr_psoc_priv_obj *pm_ctx,
 	for (i = 0; i < NUM_CHANNELS; i++) {
 		ch_freq = reg_ch_list[i].center_freq;
 		if (is_client)
-			state = wlan_reg_get_channel_state_for_freq(
-							pm_ctx->pdev, ch_freq);
+			state = wlan_reg_get_channel_state_for_pwrmode(
+							pm_ctx->pdev, ch_freq,
+							REG_CURRENT_PWR_MODE);
 		else
 			state =
 			wlan_reg_get_channel_state_from_secondary_list_for_freq(

+ 6 - 4
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -5255,12 +5255,14 @@ wlan_mlme_check_chan_param_has_dfs(struct wlan_objmgr_pdev *pdev,
 				CHANNEL_STATE_DFS)
 			is_dfs = true;
 	} else if (ch_params->ch_width == CH_WIDTH_80P80MHZ) {
-		if (wlan_reg_get_channel_state_for_freq(
+		if (wlan_reg_get_channel_state_for_pwrmode(
 			pdev,
-			chan_freq) == CHANNEL_STATE_DFS ||
-		    wlan_reg_get_channel_state_for_freq(
+			chan_freq,
+			REG_CURRENT_PWR_MODE) == CHANNEL_STATE_DFS ||
+		    wlan_reg_get_channel_state_for_pwrmode(
 			pdev,
-			ch_params->mhz_freq_seg1) == CHANNEL_STATE_DFS)
+			ch_params->mhz_freq_seg1,
+			REG_CURRENT_PWR_MODE) == CHANNEL_STATE_DFS)
 			is_dfs = true;
 	} else if (wlan_reg_is_dfs_for_freq(pdev, chan_freq)) {
 		/*Indoor channels are also marked DFS, therefore

+ 3 - 1
components/tdls/core/src/wlan_tdls_peer.c

@@ -615,7 +615,9 @@ void tdls_extract_peer_state_param(struct tdls_peer_update_state *peer_param,
 	num = 0;
 	for (i = 0; i < peer->supported_channels_len; i++) {
 		ch_freq = peer->supported_chan_freq[i];
-		ch_state = wlan_reg_get_channel_state_for_freq(pdev, ch_freq);
+		ch_state = wlan_reg_get_channel_state_for_pwrmode(
+							pdev, ch_freq,
+							REG_CURRENT_PWR_MODE);
 
 		if (CHANNEL_STATE_INVALID != ch_state &&
 		    CHANNEL_STATE_DFS != ch_state &&

+ 3 - 1
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -1118,7 +1118,9 @@ static uint32_t cm_remove_disabled_channels(struct wlan_objmgr_vdev *vdev,
 
 	for (i = 0; i < NUM_CHANNELS; i++) {
 		freq = cur_chan_list[i].center_freq;
-		state = wlan_reg_get_channel_state_for_freq(pdev, freq);
+		state = wlan_reg_get_channel_state_for_pwrmode(
+							pdev, freq,
+							REG_CURRENT_PWR_MODE);
 		if (state != CHANNEL_STATE_DISABLE &&
 		    state != CHANNEL_STATE_INVALID) {
 			for (j = 0; j < num_chan; j++) {

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

@@ -43,7 +43,8 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
 	struct ch_params ch_params;
 	qdf_freq_t sec_freq;
 
-	state = wlan_reg_get_channel_state_for_freq(pdev, freq);
+	state = wlan_reg_get_channel_state_for_pwrmode(pdev, freq,
+						       REG_CURRENT_PWR_MODE);
 	if (state == CHANNEL_STATE_INVALID)
 		return flags;
 	if (state == CHANNEL_STATE_DFS) {

+ 7 - 4
core/hdd/src/wlan_hdd_cfg80211.c

@@ -18219,9 +18219,10 @@ int wlan_hdd_cfg80211_update_band(struct hdd_context *hdd_ctx,
 		for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
 			struct ieee80211_supported_band *band = wiphy->bands[i];
 
-			channel_state = wlan_reg_get_channel_state_for_freq(
+			channel_state = wlan_reg_get_channel_state_for_pwrmode(
 					hdd_ctx->pdev,
-					band->channels[j].center_freq);
+					band->channels[j].center_freq,
+					REG_CURRENT_PWR_MODE);
 
 			if (HDD_NL80211_BAND_2GHZ == i &&
 			    BAND_5G == new_band) {
@@ -23500,8 +23501,10 @@ static int __wlan_hdd_cfg80211_set_mon_ch(struct wiphy *wiphy,
 
 	/* Verify channel state before accepting this request */
 	chan_freq_state =
-		wlan_reg_get_channel_state_for_freq(hdd_ctx->pdev,
-						    chandef->chan->center_freq);
+		wlan_reg_get_channel_state_for_pwrmode(
+						hdd_ctx->pdev,
+						chandef->chan->center_freq,
+						REG_CURRENT_PWR_MODE);
 	if (chan_freq_state == CHANNEL_STATE_DISABLE ||
 	    chan_freq_state == CHANNEL_STATE_INVALID) {
 		hdd_err("Invalid chan freq received for monitor mode aborting");

+ 12 - 8
core/hdd/src/wlan_hdd_ext_scan.c

@@ -2539,8 +2539,9 @@ static int hdd_extscan_start_fill_bucket_channel_spec(
 
 				channel->channel = chan_list[j];
 				channel->channel_class = 0;
-				if ((wlan_reg_get_channel_state_for_freq(
-				     hdd_ctx->pdev, chan_list[j])) !=
+				if ((wlan_reg_get_channel_state_for_pwrmode(
+				     hdd_ctx->pdev, chan_list[j],
+				     REG_CURRENT_PWR_MODE)) !=
 				    CHANNEL_STATE_ENABLE) {
 					channel->passive = 1;
 					channel->dwell_time_ms =
@@ -2677,8 +2678,9 @@ static int hdd_extscan_start_fill_bucket_channel_spec(
 				hdd_debug("WiFi band is unspecified, dwellTime:%d",
 						channel->dwell_time_ms);
 
-				if ((wlan_reg_get_channel_state_for_freq(
-				     hdd_ctx->pdev, channel->channel)) !=
+				if ((wlan_reg_get_channel_state_for_pwrmode(
+				     hdd_ctx->pdev, channel->channel,
+				     REG_CURRENT_PWR_MODE)) !=
 				    CHANNEL_STATE_ENABLE) {
 					channel->dwell_time_ms =
 						max_dwell_time_passive_bucket;
@@ -2691,8 +2693,9 @@ static int hdd_extscan_start_fill_bucket_channel_spec(
 			hdd_debug("New Dwell time %u ms",
 				channel->dwell_time_ms);
 
-			if ((wlan_reg_get_channel_state_for_freq(
-			     hdd_ctx->pdev, channel->channel)) !=
+			if ((wlan_reg_get_channel_state_for_pwrmode(
+			     hdd_ctx->pdev, channel->channel,
+			     REG_CURRENT_PWR_MODE)) !=
 			    CHANNEL_STATE_ENABLE) {
 				if (min_dwell_time_passive_bucket >
 						channel->dwell_time_ms) {
@@ -2729,9 +2732,10 @@ static int hdd_extscan_start_fill_bucket_channel_spec(
 			hdd_debug("Chnl spec passive %u",
 				channel->passive);
 			/* Override scan type if required */
-			if ((wlan_reg_get_channel_state_for_freq(
+			if ((wlan_reg_get_channel_state_for_pwrmode(
 							hdd_ctx->pdev,
-							channel->channel))
+							channel->channel,
+							REG_CURRENT_PWR_MODE))
 			    != CHANNEL_STATE_ENABLE) {
 				channel->passive = true;
 			} else {

+ 4 - 2
core/hdd/src/wlan_hdd_ioctl.c

@@ -5296,8 +5296,10 @@ static int drv_cmd_tdls_off_channel(struct hdd_adapter *adapter,
 		return -EINVAL;
 
 	ch_freq = wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev, channel);
-	reg_state = wlan_reg_get_channel_state_for_freq(hdd_ctx->pdev,
-							ch_freq);
+	reg_state = wlan_reg_get_channel_state_for_pwrmode(
+							hdd_ctx->pdev,
+							ch_freq,
+							REG_CURRENT_PWR_MODE);
 
 	if (reg_state == CHANNEL_STATE_DFS ||
 		reg_state == CHANNEL_STATE_DISABLE ||

+ 2 - 1
core/hdd/src/wlan_hdd_lpass.c

@@ -57,7 +57,8 @@ static void wlan_hdd_get_channel_info(struct hdd_context *hdd_ctx,
 	chan_info->band_center_freq2 = 0;
 	chan_info->info = 0;
 	if (CHANNEL_STATE_DFS ==
-	    wlan_reg_get_channel_state_for_freq(hdd_ctx->pdev, chan_freq))
+	    wlan_reg_get_channel_state_for_pwrmode(hdd_ctx->pdev, chan_freq,
+						   REG_CURRENT_PWR_MODE))
 		WMI_SET_CHANNEL_FLAG(chan_info,
 				     WMI_CHAN_FLAG_DFS);
 	hdd_update_channel_bw_info(hdd_ctx, chan_freq,

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

@@ -504,8 +504,9 @@ static int oem_process_channel_info_req_msg(int numOfChannels, char *chanList)
 
 			hddChanInfo.info = 0;
 			if (CHANNEL_STATE_DFS ==
-			    wlan_reg_get_channel_state_for_freq(
-				p_hdd_ctx->pdev, chan_freq))
+			    wlan_reg_get_channel_state_for_pwrmode(
+						p_hdd_ctx->pdev, chan_freq,
+						REG_CURRENT_PWR_MODE))
 				WMI_SET_CHANNEL_FLAG(&hddChanInfo,
 						     WMI_CHAN_FLAG_DFS);
 

+ 3 - 2
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -190,8 +190,9 @@ lim_process_ext_channel_switch_action_frame(struct mac_context *mac_ctx,
 	 * and no concurrent session is running.
 	 */
 	if (!(session_entry->curr_op_freq != target_freq &&
-	      ((wlan_reg_get_channel_state_for_freq(mac_ctx->pdev, target_freq) ==
-		  CHANNEL_STATE_ENABLE) ||
+	      ((wlan_reg_get_channel_state_for_pwrmode(mac_ctx->pdev,
+						       target_freq,
+						       REG_CURRENT_PWR_MODE) == CHANNEL_STATE_ENABLE) ||
 	       (wlan_reg_is_dfs_for_freq(mac_ctx->pdev, target_freq) &&
 		!policy_mgr_concurrent_open_sessions_running(
 			mac_ctx->psoc))))) {

+ 3 - 2
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1939,9 +1939,10 @@ static void lim_process_messages(struct mac_context *mac_ctx,
 			 *    restart, in such a case, beacon params will be
 			 *    reset and thus will not contain Q2Q IE, by default
 			 */
-			if (wlan_reg_get_channel_state_for_freq(
+			if (wlan_reg_get_channel_state_for_pwrmode(
 				mac_ctx->pdev,
-				session_entry->curr_op_freq) !=
+				session_entry->curr_op_freq,
+				REG_CURRENT_PWR_MODE) !=
 				CHANNEL_STATE_DFS) {
 				beacon_params.bss_idx = session_entry->vdev_id;
 				beacon_params.beaconInterval =

+ 6 - 4
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -236,11 +236,13 @@ void lim_process_mlm_start_cnf(struct mac_context *mac, uint32_t *msg_buf)
 					CHANNEL_STATE_DFS)
 				send_bcon_ind = true;
 		} else if (pe_session->ch_width == CH_WIDTH_80P80MHZ) {
-			if ((wlan_reg_get_channel_state_for_freq(
-					mac->pdev, chan_freq) !=
+			if ((wlan_reg_get_channel_state_for_pwrmode(
+					mac->pdev, chan_freq,
+					REG_CURRENT_PWR_MODE) !=
 					CHANNEL_STATE_DFS) &&
-			    (wlan_reg_get_channel_state_for_freq(
-					mac->pdev, ch_cfreq1) !=
+			    (wlan_reg_get_channel_state_for_pwrmode(
+					mac->pdev, ch_cfreq1,
+					REG_CURRENT_PWR_MODE) !=
 					CHANNEL_STATE_DFS))
 				send_bcon_ind = true;
 		} else {

+ 6 - 4
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -2258,13 +2258,15 @@ lim_send_sme_ap_channel_switch_resp(struct mac_context *mac,
 		    ch_width, 0) == CHANNEL_STATE_DFS)
 			is_ch_dfs = true;
 	} else if (ch_width == CH_WIDTH_80P80MHZ) {
-		if (wlan_reg_get_channel_state_for_freq(
+		if (wlan_reg_get_channel_state_for_pwrmode(
 						mac->pdev,
-						pe_session->curr_op_freq) ==
+						pe_session->curr_op_freq,
+						REG_CURRENT_PWR_MODE) ==
 		    CHANNEL_STATE_DFS ||
-		    wlan_reg_get_channel_state_for_freq(
+		    wlan_reg_get_channel_state_for_pwrmode(
 						mac->pdev,
-						ch_cfreq1) ==
+						ch_cfreq1,
+						REG_CURRENT_PWR_MODE) ==
 				CHANNEL_STATE_DFS)
 			is_ch_dfs = true;
 	} else {

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

@@ -467,13 +467,15 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx,
 		    sap_ctx->ch_params.ch_width, 0) == CHANNEL_STATE_DFS)
 			is_ch_dfs = true;
 	} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
-		if (wlan_reg_get_channel_state_for_freq(
+		if (wlan_reg_get_channel_state_for_pwrmode(
 						mac_ctx->pdev,
-						target_chan_freq) ==
+						target_chan_freq,
+						REG_CURRENT_PWR_MODE) ==
 		    CHANNEL_STATE_DFS ||
-		    wlan_reg_get_channel_state_for_freq(
+		    wlan_reg_get_channel_state_for_pwrmode(
 					mac_ctx->pdev,
-					sap_ctx->ch_params.mhz_freq_seg1) ==
+					sap_ctx->ch_params.mhz_freq_seg1,
+					REG_CURRENT_PWR_MODE) ==
 				CHANNEL_STATE_DFS)
 			is_ch_dfs = true;
 	} else {

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

@@ -503,13 +503,15 @@ is_wlansap_cac_required_for_chan(struct mac_context *mac_ctx,
 		    ch_params->ch_width, 0) == CHANNEL_STATE_DFS)
 			is_ch_dfs = true;
 	} else if (ch_params->ch_width == CH_WIDTH_80P80MHZ) {
-		if (wlan_reg_get_channel_state_for_freq(
+		if (wlan_reg_get_channel_state_for_pwrmode(
 						mac_ctx->pdev,
-						chan_freq) ==
+						chan_freq,
+						REG_CURRENT_PWR_MODE) ==
 		    CHANNEL_STATE_DFS ||
-		    wlan_reg_get_channel_state_for_freq(
+		    wlan_reg_get_channel_state_for_pwrmode(
 					mac_ctx->pdev,
-					ch_params->mhz_freq_seg1) ==
+					ch_params->mhz_freq_seg1,
+					REG_CURRENT_PWR_MODE) ==
 				CHANNEL_STATE_DFS)
 			is_ch_dfs = true;
 	} else {
@@ -848,8 +850,9 @@ uint32_t sap_select_default_oper_chan(struct mac_context *mac_ctx,
 
 	for (i = 0; i < acs_cfg->ch_list_count; i++) {
 		enum channel_state state =
-			wlan_reg_get_channel_state_for_freq(
-					mac_ctx->pdev, acs_cfg->freq_list[i]);
+			wlan_reg_get_channel_state_for_pwrmode(
+					mac_ctx->pdev, acs_cfg->freq_list[i],
+					REG_CURRENT_PWR_MODE);
 		if (!freq0 && state == CHANNEL_STATE_ENABLE &&
 		    WLAN_REG_IS_5GHZ_CH_FREQ(acs_cfg->freq_list[i])) {
 			freq0 = acs_cfg->freq_list[i];
@@ -2055,8 +2058,9 @@ void sap_append_cac_history(struct mac_context *mac_ctx,
 
 		chan_cfreq = bonded_chan_ptr->start_freq;
 		while (chan_cfreq <= bonded_chan_ptr->end_freq) {
-			state = wlan_reg_get_channel_state_for_freq(
-					mac_ctx->pdev, chan_cfreq);
+			state = wlan_reg_get_channel_state_for_pwrmode(
+					mac_ctx->pdev, chan_cfreq,
+					REG_CURRENT_PWR_MODE);
 			if (state == CHANNEL_STATE_INVALID) {
 				sap_debug("invalid ch freq %d",
 					  chan_cfreq);
@@ -3566,13 +3570,15 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
 					mac_ctx->pdev, sap_chan_freq,
 					CH_WIDTH_160MHZ) == CHANNEL_STATE_DFS;
 		} else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) {
-			if (wlan_reg_get_channel_state_for_freq(
+			if (wlan_reg_get_channel_state_for_pwrmode(
 							mac_ctx->pdev,
-							sap_chan_freq) ==
+							sap_chan_freq,
+							REG_CURRENT_PWR_MODE) ==
 			    CHANNEL_STATE_DFS ||
-			    wlan_reg_get_channel_state_for_freq(
+			    wlan_reg_get_channel_state_for_pwrmode(
 							mac_ctx->pdev,
-							ch_cfreq1) ==
+							ch_cfreq1,
+							REG_CURRENT_PWR_MODE) ==
 					CHANNEL_STATE_DFS)
 				is_dfs = true;
 		} else {
@@ -3749,9 +3755,10 @@ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx,
 					sap_debug("vdev %d freq %d (state %d) is not DFS or disabled so continue",
 						  temp_sap_ctx->sessionId,
 						  temp_sap_ctx->chan_freq,
-						  wlan_reg_get_channel_state_for_freq(
+						  wlan_reg_get_channel_state_for_pwrmode(
 						  mac_ctx->pdev,
-						  temp_sap_ctx->chan_freq));
+						  temp_sap_ctx->chan_freq,
+						  REG_CURRENT_PWR_MODE));
 					continue;
 				}
 				sap_debug("vdev %d switch freq %d -> %d",

+ 6 - 3
core/sap/src/sap_module.c

@@ -1512,8 +1512,9 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
 		       sap_get_csa_reason_str(sap_ctx->csa_reason),
 		       sap_ctx->csa_reason, strict, sap_ctx->sessionId);
 
-	state = wlan_reg_get_channel_state_for_freq(mac->pdev,
-						    target_chan_freq);
+	state = wlan_reg_get_channel_state_for_pwrmode(mac->pdev,
+						       target_chan_freq,
+						       REG_CURRENT_PWR_MODE);
 	if (state == CHANNEL_STATE_DISABLE || state == CHANNEL_STATE_INVALID) {
 		sap_nofl_debug("invalid target freq %d state %d",
 			       target_chan_freq, state);
@@ -3249,7 +3250,9 @@ static uint32_t wlansap_get_2g_first_safe_chan_freq(struct sap_context *sap_ctx)
 	acs_list_count = sap_ctx->acs_cfg->master_ch_list_count;
 	for (i = 0; i < NUM_CHANNELS; i++) {
 		freq = cur_chan_list[i].center_freq;
-		state = wlan_reg_get_channel_state_for_freq(pdev, freq);
+		state = wlan_reg_get_channel_state_for_pwrmode(
+							pdev, freq,
+							REG_CURRENT_PWR_MODE);
 		if (state != CHANNEL_STATE_DISABLE &&
 		    state != CHANNEL_STATE_PASSIVE &&
 		    state != CHANNEL_STATE_INVALID &&

+ 7 - 4
core/sme/src/common/sme_api.c

@@ -1541,8 +1541,9 @@ QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle,
 
 		if (ch_freq > 2477) {
 			enum channel_state state =
-				wlan_reg_get_channel_state_for_freq(
-					mac->pdev, ch_freq);
+				wlan_reg_get_channel_state_for_pwrmode(
+					mac->pdev, ch_freq,
+					REG_CURRENT_PWR_MODE);
 
 			if (state == CHANNEL_STATE_DFS) {
 				/* DFS channel is provided, no PLM bursts can be
@@ -6074,8 +6075,10 @@ QDF_STATUS sme_ext_change_freq(mac_handle_t mac_handle, qdf_freq_t ch_freq,
 
 	sme_err("Set Channel freq: %d", ch_freq);
 
-	channel_state =
-		wlan_reg_get_channel_state_for_freq(mac_ctx->pdev, ch_freq);
+	channel_state = wlan_reg_get_channel_state_for_pwrmode(
+							mac_ctx->pdev,
+							ch_freq,
+							REG_CURRENT_PWR_MODE);
 
 	if (CHANNEL_STATE_DISABLE == channel_state) {
 		sme_err("Invalid channel freq: %d", ch_freq);

+ 9 - 6
core/sme/src/csr/csr_api_roam.c

@@ -824,8 +824,9 @@ static void csr_add_len_of_social_channels(struct mac_context *mac,
 			*num_chan);
 	if (CSR_IS_5G_BAND_ONLY(mac)) {
 		for (i = 0; i < MAX_SOCIAL_CHANNELS; i++) {
-			if (wlan_reg_get_channel_state_for_freq(
-				mac->pdev, social_channel_freq[i]) ==
+			if (wlan_reg_get_channel_state_for_pwrmode(
+				mac->pdev, social_channel_freq[i],
+				REG_CURRENT_PWR_MODE) ==
 					CHANNEL_STATE_ENABLE)
 				no_chan++;
 		}
@@ -845,8 +846,9 @@ static void csr_add_social_channels(struct mac_context *mac,
 			*num_chan);
 	if (CSR_IS_5G_BAND_ONLY(mac)) {
 		for (i = 0; i < MAX_SOCIAL_CHANNELS; i++) {
-			if (wlan_reg_get_channel_state_for_freq(
-					mac->pdev, social_channel_freq[i]) !=
+			if (wlan_reg_get_channel_state_for_pwrmode(
+					mac->pdev, social_channel_freq[i],
+					REG_CURRENT_PWR_MODE) !=
 					CHANNEL_STATE_ENABLE)
 				continue;
 			chan_list->chanParam[no_chan].freq =
@@ -992,8 +994,9 @@ QDF_STATUS csr_update_channel_list(struct mac_context *mac)
 			continue;
 
 		channel_state =
-			wlan_reg_get_channel_state_for_freq(
-				mac->pdev, channel_freq);
+			wlan_reg_get_channel_state_for_pwrmode(
+				mac->pdev, channel_freq,
+				REG_CURRENT_PWR_MODE);
 		if ((CHANNEL_STATE_ENABLE == channel_state) ||
 		    mac->scan.fEnableDFSChnlScan) {
 			if ((roam_policy->dfs_mode ==

+ 3 - 2
core/sme/src/csr/csr_api_scan.c

@@ -795,9 +795,10 @@ static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx,
 	enum channel_state ap_channel_state;
 
 	ap_channel_state =
-		wlan_reg_get_channel_state_for_freq(
+		wlan_reg_get_channel_state_for_pwrmode(
 				mac_ctx->pdev,
-				scan_entry->channel.chan_freq);
+				scan_entry->channel.chan_freq,
+				REG_CURRENT_PWR_MODE);
 	if (ap_channel_state == CHANNEL_STATE_DISABLE ||
 	    ap_channel_state == CHANNEL_STATE_INVALID) {
 		sme_err("BSS "QDF_MAC_ADDR_FMT" channel %d invalid, not populating this BSSID",