mac80211: rtl8xxxu: sync with linux-next 20240229
[openwrt/staging/981213.git] / package / kernel / mac80211 / patches / rtl / 001-10-v6.9-wifi-rtl8xxxu-support-multiple-interfaces-in-set_aif.patch
1 From 43532c050f8eec4056a21978fdb5b958e1477553 Mon Sep 17 00:00:00 2001
2 From: Martin Kaistra <martin.kaistra@linutronix.de>
3 Date: Fri, 22 Dec 2023 11:14:31 +0100
4 Subject: [PATCH 10/21] wifi: rtl8xxxu: support multiple interfaces in
5 set_aifs()
6
7 In concurrent mode supported by this driver, both interfaces will use
8 the same channel and same wireless mode.
9 It is therefore possible to get the wireless mode by checking the first
10 connected interface.
11
12 Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
13 Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
14 Signed-off-by: Kalle Valo <kvalo@kernel.org>
15 Link: https://msgid.link/20231222101442.626837-11-martin.kaistra@linutronix.de
16 ---
17 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 ++++++++--
18 1 file changed, 8 insertions(+), 2 deletions(-)
19
20 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
21 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
22 @@ -4913,14 +4913,20 @@ static void rtl8xxxu_set_aifs(struct rtl
23 u8 aifs, aifsn, sifs;
24 int i;
25
26 - if (priv->vif) {
27 + for (i = 0; i < ARRAY_SIZE(priv->vifs); i++) {
28 + if (!priv->vifs[i])
29 + continue;
30 +
31 struct ieee80211_sta *sta;
32
33 rcu_read_lock();
34 - sta = ieee80211_find_sta(priv->vif, priv->vif->bss_conf.bssid);
35 + sta = ieee80211_find_sta(priv->vifs[i], priv->vifs[i]->bss_conf.bssid);
36 if (sta)
37 wireless_mode = rtl8xxxu_wireless_mode(priv->hw, sta);
38 rcu_read_unlock();
39 +
40 + if (wireless_mode)
41 + break;
42 }
43
44 if (priv->hw->conf.chandef.chan->band == NL80211_BAND_5GHZ ||