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

qcacld-3.0: Allow full spectrum scan when agile & aDFS scan supported

Traditionally full spectrum scan on STA/CLI is not allowed when SAP/GO is
already present on DFS channel.

With new generation of hardware, agile scan and agile DFS scan features
are supported which will allow hardware to do full spectrum scan even if
SAP/GO is present on DFS channel.

Change-Id: I7e5a21601642e0d6afef73beeecf80a3e0475909
CRs-Fixed: 1103730
Krunal Soni 8 жил өмнө
parent
commit
4274f36bcd

+ 1 - 0
core/cds/inc/cds_concurrency.h

@@ -834,6 +834,7 @@ void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len,
 uint8_t cds_get_nondfs_preferred_channel(enum cds_con_mode mode,
 					bool for_existing_conn);
 bool cds_is_any_nondfs_chnl_present(uint8_t *channel);
+bool cds_is_any_dfs_beaconing_session_present(uint8_t *channel);
 bool cds_allow_concurrency(enum cds_con_mode mode,
 				uint8_t channel, enum hw_mode_bandwidth bw);
 enum cds_conc_priority_mode cds_get_first_connection_pcl_table_index(void);

+ 36 - 0
core/cds/src/cds_concurrency.c

@@ -7480,6 +7480,42 @@ bool cds_is_any_nondfs_chnl_present(uint8_t *channel)
 	return status;
 }
 
+/**
+ * cds_is_any_dfs_beaconing_session_present() - to find if any DFS session
+ * @channel: pointer to channel number that needs to filled
+ *
+ * If any beaconing session such as SAP or GO present and it is on DFS channel
+ * then this function will return true
+ *
+ * Return: true if session is on DFS or false if session is on non-dfs channel
+ */
+bool cds_is_any_dfs_beaconing_session_present(uint8_t *channel)
+{
+	cds_context_type *cds_ctx;
+	struct cds_conc_connection_info *conn_info;
+	bool status = false;
+	uint32_t conn_index = 0;
+	cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+
+	if (!cds_ctx) {
+		cds_err("Invalid CDS Context");
+		return false;
+	}
+	qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
+	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
+			conn_index++) {
+		conn_info = &conc_connection_list[conn_index];
+		if (conn_info->in_use && CDS_IS_DFS_CH(conn_info->chan) &&
+		    (CDS_SAP_MODE == conn_info->mode ||
+		     CDS_P2P_GO_MODE == conn_info->mode)) {
+			*channel = conc_connection_list[conn_index].chan;
+			status = true;
+		}
+	}
+	qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
+	return status;
+}
+
 /**
  * cds_get_valid_chans() - Get the valid channel list
  * @chan_list: Pointer to the valid channel list

+ 1 - 8
core/hdd/src/wlan_hdd_cfg80211.c

@@ -11793,7 +11793,6 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 	eCsrAuthType RSNAuthType;
 	tSmeConfigParams *sme_config;
 	uint8_t channel = 0;
-	struct sir_hw_mode_params hw_mode;
 
 	ENTER();
 
@@ -12085,14 +12084,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
 		pRoamProfile->ChannelInfo.ChannelList = NULL;
 		pRoamProfile->ChannelInfo.numOfChannels = 0;
 
-		if (!QDF_IS_STATUS_SUCCESS(
-				wma_get_current_hw_mode(&hw_mode))) {
-			hdd_err("wma_get_current_hw_mode failed");
-			return status;
-		}
-
 		if ((QDF_STA_MODE == pAdapter->device_mode)
-		    && hw_mode.dbs_cap) {
+		    && wma_is_current_hwmode_dbs()) {
 			cds_get_channel_from_scan_result(pAdapter,
 					pRoamProfile, &channel);
 			if (channel)

+ 38 - 19
core/sme/src/csr/csr_api_scan.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -5407,25 +5407,25 @@ static void csr_scan_copy_request_valid_channels_only(tpAniSirGlobal mac_ctx,
 }
 
 /**
- * csr_scan_filter_ibss_chnl_band() - filter all channels which matches IBSS
+ * csr_scan_filter_given_chnl_band() - filter all channels which matches given
  *                                    channel's band
  * @mac_ctx: pointer to mac context
- * @ibss_channel: Given IBSS channel
+ * @channel: Given channel
  * @dst_req: destination scan request
  *
- * when ever IBSS connection already exist, STA should not scan the channels
- * which fall under same band as IBSS channel's band. this routine will filter
- * out those channels
+ * when ever particular connection already exist, STA should not scan the
+ * channels which fall under same band as given channel's band.
+ * this routine will filter out those channels
  *
  * Return: true if success otherwise false for any failure
  */
-static bool csr_scan_filter_ibss_chnl_band(tpAniSirGlobal mac_ctx,
-			uint8_t ibss_channel, tCsrScanRequest *dst_req) {
+static bool csr_scan_filter_given_chnl_band(tpAniSirGlobal mac_ctx,
+			uint8_t channel, tCsrScanRequest *dst_req) {
 	uint8_t valid_chnl_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
 	uint32_t filter_chnl_len = 0, i = 0;
 	uint32_t valid_chnl_len = WNI_CFG_VALID_CHANNEL_LIST_LEN;
 
-	if (ibss_channel == 0) {
+	if (!channel) {
 		sms_log(mac_ctx, LOG1,
 			FL("Nothing to filter as no IBSS session"));
 		return true;
@@ -5455,17 +5455,17 @@ static bool csr_scan_filter_ibss_chnl_band(tpAniSirGlobal mac_ctx,
 	}
 	for (i = 0; i < valid_chnl_len; i++) {
 		/*
-		 * Don't allow DSRC channel when IBSS concurrent connection
-		 * is up
+		 * Don't allow DSRC channel when IBSS or SAP DFS concurrent
+		 * connection is up
 		 */
 		if (valid_chnl_list[i] >= CDS_MIN_11P_CHANNEL)
 			continue;
-		if (CDS_IS_CHANNEL_5GHZ(ibss_channel) &&
+		if (CDS_IS_CHANNEL_5GHZ(channel) &&
 			CDS_IS_CHANNEL_24GHZ(valid_chnl_list[i])) {
 			valid_chnl_list[filter_chnl_len] =
 					valid_chnl_list[i];
 			filter_chnl_len++;
-		} else if (CDS_IS_CHANNEL_24GHZ(ibss_channel) &&
+		} else if (CDS_IS_CHANNEL_24GHZ(channel) &&
 			CDS_IS_CHANNEL_5GHZ(valid_chnl_list[i])) {
 			valid_chnl_list[filter_chnl_len] =
 					valid_chnl_list[i];
@@ -5517,7 +5517,7 @@ QDF_STATUS csr_scan_copy_request(tpAniSirGlobal mac_ctx,
 	uint32_t index = 0;
 	uint32_t new_index = 0;
 	enum channel_state channel_state;
-	uint8_t ibss_channel = 0;
+	uint8_t channel = 0;
 
 	bool skip_dfs_chnl =
 			mac_ctx->roam.configParam.initial_scan_no_dfs_chnl ||
@@ -5622,17 +5622,36 @@ QDF_STATUS csr_scan_copy_request(tpAniSirGlobal mac_ctx,
 	 * request comes from STA adapter then we need to filter
 	 * out IBSS channel's band otherwise it will cause issue
 	 * in IBSS+STA concurrency
+	 *
+	 * If DFS SAP/GO concurrent connection exist, and if the scan
+	 * request comes from STA adapter then we need to filter
+	 * out SAP/GO channel's band otherwise it will cause issue in
+	 * SAP+STA concurrency
 	 */
-	if (true == cds_is_ibss_conn_exist(&ibss_channel)) {
+	if (cds_is_ibss_conn_exist(&channel)) {
 		sms_log(mac_ctx, LOG1,
 			FL("Conc IBSS exist, channel list will be modified"));
+	} else if (cds_is_any_dfs_beaconing_session_present(&channel)) {
+		/*
+		 * 1) if agile & DFS scans are supported
+		 * 2) if hardware is DBS capable
+		 * 3) if current hw mode is non-dbs
+		 * if all above 3 conditions are true then don't skip any
+		 * channel from scan list
+		 */
+		if (true != wma_is_current_hwmode_dbs() &&
+		    wma_get_dbs_plus_agile_scan_config() &&
+		    wma_get_single_mac_scan_with_dfs_config())
+			channel = 0;
+		else
+			sms_log(mac_ctx, LOG1,
+				FL("Conc DFS SAP/GO exist, channel list will be modified"));
 	}
 
-	if ((ibss_channel > 0) &&
-		(false == csr_scan_filter_ibss_chnl_band(mac_ctx,
-				ibss_channel, dst_req))) {
+	if ((channel > 0) &&
+	    (!csr_scan_filter_given_chnl_band(mac_ctx, channel, dst_req))) {
 		sms_log(mac_ctx, LOGE,
-			FL("Can't filter channels due to IBSS"));
+			FL("Can't filter channels due to IBSS/SAP DFS"));
 		goto complete;
 	}
 

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

@@ -1,4 +1,4 @@
-				/*
+/*
  * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
@@ -2279,6 +2279,7 @@ static inline QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+bool wma_is_current_hwmode_dbs(void);
 void
 wma_indicate_err(enum ol_rx_err_type err_type,
 	 struct ol_error_info *err_info);

+ 20 - 0
core/wma/src/wma_utils.c

@@ -3347,6 +3347,26 @@ QDF_STATUS wma_get_current_hw_mode(struct sir_hw_mode_params *hw_mode)
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * wma_is_current_hwmode_dbs() - Check if current hw mode is DBS
+ *
+ * Checks if current hardware mode of the system is DBS or no
+ *
+ * Return: true or false
+ */
+bool wma_is_current_hwmode_dbs(void)
+{
+	struct sir_hw_mode_params hw_mode;
+
+	if (!wma_is_hw_dbs_capable())
+		return false;
+	if (QDF_STATUS_SUCCESS != wma_get_current_hw_mode(&hw_mode))
+		return false;
+	if (hw_mode.dbs_cap)
+		return true;
+	return false;
+}
+
 /**
  * wma_is_dbs_enable() - Check if master DBS control is enabled
  *