Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2469096pxb; Mon, 19 Apr 2021 06:31:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9DvnE1bAs4JmGKPjAtWTWPohf6P6UeU3EZSuTbvMsJjw8GACb/3yeMjdd7KHJfOG87SlC X-Received: by 2002:a17:906:c34d:: with SMTP id ci13mr21282313ejb.430.1618839082795; Mon, 19 Apr 2021 06:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618839082; cv=none; d=google.com; s=arc-20160816; b=b7eFxGTLzD/CXBb1IQ3kxl6zUfuekG8zahZlIHuIVwcHbeEZyJAASxS2/b8QB2CPJZ +SzJEDaxO9TWZweBs4+s/0fYdHlzwsLbts800AvuTp7IFCoaHMDc2EMQebGOZf2hvTX1 dUxf4/yvQFJiDm58/D+v3781KF7zxflMEq/NYYeYj/L/PkmDywiKRPwfu9GKvY57EAHu mp5BuW1jhSpQXP9IucILHeK+YJtUPjl8+Z/LXJHAipCANSbI3U+70hUJABCR6j32nwPE qxaZMuzAQqtiYf45ZjN0ZrJUNPHAALBp+y6Xw/G9LJK/Gm3zUJcRZdHK8TV3qLOKCYt4 zgeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZlNVdj0COkcKiWpAmaUWuYsrW9t3T4XalhavdMO4qkU=; b=N1FpKYSQp9ipeEBmgGWDmXuCdyUGCxy4gS+kOZqW0+1sdySvsFKH1UpFFa+8xj6ui5 SNbFIoxHRdDJLU7gP5v5gY8rhPRzI7bFUx7M6SyDRJh0YeR1Hld2RY6u0XzJC4h4MALX pEnssoO+58xwcN+9MA4/mW0RMup7T/9fszFaaGIpqxnaK+SaZtzAWPOjZBAOKnXSTm+s 4NsEJ6X9GirlwZE8IRpKs2o7cgGQVIms/7KpMTq3ERv6nDsXtifh/zg2LuBc/V38HPc7 aoBb2TIfQxPJ1KB5U+V/O9ToUYXQd0yCbWMH8n2zW1BLTu9c5qI6SltTSj3pVB4m6nhy Rb/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dSmxVYzr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si12259055ejx.579.2021.04.19.06.30.54; Mon, 19 Apr 2021 06:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dSmxVYzr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240932AbhDSN2h (ORCPT + 99 others); Mon, 19 Apr 2021 09:28:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:57240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241427AbhDSNUd (ORCPT ); Mon, 19 Apr 2021 09:20:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AEA16613EB; Mon, 19 Apr 2021 13:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838201; bh=AkIks0oqHhkdF+z6ehOanHRJwZy6mXz2P5PImIEaNsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dSmxVYzrDR8OXW5wIEnsmm8W605kEw8xAogubk8NCPYpm/cZtOy3FfiKjEVxpjB7K rOErErw9FhWworah10JlYc8/NKSwMLI8O7ZNN6a5Ag9yZOK2YbGskimMEeamAgIuKO SZ0hYJ4W7xZkeMpY6d2fcAJxBLp3xREsLl7hZtCU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "A. Cody Schuffelen" , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 045/103] virt_wifi: Return micros for BSS TSF values Date: Mon, 19 Apr 2021 15:05:56 +0200 Message-Id: <20210419130529.364677158@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: A. Cody Schuffelen [ Upstream commit b57aa17f07c9270e576ef7df09f142978b5a75f0 ] 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 Link: https://lore.kernel.org/r/20210318200419.1421034-1-schuffelen@google.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/virt_wifi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c index c878097f0dda..1df959532c7d 100644 --- a/drivers/net/wireless/virt_wifi.c +++ b/drivers/net/wireless/virt_wifi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include static struct wiphy *common_wiphy; @@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work) scan_result.work); struct wiphy *wiphy = priv_to_wiphy(priv); 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, CFG80211_BSS_FTYPE_PRESP, - fake_router_bssid, - ktime_get_boottime_ns(), + fake_router_bssid, tsf, WLAN_CAPABILITY_ESS, 0, (void *)&ssid, sizeof(ssid), DBM_TO_MBM(-50), GFP_KERNEL); -- 2.30.2