Explorar o código

qcacld-3.0: Move scan_results_available from bucket complete to cycle complete

qcacld-2.0 to qcacld-3.0 propagation

Currently extscan_results_available event is posted to user space after a
bucket scan is completed. If the extscan start request is configured for
multiple buckets, then the user space application tries to fetch cached
results on every extscan_results available.
If the get_cached_results is issued with flush=1, then every get_cached_results
will have 0 scan results and since flush=1 is set, due to a bug in firmware
even the temporary scan cache is flushed, there by we miss reporting the
APs found in the previous bucket scans and only the last get_cached_results
will report the APs found in the last bucket scan. Whereas the expectation is
get_cached_results must report all the APs found in the complete scan cycle.
The proposed fix is in both firmware and host:
1. Firmware to ignore get_cached_results flush=1 and not to flush the temporary
   scan cache in the middle of extscan cycle.
2. Host to consume bucket_started event within host driver and map
   extscan_results_available with cycle_complete instead of bucket_complete.

Change-Id: I399204261fa3d8515146c590630a3bb663ee801c
CRs-Fixed: 975402
Mukul Sharma %!s(int64=8) %!d(string=hai) anos
pai
achega
45114d999a
Modificáronse 3 ficheiros con 32 adicións e 34 borrados
  1. 4 2
      core/hdd/src/wlan_hdd_ext_scan.c
  2. 24 24
      core/mac/inc/sir_api.h
  3. 4 8
      core/wma/src/wma_scan_roam.c

+ 4 - 2
core/hdd/src/wlan_hdd_ext_scan.c

@@ -993,6 +993,7 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx,
 		return;
 	if (!pData) {
 		hdd_err("pData is null");
+		EXIT();
 		return;
 	}
 
@@ -1005,6 +1006,7 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx,
 
 	if (!skb) {
 		hdd_err("cfg80211_vendor_event_alloc failed");
+		EXIT();
 		return;
 	}
 
@@ -1012,7 +1014,6 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx,
 		pData->requestId, pData->scanEventType, pData->status,
 		pData->buckets_scanned);
 
-
 	context = &ext_scan_context;
 	spin_lock(&context->context_lock);
 	if (pData->scanEventType == WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT) {
@@ -1023,7 +1024,7 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx,
 		context->buckets_scanned = pData->buckets_scanned;
 		/* No need to report to user space */
 		spin_unlock(&context->context_lock);
-		return;
+		goto nla_put_failure;
 	} else {
 		spin_unlock(&context->context_lock);
 	}
@@ -1043,6 +1044,7 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx,
 
 nla_put_failure:
 	kfree_skb(skb);
+	EXIT();
 	return;
 }
 

+ 24 - 24
core/mac/inc/sir_api.h

@@ -4208,38 +4208,38 @@ typedef enum {
 	WIFI_BAND_MAX
 } tWifiBand;
 
-/* wifi scan related events */
-typedef enum {
-	/*
-	 * reported when REPORT_EVENTS_EACH_SCAN is set and a scan
-	 * completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
-	 * WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
-	 * reason for the event is available; however, at most one of
-	 * these events should be reported per scan.
-	 */
+/**
+ * enum wifi_extscan_event_type - extscan event type
+ * @WIFI_EXTSCAN_RESULTS_AVAILABLE: reported when REPORT_EVENTS_EACH_SCAN is set
+ *		and a scan cycle completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
+ *		WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
+ *		reason for the event is available; however, at most one of
+ *		these events should be reported per scan.
+ * @WIFI_EXTSCAN_THRESHOLD_NUM_SCANS: can be reported when
+ *		REPORT_EVENTS_EACH_SCAN is not set and
+ *		report_threshold_num_scans is reached.
+ * @WIFI_EXTSCAN_THRESHOLD_PERCENT: can be reported when REPORT_EVENTS_EACH_SCAN
+ *		is not set and report_threshold_percent is reached.
+ * @WIFI_SCAN_DISABLED: reported when currently executing gscans are disabled
+ *		start_gscan will need to be called again in order to continue
+ *		scanning.
+ * @WIFI_EXTSCAN_BUCKET_STARTED_EVENT: Bucket started event
+ *		This event is consumed in driver only.
+ * @WIFI_EXTSCAN_CYCLE_STARTED_EVENT: Cycle started event.
+ *		This event is consumed in driver only.
+ * @WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT: Cycle complete event. This event
+ *		triggers @WIFI_EXTSCAN_RESULTS_AVAILABLE to the user space.
+ */
+enum wifi_extscan_event_type {
 	WIFI_EXTSCAN_RESULTS_AVAILABLE,
-	/*
-	 * can be reported when REPORT_EVENTS_EACH_SCAN is not set and
-	 * report_threshold_num_scans is reached.
-	 */
 	WIFI_EXTSCAN_THRESHOLD_NUM_SCANS,
-	/*
-	 * can be reported when REPORT_EVENTS_EACH_SCAN is not set and
-	 * report_threshold_percent is reached
-	 */
 	WIFI_EXTSCAN_THRESHOLD_PERCENT,
-	/*
-	 * reported when currently executing gscans are disabled
-	 * start_gscan will need to be called again in order to continue
-	 * scanning
-	 */
 	WIFI_SCAN_DISABLED,
 
-	/* Below events are consumed in driver only */
 	WIFI_EXTSCAN_BUCKET_STARTED_EVENT = 0x10,
 	WIFI_EXTSCAN_CYCLE_STARTED_EVENT,
 	WIFI_EXTSCAN_CYCLE_COMPLETED_EVENT,
-} tWifiScanEventType;
+};
 
 /**
  * enum extscan_configuration_flags - extscan config flags

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

@@ -3648,12 +3648,8 @@ int wma_extscan_operations_event_handler(void *handle,
 
 	switch (oprn_event->event) {
 	case WMI_EXTSCAN_BUCKET_COMPLETED_EVENT:
-		WMA_LOGD("%s: received WMI_EXTSCAN_BUCKET_COMPLETED_EVENT",
-			__func__);
-		oprn_ind->scanEventType =  WIFI_EXTSCAN_RESULTS_AVAILABLE;
 		oprn_ind->status = 0;
-		break;
-
+		goto exit_handler;
 	case WMI_EXTSCAN_CYCLE_STARTED_EVENT:
 		WMA_LOGD("%s: received WMI_EXTSCAN_CYCLE_STARTED_EVENT",
 			 __func__);
@@ -3681,19 +3677,19 @@ int wma_extscan_operations_event_handler(void *handle,
 		oprn_ind->buckets_scanned = 0;
 		break;
 	case WMI_EXTSCAN_BUCKET_STARTED_EVENT:
-		WMA_LOGD("%s: received WIFI_EXTSCAN_BUCKET_STARTED_EVENT",
+		WMA_LOGD("%s: received WMI_EXTSCAN_BUCKET_STARTED_EVENT",
 			__func__);
 		oprn_ind->scanEventType = WIFI_EXTSCAN_BUCKET_STARTED_EVENT;
 		oprn_ind->status = 0;
 		goto exit_handler;
 	case WMI_EXTSCAN_THRESHOLD_NUM_SCANS:
-		WMA_LOGD("%s: received WIFI_EXTSCAN_THRESHOLD_NUM_SCANS",
+		WMA_LOGD("%s: received WMI_EXTSCAN_THRESHOLD_NUM_SCANS",
 			__func__);
 		oprn_ind->scanEventType = WIFI_EXTSCAN_THRESHOLD_NUM_SCANS;
 		oprn_ind->status = 0;
 		break;
 	case WMI_EXTSCAN_THRESHOLD_PERCENT:
-		WMA_LOGD("%s: received WIFI_EXTSCAN_THRESHOLD_PERCENT",
+		WMA_LOGD("%s: received WMI_EXTSCAN_THRESHOLD_PERCENT",
 			__func__);
 		oprn_ind->scanEventType = WIFI_EXTSCAN_THRESHOLD_PERCENT;
 		oprn_ind->status = 0;