]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtlwifi: always assume QoS mode in rtl8192cu
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 20 Mar 2024 08:43:24 +0000 (11:43 +0300)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 22 Mar 2024 06:50:25 +0000 (14:50 +0800)
In 'rtl92cu_set_hw_reg()', always assume that QoS mode is enabled
as it was hardcoded since an initial commit. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240320084324.109506-2-dmantipov@yandex.ru
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c

index 76bedfec55a3225bd692d9b5ecb7969d8df5c167..0195c9a3e9e865d98371aa2bbe25eac383a69154 100644 (file)
@@ -1484,7 +1484,6 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
        struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
        struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
        struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
-       enum wireless_mode wirelessmode = mac->mode;
        u8 idx = 0;
 
        switch (variable) {
@@ -1536,36 +1535,15 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
                }
        case HW_VAR_SLOT_TIME:{
                        u8 e_aci;
-                       u8 QOS_MODE = 1;
 
                        rtl_write_byte(rtlpriv, REG_SLOT, val[0]);
                        rtl_dbg(rtlpriv, COMP_MLME, DBG_LOUD,
                                "HW_VAR_SLOT_TIME %x\n", val[0]);
-                       if (QOS_MODE) {
-                               for (e_aci = 0; e_aci < AC_MAX; e_aci++)
-                                       rtlpriv->cfg->ops->set_hw_reg(hw,
-                                                               HW_VAR_AC_PARAM,
-                                                               &e_aci);
-                       } else {
-                               u8 sifstime = 0;
-                               u8      u1baifs;
 
-                               if (IS_WIRELESS_MODE_A(wirelessmode) ||
-                                   IS_WIRELESS_MODE_N_24G(wirelessmode) ||
-                                   IS_WIRELESS_MODE_N_5G(wirelessmode))
-                                       sifstime = 16;
-                               else
-                                       sifstime = 10;
-                               u1baifs = sifstime + (2 *  val[0]);
-                               rtl_write_byte(rtlpriv, REG_EDCA_VO_PARAM,
-                                              u1baifs);
-                               rtl_write_byte(rtlpriv, REG_EDCA_VI_PARAM,
-                                              u1baifs);
-                               rtl_write_byte(rtlpriv, REG_EDCA_BE_PARAM,
-                                              u1baifs);
-                               rtl_write_byte(rtlpriv, REG_EDCA_BK_PARAM,
-                                              u1baifs);
-                       }
+                       for (e_aci = 0; e_aci < AC_MAX; e_aci++)
+                               rtlpriv->cfg->ops->set_hw_reg(hw,
+                                                             HW_VAR_AC_PARAM,
+                                                             &e_aci);
                        break;
                }
        case HW_VAR_ACK_PREAMBLE:{