qcacmn: Add an API to check if scan is completed

Add a new scan util API to check if scan is completed and
if scan is success.

Change-Id: Id60056b999a7ec23df3d3458d4498d547f6ec4d9
CRs-Fixed: 2248972
diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
index 4e129f1..024d8ce 100644
--- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
@@ -987,3 +987,22 @@
 
 	return scm_update_scan_mlme_info(pdev, scan_entry);
 }
+
+bool util_is_scan_completed(struct scan_event *event, bool *success)
+{
+	if ((event->type == SCAN_EVENT_TYPE_COMPLETED) ||
+	    (event->type == SCAN_EVENT_TYPE_DEQUEUED) ||
+	    (event->type == SCAN_EVENT_TYPE_START_FAILED)) {
+		if ((event->type == SCAN_EVENT_TYPE_COMPLETED) &&
+		    (event->reason == SCAN_REASON_COMPLETED))
+			*success = true;
+		else
+			*success = false;
+
+		return true;
+	}
+
+	*success = false;
+	return false;
+}
+