Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp698671rdb; Fri, 22 Dec 2023 02:15:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IG16UobzdU8FT0PPr/WqWsgbierMSUZyhb7xA4Dqzr8SDWbt60gj2Nxo+NQ5lCq+aBaj767 X-Received: by 2002:a05:6214:2a4d:b0:67f:709e:c6b2 with SMTP id jf13-20020a0562142a4d00b0067f709ec6b2mr1327686qvb.10.1703240116197; Fri, 22 Dec 2023 02:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703240116; cv=none; d=google.com; s=arc-20160816; b=CBo4tAbckfBjqsjGTXLy9U6siJ+xm5ErqPeq8DEOBQpX5u/iN8n5UR1NEvEZPPgStf f+T27+Swvxpnh3EsDKwk2bQrb7awEwFaj79Ae89+gb81Te4aoL1LEAi0PawcY/QJiaGL rh+FTBO2g1ETBZ9RifpmrEG1zqqIvdEDlL8pjb7iGQ7fz7kn3gRA6kQzN2LxMoDKMA7y nM6q2zBsaSk9sVA4Bj8RLmG7P3i49m2elGDRrRIcaTQX3ggnex09OIk+Jmio66Sp934t pWBRkjyALKLKE4ON+HHqxLRjgETWvbhAkjwvYA14w+lNd0gstod/VVDqU4n4tw+ey4Wl kAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=CPW8iKPYFAwZwMyiYi0S8we3AtROWwXa6uqLOJUILIM=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=NHo/UBpMLzr80XMU1Pxy8t7h2tgynVDi/SvwFrFJa62pMFsXd9eaa3VzYHBgi7H+ZT T2FAQ6TqdiSNL/LkQTchR+ENl9EcK29RXwFEyx+Wy+crkWYKXpqJ88SYXWiTzHtlwai9 2dbyypCCiyeXYuTWnqPvK/pFTHhDtZ2aIXYQAg1PWE3tQhXcBJyLXij3fUgF5iRWE2DJ hprdkx3odO4txznwkQJUvJIrH/M6JT/wHCe3CJGvRfcN79eVXz9+Arkp/4w7OYM16wxg vCf4eVsOmyudnMa2IAfZQtc69GzR76FhiB8Seko3N5i89fmY0hbMZ8FdBFD/zZfYbV49 u34g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tb+qk1Va; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ABtZKuZ9; spf=pass (google.com: domain of linux-wireless+bounces-1230-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x15-20020a0ce24f000000b0067f28a9598dsi4107404qvl.282.2023.12.22.02.15.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 02:15:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1230-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tb+qk1Va; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ABtZKuZ9; spf=pass (google.com: domain of linux-wireless+bounces-1230-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CEC381C21556 for ; Fri, 22 Dec 2023 10:15:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45FDC1775B; Fri, 22 Dec 2023 10:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tb+qk1Va"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ABtZKuZ9" X-Original-To: linux-wireless@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA8FB171B6 for ; Fri, 22 Dec 2023 10:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703240088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CPW8iKPYFAwZwMyiYi0S8we3AtROWwXa6uqLOJUILIM=; b=tb+qk1VaM/kJMttjl0hgVZm/bl7S4oFQYsCOys/saaGl2jusXfwXESEybf4E9AZhegUJOV qPedzLzZW1botyXzGJ+uBjd8/jCyxC9KDFWFwvFK6AL1B5rvFgjQbxUm0RN3nCYK6ymS/K nNKDL3ck+LYau3UpiKH/ZzDRTTL2w1bP+gEDZqfz3C77wmlHwrZuYpBtLFftX9iYrk7XCM 40+Cs1XLlX77LCof4BfERTtIPtxQiKyhh504jz9ueSo+oEmYpG/sQQaKOHiZTgeX+j7EXN xdg3Epbg6/R1mOIUQkcxiCtdR6BlIPQ2kCVbkH5cIT/tmGujQg1fzfyFX855aQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703240088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CPW8iKPYFAwZwMyiYi0S8we3AtROWwXa6uqLOJUILIM=; b=ABtZKuZ9kgzJjBFKg7FFSMxWPiHQrZ/APGL6szjx0LBVwoyg2MiPDgTPRbTOF1Saa/qVe8 QDrPARa2UMFkkSCQ== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v3 08/21] wifi: rtl8xxxu: don't parse CFO, if both interfaces are connected in STA mode Date: Fri, 22 Dec 2023 11:14:29 +0100 Message-Id: <20231222101442.626837-9-martin.kaistra@linutronix.de> In-Reply-To: <20231222101442.626837-1-martin.kaistra@linutronix.de> References: <20231222101442.626837-1-martin.kaistra@linutronix.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If both interfaces are in STATION mode and both are connected to an AP, there might be conflicting CFO values for the two connections. Ignore the CFO information in this case. Signed-off-by: Martin Kaistra Reviewed-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index ca0d885eabb71..6fff982f65253 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -5716,6 +5716,14 @@ static inline bool rtl8xxxu_is_packet_match_bssid(struct rtl8xxxu_priv *priv, ether_addr_equal(priv->vifs[port_num]->bss_conf.bssid, hdr->addr2); } +static inline bool rtl8xxxu_is_sta_sta(struct rtl8xxxu_priv *priv) +{ + return (priv->vifs[0] && priv->vifs[0]->cfg.assoc && + priv->vifs[0]->type == NL80211_IFTYPE_STATION) && + (priv->vifs[1] && priv->vifs[1]->cfg.assoc && + priv->vifs[1]->type == NL80211_IFTYPE_STATION); +} + void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv, struct ieee80211_rx_status *rx_status, struct rtl8723au_phy_stats *phy_stats, @@ -5734,6 +5742,7 @@ void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv, bool parse_cfo = priv->fops->set_crystal_cap && !crc_icv_err && !ieee80211_is_ctl(hdr->frame_control) && + !rtl8xxxu_is_sta_sta(priv) && (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) || rtl8xxxu_is_packet_match_bssid(priv, hdr, 1)); @@ -5772,6 +5781,7 @@ static void jaguar2_rx_parse_phystats_type1(struct rtl8xxxu_priv *priv, bool parse_cfo = priv->fops->set_crystal_cap && !crc_icv_err && !ieee80211_is_ctl(hdr->frame_control) && + !rtl8xxxu_is_sta_sta(priv) && (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) || rtl8xxxu_is_packet_match_bssid(priv, hdr, 1)); u8 pwdb_max = 0; -- 2.39.2