Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp459596pxb; Thu, 9 Sep 2021 05:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzhRmH4ZezdjwXxDC2M/4luNFeqhUmvjeZiz3CVQt78VqkdyBz3iJJg4trftc6Vb59FDhG X-Received: by 2002:aa7:c884:: with SMTP id p4mr2742180eds.203.1631189133971; Thu, 09 Sep 2021 05:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631189133; cv=none; d=google.com; s=arc-20160816; b=ovcCLX8ro/vx6ve3nkuNo9XWqSNCEr8VMJTh2RzJ+p12vCZTCby8kLCA6xLP3Hjwv+ 0V0HLvZGTUV3ngZVxayyn9VfvFpx25KBRQXCBy4dlXEl/9WyUSTwnCNKIdXrXXxJWW+0 52/VlHpGlQaJIS7tB6fjJe0OWSYJ6qOQy78AdeY8+G37XaFVqo0pr9PirORr09kNTZdj Eq42wnLRFL6zbpTUybW3Y+pwFZM39UmAGlKynQK21QqVp7ePvesGWdvBpoDcmWrZiFNZ M+nF6GmFNvwcylt5qp+2gJVqOZ7xdkN56T6qHDjiLrcnPcn/CMHCvDcTEu+sgrrQsWAw NEYQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dwmGq792ZcwW2DC2whSh1eeuYuIK2KTjT9BNHEKw9S4=; b=q92bNJuLqaj8k+6dbLUAkYmvwYbU9m8xFAGZVgwQltSHong6xXHmoleKoJlRmXCnX3 TuJa+Ph6SoTuZ3EeVFiEX0wv/RXigR3Q07HLXH5YZ6rDepb8jBD5h+X5cLQLLKultaHM hg6Te14Kl3viTRx207I1jfbYCGlZ1b0xAktyVE8rDmhZaoMxbtbJ9CJWQH/8aSghgBLi t+8kHSkp237WVySW5AmxvQvFXg829YS8+V4WEJ6s+d31tbghMVSr9/nr//fpqBhyM/NU Ho/gIF//vL+aS1iBg61JjXjb4RTVyUDH1w+WajNmd5Ie2Plndsd8RWV4PlsfvXy2FPwb OI9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XGhdqytX; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si1578480edc.501.2021.09.09.05.04.46; Thu, 09 Sep 2021 05:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@kernel.org header.s=k20201202 header.b=XGhdqytX; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245702AbhIIMDj (ORCPT + 99 others); Thu, 9 Sep 2021 08:03:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:41392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240124AbhIIMBa (ORCPT ); Thu, 9 Sep 2021 08:01:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 103DB61505; Thu, 9 Sep 2021 11:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187986; bh=k7GlPxKjxxPV1E0dBBXMjRRHeWhi0zDdQc+CVA8fLYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGhdqytXgSyvXrARVeWAgxnnbCz3gT5jFx+3W6JlOyA/A7ZSRcXUTnPtJEjtSnA56 bAGmJg7bcNRTpNHxNV0ojQtMti70H2Dyu/DSTR6ZOcVprM8d6rnlq70aAP32H2x8ox xiPIQmTvIa+pjBVYSXTCG0wrOSSVrSj0ONzAAijZmcjSFCpYoflKhNcd5l6TPvupMr qWWyY6YXVLOBvW/0QHDs6u66KfENIE+MQI9cLjF7cpOj7QgJb8OINwIMwL6xLlKhps pUJiSmz6MrxKkTo/rtASWlYazKokcVaDOUmRn0eR+Yj6ss9iH6rtZjovB4zCskgn49 bjg5lpMjM/1Lw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Loic Poulain , Bryan O'Donoghue , Kalle Valo , Sasha Levin , wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 246/252] wcn36xx: Fix missing frame timestamp for beacon/probe-resp Date: Thu, 9 Sep 2021 07:41:00 -0400 Message-Id: <20210909114106.141462-246-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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(+) 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)) { -- 2.30.2