imem_sz = fwhdr.img_IMEM_size;
do {
memset(ptx_desc, 0, TXDESC_SIZE);
- if (imem_sz > MAX_DUMP_FWSZ/*49152*/)
+ if (imem_sz > MAX_DUMP_FWSZ/*49152*/) {
dump_imem_sz = MAX_DUMP_FWSZ;
- else {
+ } else {
dump_imem_sz = imem_sz;
ptx_desc->txdw0 |= cpu_to_le32(BIT(28));
}
}
if (i == 0)
goto exit_fail;
- } else
+ } else {
goto exit_fail;
+ }
ret = _SUCCESS;
exit_fail:
return _FAIL;
if (padapter->halpriv.hal_bus_init(padapter) != _SUCCESS)
return _FAIL;
- if (rtl8712_hal_init(padapter) == _SUCCESS)
+ if (rtl8712_hal_init(padapter) == _SUCCESS) {
padapter->hw_init_completed = true;
- else {
+ } else {
padapter->hw_init_completed = false;
return _FAIL;
}
*group_cipher = r8712_get_wpa_cipher_suite(pos);
pos += WPA_SELECTOR_LEN;
left -= WPA_SELECTOR_LEN;
- } else if (left > 0)
+ } else if (left > 0) {
return _FAIL;
+ }
/*pairwise_cipher*/
if (left >= 2) {
count = le16_to_cpu(*(u16 *)pos);
pos += WPA_SELECTOR_LEN;
left -= WPA_SELECTOR_LEN;
}
- } else if (left == 1)
+ } else if (left == 1) {
return _FAIL;
+ }
return _SUCCESS;
}
*group_cipher = r8712_get_wpa2_cipher_suite(pos);
pos += RSN_SELECTOR_LEN;
left -= RSN_SELECTOR_LEN;
- } else if (left > 0)
+ } else if (left > 0) {
return _FAIL;
+ }
/*pairwise_cipher*/
if (left >= 2) {
count = le16_to_cpu(*(u16 *)pos);
pos += RSN_SELECTOR_LEN;
left -= RSN_SELECTOR_LEN;
}
- } else if (left == 1)
+ } else if (left == 1) {
return _FAIL;
+ }
return _SUCCESS;
}
in_ie[cnt + 1] + 2);
*rsn_len = in_ie[cnt+1] + 2;
cnt += in_ie[cnt+1] + 2; /*get next*/
- } else
+ } else {
cnt += in_ie[cnt+1] + 2; /*get next*/
+ }
}
}
return *rsn_len + *wpa_len;
if (list_empty(&pcmdpriv->cmd_queue.queue)) {
r8712_unregister_cmd_alive(padapter);
continue;
- } else
+ } else {
goto _next;
- } else
+ }
+ } else {
goto _next;
+ }
flush_signals_thread();
}
/* free all cmd_obj resources */
*empty = true;
else
*empty = false;
- } else
+ } else {
ret = false;
+ }
return ret;
}
word_cnts = calculate_word_cnts(hworden);
/* read next header */
efuse_addr = efuse_addr + (word_cnts * 2) + 1;
- } else
+ } else {
bContinual = false;
+ }
}
return efuse_addr;
}
if (efuse_one_byte_read(padapter,
efuse_addr+1+tmpidx, &efuse_data)) {
tmpdata[tmpidx] = efuse_data;
- } else
+ } else {
ret = false;
+ }
}
pgpacket_copy_data(hworden, tmpdata, data);
}
efuse_one_byte_write(padapter, addr+1,
pkt.data[i*2 + 1]);
/* additional check */
- if (!efuse_one_byte_read(padapter, addr, &value))
+ if (!efuse_one_byte_read(padapter, addr, &value)) {
ret = false;
- else if (pkt.data[i*2] != value) {
+ } else if (pkt.data[i*2] != value) {
ret = false;
if (0xFF == value) /* write again */
efuse_one_byte_write(padapter, addr,
pkt.data[i * 2]);
}
- if (!efuse_one_byte_read(padapter, addr+1, &value))
+ if (!efuse_one_byte_read(padapter, addr+1, &value)) {
ret = false;
- else if (pkt.data[i*2 + 1] != value) {
+ } else if (pkt.data[i*2 + 1] != value) {
ret = false;
if (0xFF == value) /* write again */
efuse_one_byte_write(padapter, addr+1,
if (efuse_is_empty(padapter, &empty)) {
if (empty)
memset(pktdata, 0xFF, PGPKT_DATA_SIZE);
- } else
+ } else {
return false;
+ }
offset = (addr >> 3) & 0xF;
if (!empty)
if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata))
if (!pLed1->bSWLedCtrl) {
SwLedOn(padapter, pLed1);
pLed1->bSWLedCtrl = true;
- } else if (!pLed1->bLedOn)
+ } else if (!pLed1->bLedOn) {
SwLedOn(padapter, pLed1);
+ }
} else {
if (!pLed1->bSWLedCtrl) {
SwLedOff(padapter, pLed1);
pLed1->bSWLedCtrl = true;
- } else if (pLed1->bLedOn)
+ } else if (pLed1->bLedOn) {
SwLedOff(padapter, pLed1);
+ }
}
}
switch (pLed->CurrLedState) {
mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
bStopBlinking = false;
- } else
+ } else {
bStopBlinking = true;
+ }
if (bStopBlinking) {
pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL;
mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
bStopBlinking = false;
- } else
+ } else {
bStopBlinking = true;
+ }
if (bStopBlinking) {
pLed->CurrLedState = LED_ON;
pLed->BlinkingLedState = LED_ON;
if (pLed->bLedWPSBlinkInProgress) {
del_timer(&pLed->BlinkTimer);
pLed->bLedWPSBlinkInProgress = false;
- } else
+ } else {
pLed->bLedWPSBlinkInProgress = true;
+ }
pLed->CurrLedState = LED_BLINK_WPS_STOP;
if (pLed->bLedOn) {
pLed->BlinkingLedState = LED_OFF;
pattrib->ip_chkrpt = 1; /* correct */
else
pattrib->ip_chkrpt = 0; /* incorrect */
- } else
+ } else {
pattrib->tcpchk_valid = 0; /* invalid */
+ }
pattrib->mcs_rate = (u8)((le32_to_cpu(prxstat->rxdw3)) & 0x3f);
pattrib->htc = (u8)((le32_to_cpu(prxstat->rxdw3) >> 14) & 0x1);
/*Offset 16*/
if ((pattrib->tcpchk_valid == 1) &&
(pattrib->tcp_chkrpt == 1)) {
sub_skb->ip_summed = CHECKSUM_UNNECESSARY;
- } else
+ } else {
sub_skb->ip_summed = CHECKSUM_NONE;
+ }
netif_rx(sub_skb);
}
}
!padapter->bSurpriseRemoved) {
r8712_recv_indicatepkt(padapter, prframe);
return _SUCCESS;
- } else
+ } else {
return _FAIL;
+ }
}
}
spin_lock_irqsave(&ppending_recvframe_queue->lock, irql);
if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, prframe);
- } else
+ } else {
return _FAIL;
+ }
}
return retval;
}
/*
* (3) Get Signal Quality (EVM)
*/
- if (pwdb_all > 40)
+ if (pwdb_all > 40) {
sq = 100;
- else {
+ } else {
sq = pcck_buf->sq_rpt;
if (pcck_buf->sq_rpt > 64)
sq = 0;
struct _adapter *padapter = pxmitframe->padapter;
struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
- if (pxmitframe->frame_tag == TXAGG_FRAMETAG)
+ if (pxmitframe->frame_tag == TXAGG_FRAMETAG) {
addr = RTL8712_DMA_H2CCMD;
- else if (pxmitframe->frame_tag == MGNT_FRAMETAG)
+ } else if (pxmitframe->frame_tag == MGNT_FRAMETAG) {
addr = RTL8712_DMA_MGTQ;
- else if (pdvobj->nr_endpoint == 6) {
+ } else if (pdvobj->nr_endpoint == 6) {
switch (pattrib->priority) {
case 0:
case 3:
unsigned int qsel = 0;
struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
- if (pdvobj->nr_endpoint == 6)
+ if (pdvobj->nr_endpoint == 6) {
qsel = (unsigned int) pattrib->priority;
- else if (pdvobj->nr_endpoint == 4) {
+ } else if (pdvobj->nr_endpoint == 4) {
qsel = (unsigned int) pattrib->priority;
if (qsel == 0 || qsel == 3)
qsel = 3;
struct cmd_obj *obj;
spin_lock_irqsave(&(queue->lock), irqL);
- if (list_empty(&(queue->queue)))
+ if (list_empty(&(queue->queue))) {
obj = NULL;
- else {
+ } else {
obj = LIST_CONTAINOR(queue->queue.next,
struct cmd_obj, list);
list_del_init(&obj->list);
if (psecnetwork->IELength != tmp_len) {
psecnetwork->IELength = tmp_len;
pqospriv->qos_option = 1; /* WMM IE in beacon */
- } else
+ } else {
pqospriv->qos_option = 0; /* no WMM IE in beacon */
+ }
}
if (pregistrypriv->ht_enable) {
/* For WEP mode, we will use the bg mode to do the connection
Ndis802_11AuthModeOpen;
padapter->securitypriv.AuthAlgrthm = 0;
}
- } else
+ } else {
ret = -EINVAL;
+ }
return ret;
}
/* for large key indices, set the default (0) */
param->u.crypt.idx = 0;
}
- } else
+ } else {
return -EINVAL;
+ }
if (strcmp(param->u.crypt.alg, "WEP") == 0) {
netdev_info(dev, "r8712u: %s: crypt.alg = WEP\n", __func__);
padapter->securitypriv.ndisencryptstatus =
padapter->securitypriv.XGrpPrivacy =
_WEP104_;
}
- } else
+ } else {
return -EINVAL;
+ }
pwep->KeyIndex = wep_key_idx;
pwep->KeyIndex |= 0x80000000;
memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength);
netdev_info(padapter->pnetdev, "r8712u: SET WPS_IE, wps_phase==true\n");
cnt += buf[cnt+1]+2;
break;
- } else
+ } else {
cnt += buf[cnt + 1] + 2;
+ }
}
}
}
snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11g");
}
- } else
+ } else {
snprintf(wrqu->name, IFNAMSIZ, "unassociated");
+ }
return 0;
}
fwrq->m = c + 1;
}
/* Setting by channel number */
- if ((fwrq->m > 14) || (fwrq->e > 0))
+ if ((fwrq->m > 14) || (fwrq->e > 0)) {
rc = -EOPNOTSUPP;
- else {
+ } else {
int channel = fwrq->m;
- if ((channel < 1) || (channel > 14))
+ if ((channel < 1) || (channel > 14)) {
rc = -EINVAL;
- else {
+ } else {
/* Yes ! We can set it !!! */
padapter->registrypriv.channel = channel;
}
}
spin_unlock_irqrestore(&queue->lock, irqL);
if (!ret) {
- if (!r8712_set_802_11_authentication_mode(padapter, authmode))
+ if (!r8712_set_802_11_authentication_mode(padapter, authmode)) {
ret = -ENOMEM;
- else {
+ } else {
if (!r8712_set_802_11_bssid(padapter, temp->sa_data))
ret = -1;
}
(pmlmepriv->sitesurveyctrl.traffic_busy)) {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
status = false;
- } else
+ } else {
status = r8712_sitesurvey_cmd(padapter, &ssid);
+ }
spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
}
- } else
+ } else {
status = r8712_set_802_11_bssid_list_scan(padapter);
+ }
if (!status)
return -1;
return 0;
datarates[i] = mpdatarate[i];
if (fixed == 0)
break;
- } else
+ } else {
datarates[i] = 0xff;
+ }
}
if (r8712_setdatarate_cmd(padapter, datarates) != _SUCCESS)
ret = -ENOMEM;
max_rate *= 2; /* Mbps/2 */
}
wrqu->bitrate.value = max_rate * 500000;
- } else
+ } else {
return -ENOLINK;
+ }
return 0;
}
{
struct _adapter *padapter = netdev_priv(dev);
- if (wrqu->frag.disabled)
+ if (wrqu->frag.disabled) {
padapter->xmitpriv.frag_len = MAX_FRAG_THRESHOLD;
- else {
+ } else {
if (wrqu->frag.value < MIN_FRAG_THRESHOLD ||
wrqu->frag.value > MAX_FRAG_THRESHOLD)
return -EINVAL;
ret = -EINVAL;
goto _r871x_mp_ioctl_hdl_exit;
}
- if (phandler->oid == 0 && phandler->handler)
+ if (phandler->oid == 0 && phandler->handler) {
status = phandler->handler(&oid_par);
- else if (phandler->handler) {
+ } else if (phandler->handler) {
oid_par.adapter_context = padapter;
oid_par.oid = phandler->oid;
oid_par.information_buf = poidparam->data;
if (pdata->length >= 32) {
if (copy_from_user(data, pdata->pointer, 32))
return -EINVAL;
- } else
+ } else {
return -EINVAL;
+ }
spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
phead = &queue->queue;
plist = phead->next;
*(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_smallpacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
*(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_middlepacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
*(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_largepacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
padapter->recvpriv.rx_pkts +
padapter->recvpriv.rx_drop;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
*(uint *)poid_par_priv->information_buf =
padapter->recvpriv.rx_icv_err;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
preamblemode = 2;
*(u32 *)poid_par_priv->information_buf = preamblemode;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
padapter->registrypriv.preamble = PREAMBLE_SHORT;
*(u32 *)poid_par_priv->information_buf = preamblemode;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
*(u32 *)poid_par_priv->information_buf =
padapter->xmitpriv.tx_bytes;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
padapter->recvpriv.rx_bytes;
*poid_par_priv->bytes_rw = poid_par_priv->
information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
ulInfo |= 0x0400; /* WIRELESS_MODE_A */
*(u32 *) poid_par_priv->information_buf = ulInfo;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
return RNDIS_STATUS_INVALID_LENGTH;
+ }
return RNDIS_STATUS_SUCCESS;
}
(unsigned long)(*((unsigned long *)
poid_par_priv->information_buf + 2))))
status = RNDIS_STATUS_NOT_ACCEPTED;
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
return status;
}
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)
+ if (Adapter->mppriv.act_in_progress) {
status = RNDIS_STATUS_NOT_ACCEPTED;
- else {
+ } else {
/* init workparam */
Adapter->mppriv.act_in_progress = true;
Adapter->mppriv.workparam.bcompleted = false;
io_value))
status = RNDIS_STATUS_NOT_ACCEPTED;
}
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
return status;
}
set_fwstate(pmlmepriv,
WIFI_ADHOC_STATE);
}
- } else
+ } else {
goto _Abort_Set_SSID; /* driver is in
* WIFI_ADHOC_MASTER_STATE */
+ }
}
} else {
r8712_disassoc_cmd(padapter);
if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
res = false;
- } else
+ } else {
res = true;
+ }
return res;
}
padapter->recvpriv.signal = (u8)tmpVal;
src->Rssi = padapter->recvpriv.signal;
- } else
+ } else {
src->Rssi = (src->Rssi + dst->Rssi) / 2;
+ }
memcpy((u8 *)dst, (u8 *)src, r8712_get_wlan_bssid_ex_sz(src));
}
}
/* lock pmlmepriv->lock when you accessing network_q */
if (!check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
- if (pnetwork->Ssid.Ssid[0] != 0)
+ if (pnetwork->Ssid.Ssid[0] != 0) {
rtl8711_add_network(adapter, pnetwork);
- else {
+ } else {
pnetwork->Ssid.SsidLength = 8;
memcpy(pnetwork->Ssid.Ssid, "<hidden>", 8);
rtl8711_add_network(adapter, pnetwork);
return;
memcpy((u8 *)pnetwork+16, (u8 *)pbuf + 8,
sizeof(struct wlan_network) - 16);
- } else
+ } else {
pnetwork = (struct wlan_network *)pbuf;
+ }
#ifdef __BIG_ENDIAN
/* endian_convert */
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/*s1. find ptarget_wlan*/
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
- if (the_same_macaddr)
+ if (the_same_macaddr) {
ptarget_wlan =
r8712_find_network(&pmlmepriv->
scanned_queue,
cur_network->network.MacAddress);
- else {
+ } else {
pcur_wlan =
r8712_find_network(&pmlmepriv->
scanned_queue,
ptarget_sta =
r8712_alloc_stainfo(pstapriv,
pnetwork->network.MacAddress);
- } else
+ } else {
ptarget_sta =
r8712_alloc_stainfo(pstapriv,
pnetwork->network.MacAddress);
+ }
if (ptarget_sta) /*update ptarget_sta*/ {
ptarget_sta->aid = pnetwork->join_res;
ptarget_sta->qos_option = 1;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
r8712_indicate_connect(adapter);
del_timer(&pmlmepriv->assoc_timer);
- } else
+ } else {
goto ignore_joinbss_callback;
+ }
} else {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
mod_timer(&pmlmepriv->assoc_timer,
}
goto ask_for_joinbss;
}
- } else if (pmlmepriv->assoc_ssid.SsidLength == 0)
+ } else if (pmlmepriv->assoc_ssid.SsidLength == 0) {
goto ask_for_joinbss;
+ }
dst_ssid = pnetwork->network.Ssid.Ssid;
src_ssid = pmlmepriv->assoc_ssid.Ssid;
if ((pnetwork->network.Ssid.SsidLength ==
if (pnetwork->network.Rssi >
pnetwork_max_rssi->network.Rssi)
pnetwork_max_rssi = pnetwork;
- } else
+ } else {
pnetwork_max_rssi = pnetwork;
+ }
} else if (is_desired_network(adapter, pnetwork)) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
r8712_disassoc_cmd(adapter);
org_value = r8712_bb_reg_read(pAdapter, offset);
bit_shift = bitshift(bitmask);
new_value = ((org_value & (~bitmask)) | (value << bit_shift));
- } else
+ } else {
new_value = value;
+ }
return r8712_bb_reg_write(pAdapter, offset, new_value);
}
org_value = r8712_rf_reg_read(pAdapter, path, offset);
bit_shift = bitshift(bitmask);
new_value = ((org_value & (~bitmask)) | (value << bit_shift));
- } else
+ } else {
new_value = value;
+ }
return r8712_rf_reg_write(pAdapter, path, offset, new_value);
}
Adapter->registrypriv.wireless_mode;
*poid_par_priv->bytes_rw =
poid_par_priv->information_buf_len;
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
} else {
status = RNDIS_STATUS_NOT_ACCEPTED;
}
if (length % 4) {
/*round up to multiple of 4 bytes.*/
bssid.Length = ((length >> 2) + 1) << 2;
- } else
+ } else {
bssid.Length = length;
+ }
spin_lock_irqsave(&pmlmepriv->lock, irqL);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
goto end_of_mp_start_test;
*(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.tx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
return status;
}
*(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.rx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
return status;
}
*(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.rx_crcerrpktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
return status;
}
if (poid_par_priv->information_buf_len == sizeof(u32)) {
Adapter->mppriv.rx_pktcount = 0;
Adapter->mppriv.rx_crcerrpktcount = 0;
- } else
+ } else {
status = RNDIS_STATUS_INVALID_LENGTH;
+ }
return status;
}
struct recv_priv *precvpriv;
spin_lock_irqsave(&pfree_recv_queue->lock, irqL);
- if (list_empty(&pfree_recv_queue->queue))
+ if (list_empty(&pfree_recv_queue->queue)) {
precvframe = NULL;
- else {
+ } else {
phead = &pfree_recv_queue->queue;
plist = phead->next;
precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
6) & 0x3)) - 1].skey[0];
if (!psecuritypriv->binstallGrpkey)
return _FAIL;
- } else
+ } else {
mickey = &stainfo->tkiprxmickey.skey[0];
+ }
/*icv_len included the mic code*/
datalen = precvframe->u.hdr.len - prxattrib->hdrlen -
prxattrib->iv_len - prxattrib->icv_len - 8;
default:
break;
}
- } else if (prxattrib->bdecrypted == 1)
+ } else if (prxattrib->bdecrypted == 1) {
psecuritypriv->hw_decrypted = true;
+ }
return return_packet;
}
/*###set the security information in the recv_frame */
if ((psta != NULL) && (psta->ieee8021x_blocked)) {
/* blocked
* only accept EAPOL frame */
- if (ether_type == 0x888e)
+ if (ether_type == 0x888e) {
prtnframe = precv_frame;
- else {
+ } else {
/*free this frame*/
r8712_free_recvframe(precv_frame,
&adapter->recvpriv.free_recv_queue);
prtnframe = precv_frame;
}
}
- } else
+ } else {
prtnframe = precv_frame;
+ }
return prtnframe;
}
if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN))
return _FAIL;
sta_addr = pattrib->bssid;
- } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+ } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should
* be also MCAST */
return _FAIL;
sta_addr = pattrib->src;
}
- } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
+ } 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);
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
sta_addr = mybssid;
- } else
+ } else {
ret = _FAIL;
+ }
if (bmcast)
*psta = r8712_get_bcmc_stainfo(adapter);
else
*psta = r8712_get_stainfo(pstapriv, pattrib->bssid);
if (*psta == NULL)
return _FAIL;
- } else
+ } else {
return _FAIL;
+ }
return _SUCCESS;
}
pframe = (u8 *)RND4((addr_t)(pframe));
}
}
- } else
+ } else {
res = _FAIL;
+ }
}
return res;
}
((idx >> 6) & 0x3) - 1].skey[0];
if (!psecuritypriv->binstallGrpkey)
return _FAIL;
- } else
+ } else {
prwskey = &stainfo->x_UncstKey.skey[0];
+ }
GET_TKIP_PN(iv, txpn);
pnl = (u16)(txpn.val);
pnh = (u32)(txpn.val >> 16);
crc[1] != payload[length - 3] ||
crc[0] != payload[length - 4])
return _FAIL;
- } else
+ } else {
return _FAIL;
+ }
}
return _SUCCESS;
}
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
qc_exists = 1;
- } else
+ } else {
qc_exists = 0;
+ }
pn_vector[0] = pframe[hdrlen];
pn_vector[1] = pframe[hdrlen+1];
pn_vector[2] = pframe[hdrlen+4];
pframe = (u8 *)RND4((addr_t)(pframe));
}
}
- } else
+ } else {
res = _FAIL;
+ }
}
return res;
}
if (!psecuritypriv->binstallGrpkey)
return _FAIL;
- } else
+ } else {
prwskey = &stainfo->x_UncstKey.skey[0];
+ }
length = ((union recv_frame *)precvframe)->
u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
aes_decipher(prwskey, prxattrib->hdrlen, pframe,
length);
- } else
+ } else {
return _FAIL;
+ }
}
return _SUCCESS;
}
pfree_sta_queue = &pstapriv->free_sta_queue;
spin_lock_irqsave(&(pfree_sta_queue->lock), flags);
- if (list_empty(&pfree_sta_queue->queue))
+ if (list_empty(&pfree_sta_queue->queue)) {
psta = NULL;
- else {
+ } else {
psta = LIST_CONTAINOR(pfree_sta_queue->queue.next,
struct sta_info, list);
list_del_init(&(psta->list));
/* get ether_hdr_len */
pattrib->pkt_hdrlen = ETH_HLEN;
- if (pqospriv->qos_option)
+ if (pqospriv->qos_option) {
r8712_set_qos(&pktfile, pattrib);
- else {
+ } else {
pattrib->hdrlen = WLAN_HDR_A3_LEN;
pattrib->subtype = WIFI_DATA_TYPE;
pattrib->priority = 0;
if ((pattrib->ether_type != 0x888e) &&
!check_fwstate(pmlmepriv, WIFI_MP_STATE))
return _FAIL;
- } else
+ } else {
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast);
+ }
switch (pattrib->encrypt) {
case _WEP40_:
case _WEP104_:
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
ETH_ALEN);
- } else
+ } else {
return _FAIL;
+ }
if (pattrib->encrypt)
SetPrivacy(fctrl);
struct sta_info *psta;
sint bmcst = IS_MCAST(pattrib->ra);
- if (pattrib->psta)
+ if (pattrib->psta) {
psta = pattrib->psta;
- else {
+ } else {
if (bmcst)
psta = r8712_get_bcmc_stainfo(padapter);
else
case AUTO_VCS:
default:
perp = r8712_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
- if (perp == NULL)
+ if (perp == NULL) {
pxmitpriv->vcs = NONE_VCS;
- else {
+ } else {
protection = (*(perp + 2)) & BIT(1);
if (protection) {
if (pregistrypriv->vcs_type == RTS_CTS)
pxmitpriv->vcs = RTS_CTS;
else
pxmitpriv->vcs = CTS_TO_SELF;
- } else
+ } else {
pxmitpriv->vcs = NONE_VCS;
+ }
}
break;
}
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irqL);
- if (list_empty(&pfree_xmitbuf_queue->queue))
+ if (list_empty(&pfree_xmitbuf_queue->queue)) {
pxmitbuf = NULL;
- else {
+ } else {
phead = &pfree_xmitbuf_queue->queue;
plist = phead->next;
pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;
spin_lock_irqsave(&pfree_xmit_queue->lock, irqL);
- if (list_empty(&pfree_xmit_queue->queue))
+ if (list_empty(&pfree_xmit_queue->queue)) {
pxframe = NULL;
- else {
+ } else {
phead = &pfree_xmit_queue->queue;
plist = phead->next;
pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
sint bmcst = IS_MCAST(pattrib->ra);
- if (pattrib->psta)
+ if (pattrib->psta) {
psta = pattrib->psta;
- else {
- if (bmcst)
+ } else {
+ if (bmcst) {
psta = r8712_get_bcmc_stainfo(padapter);
- else {
+ } else {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv));
/* Reset TxDMA */
r8712_write8(padapter, CR, val8|_TXDMA_EN);
}
- } else
+ } else {
ret = _FAIL;
+ }
return ret;
}
/* step 3.
* initialize the dvobj_priv
*/
- if (!padapter->dvobj_init)
- goto error;
- else {
+ if (!padapter->dvobj_init) {
+ goto error;
+ } else {
status = padapter->dvobj_init(padapter);
if (status != _SUCCESS)
goto error;
padapter->ledpriv.bRegUseLed = false;
break;
}
- } else
+ } else {
AutoloadFail = false;
+ }
if (((mac[0] == 0xff) && (mac[1] == 0xff) &&
(mac[2] == 0xff) && (mac[3] == 0xff) &&
(mac[4] == 0xff) && (mac[5] == 0xff)) ||
pipe = usb_sndbulkpipe(pusbd, 0x0d);
break;
}
- } else
+ } else {
pipe = 0;
+ }
return pipe;
}
err = usb_submit_urb(purb, GFP_ATOMIC);
if ((err) && (err != (-EPERM)))
ret = _FAIL;
- } else
+ } else {
ret = _FAIL;
+ }
return ret;
}