Commit b57aa17f authored by A. Cody Schuffelen's avatar A. Cody Schuffelen Committed by Johannes Berg

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: default avatarA. Cody Schuffelen <schuffelen@google.com>
Link: https://lore.kernel.org/r/20210318200419.1421034-1-schuffelen@google.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1b5ab825
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <net/cfg80211.h> #include <net/cfg80211.h>
#include <net/rtnetlink.h> #include <net/rtnetlink.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/math64.h>
#include <linux/module.h> #include <linux/module.h>
static struct wiphy *common_wiphy; static struct wiphy *common_wiphy;
...@@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work) ...@@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work)
scan_result.work); scan_result.work);
struct wiphy *wiphy = priv_to_wiphy(priv); struct wiphy *wiphy = priv_to_wiphy(priv);
struct cfg80211_scan_info scan_info = { .aborted = false }; struct cfg80211_scan_info scan_info = { .aborted = false };
u64 tsf = div_u64(ktime_get_boottime_ns(), 1000);
informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz, informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz,
CFG80211_BSS_FTYPE_PRESP, CFG80211_BSS_FTYPE_PRESP,
fake_router_bssid, fake_router_bssid, tsf,
ktime_get_boottime_ns(),
WLAN_CAPABILITY_ESS, 0, WLAN_CAPABILITY_ESS, 0,
(void *)&ssid, sizeof(ssid), (void *)&ssid, sizeof(ssid),
DBM_TO_MBM(-50), GFP_KERNEL); DBM_TO_MBM(-50), GFP_KERNEL);
......
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