staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()
authorMichael Straube <straube.linux@gmail.com>
Thu, 31 Mar 2022 13:05:20 +0000 (15:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 05:33:48 +0000 (07:33 +0200)
The HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU() just calls
rtw_read32(). Remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()
and call rtw_read32() directly. Move the call to a new function to
indicate what it actually does. This is part of the ongoing effort to
get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331130522.6648-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_cmd.c
drivers/staging/r8188eu/hal/usb_halinit.c
drivers/staging/r8188eu/include/hal_intf.h

index 859ec8d..496fb67 100644 (file)
@@ -1199,6 +1199,11 @@ exit:
        return res;
 }
 
+static bool rtw_is_hi_queue_empty(struct adapter *adapter)
+{
+       return (rtw_read32(adapter, REG_HGQ_INFORMATION) & 0x0000ff00) == 0;
+}
+
 static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
 {
        int cnt = 0;
@@ -1210,12 +1215,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
                return;
 
        if (psta_bmc->sleepq_len == 0) {
-               u8 val = 0;
-
-               /* while ((rtw_read32(padapter, 0x414)&0x00ffff00)!= 0) */
-               /* while ((rtw_read32(padapter, 0x414)&0x0000ff00)!= 0) */
-
-               GetHwReg8188EU(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
+               bool val = rtw_is_hi_queue_empty(padapter);
 
                while (!val) {
                        msleep(100);
@@ -1225,7 +1225,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
                        if (cnt > 10)
                                break;
 
-                       GetHwReg8188EU(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
+                       val = rtw_is_hi_queue_empty(padapter);
                }
 
                if (cnt <= 10) {
index 8c4bc78..611785c 100644 (file)
@@ -1310,9 +1310,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
                        }
                }
                break;
-       case HW_VAR_CHK_HI_QUEUE_EMPTY:
-               *val = ((rtw_read32(Adapter, REG_HGQ_INFORMATION) & 0x0000ff00) == 0) ? true : false;
-               break;
        default:
                break;
        }
index 065fc7b..f0a6d69 100644 (file)
@@ -33,7 +33,6 @@ enum hw_variables {
        HW_VAR_FIFO_CLEARN_UP,
        HW_VAR_RPT_TIMER_SETTING,
        HW_VAR_H2C_MEDIA_STATUS_RPT,
-       HW_VAR_CHK_HI_QUEUE_EMPTY,
 };
 
 enum hal_def_variable {