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)
struct _adapter *padapter = netdev_priv(pnetdev);
struct sockaddr *addr = p;
if (padapter->bup == false)
if (!padapter->bup)
ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
return 0;
}
......@@ -384,7 +384,7 @@ static int netdev_open(struct net_device *pnetdev)
struct _adapter *padapter = netdev_priv(pnetdev);
mutex_lock(&padapter->mutex_start);
if (padapter->bup == false) {
if (!padapter->bup) {
padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false;
padapter->bup = true;
......
......@@ -85,7 +85,7 @@ static void query_fw_rx_phy_status(struct _adapter *padapter)
u32 val32 = 0;
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);
msleep(100);
/* Wait FW complete IO Cmd */
......@@ -324,8 +324,7 @@ int r8712_cmd_thread(void *context)
while (1) {
if ((_down_sema(&(pcmdpriv->cmd_queue_sema))) == _FAIL)
break;
if ((padapter->bDriverStopped == true) ||
(padapter->bSurpriseRemoved == true))
if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
break;
if (r8712_register_cmd_alive(padapter) != _SUCCESS)
continue;
......@@ -375,8 +374,8 @@ int r8712_cmd_thread(void *context)
pcmdbuf += 2; /* 8 bytes alignment */
memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
while (check_cmd_fifo(padapter, wr_sz) == _FAIL) {
if ((padapter->bDriverStopped == true) ||
(padapter->bSurpriseRemoved == true))
if (padapter->bDriverStopped ||
padapter->bSurpriseRemoved)
break;
msleep(100);
continue;
......
......@@ -39,7 +39,7 @@ static void efuse_reg_ctrl(struct _adapter *padapter, u8 bPowerOn)
{
u8 tmpu8 = 0;
if (true == bPowerOn) {
if (bPowerOn) {
/* -----------------e-fuse pwr & clk reg ctrl ---------------
* Enable LDOE25 Macro Block
*/
......@@ -127,7 +127,7 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr,
tmpv8 = ((u8)((addr >> 8) & 0x03)) |
(r8712_read8(padapter, EFUSE_CTRL + 2) & 0xFC);
r8712_write8(padapter, EFUSE_CTRL+2, tmpv8);
if (true == bRead) {
if (bRead) {
r8712_write8(padapter, EFUSE_CTRL+3, 0x72); /* read cmd */
while (!(0x80 & r8712_read8(padapter, EFUSE_CTRL+3)) &&
(tmpidx < 100))
......@@ -158,7 +158,7 @@ static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty)
u8 value, ret = true;
/* 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)
*empty = true;
else
......@@ -250,8 +250,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
return false;
memset(data, 0xFF, sizeof(u8)*PGPKT_DATA_SIZE);
while (efuse_addr < efuse_available_max_size) {
if (efuse_one_byte_read(padapter, efuse_addr, &efuse_data) ==
true) {
if (efuse_one_byte_read(padapter, efuse_addr, &efuse_data)) {
if (efuse_data == 0xFF)
break;
hoffset = (efuse_data >> 4) & 0x0F;
......@@ -262,8 +261,7 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
for (tmpidx = 0; tmpidx < word_cnts * 2;
tmpidx++) {
if (efuse_one_byte_read(padapter,
efuse_addr+1+tmpidx, &efuse_data) ==
true) {
efuse_addr+1+tmpidx, &efuse_data)) {
tmpdata[tmpidx] = efuse_data;
} else
ret = false;
......@@ -295,7 +293,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
/* retrieve original data */
addr = 0;
while (addr < header_addr) {
if (efuse_one_byte_read(padapter, addr++, &value) == false) {
if (!efuse_one_byte_read(padapter, addr++, &value)) {
ret = false;
break;
}
......@@ -310,14 +308,14 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
if (BIT(i) & pkt.word_en) {
if (efuse_one_byte_read(
padapter, addr,
&value) == true)
&value))
pkt.data[i*2] = value;
else
return false;
if (efuse_one_byte_read(
padapter,
addr + 1,
&value) == true)
&value))
pkt.data[i*2 + 1] =
value;
else
......@@ -337,8 +335,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
efuse_one_byte_write(padapter, addr+1,
pkt.data[i*2 + 1]);
/* additional check */
if (efuse_one_byte_read(padapter, addr, &value)
== false)
if (!efuse_one_byte_read(padapter, addr, &value))
ret = false;
else if (pkt.data[i*2] != value) {
ret = false;
......@@ -346,8 +343,7 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
efuse_one_byte_write(padapter, addr,
pkt.data[i * 2]);
}
if (efuse_one_byte_read(padapter, addr+1, &value) ==
false)
if (!efuse_one_byte_read(padapter, addr+1, &value))
ret = false;
else if (pkt.data[i*2 + 1] != value) {
ret = false;
......@@ -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*/
sub_repeat = 0;
/* check if what we read is what we write */
while (efuse_one_byte_read(padapter, efuse_addr,
&efuse_data) == false) {
while (!efuse_one_byte_read(padapter, efuse_addr,
&efuse_data)) {
if (++sub_repeat > _REPEAT_THRESHOLD_) {
bResult = false; /* 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,
efuse_one_byte_write(padapter,
efuse_addr + i,
*(data + i));
if (efuse_one_byte_read(padapter,
efuse_addr + i, &efuse_data) == false)
if (!efuse_one_byte_read(padapter,
efuse_addr + i,
&efuse_data))
bResult = false;
else if (*(data+i) != efuse_data) /* fail */
bResult = false;
......@@ -437,10 +434,10 @@ u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr,
if (start_addr > EFUSE_MAX_SIZE)
return false;
if ((bRead == false) && ((start_addr + cnts) >
if (!bRead && ((start_addr + cnts) >
efuse_available_max_size))
return false;
if ((false == bRead) && (r8712_efuse_reg_init(padapter) == false))
if (!bRead && !r8712_efuse_reg_init(padapter))
return false;
/* -----------------e-fuse one byte read / write ---------------------*/
for (i = 0; i < cnts; i++) {
......@@ -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,
data + i);
if ((false == bRead) && (false == res))
if (!bRead && !res)
break;
}
if (false == bRead)
if (!bRead)
r8712_efuse_reg_uninit(padapter);
return res;
}
......@@ -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)
return false;
if ((efuse_is_empty(padapter, &offset) == true) && (offset ==
true)) {
if (efuse_is_empty(padapter, &offset) && offset) {
for (i = 0; i < cnts; i++)
data[i] = 0xFF;
return ret;
......@@ -504,13 +500,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
empty = r8712_read8(padapter, EFUSE_CLK_CTRL);
if (empty != 0x03)
return false;
if (efuse_is_empty(padapter, &empty) == true) {
if (true == empty)
if (efuse_is_empty(padapter, &empty)) {
if (empty)
memset(pktdata, 0xFF, PGPKT_DATA_SIZE);
} else
return false;
offset = (addr >> 3) & 0xF;
if (empty == false)
if (!empty)
if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata))
return false;
word_en = 0xF;
......@@ -554,13 +550,13 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
}
if (word_en != 0xF)
if (r8712_efuse_pg_packet_write(padapter, offset,
word_en, newdata) == false)
if (!r8712_efuse_pg_packet_write(padapter, offset,
word_en, newdata))
return false;
if (idx == cnts)
break;
offset++;
if (empty == false)
if (!empty)
if (!r8712_efuse_pg_packet_read(padapter, offset,
pktdata))
return false;
......
......@@ -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,
u8 *pmem);
if ((adapter->bDriverStopped == true) ||
(adapter->bSurpriseRemoved == true))
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
return;
_read_mem = pintfhdl->io_ops._read_mem;
_read_mem(pintfhdl, addr, cnt, 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,
u8 *pmem);
if ((adapter->bDriverStopped == true) ||
(adapter->bSurpriseRemoved == true))
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
return;
_read_port = pintfhdl->io_ops._read_port;
_read_port(pintfhdl, addr, cnt, pmem);
......
This diff is collapsed.
......@@ -217,7 +217,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
curfragnum++;
plist = &defrag_q->queue;
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);
pnfhdr = &pnextrframe->u.hdr;
/*check the fragment sequence (2nd ~n fragment frame) */
......@@ -489,7 +489,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
phead = &ppending_recvframe_queue->queue;
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);
pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
......@@ -519,7 +519,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
phead = &ppending_recvframe_queue->queue;
plist = phead->next;
/* Handling some condition for forced indicate case.*/
if (bforced == true) {
if (bforced) {
if (list_empty(phead))
return true;
......@@ -541,8 +541,8 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
(preorder_ctrl->indicate_seq + 1) % 4096;
/*indicate this recv_frame*/
if (!pattrib->amsdu) {
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
if (!padapter->bDriverStopped &&
!padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
r8712_recv_indicatepkt(padapter,
prframe);
......@@ -576,8 +576,8 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter,
/* s1. */
r8712_wlanhdr_to_ethhdr(prframe);
if (pattrib->qos != 1) {
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
if (!padapter->bDriverStopped &&
!padapter->bSurpriseRemoved) {
r8712_recv_indicatepkt(padapter, prframe);
return _SUCCESS;
} else
......@@ -643,16 +643,15 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter,
if (phtpriv->ht_option == 1) { /*B/G/N Mode*/
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) {
/* including perform A-MPDU Rx Ordering Buffer Control*/
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false))
if (!padapter->bDriverStopped &&
!padapter->bSurpriseRemoved)
return _FAIL;
}
} else { /*B/G mode*/
retval = r8712_wlanhdr_to_ethhdr(prframe);
if (retval != _SUCCESS)
return retval;
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, prframe);
} else
......@@ -962,12 +961,12 @@ int recv_func(struct _adapter *padapter, void *pcontext)
prframe = (union recv_frame *)pcontext;
orig_prframe = prframe;
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)
padapter->mppriv.rx_crcerrpktcount++;
else
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 */
r8712_free_recvframe(orig_prframe, pfree_recv_queue);
goto _exit_recv_func;
......
......@@ -168,7 +168,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
xmitframe_phead = &pframe_queue->queue;
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,
struct xmit_frame, list);
list_del_init(&pxmitframe->list);
......@@ -208,7 +208,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
phwxmit = phwxmit_i + inx[i];
sta_phead = &phwxmit->sta_queue->queue;
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,
tx_pending);
pframe_queue = &ptxservq->sta_pending;
......
......@@ -172,7 +172,7 @@ u32 r8712_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
{
int res;
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true)
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL;
res = _enqueue_cmd(&pcmdpriv->cmd_queue, obj);
up(&pcmdpriv->cmd_queue_sema);
......@@ -186,7 +186,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
if (obj == NULL)
return _SUCCESS;
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true)
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
return _FAIL;
queue = &pcmdpriv->cmd_queue;
spin_lock_irqsave(&queue->lock, irqL);
......@@ -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
* 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],
&pnetwork->network.MacAddress[0]);
psecnetwork->IELength = r8712_restruct_sec_ie(padapter,
......@@ -679,7 +679,7 @@ u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
else
GET_ENCRY_ALGO(psecuritypriv, sta,
psetstakey_para->algorithm, false);
if (unicast_key == true)
if (unicast_key)
memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
else
memcpy(&psetstakey_para->key,
......
......@@ -49,7 +49,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
{
u16 x, mask;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
mask = 0x01 << (count - 1);
x = r8712_read8(padapter, EE_9346CR);
......@@ -58,7 +58,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
x &= ~_EEDI;
if (data & mask)
x |= _EEDI;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
r8712_write8(padapter, EE_9346CR, (u8)x);
udelay(CLOCK_RATE);
......@@ -66,7 +66,7 @@ static void shift_out_bits(struct _adapter *padapter, u16 data, u16 count)
down_clk(padapter, &x);
mask >>= 1;
} while (mask);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x &= ~_EEDI;
r8712_write8(padapter, EE_9346CR, (u8)x);
......@@ -77,7 +77,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
{
u16 x, d = 0, i;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDO | _EEDI);
......@@ -85,7 +85,7 @@ static u16 shift_in_bits(struct _adapter *padapter)
for (i = 0; i < 16; i++) {
d <<= 1;
up_clk(padapter, &x);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x = r8712_read8(padapter, EE_9346CR);
x &= ~(_EEDI);
......@@ -129,17 +129,17 @@ static void eeprom_clean(struct _adapter *padapter)
{
u16 x;
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
x &= ~(_EECS | _EEDI);
r8712_write8(padapter, EE_9346CR, (u8)x);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
up_clk(padapter, &x);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
return;
down_clk(padapter, &x);
}
......@@ -206,11 +206,11 @@ u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg) /*ReadEEprom*/
tmp8_clk_new = tmp8_clk_ori | 0x20;
if (tmp8_clk_new != tmp8_clk_ori)
r8712_write8(padapter, 0x10250003, tmp8_clk_new);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
/* select EEPROM, reset bits, set _EECS */
x = r8712_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved == true)
if (padapter->bSurpriseRemoved)
goto out;
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
x |= _EEM1 | _EECS;
......
......@@ -178,17 +178,17 @@ static inline char *translate_scan(struct _adapter *padapter,
/* Add the protocol name */
iwe.cmd = SIOCGIWNAME;
if (r8712_is_cckratesonly_included(pnetwork->network.rates)) {
if (ht_cap == true)
if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bn");
else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b");
} else if (r8712_is_cckrates_included(pnetwork->network.rates)) {
if (ht_cap == true)
if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bgn");
else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg");
} else {
if (ht_cap == true)
if (ht_cap)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11gn");
else
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g");
......@@ -310,7 +310,7 @@ static inline char *translate_scan(struct _adapter *padapter,
if (r8712_get_wps_ie(pnetwork->network.IEs,
pnetwork->network.IELength,
wps_ie, &wps_ielen) == true) {
wps_ie, &wps_ielen)) {
if (wps_ielen > 2) {
iwe.cmd = IWEVGENIE;
iwe.u.data.length = (u16)wps_ielen;
......@@ -443,7 +443,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
struct sta_priv *pstapriv = &padapter->stapriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE |
WIFI_MP_STATE) == true) { /* sta mode */
WIFI_MP_STATE)) { /* sta mode */
psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv));
if (psta) {
......@@ -617,22 +617,22 @@ static int r8711_wx_get_name(struct net_device *dev,
if (p && ht_ielen > 0)
ht_cap = true;
prates = pcur_bss->rates;
if (r8712_is_cckratesonly_included(prates) == true) {
if (ht_cap == true)
if (r8712_is_cckratesonly_included(prates)) {
if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bn");
else
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11b");
} else if ((r8712_is_cckrates_included(prates)) == true) {
if (ht_cap == true)
} else if (r8712_is_cckrates_included(prates)) {
if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bgn");
else
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11bg");
} else {
if (ht_cap == true)
if (ht_cap)
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11gn");
else
......@@ -697,7 +697,7 @@ static int r8711_wx_get_freq(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
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[
pcur_bss->Configuration.DSConfig-1] * 100000;
wrqu->freq.e = 1;
......@@ -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 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;
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;
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
wrqu->mode = IW_MODE_MASTER;
else
wrqu->mode = IW_MODE_AUTO;
......@@ -940,7 +940,7 @@ static int r871x_wx_set_priv(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
/*static u8 xxxx; */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
sprintf(ext, "%s rssi %d",
pcur_network->network.Ssid.Ssid,
/*(xxxx=xxxx+10) */
......@@ -1044,9 +1044,9 @@ static int r8711_wx_set_wap(struct net_device *dev,
struct wlan_network *pnetwork = NULL;
enum NDIS_802_11_AUTHENTICATION_MODE authmode;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true)
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
return -EBUSY;
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
return ret;
if (temp->sa_family != ARPHRD_ETHER)
return -EINVAL;
......@@ -1055,7 +1055,7 @@ static int r8711_wx_set_wap(struct net_device *dev,
phead = &queue->queue;
pmlmepriv->pscanned = phead->next;
while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned) == true)
if (end_of_queue_search(phead, pmlmepriv->pscanned))
break;
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
struct wlan_network, list);
......@@ -1137,17 +1137,17 @@ static int r8711_wx_set_scan(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 status = true;
if (padapter->bDriverStopped == true) {
if (padapter->bDriverStopped) {
netdev_info(dev, "In %s: bDriverStopped=%d\n",
__func__, padapter->bDriverStopped);
return -1;
}
if (padapter->bup == false)
if (!padapter->bup)
return -ENETDOWN;
if (padapter->hw_init_completed == false)
if (!padapter->hw_init_completed)
return -1;
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true))
(pmlmepriv->sitesurveyctrl.traffic_busy))
return 0;
if (wrqu->data.length == sizeof(struct iw_scan_req)) {
struct iw_scan_req *req = (struct iw_scan_req *)extra;
......@@ -1164,7 +1164,7 @@ static int r8711_wx_set_scan(struct net_device *dev,
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY |
_FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true)) {
(pmlmepriv->sitesurveyctrl.traffic_busy)) {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
status = false;
} else
......@@ -1173,7 +1173,7 @@ static int r8711_wx_set_scan(struct net_device *dev,
}
} else
status = r8712_set_802_11_bssid_list_scan(padapter);
if (status == false)
if (!status)
return -1;
return 0;
}
......@@ -1204,7 +1204,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
phead = &queue->queue;
plist = phead->next;
while (1) {
if (end_of_queue_search(phead, plist) == true)
if (end_of_queue_search(phead, plist))
break;
if ((stop - ev) < SCAN_ITEM_SIZE) {
ret = -E2BIG;
......@@ -1427,7 +1427,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
wrqu->bitrate.value = rate*500000;
i++;
}
if (ht_cap == true) {
if (ht_cap) {
if (mcs_rate & 0x8000 /* MCS15 */
&&
rf_type == RTL8712_RF_2T2R)
......@@ -1599,7 +1599,7 @@ static int r8711_wx_get_enc(struct net_device *dev,
struct iw_point *erq = &(wrqu->encoding);
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)) {
erq->length = 0;
erq->flags |= IW_ENCODE_DISABLED;
......@@ -1973,7 +1973,7 @@ static int r871x_get_ap_info(struct net_device *dev,
phead = &queue->queue;
plist = phead->next;
while (1) {
if (end_of_queue_search(phead, plist) == true)
if (end_of_queue_search(phead, plist))
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (!mac_pton(data, bssid)) {
......
......@@ -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)
return RNDIS_STATUS_NOT_ACCEPTED;
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true))
if (check_fwstate(pmlmepriv, _FW_LINKED) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
pnic_Config = &pmlmepriv->cur_network.network.Configuration;
else
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)
if (poid_par_priv->type_of_oid != SET_OID) /* QUERY_OID */
return RNDIS_STATUS_NOT_ACCEPTED;
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;
else {
/* init workparam */
......@@ -515,11 +515,11 @@ uint oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv)
* nStatus==2 AdHocMode
* nStatus==3 NotAssociated
*/
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
ulInfo = CHECKINGSTATUS;
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
else if (check_fwstate(pmlmepriv, _FW_LINKED))
ulInfo = ASSOCIATED;
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
ulInfo = ADHOCMODE;
else
ulInfo = NOTASSOCIATED;
......
......@@ -136,12 +136,12 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
}
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY |
_FW_UNDER_LINKING) == true) {
_FW_UNDER_LINKING)) {
status = check_fwstate(pmlmepriv, _FW_UNDER_LINKING);
goto _Abort_Set_BSSID;
}
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,
ETH_ALEN)) {
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE))
......@@ -149,7 +149,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
* WIFI_ADHOC_MASTER_STATE */
} else {
r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
if (check_fwstate(pmlmepriv, _FW_LINKED))
r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter);
if ((check_fwstate(pmlmepriv,
......@@ -197,7 +197,7 @@ void r8712_set_802_11_ssid(struct _adapter *padapter,
*/
r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv,
_FW_LINKED) == true)
_FW_LINKED))
r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter);
if (check_fwstate(pmlmepriv,
......@@ -213,18 +213,18 @@ void r8712_set_802_11_ssid(struct _adapter *padapter,
}
} else {
r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
if (check_fwstate(pmlmepriv, _FW_LINKED))
r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter);
if (check_fwstate(pmlmepriv,
WIFI_ADHOC_MASTER_STATE) == true) {
WIFI_ADHOC_MASTER_STATE)) {
_clr_fwstate_(pmlmepriv,
WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
}
}
}
if (padapter->securitypriv.btkip_countermeasure == true)
if (padapter->securitypriv.btkip_countermeasure)
goto _Abort_Set_SSID;
if (!validate_ssid(ssid))
goto _Abort_Set_SSID;
......@@ -248,13 +248,13 @@ void r8712_set_802_11_infrastructure_mode(struct _adapter *padapter,
if (*pold_state != networktype) {
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||
if (check_fwstate(pmlmepriv, _FW_LINKED) ||
(*pold_state == Ndis802_11IBSS))
r8712_disassoc_cmd(padapter);
if (check_fwstate(pmlmepriv,
_FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true)
_FW_LINKED | WIFI_ADHOC_MASTER_STATE))
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_11IBSS)) {
/* will clr Linked_state before this function,
......@@ -291,7 +291,7 @@ u8 r8712_set_802_11_disassociate(struct _adapter *padapter)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
r8712_disassoc_cmd(padapter);
r8712_ind_disconnect(padapter);
r8712_free_assoc_resources(padapter);
......@@ -312,8 +312,8 @@ u8 r8712_set_802_11_bssid_list_scan(struct _adapter *padapter)
if (!padapter->hw_init_completed)
return false;
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)) ||
(pmlmepriv->sitesurveyctrl.traffic_busy == true)) {
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) ||
pmlmepriv->sitesurveyctrl.traffic_busy) {
/* Scan or linking is in progress, do nothing. */
ret = (u8)check_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
} else {
......
This diff is collapsed.
......@@ -153,7 +153,7 @@ static inline void clr_fwstate(struct mlme_priv *pmlmepriv, sint state)
unsigned long irqL;
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, state) == true)
if (check_fwstate(pmlmepriv, state))
pmlmepriv->fw_state ^= state;
spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
}
......
......@@ -181,7 +181,7 @@ static int mp_start_test(struct _adapter *padapter)
} else
bssid.Length = length;
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;
/*init mp_start_test status*/
pmppriv->prev_fw_state = get_fwstate(pmlmepriv);
......@@ -223,7 +223,7 @@ static int mp_stop_test(struct _adapter *padapter)
unsigned long 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;
/* 3 1. disconnect psudo AdHoc */
r8712_os_indicate_disconnect(padapter);
......@@ -247,9 +247,9 @@ int mp_start_joinbss(struct _adapter *padapter, struct ndis_802_11_ssid *pssid)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned char res = _SUCCESS;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)
if (!check_fwstate(pmlmepriv, WIFI_MP_STATE))
return _FAIL;
if (check_fwstate(pmlmepriv, _FW_LINKED) == false)
if (!check_fwstate(pmlmepriv, _FW_LINKED))
return _FAIL;
_clr_fwstate_(pmlmepriv, _FW_LINKED);
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)
if (poid_par_priv->type_of_oid != QUERY_OID)
return RNDIS_STATUS_NOT_ACCEPTED;
if (Adapter->mppriv.act_in_progress == true)
if (Adapter->mppriv.act_in_progress)
return RNDIS_STATUS_NOT_ACCEPTED;
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)
if ((addr > 511) || (cnts < 1) || (cnts > 512) || (addr + cnts) >
EFUSE_MAX_SIZE)
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;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
return status;
......@@ -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) ||
(addr + cnts) > r8712_efuse_get_max_size(Adapter))
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;
return status;
}
......@@ -824,7 +824,7 @@ uint oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv)
status = RNDIS_STATUS_FAILURE;
} else {
/* SET_OID */
if (r8712_efuse_reg_init(Adapter) == true) {
if (r8712_efuse_reg_init(Adapter)) {
if (r8712_efuse_map_write(Adapter, 0,
EFUSE_MAP_MAX_SIZE, data))
*poid_par_priv->bytes_rw = EFUSE_MAP_MAX_SIZE;
......
......@@ -44,8 +44,7 @@ void r8712_set_rpwm(struct _adapter *padapter, u8 val8)
if (pwrpriv->rpwm_retry == 0)
return;
}
if ((padapter->bDriverStopped == true) ||
(padapter->bSurpriseRemoved == true))
if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
return;
rpwm = val8 | pwrpriv->tog;
switch (val8) {
......@@ -129,8 +128,7 @@ static void _rpwm_check_handler (struct _adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
if (padapter->bDriverStopped == true ||
padapter->bSurpriseRemoved == true)
if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
return;
if (pwrpriv->cpwm != pwrpriv->rpwm)
schedule_work(&pwrpriv->rpwm_workitem);
......
......@@ -147,7 +147,7 @@ void r8712_free_recvframe_queue(struct __queue *pframequeue,
spin_lock(&pframequeue->lock);
phead = &pframequeue->queue;
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);
plist = plist->next;
r8712_free_recvframe(precvframe, pfree_recv_queue);
......@@ -178,7 +178,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
idx = iv[3];
mickey = &psecuritypriv->XGrprxmickey[(((idx >>
6) & 0x3)) - 1].skey[0];
if (psecuritypriv->binstallGrpkey == false)
if (!psecuritypriv->binstallGrpkey)
return _FAIL;
} else
mickey = &stainfo->tkiprxmickey.skey[0];
......@@ -197,16 +197,15 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
if (miccode[i] != *(pframemic + i))
bmic_err = true;
}
if (bmic_err == true) {
if (prxattrib->bdecrypted == true)
if (bmic_err) {
if (prxattrib->bdecrypted)
r8712_handle_tkip_mic_err(adapter,
(u8)IS_MCAST(prxattrib->ra));
res = _FAIL;
} else {
/* mic checked ok */
if ((psecuritypriv->bcheck_grpkey ==
false) && (IS_MCAST(prxattrib->ra) ==
true))
if (!psecuritypriv->bcheck_grpkey &&
IS_MCAST(prxattrib->ra))
psecuritypriv->bcheck_grpkey = true;
}
recvframe_pull_tail(precvframe, 8);
......@@ -224,7 +223,7 @@ union recv_frame *r8712_decryptor(struct _adapter *padapter,
union recv_frame *return_packet = precv_frame;
if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) ||
(psecuritypriv->sw_decrypt == true))) {
psecuritypriv->sw_decrypt)) {
psecuritypriv->hw_decrypted = false;
switch (prxattrib->encrypt) {
case _WEP40_:
......@@ -324,8 +323,8 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
u8 *sta_addr = NULL;
sint bmcast = IS_MCAST(pattrib->dst);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
/* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN))
return _FAIL;
......@@ -336,13 +335,13 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
(memcmp(pattrib->bssid, mybssid, ETH_ALEN)))
return _FAIL;
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,
* and DA is my mac-address */
if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN))
return _FAIL;
sta_addr = pattrib->bssid;
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should
* be also MCAST */
......@@ -355,7 +354,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
return _FAIL;
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->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
......@@ -369,7 +368,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
else
*psta = r8712_get_stainfo(pstapriv, sta_addr); /* get ap_info */
if (*psta == NULL) {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
adapter->mppriv.rx_pktloss++;
return _FAIL;
}
......@@ -388,8 +387,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
u8 *myhwaddr = myid(&adapter->eeprompriv);
sint bmcast = IS_MCAST(pattrib->dst);
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
&& (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
check_fwstate(pmlmepriv, _FW_LINKED)) {
/* if NULL-frame, drop packet */
if ((GetFrameSubType(ptr)) == WIFI_DATA_NULL)
return _FAIL;
......@@ -419,8 +418,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
*psta = r8712_get_stainfo(pstapriv, pattrib->bssid);
if (*psta == NULL)
return _FAIL;
} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
check_fwstate(pmlmepriv, _FW_LINKED)) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
......@@ -444,7 +443,7 @@ static sint sta2ap_data_frame(struct _adapter *adapter,
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
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,
* and bssid == BSSID
* 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)
rmv_len = pattrib->hdrlen + pattrib->iv_len +
(bsnaphdr ? SNAP_SIZE : 0);
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 = 0x87;
*(ptr+1) = 0x12;
......
......@@ -675,7 +675,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
idx = iv[3];
prwskey = &psecuritypriv->XGrpKey[
((idx >> 6) & 0x3) - 1].skey[0];
if (psecuritypriv->binstallGrpkey == false)
if (!psecuritypriv->binstallGrpkey)
return _FAIL;
} else
prwskey = &stainfo->x_UncstKey.skey[0];
......@@ -1374,7 +1374,7 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
idx = iv[3];
prwskey = &psecuritypriv->XGrpKey[
((idx >> 6) & 0x3) - 1].skey[0];
if (psecuritypriv->binstallGrpkey == false)
if (!psecuritypriv->binstallGrpkey)
return _FAIL;
} else
......
......@@ -83,7 +83,7 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv)
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
phead = &pstapriv->free_sta_queue.queue;
plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false)
while (!end_of_queue_search(phead, plist))
plist = plist->next;
spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL);
......@@ -222,7 +222,7 @@ void r8712_free_all_stainfo(struct _adapter *padapter)
for (index = 0; index < NUM_STA; index++) {
phead = &(pstapriv->sta_hash[index]);
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);
plist = plist->next;
......@@ -247,7 +247,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
phead = &(pstapriv->sta_hash[index]);
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);
if ((!memcmp(psta->hwaddr, hwaddr, ETH_ALEN))) {
/* if found the matched address */
......
......@@ -217,8 +217,8 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN);
memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN);
pattrib->pctrl = 0;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
......@@ -227,7 +227,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
memcpy(pattrib->ra, pattrib->dst, 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*/
if (pattrib->ether_type != 0x8712)
return _FAIL;
......@@ -267,7 +267,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
psta = r8712_get_bcmc_stainfo(padapter);
pattrib->mac_id = 4;
} else {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv));
pattrib->mac_id = 5;
......@@ -300,10 +300,10 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
pattrib->subtype = WIFI_DATA_TYPE;
pattrib->priority = 0;
}
if (psta->ieee8021x_blocked == true) {
if (psta->ieee8021x_blocked) {
pattrib->encrypt = 0;
if ((pattrib->ether_type != 0x888e) &&
(check_fwstate(pmlmepriv, WIFI_MP_STATE) == false))
!check_fwstate(pmlmepriv, WIFI_MP_STATE))
return _FAIL;
} else
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast);
......@@ -330,14 +330,14 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
}
if (pattrib->encrypt &&
((padapter->securitypriv.sw_encrypt == true) ||
(psecuritypriv->hw_decrypted == false)))
(padapter->securitypriv.sw_encrypt ||
!psecuritypriv->hw_decrypted))
pattrib->bswenc = true;
else
pattrib->bswenc = false;
/* if in MP_STATE, update pkt_attrib from mp_txcmd, and overwrite
* 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;
return _SUCCESS;
}
......@@ -483,28 +483,28 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr,
memset(hdr, 0, WLANHDR_OFFSET);
SetFrameSubType(fctrl, pattrib->subtype);
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; */
SetToDs(fctrl);
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv),
ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, 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; */
SetFrDs(fctrl);
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv),
ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN);
} else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)
|| (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)
== true)) {
} else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
check_fwstate(pmlmepriv,
WIFI_ADHOC_MASTER_STATE)) {
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
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->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
......@@ -609,7 +609,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt,
return _FAIL;
_r8712_open_pktfile(pkt, &pktfile);
_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 */
if (pattrib->ether_type == 0x8712) {
/* take care - update_txdesc overwrite this */
......@@ -680,7 +680,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt,
pframe += pattrib->icv_len;
}
frg_inx++;
if (bmcst || (r8712_endofpktfile(&pktfile) == true)) {
if (bmcst || r8712_endofpktfile(&pktfile)) {
pattrib->nr_frags = frg_inx;
pattrib->last_txcmdsz = pattrib->hdrlen +
pattrib->iv_len +
......@@ -855,7 +855,7 @@ void r8712_free_xmitframe_queue(struct xmit_priv *pxmitpriv,
spin_lock_irqsave(&(pframequeue->lock), irqL);
phead = &pframequeue->queue;
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);
plist = plist->next;
r8712_free_xmitframe(pxmitpriv, pxmitframe);
......@@ -923,7 +923,7 @@ sint r8712_xmit_classifier(struct _adapter *padapter,
if (bmcst)
psta = r8712_get_bcmc_stainfo(padapter);
else {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)
if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv));
else
......
......@@ -302,7 +302,7 @@ void rtl871x_intf_stop(struct _adapter *padapter)
void r871x_dev_unload(struct _adapter *padapter)
{
if (padapter->bup == true) {
if (padapter->bup) {
/*s1.*/
padapter->bDriverStopped = true;
......@@ -611,7 +611,7 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
release_firmware(padapter->fw);
/* never exit with a firmware callback pending */
wait_for_completion(&padapter->rtl8712_fw_ready);
if (drvpriv.drv_registered == true)
if (drvpriv.drv_registered)
padapter->bSurpriseRemoved = true;
unregister_netdev(pnetdev); /* will call netdev_close() */
flush_scheduled_work();
......
......@@ -266,7 +266,7 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||
adapter->pwrctrlpriv.pnp_bstop_trx)
return _FAIL;
if (!precvbuf->reuse == false || !precvbuf->pskb) {
if (precvbuf->reuse || !precvbuf->pskb) {
precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue);
if (precvbuf->pskb != NULL)
precvbuf->reuse = true;
......@@ -330,13 +330,13 @@ void r8712_xmit_bh(void *priv)
struct _adapter *padapter = (struct _adapter *)priv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
if ((padapter->bDriverStopped == true) ||
(padapter->bSurpriseRemoved == true)) {
if (padapter->bDriverStopped ||
padapter->bSurpriseRemoved) {
netdev_err(padapter->pnetdev, "xmit_bh => bDriverStopped or bSurpriseRemoved\n");
return;
}
ret = r8712_xmitframe_complete(padapter, pxmitpriv, NULL);
if (ret == false)
if (!ret)
return;
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)
(padapter->pwrctrlpriv.pnp_bstop_trx))
return _FAIL;
for (i = 0; i < 8; i++) {
if (pxmitframe->bpending[i] == false) {
if (!pxmitframe->bpending[i]) {
spin_lock_irqsave(&pxmitpriv->lock, irqL);
pxmitpriv->txirp_cnt++;
pxmitframe->bpending[i] = true;
......
......@@ -166,7 +166,7 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev)
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
int ret = 0;
if (r8712_if_up(padapter) == false) {
if (!r8712_if_up(padapter)) {
ret = 0;
goto _xmit_entry_drop;
}
......@@ -181,7 +181,7 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev)
}
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_TX);
pxmitframe->pkt = pkt;
if (r8712_pre_xmit(padapter, pxmitframe) == true) {
if (r8712_pre_xmit(padapter, pxmitframe)) {
/*dump xmitframe directly or drop xframe*/
dev_kfree_skb_any(pkt);
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