Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp272626rdb; Thu, 21 Dec 2023 08:44:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ74yupa3xiVjhdLOwMISW1s9+kQV5OFdY4X5EmANB0ytsMMmbb5mmBQSGt/Wcb67Zqsqj X-Received: by 2002:a17:906:4b52:b0:a18:ad93:460d with SMTP id j18-20020a1709064b5200b00a18ad93460dmr37369ejv.69.1703177083018; Thu, 21 Dec 2023 08:44:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703177083; cv=none; d=google.com; s=arc-20160816; b=dymvZVlgcK6T30Glt4vN5eLkAbLaObTrS+povdOtB9scqRB12hoCyaMpEjaFjGhKoh u2zpVU+6Oz8rGFnaZED9JWaTyAveL5GjKY4jl4vanDvX6F5y/IlRBgX0gj9AFatJ63L1 meiVE8O1hLS6by5YzlJXeVfvKpo3N0+LfP4CzR2GZE5nQdQ6slvmdSg5dz/lmGHFuWWK XRvdCmq3B51KaN39R4S63p4lcsPfgIM4RxJdjHa9BFKKFOQ294FxWazlUr2TFCFxmiNd ZQPQdn1C00qtW3QOSvQiBCX5iWYDg2TuU0EfiaCOTzZgC79D11hrB8qXY63P+N3iiIiG JU7g== 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=iNyg5aqBG5urJxpU+rxykaqCxQCO72gRqKK8Ye1CjKI=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=Ng/EN5eGR3EmG+Hg1Z8ZQAdFdQNQUZoCHI3pUHQsOTvCIDCt9wYx2FubGmU7gFU6Jg 2n+42g3qImLpoaQ55THj0u3D/YnaxNsUev2RiIXwwtDFFV1UYE8YlUwSM+Y2tgRIzmJu vKGch1m/0N/8Rz1id3fZskkRUXZq4kDSUWtFbJMmhLJQ89xyHb7zwyOqvqiqPPMc6gIm Gcyeq3AYcREeE4rxEPklBBhvpcebh8OWosYjBwwrFJsjnFtlxwnosMJAOPL4cKFJlV/R /aEBg8RBwOXZ0t/41ZEDYhEY9d0sff9YSiNdJBK23d/v8mzFuIvT3FRwJWDBA5y2NDr2 XbfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SL22u6FE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1156-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 k14-20020a17090646ce00b00a2335745a39si999679ejs.764.2023.12.21.08.44.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:44:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1156-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=SL22u6FE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1156-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1156-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 C353B1F258B1 for ; Thu, 21 Dec 2023 16:44:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3456659922; Thu, 21 Dec 2023 16:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SL22u6FE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jq6GzpWk" 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 C55C95990A 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=iNyg5aqBG5urJxpU+rxykaqCxQCO72gRqKK8Ye1CjKI=; b=SL22u6FEwH27XAt3XUHG+ae6BabruNOzJ4leqbV+zMnughsIU8qBTtjiGsThYAvBJsJOWq 22o++n2GGzIvuvKxV6JoEy2CHY2ntAPiOQeePNQIx/0RL/aath/96QzS2NvM5RSo1RCxiz xa79WZQIZMuVHBsjQA+QXyhBjTM2t6cWXbRi64R0GoQbJ/b6MlNb/EM3A/KSiB3HxdBpq3 M4botKmsKvbVT/o+RGxR3kRoO+Qt6BQDmBIMJERP8G88+zmsRak1yvW6dFilBkFi6vxgv1 /bAOsAL83f7QOFyxh5z/+W5ax/J9ai7n2DukRpr2nfrkHhVetY9bSxdMTrpYtw== 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=iNyg5aqBG5urJxpU+rxykaqCxQCO72gRqKK8Ye1CjKI=; b=jq6GzpWk5vwQ1kM/IXeyPJtEsxyYY3CElP1yVWYjgQTCZFGmjMKpvshJZaAP0rmd1cWAF+ xau8PI64hjwP6BAw== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v2 10/21] wifi: rtl8xxxu: support multiple interfaces in set_aifs() Date: Thu, 21 Dec 2023 17:43:42 +0100 Message-Id: <20231221164353.603258-11-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 In concurrent mode supported by this driver, both interfaces will use the same channel and same wireless mode. It is therefore possible to get the wireless mode by checking the first connected interface. Signed-off-by: Martin Kaistra --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 490f35d0d6199..99fe567e0f75b 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -4913,14 +4913,20 @@ static void rtl8xxxu_set_aifs(struct rtl8xxxu_priv *priv, u8 slot_time) u8 aifs, aifsn, sifs; int i; - if (priv->vif) { + for (i = 0; i < ARRAY_SIZE(priv->vifs); i++) { + if (!priv->vifs[i]) + continue; + struct ieee80211_sta *sta; rcu_read_lock(); - sta = ieee80211_find_sta(priv->vif, priv->vif->bss_conf.bssid); + sta = ieee80211_find_sta(priv->vifs[i], priv->vifs[i]->bss_conf.bssid); if (sta) wireless_mode = rtl8xxxu_wireless_mode(priv->hw, sta); rcu_read_unlock(); + + if (wireless_mode) + break; } if (priv->hw->conf.chandef.chan->band == NL80211_BAND_5GHZ || -- 2.39.2