From patchwork Thu Aug 26 15:46:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 502880 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f46:0:0:0:0 with SMTP id h6csp319242ejj; Thu, 26 Aug 2021 08:35:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXyvcJK3rtmNGkAzwihM+O0/hWAjeK44ukXO9pJMKRTWteOKlLQ4baIxKGaisl6bhq+xqb X-Received: by 2002:a92:cb52:: with SMTP id f18mr3347988ilq.120.1629992126225; Thu, 26 Aug 2021 08:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629992126; cv=none; d=google.com; s=arc-20160816; b=TaXFvbNj0fhns9qo1fZ6fS75cmeFiynkB+K+gnWMuGxbAZupxzOPN3DPRsgnRpLcXA 70VmerftFifPyPTO0bgHmijohqaFubJbAkpcJtJYE5XVEY9Z8IFxq7aPtFXF4RHijobg bWdamYJmh4iW4XMMkpDM90Wf8BLk2rsn57eY4n0elMOH4gtZC7plfXDC46c/YUNTboIq DiTeHyZEJCwPNC4ARJy/S7MWpq4R7v2ufYtXKDVJZ8fdRqF+aYiQM/eUPiAOktfaal6L v5K9b1Eb830+5Ba2GeJVsriWHh7OTapYxnQ/hUKD/e7cb1hkWfoDFcCRm6p5sVyyt0DV oU+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=TaK24+8gH53dYWBrBRg64lij3FSBe4N9yadD4P1UUuU=; b=NmespWHGbNT9TTqAsUv6Q8xTmLi27fSSpNmlqDjvvtnTiqa75AcIfubrnxsKK++xmy 5tAbx7irDWKHIsfaAmwSEkUZgSQ9/dGFVfOZkWp59v9NU9xUvPv5hKnHDZkegrPJC69m xdi7TcfMqwueahpsq9hWwp3GMVX3ivReXu8oXRdaqaONXJ8IRTsScHzjo7NwdlGksArk IBCFzO1dUgRxSYAEwAdfCC6SfjEKYfH9ksdqltc+QsXiX5pwABLZZoaOOXEStE3Ol8SI wHzcXmAkxCwYCwhGybWd2GEnodsjLl0Qu5zyg4bjaH7Lm3iIMwkAQNfzMGrIQp90ea2t 7cVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nqxp7aNA; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h199si3258875iof.50.2021.08.26.08.35.20; Thu, 26 Aug 2021 08:35:26 -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=@linaro.org header.s=google header.b=nqxp7aNA; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242963AbhHZPgG (ORCPT + 2 others); Thu, 26 Aug 2021 11:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242959AbhHZPgF (ORCPT ); Thu, 26 Aug 2021 11:36:05 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60501C0613C1 for ; Thu, 26 Aug 2021 08:35:18 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id b6so5704432wrh.10 for ; Thu, 26 Aug 2021 08:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=TaK24+8gH53dYWBrBRg64lij3FSBe4N9yadD4P1UUuU=; b=nqxp7aNA2YFI86iFQqlTb8aAJarFLYJyjLq9tjqOgYQjle/y/kqUGpanPFyaG2V/ha rGWgMsvszI7GNJDYdYDaAv3VryGdwcWmErLTdZ778olOb9rlm54q2lu7mVJLq4ehXDrD DmlvDd5/ZA2t1xHZKHdjjMcnVGdy/DxI1L+PkpEzohBaUNFEXL60WhnFPulJ8bdcL2LI 2hIry2CRH8VaOscmYwYnBV61UPPHkmKa8DZ+mjIt/9hQ3ODMmH/nBEbHmCLF/AQM5lfK +qNWCAdRiRCmcGDQj9LXYyJ9kIutkZE/becoZEc834dylfEO8pzrM1TKvqwg9dTC4Oqd MHEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TaK24+8gH53dYWBrBRg64lij3FSBe4N9yadD4P1UUuU=; b=ety4S8QHC5+ak3aeBAGV8aEqqAgoSgdkU5Qii8FUPhX658TcLHjom/+R68DWvpSA4E JoIQ+kJhq+1xS/vQ9ZNJ3JdVdCWuGmE/F/3qQJEKcRAmr4nejr10UxyAfzKOWU29LeIH 8ixymceatn9kVt6tg7dMkaR8L/i34zEoWJETXpnMAL46/Cqb5+hbn0wxSmS+Q4F/HBNa tiW21TTjMlblfuV6MdnTT2b+7B1Pcwj49oAbrMvmijHtUwW1WtfH516GZTOT9WB7lhMG JjBO3WruszFXAY++oxtqRFMrlFRx23xAYxGPAdkkWWfsppA+dUi2cE26vH1KD0APd7k2 +vPQ== X-Gm-Message-State: AOAM5306ER0IdEZBLbeSk7u+S8lGXlDrIXM5+E1Azx9oPtQysepc+UUm VN5WHaM93DrWKUD+utqvpPGe+w== X-Received: by 2002:a5d:4dc3:: with SMTP id f3mr4917851wru.302.1629992116860; Thu, 26 Aug 2021 08:35:16 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:edf4:979b:2385:1df8]) by smtp.gmail.com with ESMTPSA id a12sm7598553wmm.42.2021.08.26.08.35.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Aug 2021 08:35:16 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Loic Poulain Subject: [PATCH] wcn36xx: Fix missing frame timestamp for beacon/probe-resp Date: Thu, 26 Aug 2021 17:46:08 +0200 Message-Id: <1629992768-23785-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- drivers/net/wireless/ath/wcn36xx/txrx.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 1b83115..cab196b 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)) {