2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00

staging: rtl8712: rename bSurpriseRemoved to surprise_removed

- Rename structure field bSurprisedRemoved to surprised_removed to avoid
camelcase. Suggested by checkpatch.
 - Change type to bool as the variable is used as a boolean.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Himadri Pandya 2019-03-03 16:09:14 +05:30 committed by Greg Kroah-Hartman
parent 0ec6fc6f45
commit 5b8d98f171
11 changed files with 41 additions and 42 deletions

View File

@ -146,7 +146,7 @@ struct _adapter {
struct led_priv ledpriv; struct led_priv ledpriv;
struct mp_priv mppriv; struct mp_priv mppriv;
bool driver_stopped; bool driver_stopped;
s32 bSurpriseRemoved; bool surprise_removed;
s32 bSuspended; s32 bSuspended;
u32 IsrContent; u32 IsrContent;
u32 ImrContent; u32 ImrContent;

View File

@ -375,7 +375,7 @@ static int netdev_open(struct net_device *pnetdev)
mutex_lock(&padapter->mutex_start); mutex_lock(&padapter->mutex_start);
if (!padapter->bup) { if (!padapter->bup) {
padapter->driver_stopped = false; padapter->driver_stopped = false;
padapter->bSurpriseRemoved = false; padapter->surprise_removed = false;
padapter->bup = true; padapter->bup = true;
if (rtl871x_hal_init(padapter) != _SUCCESS) if (rtl871x_hal_init(padapter) != _SUCCESS)
goto netdev_open_error; goto netdev_open_error;

View File

@ -317,7 +317,7 @@ int r8712_cmd_thread(void *context)
while (1) { while (1) {
if (wait_for_completion_interruptible(cmd_queue_comp)) if (wait_for_completion_interruptible(cmd_queue_comp))
break; break;
if (padapter->driver_stopped || padapter->bSurpriseRemoved) if (padapter->driver_stopped || padapter->surprise_removed)
break; break;
if (r8712_register_cmd_alive(padapter) != _SUCCESS) if (r8712_register_cmd_alive(padapter) != _SUCCESS)
continue; continue;
@ -369,7 +369,7 @@ _next:
memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
while (check_cmd_fifo(padapter, wr_sz) == _FAIL) { while (check_cmd_fifo(padapter, wr_sz) == _FAIL) {
if (padapter->driver_stopped || if (padapter->driver_stopped ||
padapter->bSurpriseRemoved) padapter->surprise_removed)
break; break;
msleep(100); msleep(100);
continue; continue;

View File

@ -68,7 +68,7 @@ void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{ {
struct intf_hdl *hdl = &adapter->pio_queue->intf; struct intf_hdl *hdl = &adapter->pio_queue->intf;
if (adapter->driver_stopped || adapter->bSurpriseRemoved) if (adapter->driver_stopped || adapter->surprise_removed)
return; return;
hdl->io_ops._read_mem(hdl, addr, cnt, pmem); hdl->io_ops._read_mem(hdl, addr, cnt, pmem);
@ -85,7 +85,7 @@ void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{ {
struct intf_hdl *hdl = &adapter->pio_queue->intf; struct intf_hdl *hdl = &adapter->pio_queue->intf;
if (adapter->driver_stopped || adapter->bSurpriseRemoved) if (adapter->driver_stopped || adapter->surprise_removed)
return; return;
hdl->io_ops._read_port(hdl, addr, cnt, pmem); hdl->io_ops._read_port(hdl, addr, cnt, pmem);

View File

@ -109,7 +109,7 @@ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed)
{ {
u8 LedCfg; u8 LedCfg;
if (padapter->bSurpriseRemoved || padapter->driver_stopped) if (padapter->surprise_removed || padapter->driver_stopped)
return; return;
LedCfg = r8712_read8(padapter, LEDCFG); LedCfg = r8712_read8(padapter, LEDCFG);
switch (pLed->LedPin) { switch (pLed->LedPin) {
@ -137,7 +137,7 @@ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed)
{ {
u8 LedCfg; u8 LedCfg;
if (padapter->bSurpriseRemoved || padapter->driver_stopped) if (padapter->surprise_removed || padapter->driver_stopped)
return; return;
LedCfg = r8712_read8(padapter, LEDCFG); LedCfg = r8712_read8(padapter, LEDCFG);
switch (pLed->LedPin) { switch (pLed->LedPin) {
@ -816,7 +816,7 @@ static void BlinkTimerCallback(struct timer_list *t)
/* This fixed the crash problem on Fedora 12 when trying to do the /* This fixed the crash problem on Fedora 12 when trying to do the
* insmod;ifconfig up;rmmod commands. * insmod;ifconfig up;rmmod commands.
*/ */
if (pLed->padapter->bSurpriseRemoved || pLed->padapter->driver_stopped) if (pLed->padapter->surprise_removed || pLed->padapter->driver_stopped)
return; return;
schedule_work(&pLed->BlinkWorkItem); schedule_work(&pLed->BlinkWorkItem);
} }

View File

@ -542,7 +542,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
/*indicate this recv_frame*/ /*indicate this recv_frame*/
if (!pattrib->amsdu) { if (!pattrib->amsdu) {
if (!padapter->driver_stopped && if (!padapter->driver_stopped &&
!padapter->bSurpriseRemoved) { !padapter->surprise_removed) {
/* indicate this recv_frame */ /* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, r8712_recv_indicatepkt(padapter,
prframe); prframe);
@ -577,7 +577,7 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter,
r8712_wlanhdr_to_ethhdr(prframe); r8712_wlanhdr_to_ethhdr(prframe);
if (pattrib->qos != 1) { if (pattrib->qos != 1) {
if (!padapter->driver_stopped && if (!padapter->driver_stopped &&
!padapter->bSurpriseRemoved) { !padapter->surprise_removed) {
r8712_recv_indicatepkt(padapter, prframe); r8712_recv_indicatepkt(padapter, prframe);
return _SUCCESS; return _SUCCESS;
} else { } else {
@ -626,7 +626,7 @@ void r8712_reordering_ctrl_timeout_handler(void *pcontext)
struct __queue *ppending_recvframe_queue = struct __queue *ppending_recvframe_queue =
&preorder_ctrl->pending_recvframe_queue; &preorder_ctrl->pending_recvframe_queue;
if (padapter->driver_stopped || padapter->bSurpriseRemoved) if (padapter->driver_stopped || padapter->surprise_removed)
return; return;
spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); spin_lock_irqsave(&ppending_recvframe_queue->lock, irql);
r8712_recv_indicatepkts_in_order(padapter, preorder_ctrl, true); r8712_recv_indicatepkts_in_order(padapter, preorder_ctrl, true);
@ -644,14 +644,14 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter,
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) { if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) {
/* including perform A-MPDU Rx Ordering Buffer Control*/ /* including perform A-MPDU Rx Ordering Buffer Control*/
if (!padapter->driver_stopped && if (!padapter->driver_stopped &&
!padapter->bSurpriseRemoved) !padapter->surprise_removed)
return _FAIL; return _FAIL;
} }
} else { /*B/G mode*/ } else { /*B/G mode*/
retval = r8712_wlanhdr_to_ethhdr(prframe); retval = r8712_wlanhdr_to_ethhdr(prframe);
if (retval != _SUCCESS) if (retval != _SUCCESS)
return retval; return retval;
if (!padapter->driver_stopped && !padapter->bSurpriseRemoved) { if (!padapter->driver_stopped && !padapter->surprise_removed) {
/* indicate this recv_frame */ /* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, prframe); r8712_recv_indicatepkt(padapter, prframe);
} else { } else {

View File

@ -37,7 +37,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
{ {
u16 x, mask; u16 x, mask;
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
mask = 0x01 << (count - 1); mask = 0x01 << (count - 1);
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
@ -46,7 +46,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
x &= ~_EEDI; x &= ~_EEDI;
if (data & mask) if (data & mask)
x |= _EEDI; x |= _EEDI;
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
r8712_write8(padapter, EE_9346CR, (u8)x); r8712_write8(padapter, EE_9346CR, (u8)x);
udelay(CLOCK_RATE); udelay(CLOCK_RATE);
@ -54,7 +54,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
down_clk(padapter, &x); down_clk(padapter, &x);
mask >>= 1; mask >>= 1;
} while (mask); } while (mask);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
x &= ~_EEDI; x &= ~_EEDI;
r8712_write8(padapter, EE_9346CR, (u8)x); r8712_write8(padapter, EE_9346CR, (u8)x);
@ -65,7 +65,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
{ {
u16 x, d = 0, i; u16 x, d = 0, i;
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDO | _EEDI); x &= ~(_EEDO | _EEDI);
@ -73,7 +73,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
d <<= 1; d <<= 1;
up_clk(padapter, &x); up_clk(padapter, &x);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDI); x &= ~(_EEDI);
@ -117,17 +117,17 @@ static void eeprom_clean(struct _adapter *padapter)
{ {
u16 x; u16 x;
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
return; return;
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
return; return;
x &= ~(_EECS | _EEDI); x &= ~(_EECS | _EEDI);
r8712_write8(padapter, EE_9346CR, (u8)x); r8712_write8(padapter, EE_9346CR, (u8)x);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
return; return;
up_clk(padapter, &x); up_clk(padapter, &x);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
return; return;
down_clk(padapter, &x); down_clk(padapter, &x);
} }
@ -194,11 +194,11 @@ u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg) /*ReadEEprom*/
tmp8_clk_new = tmp8_clk_ori | 0x20; tmp8_clk_new = tmp8_clk_ori | 0x20;
if (tmp8_clk_new != tmp8_clk_ori) if (tmp8_clk_new != tmp8_clk_ori)
r8712_write8(padapter, 0x10250003, tmp8_clk_new); r8712_write8(padapter, 0x10250003, tmp8_clk_new);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
/* select EEPROM, reset bits, set _EECS */ /* select EEPROM, reset bits, set _EECS */
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
goto out; goto out;
x &= ~(_EEDI | _EEDO | _EESK | _EEM0); x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
x |= _EEM1 | _EECS; x |= _EEM1 | _EECS;
@ -218,4 +218,3 @@ out:
r8712_write8(padapter, 0x102502f1, tmp8_ori); r8712_write8(padapter, 0x102502f1, tmp8_ori);
return data; return data;
} }

View File

@ -174,7 +174,7 @@ sint r8712_if_up(struct _adapter *padapter)
{ {
sint res; sint res;
if (padapter->driver_stopped || padapter->bSurpriseRemoved || if (padapter->driver_stopped || padapter->surprise_removed ||
!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { !check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
res = false; res = false;
} else { } else {
@ -1055,7 +1055,7 @@ void _r8712_join_timeout_handler(struct _adapter *adapter)
unsigned long irqL; unsigned long irqL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
if (adapter->driver_stopped || adapter->bSurpriseRemoved) if (adapter->driver_stopped || adapter->surprise_removed)
return; return;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
@ -1084,7 +1084,7 @@ void r8712_scan_timeout_handler (struct _adapter *adapter)
void _r8712_dhcp_timeout_handler (struct _adapter *adapter) void _r8712_dhcp_timeout_handler (struct _adapter *adapter)
{ {
if (adapter->driver_stopped || adapter->bSurpriseRemoved) if (adapter->driver_stopped || adapter->surprise_removed)
return; return;
if (adapter->pwrctrlpriv.pwr_mode != adapter->registrypriv.power_mgnt) if (adapter->pwrctrlpriv.pwr_mode != adapter->registrypriv.power_mgnt)
r8712_set_ps_mode(adapter, adapter->registrypriv.power_mgnt, r8712_set_ps_mode(adapter, adapter->registrypriv.power_mgnt,

View File

@ -32,7 +32,7 @@ void r8712_set_rpwm(struct _adapter *padapter, u8 val8)
if (pwrpriv->rpwm_retry == 0) if (pwrpriv->rpwm_retry == 0)
return; return;
} }
if (padapter->driver_stopped || padapter->bSurpriseRemoved) if (padapter->driver_stopped || padapter->surprise_removed)
return; return;
rpwm = val8 | pwrpriv->tog; rpwm = val8 | pwrpriv->tog;
switch (val8) { switch (val8) {
@ -117,7 +117,7 @@ static void _rpwm_check_handler (struct _adapter *padapter)
{ {
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
if (padapter->driver_stopped || padapter->bSurpriseRemoved) if (padapter->driver_stopped || padapter->surprise_removed)
return; return;
if (pwrpriv->cpwm != pwrpriv->rpwm) if (pwrpriv->cpwm != pwrpriv->rpwm)
schedule_work(&pwrpriv->rpwm_workitem); schedule_work(&pwrpriv->rpwm_workitem);

View File

@ -271,7 +271,7 @@ static void r8712_usb_dvobj_deinit(struct _adapter *padapter)
void rtl871x_intf_stop(struct _adapter *padapter) void rtl871x_intf_stop(struct _adapter *padapter)
{ {
/*disable_hw_interrupt*/ /*disable_hw_interrupt*/
if (!padapter->bSurpriseRemoved) { if (!padapter->surprise_removed) {
/*device still exists, so driver can do i/o operation /*device still exists, so driver can do i/o operation
* TODO: * TODO:
*/ */
@ -298,7 +298,7 @@ void r871x_dev_unload(struct _adapter *padapter)
r8712_stop_drv_threads(padapter); r8712_stop_drv_threads(padapter);
/*s5.*/ /*s5.*/
if (!padapter->bSurpriseRemoved) { if (!padapter->surprise_removed) {
padapter->hw_init_completed = false; padapter->hw_init_completed = false;
rtl8712_hal_deinit(padapter); rtl8712_hal_deinit(padapter);
} }
@ -600,7 +600,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
/* never exit with a firmware callback pending */ /* never exit with a firmware callback pending */
wait_for_completion(&padapter->rtl8712_fw_ready); wait_for_completion(&padapter->rtl8712_fw_ready);
if (drvpriv.drv_registered) if (drvpriv.drv_registered)
padapter->bSurpriseRemoved = true; padapter->surprise_removed = true;
unregister_netdev(pnetdev); /* will call netdev_close() */ unregister_netdev(pnetdev); /* will call netdev_close() */
flush_scheduled_work(); flush_scheduled_work();
udelay(1); udelay(1);

View File

@ -149,7 +149,7 @@ static void usb_write_mem_complete(struct urb *purb)
if (purb->status == (-ESHUTDOWN)) if (purb->status == (-ESHUTDOWN))
padapter->driver_stopped = true; padapter->driver_stopped = true;
else else
padapter->bSurpriseRemoved = true; padapter->surprise_removed = true;
} }
complete(&pintfpriv->io_retevt_comp); complete(&pintfpriv->io_retevt_comp);
} }
@ -164,7 +164,7 @@ void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
struct usb_device *pusbd = pdvobj->pusbdev; struct usb_device *pusbd = pdvobj->pusbdev;
struct urb *piorw_urb = pintfpriv->piorw_urb; struct urb *piorw_urb = pintfpriv->piorw_urb;
if ((padapter->driver_stopped) || (padapter->bSurpriseRemoved) || if ((padapter->driver_stopped) || (padapter->surprise_removed) ||
(padapter->pwrctrlpriv.pnp_bstop_trx)) (padapter->pwrctrlpriv.pnp_bstop_trx))
return; return;
/* translate DMA FIFO addr to pipehandle */ /* translate DMA FIFO addr to pipehandle */
@ -186,7 +186,7 @@ static void r8712_usb_read_port_complete(struct urb *purb)
struct _adapter *padapter = (struct _adapter *)precvbuf->adapter; struct _adapter *padapter = (struct _adapter *)precvbuf->adapter;
struct recv_priv *precvpriv = &padapter->recvpriv; struct recv_priv *precvpriv = &padapter->recvpriv;
if (padapter->bSurpriseRemoved || padapter->driver_stopped) if (padapter->surprise_removed || padapter->driver_stopped)
return; return;
if (purb->status == 0) { /* SUCCESS */ if (purb->status == 0) { /* SUCCESS */
if ((purb->actual_length > (MAX_RECVBUF_SZ)) || if ((purb->actual_length > (MAX_RECVBUF_SZ)) ||
@ -254,7 +254,7 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
struct recv_priv *precvpriv = &adapter->recvpriv; struct recv_priv *precvpriv = &adapter->recvpriv;
struct usb_device *pusbd = pdvobj->pusbdev; struct usb_device *pusbd = pdvobj->pusbdev;
if (adapter->driver_stopped || adapter->bSurpriseRemoved || if (adapter->driver_stopped || adapter->surprise_removed ||
adapter->pwrctrlpriv.pnp_bstop_trx || !precvbuf) adapter->pwrctrlpriv.pnp_bstop_trx || !precvbuf)
return _FAIL; return _FAIL;
r8712_init_recvbuf(adapter, precvbuf); r8712_init_recvbuf(adapter, precvbuf);
@ -315,8 +315,8 @@ void r8712_xmit_bh(void *priv)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
if (padapter->driver_stopped || if (padapter->driver_stopped ||
padapter->bSurpriseRemoved) { padapter->surprise_removed) {
netdev_err(padapter->pnetdev, "xmit_bh => driver_stopped or bSurpriseRemoved\n"); netdev_err(padapter->pnetdev, "xmit_bh => driver_stopped or surprise_removed\n");
return; return;
} }
ret = r8712_xmitframe_complete(padapter, pxmitpriv, NULL); ret = r8712_xmitframe_complete(padapter, pxmitpriv, NULL);
@ -360,7 +360,7 @@ static void usb_write_port_complete(struct urb *purb)
break; break;
} }
} }
if (padapter->bSurpriseRemoved) if (padapter->surprise_removed)
return; return;
switch (purb->status) { switch (purb->status) {
case 0: case 0:
@ -390,7 +390,7 @@ u32 r8712_usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
struct usb_device *pusbd = pdvobj->pusbdev; struct usb_device *pusbd = pdvobj->pusbdev;
struct pkt_attrib *pattrib = &pxmitframe->attrib; struct pkt_attrib *pattrib = &pxmitframe->attrib;
if ((padapter->driver_stopped) || (padapter->bSurpriseRemoved) || if ((padapter->driver_stopped) || (padapter->surprise_removed) ||
(padapter->pwrctrlpriv.pnp_bstop_trx)) (padapter->pwrctrlpriv.pnp_bstop_trx))
return _FAIL; return _FAIL;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {