RRM: Filter scan results by parent TSF only if driver supports it

Scan results with parent TSF older than the scan start TSF are not added
to the beacon report since they are considered as scan results from
previous scans. However, for drivers that report the scan start TSF but
not the parent TSF of each scan result, the parent TSF will be zero so
valid scan results will be dropped.

Fix this by filtering scan results by the parent TSF only if the
driver supports reporting the parent TSF for each scan result.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
This commit is contained in:
Avraham Stern 2017-06-08 11:17:56 +03:00 committed by Jouni Malinen
parent 3f8e3a5486
commit 23eead4d74

View file

@ -1376,6 +1376,10 @@ int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
continue; continue;
} }
/*
* Don't report results that were not received during the
* current measurement.
*/
if (!(wpa_s->drv_rrm_flags & if (!(wpa_s->drv_rrm_flags &
WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT)) { WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT)) {
struct os_reltime update_time, diff; struct os_reltime update_time, diff;
@ -1402,14 +1406,10 @@ int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
(unsigned int) diff.usec); (unsigned int) diff.usec);
continue; continue;
} }
} } else if (info->scan_start_tsf >
scan_res->res[i]->parent_tsf) {
/*
* Don't report results that were not received during the
* current measurement.
*/
if (info->scan_start_tsf > scan_res->res[i]->parent_tsf)
continue; continue;
}
if (wpas_add_beacon_rep(wpa_s, &buf, bss, info->scan_start_tsf, if (wpas_add_beacon_rep(wpa_s, &buf, bss, info->scan_start_tsf,
scan_res->res[i]->parent_tsf) < 0) scan_res->res[i]->parent_tsf) < 0)