1 From 3f9baa99f8429ea6f56e7cc8d881c027518e9573 Mon Sep 17 00:00:00 2001
2 From: Martin Kaistra <martin.kaistra@linutronix.de>
3 Date: Fri, 22 Dec 2023 11:14:34 +0100
4 Subject: [PATCH 13/21] wifi: rtl8xxxu: support multiple interfaces in
7 Check first whether priv->vifs[0] exists and is of type STATION, then go
8 to priv->vifs[1]. Make sure to call refresh_rate_mask for both
11 Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
12 Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
13 Signed-off-by: Kalle Valo <kvalo@kernel.org>
14 Link: https://msgid.link/20231222101442.626837-14-martin.kaistra@linutronix.de
16 .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 19 +++++++++++--------
17 1 file changed, 11 insertions(+), 8 deletions(-)
19 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
20 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
21 @@ -7200,11 +7200,15 @@ static void rtl8xxxu_watchdog_callback(s
23 struct ieee80211_vif *vif;
24 struct rtl8xxxu_priv *priv;
27 priv = container_of(work, struct rtl8xxxu_priv, ra_watchdog.work);
29 + for (i = 0; i < ARRAY_SIZE(priv->vifs); i++) {
30 + vif = priv->vifs[i];
32 + if (!vif || vif->type != NL80211_IFTYPE_STATION)
35 - if (vif && vif->type == NL80211_IFTYPE_STATION) {
37 struct ieee80211_sta *sta;
39 @@ -7215,22 +7219,21 @@ static void rtl8xxxu_watchdog_callback(s
41 dev_dbg(dev, "%s: no sta found\n", __func__);
48 signal = ieee80211_ave_rssi(vif);
50 - priv->fops->report_rssi(priv, 0,
51 + priv->fops->report_rssi(priv, rtl8xxxu_get_macid(priv, sta),
52 rtl8xxxu_signal_to_snr(signal));
54 - if (priv->fops->set_crystal_cap)
55 - rtl8xxxu_track_cfo(priv);
57 rtl8xxxu_refresh_rate_mask(priv, signal, sta, false);
61 + if (priv->fops->set_crystal_cap)
62 + rtl8xxxu_track_cfo(priv);
64 schedule_delayed_work(&priv->ra_watchdog, 2 * HZ);