Parcourir la source

qcacld-3.0: cancel all the scans during connect

P2P connection failed when scan is active on another
interface.

Abort all the scans on all the active session when
connect request is getting processed at SME.

Change-Id: Ibc7c0df7f2884710fbaf29a5b1ff5d315c3bfc52
CRs-Fixed: 1081116
(cherry picked from commit 271cbf851f7fbbfeae503097e9d06ff3cb89c761)
Sandeep Puligilla il y a 8 ans
Parent
commit
df6454a80d

+ 1 - 2
core/sme/src/csr/csr_api_roam.c

@@ -7704,8 +7704,7 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId,
 	pSession->dhcp_done = false;
 	csr_roam_cancel_roaming(pMac, sessionId);
 	csr_scan_remove_fresh_scan_command(pMac, sessionId);
-	/* Only abort the scan if its not used for other roam/connect purpose */
-	csr_scan_abort_mac_scan(pMac, sessionId, eCSR_SCAN_ABORT_DEFAULT);
+	csr_scan_abort_all_scans(pMac, eCSR_SCAN_ABORT_DEFAULT);
 	csr_roam_remove_duplicate_command(pMac, sessionId, NULL, eCsrHddIssued);
 	/* Check whether ssid changes */
 	if (csr_is_conn_state_connected(pMac, sessionId) &&

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

@@ -6626,6 +6626,39 @@ void csr_set_cfg_scan_control_list(tpAniSirGlobal pMac, uint8_t *countryCode,
 	} /* AllocateMemory */
 }
 
+
+/**
+ * csr_scan_abort_all_scans() - Abort scan on all Sessions
+ * @mac_ctx: pointer to Global Mac structure
+ * @reason: reason for cancelling scan
+ *
+ * Abort scan on all Sessions
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS csr_scan_abort_all_scans(tpAniSirGlobal mac_ctx,
+				   eCsrAbortReason reason)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	uint8_t session_id;
+
+	mac_ctx->scan.fDropScanCmd = true;
+	for (session_id = 0; session_id < CSR_ROAM_SESSION_MAX; session_id++) {
+		if (CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
+			csr_remove_cmd_with_session_id_from_pending_list(
+				mac_ctx,
+				session_id, &mac_ctx->sme.smeScanCmdPendingList,
+				eSmeCommandScan);
+			csr_abort_scan_from_active_list(mac_ctx,
+				 &mac_ctx->sme.smeScanCmdActiveList,
+				 session_id, eSmeCommandScan, reason);
+		}
+	}
+	mac_ctx->scan.fDropScanCmd = false;
+
+	return status;
+}
+
 QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal pMac, uint8_t sessionId,
 				   eCsrAbortReason reason)
 {

+ 2 - 0
core/sme/src/csr/csr_inside_api.h

@@ -268,6 +268,8 @@ QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal pMac, uint32_t sessionId,
 bool csr_scan_remove_fresh_scan_command(tpAniSirGlobal pMac, uint8_t sessionId);
 QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal pMac, uint8_t sessionId,
 				   eCsrAbortReason reason);
+QDF_STATUS csr_scan_abort_all_scans(tpAniSirGlobal mac_ctx,
+				   eCsrAbortReason reason);
 void csr_remove_cmd_from_pending_list(tpAniSirGlobal pMac, tDblLinkList *pList,
 				      eSmeCommandType commandType);
 void csr_remove_cmd_with_session_id_from_pending_list(tpAniSirGlobal pMac,