Am 20.12.23 um 07:09 schrieb Ping-Ke Shih:
-----Original Message-----
From: Martin Kaistra <martin.kaistra@xxxxxxxxxxxxx>
Sent: Monday, December 18, 2023 10:37 PM
To: linux-wireless@xxxxxxxxxxxxxxx
Cc: Jes Sorensen <Jes.Sorensen@xxxxxxxxx>; Kalle Valo <kvalo@xxxxxxxxxx>; Ping-Ke Shih
<pkshih@xxxxxxxxxxx>; Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>; Sebastian Andrzej Siewior
<bigeasy@xxxxxxxxxxxxx>
Subject: [PATCH 14/20] wifi: rtl8xxxu: support multiple interfaces in bss_info_changed()
Call set_linktype now with correct port_num. Only react to beacon
changes if port_num == 0, as we only support AP mode on this port.
Signed-off-by: Martin Kaistra <martin.kaistra@xxxxxxxxxxxxx>
---
.../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 26 +++++++++++--------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 59dd50844f1ae..f929b01615d00 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
[...]
@@ -5090,16 +5092,18 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
rtl8xxxu_set_basic_rates(priv, bss_conf->basic_rates);
}
- if (changed & BSS_CHANGED_BEACON_ENABLED) {
- if (bss_conf->enable_beacon)
- rtl8xxxu_start_tx_beacon(priv);
- else
- rtl8xxxu_stop_tx_beacon(priv);
+ /* beacon only supported for port_num = 0 */
+ if (rtlvif->port_num == 0) {
As your design, AP mode must play on port 0. Could mac80211 notify driver BEACON
changed on port 1?
Looking at mac80211 code, there is an explicit check for vif.type when changed
contains BSS_CHANGED_BEACON or BSS_CHANGED_BEACON_ENABLED. As rtl8xxxu driver
only allows to add NL80211_IFTYPE_AP on port_num = 0, a notification on port 1
will never happen. I will remove this check for v2.
+ if (changed & BSS_CHANGED_BEACON_ENABLED) {
+ if (bss_conf->enable_beacon)
+ rtl8xxxu_start_tx_beacon(priv);
+ else
+ rtl8xxxu_stop_tx_beacon(priv);
+ }
+ if (changed & BSS_CHANGED_BEACON)
+ schedule_work(&priv->update_beacon_work);
}
- if (changed & BSS_CHANGED_BEACON)
- schedule_work(&priv->update_beacon_work);
-
error:
return;
}
Ping-Ke