Skip to content

Commit 162dd6a

Browse files
committed
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: Johannes Berg <[email protected]>
1 parent 646e76b commit 162dd6a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/net/mac80211.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,8 @@ enum mac80211_rx_vht_flags {
11201120
*
11211121
* @mactime: value in microseconds of the 64-bit Time Synchronization Function
11221122
* (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
1123+
* @boottime_ns: CLOCK_BOOTTIME timestamp the frame was received at, this is
1124+
* needed only for beacons and probe responses that update the scan cache.
11231125
* @device_timestamp: arbitrary timestamp for the device, mac80211 doesn't use
11241126
* it but can store it and pass it back to the driver for synchronisation
11251127
* @band: the active band when this frame was received
@@ -1146,6 +1148,7 @@ enum mac80211_rx_vht_flags {
11461148
*/
11471149
struct ieee80211_rx_status {
11481150
u64 mactime;
1151+
u64 boottime_ns;
11491152
u32 device_timestamp;
11501153
u32 ampdu_reference;
11511154
u32 flag;

net/mac80211/scan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
6666
struct cfg80211_bss *cbss;
6767
struct ieee80211_bss *bss;
6868
int clen, srlen;
69-
struct cfg80211_inform_bss bss_meta = {};
69+
struct cfg80211_inform_bss bss_meta = {
70+
.boottime_ns = rx_status->boottime_ns,
71+
};
7072
bool signal_valid;
7173

7274
if (ieee80211_hw_check(&local->hw, SIGNAL_DBM))

0 commit comments

Comments
 (0)