Преглед изворни кода

qcacld-3.0: Fix for ROC cmd timeout issue with new scan module

When converged scan is enabled all the scan commands are queued to
serialization module from scan module and use struct
scan_start_request pointing to umac_cmd pointer.

Due to this if there is already an scan req going on and ROC is
queued driver fails to find ROC request in csr_get_active_scan_entry()
as the CSR try to interpret umac_cmd pointer as tSmeCmd.
And thus sometime ROC cmd times out.

Fix this by interpreting umac_cmd as struct scan_start_request for
scan cmd instead of tSmeCmd.

Change-Id: I6674a54b60d28d799188261b1e56b0c657c1ac19
CRs-Fixed: 2013212
Abhishek Singh пре 8 година
родитељ
комит
e6857812fe
2 измењених фајлова са 56 додато и 0 уклоњено
  1. 52 0
      core/sme/src/csr/csr_api_scan.c
  2. 4 0
      core/wma/src/wma_scan_roam.c

+ 52 - 0
core/sme/src/csr/csr_api_scan.c

@@ -4584,6 +4584,7 @@ error:
 }
 
 #endif
+#ifndef NAPIER_SCAN
 /**
  * csr_get_active_scan_entry() - To get scan entry from active command list
  *
@@ -4613,6 +4614,7 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
 		csr_scan_active_ll_unlock(mac_ctx);
 		return QDF_STATUS_SUCCESS;
 	}
+
 	localentry = csr_scan_active_ll_peek_head(mac_ctx,
 			LL_ACCESS_NOLOCK);
 	while (localentry) {
@@ -4635,6 +4637,56 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
 	sms_log(mac_ctx, LOGE, FL("Exit"));
 	return status;
 }
+
+#else
+
+/* API will be removed after p2p component L0 */
+QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
+	uint32_t scan_id, tListElem **entry)
+{
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+	struct wlan_serialization_command *cmn_cmd;
+	tSmeCmd *sme_cmd;
+	uint32_t cmd_scan_id = 0;
+
+	sms_log(mac_ctx, LOGE, FL("Enter"));
+	csr_scan_active_ll_lock(mac_ctx);
+
+	if (csr_scan_active_ll_is_list_empty(mac_ctx, LL_ACCESS_NOLOCK)) {
+		sms_log(mac_ctx, LOGE,
+			FL(" Active list Empty scanId: %d"), scan_id);
+		csr_scan_active_ll_unlock(mac_ctx);
+		return QDF_STATUS_SUCCESS;
+	}
+	cmn_cmd = wlan_serialization_peek_head_active_cmd_using_psoc(
+			mac_ctx->psoc, true);
+	while (cmn_cmd) {
+		sme_cmd = cmn_cmd->umac_cmd;
+		if (cmn_cmd->cmd_type == WLAN_SER_CMD_SCAN)
+			cmd_scan_id = cmn_cmd->cmd_id;
+		else if (cmn_cmd->cmd_type == WLAN_SER_CMD_REMAIN_ON_CHANNEL)
+			cmd_scan_id = sme_cmd->u.remainChlCmd.scan_id;
+		sms_log(mac_ctx, LOG1, FL(" cmd_scan_id %d"),
+					cmd_scan_id);
+		if ((cmn_cmd->cmd_type == WLAN_SER_CMD_REMAIN_ON_CHANNEL) &&
+			(cmd_scan_id == scan_id)) {
+			sms_log(mac_ctx, LOG1, FL(" scanId Matched %d"),
+					scan_id);
+			*entry = &sme_cmd->Link;
+			csr_scan_active_ll_unlock(mac_ctx);
+			return QDF_STATUS_SUCCESS;
+		}
+		cmn_cmd =
+			wlan_serialization_get_active_list_next_node_using_psoc(
+				mac_ctx->psoc, cmn_cmd, true);
+	}
+	csr_scan_active_ll_unlock(mac_ctx);
+	sms_log(mac_ctx, LOGE, FL("Exit"));
+
+	return status;
+}
+#endif
+
 #ifdef NAPIER_SCAN
 void csr_scan_callback(struct wlan_objmgr_vdev *vdev,
 				struct scan_event *event, void *arg)

+ 4 - 0
core/wma/src/wma_scan_roam.c

@@ -5957,6 +5957,9 @@ QDF_STATUS wma_get_scan_id(uint32_t *scan_id)
 		return QDF_STATUS_E_FAULT;
 	}
 
+#ifdef NAPIER_SCAN
+	*scan_id = ucfg_scan_get_scan_id(wma->psoc);
+#else
 	/* host need to cycle through the lower 12 bits to generate ids */
 	*scan_id = qdf_atomic_inc_return(&wma->scan_id_counter) &
 			WMA_SCAN_ID_MASK;
@@ -5965,6 +5968,7 @@ QDF_STATUS wma_get_scan_id(uint32_t *scan_id)
 	 * by PREFIX 0xA000
 	 */
 	*scan_id = *scan_id | WMI_HOST_SCAN_REQ_ID_PREFIX;
+#endif
 	return QDF_STATUS_SUCCESS;
 }