aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2016-12-28 13:06:41 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-03 13:18:29 (GMT)
commit96a5f14ee4e838ad0a98e70788b51c18eb6d301a (patch)
tree14284ef6a5111185dbed47ea48b83b231f0f27fe /src/drivers
parentc16b9f8d33fb9c981d2cfcd8aeca1ca145ef531b (diff)
downloadhostap-96a5f14ee4e838ad0a98e70788b51c18eb6d301a.zip
hostap-96a5f14ee4e838ad0a98e70788b51c18eb6d301a.tar.gz
hostap-96a5f14ee4e838ad0a98e70788b51c18eb6d301a.tar.bz2
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>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/driver_nl80211_capa.c12
-rw-r--r--src/drivers/driver_nl80211_event.c10
-rw-r--r--src/drivers/driver_nl80211_scan.c21
3 files changed, 43 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 85706ef..1baffef 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -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;
}
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 66cfb72..de539b1 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -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);
}
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index d7b61f6..3ad0d83 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -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;
}