Procházet zdrojové kódy

qcacld-3.0: Don't roam to 2G AP when 5G only configured

STA is roaming to 2G AP even though 5G
only is configured through ini.
Set weightage of the 2G social channels
to zero so that firmware will not roam
to 2G channels.

Change-Id: I7dea8413618265e0f1fe353da4b858583c1921af
CRs-Fixed: 2117614
Sandeep Puligilla před 7 roky
rodič
revize
819d94f731

+ 2 - 0
core/cds/inc/cds_config.h

@@ -108,6 +108,7 @@ enum active_bpf_mode {
  * @auto_power_save_fail_mode: auto detect power save failure mode
  * @ito_repeat_count: Indicates ito repeated count
  * @force_target_assert_enabled: Indicate whether target assert enabled or not
+ * @bandcapability: Configured band by user
  * Structure for holding cds ini parameters.
  */
 
@@ -166,6 +167,7 @@ struct cds_config_info {
 	enum pmo_auto_pwr_detect_failure_mode auto_power_save_fail_mode;
 	uint8_t ito_repeat_count;
 	bool force_target_assert_enabled;
+	uint8_t bandcapability;
 };
 
 #ifdef WLAN_FEATURE_FILS_SK

+ 1 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8329,6 +8329,7 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx)
 		hdd_ctx->config->auto_pwr_save_fail_mode;
 
 	cds_cfg->ito_repeat_count = hdd_ctx->config->ito_repeat_count;
+	cds_cfg->bandcapability = hdd_ctx->config->nBandCapability;
 
 	hdd_ra_populate_cds_config(cds_cfg, hdd_ctx);
 	hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx);

+ 2 - 0
core/wma/inc/wma.h

@@ -1383,6 +1383,7 @@ struct hw_mode_idx_to_mac_cap_idx {
  * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
  * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID
  * @dfs_cac_offload: dfs and cac timer offload
+ * @bandcapability: band capability configured through ini
  * @ito_repeat_count: Indicates ito repeated count
  * @fw_mem_dump_enabled: Fw memory dump support
  */
@@ -1575,6 +1576,7 @@ typedef struct {
 #ifdef WLAN_FEATURE_11AX
 	struct he_capability he_cap;
 #endif
+	uint8_t bandcapability;
 	bool tx_bfee_8ss_enabled;
 	bool in_imps;
 	uint8_t  ito_repeat_count;

+ 7 - 0
core/wma/src/wma_main.c

@@ -2865,6 +2865,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 				WMA_RX_SERIALIZER_CTX);
 
 	wma_handle->ito_repeat_count = cds_cfg->ito_repeat_count;
+	wma_handle->bandcapability = cds_cfg->bandcapability;
 
 	/* Register PWR_SAVE_FAIL event only in case of recovery(1) */
 	if (cds_cfg->auto_power_save_fail_mode ==
@@ -7904,6 +7905,12 @@ QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
 	for (i = 0; i < msg->saved_num_chan; i++) {
 		msg->weighed_valid_list[i] =
 			wma_map_pcl_weights(msg->weighed_valid_list[i]);
+		/* Dont allow roaming on 2G when 5G_ONLY configured */
+		if ((wma_handle->bandcapability == eCSR_BAND_5G) &&
+			(msg->saved_chan_list[i] <= MAX_24GHZ_CHANNEL)) {
+			msg->weighed_valid_list[i] =
+				WEIGHT_OF_DISALLOWED_CHANNELS;
+		}
 		WMA_LOGD("%s: chan:%d weight[%d]=%d", __func__,
 			 msg->saved_chan_list[i], i,
 			 msg->weighed_valid_list[i]);