Commit 1ca96884 authored by Luis de Bethencourt's avatar Luis de Bethencourt Committed by Greg Kroah-Hartman

staging: rtl8712: Remove boolean comparisons

Boolean tests do not need explicit comparison to true or false.
Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cf31378b
...@@ -177,7 +177,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p) ...@@ -177,7 +177,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
struct _adapter *padapter = netdev_priv(pnetdev); struct _adapter *padapter = netdev_priv(pnetdev);
struct sockaddr *addr = p; struct sockaddr *addr = p;
if (padapter->bup == false) if (!padapter->bup)
ether_addr_copy(pnetdev->dev_addr, addr->sa_data); ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
return 0; return 0;
} }
...@@ -384,7 +384,7 @@ static int netdev_open(struct net_device *pnetdev) ...@@ -384,7 +384,7 @@ static int netdev_open(struct net_device *pnetdev)
struct _adapter *padapter = netdev_priv(pnetdev); struct _adapter *padapter = netdev_priv(pnetdev);
mutex_lock(&padapter->mutex_start); mutex_lock(&padapter->mutex_start);
if (padapter->bup == false) { if (!padapter->bup) {
padapter->bDriverStopped = false; padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false; padapter->bSurpriseRemoved = false;
padapter->bup = true; padapter->bup = true;
......
...@@ -85,7 +85,7 @@ static void query_fw_rx_phy_status(struct _adapter *padapter) ...@@ -85,7 +85,7 @@ static void query_fw_rx_phy_status(struct _adapter *padapter)
u32 val32 = 0; u32 val32 = 0;
int pollingcnts = 50; int pollingcnts = 50;
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == true) { if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
r8712_write32(padapter, IOCMD_CTRL_REG, 0xf4000001); r8712_write32(padapter, IOCMD_CTRL_REG, 0xf4000001);
msleep(100); msleep(100);
/* Wait FW complete IO Cmd */ /* Wait FW complete IO Cmd */
...@@ -324,8 +324,7 @@ int r8712_cmd_thread(void *context) ...@@ -324,8 +324,7 @@ int r8712_cmd_thread(void *context)
while (1) { while (1) {
if ((_down_sema(&(pcmdpriv->cmd_queue_sema))) == _FAIL) if ((_down_sema(&(pcmdpriv->cmd_queue_sema))) == _FAIL)
break; break;
if ((padapter->bDriverStopped == true) || if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
(padapter->bSurpriseRemoved == true))
break; break;
if (r8712_register_cmd_alive(padapter) != _SUCCESS) if (r8712_register_cmd_alive(padapter) != _SUCCESS)
continue; continue;
...@@ -375,8 +374,8 @@ int r8712_cmd_thread(void *context) ...@@ -375,8 +374,8 @@ int r8712_cmd_thread(void *context)
pcmdbuf += 2; /* 8 bytes alignment */ pcmdbuf += 2; /* 8 bytes alignment */
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->bDriverStopped == true) || if (padapter->bDriverStopped ||
(padapter->bSurpriseRemoved == true)) padapter->bSurpriseRemoved)
break; break;
msleep(100); msleep(100);
continue; continue;
......
...@@ -39,7 +39,7 @@ static void efuse_reg_ctrl(struct _adapter *padapter, u8 bPowerOn) ...@@ -39,7 +39,7 @@ static void efuse_reg_ctrl(struct _adapter *padapter, u8 bPowerOn)
{ {
u8 tmpu8 = 0; u8 tmpu8 = 0;
if (true == bPowerOn) { if (bPowerOn) {
/* -----------------e-fuse pwr & clk reg ctrl --------------- /* -----------------e-fuse pwr & clk reg ctrl ---------------
* Enable LDOE25 Macro Block * Enable LDOE25 Macro Block
*/ */
...@@ -127,7 +127,7 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr, ...@@ -127,7 +127,7 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr,
tmpv8 = ((u8)((addr >> 8) & 0x03)) | tmpv8 = ((u8)((addr >> 8) & 0x03)) |
(r8712_read8(padapter, EFUSE_CTRL + 2) & 0xFC); (r8712_read8(padapter, EFUSE_CTRL + 2) & 0xFC);
r8712_write8(padapter, EFUSE_CTRL+2, tmpv8); r8712_write8(padapter, EFUSE_CTRL+2, tmpv8);
if (true == bRead) { if (bRead) {
r8712_write8(padapter, EFUSE_CTRL+3, 0x72); /* read cmd */ r8712_write8(padapter, EFUSE_CTRL+3, 0x72); /* read cmd */
while (!(0x80 & r8712_read8(padapter, EFUSE_CTRL+3)) && while (!(0x80 & r8712_read8(padapter, EFUSE_CTRL+3)) &&
(tmpidx < 100)) (tmpidx < 100))
...@@ -158,7 +158,7 @@ static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty) ...@@ -158,7 +158,7 @@ static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty)
u8 value, ret = true; u8 value, ret = true;
/* read one byte to check if E-Fuse is empty */ /* read one byte to check if E-Fuse is empty */
if (efuse_one_byte_rw(padapter, true, 0, &value) == true) { if (efuse_one_byte_rw(padapter, true, 0, &value)) {
if (0xFF == value) if (0xFF == value)
*empty = true; *empty = true;
else else
...@@ -250,8 +250,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data) ...@@ -250,8 +250,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
return false; return false;
memset(data, 0xFF, sizeof(u8)*PGPKT_DATA_SIZE); memset(data, 0xFF, sizeof(u8)*PGPKT_DATA_SIZE);
while (efuse_addr < efuse_available_max_size) { while (efuse_addr < efuse_available_max_size) {
if (efuse_one_byte_read(padapter, efuse_addr, &efuse_data) == if (efuse_one_byte_read(padapter, efuse_addr, &efuse_data)) {
true) {
if (efuse_data == 0xFF) if (efuse_data == 0xFF)
break; break;
hoffset = (efuse_data >> 4) & 0x0F; hoffset = (efuse_data >> 4) & 0x0F;
...@@ -262,8 +261,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data) ...@@ -262,8 +261,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
for (tmpidx = 0; tmpidx < word_cnts * 2; for (tmpidx = 0; tmpidx < word_cnts * 2;
tmpidx++) { tmpidx++) {
if (efuse_one_byte_read(padapter, if (efuse_one_byte_read(padapter,
efuse_addr+1+tmpidx, &efuse_data) == efuse_addr+1+tmpidx, &efuse_data)) {
true) {
tmpdata[tmpidx] = efuse_data; tmpdata[tmpidx] = efuse_data;
} else } else
ret = false; ret = false;
...@@ -295,7 +293,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr) ...@@ -295,7 +293,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
/* retrieve original data */ /* retrieve original data */
addr = 0; addr = 0;
while (addr < header_addr) { while (addr < header_addr) {
if (efuse_one_byte_read(padapter, addr++, &value) == false) { if (!efuse_one_byte_read(padapter, addr++, &value)) {
ret = false; ret = false;
break; break;
} }
...@@ -310,14 +308,14 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr) ...@@ -310,14 +308,14 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
if (BIT(i) & pkt.word_en) { if (BIT(i) & pkt.word_en) {
if (efuse_one_byte_read( if (efuse_one_byte_read(
padapter, addr, padapter, addr,
&value) == true) &value))
pkt.data[i*2] = value; pkt.data[i*2] = value;
else else
return false; return false;
if (efuse_one_byte_read( if (efuse_one_byte_read(
padapter, padapter,
addr + 1, addr + 1,
&value) == true) &value))
pkt.data[i*2 + 1] = pkt.data[i*2 + 1] =
value; value;
else else
...@@ -337,8 +335,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr) ...@@ -337,8 +335,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
efuse_one_byte_write(padapter, addr+1, efuse_one_byte_write(padapter, addr+1,
pkt.data[i*2 + 1]); pkt.data[i*2 + 1]);
/* additional check */ /* additional check */
if (efuse_one_byte_read(padapter, addr, &value) if (!efuse_one_byte_read(padapter, addr, &value))
== false)
ret = false; ret = false;
else if (pkt.data[i*2] != value) { else if (pkt.data[i*2] != value) {
ret = false; ret = false;
...@@ -346,8 +343,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr) ...@@ -346,8 +343,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
efuse_one_byte_write(padapter, addr, efuse_one_byte_write(padapter, addr,
pkt.data[i * 2]); pkt.data[i * 2]);
} }
if (efuse_one_byte_read(padapter, addr+1, &value) == if (!efuse_one_byte_read(padapter, addr+1, &value))
false)
ret = false; ret = false;
else if (pkt.data[i*2 + 1] != value) { else if (pkt.data[i*2 + 1] != value) {
ret = false; ret = false;
...@@ -388,8 +384,8 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset, ...@@ -388,8 +384,8 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
efuse_one_byte_write(padapter, efuse_addr, pg_header); /*hdr*/ efuse_one_byte_write(padapter, efuse_addr, pg_header); /*hdr*/
sub_repeat = 0; sub_repeat = 0;
/* check if what we read is what we write */ /* check if what we read is what we write */
while (efuse_one_byte_read(padapter, efuse_addr, while (!efuse_one_byte_read(padapter, efuse_addr,
&efuse_data) == false) { &efuse_data)) {
if (++sub_repeat > _REPEAT_THRESHOLD_) { if (++sub_repeat > _REPEAT_THRESHOLD_) {
bResult = false; /* continue to blind write */ bResult = false; /* continue to blind write */
break; /* continue to blind write */ break; /* continue to blind write */
...@@ -406,8 +402,9 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset, ...@@ -406,8 +402,9 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
efuse_one_byte_write(padapter, efuse_one_byte_write(padapter,
efuse_addr + i, efuse_addr + i,
*(data + i)); *(data + i));
if (efuse_one_byte_read(padapter, if (!efuse_one_byte_read(padapter,
efuse_addr + i, &efuse_data) == false) efuse_addr + i,
&efuse_data))
bResult = false; bResult = false;
else if (*(data+i) != efuse_data) /* fail */ else if (*(data+i) != efuse_data) /* fail */
bResult = false; bResult = false;
...@@ -437,10 +434,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr, ...@@ -437,10 +434,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr,
if (start_addr > EFUSE_MAX_SIZE) if (start_addr > EFUSE_MAX_SIZE)
return false; return false;
if ((bRead == false) && ((start_addr + cnts) > if (!bRead && ((start_addr + cnts) >
efuse_available_max_size)) efuse_available_max_size))
return false; return false;
if ((false == bRead) && (r8712_efuse_reg_init(padapter) == false)) if (!bRead && !r8712_efuse_reg_init(padapter))
return false; return false;
/* -----------------e-fuse one byte read / write ---------------------*/ /* -----------------e-fuse one byte read / write ---------------------*/
for (i = 0; i < cnts; i++) { for (i = 0; i < cnts; i++) {
...@@ -450,10 +447,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr, ...@@ -450,10 +447,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr,
} }
res = efuse_one_byte_rw(padapter, bRead, start_addr + i, res = efuse_one_byte_rw(padapter, bRead, start_addr + i,
data + i); data + i);
if ((false == bRead) && (false == res)) if (!bRead && !res)
break; break;
} }
if (false == bRead) if (!bRead)
r8712_efuse_reg_uninit(padapter); r8712_efuse_reg_uninit(padapter);
return res; return res;
} }
...@@ -466,8 +463,7 @@ u8 r8712_efuse_map_read(struct _adapter *padapter, u16 addr, u16 cnts, u8 *data) ...@@ -466,8 +463,7 @@ u8 r8712_efuse_map_read(struct _adapter *padapter, u16 addr, u16 cnts, u8 *data)
if ((addr + cnts) > EFUSE_MAP_MAX_SIZE) if ((addr + cnts) > EFUSE_MAP_MAX_SIZE)
return false; return false;
if ((efuse_is_empty(padapter, &offset) == true) && (offset == if (efuse_is_empty(padapter, &offset) && offset) {
true)) {
for (i = 0; i < cnts; i++) for (i = 0; i < cnts; i++)
data[i] = 0xFF; data[i] = 0xFF;
return ret; return ret;
...@@ -504,13 +500,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts, ...@@ -504,13 +500,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
empty = r8712_read8(padapter, EFUSE_CLK_CTRL); empty = r8712_read8(padapter, EFUSE_CLK_CTRL);
if (empty != 0x03) if (empty != 0x03)
return false; return false;
if (efuse_is_empty(padapter, &empty) == true) { if (efuse_is_empty(padapter, &empty)) {
if (true == empty) if (empty)
memset(pktdata, 0xFF, PGPKT_DATA_SIZE); memset(pktdata, 0xFF, PGPKT_DATA_SIZE);
} else } else
return false; return false;
offset = (addr >> 3) & 0xF; offset = (addr >> 3) & 0xF;
if (empty == false) if (!empty)
if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata)) if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata))
return false; return false;
word_en = 0xF; word_en = 0xF;
...@@ -554,13 +550,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts, ...@@ -554,13 +550,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
} }
if (word_en != 0xF) if (word_en != 0xF)
if (r8712_efuse_pg_packet_write(padapter, offset, if (!r8712_efuse_pg_packet_write(padapter, offset,
word_en, newdata) == false) word_en, newdata))
return false; return false;
if (idx == cnts) if (idx == cnts)
break; break;
offset++; offset++;
if (empty == false) if (!empty)
if (!r8712_efuse_pg_packet_read(padapter, offset, if (!r8712_efuse_pg_packet_read(padapter, offset,
pktdata)) pktdata))
return false; return false;
......
...@@ -102,8 +102,7 @@ void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem) ...@@ -102,8 +102,7 @@ void r8712_read_mem(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
u8 *pmem); u8 *pmem);
if ((adapter->bDriverStopped == true) || if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
(adapter->bSurpriseRemoved == true))
return; return;
_read_mem = pintfhdl->io_ops._read_mem; _read_mem = pintfhdl->io_ops._read_mem;
_read_mem(pintfhdl, addr, cnt, pmem); _read_mem(pintfhdl, addr, cnt, pmem);
...@@ -127,8 +126,7 @@ void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem) ...@@ -127,8 +126,7 @@ void r8712_read_port(struct _adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
u8 *pmem); u8 *pmem);
if ((adapter->bDriverStopped == true) || if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
(adapter->bSurpriseRemoved == true))
return; return;
_read_port = pintfhdl->io_ops._read_port; _read_port = pintfhdl->io_ops._read_port;
_read_port(pintfhdl, addr, cnt, pmem); _read_port(pintfhdl, addr, cnt, pmem);
......
...@@ -122,8 +122,7 @@ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed) ...@@ -122,8 +122,7 @@ static void SwLedOn(struct _adapter *padapter, struct LED_871x *pLed)
{ {
u8 LedCfg; u8 LedCfg;
if ((padapter->bSurpriseRemoved == true) || if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
(padapter->bDriverStopped == true))
return; return;
LedCfg = r8712_read8(padapter, LEDCFG); LedCfg = r8712_read8(padapter, LEDCFG);
switch (pLed->LedPin) { switch (pLed->LedPin) {
...@@ -151,8 +150,7 @@ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed) ...@@ -151,8 +150,7 @@ static void SwLedOff(struct _adapter *padapter, struct LED_871x *pLed)
{ {
u8 LedCfg; u8 LedCfg;
if ((padapter->bSurpriseRemoved == true) || if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
(padapter->bDriverStopped == true))
return; return;
LedCfg = r8712_read8(padapter, LEDCFG); LedCfg = r8712_read8(padapter, LEDCFG);
switch (pLed->LedPin) { switch (pLed->LedPin) {
...@@ -222,11 +220,11 @@ static void SwLedBlink(struct LED_871x *pLed) ...@@ -222,11 +220,11 @@ static void SwLedBlink(struct LED_871x *pLed)
bStopBlinking = true; bStopBlinking = true;
break; break;
case LED_BLINK_StartToBlink: case LED_BLINK_StartToBlink:
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
(pmlmepriv->fw_state & WIFI_STATION_STATE)) (pmlmepriv->fw_state & WIFI_STATION_STATE))
bStopBlinking = true; bStopBlinking = true;
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
((pmlmepriv->fw_state & WIFI_ADHOC_STATE) || ((pmlmepriv->fw_state & WIFI_ADHOC_STATE) ||
(pmlmepriv->fw_state & WIFI_ADHOC_MASTER_STATE))) (pmlmepriv->fw_state & WIFI_ADHOC_MASTER_STATE)))
bStopBlinking = true; bStopBlinking = true;
else if (pLed->BlinkTimes == 0) else if (pLed->BlinkTimes == 0)
...@@ -241,11 +239,10 @@ static void SwLedBlink(struct LED_871x *pLed) ...@@ -241,11 +239,10 @@ static void SwLedBlink(struct LED_871x *pLed)
break; break;
} }
if (bStopBlinking) { if (bStopBlinking) {
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
(pLed->bLedOn == false)) !pLed->bLedOn)
SwLedOn(padapter, pLed); SwLedOn(padapter, pLed);
else if ((check_fwstate(pmlmepriv, _FW_LINKED) == else if (check_fwstate(pmlmepriv, _FW_LINKED) && pLed->bLedOn)
true) && pLed->bLedOn == true)
SwLedOff(padapter, pLed); SwLedOff(padapter, pLed);
pLed->BlinkTimes = 0; pLed->BlinkTimes = 0;
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
...@@ -296,7 +293,7 @@ static void SwLedBlink1(struct LED_871x *pLed) ...@@ -296,7 +293,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
else else
SwLedOff(padapter, pLed); SwLedOff(padapter, pLed);
if (peeprompriv->CustomerID == RT_CID_DEFAULT) { if (peeprompriv->CustomerID == RT_CID_DEFAULT) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
if (!pLed1->bSWLedCtrl) { if (!pLed1->bSWLedCtrl) {
SwLedOn(padapter, pLed1); SwLedOn(padapter, pLed1);
pLed1->bSWLedCtrl = true; pLed1->bSWLedCtrl = true;
...@@ -332,7 +329,7 @@ static void SwLedBlink1(struct LED_871x *pLed) ...@@ -332,7 +329,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->bLedLinkBlinkInProgress = true; pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL; pLed->CurrLedState = LED_BLINK_NORMAL;
if (pLed->bLedOn) if (pLed->bLedOn)
...@@ -366,7 +363,7 @@ static void SwLedBlink1(struct LED_871x *pLed) ...@@ -366,7 +363,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->bLedLinkBlinkInProgress = true; pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL; pLed->CurrLedState = LED_BLINK_NORMAL;
if (pLed->bLedOn) if (pLed->bLedOn)
...@@ -446,7 +443,7 @@ static void SwLedBlink2(struct LED_871x *pLed) ...@@ -446,7 +443,7 @@ static void SwLedBlink2(struct LED_871x *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->CurrLedState = LED_ON; pLed->CurrLedState = LED_ON;
pLed->BlinkingLedState = LED_ON; pLed->BlinkingLedState = LED_ON;
SwLedOn(padapter, pLed); SwLedOn(padapter, pLed);
...@@ -470,7 +467,7 @@ static void SwLedBlink2(struct LED_871x *pLed) ...@@ -470,7 +467,7 @@ static void SwLedBlink2(struct LED_871x *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->CurrLedState = LED_ON; pLed->CurrLedState = LED_ON;
pLed->BlinkingLedState = LED_ON; pLed->BlinkingLedState = LED_ON;
SwLedOn(padapter, pLed); SwLedOn(padapter, pLed);
...@@ -512,7 +509,7 @@ static void SwLedBlink3(struct LED_871x *pLed) ...@@ -512,7 +509,7 @@ static void SwLedBlink3(struct LED_871x *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->CurrLedState = LED_ON; pLed->CurrLedState = LED_ON;
pLed->BlinkingLedState = LED_ON; pLed->BlinkingLedState = LED_ON;
if (!pLed->bLedOn) if (!pLed->bLedOn)
...@@ -538,7 +535,7 @@ static void SwLedBlink3(struct LED_871x *pLed) ...@@ -538,7 +535,7 @@ static void SwLedBlink3(struct LED_871x *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->CurrLedState = LED_ON; pLed->CurrLedState = LED_ON;
pLed->BlinkingLedState = LED_ON; pLed->BlinkingLedState = LED_ON;
if (!pLed->bLedOn) if (!pLed->bLedOn)
...@@ -827,8 +824,7 @@ static void BlinkTimerCallback(unsigned long data) ...@@ -827,8 +824,7 @@ static void BlinkTimerCallback(unsigned long data)
/* 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 == true) || if (pLed->padapter->bSurpriseRemoved || pLed->padapter->bDriverStopped)
(pLed->padapter->bDriverStopped == true))
return; return;
schedule_work(&pLed->BlinkWorkItem); schedule_work(&pLed->BlinkWorkItem);
} }
...@@ -893,15 +889,15 @@ static void SwLedControlMode1(struct _adapter *padapter, ...@@ -893,15 +889,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
switch (LedAction) { switch (LedAction) {
case LED_CTL_START_TO_LINK: case LED_CTL_START_TO_LINK:
case LED_CTL_NO_LINK: case LED_CTL_NO_LINK:
if (pLed->bLedNoLinkBlinkInProgress == false) { if (!pLed->bLedNoLinkBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedLinkBlinkInProgress == true) { if (pLed->bLedLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -916,15 +912,15 @@ static void SwLedControlMode1(struct _adapter *padapter, ...@@ -916,15 +912,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
} }
break; break;
case LED_CTL_LINK: case LED_CTL_LINK:
if (pLed->bLedLinkBlinkInProgress == false) { if (!pLed->bLedLinkBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -939,21 +935,21 @@ static void SwLedControlMode1(struct _adapter *padapter, ...@@ -939,21 +935,21 @@ static void SwLedControlMode1(struct _adapter *padapter,
} }
break; break;
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if ((psitesurveyctrl->traffic_busy) && if (psitesurveyctrl->traffic_busy &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) check_fwstate(pmlmepriv, _FW_LINKED))
; /* dummy branch */ ; /* dummy branch */
else if (pLed->bLedScanBlinkInProgress == false) { else if (!pLed->bLedScanBlinkInProgress) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedLinkBlinkInProgress == true) { if (pLed->bLedLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -970,15 +966,15 @@ static void SwLedControlMode1(struct _adapter *padapter, ...@@ -970,15 +966,15 @@ static void SwLedControlMode1(struct _adapter *padapter,
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if (pLed->bLedBlinkInProgress == false) { if (!pLed->bLedBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedLinkBlinkInProgress == true) { if (pLed->bLedLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false;
} }
...@@ -996,20 +992,20 @@ static void SwLedControlMode1(struct _adapter *padapter, ...@@ -996,20 +992,20 @@ static void SwLedControlMode1(struct _adapter *padapter,
case LED_CTL_START_WPS: /*wait until xinpin finish */ case LED_CTL_START_WPS: /*wait until xinpin finish */
case LED_CTL_START_WPS_BOTTON: case LED_CTL_START_WPS_BOTTON:
if (pLed->bLedWPSBlinkInProgress == false) { if (!pLed->bLedWPSBlinkInProgress) {
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedLinkBlinkInProgress == true) { if (pLed->bLedLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
if (pLed->bLedScanBlinkInProgress == true) { if (pLed->bLedScanBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedScanBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false;
} }
...@@ -1024,19 +1020,19 @@ static void SwLedControlMode1(struct _adapter *padapter, ...@@ -1024,19 +1020,19 @@ static void SwLedControlMode1(struct _adapter *padapter,
} }
break; break;
case LED_CTL_STOP_WPS: case LED_CTL_STOP_WPS:
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedLinkBlinkInProgress == true) { if (pLed->bLedLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedLinkBlinkInProgress = false; pLed->bLedLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
if (pLed->bLedScanBlinkInProgress == true) { if (pLed->bLedScanBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedScanBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false;
} }
...@@ -1111,11 +1107,11 @@ static void SwLedControlMode2(struct _adapter *padapter, ...@@ -1111,11 +1107,11 @@ static void SwLedControlMode2(struct _adapter *padapter,
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if (pmlmepriv->sitesurveyctrl.traffic_busy) if (pmlmepriv->sitesurveyctrl.traffic_busy)
; /* dummy branch */ ; /* dummy branch */
else if (pLed->bLedScanBlinkInProgress == false) { else if (!pLed->bLedScanBlinkInProgress) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -1133,8 +1129,8 @@ static void SwLedControlMode2(struct _adapter *padapter, ...@@ -1133,8 +1129,8 @@ static void SwLedControlMode2(struct _adapter *padapter,
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if ((pLed->bLedBlinkInProgress == false) && if (!pLed->bLedBlinkInProgress &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
...@@ -1168,12 +1164,12 @@ static void SwLedControlMode2(struct _adapter *padapter, ...@@ -1168,12 +1164,12 @@ static void SwLedControlMode2(struct _adapter *padapter,
case LED_CTL_START_WPS: /*wait until xinpin finish*/ case LED_CTL_START_WPS: /*wait until xinpin finish*/
case LED_CTL_START_WPS_BOTTON: case LED_CTL_START_WPS_BOTTON:
if (pLed->bLedWPSBlinkInProgress == false) { if (!pLed->bLedWPSBlinkInProgress) {
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
if (pLed->bLedScanBlinkInProgress == true) { if (pLed->bLedScanBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedScanBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false;
} }
...@@ -1244,10 +1240,10 @@ static void SwLedControlMode3(struct _adapter *padapter, ...@@ -1244,10 +1240,10 @@ static void SwLedControlMode3(struct _adapter *padapter,
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if (pmlmepriv->sitesurveyctrl.traffic_busy) if (pmlmepriv->sitesurveyctrl.traffic_busy)
; /* dummy branch */ ; /* dummy branch */
else if (pLed->bLedScanBlinkInProgress == false) { else if (!pLed->bLedScanBlinkInProgress) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -1264,8 +1260,8 @@ static void SwLedControlMode3(struct _adapter *padapter, ...@@ -1264,8 +1260,8 @@ static void SwLedControlMode3(struct _adapter *padapter,
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if ((pLed->bLedBlinkInProgress == false) && if (!pLed->bLedBlinkInProgress &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
...@@ -1298,12 +1294,12 @@ static void SwLedControlMode3(struct _adapter *padapter, ...@@ -1298,12 +1294,12 @@ static void SwLedControlMode3(struct _adapter *padapter,
break; break;
case LED_CTL_START_WPS: /* wait until xinpin finish */ case LED_CTL_START_WPS: /* wait until xinpin finish */
case LED_CTL_START_WPS_BOTTON: case LED_CTL_START_WPS_BOTTON:
if (pLed->bLedWPSBlinkInProgress == false) { if (!pLed->bLedWPSBlinkInProgress) {
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
if (pLed->bLedScanBlinkInProgress == true) { if (pLed->bLedScanBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedScanBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false;
} }
...@@ -1395,15 +1391,15 @@ static void SwLedControlMode4(struct _adapter *padapter, ...@@ -1395,15 +1391,15 @@ static void SwLedControlMode4(struct _adapter *padapter,
mod_timer(&pLed->BlinkTimer, mod_timer(&pLed->BlinkTimer,
jiffies + msecs_to_jiffies(0)); jiffies + msecs_to_jiffies(0));
} }
if (pLed->bLedStartToLinkBlinkInProgress == false) { if (!pLed->bLedStartToLinkBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
...@@ -1434,11 +1430,11 @@ static void SwLedControlMode4(struct _adapter *padapter, ...@@ -1434,11 +1430,11 @@ static void SwLedControlMode4(struct _adapter *padapter,
jiffies + msecs_to_jiffies(0)); jiffies + msecs_to_jiffies(0));
} }
} }
if (pLed->bLedNoLinkBlinkInProgress == false) { if (!pLed->bLedNoLinkBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -1453,17 +1449,17 @@ static void SwLedControlMode4(struct _adapter *padapter, ...@@ -1453,17 +1449,17 @@ static void SwLedControlMode4(struct _adapter *padapter,
} }
break; break;
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if ((pmlmepriv->sitesurveyctrl.traffic_busy) && if (pmlmepriv->sitesurveyctrl.traffic_busy &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) check_fwstate(pmlmepriv, _FW_LINKED))
; ;
else if (pLed->bLedScanBlinkInProgress == false) { else if (!pLed->bLedScanBlinkInProgress) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -1480,11 +1476,11 @@ static void SwLedControlMode4(struct _adapter *padapter, ...@@ -1480,11 +1476,11 @@ static void SwLedControlMode4(struct _adapter *padapter,
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if (pLed->bLedBlinkInProgress == false) { if (!pLed->bLedBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK || if (pLed->CurrLedState == LED_SCAN_BLINK ||
IS_LED_WPS_BLINKING(pLed)) IS_LED_WPS_BLINKING(pLed))
return; return;
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
...@@ -1510,16 +1506,16 @@ static void SwLedControlMode4(struct _adapter *padapter, ...@@ -1510,16 +1506,16 @@ static void SwLedControlMode4(struct _adapter *padapter,
mod_timer(&pLed->BlinkTimer, mod_timer(&pLed->BlinkTimer,
jiffies + msecs_to_jiffies(0)); jiffies + msecs_to_jiffies(0));
} }
if (pLed->bLedWPSBlinkInProgress == false) { if (!pLed->bLedWPSBlinkInProgress) {
if (pLed->bLedNoLinkBlinkInProgress == true) { if (pLed->bLedNoLinkBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedNoLinkBlinkInProgress = false; pLed->bLedNoLinkBlinkInProgress = false;
} }
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
if (pLed->bLedScanBlinkInProgress == true) { if (pLed->bLedScanBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedScanBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false;
} }
...@@ -1666,11 +1662,11 @@ static void SwLedControlMode5(struct _adapter *padapter, ...@@ -1666,11 +1662,11 @@ static void SwLedControlMode5(struct _adapter *padapter,
jiffies + msecs_to_jiffies(0)); jiffies + msecs_to_jiffies(0));
break; break;
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if ((pmlmepriv->sitesurveyctrl.traffic_busy) && if (pmlmepriv->sitesurveyctrl.traffic_busy &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) check_fwstate(pmlmepriv, _FW_LINKED))
; /* dummy branch */ ; /* dummy branch */
else if (pLed->bLedScanBlinkInProgress == false) { else if (!pLed->bLedScanBlinkInProgress) {
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -1687,7 +1683,7 @@ static void SwLedControlMode5(struct _adapter *padapter, ...@@ -1687,7 +1683,7 @@ static void SwLedControlMode5(struct _adapter *padapter,
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if (pLed->bLedBlinkInProgress == false) { if (!pLed->bLedBlinkInProgress) {
if (pLed->CurrLedState == LED_SCAN_BLINK) if (pLed->CurrLedState == LED_SCAN_BLINK)
return; return;
pLed->bLedBlinkInProgress = true; pLed->bLedBlinkInProgress = true;
...@@ -1737,8 +1733,8 @@ static void SwLedControlMode6(struct _adapter *padapter, ...@@ -1737,8 +1733,8 @@ static void SwLedControlMode6(struct _adapter *padapter,
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if (pLed->bLedBlinkInProgress == false && if (!pLed->bLedBlinkInProgress &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
return; return;
pLed->bLedBlinkInProgress = true; pLed->bLedBlinkInProgress = true;
...@@ -1754,8 +1750,8 @@ static void SwLedControlMode6(struct _adapter *padapter, ...@@ -1754,8 +1750,8 @@ static void SwLedControlMode6(struct _adapter *padapter,
break; break;
case LED_CTL_START_WPS: /*wait until xinpin finish*/ case LED_CTL_START_WPS: /*wait until xinpin finish*/
case LED_CTL_START_WPS_BOTTON: case LED_CTL_START_WPS_BOTTON:
if (pLed->bLedWPSBlinkInProgress == false) { if (!pLed->bLedWPSBlinkInProgress) {
if (pLed->bLedBlinkInProgress == true) { if (pLed->bLedBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedBlinkInProgress = false; pLed->bLedBlinkInProgress = false;
} }
...@@ -1805,7 +1801,7 @@ void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction) ...@@ -1805,7 +1801,7 @@ void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction)
{ {
struct led_priv *ledpriv = &(padapter->ledpriv); struct led_priv *ledpriv = &(padapter->ledpriv);
if (ledpriv->bRegUseLed == false) if (!ledpriv->bRegUseLed)
return; return;
switch (ledpriv->LedStrategy) { switch (ledpriv->LedStrategy) {
case SW_LED_MODE0: case SW_LED_MODE0:
......
...@@ -217,7 +217,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, ...@@ -217,7 +217,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
curfragnum++; curfragnum++;
plist = &defrag_q->queue; plist = &defrag_q->queue;
plist = plist->next; plist = plist->next;
while (end_of_queue_search(phead, plist) == false) { while (!end_of_queue_search(phead, plist)) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnfhdr = &pnextrframe->u.hdr; pnfhdr = &pnextrframe->u.hdr;
/*check the fragment sequence (2nd ~n fragment frame) */ /*check the fragment sequence (2nd ~n fragment frame) */
...@@ -489,7 +489,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, ...@@ -489,7 +489,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
phead = &ppending_recvframe_queue->queue; phead = &ppending_recvframe_queue->queue;
plist = phead->next; plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (!end_of_queue_search(phead, plist)) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnextattrib = &pnextrframe->u.hdr.attrib; pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
...@@ -519,7 +519,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, ...@@ -519,7 +519,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
phead = &ppending_recvframe_queue->queue; phead = &ppending_recvframe_queue->queue;
plist = phead->next; plist = phead->next;
/* Handling some condition for forced indicate case.*/ /* Handling some condition for forced indicate case.*/
if (bforced == true) { if (bforced) {
if (list_empty(phead)) if (list_empty(phead))
return true; return true;
...@@ -541,8 +541,8 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, ...@@ -541,8 +541,8 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
(preorder_ctrl->indicate_seq + 1) % 4096; (preorder_ctrl->indicate_seq + 1) % 4096;
/*indicate this recv_frame*/ /*indicate this recv_frame*/
if (!pattrib->amsdu) { if (!pattrib->amsdu) {
if ((padapter->bDriverStopped == false) && if (!padapter->bDriverStopped &&
(padapter->bSurpriseRemoved == false)) { !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */ /* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, r8712_recv_indicatepkt(padapter,
prframe); prframe);
...@@ -576,8 +576,8 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter, ...@@ -576,8 +576,8 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter,
/* s1. */ /* s1. */
r8712_wlanhdr_to_ethhdr(prframe); r8712_wlanhdr_to_ethhdr(prframe);
if (pattrib->qos != 1) { if (pattrib->qos != 1) {
if ((padapter->bDriverStopped == false) && if (!padapter->bDriverStopped &&
(padapter->bSurpriseRemoved == false)) { !padapter->bSurpriseRemoved) {
r8712_recv_indicatepkt(padapter, prframe); r8712_recv_indicatepkt(padapter, prframe);
return _SUCCESS; return _SUCCESS;
} else } else
...@@ -643,16 +643,15 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter, ...@@ -643,16 +643,15 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter,
if (phtpriv->ht_option == 1) { /*B/G/N Mode*/ if (phtpriv->ht_option == 1) { /*B/G/N Mode*/
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->bDriverStopped == false) && if (!padapter->bDriverStopped &&
(padapter->bSurpriseRemoved == false)) !padapter->bSurpriseRemoved)
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->bDriverStopped == false) && if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
(padapter->bSurpriseRemoved == false)) {
/* indicate this recv_frame */ /* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, prframe); r8712_recv_indicatepkt(padapter, prframe);
} else } else
...@@ -962,12 +961,12 @@ int recv_func(struct _adapter *padapter, void *pcontext) ...@@ -962,12 +961,12 @@ int recv_func(struct _adapter *padapter, void *pcontext)
prframe = (union recv_frame *)pcontext; prframe = (union recv_frame *)pcontext;
orig_prframe = prframe; orig_prframe = prframe;
pattrib = &prframe->u.hdr.attrib; pattrib = &prframe->u.hdr.attrib;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
if (pattrib->crc_err == 1) if (pattrib->crc_err == 1)
padapter->mppriv.rx_crcerrpktcount++; padapter->mppriv.rx_crcerrpktcount++;
else else
padapter->mppriv.rx_pktcount++; padapter->mppriv.rx_pktcount++;
if (check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE) == false) { if (!check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE)) {
/* free this recv_frame */ /* free this recv_frame */
r8712_free_recvframe(orig_prframe, pfree_recv_queue); r8712_free_recvframe(orig_prframe, pfree_recv_queue);
goto _exit_recv_func; goto _exit_recv_func;
......
...@@ -168,7 +168,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, ...@@ -168,7 +168,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
xmitframe_phead = &pframe_queue->queue; xmitframe_phead = &pframe_queue->queue;
xmitframe_plist = xmitframe_phead->next; xmitframe_plist = xmitframe_phead->next;
if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) { if (!end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, pxmitframe = LIST_CONTAINOR(xmitframe_plist,
struct xmit_frame, list); struct xmit_frame, list);
list_del_init(&pxmitframe->list); list_del_init(&pxmitframe->list);
...@@ -208,7 +208,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, ...@@ -208,7 +208,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
phwxmit = phwxmit_i + inx[i]; phwxmit = phwxmit_i + inx[i];
sta_phead = &phwxmit->sta_queue->queue; sta_phead = &phwxmit->sta_queue->queue;
sta_plist = sta_phead->next; sta_plist = sta_phead->next;
while ((end_of_queue_search(sta_phead, sta_plist)) == false) { while (!end_of_queue_search(sta_phead, sta_plist)) {
ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq,
tx_pending); tx_pending);
pframe_queue = &ptxservq->sta_pending; pframe_queue = &ptxservq->sta_pending;
......
...@@ -172,7 +172,7 @@ u32 r8712_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj) ...@@ -172,7 +172,7 @@ u32 r8712_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
{ {
int res; int res;
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true) if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL; return _FAIL;
res = _enqueue_cmd(&pcmdpriv->cmd_queue, obj); res = _enqueue_cmd(&pcmdpriv->cmd_queue, obj);
up(&pcmdpriv->cmd_queue_sema); up(&pcmdpriv->cmd_queue_sema);
...@@ -186,7 +186,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj) ...@@ -186,7 +186,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
if (obj == NULL) if (obj == NULL)
return _SUCCESS; return _SUCCESS;
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true) if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL; return _FAIL;
queue = &pcmdpriv->cmd_queue; queue = &pcmdpriv->cmd_queue;
spin_lock_irqsave(&queue->lock, irqL); spin_lock_irqsave(&queue->lock, irqL);
...@@ -519,7 +519,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) ...@@ -519,7 +519,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork)
* If not, we copy the connecting AP's MAC address to it so that * If not, we copy the connecting AP's MAC address to it so that
* the driver just has the bssid information for PMKIDList searching. * the driver just has the bssid information for PMKIDList searching.
*/ */
if (pmlmepriv->assoc_by_bssid == false) if (!pmlmepriv->assoc_by_bssid)
ether_addr_copy(&pmlmepriv->assoc_bssid[0], ether_addr_copy(&pmlmepriv->assoc_bssid[0],
&pnetwork->network.MacAddress[0]); &pnetwork->network.MacAddress[0]);
psecnetwork->IELength = r8712_restruct_sec_ie(padapter, psecnetwork->IELength = r8712_restruct_sec_ie(padapter,
...@@ -679,7 +679,7 @@ u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key) ...@@ -679,7 +679,7 @@ u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
else else
GET_ENCRY_ALGO(psecuritypriv, sta, GET_ENCRY_ALGO(psecuritypriv, sta,
psetstakey_para->algorithm, false); psetstakey_para->algorithm, false);
if (unicast_key == true) if (unicast_key)
memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16); memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
else else
memcpy(&psetstakey_para->key, memcpy(&psetstakey_para->key,
......
...@@ -49,7 +49,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count) ...@@ -49,7 +49,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
{ {
u16 x, mask; u16 x, mask;
if (padapter->bSurpriseRemoved == true) if (padapter->bSurpriseRemoved)
goto out; goto out;
mask = 0x01 << (count - 1); mask = 0x01 << (count - 1);
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
...@@ -58,7 +58,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count) ...@@ -58,7 +58,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 == true) if (padapter->bSurpriseRemoved)
goto out; goto out;
r8712_write8(padapter, EE_9346CR, (u8)x); r8712_write8(padapter, EE_9346CR, (u8)x);
udelay(CLOCK_RATE); udelay(CLOCK_RATE);
...@@ -66,7 +66,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count) ...@@ -66,7 +66,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 == true) if (padapter->bSurpriseRemoved)
goto out; goto out;
x &= ~_EEDI; x &= ~_EEDI;
r8712_write8(padapter, EE_9346CR, (u8)x); r8712_write8(padapter, EE_9346CR, (u8)x);
...@@ -77,7 +77,7 @@ static u16 shift_in_bits(struct _adapter *padapter) ...@@ -77,7 +77,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
{ {
u16 x, d = 0, i; u16 x, d = 0, i;
if (padapter->bSurpriseRemoved == true) if (padapter->bSurpriseRemoved)
goto out; goto out;
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDO | _EEDI); x &= ~(_EEDO | _EEDI);
...@@ -85,7 +85,7 @@ static u16 shift_in_bits(struct _adapter *padapter) ...@@ -85,7 +85,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 == true) if (padapter->bSurpriseRemoved)
goto out; goto out;
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDI); x &= ~(_EEDI);
...@@ -129,17 +129,17 @@ static void eeprom_clean(struct _adapter *padapter) ...@@ -129,17 +129,17 @@ static void eeprom_clean(struct _adapter *padapter)
{ {
u16 x; u16 x;
if (padapter->bSurpriseRemoved == true) if (padapter->bSurpriseRemoved)
return; return;
x = r8712_read8(padapter, EE_9346CR); x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved == true) if (padapter->bSurpriseRemoved)
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 == true) if (padapter->bSurpriseRemoved)
return; return;
up_clk(padapter, &x); up_clk(padapter, &x);
if (padapter->bSurpriseRemoved == true) if (padapter->bSurpriseRemoved)
return; return;
down_clk(padapter, &x); down_clk(padapter, &x);
} }
...@@ -206,11 +206,11 @@ u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg) /*ReadEEprom*/ ...@@ -206,11 +206,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 == true) if (padapter->bSurpriseRemoved)
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 == true) if (padapter->bSurpriseRemoved)
goto out; goto out;
x &= ~(_EEDI | _EEDO | _EESK | _EEM0); x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
x |= _EEM1 | _EECS; x |= _EEM1 | _EECS;
......
...@@ -178,17 +178,17 @@ static inline char *translate_scan(struct _adapter *padapter, ...@@ -178,17 +178,17 @@ static inline char *translate_scan(struct _adapter *padapter,
/* Add the protocol name */ /* Add the protocol name */
iwe.cmd = SIOCGIWNAME; iwe.cmd = SIOCGIWNAME;
if (r8712_is_cckratesonly_included(pnetwork->network.rates)) { if (r8712_is_cckratesonly_included(pnetwork->network.rates)) {
if (ht_cap == true) if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bn"); snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bn");
else else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b"); snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b");
} else if (r8712_is_cckrates_included(pnetwork->network.rates)) { } else if (r8712_is_cckrates_included(pnetwork->network.rates)) {
if (ht_cap == true) if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bgn"); snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bgn");
else else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg"); snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg");
} else { } else {
if (ht_cap == true) if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11gn"); snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11gn");
else else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g"); snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g");
...@@ -310,7 +310,7 @@ static inline char *translate_scan(struct _adapter *padapter, ...@@ -310,7 +310,7 @@ static inline char *translate_scan(struct _adapter *padapter,
if (r8712_get_wps_ie(pnetwork->network.IEs, if (r8712_get_wps_ie(pnetwork->network.IEs,
pnetwork->network.IELength, pnetwork->network.IELength,
wps_ie, &wps_ielen) == true) { wps_ie, &wps_ielen)) {
if (wps_ielen > 2) { if (wps_ielen > 2) {
iwe.cmd = IWEVGENIE; iwe.cmd = IWEVGENIE;
iwe.u.data.length = (u16)wps_ielen; iwe.u.data.length = (u16)wps_ielen;
...@@ -443,7 +443,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, ...@@ -443,7 +443,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | if (check_fwstate(pmlmepriv, WIFI_STATION_STATE |
WIFI_MP_STATE) == true) { /* sta mode */ WIFI_MP_STATE)) { /* sta mode */
psta = r8712_get_stainfo(pstapriv, psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv)); get_bssid(pmlmepriv));
if (psta) { if (psta) {
...@@ -617,22 +617,22 @@ static int r8711_wx_get_name(struct net_device *dev, ...@@ -617,22 +617,22 @@ static int r8711_wx_get_name(struct net_device *dev,
if (p && ht_ielen > 0) if (p && ht_ielen > 0)
ht_cap = true; ht_cap = true;
prates = pcur_bss->rates; prates = pcur_bss->rates;
if (r8712_is_cckratesonly_included(prates) == true) { if (r8712_is_cckratesonly_included(prates)) {
if (ht_cap == true) if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ, snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bn"); "IEEE 802.11bn");
else else
snprintf(wrqu->name, IFNAMSIZ, snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11b"); "IEEE 802.11b");
} else if ((r8712_is_cckrates_included(prates)) == true) { } else if (r8712_is_cckrates_included(prates)) {
if (ht_cap == true) if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ, snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bgn"); "IEEE 802.11bgn");
else else
snprintf(wrqu->name, IFNAMSIZ, snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bg"); "IEEE 802.11bg");
} else { } else {
if (ht_cap == true) if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ, snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11gn"); "IEEE 802.11gn");
else else
...@@ -697,7 +697,7 @@ static int r8711_wx_get_freq(struct net_device *dev, ...@@ -697,7 +697,7 @@ static int r8711_wx_get_freq(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
wrqu->freq.m = ieee80211_wlan_frequencies[ wrqu->freq.m = ieee80211_wlan_frequencies[
pcur_bss->Configuration.DSConfig-1] * 100000; pcur_bss->Configuration.DSConfig-1] * 100000;
wrqu->freq.e = 1; wrqu->freq.e = 1;
...@@ -746,12 +746,12 @@ static int r8711_wx_get_mode(struct net_device *dev, struct iw_request_info *a, ...@@ -746,12 +746,12 @@ static int r8711_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
struct _adapter *padapter = netdev_priv(dev); struct _adapter *padapter = netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
wrqu->mode = IW_MODE_INFRA; wrqu->mode = IW_MODE_INFRA;
else if (check_fwstate(pmlmepriv, else if (check_fwstate(pmlmepriv,
WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE) == true) WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE))
wrqu->mode = IW_MODE_ADHOC; wrqu->mode = IW_MODE_ADHOC;
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
wrqu->mode = IW_MODE_MASTER; wrqu->mode = IW_MODE_MASTER;
else else
wrqu->mode = IW_MODE_AUTO; wrqu->mode = IW_MODE_AUTO;
...@@ -940,7 +940,7 @@ static int r871x_wx_set_priv(struct net_device *dev, ...@@ -940,7 +940,7 @@ static int r871x_wx_set_priv(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network; struct wlan_network *pcur_network = &pmlmepriv->cur_network;
/*static u8 xxxx; */ /*static u8 xxxx; */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
sprintf(ext, "%s rssi %d", sprintf(ext, "%s rssi %d",
pcur_network->network.Ssid.Ssid, pcur_network->network.Ssid.Ssid,
/*(xxxx=xxxx+10) */ /*(xxxx=xxxx+10) */
...@@ -1044,9 +1044,9 @@ static int r8711_wx_set_wap(struct net_device *dev, ...@@ -1044,9 +1044,9 @@ static int r8711_wx_set_wap(struct net_device *dev,
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
enum NDIS_802_11_AUTHENTICATION_MODE authmode; enum NDIS_802_11_AUTHENTICATION_MODE authmode;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
return -EBUSY; return -EBUSY;
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
return ret; return ret;
if (temp->sa_family != ARPHRD_ETHER) if (temp->sa_family != ARPHRD_ETHER)
return -EINVAL; return -EINVAL;
...@@ -1055,7 +1055,7 @@ static int r8711_wx_set_wap(struct net_device *dev, ...@@ -1055,7 +1055,7 @@ static int r8711_wx_set_wap(struct net_device *dev,
phead = &queue->queue; phead = &queue->queue;
pmlmepriv->pscanned = phead->next; pmlmepriv->pscanned = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned) == true) if (end_of_queue_search(phead, pmlmepriv->pscanned))
break; break;
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
struct wlan_network, list); struct wlan_network, list);
...@@ -1137,17 +1137,17 @@ static int r8711_wx_set_scan(struct net_device *dev, ...@@ -1137,17 +1137,17 @@ static int r8711_wx_set_scan(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 status = true; u8 status = true;
if (padapter->bDriverStopped == true) { if (padapter->bDriverStopped) {
netdev_info(dev, "In %s: bDriverStopped=%d\n", netdev_info(dev, "In %s: bDriverStopped=%d\n",
__func__, padapter->bDriverStopped); __func__, padapter->bDriverStopped);
return -1; return -1;
} }
if (padapter->bup == false) if (!padapter->bup)
return -ENETDOWN; return -ENETDOWN;
if (padapter->hw_init_completed == false) if (!padapter->hw_init_completed)
return -1; return -1;
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) || if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true)) (pmlmepriv->sitesurveyctrl.traffic_busy))
return 0; return 0;
if (wrqu->data.length == sizeof(struct iw_scan_req)) { if (wrqu->data.length == sizeof(struct iw_scan_req)) {
struct iw_scan_req *req = (struct iw_scan_req *)extra; struct iw_scan_req *req = (struct iw_scan_req *)extra;
...@@ -1164,7 +1164,7 @@ static int r8711_wx_set_scan(struct net_device *dev, ...@@ -1164,7 +1164,7 @@ static int r8711_wx_set_scan(struct net_device *dev,
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY |
_FW_UNDER_LINKING)) || _FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true)) { (pmlmepriv->sitesurveyctrl.traffic_busy)) {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
status = false; status = false;
} else } else
...@@ -1173,7 +1173,7 @@ static int r8711_wx_set_scan(struct net_device *dev, ...@@ -1173,7 +1173,7 @@ static int r8711_wx_set_scan(struct net_device *dev,
} }
} else } else
status = r8712_set_802_11_bssid_list_scan(padapter); status = r8712_set_802_11_bssid_list_scan(padapter);
if (status == false) if (!status)
return -1; return -1;
return 0; return 0;
} }
...@@ -1204,7 +1204,7 @@ static int r8711_wx_get_scan(struct net_device *dev, ...@@ -1204,7 +1204,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
phead = &queue->queue; phead = &queue->queue;
plist = phead->next; plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist))
break; break;
if ((stop - ev) < SCAN_ITEM_SIZE) { if ((stop - ev) < SCAN_ITEM_SIZE) {
ret = -E2BIG; ret = -E2BIG;
...@@ -1427,7 +1427,7 @@ static int r8711_wx_get_rate(struct net_device *dev, ...@@ -1427,7 +1427,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
wrqu->bitrate.value = rate*500000; wrqu->bitrate.value = rate*500000;
i++; i++;
} }
if (ht_cap == true) { if (ht_cap) {
if (mcs_rate & 0x8000 /* MCS15 */ if (mcs_rate & 0x8000 /* MCS15 */
&& &&
rf_type == RTL8712_RF_2T2R) rf_type == RTL8712_RF_2T2R)
...@@ -1599,7 +1599,7 @@ static int r8711_wx_get_enc(struct net_device *dev, ...@@ -1599,7 +1599,7 @@ static int r8711_wx_get_enc(struct net_device *dev,
struct iw_point *erq = &(wrqu->encoding); struct iw_point *erq = &(wrqu->encoding);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
if (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { if (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
erq->length = 0; erq->length = 0;
erq->flags |= IW_ENCODE_DISABLED; erq->flags |= IW_ENCODE_DISABLED;
...@@ -1973,7 +1973,7 @@ static int r871x_get_ap_info(struct net_device *dev, ...@@ -1973,7 +1973,7 @@ static int r871x_get_ap_info(struct net_device *dev,
phead = &queue->queue; phead = &queue->queue;
plist = phead->next; plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist))
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (!mac_pton(data, bssid)) { if (!mac_pton(data, bssid)) {
......
...@@ -324,8 +324,8 @@ uint oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv) ...@@ -324,8 +324,8 @@ uint oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv)
if (poid_par_priv->type_of_oid != QUERY_OID) if (poid_par_priv->type_of_oid != QUERY_OID)
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || if (check_fwstate(pmlmepriv, _FW_LINKED) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
pnic_Config = &pmlmepriv->cur_network.network.Configuration; pnic_Config = &pmlmepriv->cur_network.network.Configuration;
else else
pnic_Config = &padapter->registrypriv.dev_network. pnic_Config = &padapter->registrypriv.dev_network.
...@@ -465,7 +465,7 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv) ...@@ -465,7 +465,7 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv)
if (poid_par_priv->type_of_oid != SET_OID) /* QUERY_OID */ if (poid_par_priv->type_of_oid != SET_OID) /* QUERY_OID */
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (poid_par_priv->information_buf_len == (sizeof(unsigned long)*3)) { if (poid_par_priv->information_buf_len == (sizeof(unsigned long)*3)) {
if (Adapter->mppriv.act_in_progress == true) if (Adapter->mppriv.act_in_progress)
status = RNDIS_STATUS_NOT_ACCEPTED; status = RNDIS_STATUS_NOT_ACCEPTED;
else { else {
/* init workparam */ /* init workparam */
...@@ -515,11 +515,11 @@ uint oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv) ...@@ -515,11 +515,11 @@ uint oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv)
* nStatus==2 AdHocMode * nStatus==2 AdHocMode
* nStatus==3 NotAssociated * nStatus==3 NotAssociated
*/ */
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
ulInfo = CHECKINGSTATUS; ulInfo = CHECKINGSTATUS;
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true) else if (check_fwstate(pmlmepriv, _FW_LINKED))
ulInfo = ASSOCIATED; ulInfo = ASSOCIATED;
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
ulInfo = ADHOCMODE; ulInfo = ADHOCMODE;
else else
ulInfo = NOTASSOCIATED; ulInfo = NOTASSOCIATED;
......
...@@ -136,12 +136,12 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) ...@@ -136,12 +136,12 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
} }
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY |
_FW_UNDER_LINKING) == true) { _FW_UNDER_LINKING)) {
status = check_fwstate(pmlmepriv, _FW_UNDER_LINKING); status = check_fwstate(pmlmepriv, _FW_UNDER_LINKING);
goto _Abort_Set_BSSID; goto _Abort_Set_BSSID;
} }
if (check_fwstate(pmlmepriv, if (check_fwstate(pmlmepriv,
_FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) {
if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid,
ETH_ALEN)) { ETH_ALEN)) {
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE))
...@@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) ...@@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
* WIFI_ADHOC_MASTER_STATE */ * WIFI_ADHOC_MASTER_STATE */
} else { } else {
r8712_disassoc_cmd(padapter); r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
r8712_ind_disconnect(padapter); r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter); r8712_free_assoc_resources(padapter);
if ((check_fwstate(pmlmepriv, if ((check_fwstate(pmlmepriv,
...@@ -197,7 +197,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, ...@@ -197,7 +197,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter,
*/ */
r8712_disassoc_cmd(padapter); r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv, if (check_fwstate(pmlmepriv,
_FW_LINKED) == true) _FW_LINKED))
r8712_ind_disconnect(padapter); r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter); r8712_free_assoc_resources(padapter);
if (check_fwstate(pmlmepriv, if (check_fwstate(pmlmepriv,
...@@ -213,18 +213,18 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, ...@@ -213,18 +213,18 @@ void r8712_set_802_11_ssid(struct _adapter *padapter,
} }
} else { } else {
r8712_disassoc_cmd(padapter); r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
r8712_ind_disconnect(padapter); r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter); r8712_free_assoc_resources(padapter);
if (check_fwstate(pmlmepriv, if (check_fwstate(pmlmepriv,
WIFI_ADHOC_MASTER_STATE) == true) { WIFI_ADHOC_MASTER_STATE)) {
_clr_fwstate_(pmlmepriv, _clr_fwstate_(pmlmepriv,
WIFI_ADHOC_MASTER_STATE); WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
} }
} }
} }
if (padapter->securitypriv.btkip_countermeasure == true) if (padapter->securitypriv.btkip_countermeasure)
goto _Abort_Set_SSID; goto _Abort_Set_SSID;
if (!validate_ssid(ssid)) if (!validate_ssid(ssid))
goto _Abort_Set_SSID; goto _Abort_Set_SSID;
...@@ -248,13 +248,13 @@ void r8712_set_802_11_infrastructure_mode(struct _adapter *padapter, ...@@ -248,13 +248,13 @@ void r8712_set_802_11_infrastructure_mode(struct _adapter *padapter,
if (*pold_state != networktype) { if (*pold_state != networktype) {
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || if (check_fwstate(pmlmepriv, _FW_LINKED) ||
(*pold_state == Ndis802_11IBSS)) (*pold_state == Ndis802_11IBSS))
r8712_disassoc_cmd(padapter); r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv, if (check_fwstate(pmlmepriv,
_FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) _FW_LINKED | WIFI_ADHOC_MASTER_STATE))
r8712_free_assoc_resources(padapter); r8712_free_assoc_resources(padapter);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || if (check_fwstate(pmlmepriv, _FW_LINKED) ||
(*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11Infrastructure) ||
(*pold_state == Ndis802_11IBSS)) { (*pold_state == Ndis802_11IBSS)) {
/* will clr Linked_state before this function, /* will clr Linked_state before this function,
...@@ -291,7 +291,7 @@ u8 r8712_set_802_11_disassociate(struct _adapter *padapter) ...@@ -291,7 +291,7 @@ u8 r8712_set_802_11_disassociate(struct _adapter *padapter)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
r8712_disassoc_cmd(padapter); r8712_disassoc_cmd(padapter);
r8712_ind_disconnect(padapter); r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter); r8712_free_assoc_resources(padapter);
...@@ -312,8 +312,8 @@ u8 r8712_set_802_11_bssid_list_scan(struct _adapter *padapter) ...@@ -312,8 +312,8 @@ u8 r8712_set_802_11_bssid_list_scan(struct _adapter *padapter)
if (!padapter->hw_init_completed) if (!padapter->hw_init_completed)
return false; return false;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) || if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true)) { pmlmepriv->sitesurveyctrl.traffic_busy) {
/* Scan or linking is in progress, do nothing. */ /* Scan or linking is in progress, do nothing. */
ret = (u8)check_fwstate(pmlmepriv, _FW_UNDER_SURVEY); ret = (u8)check_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
} else { } else {
......
...@@ -110,7 +110,7 @@ static void _free_network(struct mlme_priv *pmlmepriv, ...@@ -110,7 +110,7 @@ static void _free_network(struct mlme_priv *pmlmepriv,
if (pnetwork == NULL) if (pnetwork == NULL)
return; return;
if (pnetwork->fixed == true) if (pnetwork->fixed)
return; return;
curr_time = jiffies; curr_time = jiffies;
delta_time = (curr_time - (u32)pnetwork->last_scanned) / HZ; delta_time = (curr_time - (u32)pnetwork->last_scanned) / HZ;
...@@ -130,7 +130,7 @@ static void _free_network_nolock(struct mlme_priv *pmlmepriv, ...@@ -130,7 +130,7 @@ static void _free_network_nolock(struct mlme_priv *pmlmepriv,
if (pnetwork == NULL) if (pnetwork == NULL)
return; return;
if (pnetwork->fixed == true) if (pnetwork->fixed)
return; return;
list_del_init(&pnetwork->list); list_del_init(&pnetwork->list);
list_add_tail(&pnetwork->list, &free_queue->queue); list_add_tail(&pnetwork->list, &free_queue->queue);
...@@ -176,7 +176,7 @@ static void _free_network_queue(struct _adapter *padapter) ...@@ -176,7 +176,7 @@ static void _free_network_queue(struct _adapter *padapter)
spin_lock_irqsave(&scanned_queue->lock, irqL); spin_lock_irqsave(&scanned_queue->lock, irqL);
phead = &scanned_queue->queue; phead = &scanned_queue->queue;
plist = phead->next; plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (!end_of_queue_search(phead, plist)) {
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
plist = plist->next; plist = plist->next;
_free_network(pmlmepriv, pnetwork); _free_network(pmlmepriv, pnetwork);
...@@ -189,7 +189,7 @@ sint r8712_if_up(struct _adapter *padapter) ...@@ -189,7 +189,7 @@ sint r8712_if_up(struct _adapter *padapter)
sint res; sint res;
if (padapter->bDriverStopped || padapter->bSurpriseRemoved || if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
(check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false)) { !check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
res = false; res = false;
} else } else
res = true; res = true;
...@@ -392,7 +392,7 @@ static void update_scanned_network(struct _adapter *adapter, ...@@ -392,7 +392,7 @@ static void update_scanned_network(struct _adapter *adapter,
plist = phead->next; plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist))
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
...@@ -409,7 +409,7 @@ static void update_scanned_network(struct _adapter *adapter, ...@@ -409,7 +409,7 @@ static void update_scanned_network(struct _adapter *adapter,
/* If we didn't find a match, then get a new network slot to initialize /* If we didn't find a match, then get a new network slot to initialize
* with this beacon's information */ * with this beacon's information */
if (end_of_queue_search(phead, plist) == true) { if (end_of_queue_search(phead, plist)) {
if (list_empty(&pmlmepriv->free_bss_pool.queue)) { if (list_empty(&pmlmepriv->free_bss_pool.queue)) {
/* If there are no more slots, expire the oldest */ /* If there are no more slots, expire the oldest */
pnetwork = oldest; pnetwork = oldest;
...@@ -468,10 +468,10 @@ static int is_desired_network(struct _adapter *adapter, ...@@ -468,10 +468,10 @@ static int is_desired_network(struct _adapter *adapter,
int bselected = true; int bselected = true;
struct security_priv *psecuritypriv = &adapter->securitypriv; struct security_priv *psecuritypriv = &adapter->securitypriv;
if (psecuritypriv->wps_phase == true) { if (psecuritypriv->wps_phase) {
if (r8712_get_wps_ie(pnetwork->network.IEs, if (r8712_get_wps_ie(pnetwork->network.IEs,
pnetwork->network.IELength, wps_ie, pnetwork->network.IELength, wps_ie,
&wps_ielen) == true) &wps_ielen))
return true; return true;
else else
return false; return false;
...@@ -479,7 +479,7 @@ static int is_desired_network(struct _adapter *adapter, ...@@ -479,7 +479,7 @@ static int is_desired_network(struct _adapter *adapter,
if ((psecuritypriv->PrivacyAlgrthm != _NO_PRIVACY_) && if ((psecuritypriv->PrivacyAlgrthm != _NO_PRIVACY_) &&
(pnetwork->network.Privacy == 0)) (pnetwork->network.Privacy == 0))
bselected = false; bselected = false;
if (check_fwstate(&adapter->mlmepriv, WIFI_ADHOC_STATE) == true) { if (check_fwstate(&adapter->mlmepriv, WIFI_ADHOC_STATE)) {
if (pnetwork->network.InfrastructureMode != if (pnetwork->network.InfrastructureMode !=
adapter->mlmepriv.cur_network.network. adapter->mlmepriv.cur_network.network.
InfrastructureMode) InfrastructureMode)
...@@ -533,7 +533,7 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -533,7 +533,7 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf)
return; return;
spin_lock_irqsave(&pmlmepriv->lock2, flags); spin_lock_irqsave(&pmlmepriv->lock2, flags);
/* update IBSS_network 's timestamp */ /* update IBSS_network 's timestamp */
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
if (!memcmp(&(pmlmepriv->cur_network.network.MacAddress), if (!memcmp(&(pmlmepriv->cur_network.network.MacAddress),
pnetwork->MacAddress, ETH_ALEN)) { pnetwork->MacAddress, ETH_ALEN)) {
struct wlan_network *ibss_wlan = NULL; struct wlan_network *ibss_wlan = NULL;
...@@ -551,7 +551,7 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -551,7 +551,7 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf)
} }
} }
/* lock pmlmepriv->lock when you accessing network_q */ /* lock pmlmepriv->lock when you accessing network_q */
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == false) { if (!check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
if (pnetwork->Ssid.Ssid[0] != 0) if (pnetwork->Ssid.Ssid[0] != 0)
rtl8711_add_network(adapter, pnetwork); rtl8711_add_network(adapter, pnetwork);
else { else {
...@@ -571,15 +571,15 @@ void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -571,15 +571,15 @@ void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf)
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
del_timer(&pmlmepriv->scan_to_timer); del_timer(&pmlmepriv->scan_to_timer);
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
} }
if (pmlmepriv->to_join == true) { if (pmlmepriv->to_join) {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
set_fwstate(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
if (r8712_select_and_join_from_scan(pmlmepriv) if (r8712_select_and_join_from_scan(pmlmepriv)
...@@ -679,7 +679,7 @@ void r8712_ind_disconnect(struct _adapter *padapter) ...@@ -679,7 +679,7 @@ void r8712_ind_disconnect(struct _adapter *padapter)
{ {
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
_clr_fwstate_(pmlmepriv, _FW_LINKED); _clr_fwstate_(pmlmepriv, _FW_LINKED);
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_NO_LINK); padapter->ledpriv.LedControlHandler(padapter, LED_CTL_NO_LINK);
r8712_os_indicate_disconnect(padapter); r8712_os_indicate_disconnect(padapter);
...@@ -764,10 +764,10 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -764,10 +764,10 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex)) if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex))
goto ignore_joinbss_callback; goto ignore_joinbss_callback;
if (pnetwork->join_res > 0) { if (pnetwork->join_res > 0) {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/*s1. find ptarget_wlan*/ /*s1. find ptarget_wlan*/
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
if (the_same_macaddr == true) if (the_same_macaddr)
ptarget_wlan = ptarget_wlan =
r8712_find_network(&pmlmepriv-> r8712_find_network(&pmlmepriv->
scanned_queue, scanned_queue,
...@@ -813,7 +813,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -813,7 +813,7 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
/*s2. find ptarget_sta & update ptarget_sta*/ /*s2. find ptarget_sta & update ptarget_sta*/
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
if (the_same_macaddr == true) { if (the_same_macaddr) {
ptarget_sta = ptarget_sta =
r8712_get_stainfo(pstapriv, r8712_get_stainfo(pstapriv,
pnetwork->network.MacAddress); pnetwork->network.MacAddress);
...@@ -897,14 +897,13 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -897,14 +897,13 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
update_ht_cap(adapter, cur_network->network.IEs, update_ht_cap(adapter, cur_network->network.IEs,
cur_network->network.IELength); cur_network->network.IELength);
/*indicate connect*/ /*indicate connect*/
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
== true)
r8712_indicate_connect(adapter); r8712_indicate_connect(adapter);
del_timer(&pmlmepriv->assoc_timer); del_timer(&pmlmepriv->assoc_timer);
} else } else
goto ignore_joinbss_callback; goto ignore_joinbss_callback;
} else { } else {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
mod_timer(&pmlmepriv->assoc_timer, mod_timer(&pmlmepriv->assoc_timer,
jiffies + msecs_to_jiffies(1)); jiffies + msecs_to_jiffies(1));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
...@@ -924,7 +923,7 @@ void r8712_stassoc_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -924,7 +923,7 @@ void r8712_stassoc_event_callback(struct _adapter *adapter, u8 *pbuf)
struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf; struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf;
/* to do: */ /* to do: */
if (r8712_access_ctrl(&adapter->acl_list, pstassoc->macaddr) == false) if (!r8712_access_ctrl(&adapter->acl_list, pstassoc->macaddr))
return; return;
psta = r8712_get_stainfo(&adapter->stapriv, pstassoc->macaddr); psta = r8712_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
if (psta != NULL) { if (psta != NULL) {
...@@ -946,8 +945,8 @@ void r8712_stassoc_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -946,8 +945,8 @@ void r8712_stassoc_event_callback(struct _adapter *adapter, u8 *pbuf)
psta->XPrivacy = adapter->securitypriv.PrivacyAlgrthm; psta->XPrivacy = adapter->securitypriv.PrivacyAlgrthm;
psta->ieee8021x_blocked = false; psta->ieee8021x_blocked = false;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) { check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
if (adapter->stapriv.asoc_sta_count == 2) { if (adapter->stapriv.asoc_sta_count == 2) {
/* a sta + bc/mc_stainfo (not Ibss_stainfo) */ /* a sta + bc/mc_stainfo (not Ibss_stainfo) */
r8712_indicate_connect(adapter); r8712_indicate_connect(adapter);
...@@ -969,7 +968,7 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -969,7 +968,7 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf)
struct wlan_network *tgt_network = &pmlmepriv->cur_network; struct wlan_network *tgt_network = &pmlmepriv->cur_network;
spin_lock_irqsave(&pmlmepriv->lock, irqL2); spin_lock_irqsave(&pmlmepriv->lock, irqL2);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
r8712_ind_disconnect(adapter); r8712_ind_disconnect(adapter);
r8712_free_assoc_resources(adapter); r8712_free_assoc_resources(adapter);
} }
...@@ -1046,7 +1045,7 @@ void r8712_got_addbareq_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -1046,7 +1045,7 @@ void r8712_got_addbareq_event_callback(struct _adapter *adapter, u8 *pbuf)
void r8712_wpspbc_event_callback(struct _adapter *adapter, u8 *pbuf) void r8712_wpspbc_event_callback(struct _adapter *adapter, u8 *pbuf)
{ {
if (adapter->securitypriv.wps_hw_pbc_pressed == false) if (!adapter->securitypriv.wps_hw_pbc_pressed)
adapter->securitypriv.wps_hw_pbc_pressed = true; adapter->securitypriv.wps_hw_pbc_pressed = true;
} }
...@@ -1081,7 +1080,7 @@ void _r8712_join_timeout_handler(struct _adapter *adapter) ...@@ -1081,7 +1080,7 @@ void _r8712_join_timeout_handler(struct _adapter *adapter)
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
pmlmepriv->to_join = false; pmlmepriv->to_join = false;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
r8712_os_indicate_disconnect(adapter); r8712_os_indicate_disconnect(adapter);
_clr_fwstate_(pmlmepriv, _FW_LINKED); _clr_fwstate_(pmlmepriv, _FW_LINKED);
} }
...@@ -1131,8 +1130,8 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1131,8 +1130,8 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
phead = &queue->queue; phead = &queue->queue;
pmlmepriv->pscanned = phead->next; pmlmepriv->pscanned = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned) == true) { if (end_of_queue_search(phead, pmlmepriv->pscanned)) {
if ((pmlmepriv->assoc_by_rssi == true) && if ((pmlmepriv->assoc_by_rssi) &&
(pnetwork_max_rssi != NULL)) { (pnetwork_max_rssi != NULL)) {
pnetwork = pnetwork_max_rssi; pnetwork = pnetwork_max_rssi;
goto ask_for_joinbss; goto ask_for_joinbss;
...@@ -1144,7 +1143,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1144,7 +1143,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
if (pnetwork == NULL) if (pnetwork == NULL)
return _FAIL; return _FAIL;
pmlmepriv->pscanned = pmlmepriv->pscanned->next; pmlmepriv->pscanned = pmlmepriv->pscanned->next;
if (pmlmepriv->assoc_by_bssid == true) { if (pmlmepriv->assoc_by_bssid) {
dst_ssid = pnetwork->network.MacAddress; dst_ssid = pnetwork->network.MacAddress;
src_ssid = pmlmepriv->assoc_bssid; src_ssid = pmlmepriv->assoc_bssid;
if (!memcmp(dst_ssid, src_ssid, ETH_ALEN)) { if (!memcmp(dst_ssid, src_ssid, ETH_ALEN)) {
...@@ -1172,7 +1171,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1172,7 +1171,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
pmlmepriv->assoc_ssid.SsidLength) && pmlmepriv->assoc_ssid.SsidLength) &&
(!memcmp(dst_ssid, src_ssid, (!memcmp(dst_ssid, src_ssid,
pmlmepriv->assoc_ssid.SsidLength))) { pmlmepriv->assoc_ssid.SsidLength))) {
if (pmlmepriv->assoc_by_rssi == true) { if (pmlmepriv->assoc_by_rssi) {
/* if the ssid is the same, select the bss /* if the ssid is the same, select the bss
* which has the max rssi*/ * which has the max rssi*/
if (pnetwork_max_rssi) { if (pnetwork_max_rssi) {
...@@ -1429,7 +1428,7 @@ sint r8712_restruct_sec_ie(struct _adapter *adapter, u8 *in_ie, ...@@ -1429,7 +1428,7 @@ sint r8712_restruct_sec_ie(struct _adapter *adapter, u8 *in_ie,
cnt += in_ie[cnt+1] + 2; /*get next*/ cnt += in_ie[cnt+1] + 2; /*get next*/
} }
/*restruct WPA IE or WPA2 IE in sec_ie[] */ /*restruct WPA IE or WPA2 IE in sec_ie[] */
if (match == true) { if (match) {
if (sec_ie[0] == _WPA_IE_ID_) { if (sec_ie[0] == _WPA_IE_ID_) {
/* parsing SSN IE to select required encryption /* parsing SSN IE to select required encryption
* algorithm, and set the bc/mc encryption algorithm */ * algorithm, and set the bc/mc encryption algorithm */
...@@ -1566,7 +1565,7 @@ sint r8712_restruct_sec_ie(struct _adapter *adapter, u8 *in_ie, ...@@ -1566,7 +1565,7 @@ sint r8712_restruct_sec_ie(struct _adapter *adapter, u8 *in_ie,
memcpy(out_ie, in_ie, 12); memcpy(out_ie, in_ie, 12);
ielength = 12; ielength = 12;
/*copy RSN or SSN*/ /*copy RSN or SSN*/
if (match == true) { if (match) {
memcpy(&out_ie[ielength], &sec_ie[0], sec_ie[1]+2); memcpy(&out_ie[ielength], &sec_ie[0], sec_ie[1]+2);
ielength += sec_ie[1] + 2; ielength += sec_ie[1] + 2;
if (authmode == _WPA2_IE_ID_) { if (authmode == _WPA2_IE_ID_) {
...@@ -1580,7 +1579,7 @@ sint r8712_restruct_sec_ie(struct _adapter *adapter, u8 *in_ie, ...@@ -1580,7 +1579,7 @@ sint r8712_restruct_sec_ie(struct _adapter *adapter, u8 *in_ie,
/*copy fixed ie only*/ /*copy fixed ie only*/
memcpy(out_ie, in_ie, 12); memcpy(out_ie, in_ie, 12);
ielength = 12; ielength = 12;
if (psecuritypriv->wps_phase == true) { if (psecuritypriv->wps_phase) {
memcpy(out_ie+ielength, psecuritypriv->wps_ie, memcpy(out_ie+ielength, psecuritypriv->wps_ie,
psecuritypriv->wps_ie_len); psecuritypriv->wps_ie_len);
ielength += psecuritypriv->wps_ie_len; ielength += psecuritypriv->wps_ie_len;
...@@ -1738,7 +1737,7 @@ static void update_ht_cap(struct _adapter *padapter, u8 *pie, uint ie_len) ...@@ -1738,7 +1737,7 @@ static void update_ht_cap(struct _adapter *padapter, u8 *pie, uint ie_len)
if (!phtpriv->ht_option) if (!phtpriv->ht_option)
return; return;
/* maybe needs check if ap supports rx ampdu. */ /* maybe needs check if ap supports rx ampdu. */
if ((phtpriv->ampdu_enable == false) && if (!phtpriv->ampdu_enable &&
(pregistrypriv->ampdu_enable == 1)) (pregistrypriv->ampdu_enable == 1))
phtpriv->ampdu_enable = true; phtpriv->ampdu_enable = true;
/*check Max Rx A-MPDU Size*/ /*check Max Rx A-MPDU Size*/
...@@ -1788,8 +1787,8 @@ void r8712_issue_addbareq_cmd(struct _adapter *padapter, int priority) ...@@ -1788,8 +1787,8 @@ void r8712_issue_addbareq_cmd(struct _adapter *padapter, int priority)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ht_priv *phtpriv = &pmlmepriv->htpriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv;
if ((phtpriv->ht_option == 1) && (phtpriv->ampdu_enable == true)) { if ((phtpriv->ht_option == 1) && (phtpriv->ampdu_enable)) {
if (phtpriv->baddbareq_issued[priority] == false) { if (!phtpriv->baddbareq_issued[priority]) {
r8712_addbareq_cmd(padapter, (u8)priority); r8712_addbareq_cmd(padapter, (u8)priority);
phtpriv->baddbareq_issued[priority] = true; phtpriv->baddbareq_issued[priority] = true;
} }
......
...@@ -153,7 +153,7 @@ static inline void clr_fwstate(struct mlme_priv *pmlmepriv, sint state) ...@@ -153,7 +153,7 @@ static inline void clr_fwstate(struct mlme_priv *pmlmepriv, sint state)
unsigned long irqL; unsigned long irqL;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, state) == true) if (check_fwstate(pmlmepriv, state))
pmlmepriv->fw_state ^= state; pmlmepriv->fw_state ^= state;
spin_unlock_irqrestore(&pmlmepriv->lock, irqL); spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
} }
......
...@@ -181,7 +181,7 @@ static int mp_start_test(struct _adapter *padapter) ...@@ -181,7 +181,7 @@ static int mp_start_test(struct _adapter *padapter)
} else } else
bssid.Length = length; bssid.Length = length;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
goto end_of_mp_start_test; goto end_of_mp_start_test;
/*init mp_start_test status*/ /*init mp_start_test status*/
pmppriv->prev_fw_state = get_fwstate(pmlmepriv); pmppriv->prev_fw_state = get_fwstate(pmlmepriv);
...@@ -223,7 +223,7 @@ static int mp_stop_test(struct _adapter *padapter) ...@@ -223,7 +223,7 @@ static int mp_stop_test(struct _adapter *padapter)
unsigned long irqL; unsigned long irqL;
spin_lock_irqsave(&pmlmepriv->lock, irqL); spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false) if (!check_fwstate(pmlmepriv, WIFI_MP_STATE))
goto end_of_mp_stop_test; goto end_of_mp_stop_test;
/* 3 1. disconnect psudo AdHoc */ /* 3 1. disconnect psudo AdHoc */
r8712_os_indicate_disconnect(padapter); r8712_os_indicate_disconnect(padapter);
...@@ -247,9 +247,9 @@ int mp_start_joinbss(struct _adapter *padapter, struct ndis_802_11_ssid *pssid) ...@@ -247,9 +247,9 @@ int mp_start_joinbss(struct _adapter *padapter, struct ndis_802_11_ssid *pssid)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned char res = _SUCCESS; unsigned char res = _SUCCESS;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false) if (!check_fwstate(pmlmepriv, WIFI_MP_STATE))
return _FAIL; return _FAIL;
if (check_fwstate(pmlmepriv, _FW_LINKED) == false) if (!check_fwstate(pmlmepriv, _FW_LINKED))
return _FAIL; return _FAIL;
_clr_fwstate_(pmlmepriv, _FW_LINKED); _clr_fwstate_(pmlmepriv, _FW_LINKED);
res = r8712_setassocsta_cmd(padapter, pmppriv->network_macaddr); res = r8712_setassocsta_cmd(padapter, pmppriv->network_macaddr);
...@@ -684,7 +684,7 @@ uint oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv) ...@@ -684,7 +684,7 @@ uint oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv)
if (poid_par_priv->type_of_oid != QUERY_OID) if (poid_par_priv->type_of_oid != QUERY_OID)
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (Adapter->mppriv.act_in_progress == true) if (Adapter->mppriv.act_in_progress)
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (poid_par_priv->information_buf_len < sizeof(u8)) if (poid_par_priv->information_buf_len < sizeof(u8))
...@@ -728,7 +728,7 @@ uint oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv) ...@@ -728,7 +728,7 @@ uint oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv)
if ((addr > 511) || (cnts < 1) || (cnts > 512) || (addr + cnts) > if ((addr > 511) || (cnts < 1) || (cnts > 512) || (addr + cnts) >
EFUSE_MAX_SIZE) EFUSE_MAX_SIZE)
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (r8712_efuse_access(Adapter, true, addr, cnts, data) == false) if (!r8712_efuse_access(Adapter, true, addr, cnts, data))
status = RNDIS_STATUS_FAILURE; status = RNDIS_STATUS_FAILURE;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
return status; return status;
...@@ -756,7 +756,7 @@ uint oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv) ...@@ -756,7 +756,7 @@ uint oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv)
if ((addr > 511) || (cnts < 1) || (cnts > 512) || if ((addr > 511) || (cnts < 1) || (cnts > 512) ||
(addr + cnts) > r8712_efuse_get_max_size(Adapter)) (addr + cnts) > r8712_efuse_get_max_size(Adapter))
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (r8712_efuse_access(Adapter, false, addr, cnts, data) == false) if (!r8712_efuse_access(Adapter, false, addr, cnts, data))
status = RNDIS_STATUS_FAILURE; status = RNDIS_STATUS_FAILURE;
return status; return status;
} }
...@@ -824,7 +824,7 @@ uint oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv) ...@@ -824,7 +824,7 @@ uint oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv)
status = RNDIS_STATUS_FAILURE; status = RNDIS_STATUS_FAILURE;
} else { } else {
/* SET_OID */ /* SET_OID */
if (r8712_efuse_reg_init(Adapter) == true) { if (r8712_efuse_reg_init(Adapter)) {
if (r8712_efuse_map_write(Adapter, 0, if (r8712_efuse_map_write(Adapter, 0,
EFUSE_MAP_MAX_SIZE, data)) EFUSE_MAP_MAX_SIZE, data))
*poid_par_priv->bytes_rw = EFUSE_MAP_MAX_SIZE; *poid_par_priv->bytes_rw = EFUSE_MAP_MAX_SIZE;
......
...@@ -44,8 +44,7 @@ void r8712_set_rpwm(struct _adapter *padapter, u8 val8) ...@@ -44,8 +44,7 @@ void r8712_set_rpwm(struct _adapter *padapter, u8 val8)
if (pwrpriv->rpwm_retry == 0) if (pwrpriv->rpwm_retry == 0)
return; return;
} }
if ((padapter->bDriverStopped == true) || if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
(padapter->bSurpriseRemoved == true))
return; return;
rpwm = val8 | pwrpriv->tog; rpwm = val8 | pwrpriv->tog;
switch (val8) { switch (val8) {
...@@ -129,8 +128,7 @@ static void _rpwm_check_handler (struct _adapter *padapter) ...@@ -129,8 +128,7 @@ static void _rpwm_check_handler (struct _adapter *padapter)
{ {
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
if (padapter->bDriverStopped == true || if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
padapter->bSurpriseRemoved == true)
return; return;
if (pwrpriv->cpwm != pwrpriv->rpwm) if (pwrpriv->cpwm != pwrpriv->rpwm)
schedule_work(&pwrpriv->rpwm_workitem); schedule_work(&pwrpriv->rpwm_workitem);
......
...@@ -147,7 +147,7 @@ void r8712_free_recvframe_queue(struct __queue *pframequeue, ...@@ -147,7 +147,7 @@ void r8712_free_recvframe_queue(struct __queue *pframequeue,
spin_lock(&pframequeue->lock); spin_lock(&pframequeue->lock);
phead = &pframequeue->queue; phead = &pframequeue->queue;
plist = phead->next; plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (!end_of_queue_search(phead, plist)) {
precvframe = LIST_CONTAINOR(plist, union recv_frame, u); precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
plist = plist->next; plist = plist->next;
r8712_free_recvframe(precvframe, pfree_recv_queue); r8712_free_recvframe(precvframe, pfree_recv_queue);
...@@ -178,7 +178,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter, ...@@ -178,7 +178,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
idx = iv[3]; idx = iv[3];
mickey = &psecuritypriv->XGrprxmickey[(((idx >> mickey = &psecuritypriv->XGrprxmickey[(((idx >>
6) & 0x3)) - 1].skey[0]; 6) & 0x3)) - 1].skey[0];
if (psecuritypriv->binstallGrpkey == false) if (!psecuritypriv->binstallGrpkey)
return _FAIL; return _FAIL;
} else } else
mickey = &stainfo->tkiprxmickey.skey[0]; mickey = &stainfo->tkiprxmickey.skey[0];
...@@ -197,16 +197,15 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter, ...@@ -197,16 +197,15 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
if (miccode[i] != *(pframemic + i)) if (miccode[i] != *(pframemic + i))
bmic_err = true; bmic_err = true;
} }
if (bmic_err == true) { if (bmic_err) {
if (prxattrib->bdecrypted == true) if (prxattrib->bdecrypted)
r8712_handle_tkip_mic_err(adapter, r8712_handle_tkip_mic_err(adapter,
(u8)IS_MCAST(prxattrib->ra)); (u8)IS_MCAST(prxattrib->ra));
res = _FAIL; res = _FAIL;
} else { } else {
/* mic checked ok */ /* mic checked ok */
if ((psecuritypriv->bcheck_grpkey == if (!psecuritypriv->bcheck_grpkey &&
false) && (IS_MCAST(prxattrib->ra) == IS_MCAST(prxattrib->ra))
true))
psecuritypriv->bcheck_grpkey = true; psecuritypriv->bcheck_grpkey = true;
} }
recvframe_pull_tail(precvframe, 8); recvframe_pull_tail(precvframe, 8);
...@@ -224,7 +223,7 @@ union recv_frame *r8712_decryptor(struct _adapter *padapter, ...@@ -224,7 +223,7 @@ union recv_frame *r8712_decryptor(struct _adapter *padapter,
union recv_frame *return_packet = precv_frame; union recv_frame *return_packet = precv_frame;
if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) ||
(psecuritypriv->sw_decrypt == true))) { psecuritypriv->sw_decrypt)) {
psecuritypriv->hw_decrypted = false; psecuritypriv->hw_decrypted = false;
switch (prxattrib->encrypt) { switch (prxattrib->encrypt) {
case _WEP40_: case _WEP40_:
...@@ -324,8 +323,8 @@ static sint sta2sta_data_frame(struct _adapter *adapter, ...@@ -324,8 +323,8 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
u8 *sta_addr = NULL; u8 *sta_addr = NULL;
sint bmcast = IS_MCAST(pattrib->dst); sint bmcast = IS_MCAST(pattrib->dst);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
/* filter packets that SA is myself or multicast or broadcast */ /* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN))
return _FAIL; return _FAIL;
...@@ -336,13 +335,13 @@ static sint sta2sta_data_frame(struct _adapter *adapter, ...@@ -336,13 +335,13 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
(memcmp(pattrib->bssid, mybssid, ETH_ALEN))) (memcmp(pattrib->bssid, mybssid, ETH_ALEN)))
return _FAIL; return _FAIL;
sta_addr = pattrib->src; sta_addr = pattrib->src;
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* For Station mode, sa and bssid should always be BSSID, /* For Station mode, sa and bssid should always be BSSID,
* and DA is my mac-address */ * and DA is my mac-address */
if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN))
return _FAIL; return _FAIL;
sta_addr = pattrib->bssid; sta_addr = pattrib->bssid;
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) { if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should /* For AP mode, if DA == MCAST, then BSSID should
* be also MCAST */ * be also MCAST */
...@@ -355,7 +354,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter, ...@@ -355,7 +354,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
return _FAIL; return _FAIL;
sta_addr = pattrib->src; sta_addr = pattrib->src;
} }
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN); memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
...@@ -369,7 +368,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter, ...@@ -369,7 +368,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
else else
*psta = r8712_get_stainfo(pstapriv, sta_addr); /* get ap_info */ *psta = r8712_get_stainfo(pstapriv, sta_addr); /* get ap_info */
if (*psta == NULL) { if (*psta == NULL) {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
adapter->mppriv.rx_pktloss++; adapter->mppriv.rx_pktloss++;
return _FAIL; return _FAIL;
} }
...@@ -388,8 +387,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter, ...@@ -388,8 +387,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
u8 *myhwaddr = myid(&adapter->eeprompriv); u8 *myhwaddr = myid(&adapter->eeprompriv);
sint bmcast = IS_MCAST(pattrib->dst); sint bmcast = IS_MCAST(pattrib->dst);
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
&& (check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
/* if NULL-frame, drop packet */ /* if NULL-frame, drop packet */
if ((GetFrameSubType(ptr)) == WIFI_DATA_NULL) if ((GetFrameSubType(ptr)) == WIFI_DATA_NULL)
return _FAIL; return _FAIL;
...@@ -419,8 +418,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter, ...@@ -419,8 +418,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
*psta = r8712_get_stainfo(pstapriv, pattrib->bssid); *psta = r8712_get_stainfo(pstapriv, pattrib->bssid);
if (*psta == NULL) if (*psta == NULL)
return _FAIL; return _FAIL;
} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN); memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
...@@ -444,7 +443,7 @@ static sint sta2ap_data_frame(struct _adapter *adapter, ...@@ -444,7 +443,7 @@ static sint sta2ap_data_frame(struct _adapter *adapter,
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
unsigned char *mybssid = get_bssid(pmlmepriv); unsigned char *mybssid = get_bssid(pmlmepriv);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* For AP mode, if DA is non-MCAST, then it must be BSSID, /* For AP mode, if DA is non-MCAST, then it must be BSSID,
* and bssid == BSSID * and bssid == BSSID
* For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR */ * For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR */
...@@ -630,7 +629,7 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) ...@@ -630,7 +629,7 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe)
rmv_len = pattrib->hdrlen + pattrib->iv_len + rmv_len = pattrib->hdrlen + pattrib->iv_len +
(bsnaphdr ? SNAP_SIZE : 0); (bsnaphdr ? SNAP_SIZE : 0);
len = precvframe->u.hdr.len - rmv_len; len = precvframe->u.hdr.len - rmv_len;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
ptr += rmv_len; ptr += rmv_len;
*ptr = 0x87; *ptr = 0x87;
*(ptr+1) = 0x12; *(ptr+1) = 0x12;
......
...@@ -675,7 +675,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe) ...@@ -675,7 +675,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
idx = iv[3]; idx = iv[3];
prwskey = &psecuritypriv->XGrpKey[ prwskey = &psecuritypriv->XGrpKey[
((idx >> 6) & 0x3) - 1].skey[0]; ((idx >> 6) & 0x3) - 1].skey[0];
if (psecuritypriv->binstallGrpkey == false) if (!psecuritypriv->binstallGrpkey)
return _FAIL; return _FAIL;
} else } else
prwskey = &stainfo->x_UncstKey.skey[0]; prwskey = &stainfo->x_UncstKey.skey[0];
...@@ -1374,7 +1374,7 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe) ...@@ -1374,7 +1374,7 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
idx = iv[3]; idx = iv[3];
prwskey = &psecuritypriv->XGrpKey[ prwskey = &psecuritypriv->XGrpKey[
((idx >> 6) & 0x3) - 1].skey[0]; ((idx >> 6) & 0x3) - 1].skey[0];
if (psecuritypriv->binstallGrpkey == false) if (!psecuritypriv->binstallGrpkey)
return _FAIL; return _FAIL;
} else } else
......
...@@ -83,7 +83,7 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv) ...@@ -83,7 +83,7 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv)
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
phead = &pstapriv->free_sta_queue.queue; phead = &pstapriv->free_sta_queue.queue;
plist = phead->next; plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false) while (!end_of_queue_search(phead, plist))
plist = plist->next; plist = plist->next;
spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL); spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL);
...@@ -222,7 +222,7 @@ void r8712_free_all_stainfo(struct _adapter *padapter) ...@@ -222,7 +222,7 @@ void r8712_free_all_stainfo(struct _adapter *padapter)
for (index = 0; index < NUM_STA; index++) { for (index = 0; index < NUM_STA; index++) {
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
plist = phead->next; plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false) { while (!end_of_queue_search(phead, plist)) {
psta = LIST_CONTAINOR(plist, psta = LIST_CONTAINOR(plist,
struct sta_info, hash_list); struct sta_info, hash_list);
plist = plist->next; plist = plist->next;
...@@ -247,7 +247,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -247,7 +247,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
plist = phead->next; plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false) { while (!end_of_queue_search(phead, plist)) {
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
if ((!memcmp(psta->hwaddr, hwaddr, ETH_ALEN))) { if ((!memcmp(psta->hwaddr, hwaddr, ETH_ALEN))) {
/* if found the matched address */ /* if found the matched address */
......
...@@ -217,8 +217,8 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -217,8 +217,8 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN); memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN);
memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN); memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN);
pattrib->pctrl = 0; pattrib->pctrl = 0;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN); memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
...@@ -227,7 +227,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -227,7 +227,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
/*firstly, filter packet not belongs to mp*/ /*firstly, filter packet not belongs to mp*/
if (pattrib->ether_type != 0x8712) if (pattrib->ether_type != 0x8712)
return _FAIL; return _FAIL;
...@@ -267,7 +267,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -267,7 +267,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
psta = r8712_get_bcmc_stainfo(padapter); psta = r8712_get_bcmc_stainfo(padapter);
pattrib->mac_id = 4; pattrib->mac_id = 4;
} else { } else {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
psta = r8712_get_stainfo(pstapriv, psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv)); get_bssid(pmlmepriv));
pattrib->mac_id = 5; pattrib->mac_id = 5;
...@@ -300,10 +300,10 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -300,10 +300,10 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
pattrib->subtype = WIFI_DATA_TYPE; pattrib->subtype = WIFI_DATA_TYPE;
pattrib->priority = 0; pattrib->priority = 0;
} }
if (psta->ieee8021x_blocked == true) { if (psta->ieee8021x_blocked) {
pattrib->encrypt = 0; pattrib->encrypt = 0;
if ((pattrib->ether_type != 0x888e) && if ((pattrib->ether_type != 0x888e) &&
(check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) !check_fwstate(pmlmepriv, WIFI_MP_STATE))
return _FAIL; return _FAIL;
} else } else
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast); GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast);
...@@ -330,14 +330,14 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -330,14 +330,14 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
} }
if (pattrib->encrypt && if (pattrib->encrypt &&
((padapter->securitypriv.sw_encrypt == true) || (padapter->securitypriv.sw_encrypt ||
(psecuritypriv->hw_decrypted == false))) !psecuritypriv->hw_decrypted))
pattrib->bswenc = true; pattrib->bswenc = true;
else else
pattrib->bswenc = false; pattrib->bswenc = false;
/* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite /* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite
* some settings above.*/ * some settings above.*/
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f; pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f;
return _SUCCESS; return _SUCCESS;
} }
...@@ -483,28 +483,28 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr, ...@@ -483,28 +483,28 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr,
memset(hdr, 0, WLANHDR_OFFSET); memset(hdr, 0, WLANHDR_OFFSET);
SetFrameSubType(fctrl, pattrib->subtype); SetFrameSubType(fctrl, pattrib->subtype);
if (pattrib->subtype & WIFI_DATA_TYPE) { if (pattrib->subtype & WIFI_DATA_TYPE) {
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* to_ds = 1, fr_ds = 0; */ /* to_ds = 1, fr_ds = 0; */
SetToDs(fctrl); SetToDs(fctrl);
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv),
ETH_ALEN); ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* to_ds = 0, fr_ds = 1; */ /* to_ds = 0, fr_ds = 1; */
SetFrDs(fctrl); SetFrDs(fctrl);
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv),
ETH_ALEN); ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN);
} else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
|| (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) check_fwstate(pmlmepriv,
== true)) { WIFI_ADHOC_MASTER_STATE)) {
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
ETH_ALEN); ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
...@@ -609,7 +609,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt, ...@@ -609,7 +609,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt,
return _FAIL; return _FAIL;
_r8712_open_pktfile(pkt, &pktfile); _r8712_open_pktfile(pkt, &pktfile);
_r8712_pktfile_read(&pktfile, NULL, (uint) pattrib->pkt_hdrlen); _r8712_pktfile_read(&pktfile, NULL, (uint) pattrib->pkt_hdrlen);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
/* truncate TXDESC_SIZE bytes txcmd if at mp mode for 871x */ /* truncate TXDESC_SIZE bytes txcmd if at mp mode for 871x */
if (pattrib->ether_type == 0x8712) { if (pattrib->ether_type == 0x8712) {
/* take care - update_txdesc overwrite this */ /* take care - update_txdesc overwrite this */
...@@ -680,7 +680,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt, ...@@ -680,7 +680,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt,
pframe += pattrib->icv_len; pframe += pattrib->icv_len;
} }
frg_inx++; frg_inx++;
if (bmcst || (r8712_endofpktfile(&pktfile) == true)) { if (bmcst || r8712_endofpktfile(&pktfile)) {
pattrib->nr_frags = frg_inx; pattrib->nr_frags = frg_inx;
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->last_txcmdsz = pattrib->hdrlen +
pattrib->iv_len + pattrib->iv_len +
...@@ -855,7 +855,7 @@ void r8712_free_xmitframe_queue(struct xmit_priv *pxmitpriv, ...@@ -855,7 +855,7 @@ void r8712_free_xmitframe_queue(struct xmit_priv *pxmitpriv,
spin_lock_irqsave(&(pframequeue->lock), irqL); spin_lock_irqsave(&(pframequeue->lock), irqL);
phead = &pframequeue->queue; phead = &pframequeue->queue;
plist = phead->next; plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (!end_of_queue_search(phead, plist)) {
pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
plist = plist->next; plist = plist->next;
r8712_free_xmitframe(pxmitpriv, pxmitframe); r8712_free_xmitframe(pxmitpriv, pxmitframe);
...@@ -923,7 +923,7 @@ sint r8712_xmit_classifier(struct _adapter *padapter, ...@@ -923,7 +923,7 @@ sint r8712_xmit_classifier(struct _adapter *padapter,
if (bmcst) if (bmcst)
psta = r8712_get_bcmc_stainfo(padapter); psta = r8712_get_bcmc_stainfo(padapter);
else { else {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
psta = r8712_get_stainfo(pstapriv, psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv)); get_bssid(pmlmepriv));
else else
......
...@@ -302,7 +302,7 @@ void rtl871x_intf_stop(struct _adapter *padapter) ...@@ -302,7 +302,7 @@ void rtl871x_intf_stop(struct _adapter *padapter)
void r871x_dev_unload(struct _adapter *padapter) void r871x_dev_unload(struct _adapter *padapter)
{ {
if (padapter->bup == true) { if (padapter->bup) {
/*s1.*/ /*s1.*/
padapter->bDriverStopped = true; padapter->bDriverStopped = true;
...@@ -611,7 +611,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf) ...@@ -611,7 +611,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
release_firmware(padapter->fw); release_firmware(padapter->fw);
/* 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 == true) if (drvpriv.drv_registered)
padapter->bSurpriseRemoved = true; padapter->bSurpriseRemoved = true;
unregister_netdev(pnetdev); /* will call netdev_close() */ unregister_netdev(pnetdev); /* will call netdev_close() */
flush_scheduled_work(); flush_scheduled_work();
......
...@@ -266,7 +266,7 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) ...@@ -266,7 +266,7 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
if (adapter->bDriverStopped || adapter->bSurpriseRemoved || if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||
adapter->pwrctrlpriv.pnp_bstop_trx) adapter->pwrctrlpriv.pnp_bstop_trx)
return _FAIL; return _FAIL;
if (!precvbuf->reuse == false || !precvbuf->pskb) { if (precvbuf->reuse || !precvbuf->pskb) {
precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue); precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue);
if (precvbuf->pskb != NULL) if (precvbuf->pskb != NULL)
precvbuf->reuse = true; precvbuf->reuse = true;
...@@ -330,13 +330,13 @@ void r8712_xmit_bh(void *priv) ...@@ -330,13 +330,13 @@ void r8712_xmit_bh(void *priv)
struct _adapter *padapter = (struct _adapter *)priv; struct _adapter *padapter = (struct _adapter *)priv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
if ((padapter->bDriverStopped == true) || if (padapter->bDriverStopped ||
(padapter->bSurpriseRemoved == true)) { padapter->bSurpriseRemoved) {
netdev_err(padapter->pnetdev, "xmit_bh => bDriverStopped or bSurpriseRemoved\n"); netdev_err(padapter->pnetdev, "xmit_bh => bDriverStopped or bSurpriseRemoved\n");
return; return;
} }
ret = r8712_xmitframe_complete(padapter, pxmitpriv, NULL); ret = r8712_xmitframe_complete(padapter, pxmitpriv, NULL);
if (ret == false) if (!ret)
return; return;
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
} }
...@@ -410,7 +410,7 @@ u32 r8712_usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) ...@@ -410,7 +410,7 @@ u32 r8712_usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
(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++) {
if (pxmitframe->bpending[i] == false) { if (!pxmitframe->bpending[i]) {
spin_lock_irqsave(&pxmitpriv->lock, irqL); spin_lock_irqsave(&pxmitpriv->lock, irqL);
pxmitpriv->txirp_cnt++; pxmitpriv->txirp_cnt++;
pxmitframe->bpending[i] = true; pxmitframe->bpending[i] = true;
......
...@@ -166,7 +166,7 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev) ...@@ -166,7 +166,7 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev)
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
int ret = 0; int ret = 0;
if (r8712_if_up(padapter) == false) { if (!r8712_if_up(padapter)) {
ret = 0; ret = 0;
goto _xmit_entry_drop; goto _xmit_entry_drop;
} }
...@@ -181,7 +181,7 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev) ...@@ -181,7 +181,7 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev)
} }
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_TX); padapter->ledpriv.LedControlHandler(padapter, LED_CTL_TX);
pxmitframe->pkt = pkt; pxmitframe->pkt = pkt;
if (r8712_pre_xmit(padapter, pxmitframe) == true) { if (r8712_pre_xmit(padapter, pxmitframe)) {
/*dump xmitframe directly or drop xframe*/ /*dump xmitframe directly or drop xframe*/
dev_kfree_skb_any(pkt); dev_kfree_skb_any(pkt);
pxmitframe->pkt = NULL; pxmitframe->pkt = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment