Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp272740rdb; Thu, 21 Dec 2023 08:44:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSdT/0VgfP36DMpMzolFxbr2ouolbnO4k5GDLSvM47nBCiMgxX493aOlT1tmrzKdp8FXvP X-Received: by 2002:ac8:5f81:0:b0:423:a6c5:1924 with SMTP id j1-20020ac85f81000000b00423a6c51924mr1345212qta.23.1703177099671; Thu, 21 Dec 2023 08:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703177099; cv=none; d=google.com; s=arc-20160816; b=qEF2D3xjeoIEUqGaElAW3uj4f3iLrts81ggSA+iO8Y7f+91j8cBAq7PNVmaOUlAWTl 6GVZqAyyEyt1QElON3/FPPpPYfKGVB/1AfQZ03O4Ieylo0jZ/n22L9MkEMOYv4tQ3/Jz zuYYqwOgCUX0rc2tRTFlHwAPfbyCmeOuwiytrKu7KNE87LkzFH3sfsNrYK8MY/95IPZS NlfAf5msLlTMzQFgnCSLLtutgqJQg4kfO3iny2zyLmP08TmtRze3y0y/1xzrYnBpbDCj Ckv0Oa0p/pkrF+5yQvEShNDz1gtkzmVsRzYxsTIAP3sSa8y5uaruqyku1su2YTp6Lxr9 maBg== 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=eryH5zA3yic32Y48S4s6Nib6FNvxlkIlksAClAdIqQM=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=MPfsCFr6dU1ceCKBojTwp7RfjnZTGKIcDJ3nxH3ru3aITgm0ZTeG3yjCeWFZQsezQR k8zngXs3HJnbqVzRdViGk1fQuEcLtZit9xocSV7/oe9EjPylaH+zeQDfKVGm3JAaKFke sbeJZ676XcN2QwQHrDkiJi8ykj/RnwMia3RLdt4o1MCD3ZZ5Q5ytbYNj2wqQgZQ46zXv bPL1M3yKWQPvhKlftL9AdFnelgIKRicvZ5TEKAkqhkJWiltB7hKNCRVeZEogwIB6Ex71 0d2SzN2skD7ilSM8XpHUUnoSJHLelmjtZZIOgIqmBGQGqphedbf2i5RglJdaUE14tcNw ZfbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bepDixIK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1160-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1160-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y13-20020a05622a164d00b00425fea03c12si2433784qtj.388.2023.12.21.08.44.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:44:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1160-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bepDixIK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1160-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1160-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 6C6F61C20864 for ; Thu, 21 Dec 2023 16:44:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A1E05990A; 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="bepDixIK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qD2tXmYv" 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 D33B55823D for ; Thu, 21 Dec 2023 16:44:14 +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=1703177045; 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=eryH5zA3yic32Y48S4s6Nib6FNvxlkIlksAClAdIqQM=; b=bepDixIKnHrgPtWPJeeo58k8/r2IJ4oD1uef5zDAigtIrgTpJ1SSDqib+UcKhph1a1vuWp gaDIXZ8GzGIPfXPw8GEZqLk8qr1oYE3AaMp8Eg1oMoWjZlU30/X0YWbJVGqKtFuTakziy2 jTWWihQgXM54h40icj+QM3G0rO0tFHMQiFA/dXTMuAPaUhSSxbFcGaILKLOZgEgZT1Vno4 zpL3nL2YSkCzI2tIlzkBXx2u1cUAV8tjicRm8wdhCszFGhbekIZHbS3cHTVqGn2xspkr40 WkC2eUFfKzFqok0C61wbHwEyd7jmLVAbKIptNmTTmVZVH1tkLNPMRbNBV+IbZg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703177045; 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=eryH5zA3yic32Y48S4s6Nib6FNvxlkIlksAClAdIqQM=; b=qD2tXmYv3CymP+cEhRkdFI6j0mOues/eEI6VUXCfS1yRz7H/LvGAXeR/Y+G/dgcfs9SRXS 258GwFW3clERSGBA== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v2 13/21] wifi: rtl8xxxu: support multiple interfaces in watchdog_callback() Date: Thu, 21 Dec 2023 17:43:45 +0100 Message-Id: <20231221164353.603258-14-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 Check first whether priv->vifs[0] exists and is of type STATION, then go to priv->vifs[1]. Make sure to call refresh_rate_mask for both interfaces. Signed-off-by: Martin Kaistra --- .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index c5b71892369c9..fd0108668bcda 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -7200,11 +7200,15 @@ static void rtl8xxxu_watchdog_callback(struct work_struct *work) { struct ieee80211_vif *vif; struct rtl8xxxu_priv *priv; + int i; priv = container_of(work, struct rtl8xxxu_priv, ra_watchdog.work); - vif = priv->vif; + for (i = 0; i < ARRAY_SIZE(priv->vifs); i++) { + vif = priv->vifs[i]; + + if (!vif || vif->type != NL80211_IFTYPE_STATION) + continue; - if (vif && vif->type == NL80211_IFTYPE_STATION) { int signal; struct ieee80211_sta *sta; @@ -7215,22 +7219,21 @@ static void rtl8xxxu_watchdog_callback(struct work_struct *work) dev_dbg(dev, "%s: no sta found\n", __func__); rcu_read_unlock(); - goto out; + continue; } rcu_read_unlock(); signal = ieee80211_ave_rssi(vif); - priv->fops->report_rssi(priv, 0, + priv->fops->report_rssi(priv, rtl8xxxu_get_macid(priv, sta), rtl8xxxu_signal_to_snr(signal)); - if (priv->fops->set_crystal_cap) - rtl8xxxu_track_cfo(priv); - rtl8xxxu_refresh_rate_mask(priv, signal, sta, false); } -out: + if (priv->fops->set_crystal_cap) + rtl8xxxu_track_cfo(priv); + schedule_delayed_work(&priv->ra_watchdog, 2 * HZ); } -- 2.39.2