staging: r8188eu: remove HW_VAR_FIFO_CLEARN_UP
authorMichael Straube <straube.linux@gmail.com>
Sat, 9 Apr 2022 12:06:26 +0000 (14:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2022 13:49:05 +0000 (15:49 +0200)
Remove the HW_VAR_FIFO_CLEARN_UP case from SetHwReg8188EU() and move
its functionality to a new static function in os_intfs.c. 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/20220409120627.10633-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_halinit.c
drivers/staging/r8188eu/include/hal_intf.h
drivers/staging/r8188eu/os_dep/os_intfs.c

index e50d47b..62ada17 100644 (file)
@@ -1116,32 +1116,6 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
                        rtl8188e_set_FwPwrMode_cmd(Adapter, psmode);
                }
                break;
-       case HW_VAR_FIFO_CLEARN_UP:
-               {
-                       struct pwrctrl_priv *pwrpriv = &Adapter->pwrctrlpriv;
-                       u8 trycnt = 100;
-
-                       /* pause tx */
-                       rtw_write8(Adapter, REG_TXPAUSE, 0xff);
-
-                       /* keep sn */
-                       Adapter->xmitpriv.nqos_ssn = rtw_read16(Adapter, REG_NQOS_SEQ);
-
-                       if (!pwrpriv->bkeepfwalive) {
-                               /* RX DMA stop */
-                               rtw_write32(Adapter, REG_RXPKT_NUM, (rtw_read32(Adapter, REG_RXPKT_NUM) | RW_RELEASE_EN));
-                               do {
-                                       if (!(rtw_read32(Adapter, REG_RXPKT_NUM) & RXDMA_IDLE))
-                                               break;
-                               } while (trycnt--);
-
-                               /* RQPN Load 0 */
-                               rtw_write16(Adapter, REG_RQPN_NPQ, 0x0);
-                               rtw_write32(Adapter, REG_RQPN, 0x80000000);
-                               mdelay(10);
-                       }
-               }
-               break;
        case HW_VAR_H2C_MEDIA_STATUS_RPT:
                rtl8188e_set_FwMediaStatus_cmd(Adapter, (*(__le16 *)val));
                break;
index 42d5aaf..bbbdcfa 100644 (file)
@@ -21,7 +21,6 @@ enum hw_variables {
        HW_VAR_AC_PARAM_BE,
        HW_VAR_AMPDU_FACTOR,
        HW_VAR_H2C_FW_PWRMODE,
-       HW_VAR_FIFO_CLEARN_UP,
        HW_VAR_H2C_MEDIA_STATUS_RPT,
 };
 
index 390d1cc..891c85b 100644 (file)
@@ -736,9 +736,36 @@ void rtw_ips_pwr_down(struct adapter *padapter)
        padapter->bCardDisableWOHSM = false;
 }
 
+static void rtw_fifo_cleanup(struct adapter *adapter)
+{
+       struct pwrctrl_priv *pwrpriv = &adapter->pwrctrlpriv;
+       u8 trycnt = 100;
+
+       /* pause tx */
+       rtw_write8(adapter, REG_TXPAUSE, 0xff);
+
+       /* keep sn */
+       adapter->xmitpriv.nqos_ssn = rtw_read16(adapter, REG_NQOS_SEQ);
+
+       if (!pwrpriv->bkeepfwalive) {
+               /* RX DMA stop */
+               rtw_write32(adapter, REG_RXPKT_NUM,
+                           (rtw_read32(adapter, REG_RXPKT_NUM) | RW_RELEASE_EN));
+               do {
+                       if (!(rtw_read32(adapter, REG_RXPKT_NUM) & RXDMA_IDLE))
+                               break;
+               } while (trycnt--);
+
+               /* RQPN Load 0 */
+               rtw_write16(adapter, REG_RQPN_NPQ, 0x0);
+               rtw_write32(adapter, REG_RQPN, 0x80000000);
+               mdelay(10);
+       }
+}
+
 void rtw_ips_dev_unload(struct adapter *padapter)
 {
-       SetHwReg8188EU(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);
+       rtw_fifo_cleanup(padapter);
 
        if (padapter->intf_stop)
                padapter->intf_stop(padapter);