wifi: rtl8xxxu: support multiple interfaces in watchdog_callback()

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 <martin.kaistra@linutronix.de>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231222101442.626837-14-martin.kaistra@linutronix.de
This commit is contained in:
Martin Kaistra
2023-12-22 11:14:34 +01:00
committed by Kalle Valo
parent 6b76638287
commit 3f9baa99f8

View File

@@ -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);
}