From patchwork Thu Sep 16 16:02:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 513043 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1444543jao; Thu, 16 Sep 2021 10:44:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPvRK8qvBZeqpBU4dK0Cef+oq4c7Nao43hvN8SIUoLjoRytZXp4fj6wbBQVsdf+vcSeXGS X-Received: by 2002:a92:ca82:: with SMTP id t2mr4768418ilo.151.1631814264284; Thu, 16 Sep 2021 10:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631814264; cv=none; d=google.com; s=arc-20160816; b=PstxmQvK8DqY88hZMlf8UrmG5fNHVKx0EUI0DPZRMgllsYJomgqAlnwmt7ye+AkLZm tJnIpv2sNbQn8ocq643jg0R8QyIkUxMxx7CiHjhAZ+QmIhCtEimVxikEW9MHN6cldhoe 2qI0rLgq3sKCBnkHVC7obrhstaQmB8ow7Z5m/X0v0Ww0514u8YRM8c+j5VBejzWMp9kZ sOMTgKgKaYMElH/5A32IEBera/9eB8NbOnhL/MT1e6w5hA+OFVZ8lj6WqdHf+PMrZLcw Lhhxv9qk0GO/Hq+Az1Z1lbJ4OtdUIhc3xwL8LpkrE2HET/IbbrdMqs8yVUnLr7wvfU6J fDVg== 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=dwmGq792ZcwW2DC2whSh1eeuYuIK2KTjT9BNHEKw9S4=; b=wiEAgx+RIooib/O5nUKY4kiT1deedVhUlF1pRTggfNSiEwAb6VB/zKu/5PPdlrPp2Q a0Jgw+57W57r3JEBhlY0lMBbgUp3g38FThRhh1scPKDF94Ti5zmpNAaS9BcwycNudSBc tLSCHbkPL7A0deBKHyT9m+leiOn8/tDylG2bRnfAukI4Ak6w9qjo4d2LXZd18uePLVAJ +SyZeWmlOXMkCjNXyr9HdNXw330uYIxtuvSPn3gI/T3xoXfv5xHPuIip0+Cs9AXyN1yC d3zAUdfhCO36d3QVqk0NHDiyvWtZjPf4jUZnH4c/UYjxDjphR45dEgVwyeXV8i/CAtc1 P1Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FCXiZd2K; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 c184si3522977iof.111.2021.09.16.10.44.24; Thu, 16 Sep 2021 10:44:24 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=FCXiZd2K; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1353249AbhIPRoQ (ORCPT + 11 others); Thu, 16 Sep 2021 13:44:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:53762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354953AbhIPRkw (ORCPT ); Thu, 16 Sep 2021 13:40:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F40C8611C8; Thu, 16 Sep 2021 16:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631811100; bh=k7GlPxKjxxPV1E0dBBXMjRRHeWhi0zDdQc+CVA8fLYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FCXiZd2K5sZRwjUqSrg0SmC5vhXM4j9BAmPw+cmwlZBPctpFLvL1ZHI3ngfZMT99g tlxiSg5zbwI38K1FP71l3hjOnjYje3LY8qNG2NNxh3cZkldkV7I8A1C/p78WGd7Od8 B/vqnte06edNyxnCn7Glg/8glyUR2GvKzOCu5aRA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Loic Poulain , Bryan ODonoghue , Kalle Valo , Sasha Levin Subject: [PATCH 5.14 384/432] wcn36xx: Fix missing frame timestamp for beacon/probe-resp Date: Thu, 16 Sep 2021 18:02:13 +0200 Message-Id: <20210916155823.823416268@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Loic Poulain [ Upstream commit 8678fd31f2d3eb14f2b8b39c9bc266f16fa24b22 ] When receiving a beacon or probe response, we should update the boottime_ns field which is the timestamp the frame was received at. (cf mac80211.h) This fixes a scanning issue with Android since it relies on this timestamp to determine when the AP has been seen for the last time (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter). Signed-off-by: Loic Poulain Reviewed-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1629992768-23785-1-git-send-email-loic.poulain@linaro.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wcn36xx/txrx.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.30.2 diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 1b831157ede1..cab196bb38cd 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -287,6 +287,10 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) status.rate_idx = 0; } + if (ieee80211_is_beacon(hdr->frame_control) || + ieee80211_is_probe_resp(hdr->frame_control)) + status.boottime_ns = ktime_get_boottime_ns(); + memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status)); if (ieee80211_is_beacon(hdr->frame_control)) {