From: Michael Straube Date: Sat, 9 Apr 2022 12:06:26 +0000 (+0200) Subject: staging: r8188eu: remove HW_VAR_FIFO_CLEARN_UP X-Git-Tag: v6.6.17~7348^2~187 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c05493bcfb522326867d99222a044a589272c0f;p=platform%2Fkernel%2Flinux-rpi.git staging: r8188eu: remove HW_VAR_FIFO_CLEARN_UP 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 Link: https://lore.kernel.org/r/20220409120627.10633-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index e50d47b..62ada17 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -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; diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h index 42d5aaf..bbbdcfa 100644 --- a/drivers/staging/r8188eu/include/hal_intf.h +++ b/drivers/staging/r8188eu/include/hal_intf.h @@ -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, }; diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 390d1cc..891c85b 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -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);