]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
wifi: rtl8xxxu: support multiple interfaces in set_aifs()
authorMartin Kaistra <martin.kaistra@linutronix.de>
Fri, 22 Dec 2023 10:14:31 +0000 (11:14 +0100)
committerKalle Valo <kvalo@kernel.org>
Wed, 10 Jan 2024 14:52:56 +0000 (16:52 +0200)
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 <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-11-martin.kaistra@linutronix.de
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

index 71d9d48ef21446e18a521b777eaf4c9147385967..3adbcc4bccb5989b4d785a36ffb69c3e709943ea 100644 (file)
@@ -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 ||