Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3037749pxb; Tue, 24 Aug 2021 13:36:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrnVjTL7/1pqQfrhaXK819hoL3JRFgMSoT06bbRdK0Lt75y7elNnIh/Gsc6YnjM0SrWxCQ X-Received: by 2002:a5d:9906:: with SMTP id x6mr32796282iol.23.1629837387003; Tue, 24 Aug 2021 13:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629837386; cv=none; d=google.com; s=arc-20160816; b=rSDGTkqPM3y5rzIczv+7L6KDorBhWBGkIA2wIzLdc5u/2tWJ2JpPGMDUfNzUUK2FdE PTk9YQB/pkNRJjUo+4IIZLbMriBQHNyFGZItqGGiJEEZocHCRy90kNTQBxVMhNwpsOIj VPy3lI31xtrfL+iC1g0vQ2XhT5MGN+EooTVOLzHuaB0aWB5FY6vZMaWPxy2S3tQTcsEl CKzvCuBE3xhJT90z+KIvsW+FK90idMTjRDzF3X6PvS/caKe2JWJuasfhycqlQob2fQ5A g1k5ZzHpWCDV75W8Y7trL6wy0eN3tDu2Hpnh38ntAggGEw0/9u4k3h5VN1ZDvAwuhRkB cLnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=iegoMqqA+kYuoQVpUvRK3gBau9CKgESDaZYF0Mb68j0=; b=jR3LRCJc2Yl/u3nkIxsGH7B6quueKv+XjMy3hIQ0jZEsjEqj9S6eosvirAGAXG2/Tf rfC6UIbiM88jhlmnlQ45hV8f4zQ8AlweB41husIEaj3vURt9oZoCkONLn8u+A2BRf5Ep ascokRCZyaqK1GgVZC0Aak2bH6yUSX+2R/UW/Xkn+pWCcoui6OnTtZpTTOIn/096HKAs EWRFm8Qd8J4bS0TmnkKVnbN6Y/e+zFLM5sV/5XA219JL+4DOloFydI/vBjqGEaQ2IBfB jfmazEvLbKodtyBDpiXA93JC02RNVhZqrbuTrNHX6tzvGbBFtsRtY3cNUkqKLM7UaeC4 47OQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si18612046ilu.92.2021.08.24.13.35.43; Tue, 24 Aug 2021 13:36: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234838AbhHXUgI (ORCPT + 99 others); Tue, 24 Aug 2021 16:36:08 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:52744 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229514AbhHXUgI (ORCPT ); Tue, 24 Aug 2021 16:36:08 -0400 X-UUID: 814b16205a6c480ab5a64afe02273594-20210825 X-UUID: 814b16205a6c480ab5a64afe02273594-20210825 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 557214062; Wed, 25 Aug 2021 04:35:19 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 25 Aug 2021 04:35:18 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 25 Aug 2021 04:35:18 +0800 From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , , Ryder Lee Subject: [PATCH] mt76: fill boottime_ns in Rx path Date: Wed, 25 Aug 2021 04:35:16 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Give a proper boottime_ns value for netlink RX to avoid scan issues with Android. Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mac80211.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 2a434a97fa45..fab55f7d3766 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -801,6 +801,7 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb, struct ieee80211_sta **sta) { struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); + struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb); struct mt76_rx_status mstat; mstat = *((struct mt76_rx_status *)skb->cb); @@ -823,6 +824,10 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb, status->device_timestamp = mstat.timestamp; status->mactime = mstat.timestamp; + if (ieee80211_is_beacon(hdr->frame_control) || + ieee80211_is_probe_resp(hdr->frame_control)) + status->boottime_ns = ktime_get_boottime_ns(); + BUILD_BUG_ON(sizeof(mstat) > sizeof(skb->cb)); BUILD_BUG_ON(sizeof(status->chain_signal) != sizeof(mstat.chain_signal)); -- 2.29.2