|
@@ -1203,6 +1203,59 @@ validation_done:
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
+#ifdef WLAN_FEATURE_SAP_ACS_OPTIMIZE
|
|
|
+/**
|
|
|
+ * sap_acs_scan_freq_list_optimize - optimize the ACS scan freq list based
|
|
|
+ * on when last scan was performed on particular frequency. If last scan
|
|
|
+ * performed on particular frequency is less than configured last_scan_ageout
|
|
|
+ * time, then skip that frequency from ACS scan freq list.
|
|
|
+ *
|
|
|
+ * sap_ctx: sap context
|
|
|
+ * list: ACS scan frequency list
|
|
|
+ * ch_count: number of frequency in list
|
|
|
+ *
|
|
|
+ * Return: None
|
|
|
+ */
|
|
|
+static void sap_acs_scan_freq_list_optimize(struct sap_context *sap_ctx,
|
|
|
+ struct chan_list *list,
|
|
|
+ uint8_t *ch_count)
|
|
|
+{
|
|
|
+ int loop_count = 0, j = 0;
|
|
|
+ uint32_t ts_last_scan;
|
|
|
+
|
|
|
+ sap_ctx->partial_acs_scan = false;
|
|
|
+
|
|
|
+ while (loop_count < *ch_count) {
|
|
|
+ ts_last_scan = scm_get_last_scan_time_per_channel(
|
|
|
+ sap_ctx->vdev, list->chan[loop_count].freq);
|
|
|
+
|
|
|
+ if (qdf_system_time_before(
|
|
|
+ qdf_get_time_of_the_day_ms(),
|
|
|
+ ts_last_scan + sap_ctx->acs_cfg->last_scan_ageout_time)) {
|
|
|
+ sap_info("ACS chan %d skipped from scan as last scan ts %d\n",
|
|
|
+ list->chan[loop_count].freq,
|
|
|
+ qdf_get_time_of_the_day_ms() - ts_last_scan);
|
|
|
+
|
|
|
+ for (j = loop_count; j < *ch_count - 1; j++)
|
|
|
+ list->chan[j].freq = list->chan[j + 1].freq;
|
|
|
+
|
|
|
+ (*ch_count)--;
|
|
|
+ sap_ctx->partial_acs_scan = true;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ loop_count++;
|
|
|
+ }
|
|
|
+ if (*ch_count == 0)
|
|
|
+ sap_info("All ACS freq channels are scanned recently, skip ACS scan\n");
|
|
|
+}
|
|
|
+#else
|
|
|
+static void sap_acs_scan_freq_list_optimize(struct sap_context *sap_ctx,
|
|
|
+ struct chan_list *list,
|
|
|
+ uint8_t *ch_count)
|
|
|
+{
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
QDF_STATUS sap_channel_sel(struct sap_context *sap_context)
|
|
|
{
|
|
|
QDF_STATUS qdf_ret_status;
|
|
@@ -1312,6 +1365,26 @@ QDF_STATUS sap_channel_sel(struct sap_context *sap_context)
|
|
|
sap_context->num_of_channel = num_of_channels;
|
|
|
/* Set requestType to Full scan */
|
|
|
|
|
|
+ /*
|
|
|
+ * send partial channels to be scanned in SCAN request if
|
|
|
+ * vendor command included last scan ageout time to be used to
|
|
|
+ * optimize the SAP bring up time
|
|
|
+ */
|
|
|
+ if (sap_context->acs_cfg->last_scan_ageout_time)
|
|
|
+ sap_acs_scan_freq_list_optimize(
|
|
|
+ sap_context, &req->scan_req.chan_list,
|
|
|
+ &req->scan_req.chan_list.num_chan);
|
|
|
+
|
|
|
+ if (!req->scan_req.chan_list.num_chan) {
|
|
|
+ sap_info("## SKIPPED ACS SCAN");
|
|
|
+ wlansap_pre_start_bss_acs_scan_callback(
|
|
|
+ mac_handle, sap_context, sap_context->sessionId,
|
|
|
+ 0, eCSR_SCAN_SUCCESS);
|
|
|
+ qdf_mem_free(req);
|
|
|
+ qdf_ret_status = QDF_STATUS_SUCCESS;
|
|
|
+ goto release_vdev_ref;
|
|
|
+ }
|
|
|
+
|
|
|
sap_context->acs_req_timestamp = qdf_get_time_of_the_day_ms();
|
|
|
qdf_ret_status = wlan_scan_start(req);
|
|
|
if (qdf_ret_status != QDF_STATUS_SUCCESS) {
|
|
@@ -1340,6 +1413,7 @@ QDF_STATUS sap_channel_sel(struct sap_context *sap_context)
|
|
|
wlansap_dump_acs_ch_freq(sap_context);
|
|
|
host_log_acs_scan_start(scan_id, vdev_id);
|
|
|
}
|
|
|
+
|
|
|
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
|
|
|
} else {
|
|
|
sap_context->acs_cfg->skip_scan_status = eSAP_SKIP_ACS_SCAN;
|