]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
wifi: rtl8xxxu: Add parameter force to rtl8xxxu_refresh_rate_mask
authorMartin Kaistra <martin.kaistra@linutronix.de>
Fri, 28 Apr 2023 15:08:24 +0000 (17:08 +0200)
committerKalle Valo <kvalo@kernel.org>
Fri, 5 May 2023 07:30:13 +0000 (10:30 +0300)
In AP mode, when multiple STAs connect to us, we need to set an initial
rate mask for each of them. This initialisation should happen regardless
of the rssi_level saved in the priv struct.

Add a parameter called force to rtl8xxxu_refresh_rate_mask() which will
be used for this initialisation.

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://lore.kernel.org/r/20230428150833.218605-10-martin.kaistra@linutronix.de
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

index 0e951dee127ecd22e583e934d2b90e5a70fae3ee..a3ca6ea9b2d6650b8a5f0ee99889b0112118d4f8 100644 (file)
@@ -6830,7 +6830,8 @@ static u8 rtl8xxxu_signal_to_snr(int signal)
 }
 
 static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv,
-                                      int signal, struct ieee80211_sta *sta)
+                                      int signal, struct ieee80211_sta *sta,
+                                      bool force)
 {
        struct ieee80211_hw *hw = priv->hw;
        u16 wireless_mode;
@@ -6864,7 +6865,7 @@ static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv,
        else
                rssi_level = RTL8XXXU_RATR_STA_LOW;
 
-       if (rssi_level != priv->rssi_level) {
+       if (rssi_level != priv->rssi_level || force) {
                int sgi = 0;
                u32 rate_bitmap = 0;
 
@@ -7080,7 +7081,7 @@ static void rtl8xxxu_watchdog_callback(struct work_struct *work)
                if (priv->fops->set_crystal_cap)
                        rtl8xxxu_track_cfo(priv);
 
-               rtl8xxxu_refresh_rate_mask(priv, signal, sta);
+               rtl8xxxu_refresh_rate_mask(priv, signal, sta, false);
        }
 
 out: