From patchwork Thu Sep 16 16:01:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 513014 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1408515jao; Thu, 16 Sep 2021 10:04:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZrCqK7VFlK6n+uVDK47FuUri01pP+pz8bqPYiGYnoKEniMy8oDoVJ87oxquNnPy5mbNtV X-Received: by 2002:a17:906:a187:: with SMTP id s7mr7240974ejy.191.1631811839871; Thu, 16 Sep 2021 10:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631811839; cv=none; d=google.com; s=arc-20160816; b=jzlZB6NX4WzTSBZx8UY2fz86uYvqnKuxErpuAdyL/Zo7tl5GO4e4eLNDE6fFFsfewT 9+6DL4gSCJfE/9C7JGJKZJv1ZmtACVGu+79flYgAoeRl68EGnwF+H1CfEcqNS6sgxOYP 61qL9P5Q5LoCeQkfH1mepJGy3m9l+B6w4lWG6E7OV6g+8bVWJBsvsf3qT2zuHqzs8ALF Yi9MCh09XIJHx3TUVFfIMBJCB8AA9JziVCX/fxrv0lSRry3zRAF/mPCYilynH31/LMsg MQnGlBSzjwPJnx1mX78iuVTVheUdnVrTynEhIbQTvQRyTv6PNMhbfouGhv1BzRPECd19 OPmw== 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=QgoYaNAIq5T3VHDKYofBX3k6MkgMlU8REcSBdsSzfBbPZAKN+K6spHL4YZOya2cYBv KxeejleT/OpksXJdY814yw10WorjOyIL86Fg48/T6V4uCFyvbepnEKJy5XM9ADhBch42 ZAv36QH1YMysTRZPivCUTs7ysYS0uyLYoIN9J2a3pEEQKKVYKe60Jyk9A04uyh12+yPq j0fIlTXmgakORAiXspiexNuYKYDq80+nU2B1eK7CdRlmpx9pVmnQOk9hAbSkR67ovNW9 wARDKtj+8wQzBS41/NQTmwtC0DYUSo8BBOcWQZNdDpwOFnjnLE0e5aEeQ1ZKMgJToiDS dYkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W25mm+vO; 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 l13si4082720edv.249.2021.09.16.10.03.59; Thu, 16 Sep 2021 10:03:59 -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=W25mm+vO; 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 S1344567AbhIPRFG (ORCPT + 11 others); Thu, 16 Sep 2021 13:05:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347394AbhIPQ7F (ORCPT ); Thu, 16 Sep 2021 12:59:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B47D613CF; Thu, 16 Sep 2021 16:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809937; bh=k7GlPxKjxxPV1E0dBBXMjRRHeWhi0zDdQc+CVA8fLYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W25mm+vOAHTtaAjwYOU0FycVCrT1CCXCHhlIOvoJuomUwEHiCkAWTIGIDSWEIaQMJ Z7HoVsaR/3Q+roo86OJTsi9ca5mi05R8qJuIj2wxCEBjW5avbl3Mka1iHZGP1WMYqv X7oEL29lzfpLl7XICn9XJzE3mi8yMEaL1RONyW+Q= 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.13 338/380] wcn36xx: Fix missing frame timestamp for beacon/probe-resp Date: Thu, 16 Sep 2021 18:01:35 +0200 Message-Id: <20210916155815.534518311@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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)) {