staging: r8188eu: wifi_error_status is write-only

wifi_error_status in struct sreset_priv is set in a couple of places,
its value is never used.

Remove wifi_error_status itself, the defines for the possible values and
the sreset_set_wifi_error_status function.

Rewrite the if statement in usb_write_port_complete. For purb->status ==
-EPIPE or -EPROTO, nothing should be done.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211024180448.20624-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Martin Kaiser 2021-10-24 20:04:45 +02:00 committed by Greg Kroah-Hartman
parent dae4c880a8
commit 8590f5db39
4 changed files with 2 additions and 29 deletions

View File

@ -9,7 +9,6 @@ void sreset_init_value(struct adapter *padapter)
struct sreset_priv *psrtpriv = &pHalData->srestpriv; struct sreset_priv *psrtpriv = &pHalData->srestpriv;
mutex_init(&psrtpriv->silentreset_mutex); mutex_init(&psrtpriv->silentreset_mutex);
psrtpriv->wifi_error_status = WIFI_STATUS_SUCCESS;
psrtpriv->last_tx_time = 0; psrtpriv->last_tx_time = 0;
psrtpriv->last_tx_complete_time = 0; psrtpriv->last_tx_complete_time = 0;
} }
@ -18,13 +17,6 @@ void sreset_reset_value(struct adapter *padapter)
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter); struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
struct sreset_priv *psrtpriv = &pHalData->srestpriv; struct sreset_priv *psrtpriv = &pHalData->srestpriv;
psrtpriv->wifi_error_status = WIFI_STATUS_SUCCESS;
psrtpriv->last_tx_time = 0; psrtpriv->last_tx_time = 0;
psrtpriv->last_tx_complete_time = 0; psrtpriv->last_tx_complete_time = 0;
} }
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
pHalData->srestpriv.wifi_error_status = status;
}

View File

@ -39,9 +39,6 @@ static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size)
} }
if (status < 0) { if (status < 0) {
GET_HAL_DATA(adapt)->srestpriv.wifi_error_status =
USB_VEN_REQ_CMD_FAIL;
if (rtw_inc_and_chk_continual_urb_error(dvobjpriv)) if (rtw_inc_and_chk_continual_urb_error(dvobjpriv))
adapt->bSurpriseRemoved = true; adapt->bSurpriseRemoved = true;
@ -86,9 +83,6 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
} }
if (status < 0) { if (status < 0) {
GET_HAL_DATA(adapt)->srestpriv.wifi_error_status =
USB_VEN_REQ_CMD_FAIL;
if (rtw_inc_and_chk_continual_urb_error(dvobjpriv)) if (rtw_inc_and_chk_continual_urb_error(dvobjpriv))
adapt->bSurpriseRemoved = true; adapt->bSurpriseRemoved = true;
@ -441,10 +435,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
break; break;
case -EPROTO: case -EPROTO:
case -EOVERFLOW: case -EOVERFLOW:
{
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
haldata->srestpriv.wifi_error_status = USB_READ_PORT_FAIL;
}
precvbuf->reuse = true; precvbuf->reuse = true;
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
break; break;

View File

@ -9,20 +9,13 @@
struct sreset_priv { struct sreset_priv {
struct mutex silentreset_mutex; struct mutex silentreset_mutex;
u8 wifi_error_status;
unsigned long last_tx_time; unsigned long last_tx_time;
unsigned long last_tx_complete_time; unsigned long last_tx_complete_time;
}; };
#include "rtl8188e_hal.h" #include "rtl8188e_hal.h"
#define WIFI_STATUS_SUCCESS 0
#define USB_VEN_REQ_CMD_FAIL BIT(0)
#define USB_READ_PORT_FAIL BIT(1)
#define USB_WRITE_PORT_FAIL BIT(2)
void sreset_init_value(struct adapter *padapter); void sreset_init_value(struct adapter *padapter);
void sreset_reset_value(struct adapter *padapter); void sreset_reset_value(struct adapter *padapter);
void sreset_set_wifi_error_status(struct adapter *padapter, u32 status);
#endif #endif

View File

@ -87,9 +87,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
if (purb->status) { if (purb->status) {
DBG_88E("###=> urb_write_port_complete status(%d)\n", purb->status); DBG_88E("###=> urb_write_port_complete status(%d)\n", purb->status);
if ((purb->status == -EPIPE) || (purb->status == -EPROTO)) { if (purb->status == -EINPROGRESS) {
sreset_set_wifi_error_status(padapter, USB_WRITE_PORT_FAIL);
} else if (purb->status == -EINPROGRESS) {
goto check_completion; goto check_completion;
} else if (purb->status == -ENOENT) { } else if (purb->status == -ENOENT) {
DBG_88E("%s: -ENOENT\n", __func__); DBG_88E("%s: -ENOENT\n", __func__);
@ -100,7 +98,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
} else if (purb->status == -ESHUTDOWN) { } else if (purb->status == -ESHUTDOWN) {
padapter->bDriverStopped = true; padapter->bDriverStopped = true;
goto check_completion; goto check_completion;
} else { } else if ((purb->status != -EPIPE) && (purb->status != -EPROTO)) {
padapter->bSurpriseRemoved = true; padapter->bSurpriseRemoved = true;
DBG_88E("bSurpriseRemoved = true\n"); DBG_88E("bSurpriseRemoved = true\n");