Browse Source

qcacld-3.0: Fix dwell-time when 2G-SAP is active and DBS is supported

Old generation of projects, which had only one MAC, are restricted to
use 28ms of fix active and passive dwell time when SAP session is active
but with new generation of projects, which can have two MACs, are
permitted to use longer active and passive dwell time when SAP session
is active on 2G band and DBS is supported.

Change-Id: I2638d9b7a3677c3f0b329ed8109d01baa2cffd68
CRs-Fixed: 1071353
Krunal Soni 8 years ago
parent
commit
499d364340
3 changed files with 39 additions and 3 deletions
  1. 1 0
      core/cds/inc/cds_concurrency.h
  2. 30 0
      core/cds/src/cds_concurrency.c
  3. 8 3
      core/wma/src/wma_scan_roam.c

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

@@ -693,6 +693,7 @@ void cds_decr_session_set_pcl(enum tQDF_ADAPTER_MODE mode,
 		uint8_t session_id);
 QDF_STATUS cds_init_policy_mgr(struct cds_sme_cbacks *sme_cbacks);
 QDF_STATUS cds_deinit_policy_mgr(void);
+uint8_t cds_get_channel(enum cds_con_mode mode, uint32_t *vdev_id);
 QDF_STATUS cds_get_pcl(enum cds_con_mode mode,
 			uint8_t *pcl_channels, uint32_t *len,
 			uint8_t *pcl_weight, uint32_t weight_len);

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

@@ -4950,6 +4950,36 @@ bool cds_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode,
 	return status;
 }
 
+/**
+ * cds_get_channel() - provide channel number of given mode and vdevid
+ * @mode: given CDS mode
+ * @vdev_id: pointer to vdev_id
+ *
+ * This API will provide channel number of matching mode and vdevid.
+ * If vdev_id is NULL then it will match only mode
+ * If vdev_id is not NULL the it will match both mode and vdev_id
+ *
+ * Return: channel number
+ */
+uint8_t cds_get_channel(enum cds_con_mode mode, uint32_t *vdev_id)
+{
+	uint32_t idx = 0;
+
+	if (mode >= CDS_MAX_NUM_OF_MODE) {
+		cds_err("incorrect mode");
+		return 0;
+	}
+
+	for (idx = 0; idx < MAX_NUMBER_OF_CONC_CONNECTIONS; idx++) {
+		if ((conc_connection_list[idx].mode == mode) &&
+				(!vdev_id || (*vdev_id ==
+					conc_connection_list[idx].vdev_id))
+				&& conc_connection_list[idx].in_use)
+			return conc_connection_list[idx].chan;
+	}
+	return 0;
+}
+
 /**
  * cds_get_pcl() - provides the preferred channel list for
  * new connection

+ 8 - 3
core/wma/src/wma_scan_roam.c

@@ -415,14 +415,19 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
 	if (wma_is_sap_active(wma_handle)) {
 		/* P2P/STA scan while SoftAP is sending beacons.
 		 * Max duration of CTS2self is 32 ms, which limits the
-		 * dwell time.
+		 * dwell time. If DBS is supported and if SAP is on 2G channel
+		 * then keep passive dwell time default.
 		 */
 		cmd->dwell_time_active =
 			QDF_MIN(scan_req->maxChannelTime,
 					(WMA_CTS_DURATION_MS_MAX -
 					 WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME));
-		cmd->dwell_time_passive =
-			cmd->dwell_time_active;
+		if (!wma_is_hw_dbs_capable() ||
+			(wma_is_hw_dbs_capable() &&
+				CDS_IS_CHANNEL_5GHZ(
+					cds_get_channel(CDS_SAP_MODE, NULL)))) {
+			cmd->dwell_time_passive = cmd->dwell_time_active;
+		}
 		cmd->burst_duration = 0;
 	}