nl80211: Add support for additional scan parameters for beacon report

Add support for:
 1. Setting scan dwell time
 2. Parsing scan start TSF and beacon received TSF reported
    by the driver
 3. Setting driver capabilities for the above

These capabilities are needed for Beacon Report radio measurement.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
This commit is contained in:
Avraham Stern 2016-12-28 15:06:41 +02:00 committed by Jouni Malinen
parent c16b9f8d33
commit 96a5f14ee4
3 changed files with 43 additions and 0 deletions

View file

@ -377,6 +377,18 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_BEACON_RATE_VHT))
capa->flags |= WPA_DRIVER_FLAGS_BEACON_RATE_VHT;
if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_SET_SCAN_DWELL))
capa->rrm_flags |= WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL;
if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_SCAN_START_TIME) &&
ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_BSS_PARENT_TSF) &&
ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_SET_SCAN_DWELL))
capa->rrm_flags |= WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT;
}

View file

@ -1110,6 +1110,16 @@ static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted,
wpa_printf(MSG_DEBUG, "nl80211: Scan included frequencies:%s",
msg);
}
if (tb[NL80211_ATTR_SCAN_START_TIME_TSF] &&
tb[NL80211_ATTR_SCAN_START_TIME_TSF_BSSID]) {
info->scan_start_tsf =
nla_get_u64(tb[NL80211_ATTR_SCAN_START_TIME_TSF]);
os_memcpy(info->scan_start_tsf_bssid,
nla_data(tb[NL80211_ATTR_SCAN_START_TIME_TSF_BSSID]),
ETH_ALEN);
}
wpa_supplicant_event(drv->ctx, EVENT_SCAN_RESULTS, &event);
}

View file

@ -270,6 +270,19 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
}
}
if (params->duration) {
if (!(drv->capa.rrm_flags &
WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL) ||
nla_put_u16(msg, NL80211_ATTR_MEASUREMENT_DURATION,
params->duration))
goto fail;
if (params->duration_mandatory &&
nla_put_flag(msg,
NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY))
goto fail;
}
if (scan_flags &&
nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, scan_flags))
goto fail;
@ -645,6 +658,8 @@ nl80211_parse_bss_info(struct wpa_driver_nl80211_data *drv,
[NL80211_BSS_STATUS] = { .type = NLA_U32 },
[NL80211_BSS_SEEN_MS_AGO] = { .type = NLA_U32 },
[NL80211_BSS_BEACON_IES] = { .type = NLA_UNSPEC },
[NL80211_BSS_PARENT_TSF] = { .type = NLA_U64 },
[NL80211_BSS_PARENT_BSSID] = { .type = NLA_UNSPEC },
};
struct wpa_scan_res *r;
const u8 *ie, *beacon_ie;
@ -730,6 +745,12 @@ nl80211_parse_bss_info(struct wpa_driver_nl80211_data *drv,
}
}
if (bss[NL80211_BSS_PARENT_TSF] && bss[NL80211_BSS_PARENT_BSSID]) {
r->parent_tsf = nla_get_u64(bss[NL80211_BSS_PARENT_TSF]);
os_memcpy(r->tsf_bssid, nla_data(bss[NL80211_BSS_PARENT_BSSID]),
ETH_ALEN);
}
return r;
}