Skip to content

Commit b57aa17

Browse files
Databeanjmberg-intel
authored andcommitted
virt_wifi: Return micros for BSS TSF values
cfg80211_inform_bss expects to receive a TSF value, but is given the time since boot in nanoseconds. TSF values are expected to be at microsecond scale rather than nanosecond scale. Signed-off-by: A. Cody Schuffelen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 1b5ab82 commit b57aa17

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/wireless/virt_wifi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <net/cfg80211.h>
1313
#include <net/rtnetlink.h>
1414
#include <linux/etherdevice.h>
15+
#include <linux/math64.h>
1516
#include <linux/module.h>
1617

1718
static struct wiphy *common_wiphy;
@@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work)
168169
scan_result.work);
169170
struct wiphy *wiphy = priv_to_wiphy(priv);
170171
struct cfg80211_scan_info scan_info = { .aborted = false };
172+
u64 tsf = div_u64(ktime_get_boottime_ns(), 1000);
171173

172174
informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz,
173175
CFG80211_BSS_FTYPE_PRESP,
174-
fake_router_bssid,
175-
ktime_get_boottime_ns(),
176+
fake_router_bssid, tsf,
176177
WLAN_CAPABILITY_ESS, 0,
177178
(void *)&ssid, sizeof(ssid),
178179
DBM_TO_MBM(-50), GFP_KERNEL);

0 commit comments

Comments
 (0)