Эх сурвалжийг харах

qcacld-3.0: Use get_channel_state_for_freq to get chan state

As chan num may be same for different bands, getting chan state
from channel number may provide incorrect chan state.

Fix is to get chan state from frequency instead of channel number.

Change-Id: Iaf379614d8e536dba2cde71b9294a5a4b018769a
CRs-Fixed: 2869828
sheenam monga 4 жил өмнө
parent
commit
97f0114fe0

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

@@ -4865,7 +4865,7 @@ int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx)
 {
 {
 	struct hdd_cache_channels *cache_chann;
 	struct hdd_cache_channels *cache_chann;
 	struct wiphy *wiphy;
 	struct wiphy *wiphy;
-	int freq, status, rf_channel;
+	int freq, status;
 	int i;
 	int i;
 	struct ieee80211_channel *wiphy_channel = NULL;
 	struct ieee80211_channel *wiphy_channel = NULL;
 
 
@@ -4902,7 +4902,6 @@ int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx)
 		wiphy_channel = wlan_hdd_get_wiphy_channel(wiphy, freq);
 		wiphy_channel = wlan_hdd_get_wiphy_channel(wiphy, freq);
 		if (!wiphy_channel)
 		if (!wiphy_channel)
 			continue;
 			continue;
-		rf_channel = wiphy_channel->hw_value;
 		/*
 		/*
 		 * Restore the orginal states of the channels
 		 * Restore the orginal states of the channels
 		 * only if we have cached non zero values
 		 * only if we have cached non zero values
@@ -4936,7 +4935,7 @@ int wlan_hdd_disable_channels(struct hdd_context *hdd_ctx)
 {
 {
 	struct hdd_cache_channels *cache_chann;
 	struct hdd_cache_channels *cache_chann;
 	struct wiphy *wiphy;
 	struct wiphy *wiphy;
-	int freq, status, rf_channel;
+	int freq, status;
 	int i;
 	int i;
 	struct ieee80211_channel *wiphy_channel = NULL;
 	struct ieee80211_channel *wiphy_channel = NULL;
 
 
@@ -4970,15 +4969,14 @@ int wlan_hdd_disable_channels(struct hdd_context *hdd_ctx)
 		wiphy_channel = wlan_hdd_get_wiphy_channel(wiphy, freq);
 		wiphy_channel = wlan_hdd_get_wiphy_channel(wiphy, freq);
 		if (!wiphy_channel)
 		if (!wiphy_channel)
 			continue;
 			continue;
-		rf_channel = wiphy_channel->hw_value;
 		/*
 		/*
 		 * Cache the current states of
 		 * Cache the current states of
 		 * the channels
 		 * the channels
 		 */
 		 */
 		cache_chann->channel_info[i].reg_status =
 		cache_chann->channel_info[i].reg_status =
-					wlan_reg_get_channel_state(
+					wlan_reg_get_channel_state_for_freq(
 							hdd_ctx->pdev,
 							hdd_ctx->pdev,
-							rf_channel);
+							freq);
 		cache_chann->channel_info[i].wiphy_status =
 		cache_chann->channel_info[i].wiphy_status =
 							wiphy_channel->flags;
 							wiphy_channel->flags;
 		hdd_debug("Disable channel %d reg_stat %d wiphy_stat 0x%x",
 		hdd_debug("Disable channel %d reg_stat %d wiphy_stat 0x%x",
@@ -6441,6 +6439,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 	bool srd_channel_allowed, disable_nan = true;
 	bool srd_channel_allowed, disable_nan = true;
 	enum QDF_OPMODE vdev_opmode;
 	enum QDF_OPMODE vdev_opmode;
 	uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i;
 	uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i;
+	qdf_freq_t chan_freq;
 
 
 	hdd_enter();
 	hdd_enter();
 
 
@@ -6487,6 +6486,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 		hdd_err("Invalid channel");
 		hdd_err("Invalid channel");
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
+	chan_freq = (qdf_freq_t)params->chandef.chan->center_freq;
+
 	chandef = &params->chandef;
 	chandef = &params->chandef;
 	if ((adapter->device_mode == QDF_SAP_MODE ||
 	if ((adapter->device_mode == QDF_SAP_MODE ||
 	     adapter->device_mode == QDF_P2P_GO_MODE) &&
 	     adapter->device_mode == QDF_P2P_GO_MODE) &&
@@ -6537,8 +6538,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 		enum phy_ch_width sub_20_ch_width = CH_WIDTH_INVALID;
 		enum phy_ch_width sub_20_ch_width = CH_WIDTH_INVALID;
 		struct sap_config *sap_cfg = &adapter->session.ap.sap_config;
 		struct sap_config *sap_cfg = &adapter->session.ap.sap_config;
 
 
-		if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state(
-					hdd_ctx->pdev, channel)) {
+		if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state_for_freq(
+					hdd_ctx->pdev, chan_freq)) {
 			hdd_err("Can't start SAP-DFS (channel=%d)with sub 20 MHz ch wd",
 			hdd_err("Can't start SAP-DFS (channel=%d)with sub 20 MHz ch wd",
 				channel);
 				channel);
 			return -EINVAL;
 			return -EINVAL;

+ 5 - 1
core/hdd/src/wlan_hdd_ioctl.c

@@ -5656,6 +5656,7 @@ static int drv_cmd_tdls_off_channel(struct hdd_adapter *adapter,
 	uint8_t *value = command;
 	uint8_t *value = command;
 	int channel;
 	int channel;
 	enum channel_state reg_state;
 	enum channel_state reg_state;
+	qdf_freq_t ch_freq;
 
 
 	/* Move pointer to point the string */
 	/* Move pointer to point the string */
 	value += command_len;
 	value += command_len;
@@ -5663,7 +5664,10 @@ static int drv_cmd_tdls_off_channel(struct hdd_adapter *adapter,
 	ret = sscanf(value, "%d", &channel);
 	ret = sscanf(value, "%d", &channel);
 	if (ret != 1)
 	if (ret != 1)
 		return -EINVAL;
 		return -EINVAL;
-	reg_state = wlan_reg_get_channel_state(hdd_ctx->pdev, channel);
+
+	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);
 
 
 	if (reg_state == CHANNEL_STATE_DFS ||
 	if (reg_state == CHANNEL_STATE_DFS ||
 		reg_state == CHANNEL_STATE_DISABLE ||
 		reg_state == CHANNEL_STATE_DISABLE ||

+ 5 - 3
core/hdd/src/wlan_hdd_wext.c

@@ -4664,6 +4664,7 @@ static int hdd_we_start_fw_profile(struct hdd_adapter *adapter, int value)
 static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel)
 static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel)
 {
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+	qdf_freq_t ch_freq;
 	QDF_STATUS status;
 	QDF_STATUS status;
 
 
 	hdd_debug("Set Channel %d Session ID %d mode %d", channel,
 	hdd_debug("Set Channel %d Session ID %d mode %d", channel,
@@ -4682,9 +4683,10 @@ static int hdd_we_set_channel(struct hdd_adapter *adapter, int channel)
 			adapter->device_mode);
 			adapter->device_mode);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
-
-	status = sme_ext_change_channel(hdd_ctx->mac_handle, channel,
-					adapter->vdev_id);
+	ch_freq = wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
+					       channel);
+	status = sme_ext_change_freq(hdd_ctx->mac_handle, ch_freq,
+				     adapter->vdev_id);
 	if (status != QDF_STATUS_SUCCESS)
 	if (status != QDF_STATUS_SUCCESS)
 		hdd_err("Error in change channel status %d", status);
 		hdd_err("Error in change channel status %d", status);
 
 

+ 1 - 1
core/mac/inc/sir_api.h

@@ -3994,7 +3994,7 @@ struct sir_qos_params {
 struct sir_sme_ext_cng_chan_req {
 struct sir_sme_ext_cng_chan_req {
 	uint16_t  message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
 	uint16_t  message_type; /* eWNI_SME_EXT_CHANGE_CHANNEL */
 	uint16_t  length;
 	uint16_t  length;
-	uint32_t  new_channel;
+	uint32_t  new_ch_freq;
 	uint8_t   vdev_id;
 	uint8_t   vdev_id;
 };
 };
 
 

+ 3 - 5
core/mac/src/pe/lim/lim_link_monitoring_algo.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -452,7 +452,6 @@ lim_tear_down_link_with_ap(struct mac_context *mac, uint8_t sessionId,
 void lim_handle_heart_beat_failure(struct mac_context *mac_ctx,
 void lim_handle_heart_beat_failure(struct mac_context *mac_ctx,
 				   struct pe_session *session)
 				   struct pe_session *session)
 {
 {
-	uint8_t curr_chan;
 	tpSirAddie scan_ie = NULL;
 	tpSirAddie scan_ie = NULL;
 
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
@@ -494,9 +493,8 @@ void lim_handle_heart_beat_failure(struct mac_context *mac_ctx,
 		 * DFS channel then only send the probe request otherwise tear
 		 * DFS channel then only send the probe request otherwise tear
 		 * down the link
 		 * down the link
 		 */
 		 */
-		curr_chan = wlan_reg_freq_to_chan(
-					mac_ctx->pdev, session->curr_op_freq);
-		if (!lim_isconnected_on_dfs_channel(mac_ctx, curr_chan)) {
+		if (!lim_isconnected_on_dfs_freq(mac_ctx,
+						 session->curr_op_freq)) {
 			/* Detected continuous Beacon Misses */
 			/* Detected continuous Beacon Misses */
 			session->LimHBFailureStatus = true;
 			session->LimHBFailureStatus = true;
 
 

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

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

+ 6 - 11
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2699,10 +2699,9 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 
 
 	/* Enable the spectrum management if this is a DFS channel */
 	/* Enable the spectrum management if this is a DFS channel */
 	if (session->country_info_present &&
 	if (session->country_info_present &&
-	    lim_isconnected_on_dfs_channel(
+	    lim_isconnected_on_dfs_freq(
 			mac_ctx,
 			mac_ctx,
-			wlan_reg_freq_to_chan(
-			mac_ctx->pdev, session->curr_op_freq)))
+			session->curr_op_freq))
 		session->spectrumMgtEnabled = true;
 		session->spectrumMgtEnabled = true;
 
 
 	ap_cap_info = (tSirMacCapabilityInfo *)&bss_desc->capabilityInfo;
 	ap_cap_info = (tSirMacCapabilityInfo *)&bss_desc->capabilityInfo;
@@ -4610,9 +4609,8 @@ static void __lim_process_sme_reassoc_req(struct mac_context *mac_ctx,
 
 
 	/* Enable the spectrum management if this is a DFS channel */
 	/* Enable the spectrum management if this is a DFS channel */
 	if (session_entry->country_info_present &&
 	if (session_entry->country_info_present &&
-	    lim_isconnected_on_dfs_channel(
-		mac_ctx, wlan_reg_freq_to_chan(
-		mac_ctx->pdev, session_entry->curr_op_freq)))
+	    lim_isconnected_on_dfs_freq(
+		mac_ctx, session_entry->curr_op_freq))
 		session_entry->spectrumMgtEnabled = true;
 		session_entry->spectrumMgtEnabled = true;
 
 
 	session_entry->limPrevSmeState = session_entry->limSmeState;
 	session_entry->limPrevSmeState = session_entry->limSmeState;
@@ -8221,7 +8219,6 @@ static void lim_process_ext_change_channel(struct mac_context *mac_ctx,
 	struct sir_sme_ext_cng_chan_req *ext_chng_channel =
 	struct sir_sme_ext_cng_chan_req *ext_chng_channel =
 				(struct sir_sme_ext_cng_chan_req *) msg;
 				(struct sir_sme_ext_cng_chan_req *) msg;
 	struct pe_session *session_entry = NULL;
 	struct pe_session *session_entry = NULL;
-	uint32_t new_ext_chan_freq;
 
 
 	if (!msg) {
 	if (!msg) {
 		pe_err("Buffer is Pointing to NULL");
 		pe_err("Buffer is Pointing to NULL");
@@ -8238,11 +8235,9 @@ static void lim_process_ext_change_channel(struct mac_context *mac_ctx,
 		pe_err("not an STA/CLI session");
 		pe_err("not an STA/CLI session");
 		return;
 		return;
 	}
 	}
-	new_ext_chan_freq =
-		wlan_reg_legacy_chan_to_freq(mac_ctx->pdev,
-					     ext_chng_channel->new_channel);
 	session_entry->gLimChannelSwitch.sec_ch_offset = 0;
 	session_entry->gLimChannelSwitch.sec_ch_offset = 0;
-	send_extended_chan_switch_action_frame(mac_ctx, new_ext_chan_freq, 0,
+	send_extended_chan_switch_action_frame(mac_ctx,
+					       ext_chng_channel->new_ch_freq, 0,
 					       session_entry);
 					       session_entry);
 }
 }
 
 

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

@@ -4819,11 +4819,12 @@ void pe_set_resume_channel(struct mac_context *mac, uint16_t channel,
 	mac->lim.gResumePhyCbState = phyCbState;
 	mac->lim.gResumePhyCbState = phyCbState;
 }
 }
 
 
-bool lim_isconnected_on_dfs_channel(struct mac_context *mac_ctx,
-		uint8_t currentChannel)
+bool lim_isconnected_on_dfs_freq(struct mac_context *mac_ctx,
+				 qdf_freq_t oper_freq)
 {
 {
 	if (CHANNEL_STATE_DFS ==
 	if (CHANNEL_STATE_DFS ==
-	    wlan_reg_get_channel_state(mac_ctx->pdev, currentChannel)) {
+	    wlan_reg_get_channel_state_for_freq(mac_ctx->pdev,
+						oper_freq)) {
 		return true;
 		return true;
 	} else {
 	} else {
 		return false;
 		return false;

+ 2 - 2
core/mac/src/pe/lim/lim_utils.h

@@ -669,8 +669,8 @@ uint8_t lim_get_noa_attr_stream(struct mac_context *mac, uint8_t *pNoaStream,
 uint8_t lim_build_p2p_ie(struct mac_context *mac, uint8_t *ie, uint8_t *data,
 uint8_t lim_build_p2p_ie(struct mac_context *mac, uint8_t *ie, uint8_t *data,
 		uint8_t ie_len);
 		uint8_t ie_len);
 
 
-bool lim_isconnected_on_dfs_channel(struct mac_context *mac_ctx,
-				    uint8_t currentChannel);
+bool lim_isconnected_on_dfs_freq(struct mac_context *mac_ctx,
+				 qdf_freq_t curr_chan_freq);
 
 
 uint32_t lim_get_max_rate_flags(struct mac_context *mac_ctx,
 uint32_t lim_get_max_rate_flags(struct mac_context *mac_ctx,
 				tpDphHashNode sta_ds);
 				tpDphHashNode sta_ds);

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

@@ -618,6 +618,7 @@ sap_dfs_is_channel_in_nol_list(struct sap_context *sap_context,
 	uint8_t num_channels;
 	uint8_t num_channels;
 	struct wlan_objmgr_pdev *pdev = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
 	enum channel_state ch_state;
 	enum channel_state ch_state;
+	qdf_freq_t ch_freq;
 
 
 	mac_ctx = sap_get_mac_context();
 	mac_ctx = sap_get_mac_context();
 	if (!mac_ctx) {
 	if (!mac_ctx) {
@@ -644,11 +645,13 @@ sap_dfs_is_channel_in_nol_list(struct sap_context *sap_context,
 
 
 	/* check for NOL, first on will break the loop */
 	/* check for NOL, first on will break the loop */
 	for (i = 0; i < num_channels; i++) {
 	for (i = 0; i < num_channels; i++) {
-		ch_state = wlan_reg_get_channel_state(pdev, channels[i]);
+		ch_freq = wlan_reg_legacy_chan_to_freq(pdev, channels[i]);
+
+		ch_state = wlan_reg_get_channel_state_for_freq(pdev, ch_freq);
 		if (CHANNEL_STATE_ENABLE != ch_state &&
 		if (CHANNEL_STATE_ENABLE != ch_state &&
 		    CHANNEL_STATE_DFS != ch_state) {
 		    CHANNEL_STATE_DFS != ch_state) {
-			sap_err_rl("Invalid ch num=%d, ch state=%d",
-				   channels[i], ch_state);
+			sap_err_rl("Invalid ch num=%d chfreq = %d, ch state=%d",
+				   channels[i], ch_freq, ch_state);
 			return true;
 			return true;
 		}
 		}
 	} /* loop for bonded channels */
 	} /* loop for bonded channels */

+ 0 - 2
core/sme/inc/csr_support.h

@@ -311,8 +311,6 @@ QDF_STATUS csr_get_parsed_bss_description_ies(struct mac_context *mac_ctx,
 					      struct bss_description *bss_desc,
 					      struct bss_description *bss_desc,
 					      tDot11fBeaconIEs **ppIEStruct);
 					      tDot11fBeaconIEs **ppIEStruct);
 
 
-tSirScanType csr_get_scan_type(struct mac_context *mac, uint8_t chnId);
-
 QDF_STATUS csr_get_phy_mode_from_bss(struct mac_context *mac,
 QDF_STATUS csr_get_phy_mode_from_bss(struct mac_context *mac,
 		struct bss_description *pBSSDescription,
 		struct bss_description *pBSSDescription,
 		eCsrPhyMode *pPhyMode, tDot11fBeaconIEs *pIes);
 		eCsrPhyMode *pPhyMode, tDot11fBeaconIEs *pIes);

+ 2 - 2
core/sme/inc/sme_api.h

@@ -1701,8 +1701,8 @@ QDF_STATUS sme_set_led_flashing(mac_handle_t mac_handle, uint8_t type,
 QDF_STATUS sme_enable_dfs_chan_scan(mac_handle_t mac_handle, uint8_t dfs_flag);
 QDF_STATUS sme_enable_dfs_chan_scan(mac_handle_t mac_handle, uint8_t dfs_flag);
 QDF_STATUS sme_set_mas(uint32_t val);
 QDF_STATUS sme_set_mas(uint32_t val);
 QDF_STATUS sme_set_miracast(mac_handle_t mac_handle, uint8_t filter_type);
 QDF_STATUS sme_set_miracast(mac_handle_t mac_handle, uint8_t filter_type);
-QDF_STATUS sme_ext_change_channel(mac_handle_t mac_handle, uint32_t channel,
-				  uint8_t session_id);
+QDF_STATUS sme_ext_change_freq(mac_handle_t mac_handle, qdf_freq_t freq,
+			       uint8_t session_id);
 
 
 QDF_STATUS sme_configure_stats_avg_factor(mac_handle_t mac_handle,
 QDF_STATUS sme_configure_stats_avg_factor(mac_handle_t mac_handle,
 					  uint8_t session_id,
 					  uint8_t session_id,

+ 9 - 8
core/sme/src/common/sme_api.c

@@ -5939,7 +5939,7 @@ sme_update_roam_scan_home_away_time(mac_handle_t mac_handle, uint8_t vdev_id,
 }
 }
 
 
 /**
 /**
- * sme_ext_change_channel()- function to post send ECSA
+ * sme_ext_change_freq()- function to post send ECSA
  * action frame to csr.
  * action frame to csr.
  * @mac_handle: Opaque handle to the global MAC context
  * @mac_handle: Opaque handle to the global MAC context
  * @channel freq: new channel freq to switch
  * @channel freq: new channel freq to switch
@@ -5949,19 +5949,20 @@ sme_update_roam_scan_home_away_time(mac_handle_t mac_handle, uint8_t vdev_id,
  *
  *
  * Return: success if msg is sent else return failure
  * Return: success if msg is sent else return failure
  */
  */
-QDF_STATUS sme_ext_change_channel(mac_handle_t mac_handle, uint32_t channel,
-						uint8_t session_id)
+QDF_STATUS sme_ext_change_freq(mac_handle_t mac_handle, qdf_freq_t ch_freq,
+			       uint8_t session_id)
 {
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct mac_context *mac_ctx  = MAC_CONTEXT(mac_handle);
 	struct mac_context *mac_ctx  = MAC_CONTEXT(mac_handle);
 	uint8_t channel_state;
 	uint8_t channel_state;
 
 
-	sme_err("Set Channel: %d", channel);
+	sme_err("Set Channel freq: %d", ch_freq);
+
 	channel_state =
 	channel_state =
-		wlan_reg_get_channel_state(mac_ctx->pdev, channel);
+		wlan_reg_get_channel_state_for_freq(mac_ctx->pdev, ch_freq);
 
 
 	if (CHANNEL_STATE_DISABLE == channel_state) {
 	if (CHANNEL_STATE_DISABLE == channel_state) {
-		sme_err("Invalid channel: %d", channel);
+		sme_err("Invalid channel freq: %d", ch_freq);
 		return QDF_STATUS_E_INVAL;
 		return QDF_STATUS_E_INVAL;
 	}
 	}
 
 
@@ -5969,8 +5970,8 @@ QDF_STATUS sme_ext_change_channel(mac_handle_t mac_handle, uint32_t channel,
 
 
 	if (QDF_STATUS_SUCCESS == status) {
 	if (QDF_STATUS_SUCCESS == status) {
 		/* update the channel list to the firmware */
 		/* update the channel list to the firmware */
-		status = csr_send_ext_change_channel(mac_ctx,
-						channel, session_id);
+		status = csr_send_ext_change_freq(mac_ctx,
+						  ch_freq, session_id);
 		sme_release_global_lock(&mac_ctx->sme);
 		sme_release_global_lock(&mac_ctx->sme);
 	}
 	}
 
 

+ 5 - 5
core/sme/src/csr/csr_api_roam.c

@@ -16182,18 +16182,18 @@ csr_roam_update_add_ies(struct mac_context *mac,
 }
 }
 
 
 /**
 /**
- * csr_send_ext_change_channel()- function to post send ECSA
+ * csr_send_ext_change_freq()- function to post send ECSA
  * action frame to lim.
  * action frame to lim.
  * @mac_ctx: pointer to global mac structure
  * @mac_ctx: pointer to global mac structure
- * @channel: new channel to switch
+ * @ch_freq: new channel freq to switch
  * @session_id: senssion it should be sent on.
  * @session_id: senssion it should be sent on.
  *
  *
  * This function is called to post ECSA frame to lim.
  * This function is called to post ECSA frame to lim.
  *
  *
  * Return: success if msg posted to LIM else return failure
  * Return: success if msg posted to LIM else return failure
  */
  */
-QDF_STATUS csr_send_ext_change_channel(struct mac_context *mac_ctx, uint32_t channel,
-					uint8_t session_id)
+QDF_STATUS csr_send_ext_change_freq(struct mac_context *mac_ctx,
+				    qdf_freq_t ch_freq, uint8_t session_id)
 {
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct sir_sme_ext_cng_chan_req *msg;
 	struct sir_sme_ext_cng_chan_req *msg;
@@ -16204,7 +16204,7 @@ QDF_STATUS csr_send_ext_change_channel(struct mac_context *mac_ctx, uint32_t cha
 
 
 	msg->message_type = eWNI_SME_EXT_CHANGE_CHANNEL;
 	msg->message_type = eWNI_SME_EXT_CHANGE_CHANNEL;
 	msg->length = sizeof(*msg);
 	msg->length = sizeof(*msg);
-	msg->new_channel = channel;
+	msg->new_ch_freq = ch_freq;
 	msg->vdev_id = session_id;
 	msg->vdev_id = session_id;
 	status = umac_send_mb_message_to_mac(msg);
 	status = umac_send_mb_message_to_mac(msg);
 	return status;
 	return status;

+ 2 - 2
core/sme/src/csr/csr_inside_api.h

@@ -871,8 +871,8 @@ void csr_store_sae_single_pmk_to_global_cache(struct mac_context *mac,
 {}
 {}
 #endif
 #endif
 
 
-QDF_STATUS csr_send_ext_change_channel(struct mac_context *mac_ctx,
-				uint32_t channel, uint8_t session_id);
+QDF_STATUS csr_send_ext_change_freq(struct mac_context *mac_ctx,
+				    qdf_freq_t ch_freq, uint8_t session_id);
 
 
 /**
 /**
  * csr_csa_start() - request CSA IE transmission from PE
  * csr_csa_start() - request CSA IE transmission from PE

+ 0 - 12
core/sme/src/csr/csr_util.c

@@ -3127,18 +3127,6 @@ tSirResultCodes csr_get_de_auth_rsp_status_code(struct deauth_rsp *pSmeRsp)
 	return (tSirResultCodes) ret;
 	return (tSirResultCodes) ret;
 }
 }
 
 
-tSirScanType csr_get_scan_type(struct mac_context *mac, uint8_t chnId)
-{
-	tSirScanType scanType = eSIR_PASSIVE_SCAN;
-	enum channel_state channelEnabledType;
-
-	channelEnabledType = wlan_reg_get_channel_state(mac->pdev, chnId);
-	if (CHANNEL_STATE_ENABLE == channelEnabledType)
-		scanType = eSIR_ACTIVE_SCAN;
-
-	return scanType;
-}
-
 enum bss_type csr_translate_bsstype_to_mac_type(eCsrRoamBssType csrtype)
 enum bss_type csr_translate_bsstype_to_mac_type(eCsrRoamBssType csrtype)
 {
 {
 	enum bss_type ret;
 	enum bss_type ret;