s32 bmcst = IS_MCAST(pattrib->ra);
s32 res = _SUCCESS;
- if (!pxmitframe->buf_addr) {
+ if (!pxmitframe->buf_addr)
return _FAIL;
- }
pbuf_start = pxmitframe->buf_addr;
if (is_primary_adapter(padapter)) { /* if (padapter->isprimary) */
padapter->hal_data_sz = sizeof(struct hal_com_data);
padapter->HalData = vzalloc(padapter->hal_data_sz);
- if (!padapter->HalData) {
+ if (!padapter->HalData)
return _FAIL;
- }
}
return _SUCCESS;
}
do {
h2c_box_num = pHalData->LastHMEBoxNum;
- if (!_is_fw_read_cmd_down(padapter, h2c_box_num)) {
+ if (!_is_fw_read_cmd_down(padapter, h2c_box_num))
goto exit;
- }
if (CmdLen <= 3)
memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, CmdLen);
MaxRsvdPageBufSize = RsvdPageNum*PageSize;
pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv);
- if (!pcmdframe) {
+ if (!pcmdframe)
return;
- }
ReservedPagePacket = pcmdframe->buf_addr;
memset(&RsvdPageLoc, 0, sizeof(struct rsvdpage_loc));
TotalPageNum += CurtPktPageNum;
TotalPacketLen = BufIndex + BTQosNullLength;
- if (TotalPacketLen > MaxRsvdPageBufSize) {
+ if (TotalPacketLen > MaxRsvdPageBufSize)
goto error;
- }
/* update attribute */
pattrib = &pcmdframe->attrib;
/* */
/* Do NOT excess total size of EFuse table. Added by Roger, 2008.11.10. */
/* */
- if ((_offset+_size_byte) > EFUSE_MAX_MAP_LEN) {
+ if ((_offset+_size_byte) > EFUSE_MAX_MAP_LEN)
return;
- }
efuseTbl = rtw_malloc(EFUSE_MAX_MAP_LEN);
- if (!efuseTbl) {
+ if (!efuseTbl)
return;
- }
+
/* 0xff will be efuse default value instead of 0x00. */
memset(efuseTbl, 0xFF, EFUSE_MAX_MAP_LEN);
/* */
/* Do NOT excess total size of EFuse table. Added by Roger, 2008.11.10. */
/* */
- if ((_offset+_size_byte) > EFUSE_BT_MAP_LEN) {
+ if ((_offset+_size_byte) > EFUSE_BT_MAP_LEN)
return;
- }
efuseTbl = rtw_malloc(EFUSE_BT_MAP_LEN);
- if (!efuseTbl) {
+ if (!efuseTbl)
return;
- }
+
/* 0xff will be efuse default value instead of 0x00. */
memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN);
EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total, bPseudoTest);
for (bank = 1; bank < 3; bank++) { /* 8723b Max bake 0~2 */
- if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false) {
+ if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false)
goto exit;
- }
eFuse_Addr = 0;
}
}
- if ((eFuse_Addr-1) < total) {
+ if ((eFuse_Addr-1) < total)
break;
- }
+
}
/* switch bank back to bank 0 for later BT and wifi use. */
count = 0;
while (AVAILABLE_EFUSE_ADDR(efuse_addr)) {
- if (efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest) == false) {
+ if (efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest) == false)
goto error;
- }
if (efuse_data == 0xFF)
break;
EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &retU2, bPseudoTest);
for (bank = startBank; bank < 3; bank++) {
- if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false) {
+ if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false)
/* bank = EFUSE_MAX_BANK; */
break;
- }
/* only when bank is switched we have to reset the efuse_addr. */
if (bank != startBank)
#if 1
while (AVAILABLE_EFUSE_ADDR(efuse_addr)) {
- if (efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest) == false) {
+ if (efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest) == false)
/* bank = EFUSE_MAX_BANK; */
break;
- }
if (efuse_data == 0xFF)
break;
return false;
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAX_SECTION, &max_section, bPseudoTest);
- if (offset > max_section) {
+ if (offset > max_section)
return false;
- }
memset(data, 0xFF, PGPKT_DATA_SIZE);
ret = true;
if (EXT_HEADER(efuse_data)) {
hoffset = GET_HDR_OFFSET_2_0(efuse_data);
efuse_OneByteRead(padapter, efuse_addr++, &efuse_data, bPseudoTest);
- if (ALL_WORDS_DISABLED(efuse_data)) {
+ if (ALL_WORDS_DISABLED(efuse_data))
continue;
- }
hoffset |= ((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F;
efuse_OneByteRead(padapter, efuse_addr, &tmp_header, bPseudoTest);
if (tmp_header != 0xFF)
break;
- if (repeatcnt++ > EFUSE_REPEAT_THRESHOLD_) {
+ if (repeatcnt++ > EFUSE_REPEAT_THRESHOLD_)
return false;
- }
+
} while (1);
- if (tmp_header != pg_header) {
+ if (tmp_header != pg_header)
return false;
- }
/* to write ext_header */
efuse_addr++;
efuse_OneByteRead(padapter, efuse_addr, &tmp_header, bPseudoTest);
if (tmp_header != 0xFF)
break;
- if (repeatcnt++ > EFUSE_REPEAT_THRESHOLD_) {
+ if (repeatcnt++ > EFUSE_REPEAT_THRESHOLD_)
return false;
- }
+
} while (1);
- if (tmp_header != pg_header) { /* offset PG fail */
+ if (tmp_header != pg_header) /* offset PG fail */
return false;
- }
*pAddr = efuse_addr;
efuse_addr = *pAddr;
badworden = Efuse_WordEnableDataWrite(padapter, efuse_addr+1, pTargetPkt->word_en, pTargetPkt->data, bPseudoTest);
- if (badworden != 0x0F) {
+ if (badworden != 0x0F)
return false;
- }
return true;
}
}
passing_time = jiffies_to_msecs(jiffies - start);
- if (passing_time > 1000) {
+ if (passing_time > 1000)
break;
- }
msleep(1);
} while (1);
static void process_c2h_event(struct adapter *padapter, struct c2h_evt_hdr_t *pC2hEvent, u8 *c2hBuf)
{
- if (!c2hBuf) {
+ if (!c2hBuf)
return;
- }
switch (pC2hEvent->CmdID) {
case C2H_AP_RPT_RSP:
case HW_VAR_MACID_WAKEUP:
/* Input is MACID */
val32 = *(u32 *)val;
- if (val32 > 31) {
+ if (val32 > 31)
break;
- }
+
val8 = (u8)val32; /* macid is between 0~31 */
val32 = rtw_read32(padapter, REG_MACID_SLEEP);
/* init LLT after tx buffer boundary is defined */
ret = rtl8723b_InitLLTTable(padapter);
- if (_SUCCESS != ret) {
+ if (_SUCCESS != ret)
return _FAIL;
- }
+
/* */
_InitQueuePriority(padapter);
_InitPageBoundary(padapter);
u8 *tmpbuf;
tmpbuf = rtw_malloc(8);
- if (!tmpbuf) {
+ if (!tmpbuf)
return SDIO_ERR_VAL32;
- }
ftaddr &= ~(u16)0x3;
sd_read(intfhdl, ftaddr, 8, tmpbuf);
bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)buf,
len, notify_signal, GFP_ATOMIC);
- if (unlikely(!bss)) {
+ if (unlikely(!bss))
goto exit;
- }
cfg80211_put_bss(wiphy, bss);
kfree(buf);
{
psta = rtw_get_stainfo(pstapriv, param->sta_addr);
if (!psta)
- {
/* ret = -EINVAL; */
goto exit;
- }
}
if (strcmp(param->u.crypt.alg, "none") == 0 && (psta == NULL))
- {
-
goto exit;
- }
-
if (strcmp(param->u.crypt.alg, "WEP") == 0 && (psta == NULL))
{
}
pmlmepriv->wps_probe_req_ie = rtw_malloc(wps_ielen);
- if (pmlmepriv->wps_probe_req_ie == NULL) {
+ if (pmlmepriv->wps_probe_req_ie == NULL)
return -EINVAL;
- }
memcpy(pmlmepriv->wps_probe_req_ie, wps_ie, wps_ielen);
pmlmepriv->wps_probe_req_ie_len = wps_ielen;
}
}
if (request->ie && request->ie_len > 0)
- {
rtw_cfg80211_set_probe_req_wpsp2pie(padapter, (u8 *)request->ie, request->ie_len);
- }
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
need_indicate_scan_done = true;
if (unlikely(skb->len < rtap_len))
goto fail;
- if (rtap_len != 14) {
+ if (rtap_len != 14)
goto fail;
- }
/* Skip the ratio tap header */
skb_pull(skb, rtap_len);
u32 len = skb->len;
u8 category, action;
- if (rtw_action_frame_parse(buf, len, &category, &action) == false) {
+ if (rtw_action_frame_parse(buf, len, &category, &action) == false)
goto fail;
- }
/* starting alloc mgmt frame to dump it */
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
struct sta_priv *pstapriv = &padapter->stapriv;
const u8 *mac = params->mac;
- if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) {
+ if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true)
return -EINVAL;
- }
-
if (!mac) {
flush_all_cam_entry(padapter); /* clear CAM */
/* indicate ack before issue frame to avoid racing with rsp frame */
rtw_cfg80211_mgmt_tx_status(padapter, *cookie, buf, len, ack, GFP_KERNEL);
- if (rtw_action_frame_parse(buf, len, &category, &action) == false) {
+ if (rtw_action_frame_parse(buf, len, &category, &action) == false)
goto exit;
- }
rtw_ps_deny(padapter, PS_DENY_MGNT_TX);
if (_FAIL == rtw_pwr_wakeup(padapter)) {
rtw_regd_init(wiphy, rtw_reg_notifier);
ret = wiphy_register(wiphy);
- if (ret < 0) {
+ if (ret < 0)
goto free_wiphy;
- }
/* wdev */
wdev = rtw_zmalloc(sizeof(struct wireless_dev));
rtw_cfg80211_indicate_scan_done(adapter, true);
- if (pwdev_priv->pmon_ndev) {
+ if (pwdev_priv->pmon_ndev)
unregister_netdev(pwdev_priv->pmon_ndev);
- }
wiphy_unregister(wdev->wiphy);
}
if (func) {
sdio_claim_host(func);
err = sdio_disable_func(func);
- if (err) {
+ if (err)
dvobj->drv_dbg.dbg_sdio_deinit_error_cnt++;
- }
if (dvobj->irq_alloc) {
err = sdio_release_irq(func);
- if (err) {
+ if (err)
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
- } else
+ else
dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
}
struct sdio_data *psdio;
dvobj = devobj_init();
- if (dvobj == NULL) {
+ if (dvobj == NULL)
goto exit;
- }
sdio_set_drvdata(func, dvobj);
static void sd_intf_start(struct adapter *padapter)
{
- if (padapter == NULL) {
+ if (padapter == NULL)
return;
- }
/* hal dep */
rtw_hal_enable_interrupt(padapter);
static void sd_intf_stop(struct adapter *padapter)
{
- if (padapter == NULL) {
+ if (padapter == NULL)
return;
- }
/* hal dep */
rtw_hal_disable_interrupt(padapter);
struct sdio_data *psdio = &dvobj->intf_data;
padapter = vzalloc(sizeof(*padapter));
- if (padapter == NULL) {
+ if (padapter == NULL)
goto exit;
- }
padapter->dvobj = dvobj;
dvobj->if1 = padapter;
rtw_dev_unload(if1);
- if (if1->rtw_wdev) {
+ if (if1->rtw_wdev)
rtw_wdev_free(if1->rtw_wdev);
- }
rtw_free_drv_sw(if1);
free_if2:
if (status != _SUCCESS && if2) {
}
- if (status != _SUCCESS && if1) {
+ if (status != _SUCCESS && if1)
rtw_sdio_if1_deinit(if1);
- }
+
free_dvobj:
if (status != _SUCCESS)
sdio_dvobj_deinit(func);
sdio_claim_host(func);
sdio_readb(func, 0, &err);
sdio_release_host(func);
- if (err == -ENOMEDIUM) {
+ if (err == -ENOMEDIUM)
padapter->bSurpriseRemoved = true;
- }
}
rtw_ps_deny(padapter, PS_DENY_DRV_REMOVE);