Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp272773rdb; Thu, 21 Dec 2023 08:45:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZjBCgpyLatBJWcHHlTB77Jc9ZIdlSI5XYfMxKZEHsFu+6C6XhF3Oc55jwNVyDph0/w0rP X-Received: by 2002:a05:600c:310e:b0:40d:33eb:d472 with SMTP id g14-20020a05600c310e00b0040d33ebd472mr551wmo.88.1703177103274; Thu, 21 Dec 2023 08:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703177103; cv=none; d=google.com; s=arc-20160816; b=oldTGNw5mZODbbq18Ppvos9r8Xli1JYBudPO9IlEIkDZFJtNdEix/JsaQ9WaKqT8n5 3U1fIMWfCbz2Rw5ob+fQ/UA1i/e3PuwoV26IW7UCvzMwAg2tjg0aG306Slw4OHTNUmKU FW2ZvMHNnYSqc2g21iIAc33REHuZO+A09l1TxxXVxB3QR9zf4XDyp5k95m4YF/Bp9E6q 3cP/OdAc08WptQ/scYkybtc5LCZJ0apbsWx0CQXDtLg5UZuYvj9JaLxMR7OUr/t/PD/A 1sEZLvuhstB+8U8v0KKcXKY4lfM+xLJkF7P/Nd3zkNJeZ8jqpzkuW1g8xNV871NA60Sq Uc4w== 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=pkAuxOUYb76fa0wQknKeoYn/lmHg+tg5V/b7Uvvt8Yw=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=jfj3Rr6tYO+s8+qUIjh5CEe4VxbuniVxcuMxDPRCogXeFMlNt9pECtyNBre2Oy+56Z Gwf669Y/fQFO11XOXYp5Fv7ilDCoGw4IBdSLwHTy2WXwCtWngyCa+0C3bO9YFKF9I3Ff W3x9gaSzWmiAuXOrTQ32bRvGaTwg7xPtqOIlTWRduJmsZGgNuczb209WFslTFo8b4XqP t0n6OgYRFslen6SIFsT+/PKKK+2TItifvX8gfy1c+3LCvQUozjs5FI59NelH/cSUjJfb 4ZTHdSBwdEQBUuY2Ky+xAj2Bn5BiWKg6EiLxLhDgYrwSsSzgRa0ru8N7Lo8iaNGtjGtg Se0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0PQs1VT5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1162-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1162-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n19-20020a170906841300b00a26a95985e0si556395ejx.122.2023.12.21.08.45.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:45:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1162-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0PQs1VT5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1162-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1162-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CA64A1F23938 for ; Thu, 21 Dec 2023 16:45:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5901159913; Thu, 21 Dec 2023 16:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0PQs1VT5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rHWVwjsn" 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 F011C5990F for ; Thu, 21 Dec 2023 16:44:13 +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=1703177044; 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=pkAuxOUYb76fa0wQknKeoYn/lmHg+tg5V/b7Uvvt8Yw=; b=0PQs1VT5muVSJPz6WUpj664NPInxDzj8QfYOnieZnK1J+0tAj68CDLCFlpBIlqAKQxHybF obuQT6zeWR1ICjVOOLNFrAwGx29wwRRz8Va0wAcY5BKOCbjNfGt0++24wNbxZbqZDQk2rJ FcsummI1NDKTCsAMFMcQETwNHRT7Zp+5kRqtkn9+BQY0eRcwGjLoVWqyJHieSr0mHsZXQM cDxsoHoAHXAOXBIYdRMCFGTxzspYF+2z+scN8+WSPwHu3WGAcpORW6/h2rGQjVLz0Bor/l CRRJhCFe3e2PH2lVc5X6ZvKcKozsYvVrYV4HM4ax3CVPvT7rkTtVCbzWW9hQsw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703177044; 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=pkAuxOUYb76fa0wQknKeoYn/lmHg+tg5V/b7Uvvt8Yw=; b=rHWVwjsn3+0EO8n0zdLA6CaZHzZRDApCyQruNUDEsQR+7W6Vu7B+Cg2HBB6nevcXkUtiM1 /PxPOUtjen0a5SAw== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v2 08/21] wifi: rtl8xxxu: don't parse CFO, if both interfaces are connected in STA mode Date: Thu, 21 Dec 2023 17:43:40 +0100 Message-Id: <20231221164353.603258-9-martin.kaistra@linutronix.de> In-Reply-To: <20231221164353.603258-1-martin.kaistra@linutronix.de> References: <20231221164353.603258-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 --- 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