From patchwork Thu Sep 16 16:00:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 512993 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1368797jao; Thu, 16 Sep 2021 09:23:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztdak+6wBNVnrJV9Rn5prSrKRHhnfceIWNH8Z/KsVpR49hEGC2I2vBZXCgLRHMCWqUnUD5 X-Received: by 2002:a05:6e02:17cf:: with SMTP id z15mr4306546ilu.103.1631809401510; Thu, 16 Sep 2021 09:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809401; cv=none; d=google.com; s=arc-20160816; b=oo/A9bBzKyUfIhI5MvFlbRY7PaMVlj+MjZQpYNZViP/rS9uKUbxLhxnTP0FIXL8yCD OMIRCeZXhtLzAj5BfuKGVrmgqGxAdKC94YOlF2rpcHEbOcw8CZnFlcNYaIYiBS0oMe6f 0LD56eHAMplFnXfVmYJf4oZBdOJidaJAQma2zhG0kMHDe5QOeKQmF5tp9q0QPR1Yx9tR VBV0NlswH+1I+lxgURUra9p7xdtchnqgvlTroRSu140T39X5mgPhdxQE8XXcKi/sHMdh FV8rUNNuZlW6/JqAFk7rlePn5Ls54wJGE9xu/qpLouLAoPQw7/kc+1NrVFAPh4I3pmF4 AXsA== 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=dp3stG/uUQjtB0uBwBNByhJFy0On/FHEEj+DIA7vhx/t1id6KGPe+l885nW/nP4VL9 GiAbW1Ry6aOlE7InZyQg28RPoQWCObNQE36/E9cJwHLMjSWy4qMHFhKV+hXudVEIMYTL pfaT+KEmljPPTg04FxaiFhrEXk29XQFd8uc7/NDPZmLnoh1NJheY4p+LOnw6Z4Bu/zZr gZ/WevqIFeoYAFfN4USYp0/kEr9dZCKcI1GfMAOmiVQeLUhIo38ON10uCBb9ZLfs3wqP oYP8wwGocbx79Jk3/Zvdu0GWLQ4kLFjQryfgoF+pt/E6OyUDz9EI04iEFZ5jLcsJ7I5z wv4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GKgWMipY; 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 d5si3046713ilu.50.2021.09.16.09.23.21; Thu, 16 Sep 2021 09:23:21 -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=GKgWMipY; 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 S236893AbhIPQYk (ORCPT + 11 others); Thu, 16 Sep 2021 12:24:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:59936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241856AbhIPQWc (ORCPT ); Thu, 16 Sep 2021 12:22:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB5B16140D; Thu, 16 Sep 2021 16:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808921; bh=k7GlPxKjxxPV1E0dBBXMjRRHeWhi0zDdQc+CVA8fLYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GKgWMipYJqJiTU2VGgzmHiFJcqBSJssklq81ZZu3AP0fJeP9Km10gsZpaJT1ObPi5 UtRh3823u+LJzBbBP5D7IYxv2dPgZbuzjtnMlYNd83N4Y/7nSVOI3PClIjV3yWHlDJ J25Qju67vhPi1Ivq8DduQd4PGWj8+0yBWMXkLJP8= 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.10 271/306] wcn36xx: Fix missing frame timestamp for beacon/probe-resp Date: Thu, 16 Sep 2021 18:00:16 +0200 Message-Id: <20210916155803.312358138@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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)) {