Commit 162dd6a7 authored by Johannes Berg's avatar Johannes Berg

mac80211: allow drivers to report CLOCK_BOOTTIME for scan results

This was requested by Android, and the appropriate cfg80211 API
had been added by Dmitry. Support it in mac80211, allowing drivers
to provide the timestamp.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 646e76bb
...@@ -1120,6 +1120,8 @@ enum mac80211_rx_vht_flags { ...@@ -1120,6 +1120,8 @@ enum mac80211_rx_vht_flags {
* *
* @mactime: value in microseconds of the 64-bit Time Synchronization Function * @mactime: value in microseconds of the 64-bit Time Synchronization Function
* (TSF) timer when the first data symbol (MPDU) arrived at the hardware. * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
* @boottime_ns: CLOCK_BOOTTIME timestamp the frame was received at, this is
* needed only for beacons and probe responses that update the scan cache.
* @device_timestamp: arbitrary timestamp for the device, mac80211 doesn't use * @device_timestamp: arbitrary timestamp for the device, mac80211 doesn't use
* it but can store it and pass it back to the driver for synchronisation * it but can store it and pass it back to the driver for synchronisation
* @band: the active band when this frame was received * @band: the active band when this frame was received
...@@ -1146,6 +1148,7 @@ enum mac80211_rx_vht_flags { ...@@ -1146,6 +1148,7 @@ enum mac80211_rx_vht_flags {
*/ */
struct ieee80211_rx_status { struct ieee80211_rx_status {
u64 mactime; u64 mactime;
u64 boottime_ns;
u32 device_timestamp; u32 device_timestamp;
u32 ampdu_reference; u32 ampdu_reference;
u32 flag; u32 flag;
......
...@@ -66,7 +66,9 @@ ieee80211_bss_info_update(struct ieee80211_local *local, ...@@ -66,7 +66,9 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
struct cfg80211_bss *cbss; struct cfg80211_bss *cbss;
struct ieee80211_bss *bss; struct ieee80211_bss *bss;
int clen, srlen; int clen, srlen;
struct cfg80211_inform_bss bss_meta = {}; struct cfg80211_inform_bss bss_meta = {
.boottime_ns = rx_status->boottime_ns,
};
bool signal_valid; bool signal_valid;
if (ieee80211_hw_check(&local->hw, SIGNAL_DBM)) if (ieee80211_hw_check(&local->hw, SIGNAL_DBM))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment