5c5c1948d3742af89d4aeb6f0cd5a8177a7db688
[openwrt/staging/ansuel.git] /
1 From 073401c3b6b9eaea027240baf07f2b84dd2d2d26 Mon Sep 17 00:00:00 2001
2 From: Martin Kaistra <martin.kaistra@linutronix.de>
3 Date: Fri, 22 Dec 2023 11:14:36 +0100
4 Subject: [PATCH 15/21] wifi: rtl8xxxu: support multiple interfaces in
5 bss_info_changed()
6
7 Call set_linktype and set_bssid now with correct port_num. Call
8 stop_tx_beacon only for port 0, as we don't support beacons on port 1.
9 Explicit changes to BEACON will only happen for AP type interfaces, so
10 we don't need an additional check there.
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-16-martin.kaistra@linutronix.de
16 ---
17 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 +++++---
18 1 file changed, 5 insertions(+), 3 deletions(-)
19
20 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
21 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
22 @@ -4983,6 +4983,7 @@ static void
23 rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
24 struct ieee80211_bss_conf *bss_conf, u64 changed)
25 {
26 + struct rtl8xxxu_vif *rtlvif = (struct rtl8xxxu_vif *)vif->drv_priv;
27 struct rtl8xxxu_priv *priv = hw->priv;
28 struct device *dev = &priv->udev->dev;
29 struct ieee80211_sta *sta;
30 @@ -4995,7 +4996,7 @@ rtl8xxxu_bss_info_changed(struct ieee802
31 if (changed & BSS_CHANGED_ASSOC) {
32 dev_dbg(dev, "Changed ASSOC: %i!\n", vif->cfg.assoc);
33
34 - rtl8xxxu_set_linktype(priv, vif->type, 0);
35 + rtl8xxxu_set_linktype(priv, vif->type, rtlvif->port_num);
36
37 if (vif->cfg.assoc) {
38 u32 ramask;
39 @@ -5042,7 +5043,8 @@ rtl8xxxu_bss_info_changed(struct ieee802
40
41 rtl8xxxu_write8(priv, REG_BCN_MAX_ERR, 0xff);
42
43 - rtl8xxxu_stop_tx_beacon(priv);
44 + if (rtlvif->port_num == 0)
45 + rtl8xxxu_stop_tx_beacon(priv);
46
47 /* joinbss sequence */
48 rtl8xxxu_write16(priv, REG_BCN_PSR_RPT,
49 @@ -5084,7 +5086,7 @@ rtl8xxxu_bss_info_changed(struct ieee802
50
51 if (changed & BSS_CHANGED_BSSID) {
52 dev_dbg(dev, "Changed BSSID!\n");
53 - rtl8xxxu_set_bssid(priv, bss_conf->bssid, 0);
54 + rtl8xxxu_set_bssid(priv, bss_conf->bssid, rtlvif->port_num);
55 }
56
57 if (changed & BSS_CHANGED_BASIC_RATES) {