Procházet zdrojové kódy

qcacld-3.0: Policy manager update for channel to frequency usage

Update policy manager data structures and APIs to use frequency
instead of channels. This is done to address channel number
ambiguity with introduction of 6GHZ band. Fix all references of
channel and add temporary internal functions for frequency
usage as replacement for public APIs using channels. Also modify
the channel list handling to frequency list in associated modules.

Change-Id: I11dff14a5fbe6d49cf411f8fce6863994ffccd75
CRs-fixed: 2540000
Manikandan Mohan před 5 roky
rodič
revize
932c11e3b3

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 391 - 124
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h


+ 5 - 5
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h

@@ -981,7 +981,7 @@ enum dbs_support {
  * connections in the wlan system
  * connections in the wlan system
  *
  *
  * @mode: connection type
  * @mode: connection type
- * @chan: channel of the connection
+ * @freq: Channel frequency
  * @bw: channel bandwidth used for the connection
  * @bw: channel bandwidth used for the connection
  * @mac: The HW mac it is running
  * @mac: The HW mac it is running
  * @chain_mask: The original capability advertised by HW
  * @chain_mask: The original capability advertised by HW
@@ -991,7 +991,7 @@ enum dbs_support {
  */
  */
 struct policy_mgr_conc_connection_info {
 struct policy_mgr_conc_connection_info {
 	enum policy_mgr_con_mode mode;
 	enum policy_mgr_con_mode mode;
-	uint8_t       chan;
+	uint32_t      freq;
 	enum hw_mode_bandwidth bw;
 	enum hw_mode_bandwidth bw;
 	uint8_t       mac;
 	uint8_t       mac;
 	enum policy_mgr_chain_mode chain_mask;
 	enum policy_mgr_chain_mode chain_mask;
@@ -1075,7 +1075,7 @@ struct policy_mgr_hw_mode {
  * @pcl_len: Number of channels in the PCL
  * @pcl_len: Number of channels in the PCL
  */
  */
 struct policy_mgr_pcl_list {
 struct policy_mgr_pcl_list {
-	uint8_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST];
+	uint32_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint32_t pcl_len;
 	uint32_t pcl_len;
 };
 };
@@ -1093,9 +1093,9 @@ struct policy_mgr_pcl_list {
  * @weight_list: Weights assigned by policy manager
  * @weight_list: Weights assigned by policy manager
  */
  */
 struct policy_mgr_pcl_chan_weights {
 struct policy_mgr_pcl_chan_weights {
-	uint8_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST];
+	uint32_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint32_t pcl_len;
 	uint32_t pcl_len;
-	uint8_t saved_chan_list[POLICY_MGR_MAX_CHANNEL_LIST];
+	uint32_t saved_chan_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint32_t saved_num_chan;
 	uint32_t saved_num_chan;
 	uint8_t weighed_valid_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint8_t weighed_valid_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST];
 	uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST];

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 238 - 232
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 234 - 220
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 242 - 193
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c


+ 50 - 15
components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -36,8 +36,8 @@
 #define CONNECTION_UPDATE_TIMEOUT (POLICY_MGR_SER_CMD_TIMEOUT + 2000)
 #define CONNECTION_UPDATE_TIMEOUT (POLICY_MGR_SER_CMD_TIMEOUT + 2000)
 #endif
 #endif
 
 
-#define PM_24_GHZ_CHANNEL_6   (6)
-#define PM_5_GHZ_CHANNEL_36   (36)
+#define PM_24_GHZ_CH_FREQ_6   (2437)
+#define PM_5_GHZ_CH_FREQ_36   (5180)
 #define CHANNEL_SWITCH_COMPLETE_TIMEOUT   (2000)
 #define CHANNEL_SWITCH_COMPLETE_TIMEOUT   (2000)
 
 
 /**
 /**
@@ -291,7 +291,7 @@ struct policy_mgr_cfg {
  * interaction with Policy Manager
  * interaction with Policy Manager
  * @sap_mandatory_channels: The user preferred master list on
  * @sap_mandatory_channels: The user preferred master list on
  *                        which SAP can be brought up. This
  *                        which SAP can be brought up. This
- *                        mandatory channel list would be as per
+ *                        mandatory channel freq list would be as per
  *                        OEMs preference & conforming to the
  *                        OEMs preference & conforming to the
  *                        regulatory/other considerations
  *                        regulatory/other considerations
  * @sap_mandatory_channels_len: Length of the SAP mandatory
  * @sap_mandatory_channels_len: Length of the SAP mandatory
@@ -313,12 +313,16 @@ struct policy_mgr_cfg {
  *                            change is in progress
  *                            change is in progress
  * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler
  * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler
  *      value from INI
  *      value from INI
- * @unsafe_channel_list: LTE coex channel avoidance list
+ * @unsafe_channel_list: LTE coex channel freq avoidance list
  * @unsafe_channel_count: LTE coex channel avoidance list count
  * @unsafe_channel_count: LTE coex channel avoidance list count
  * @sta_ap_intf_check_work_info: Info related to sta_ap_intf_check_work
  * @sta_ap_intf_check_work_info: Info related to sta_ap_intf_check_work
  * @nan_sap_conc_work: Info related to nan sap conc work
  * @nan_sap_conc_work: Info related to nan sap conc work
  * @opportunistic_update_done_evt: qdf event to synchronize host
  * @opportunistic_update_done_evt: qdf event to synchronize host
  *                               & FW HW mode
  *                               & FW HW mode
+ * @channel_switch_complete_evt: qdf event for channel switch completion check
+ * @mode_change_cb: Mode change callback
+ * @user_config_sap_ch_freq: SAP channel freq configured by user application
+ * @cfg: Policy manager config data
  */
  */
 struct policy_mgr_psoc_priv_obj {
 struct policy_mgr_psoc_priv_obj {
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_objmgr_psoc *psoc;
@@ -332,7 +336,7 @@ struct policy_mgr_psoc_priv_obj {
 	struct policy_mgr_tdls_cbacks tdls_cbacks;
 	struct policy_mgr_tdls_cbacks tdls_cbacks;
 	struct policy_mgr_cdp_cbacks cdp_cbacks;
 	struct policy_mgr_cdp_cbacks cdp_cbacks;
 	struct policy_mgr_dp_cbacks dp_cbacks;
 	struct policy_mgr_dp_cbacks dp_cbacks;
-	uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN];
+	uint32_t sap_mandatory_channels[QDF_MAX_NUM_CHAN];
 	uint32_t sap_mandatory_channels_len;
 	uint32_t sap_mandatory_channels_len;
 	bool do_hw_mode_change;
 	bool do_hw_mode_change;
 	bool do_sap_unsafe_ch_check;
 	bool do_sap_unsafe_ch_check;
@@ -348,14 +352,14 @@ struct policy_mgr_psoc_priv_obj {
 	struct dual_mac_config dual_mac_cfg;
 	struct dual_mac_config dual_mac_cfg;
 	uint32_t hw_mode_change_in_progress;
 	uint32_t hw_mode_change_in_progress;
 	struct policy_mgr_user_cfg user_cfg;
 	struct policy_mgr_user_cfg user_cfg;
-	uint16_t unsafe_channel_list[QDF_MAX_NUM_CHAN];
+	uint32_t unsafe_channel_list[QDF_MAX_NUM_CHAN];
 	uint16_t unsafe_channel_count;
 	uint16_t unsafe_channel_count;
 	struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info;
 	struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info;
 	uint8_t cur_conc_system_pref;
 	uint8_t cur_conc_system_pref;
 	qdf_event_t opportunistic_update_done_evt;
 	qdf_event_t opportunistic_update_done_evt;
 	qdf_event_t channel_switch_complete_evt;
 	qdf_event_t channel_switch_complete_evt;
 	send_mode_change_event_cb mode_change_cb;
 	send_mode_change_event_cb mode_change_cb;
-	uint32_t user_config_sap_channel;
+	uint32_t user_config_sap_ch_freq;
 	struct policy_mgr_cfg cfg;
 	struct policy_mgr_cfg cfg;
 };
 };
 
 
@@ -433,7 +437,7 @@ QDF_STATUS policy_mgr_get_old_and_new_hw_index(
 void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 		uint32_t conn_index,
 		uint32_t conn_index,
 		enum policy_mgr_con_mode mode,
 		enum policy_mgr_con_mode mode,
-		uint8_t chan,
+		uint32_t freq,
 		enum hw_mode_bandwidth bw,
 		enum hw_mode_bandwidth bw,
 		uint8_t mac,
 		uint8_t mac,
 		enum policy_mgr_chain_mode chain_mask,
 		enum policy_mgr_chain_mode chain_mask,
@@ -471,7 +475,7 @@ void policy_mgr_store_and_del_conn_info_by_vdev_id(
  * policy_mgr_store_and_del_conn_info_by_chan_and_mode() - Store and del a
  * policy_mgr_store_and_del_conn_info_by_chan_and_mode() - Store and del a
  * connection info by chan number and conn mode
  * connection info by chan number and conn mode
  * @psoc: PSOC object information
  * @psoc: PSOC object information
- * @chan: channel number
+ * @ch_freq: channel frequency value
  * @mode: conn mode
  * @mode: conn mode
  * @info: structure array pointer where the connection info will be saved
  * @info: structure array pointer where the connection info will be saved
  * @num_cxn_del: number of connection which are going to be deleted
  * @num_cxn_del: number of connection which are going to be deleted
@@ -483,7 +487,7 @@ void policy_mgr_store_and_del_conn_info_by_vdev_id(
  */
  */
 void policy_mgr_store_and_del_conn_info_by_chan_and_mode(
 void policy_mgr_store_and_del_conn_info_by_chan_and_mode(
 			struct wlan_objmgr_psoc *psoc,
 			struct wlan_objmgr_psoc *psoc,
-			uint32_t chan,
+			uint32_t ch_freq,
 			enum policy_mgr_con_mode mode,
 			enum policy_mgr_con_mode mode,
 			struct policy_mgr_conc_connection_info *info,
 			struct policy_mgr_conc_connection_info *info,
 			uint8_t *num_cxn_del);
 			uint8_t *num_cxn_del);
@@ -532,15 +536,46 @@ enum phy_ch_width policy_mgr_get_ch_width(enum hw_mode_bandwidth bw);
 
 
 QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 			enum policy_mgr_pcl_type pcl,
 			enum policy_mgr_pcl_type pcl,
-			uint8_t *pcl_channels, uint32_t *len,
+			uint32_t *pcl_channels, uint32_t *len,
 			enum policy_mgr_con_mode mode,
 			enum policy_mgr_con_mode mode,
 			uint8_t *pcl_weights, uint32_t weight_len);
 			uint8_t *pcl_weights, uint32_t weight_len);
+
+/**
+ * policy_mgr_allow_new_home_channel() - Check for allowed number of
+ * home channels
+ * @psoc: PSOC Pointer
+ * @mode: Connection mode
+ * @ch_freq: channel frequency on which new connection is coming up
+ * @num_connections: number of current connections
+ *
+ * When a new connection is about to come up check if current
+ * concurrency combination including the new connection is
+ * allowed or not based on the HW capability
+ *
+ * Return: True/False
+ */
 bool policy_mgr_allow_new_home_channel(
 bool policy_mgr_allow_new_home_channel(
 	struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode,
 	struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode,
-	uint8_t channel, uint32_t num_connections);
+	uint32_t ch_freq, uint32_t num_connections);
+
+/**
+ * policy_mgr_is_5g_channel_allowed() - check if 5g channel is allowed
+ * @ch_freq: channel frequency which needs to be validated
+ * @list: list of existing connections.
+ * @mode: mode against which channel needs to be validated
+ *
+ * This API takes the channel frequency as input and compares with existing
+ * connection channels. If existing connection's channel is DFS channel
+ * and provided channel is 5G channel then don't allow concurrency to
+ * happen as MCC with DFS channel is not yet supported
+ *
+ * Return: true if 5G channel is allowed, false if not allowed
+ *
+ */
 bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc,
 bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc,
-				uint8_t channel, uint32_t *list,
+				uint32_t ch_freq, uint32_t *list,
 				enum policy_mgr_con_mode mode);
 				enum policy_mgr_con_mode mode);
+
 QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
 				uint8_t  new_nss, uint8_t next_action,
 				uint8_t  new_nss, uint8_t next_action,
 				enum policy_mgr_conn_update_reason reason,
 				enum policy_mgr_conn_update_reason reason,
@@ -617,7 +652,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
  * concurrency combination
  * concurrency combination
  * @psoc: PSOC object information
  * @psoc: PSOC object information
  * @mode: new connection mode
  * @mode: new connection mode
- * @channel: channel on which new connection is coming up
+ * @ch_freq: channel frequency on which new connection is coming up
  * @bw: Bandwidth requested by the connection (optional)
  * @bw: Bandwidth requested by the connection (optional)
  *
  *
  * When a new connection is about to come up check if current
  * When a new connection is about to come up check if current
@@ -629,6 +664,6 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
  */
  */
 bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
 bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
 				       enum policy_mgr_con_mode mode,
 				       enum policy_mgr_con_mode mode,
-				       uint8_t channel,
+				       uint32_t ch_freq,
 				       enum hw_mode_bandwidth bw);
 				       enum hw_mode_bandwidth bw);
 #endif
 #endif

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 285 - 202
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c


+ 45 - 21
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2641,6 +2641,44 @@ static void hdd_avoid_acs_channels(struct hdd_context *hdd_ctx,
 }
 }
 #endif
 #endif
 
 
+/**
+ * wlan_hdd_trim_acs_channel_list() - Trims ACS channel list with
+ * intersection of PCL
+ * @pcl: preferred channel list
+ * @pcl_count: Preferred channel list count
+ * @org_ch_list: ACS channel list from user space
+ * @org_ch_list_count: ACS channel count from user space
+ *
+ * Return: None
+ */
+static void wlan_hdd_trim_acs_channel_list(uint8_t *pcl, uint8_t pcl_count,
+					   uint8_t *org_ch_list,
+					   uint8_t *org_ch_list_count)
+{
+	uint16_t i, j, ch_list_count = 0;
+
+	if (*org_ch_list_count >= QDF_MAX_NUM_CHAN) {
+		hdd_err("org_ch_list_count too big %d",
+			*org_ch_list_count);
+		return;
+	}
+
+	if (pcl_count >= QDF_MAX_NUM_CHAN) {
+		hdd_err("pcl_count is too big %d", pcl_count);
+		return;
+	}
+
+	hdd_debug("Update ACS channels with PCL");
+	for (j = 0; j < *org_ch_list_count; j++)
+		for (i = 0; i < pcl_count; i++)
+			if (pcl[i] == org_ch_list[j]) {
+				org_ch_list[ch_list_count++] = pcl[i];
+				break;
+			}
+
+	*org_ch_list_count = ch_list_count;
+}
+
 /**
 /**
  * __wlan_hdd_cfg80211_do_acs(): CFG80211 handler function for DO_ACS Vendor CMD
  * __wlan_hdd_cfg80211_do_acs(): CFG80211 handler function for DO_ACS Vendor CMD
  * @wiphy:  Linux wiphy struct pointer
  * @wiphy:  Linux wiphy struct pointer
@@ -2927,7 +2965,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 	if (is_external_acs_policy &&
 	if (is_external_acs_policy &&
 	    policy_mgr_is_force_scc(hdd_ctx->psoc) &&
 	    policy_mgr_is_force_scc(hdd_ctx->psoc) &&
 	    policy_mgr_get_connection_count(hdd_ctx->psoc)) {
 	    policy_mgr_get_connection_count(hdd_ctx->psoc)) {
-		policy_mgr_trim_acs_channel_list(
+		wlan_hdd_trim_acs_channel_list(
 					sap_config->acs_cfg.pcl_channels,
 					sap_config->acs_cfg.pcl_channels,
 					sap_config->acs_cfg.pcl_ch_count,
 					sap_config->acs_cfg.pcl_ch_count,
 					sap_config->acs_cfg.ch_list,
 					sap_config->acs_cfg.ch_list,
@@ -9479,13 +9517,7 @@ static uint32_t wlan_hdd_populate_weigh_pcl(
 	for (i = 0; i < chan_weights->pcl_len; i++) {
 	for (i = 0; i < chan_weights->pcl_len; i++) {
 		if (chan_weights->pcl_list[i] <=
 		if (chan_weights->pcl_list[i] <=
 		    ARRAY_SIZE(hdd_channels_2_4_ghz))
 		    ARRAY_SIZE(hdd_channels_2_4_ghz))
-			w_pcl[i].freq = ieee80211_channel_to_frequency(
-						chan_weights->pcl_list[i],
-						HDD_NL80211_BAND_2GHZ);
-		else
-			w_pcl[i].freq = ieee80211_channel_to_frequency(
-						chan_weights->pcl_list[i],
-						HDD_NL80211_BAND_5GHZ);
+			w_pcl[i].freq = chan_weights->pcl_list[i];
 		w_pcl[i].weight = chan_weights->weight_list[i];
 		w_pcl[i].weight = chan_weights->weight_list[i];
 
 
 		if (intf_mode == PM_SAP_MODE || intf_mode == PM_P2P_GO_MODE)
 		if (intf_mode == PM_SAP_MODE || intf_mode == PM_P2P_GO_MODE)
@@ -9513,14 +9545,7 @@ static uint32_t wlan_hdd_populate_weigh_pcl(
 			if (chan_weights->saved_chan_list[i] <=
 			if (chan_weights->saved_chan_list[i] <=
 				ARRAY_SIZE(hdd_channels_2_4_ghz))
 				ARRAY_SIZE(hdd_channels_2_4_ghz))
 				w_pcl[chan_idx].freq =
 				w_pcl[chan_idx].freq =
-					ieee80211_channel_to_frequency(
-					      chan_weights->saved_chan_list[i],
-					      HDD_NL80211_BAND_2GHZ);
-			else
-				w_pcl[chan_idx].freq =
-					ieee80211_channel_to_frequency(
-					      chan_weights->saved_chan_list[i],
-					      HDD_NL80211_BAND_5GHZ);
+					chan_weights->saved_chan_list[i];
 
 
 			if (!chan_weights->weighed_valid_list[i]) {
 			if (!chan_weights->weighed_valid_list[i]) {
 				w_pcl[chan_idx].flag =
 				w_pcl[chan_idx].flag =
@@ -9604,11 +9629,10 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
 	if (!chan_weights)
 	if (!chan_weights)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
-	status = policy_mgr_get_pcl(hdd_ctx->psoc,
-				intf_mode, chan_weights->pcl_list,
-				&chan_weights->pcl_len,
-				chan_weights->weight_list,
-				QDF_ARRAY_SIZE(chan_weights->weight_list));
+	status = policy_mgr_get_pcl_int(
+			hdd_ctx->psoc, intf_mode, chan_weights->pcl_list,
+			&chan_weights->pcl_len, chan_weights->weight_list,
+			QDF_ARRAY_SIZE(chan_weights->weight_list));
 	if (status != QDF_STATUS_SUCCESS) {
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("Get pcl failed");
 		hdd_err("Get pcl failed");
 		qdf_mem_free(chan_weights);
 		qdf_mem_free(chan_weights);

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

@@ -3096,7 +3096,7 @@ void hdd_sap_restart_with_channel_switch(struct hdd_adapter *ap_adapter,
 }
 }
 
 
 void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
 void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
-				    uint8_t vdev_id, uint32_t channel,
+				    uint8_t vdev_id, uint32_t ch_freq,
 				    uint32_t channel_bw,
 				    uint32_t channel_bw,
 				    bool forced)
 				    bool forced)
 {
 {
@@ -3107,7 +3107,8 @@ void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
 		hdd_err("Adapter is NULL");
 		hdd_err("Adapter is NULL");
 		return;
 		return;
 	}
 	}
-	hdd_sap_restart_with_channel_switch(ap_adapter, channel,
+	hdd_sap_restart_with_channel_switch(ap_adapter,
+					    wlan_freq_to_chan(ch_freq),
 					    channel_bw, forced);
 					    channel_bw, forced);
 }
 }
 
 
@@ -3128,7 +3129,7 @@ void wlan_hdd_set_sap_csa_reason(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 
 
 QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 				struct wlan_objmgr_psoc *psoc,
 				struct wlan_objmgr_psoc *psoc,
-				uint8_t vdev_id, uint8_t *channel)
+				uint8_t vdev_id, uint32_t *ch_freq)
 {
 {
 	mac_handle_t mac_handle;
 	mac_handle_t mac_handle;
 	struct hdd_ap_ctx *hdd_ap_ctx;
 	struct hdd_ap_ctx *hdd_ap_ctx;
@@ -3159,7 +3160,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 		return QDF_STATUS_E_FAILURE;
 		return QDF_STATUS_E_FAILURE;
 	}
 	}
 
 
-	if (!channel) {
+	if (!ch_freq) {
 		hdd_err("Null parameters");
 		hdd_err("Null parameters");
 		return QDF_STATUS_E_FAILURE;
 		return QDF_STATUS_E_FAILURE;
 	}
 	}
@@ -3231,12 +3232,10 @@ sap_restart:
 				    0,
 				    0,
 				    &ch_params);
 				    &ch_params);
 
 
-	*channel = intf_ch;
-
+	*ch_freq = wlan_chan_to_freq(intf_ch);
 	hdd_info("SAP channel change with CSA/ECSA");
 	hdd_info("SAP channel change with CSA/ECSA");
-	hdd_sap_restart_chan_switch_cb(psoc, vdev_id,
-		intf_ch,
-		ch_params.ch_width, false);
+	hdd_sap_restart_chan_switch_cb(psoc, vdev_id, *ch_freq,
+				       ch_params.ch_width, false);
 
 
 	return QDF_STATUS_SUCCESS;
 	return QDF_STATUS_SUCCESS;
 }
 }

+ 4 - 4
core/hdd/src/wlan_hdd_hostapd.h

@@ -58,7 +58,7 @@ void hdd_sap_restart_with_channel_switch(struct hdd_adapter *adapter,
  * a different channel
  * a different channel
  * @psoc: PSOC object information
  * @psoc: PSOC object information
  * @vdev_id: vdev id
  * @vdev_id: vdev id
- * @channel: channel to switch
+ * @ch_freq: channel to switch
  * @forced: Force to switch channel, ignore SCC/MCC check
  * @forced: Force to switch channel, ignore SCC/MCC check
  *
  *
  * This function restarts SAP with a different channel
  * This function restarts SAP with a different channel
@@ -67,7 +67,7 @@ void hdd_sap_restart_with_channel_switch(struct hdd_adapter *adapter,
  *
  *
  */
  */
 void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
 void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
-				    uint8_t vdev_id, uint32_t channel,
+				    uint8_t vdev_id, uint32_t ch_freq,
 				    uint32_t channel_bw,
 				    uint32_t channel_bw,
 				    bool forced);
 				    bool forced);
 /**
 /**
@@ -75,7 +75,7 @@ void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
  * suitable channel and restart SAP
  * suitable channel and restart SAP
  * @psoc: PSOC object information
  * @psoc: PSOC object information
  * @vdev_id: vdev id
  * @vdev_id: vdev id
- * @channel: channel to be returned
+ * @ch_freq: channel to be returned
  *
  *
  * This function gets the channel parameters to restart SAP
  * This function gets the channel parameters to restart SAP
  *
  *
@@ -84,7 +84,7 @@ void hdd_sap_restart_chan_switch_cb(struct wlan_objmgr_psoc *psoc,
  */
  */
 QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 				struct wlan_objmgr_psoc *psoc,
 				struct wlan_objmgr_psoc *psoc,
-				uint8_t vdev_id, uint8_t *channel);
+				uint8_t vdev_id, uint32_t *ch_freq);
 #endif
 #endif
 
 
 /**
 /**

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

@@ -7927,7 +7927,8 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		for (i = 0; i < len; i++) {
 		for (i = 0; i < len; i++) {
 			pr_info("|table_index[%d]\t\t\n", i);
 			pr_info("|table_index[%d]\t\t\n", i);
 			pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id);
 			pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id);
-			pr_info("|\t|chan    - %-10d|\n", conn_info->chan);
+			pr_info("|\t|chan    - %-10d|\n",
+				wlan_freq_to_chan(conn_info->freq));
 			pr_info("|\t|bw      - %-10d|\n", conn_info->bw);
 			pr_info("|\t|bw      - %-10d|\n", conn_info->bw);
 			pr_info("|\t|mode    - %-10d|\n", conn_info->mode);
 			pr_info("|\t|mode    - %-10d|\n", conn_info->mode);
 			pr_info("|\t|mac     - %-10d|\n", conn_info->mac);
 			pr_info("|\t|mac     - %-10d|\n", conn_info->mac);

+ 20 - 4
core/sme/inc/sme_api.h

@@ -491,9 +491,25 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 		struct csr_roam_profile *profile,
 		struct csr_roam_profile *profile,
 		tScanResultHandle *scan_cache,
 		tScanResultHandle *scan_cache,
 		uint8_t *ap_chnl_id);
 		uint8_t *ap_chnl_id);
+/**
+ * sme_get_ap_channel_from_scan() - a wrapper function to get
+ *				  AP's channel id from
+ *				  CSR by filtering the
+ *				  result which matches
+ *				  our roam profile.
+ * @profile: SAP profile
+ * @ap_ch_freq: pointer to channel id of SAP. Fill the value after finding the
+ *              best ap from scan cache.
+ *
+ * This function is written to get AP's channel id from CSR by filtering
+ * the result which matches our roam profile. This is a synchronous call.
+ *
+ * Return: QDF_STATUS.
+ */
 QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
 QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
-		tScanResultHandle *scan_cache,
-		uint8_t *ap_chnl_id);
+					tScanResultHandle *scan_cache,
+					uint32_t *ap_ch_freq);
+
 tCsrScanResultInfo *sme_scan_result_get_first(mac_handle_t,
 tCsrScanResultInfo *sme_scan_result_get_first(mac_handle_t,
 		tScanResultHandle hScanResult);
 		tScanResultHandle hScanResult);
 tCsrScanResultInfo *sme_scan_result_get_next(mac_handle_t,
 tCsrScanResultInfo *sme_scan_result_get_next(mac_handle_t,
@@ -2536,7 +2552,7 @@ QDF_STATUS sme_get_fw_state(mac_handle_t mac_handle,
 /**
 /**
  * sme_get_valid_channels() - sme api to get valid channels for
  * sme_get_valid_channels() - sme api to get valid channels for
  * current regulatory domain
  * current regulatory domain
- * @chan_list: list of the valid channels
+ * @ch_freq_list: list of the valid channel frequencies
  * @list_len: length of the channel list
  * @list_len: length of the channel list
  *
  *
  * This function will get valid channels for current regulatory
  * This function will get valid channels for current regulatory
@@ -2544,7 +2560,7 @@ QDF_STATUS sme_get_fw_state(mac_handle_t mac_handle,
  *
  *
  * Return: QDF_STATUS_SUCCESS or non-zero on failure
  * Return: QDF_STATUS_SUCCESS or non-zero on failure
  */
  */
-QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len);
+QDF_STATUS sme_get_valid_channels(uint32_t *ch_freq_list, uint32_t *list_len);
 
 
 /**
 /**
  * sme_get_mac_context() - sme api to get the pmac context
  * sme_get_mac_context() - sme api to get the pmac context

+ 13 - 22
core/sme/src/common/sme_api.c

@@ -1123,7 +1123,7 @@ sme_register_bcn_report_pe_cb(mac_handle_t mac_handle, beacon_report_cb cb)
 }
 }
 #endif
 #endif
 
 
-QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len)
+QDF_STATUS sme_get_valid_channels(uint32_t *ch_freq_list, uint32_t *list_len)
 {
 {
 	struct mac_context *mac_ctx = sme_get_mac_context();
 	struct mac_context *mac_ctx = sme_get_mac_context();
 	uint32_t num_valid_chan;
 	uint32_t num_valid_chan;
@@ -1145,8 +1145,8 @@ QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len)
 	}
 	}
 	*list_len = num_valid_chan;
 	*list_len = num_valid_chan;
 	for (i = 0; i < *list_len; i++) {
 	for (i = 0; i < *list_len; i++) {
-		chan_list[i] = wlan_reg_freq_to_chan(mac_ctx->pdev,
-						     mac_ctx->mlme_cfg->reg.valid_channel_freq_list[i]);
+		ch_freq_list[i] =
+			mac_ctx->mlme_cfg->reg.valid_channel_freq_list[i];
 	}
 	}
 
 
 	return QDF_STATUS_SUCCESS;
 	return QDF_STATUS_SUCCESS;
@@ -2579,29 +2579,19 @@ QDF_STATUS sme_scan_get_result_for_bssid(mac_handle_t mac_handle,
 	return status;
 	return status;
 }
 }
 
 
-/**
- * sme_get_ap_channel_from_scan() - a wrapper function to get
- *				  AP's channel id from
- *				  CSR by filtering the
- *				  result which matches
- *				  our roam profile.
- * @profile: SAP profile
- * @ap_chnl_id: pointer to channel id of SAP. Fill the value after finding the
- *              best ap from scan cache.
- *
- * This function is written to get AP's channel id from CSR by filtering
- * the result which matches our roam profile. This is a synchronous call.
- *
- * Return: QDF_STATUS.
- */
 QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
 QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
 					tScanResultHandle *scan_cache,
 					tScanResultHandle *scan_cache,
-					uint8_t *ap_chnl_id)
+					uint32_t *ap_ch_freq)
 {
 {
-	return sme_get_ap_channel_from_scan_cache((struct csr_roam_profile *)
+	uint8_t ap_ch;
+	QDF_STATUS status;
+
+	status = sme_get_ap_channel_from_scan_cache((struct csr_roam_profile *)
 						  profile,
 						  profile,
 						  scan_cache,
 						  scan_cache,
-						  ap_chnl_id);
+						  &ap_ch);
+	*ap_ch_freq = wlan_chan_to_freq(ap_ch);
+	return status;
 }
 }
 
 
 /**
 /**
@@ -12306,7 +12296,8 @@ QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg)
 		sme_debug("Connected STA band %d", req_msg->band);
 		sme_debug("Connected STA band %d", req_msg->band);
 	}
 	}
 	for (i = 0; i < msg->pcl_len; i++) {
 	for (i = 0; i < msg->pcl_len; i++) {
-		req_msg->chan_weights.pcl_list[i] =  msg->pcl_list[i];
+		req_msg->chan_weights.pcl_list[i] =  wlan_freq_to_chan(
+							msg->pcl_list[i]);
 		req_msg->chan_weights.weight_list[i] =  msg->weight_list[i];
 		req_msg->chan_weights.weight_list[i] =  msg->weight_list[i];
 	}
 	}
 
 

+ 4 - 3
core/wma/src/wma_main.c

@@ -9248,13 +9248,14 @@ QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
 		/* Dont allow roaming on 2G when 5G_ONLY configured */
 		/* Dont allow roaming on 2G when 5G_ONLY configured */
 		if (((wma_handle->bandcapability == BAND_5G) ||
 		if (((wma_handle->bandcapability == BAND_5G) ||
 		    (msg->band == BAND_5G)) &&
 		    (msg->band == BAND_5G)) &&
-		    (WLAN_REG_IS_24GHZ_CH(
-				msg->chan_weights.saved_chan_list[i]))) {
+		    (WLAN_REG_IS_24GHZ_CH_FREQ(
+		    msg->chan_weights.saved_chan_list[i]))) {
 			msg->chan_weights.weighed_valid_list[i] =
 			msg->chan_weights.weighed_valid_list[i] =
 				WEIGHT_OF_DISALLOWED_CHANNELS;
 				WEIGHT_OF_DISALLOWED_CHANNELS;
 		}
 		}
 		if ((msg->band == BAND_2G) &&
 		if ((msg->band == BAND_2G) &&
-		    WLAN_REG_IS_5GHZ_CH(msg->chan_weights.saved_chan_list[i]))
+		    WLAN_REG_IS_5GHZ_CH_FREQ(
+		    msg->chan_weights.saved_chan_list[i]))
 			msg->chan_weights.weighed_valid_list[i] =
 			msg->chan_weights.weighed_valid_list[i] =
 				WEIGHT_OF_DISALLOWED_CHANNELS;
 				WEIGHT_OF_DISALLOWED_CHANNELS;
 		WMA_LOGD("%s: chan:%d weight[%d]=%d", __func__,
 		WMA_LOGD("%s: chan:%d weight[%d]=%d", __func__,

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů