summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Brown <dustinb@codeaurora.org>2016-09-29 13:27:15 -0700
committerqcabuildsw <qcabuildsw@localhost>2016-10-03 17:32:46 -0700
commit73fce8f09aef397f1ea6267f1426607aa22111d0 (patch)
treec21562fbe20745131d6776253914bbfe31f4f659
parent705fa39ffbc9d9a5a297192334305ec3e8d3d46c (diff)
qcacld-3.0: Abort suspend if RRM scan is pending
Currently RRM scan state is not being tracked, leading to possible suspend attempts while RRM scan is pending. Set scan state information to prevent suspend while RRM scan is pending. Change-Id: I1d688f137961b4cb09d13764761c8d22709c3a43 CRs-Fixed: 1072598
-rw-r--r--core/wma/src/wma_scan_roam.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 11ee61b69cf4..cdbecb59d00c 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -100,6 +100,35 @@ enum extscan_report_events_type {
#endif
/**
+ * wma_set_scan_info() - set scan info in wma handle
+ * @wma_handle: wma handle
+ * @scan_id: scan id
+ * @vdev_id: vdev id
+ *
+ * Return: none
+ */
+static inline void wma_set_scan_info(tp_wma_handle wma_handle,
+ uint32_t scan_id,
+ uint32_t vdev_id)
+{
+ wma_handle->interfaces[vdev_id].scan_info.scan_id = scan_id;
+}
+
+/**
+ * wma_reset_scan_info() - reset scan info from wma handle
+ * @wma_handle: wma handle
+ * @vdev_id: vdev id
+ *
+ * Return: none
+ */
+static inline void wma_reset_scan_info(tp_wma_handle wma_handle,
+ uint8_t vdev_id)
+{
+ qdf_mem_zero((void *)&(wma_handle->interfaces[vdev_id].scan_info),
+ sizeof(wma_handle->interfaces[vdev_id].scan_info));
+}
+
+/**
* wma_set_p2p_scan_info() - set p2p scan info in wma handle
* @wma_handle: wma handle
* @scan_id: scan id
@@ -530,6 +559,8 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
goto error1;
}
+ wma_set_scan_info(wma_handle, cmd.scan_id, cmd.vdev_id);
+
if (scan_req->p2pScanType == P2P_SCAN_TYPE_LISTEN)
wma_set_p2p_scan_info(wma_handle, cmd.scan_id,
cmd.vdev_id, P2P_SCAN_TYPE_LISTEN);
@@ -5639,6 +5670,12 @@ int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data,
scan_event->chanFreq = wmi_event->channel_freq;
if (scan_event->scanId ==
+ wma_handle->interfaces[vdev_id].scan_info.scan_id) {
+ if (scan_event->event == SIR_SCAN_EVENT_COMPLETED)
+ wma_reset_scan_info(wma_handle, vdev_id);
+ }
+
+ if (scan_event->scanId ==
wma_handle->interfaces[vdev_id].p2p_scan_info.scan_id) {
scan_event->p2pScanType = P2P_SCAN_TYPE_LISTEN;
if (scan_event->event == SIR_SCAN_EVENT_COMPLETED)