Commit 168a2c10 authored by Luis de Bethencourt's avatar Luis de Bethencourt Committed by Greg Kroah-Hartman

staging: rtl8712: braces should be used on all arms

Fix all instances of the following checkpatch.pl check:
CHECK: braces {} should be used on all arms of this statement
Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1ca96884
...@@ -191,9 +191,9 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) ...@@ -191,9 +191,9 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter)
imem_sz = fwhdr.img_IMEM_size; imem_sz = fwhdr.img_IMEM_size;
do { do {
memset(ptx_desc, 0, TXDESC_SIZE); 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; dump_imem_sz = MAX_DUMP_FWSZ;
else { } else {
dump_imem_sz = imem_sz; dump_imem_sz = imem_sz;
ptx_desc->txdw0 |= cpu_to_le32(BIT(28)); ptx_desc->txdw0 |= cpu_to_le32(BIT(28));
} }
...@@ -309,8 +309,9 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) ...@@ -309,8 +309,9 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter)
} }
if (i == 0) if (i == 0)
goto exit_fail; goto exit_fail;
} else } else {
goto exit_fail; goto exit_fail;
}
ret = _SUCCESS; ret = _SUCCESS;
exit_fail: exit_fail:
...@@ -386,9 +387,9 @@ uint rtl871x_hal_init(struct _adapter *padapter) ...@@ -386,9 +387,9 @@ uint rtl871x_hal_init(struct _adapter *padapter)
return _FAIL; return _FAIL;
if (padapter->halpriv.hal_bus_init(padapter) != _SUCCESS) if (padapter->halpriv.hal_bus_init(padapter) != _SUCCESS)
return _FAIL; return _FAIL;
if (rtl8712_hal_init(padapter) == _SUCCESS) if (rtl8712_hal_init(padapter) == _SUCCESS) {
padapter->hw_init_completed = true; padapter->hw_init_completed = true;
else { } else {
padapter->hw_init_completed = false; padapter->hw_init_completed = false;
return _FAIL; return _FAIL;
} }
......
...@@ -304,8 +304,9 @@ int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, ...@@ -304,8 +304,9 @@ int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,
*group_cipher = r8712_get_wpa_cipher_suite(pos); *group_cipher = r8712_get_wpa_cipher_suite(pos);
pos += WPA_SELECTOR_LEN; pos += WPA_SELECTOR_LEN;
left -= WPA_SELECTOR_LEN; left -= WPA_SELECTOR_LEN;
} else if (left > 0) } else if (left > 0) {
return _FAIL; return _FAIL;
}
/*pairwise_cipher*/ /*pairwise_cipher*/
if (left >= 2) { if (left >= 2) {
count = le16_to_cpu(*(u16 *)pos); count = le16_to_cpu(*(u16 *)pos);
...@@ -318,8 +319,9 @@ int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, ...@@ -318,8 +319,9 @@ int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,
pos += WPA_SELECTOR_LEN; pos += WPA_SELECTOR_LEN;
left -= WPA_SELECTOR_LEN; left -= WPA_SELECTOR_LEN;
} }
} else if (left == 1) } else if (left == 1) {
return _FAIL; return _FAIL;
}
return _SUCCESS; return _SUCCESS;
} }
...@@ -344,8 +346,9 @@ int r8712_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, ...@@ -344,8 +346,9 @@ int r8712_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher,
*group_cipher = r8712_get_wpa2_cipher_suite(pos); *group_cipher = r8712_get_wpa2_cipher_suite(pos);
pos += RSN_SELECTOR_LEN; pos += RSN_SELECTOR_LEN;
left -= RSN_SELECTOR_LEN; left -= RSN_SELECTOR_LEN;
} else if (left > 0) } else if (left > 0) {
return _FAIL; return _FAIL;
}
/*pairwise_cipher*/ /*pairwise_cipher*/
if (left >= 2) { if (left >= 2) {
count = le16_to_cpu(*(u16 *)pos); count = le16_to_cpu(*(u16 *)pos);
...@@ -358,8 +361,9 @@ int r8712_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, ...@@ -358,8 +361,9 @@ int r8712_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher,
pos += RSN_SELECTOR_LEN; pos += RSN_SELECTOR_LEN;
left -= RSN_SELECTOR_LEN; left -= RSN_SELECTOR_LEN;
} }
} else if (left == 1) } else if (left == 1) {
return _FAIL; return _FAIL;
}
return _SUCCESS; return _SUCCESS;
} }
...@@ -385,8 +389,9 @@ int r8712_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, ...@@ -385,8 +389,9 @@ int r8712_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len,
in_ie[cnt + 1] + 2); in_ie[cnt + 1] + 2);
*rsn_len = in_ie[cnt+1] + 2; *rsn_len = in_ie[cnt+1] + 2;
cnt += in_ie[cnt+1] + 2; /*get next*/ cnt += in_ie[cnt+1] + 2; /*get next*/
} else } else {
cnt += in_ie[cnt+1] + 2; /*get next*/ cnt += in_ie[cnt+1] + 2; /*get next*/
}
} }
} }
return *rsn_len + *wpa_len; return *rsn_len + *wpa_len;
......
...@@ -405,10 +405,12 @@ int r8712_cmd_thread(void *context) ...@@ -405,10 +405,12 @@ int r8712_cmd_thread(void *context)
if (list_empty(&pcmdpriv->cmd_queue.queue)) { if (list_empty(&pcmdpriv->cmd_queue.queue)) {
r8712_unregister_cmd_alive(padapter); r8712_unregister_cmd_alive(padapter);
continue; continue;
} else } else {
goto _next; goto _next;
} else }
} else {
goto _next; goto _next;
}
flush_signals_thread(); flush_signals_thread();
} }
/* free all cmd_obj resources */ /* free all cmd_obj resources */
......
...@@ -163,8 +163,9 @@ static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty) ...@@ -163,8 +163,9 @@ static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty)
*empty = true; *empty = true;
else else
*empty = false; *empty = false;
} else } else {
ret = false; ret = false;
}
return ret; return ret;
} }
...@@ -229,8 +230,9 @@ u16 r8712_efuse_get_current_size(struct _adapter *padapter) ...@@ -229,8 +230,9 @@ u16 r8712_efuse_get_current_size(struct _adapter *padapter)
word_cnts = calculate_word_cnts(hworden); word_cnts = calculate_word_cnts(hworden);
/* read next header */ /* read next header */
efuse_addr = efuse_addr + (word_cnts * 2) + 1; efuse_addr = efuse_addr + (word_cnts * 2) + 1;
} else } else {
bContinual = false; bContinual = false;
}
} }
return efuse_addr; return efuse_addr;
} }
...@@ -263,8 +265,9 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data) ...@@ -263,8 +265,9 @@ u8 r8712_efuse_pg_packet_read(struct _adapter *padapter, u8 offset, u8 *data)
if (efuse_one_byte_read(padapter, if (efuse_one_byte_read(padapter,
efuse_addr+1+tmpidx, &efuse_data)) { efuse_addr+1+tmpidx, &efuse_data)) {
tmpdata[tmpidx] = efuse_data; tmpdata[tmpidx] = efuse_data;
} else } else {
ret = false; ret = false;
}
} }
pgpacket_copy_data(hworden, tmpdata, data); pgpacket_copy_data(hworden, tmpdata, data);
} }
...@@ -335,17 +338,17 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr) ...@@ -335,17 +338,17 @@ 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)) {
ret = false; ret = false;
else if (pkt.data[i*2] != value) { } else if (pkt.data[i*2] != value) {
ret = false; ret = false;
if (0xFF == value) /* write again */ if (0xFF == value) /* write again */
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)) {
ret = false; ret = false;
else if (pkt.data[i*2 + 1] != value) { } else if (pkt.data[i*2 + 1] != value) {
ret = false; ret = false;
if (0xFF == value) /* write again */ if (0xFF == value) /* write again */
efuse_one_byte_write(padapter, addr+1, efuse_one_byte_write(padapter, addr+1,
...@@ -503,8 +506,9 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts, ...@@ -503,8 +506,9 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts,
if (efuse_is_empty(padapter, &empty)) { if (efuse_is_empty(padapter, &empty)) {
if (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) if (!empty)
if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata)) if (!r8712_efuse_pg_packet_read(padapter, offset, pktdata))
......
...@@ -297,14 +297,16 @@ static void SwLedBlink1(struct LED_871x *pLed) ...@@ -297,14 +297,16 @@ static void SwLedBlink1(struct LED_871x *pLed)
if (!pLed1->bSWLedCtrl) { if (!pLed1->bSWLedCtrl) {
SwLedOn(padapter, pLed1); SwLedOn(padapter, pLed1);
pLed1->bSWLedCtrl = true; pLed1->bSWLedCtrl = true;
} else if (!pLed1->bLedOn) } else if (!pLed1->bLedOn) {
SwLedOn(padapter, pLed1); SwLedOn(padapter, pLed1);
}
} else { } else {
if (!pLed1->bSWLedCtrl) { if (!pLed1->bSWLedCtrl) {
SwLedOff(padapter, pLed1); SwLedOff(padapter, pLed1);
pLed1->bSWLedCtrl = true; pLed1->bSWLedCtrl = true;
} else if (pLed1->bLedOn) } else if (pLed1->bLedOn) {
SwLedOff(padapter, pLed1); SwLedOff(padapter, pLed1);
}
} }
} }
switch (pLed->CurrLedState) { switch (pLed->CurrLedState) {
...@@ -407,8 +409,9 @@ static void SwLedBlink1(struct LED_871x *pLed) ...@@ -407,8 +409,9 @@ static void SwLedBlink1(struct LED_871x *pLed)
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
bStopBlinking = false; bStopBlinking = false;
} else } else {
bStopBlinking = true; bStopBlinking = true;
}
if (bStopBlinking) { if (bStopBlinking) {
pLed->bLedLinkBlinkInProgress = true; pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL; pLed->CurrLedState = LED_BLINK_NORMAL;
...@@ -570,8 +573,9 @@ static void SwLedBlink3(struct LED_871x *pLed) ...@@ -570,8 +573,9 @@ static void SwLedBlink3(struct LED_871x *pLed)
mod_timer(&pLed->BlinkTimer, jiffies + mod_timer(&pLed->BlinkTimer, jiffies +
msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA)); msecs_to_jiffies(LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA));
bStopBlinking = false; bStopBlinking = false;
} else } else {
bStopBlinking = true; bStopBlinking = true;
}
if (bStopBlinking) { if (bStopBlinking) {
pLed->CurrLedState = LED_ON; pLed->CurrLedState = LED_ON;
pLed->BlinkingLedState = LED_ON; pLed->BlinkingLedState = LED_ON;
...@@ -1317,8 +1321,9 @@ static void SwLedControlMode3(struct _adapter *padapter, ...@@ -1317,8 +1321,9 @@ static void SwLedControlMode3(struct _adapter *padapter,
if (pLed->bLedWPSBlinkInProgress) { if (pLed->bLedWPSBlinkInProgress) {
del_timer(&pLed->BlinkTimer); del_timer(&pLed->BlinkTimer);
pLed->bLedWPSBlinkInProgress = false; pLed->bLedWPSBlinkInProgress = false;
} else } else {
pLed->bLedWPSBlinkInProgress = true; pLed->bLedWPSBlinkInProgress = true;
}
pLed->CurrLedState = LED_BLINK_WPS_STOP; pLed->CurrLedState = LED_BLINK_WPS_STOP;
if (pLed->bLedOn) { if (pLed->bLedOn) {
pLed->BlinkingLedState = LED_OFF; pLed->BlinkingLedState = LED_OFF;
......
...@@ -180,8 +180,9 @@ static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib, ...@@ -180,8 +180,9 @@ static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib,
pattrib->ip_chkrpt = 1; /* correct */ pattrib->ip_chkrpt = 1; /* correct */
else else
pattrib->ip_chkrpt = 0; /* incorrect */ pattrib->ip_chkrpt = 0; /* incorrect */
} else } else {
pattrib->tcpchk_valid = 0; /* invalid */ pattrib->tcpchk_valid = 0; /* invalid */
}
pattrib->mcs_rate = (u8)((le32_to_cpu(prxstat->rxdw3)) & 0x3f); pattrib->mcs_rate = (u8)((le32_to_cpu(prxstat->rxdw3)) & 0x3f);
pattrib->htc = (u8)((le32_to_cpu(prxstat->rxdw3) >> 14) & 0x1); pattrib->htc = (u8)((le32_to_cpu(prxstat->rxdw3) >> 14) & 0x1);
/*Offset 16*/ /*Offset 16*/
...@@ -414,8 +415,9 @@ static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe) ...@@ -414,8 +415,9 @@ static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe)
if ((pattrib->tcpchk_valid == 1) && if ((pattrib->tcpchk_valid == 1) &&
(pattrib->tcp_chkrpt == 1)) { (pattrib->tcp_chkrpt == 1)) {
sub_skb->ip_summed = CHECKSUM_UNNECESSARY; sub_skb->ip_summed = CHECKSUM_UNNECESSARY;
} else } else {
sub_skb->ip_summed = CHECKSUM_NONE; sub_skb->ip_summed = CHECKSUM_NONE;
}
netif_rx(sub_skb); netif_rx(sub_skb);
} }
} }
...@@ -580,8 +582,9 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter, ...@@ -580,8 +582,9 @@ static int recv_indicatepkt_reorder(struct _adapter *padapter,
!padapter->bSurpriseRemoved) { !padapter->bSurpriseRemoved) {
r8712_recv_indicatepkt(padapter, prframe); r8712_recv_indicatepkt(padapter, prframe);
return _SUCCESS; return _SUCCESS;
} else } else {
return _FAIL; return _FAIL;
}
} }
} }
spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); spin_lock_irqsave(&ppending_recvframe_queue->lock, irql);
...@@ -654,8 +657,9 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter, ...@@ -654,8 +657,9 @@ static int r8712_process_recv_indicatepkts(struct _adapter *padapter,
if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) { if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */ /* indicate this recv_frame */
r8712_recv_indicatepkt(padapter, prframe); r8712_recv_indicatepkt(padapter, prframe);
} else } else {
return _FAIL; return _FAIL;
}
} }
return retval; return retval;
} }
...@@ -812,9 +816,9 @@ static void query_rx_phy_status(struct _adapter *padapter, ...@@ -812,9 +816,9 @@ static void query_rx_phy_status(struct _adapter *padapter,
/* /*
* (3) Get Signal Quality (EVM) * (3) Get Signal Quality (EVM)
*/ */
if (pwdb_all > 40) if (pwdb_all > 40) {
sq = 100; sq = 100;
else { } else {
sq = pcck_buf->sq_rpt; sq = pcck_buf->sq_rpt;
if (pcck_buf->sq_rpt > 64) if (pcck_buf->sq_rpt > 64)
sq = 0; sq = 0;
......
...@@ -98,11 +98,11 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitframe) ...@@ -98,11 +98,11 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitframe)
struct _adapter *padapter = pxmitframe->padapter; struct _adapter *padapter = pxmitframe->padapter;
struct dvobj_priv *pdvobj = &padapter->dvobjpriv; struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
if (pxmitframe->frame_tag == TXAGG_FRAMETAG) if (pxmitframe->frame_tag == TXAGG_FRAMETAG) {
addr = RTL8712_DMA_H2CCMD; addr = RTL8712_DMA_H2CCMD;
else if (pxmitframe->frame_tag == MGNT_FRAMETAG) } else if (pxmitframe->frame_tag == MGNT_FRAMETAG) {
addr = RTL8712_DMA_MGTQ; addr = RTL8712_DMA_MGTQ;
else if (pdvobj->nr_endpoint == 6) { } else if (pdvobj->nr_endpoint == 6) {
switch (pattrib->priority) { switch (pattrib->priority) {
case 0: case 0:
case 3: case 3:
...@@ -239,9 +239,9 @@ void r8712_do_queue_select(struct _adapter *padapter, ...@@ -239,9 +239,9 @@ void r8712_do_queue_select(struct _adapter *padapter,
unsigned int qsel = 0; unsigned int qsel = 0;
struct dvobj_priv *pdvobj = &padapter->dvobjpriv; struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
if (pdvobj->nr_endpoint == 6) if (pdvobj->nr_endpoint == 6) {
qsel = (unsigned int) pattrib->priority; qsel = (unsigned int) pattrib->priority;
else if (pdvobj->nr_endpoint == 4) { } else if (pdvobj->nr_endpoint == 4) {
qsel = (unsigned int) pattrib->priority; qsel = (unsigned int) pattrib->priority;
if (qsel == 0 || qsel == 3) if (qsel == 0 || qsel == 3)
qsel = 3; qsel = 3;
......
...@@ -137,9 +137,9 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue) ...@@ -137,9 +137,9 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue)
struct cmd_obj *obj; struct cmd_obj *obj;
spin_lock_irqsave(&(queue->lock), irqL); spin_lock_irqsave(&(queue->lock), irqL);
if (list_empty(&(queue->queue))) if (list_empty(&(queue->queue))) {
obj = NULL; obj = NULL;
else { } else {
obj = LIST_CONTAINOR(queue->queue.next, obj = LIST_CONTAINOR(queue->queue.next,
struct cmd_obj, list); struct cmd_obj, list);
list_del_init(&obj->list); list_del_init(&obj->list);
...@@ -538,8 +538,9 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) ...@@ -538,8 +538,9 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork)
if (psecnetwork->IELength != tmp_len) { if (psecnetwork->IELength != tmp_len) {
psecnetwork->IELength = tmp_len; psecnetwork->IELength = tmp_len;
pqospriv->qos_option = 1; /* WMM IE in beacon */ pqospriv->qos_option = 1; /* WMM IE in beacon */
} else } else {
pqospriv->qos_option = 0; /* no WMM IE in beacon */ pqospriv->qos_option = 0; /* no WMM IE in beacon */
}
} }
if (pregistrypriv->ht_enable) { if (pregistrypriv->ht_enable) {
/* For WEP mode, we will use the bg mode to do the connection /* For WEP mode, we will use the bg mode to do the connection
......
...@@ -356,8 +356,9 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) ...@@ -356,8 +356,9 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
Ndis802_11AuthModeOpen; Ndis802_11AuthModeOpen;
padapter->securitypriv.AuthAlgrthm = 0; padapter->securitypriv.AuthAlgrthm = 0;
} }
} else } else {
ret = -EINVAL; ret = -EINVAL;
}
return ret; return ret;
} }
...@@ -381,8 +382,9 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, ...@@ -381,8 +382,9 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
/* for large key indices, set the default (0) */ /* for large key indices, set the default (0) */
param->u.crypt.idx = 0; param->u.crypt.idx = 0;
} }
} else } else {
return -EINVAL; return -EINVAL;
}
if (strcmp(param->u.crypt.alg, "WEP") == 0) { if (strcmp(param->u.crypt.alg, "WEP") == 0) {
netdev_info(dev, "r8712u: %s: crypt.alg = WEP\n", __func__); netdev_info(dev, "r8712u: %s: crypt.alg = WEP\n", __func__);
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
...@@ -411,8 +413,9 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, ...@@ -411,8 +413,9 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
padapter->securitypriv.XGrpPrivacy = padapter->securitypriv.XGrpPrivacy =
_WEP104_; _WEP104_;
} }
} else } else {
return -EINVAL; return -EINVAL;
}
pwep->KeyIndex = wep_key_idx; pwep->KeyIndex = wep_key_idx;
pwep->KeyIndex |= 0x80000000; pwep->KeyIndex |= 0x80000000;
memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength); memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength);
...@@ -587,8 +590,9 @@ static int r871x_set_wpa_ie(struct _adapter *padapter, char *pie, ...@@ -587,8 +590,9 @@ static int r871x_set_wpa_ie(struct _adapter *padapter, char *pie,
netdev_info(padapter->pnetdev, "r8712u: SET WPS_IE, wps_phase==true\n"); netdev_info(padapter->pnetdev, "r8712u: SET WPS_IE, wps_phase==true\n");
cnt += buf[cnt+1]+2; cnt += buf[cnt+1]+2;
break; break;
} else } else {
cnt += buf[cnt + 1] + 2; cnt += buf[cnt + 1] + 2;
}
} }
} }
} }
...@@ -639,8 +643,9 @@ static int r8711_wx_get_name(struct net_device *dev, ...@@ -639,8 +643,9 @@ static int r8711_wx_get_name(struct net_device *dev,
snprintf(wrqu->name, IFNAMSIZ, snprintf(wrqu->name, IFNAMSIZ,
"IEEE 802.11g"); "IEEE 802.11g");
} }
} else } else {
snprintf(wrqu->name, IFNAMSIZ, "unassociated"); snprintf(wrqu->name, IFNAMSIZ, "unassociated");
}
return 0; return 0;
} }
...@@ -674,14 +679,14 @@ static int r8711_wx_set_freq(struct net_device *dev, ...@@ -674,14 +679,14 @@ static int r8711_wx_set_freq(struct net_device *dev,
fwrq->m = c + 1; fwrq->m = c + 1;
} }
/* Setting by channel number */ /* Setting by channel number */
if ((fwrq->m > 14) || (fwrq->e > 0)) if ((fwrq->m > 14) || (fwrq->e > 0)) {
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
else { } else {
int channel = fwrq->m; int channel = fwrq->m;
if ((channel < 1) || (channel > 14)) if ((channel < 1) || (channel > 14)) {
rc = -EINVAL; rc = -EINVAL;
else { } else {
/* Yes ! We can set it !!! */ /* Yes ! We can set it !!! */
padapter->registrypriv.channel = channel; padapter->registrypriv.channel = channel;
} }
...@@ -1069,9 +1074,9 @@ static int r8711_wx_set_wap(struct net_device *dev, ...@@ -1069,9 +1074,9 @@ static int r8711_wx_set_wap(struct net_device *dev,
} }
spin_unlock_irqrestore(&queue->lock, irqL); spin_unlock_irqrestore(&queue->lock, irqL);
if (!ret) { if (!ret) {
if (!r8712_set_802_11_authentication_mode(padapter, authmode)) if (!r8712_set_802_11_authentication_mode(padapter, authmode)) {
ret = -ENOMEM; ret = -ENOMEM;
else { } else {
if (!r8712_set_802_11_bssid(padapter, temp->sa_data)) if (!r8712_set_802_11_bssid(padapter, temp->sa_data))
ret = -1; ret = -1;
} }
...@@ -1167,12 +1172,14 @@ static int r8711_wx_set_scan(struct net_device *dev, ...@@ -1167,12 +1172,14 @@ static int r8711_wx_set_scan(struct net_device *dev,
(pmlmepriv->sitesurveyctrl.traffic_busy)) { (pmlmepriv->sitesurveyctrl.traffic_busy)) {
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
status = false; status = false;
} else } else {
status = r8712_sitesurvey_cmd(padapter, &ssid); status = r8712_sitesurvey_cmd(padapter, &ssid);
}
spin_unlock_irqrestore(&pmlmepriv->lock, irqL); spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
} }
} else } else {
status = r8712_set_802_11_bssid_list_scan(padapter); status = r8712_set_802_11_bssid_list_scan(padapter);
}
if (!status) if (!status)
return -1; return -1;
return 0; return 0;
...@@ -1379,8 +1386,9 @@ static int r8711_wx_set_rate(struct net_device *dev, ...@@ -1379,8 +1386,9 @@ static int r8711_wx_set_rate(struct net_device *dev,
datarates[i] = mpdatarate[i]; datarates[i] = mpdatarate[i];
if (fixed == 0) if (fixed == 0)
break; break;
} else } else {
datarates[i] = 0xff; datarates[i] = 0xff;
}
} }
if (r8712_setdatarate_cmd(padapter, datarates) != _SUCCESS) if (r8712_setdatarate_cmd(padapter, datarates) != _SUCCESS)
ret = -ENOMEM; ret = -ENOMEM;
...@@ -1439,8 +1447,9 @@ static int r8711_wx_get_rate(struct net_device *dev, ...@@ -1439,8 +1447,9 @@ static int r8711_wx_get_rate(struct net_device *dev,
max_rate *= 2; /* Mbps/2 */ max_rate *= 2; /* Mbps/2 */
} }
wrqu->bitrate.value = max_rate * 500000; wrqu->bitrate.value = max_rate * 500000;
} else } else {
return -ENOLINK; return -ENOLINK;
}
return 0; return 0;
} }
...@@ -1461,9 +1470,9 @@ static int r8711_wx_set_frag(struct net_device *dev, ...@@ -1461,9 +1470,9 @@ static int r8711_wx_set_frag(struct net_device *dev,
{ {
struct _adapter *padapter = netdev_priv(dev); struct _adapter *padapter = netdev_priv(dev);
if (wrqu->frag.disabled) if (wrqu->frag.disabled) {
padapter->xmitpriv.frag_len = MAX_FRAG_THRESHOLD; padapter->xmitpriv.frag_len = MAX_FRAG_THRESHOLD;
else { } else {
if (wrqu->frag.value < MIN_FRAG_THRESHOLD || if (wrqu->frag.value < MIN_FRAG_THRESHOLD ||
wrqu->frag.value > MAX_FRAG_THRESHOLD) wrqu->frag.value > MAX_FRAG_THRESHOLD)
return -EINVAL; return -EINVAL;
...@@ -1898,9 +1907,9 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev, ...@@ -1898,9 +1907,9 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev,
ret = -EINVAL; ret = -EINVAL;
goto _r871x_mp_ioctl_hdl_exit; goto _r871x_mp_ioctl_hdl_exit;
} }
if (phandler->oid == 0 && phandler->handler) if (phandler->oid == 0 && phandler->handler) {
status = phandler->handler(&oid_par); status = phandler->handler(&oid_par);
else if (phandler->handler) { } else if (phandler->handler) {
oid_par.adapter_context = padapter; oid_par.adapter_context = padapter;
oid_par.oid = phandler->oid; oid_par.oid = phandler->oid;
oid_par.information_buf = poidparam->data; oid_par.information_buf = poidparam->data;
...@@ -1967,8 +1976,9 @@ static int r871x_get_ap_info(struct net_device *dev, ...@@ -1967,8 +1976,9 @@ static int r871x_get_ap_info(struct net_device *dev,
if (pdata->length >= 32) { if (pdata->length >= 32) {
if (copy_from_user(data, pdata->pointer, 32)) if (copy_from_user(data, pdata->pointer, 32))
return -EINVAL; return -EINVAL;
} else } else {
return -EINVAL; return -EINVAL;
}
spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL); spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
phead = &queue->queue; phead = &queue->queue;
plist = phead->next; plist = phead->next;
......
...@@ -58,8 +58,9 @@ uint oid_rt_get_small_packet_crc_hdl(struct oid_par_priv *poid_par_priv) ...@@ -58,8 +58,9 @@ uint oid_rt_get_small_packet_crc_hdl(struct oid_par_priv *poid_par_priv)
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_smallpacket_crcerr; padapter->recvpriv.rx_smallpacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -74,8 +75,9 @@ uint oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv *poid_par_priv) ...@@ -74,8 +75,9 @@ uint oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv *poid_par_priv)
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_middlepacket_crcerr; padapter->recvpriv.rx_middlepacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -90,8 +92,9 @@ uint oid_rt_get_large_packet_crc_hdl(struct oid_par_priv *poid_par_priv) ...@@ -90,8 +92,9 @@ uint oid_rt_get_large_packet_crc_hdl(struct oid_par_priv *poid_par_priv)
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_largepacket_crcerr; padapter->recvpriv.rx_largepacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -122,8 +125,9 @@ uint oid_rt_get_rx_total_packet_hdl(struct oid_par_priv *poid_par_priv) ...@@ -122,8 +125,9 @@ uint oid_rt_get_rx_total_packet_hdl(struct oid_par_priv *poid_par_priv)
padapter->recvpriv.rx_pkts + padapter->recvpriv.rx_pkts +
padapter->recvpriv.rx_drop; padapter->recvpriv.rx_drop;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -152,8 +156,9 @@ uint oid_rt_get_rx_icv_err_hdl(struct oid_par_priv *poid_par_priv) ...@@ -152,8 +156,9 @@ uint oid_rt_get_rx_icv_err_hdl(struct oid_par_priv *poid_par_priv)
*(uint *)poid_par_priv->information_buf = *(uint *)poid_par_priv->information_buf =
padapter->recvpriv.rx_icv_err; padapter->recvpriv.rx_icv_err;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -182,8 +187,9 @@ uint oid_rt_get_preamble_mode_hdl(struct oid_par_priv *poid_par_priv) ...@@ -182,8 +187,9 @@ uint oid_rt_get_preamble_mode_hdl(struct oid_par_priv *poid_par_priv)
preamblemode = 2; preamblemode = 2;
*(u32 *)poid_par_priv->information_buf = preamblemode; *(u32 *)poid_par_priv->information_buf = preamblemode;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -239,8 +245,9 @@ uint oid_rt_set_preamble_mode_hdl(struct oid_par_priv ...@@ -239,8 +245,9 @@ uint oid_rt_set_preamble_mode_hdl(struct oid_par_priv
padapter->registrypriv.preamble = PREAMBLE_SHORT; padapter->registrypriv.preamble = PREAMBLE_SHORT;
*(u32 *)poid_par_priv->information_buf = preamblemode; *(u32 *)poid_par_priv->information_buf = preamblemode;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -269,8 +276,9 @@ uint oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv ...@@ -269,8 +276,9 @@ uint oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
padapter->xmitpriv.tx_bytes; padapter->xmitpriv.tx_bytes;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -287,8 +295,9 @@ uint oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv ...@@ -287,8 +295,9 @@ uint oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv
padapter->recvpriv.rx_bytes; padapter->recvpriv.rx_bytes;
*poid_par_priv->bytes_rw = poid_par_priv-> *poid_par_priv->bytes_rw = poid_par_priv->
information_buf_len; information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -364,8 +373,9 @@ uint oid_rt_supported_wireless_mode_hdl(struct oid_par_priv ...@@ -364,8 +373,9 @@ uint oid_rt_supported_wireless_mode_hdl(struct oid_par_priv
ulInfo |= 0x0400; /* WIRELESS_MODE_A */ ulInfo |= 0x0400; /* WIRELESS_MODE_A */
*(u32 *) poid_par_priv->information_buf = ulInfo; *(u32 *) poid_par_priv->information_buf = ulInfo;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
return RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
}
return RNDIS_STATUS_SUCCESS; return RNDIS_STATUS_SUCCESS;
} }
...@@ -451,8 +461,9 @@ uint oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* ...@@ -451,8 +461,9 @@ uint oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv*
(unsigned long)(*((unsigned long *) (unsigned long)(*((unsigned long *)
poid_par_priv->information_buf + 2)))) poid_par_priv->information_buf + 2))))
status = RNDIS_STATUS_NOT_ACCEPTED; status = RNDIS_STATUS_NOT_ACCEPTED;
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
return status; return status;
} }
...@@ -465,9 +476,9 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv) ...@@ -465,9 +476,9 @@ 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) if (Adapter->mppriv.act_in_progress) {
status = RNDIS_STATUS_NOT_ACCEPTED; status = RNDIS_STATUS_NOT_ACCEPTED;
else { } else {
/* init workparam */ /* init workparam */
Adapter->mppriv.act_in_progress = true; Adapter->mppriv.act_in_progress = true;
Adapter->mppriv.workparam.bcompleted = false; Adapter->mppriv.workparam.bcompleted = false;
...@@ -489,8 +500,9 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv) ...@@ -489,8 +500,9 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv)
io_value)) io_value))
status = RNDIS_STATUS_NOT_ACCEPTED; status = RNDIS_STATUS_NOT_ACCEPTED;
} }
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
return status; return status;
} }
......
...@@ -207,9 +207,10 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, ...@@ -207,9 +207,10 @@ void r8712_set_802_11_ssid(struct _adapter *padapter,
set_fwstate(pmlmepriv, set_fwstate(pmlmepriv,
WIFI_ADHOC_STATE); WIFI_ADHOC_STATE);
} }
} else } else {
goto _Abort_Set_SSID; /* driver is in goto _Abort_Set_SSID; /* driver is in
* WIFI_ADHOC_MASTER_STATE */ * WIFI_ADHOC_MASTER_STATE */
}
} }
} else { } else {
r8712_disassoc_cmd(padapter); r8712_disassoc_cmd(padapter);
......
...@@ -191,8 +191,9 @@ sint r8712_if_up(struct _adapter *padapter) ...@@ -191,8 +191,9 @@ sint r8712_if_up(struct _adapter *padapter)
if (padapter->bDriverStopped || padapter->bSurpriseRemoved || if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { !check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
res = false; res = false;
} else } else {
res = true; res = true;
}
return res; return res;
} }
...@@ -354,8 +355,9 @@ static void update_network(struct wlan_bssid_ex *dst, ...@@ -354,8 +355,9 @@ static void update_network(struct wlan_bssid_ex *dst,
padapter->recvpriv.signal = (u8)tmpVal; padapter->recvpriv.signal = (u8)tmpVal;
src->Rssi = padapter->recvpriv.signal; src->Rssi = padapter->recvpriv.signal;
} else } else {
src->Rssi = (src->Rssi + dst->Rssi) / 2; src->Rssi = (src->Rssi + dst->Rssi) / 2;
}
memcpy((u8 *)dst, (u8 *)src, r8712_get_wlan_bssid_ex_sz(src)); memcpy((u8 *)dst, (u8 *)src, r8712_get_wlan_bssid_ex_sz(src));
} }
...@@ -552,9 +554,9 @@ void r8712_survey_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -552,9 +554,9 @@ 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)) { 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 {
pnetwork->Ssid.SsidLength = 8; pnetwork->Ssid.SsidLength = 8;
memcpy(pnetwork->Ssid.Ssid, "<hidden>", 8); memcpy(pnetwork->Ssid.Ssid, "<hidden>", 8);
rtl8711_add_network(adapter, pnetwork); rtl8711_add_network(adapter, pnetwork);
...@@ -719,8 +721,9 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -719,8 +721,9 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
return; return;
memcpy((u8 *)pnetwork+16, (u8 *)pbuf + 8, memcpy((u8 *)pnetwork+16, (u8 *)pbuf + 8,
sizeof(struct wlan_network) - 16); sizeof(struct wlan_network) - 16);
} else } else {
pnetwork = (struct wlan_network *)pbuf; pnetwork = (struct wlan_network *)pbuf;
}
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
/* endian_convert */ /* endian_convert */
...@@ -767,12 +770,12 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -767,12 +770,12 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/*s1. find ptarget_wlan*/ /*s1. find ptarget_wlan*/
if (check_fwstate(pmlmepriv, _FW_LINKED)) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
if (the_same_macaddr) if (the_same_macaddr) {
ptarget_wlan = ptarget_wlan =
r8712_find_network(&pmlmepriv-> r8712_find_network(&pmlmepriv->
scanned_queue, scanned_queue,
cur_network->network.MacAddress); cur_network->network.MacAddress);
else { } else {
pcur_wlan = pcur_wlan =
r8712_find_network(&pmlmepriv-> r8712_find_network(&pmlmepriv->
scanned_queue, scanned_queue,
...@@ -821,10 +824,11 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -821,10 +824,11 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
ptarget_sta = ptarget_sta =
r8712_alloc_stainfo(pstapriv, r8712_alloc_stainfo(pstapriv,
pnetwork->network.MacAddress); pnetwork->network.MacAddress);
} else } else {
ptarget_sta = ptarget_sta =
r8712_alloc_stainfo(pstapriv, r8712_alloc_stainfo(pstapriv,
pnetwork->network.MacAddress); pnetwork->network.MacAddress);
}
if (ptarget_sta) /*update ptarget_sta*/ { if (ptarget_sta) /*update ptarget_sta*/ {
ptarget_sta->aid = pnetwork->join_res; ptarget_sta->aid = pnetwork->join_res;
ptarget_sta->qos_option = 1; ptarget_sta->qos_option = 1;
...@@ -900,8 +904,9 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) ...@@ -900,8 +904,9 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf)
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
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)) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
mod_timer(&pmlmepriv->assoc_timer, mod_timer(&pmlmepriv->assoc_timer,
...@@ -1163,8 +1168,9 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1163,8 +1168,9 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
} }
goto ask_for_joinbss; goto ask_for_joinbss;
} }
} else if (pmlmepriv->assoc_ssid.SsidLength == 0) } else if (pmlmepriv->assoc_ssid.SsidLength == 0) {
goto ask_for_joinbss; goto ask_for_joinbss;
}
dst_ssid = pnetwork->network.Ssid.Ssid; dst_ssid = pnetwork->network.Ssid.Ssid;
src_ssid = pmlmepriv->assoc_ssid.Ssid; src_ssid = pmlmepriv->assoc_ssid.Ssid;
if ((pnetwork->network.Ssid.SsidLength == if ((pnetwork->network.Ssid.SsidLength ==
...@@ -1178,8 +1184,9 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1178,8 +1184,9 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
if (pnetwork->network.Rssi > if (pnetwork->network.Rssi >
pnetwork_max_rssi->network.Rssi) pnetwork_max_rssi->network.Rssi)
pnetwork_max_rssi = pnetwork; pnetwork_max_rssi = pnetwork;
} else } else {
pnetwork_max_rssi = pnetwork; pnetwork_max_rssi = pnetwork;
}
} else if (is_desired_network(adapter, pnetwork)) { } else if (is_desired_network(adapter, pnetwork)) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
r8712_disassoc_cmd(adapter); r8712_disassoc_cmd(adapter);
......
...@@ -237,8 +237,9 @@ static u8 set_bb_reg(struct _adapter *pAdapter, ...@@ -237,8 +237,9 @@ static u8 set_bb_reg(struct _adapter *pAdapter,
org_value = r8712_bb_reg_read(pAdapter, offset); org_value = r8712_bb_reg_read(pAdapter, offset);
bit_shift = bitshift(bitmask); bit_shift = bitshift(bitmask);
new_value = ((org_value & (~bitmask)) | (value << bit_shift)); new_value = ((org_value & (~bitmask)) | (value << bit_shift));
} else } else {
new_value = value; new_value = value;
}
return r8712_bb_reg_write(pAdapter, offset, new_value); return r8712_bb_reg_write(pAdapter, offset, new_value);
} }
...@@ -262,8 +263,9 @@ static u8 set_rf_reg(struct _adapter *pAdapter, u8 path, u8 offset, u32 bitmask, ...@@ -262,8 +263,9 @@ static u8 set_rf_reg(struct _adapter *pAdapter, u8 path, u8 offset, u32 bitmask,
org_value = r8712_rf_reg_read(pAdapter, path, offset); org_value = r8712_rf_reg_read(pAdapter, path, offset);
bit_shift = bitshift(bitmask); bit_shift = bitshift(bitmask);
new_value = ((org_value & (~bitmask)) | (value << bit_shift)); new_value = ((org_value & (~bitmask)) | (value << bit_shift));
} else } else {
new_value = value; new_value = value;
}
return r8712_rf_reg_write(pAdapter, path, offset, new_value); return r8712_rf_reg_write(pAdapter, path, offset, new_value);
} }
......
...@@ -56,8 +56,9 @@ uint oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv) ...@@ -56,8 +56,9 @@ uint oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv)
Adapter->registrypriv.wireless_mode; Adapter->registrypriv.wireless_mode;
*poid_par_priv->bytes_rw = *poid_par_priv->bytes_rw =
poid_par_priv->information_buf_len; poid_par_priv->information_buf_len;
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
} else { } else {
status = RNDIS_STATUS_NOT_ACCEPTED; status = RNDIS_STATUS_NOT_ACCEPTED;
} }
...@@ -178,8 +179,9 @@ static int mp_start_test(struct _adapter *padapter) ...@@ -178,8 +179,9 @@ static int mp_start_test(struct _adapter *padapter)
if (length % 4) { if (length % 4) {
/*round up to multiple of 4 bytes.*/ /*round up to multiple of 4 bytes.*/
bssid.Length = ((length >> 2) + 1) << 2; bssid.Length = ((length >> 2) + 1) << 2;
} 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)) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
goto end_of_mp_start_test; goto end_of_mp_start_test;
...@@ -388,8 +390,9 @@ uint oid_rt_pro_query_tx_packet_sent_hdl( ...@@ -388,8 +390,9 @@ uint oid_rt_pro_query_tx_packet_sent_hdl(
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.tx_pktcount; Adapter->mppriv.tx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
return status; return status;
} }
...@@ -408,8 +411,9 @@ uint oid_rt_pro_query_rx_packet_received_hdl( ...@@ -408,8 +411,9 @@ uint oid_rt_pro_query_rx_packet_received_hdl(
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.rx_pktcount; Adapter->mppriv.rx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
return status; return status;
} }
...@@ -428,8 +432,9 @@ uint oid_rt_pro_query_rx_packet_crc32_error_hdl( ...@@ -428,8 +432,9 @@ uint oid_rt_pro_query_rx_packet_crc32_error_hdl(
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.rx_crcerrpktcount; Adapter->mppriv.rx_crcerrpktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
return status; return status;
} }
...@@ -457,8 +462,9 @@ uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv ...@@ -457,8 +462,9 @@ uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv
if (poid_par_priv->information_buf_len == sizeof(u32)) { if (poid_par_priv->information_buf_len == sizeof(u32)) {
Adapter->mppriv.rx_pktcount = 0; Adapter->mppriv.rx_pktcount = 0;
Adapter->mppriv.rx_crcerrpktcount = 0; Adapter->mppriv.rx_crcerrpktcount = 0;
} else } else {
status = RNDIS_STATUS_INVALID_LENGTH; status = RNDIS_STATUS_INVALID_LENGTH;
}
return status; return status;
} }
......
...@@ -112,9 +112,9 @@ union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue) ...@@ -112,9 +112,9 @@ union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue)
struct recv_priv *precvpriv; struct recv_priv *precvpriv;
spin_lock_irqsave(&pfree_recv_queue->lock, irqL); spin_lock_irqsave(&pfree_recv_queue->lock, irqL);
if (list_empty(&pfree_recv_queue->queue)) if (list_empty(&pfree_recv_queue->queue)) {
precvframe = NULL; precvframe = NULL;
else { } else {
phead = &pfree_recv_queue->queue; phead = &pfree_recv_queue->queue;
plist = phead->next; plist = phead->next;
precvframe = LIST_CONTAINOR(plist, union recv_frame, u); precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
...@@ -180,8 +180,9 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter, ...@@ -180,8 +180,9 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
6) & 0x3)) - 1].skey[0]; 6) & 0x3)) - 1].skey[0];
if (!psecuritypriv->binstallGrpkey) if (!psecuritypriv->binstallGrpkey)
return _FAIL; return _FAIL;
} else } else {
mickey = &stainfo->tkiprxmickey.skey[0]; mickey = &stainfo->tkiprxmickey.skey[0];
}
/*icv_len included the mic code*/ /*icv_len included the mic code*/
datalen = precvframe->u.hdr.len - prxattrib->hdrlen - datalen = precvframe->u.hdr.len - prxattrib->hdrlen -
prxattrib->iv_len - prxattrib->icv_len - 8; prxattrib->iv_len - prxattrib->icv_len - 8;
...@@ -239,8 +240,9 @@ union recv_frame *r8712_decryptor(struct _adapter *padapter, ...@@ -239,8 +240,9 @@ union recv_frame *r8712_decryptor(struct _adapter *padapter,
default: default:
break; break;
} }
} else if (prxattrib->bdecrypted == 1) } else if (prxattrib->bdecrypted == 1) {
psecuritypriv->hw_decrypted = true; psecuritypriv->hw_decrypted = true;
}
return return_packet; return return_packet;
} }
/*###set the security information in the recv_frame */ /*###set the security information in the recv_frame */
...@@ -270,9 +272,9 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter, ...@@ -270,9 +272,9 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter,
if ((psta != NULL) && (psta->ieee8021x_blocked)) { if ((psta != NULL) && (psta->ieee8021x_blocked)) {
/* blocked /* blocked
* only accept EAPOL frame */ * only accept EAPOL frame */
if (ether_type == 0x888e) if (ether_type == 0x888e) {
prtnframe = precv_frame; prtnframe = precv_frame;
else { } else {
/*free this frame*/ /*free this frame*/
r8712_free_recvframe(precv_frame, r8712_free_recvframe(precv_frame,
&adapter->recvpriv.free_recv_queue); &adapter->recvpriv.free_recv_queue);
...@@ -289,8 +291,9 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter, ...@@ -289,8 +291,9 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter,
prtnframe = precv_frame; prtnframe = precv_frame;
} }
} }
} else } else {
prtnframe = precv_frame; prtnframe = precv_frame;
}
return prtnframe; return prtnframe;
} }
...@@ -341,7 +344,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter, ...@@ -341,7 +344,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
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)) { } 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 */
...@@ -354,15 +357,16 @@ static sint sta2sta_data_frame(struct _adapter *adapter, ...@@ -354,15 +357,16 @@ 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)) { } 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);
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);
sta_addr = mybssid; sta_addr = mybssid;
} else } else {
ret = _FAIL; ret = _FAIL;
}
if (bmcast) if (bmcast)
*psta = r8712_get_bcmc_stainfo(adapter); *psta = r8712_get_bcmc_stainfo(adapter);
else else
...@@ -429,8 +433,9 @@ static sint ap2sta_data_frame(struct _adapter *adapter, ...@@ -429,8 +433,9 @@ 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 } else {
return _FAIL; return _FAIL;
}
return _SUCCESS; return _SUCCESS;
} }
......
...@@ -636,8 +636,9 @@ u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe) ...@@ -636,8 +636,9 @@ u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe)
pframe = (u8 *)RND4((addr_t)(pframe)); pframe = (u8 *)RND4((addr_t)(pframe));
} }
} }
} else } else {
res = _FAIL; res = _FAIL;
}
} }
return res; return res;
} }
...@@ -677,8 +678,9 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe) ...@@ -677,8 +678,9 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
((idx >> 6) & 0x3) - 1].skey[0]; ((idx >> 6) & 0x3) - 1].skey[0];
if (!psecuritypriv->binstallGrpkey) if (!psecuritypriv->binstallGrpkey)
return _FAIL; return _FAIL;
} else } else {
prwskey = &stainfo->x_UncstKey.skey[0]; prwskey = &stainfo->x_UncstKey.skey[0];
}
GET_TKIP_PN(iv, txpn); GET_TKIP_PN(iv, txpn);
pnl = (u16)(txpn.val); pnl = (u16)(txpn.val);
pnh = (u32)(txpn.val >> 16); pnh = (u32)(txpn.val >> 16);
...@@ -696,8 +698,9 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe) ...@@ -696,8 +698,9 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
crc[1] != payload[length - 3] || crc[1] != payload[length - 3] ||
crc[0] != payload[length - 4]) crc[0] != payload[length - 4])
return _FAIL; return _FAIL;
} else } else {
return _FAIL; return _FAIL;
}
} }
return _SUCCESS; return _SUCCESS;
} }
...@@ -1069,8 +1072,9 @@ static sint aes_cipher(u8 *key, uint hdrlen, ...@@ -1069,8 +1072,9 @@ static sint aes_cipher(u8 *key, uint hdrlen,
if (hdrlen != WLAN_HDR_A3_QOS_LEN) if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2; hdrlen += 2;
qc_exists = 1; qc_exists = 1;
} else } else {
qc_exists = 0; qc_exists = 0;
}
pn_vector[0] = pframe[hdrlen]; pn_vector[0] = pframe[hdrlen];
pn_vector[1] = pframe[hdrlen+1]; pn_vector[1] = pframe[hdrlen+1];
pn_vector[2] = pframe[hdrlen+4]; pn_vector[2] = pframe[hdrlen+4];
...@@ -1188,8 +1192,9 @@ u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe) ...@@ -1188,8 +1192,9 @@ u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe)
pframe = (u8 *)RND4((addr_t)(pframe)); pframe = (u8 *)RND4((addr_t)(pframe));
} }
} }
} else } else {
res = _FAIL; res = _FAIL;
}
} }
return res; return res;
} }
...@@ -1377,14 +1382,16 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe) ...@@ -1377,14 +1382,16 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
if (!psecuritypriv->binstallGrpkey) if (!psecuritypriv->binstallGrpkey)
return _FAIL; return _FAIL;
} else } else {
prwskey = &stainfo->x_UncstKey.skey[0]; prwskey = &stainfo->x_UncstKey.skey[0];
}
length = ((union recv_frame *)precvframe)-> length = ((union recv_frame *)precvframe)->
u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
aes_decipher(prwskey, prxattrib->hdrlen, pframe, aes_decipher(prwskey, prxattrib->hdrlen, pframe,
length); length);
} else } else {
return _FAIL; return _FAIL;
}
} }
return _SUCCESS; return _SUCCESS;
} }
......
...@@ -117,9 +117,9 @@ struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -117,9 +117,9 @@ struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
pfree_sta_queue = &pstapriv->free_sta_queue; pfree_sta_queue = &pstapriv->free_sta_queue;
spin_lock_irqsave(&(pfree_sta_queue->lock), flags); spin_lock_irqsave(&(pfree_sta_queue->lock), flags);
if (list_empty(&pfree_sta_queue->queue)) if (list_empty(&pfree_sta_queue->queue)) {
psta = NULL; psta = NULL;
else { } else {
psta = LIST_CONTAINOR(pfree_sta_queue->queue.next, psta = LIST_CONTAINOR(pfree_sta_queue->queue.next,
struct sta_info, list); struct sta_info, list);
list_del_init(&(psta->list)); list_del_init(&(psta->list));
......
...@@ -293,9 +293,9 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -293,9 +293,9 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
/* get ether_hdr_len */ /* get ether_hdr_len */
pattrib->pkt_hdrlen = ETH_HLEN; pattrib->pkt_hdrlen = ETH_HLEN;
if (pqospriv->qos_option) if (pqospriv->qos_option) {
r8712_set_qos(&pktfile, pattrib); r8712_set_qos(&pktfile, pattrib);
else { } else {
pattrib->hdrlen = WLAN_HDR_A3_LEN; pattrib->hdrlen = WLAN_HDR_A3_LEN;
pattrib->subtype = WIFI_DATA_TYPE; pattrib->subtype = WIFI_DATA_TYPE;
pattrib->priority = 0; pattrib->priority = 0;
...@@ -305,8 +305,9 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt, ...@@ -305,8 +305,9 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
if ((pattrib->ether_type != 0x888e) && if ((pattrib->ether_type != 0x888e) &&
!check_fwstate(pmlmepriv, WIFI_MP_STATE)) !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);
}
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
case _WEP40_: case _WEP40_:
case _WEP104_: case _WEP104_:
...@@ -509,8 +510,9 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr, ...@@ -509,8 +510,9 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr,
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 } else {
return _FAIL; return _FAIL;
}
if (pattrib->encrypt) if (pattrib->encrypt)
SetPrivacy(fctrl); SetPrivacy(fctrl);
...@@ -526,9 +528,9 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr, ...@@ -526,9 +528,9 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr,
struct sta_info *psta; struct sta_info *psta;
sint bmcst = IS_MCAST(pattrib->ra); sint bmcst = IS_MCAST(pattrib->ra);
if (pattrib->psta) if (pattrib->psta) {
psta = pattrib->psta; psta = pattrib->psta;
else { } else {
if (bmcst) if (bmcst)
psta = r8712_get_bcmc_stainfo(padapter); psta = r8712_get_bcmc_stainfo(padapter);
else else
...@@ -719,17 +721,18 @@ void r8712_update_protection(struct _adapter *padapter, u8 *ie, uint ie_len) ...@@ -719,17 +721,18 @@ void r8712_update_protection(struct _adapter *padapter, u8 *ie, uint ie_len)
case AUTO_VCS: case AUTO_VCS:
default: default:
perp = r8712_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len); perp = r8712_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
if (perp == NULL) if (perp == NULL) {
pxmitpriv->vcs = NONE_VCS; pxmitpriv->vcs = NONE_VCS;
else { } else {
protection = (*(perp + 2)) & BIT(1); protection = (*(perp + 2)) & BIT(1);
if (protection) { if (protection) {
if (pregistrypriv->vcs_type == RTS_CTS) if (pregistrypriv->vcs_type == RTS_CTS)
pxmitpriv->vcs = RTS_CTS; pxmitpriv->vcs = RTS_CTS;
else else
pxmitpriv->vcs = CTS_TO_SELF; pxmitpriv->vcs = CTS_TO_SELF;
} else } else {
pxmitpriv->vcs = NONE_VCS; pxmitpriv->vcs = NONE_VCS;
}
} }
break; break;
} }
...@@ -743,9 +746,9 @@ struct xmit_buf *r8712_alloc_xmitbuf(struct xmit_priv *pxmitpriv) ...@@ -743,9 +746,9 @@ struct xmit_buf *r8712_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue; struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irqL); spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irqL);
if (list_empty(&pfree_xmitbuf_queue->queue)) if (list_empty(&pfree_xmitbuf_queue->queue)) {
pxmitbuf = NULL; pxmitbuf = NULL;
else { } else {
phead = &pfree_xmitbuf_queue->queue; phead = &pfree_xmitbuf_queue->queue;
plist = phead->next; plist = phead->next;
pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list); pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
...@@ -797,9 +800,9 @@ struct xmit_frame *r8712_alloc_xmitframe(struct xmit_priv *pxmitpriv) ...@@ -797,9 +800,9 @@ struct xmit_frame *r8712_alloc_xmitframe(struct xmit_priv *pxmitpriv)
struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue; struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;
spin_lock_irqsave(&pfree_xmit_queue->lock, irqL); spin_lock_irqsave(&pfree_xmit_queue->lock, irqL);
if (list_empty(&pfree_xmit_queue->queue)) if (list_empty(&pfree_xmit_queue->queue)) {
pxframe = NULL; pxframe = NULL;
else { } else {
phead = &pfree_xmit_queue->queue; phead = &pfree_xmit_queue->queue;
plist = phead->next; plist = phead->next;
pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
...@@ -917,12 +920,12 @@ sint r8712_xmit_classifier(struct _adapter *padapter, ...@@ -917,12 +920,12 @@ sint r8712_xmit_classifier(struct _adapter *padapter,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
sint bmcst = IS_MCAST(pattrib->ra); sint bmcst = IS_MCAST(pattrib->ra);
if (pattrib->psta) if (pattrib->psta) {
psta = pattrib->psta; psta = pattrib->psta;
else { } else {
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)) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
psta = r8712_get_stainfo(pstapriv, psta = r8712_get_stainfo(pstapriv,
get_bssid(pmlmepriv)); get_bssid(pmlmepriv));
......
...@@ -285,8 +285,9 @@ u8 r8712_usb_hal_bus_init(struct _adapter *padapter) ...@@ -285,8 +285,9 @@ u8 r8712_usb_hal_bus_init(struct _adapter *padapter)
/* Reset TxDMA */ /* Reset TxDMA */
r8712_write8(padapter, CR, val8|_TXDMA_EN); r8712_write8(padapter, CR, val8|_TXDMA_EN);
} }
} else } else {
ret = _FAIL; ret = _FAIL;
}
return ret; return ret;
} }
......
...@@ -395,9 +395,9 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, ...@@ -395,9 +395,9 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
/* step 3. /* step 3.
* initialize the dvobj_priv * initialize the dvobj_priv
*/ */
if (!padapter->dvobj_init) if (!padapter->dvobj_init) {
goto error; goto error;
else { } else {
status = padapter->dvobj_init(padapter); status = padapter->dvobj_init(padapter);
if (status != _SUCCESS) if (status != _SUCCESS)
goto error; goto error;
...@@ -553,8 +553,9 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, ...@@ -553,8 +553,9 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
padapter->ledpriv.bRegUseLed = false; padapter->ledpriv.bRegUseLed = false;
break; break;
} }
} else } else {
AutoloadFail = false; AutoloadFail = false;
}
if (((mac[0] == 0xff) && (mac[1] == 0xff) && if (((mac[0] == 0xff) && (mac[1] == 0xff) &&
(mac[2] == 0xff) && (mac[3] == 0xff) && (mac[2] == 0xff) && (mac[3] == 0xff) &&
(mac[4] == 0xff) && (mac[5] == 0xff)) || (mac[4] == 0xff) && (mac[5] == 0xff)) ||
......
...@@ -144,8 +144,9 @@ static unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr) ...@@ -144,8 +144,9 @@ static unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr)
pipe = usb_sndbulkpipe(pusbd, 0x0d); pipe = usb_sndbulkpipe(pusbd, 0x0d);
break; break;
} }
} else } else {
pipe = 0; pipe = 0;
}
return pipe; return pipe;
} }
...@@ -306,8 +307,9 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) ...@@ -306,8 +307,9 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
err = usb_submit_urb(purb, GFP_ATOMIC); err = usb_submit_urb(purb, GFP_ATOMIC);
if ((err) && (err != (-EPERM))) if ((err) && (err != (-EPERM)))
ret = _FAIL; ret = _FAIL;
} else } else {
ret = _FAIL; ret = _FAIL;
}
return ret; return ret;
} }
......
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