u8 chk_sta_is_alive(struct sta_info *psta);
u8 chk_sta_is_alive(struct sta_info *psta)
{
- #ifdef DBG_EXPIRATION_CHK
- #endif
-
sta_update_last_rx_pkts(psta);
return true;
plist = get_next(phead);
/* check auth_queue */
- #ifdef DBG_EXPIRATION_CHK
- #endif
while (phead != plist) {
psta = container_of(plist, struct sta_info, auth_list);
plist = get_next(phead);
/* check asoc_queue */
- #ifdef DBG_EXPIRATION_CHK
- #endif
while (phead != plist) {
psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist);
u8 sq_final;
long rssi_final;
- #if defined(DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) && 1
- if (strcmp(dst->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) {
- }
- #endif
-
/* The rule below is 1/5 for sample value, 4/5 for history value */
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) && is_same_network(&(padapter->mlmepriv.cur_network.network), src, 0)) {
/* Take the recvpriv's value for the connected AP*/
dst->PhyInfo.SignalStrength = ss_final;
dst->PhyInfo.SignalQuality = sq_final;
dst->Rssi = rssi_final;
-
- #if defined(DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) && 1
- #endif
}
static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
preorder_ctrl = &psta->recvreorder_ctrl[i];
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
- #ifdef DBG_RX_SEQ
- #endif
preorder_ctrl->wend_b = 0xffff;
preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
}
preorder_ctrl = &bmc_sta->recvreorder_ctrl[i];
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
- #ifdef DBG_RX_SEQ
- #endif
preorder_ctrl->wend_b = 0xffff;
preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
}
padapter->recvpriv.signal_qual = ptarget_wlan->network.PhyInfo.SignalQuality;
/* the ptarget_wlan->network.Rssi is raw data, we use ptarget_wlan->network.PhyInfo.SignalStrength instead (has scaled) */
padapter->recvpriv.rssi = translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength);
- #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) && 1
- #endif
rtw_set_signal_stat_timer(&padapter->recvpriv);
preorder_ctrl = &psta->recvreorder_ctrl[tid];
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
- #ifdef DBG_RX_SEQ
- #endif
}
/* todo: how to notify the host while receiving DELETE BA */
break;
issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F));
psta->recvreorder_ctrl[tid].enable = false;
psta->recvreorder_ctrl[tid].indicate_seq = 0xffff;
- #ifdef DBG_RX_SEQ
- #endif
}
}
} else if (initiator == 1) {/* originator */
}
}
-#ifdef DBG_FIXED_CHAN
-
-#endif
-
if (survey_channel != 0) {
/* PAUSE 4-AC Queue when site_survey */
/* rtw_hal_get_hwreg(padapter, HW_VAR_TXPAUSE, (u8 *)(&val8)); */
pmlmepriv->num_sta_no_ht++;
}
- #if defined(DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) & 1
- #endif
-
/* mark bss info receiving from nearby channel as SignalQuality 101 */
if (bssid->Configuration.DSConfig != rtw_get_oper_ch(padapter))
bssid->PhyInfo.SignalQuality = 101;
{
u8 ret = false;
- #ifdef DBG_EXPIRATION_CHK
- #endif
-
if ((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta))
&& sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta)
&& sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta)
{
if (rx_chk != _SUCCESS) {
if (pmlmeext->retry == 0) {
- #ifdef DBG_EXPIRATION_CHK
- #endif
issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress, 0, 0, 0, 0);
issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress, 0, 0, 0, 0);
issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress, 0, 0, 0, 0);
}
if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit) {
- #ifdef DBG_EXPIRATION_CHK
- #endif
tx_chk = issue_nulldata_in_interrupt(padapter, NULL);
}
}
if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt == true))) {
psecuritypriv->hw_decrypted = false;
- #ifdef DBG_RX_DECRYPTOR
- #endif
-
switch (prxattrib->encrypt) {
case _WEP40_:
case _WEP104_:
(psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_)
) {
psecuritypriv->hw_decrypted = true;
- #ifdef DBG_RX_DECRYPTOR
-
- #endif
} else {
- #ifdef DBG_RX_DECRYPTOR
- #endif
}
if (res == _FAIL) {
/* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
/* da should be for me */
if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
!memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
(memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
if (!bmcast) {
issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get ap_info */
if (!*psta) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */
if (!*psta) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
}
ret = _FAIL;
- #ifdef DBG_RX_DROP_FRAME
- #endif
}
exit:
pbssid = get_hdr_bssid(ptr);
if (!pbssid) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
}
if (ret == _FAIL) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
goto exit;
} else if (ret == RTW_RX_HANDLED) {
goto exit;
if (!psta) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
/* decache, drop duplicate recv packets */
if (recv_decache(precv_frame, bretry, &psta->sta_recvpriv.rxcache) == _FAIL) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto exit;
}
}
break;
default:
- #ifdef DBG_RX_DROP_FRAME
- #endif
retval = _FAIL;
break;
}
/* Rx Reorder initialize condition. */
if (preorder_ctrl->indicate_seq == 0xFFFF) {
preorder_ctrl->indicate_seq = seq_num;
- #ifdef DBG_RX_SEQ
- #endif
/* DbgPrint("check_indicate_seq, 1st->indicate_seq =%d\n", precvpriv->indicate_seq); */
}
if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
/* DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */
- #ifdef DBG_RX_DROP_FRAME
- #endif
-
-
return false;
}
if (SN_EQUAL(seq_num, preorder_ctrl->indicate_seq)) {
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF;
- #ifdef DBG_RX_SEQ
- #endif
} else if (SN_LESS(wend, seq_num)) {
/* DbgPrint("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */
else
preorder_ctrl->indicate_seq = 0xFFF - (wsize - (seq_num + 1)) + 1;
pdbgpriv->dbg_rx_ampdu_window_shift_cnt++;
- #ifdef DBG_RX_SEQ
- #endif
}
/* DbgPrint("exit->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */
prframe = (union recv_frame *)plist;
pattrib = &prframe->u.hdr.attrib;
- #ifdef DBG_RX_SEQ
- #endif
recv_indicatepkts_pkt_loss_cnt(pdbgpriv, preorder_ctrl->indicate_seq, pattrib->seq_num);
preorder_ctrl->indicate_seq = pattrib->seq_num;
if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF;
- #ifdef DBG_RX_SEQ
- #endif
}
/* Set this as a lock to make sure that only one thread is indicating packet. */
}
- #ifdef DBG_RX_DROP_FRAME
- #endif
-
return _FAIL;
}
if (preorder_ctrl->enable == false) {
/* indicate this recv_frame */
preorder_ctrl->indicate_seq = pattrib->seq_num;
- #ifdef DBG_RX_SEQ
- #endif
rtw_recv_indicatepkt(padapter, prframe);
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1)%4096;
- #ifdef DBG_RX_SEQ
- #endif
return _SUCCESS;
}
} else if (pattrib->amsdu == 1) { /* temp filter -> means didn't support A-MSDUs in a A-MPDU */
if (preorder_ctrl->enable == false) {
preorder_ctrl->indicate_seq = pattrib->seq_num;
- #ifdef DBG_RX_SEQ
- #endif
retval = amsdu_to_msdu(padapter, prframe);
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1)%4096;
- #ifdef DBG_RX_SEQ
- #endif
if (retval != _SUCCESS) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
}
return retval;
/* s2. check if winstart_b(indicate_seq) needs to been updated */
if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) {
pdbgpriv->dbg_rx_ampdu_drop_count++;
- #ifdef DBG_RX_DROP_FRAME
- #endif
goto _err_exit;
}
/* DbgPrint("recv_indicatepkt_reorder, enqueue_reorder_recvframe fail!\n"); */
/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
/* return _FAIL; */
- #ifdef DBG_RX_DROP_FRAME
- #endif
goto _err_exit;
}
/* prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; */
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) { /* including perform A-MPDU Rx Ordering Buffer Control */
- #ifdef DBG_RX_DROP_FRAME
- #endif
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
} else { /* B/G mode */
retval = wlanhdr_to_ethhdr(prframe);
if (retval != _SUCCESS) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
return retval;
}
prframe = decryptor(padapter, prframe);
if (!prframe) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto _recv_data_drop;
}
prframe = recvframe_chk_defrag(padapter, prframe);
if (!prframe) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
goto _recv_data_drop;
}
prframe = portctrl(padapter, prframe);
if (!prframe) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
ret = _FAIL;
goto _recv_data_drop;
}
ret = process_recv_indicatepkts(padapter, prframe);
if (ret != _SUCCESS) {
- #ifdef DBG_RX_DROP_FRAME
- #endif
rtw_free_recvframe(orig_prframe, pfree_recv_queue);/* free this recv_frame */
goto _recv_data_drop;
}
recvpriv->signal_strength = tmp_s;
recvpriv->rssi = (s8)translate_percentage_to_dbm(tmp_s);
recvpriv->signal_qual = tmp_q;
-
- #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) && 1
- #endif
}
set_timer:
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
- #ifdef DBG_RX_SEQ
- #endif
preorder_ctrl->wend_b = 0xffff;
/* preorder_ctrl->wsize_b = (NR_RECVBUFF-2); */
preorder_ctrl->wsize_b = 64;/* 64; */
pattrib->encrypt = 0;
if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) {
- #ifdef DBG_TX_DROP_FRAME
- #endif
res = _FAIL;
goto exit;
}
pattrib->icv_len = 4;
if (psecuritypriv->busetkipkey == _FAIL) {
- #ifdef DBG_TX_DROP_FRAME
- #endif
res = _FAIL;
goto exit;
}
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
if (!psta) { /* if we cannot get psta => drop the pkt */
- #ifdef DBG_TX_DROP_FRAME
- #endif
res = _FAIL;
goto exit;
} else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) && (!(psta->state & _FW_LINKED))) {
if (!psta) {
/* if we cannot get psta => drop the pkt */
- #ifdef DBG_TX_DROP_FRAME
- #endif
res = _FAIL;
goto exit;
}
if (pxmitbuf) {
pxmitpriv->free_xmit_extbuf_cnt--;
- #ifdef DBG_XMIT_BUF_EXT
- #endif
pxmitbuf->priv_data = NULL;
list_add_tail(&pxmitbuf->list, get_list_head(pfree_queue));
pxmitpriv->free_xmit_extbuf_cnt++;
- #ifdef DBG_XMIT_BUF_EXT
- #endif
spin_unlock_irqrestore(&pfree_queue->lock, irqL);
if (pxmitbuf) {
pxmitpriv->free_xmitbuf_cnt--;
- #ifdef DBG_XMIT_BUF
- #endif
pxmitbuf->priv_data = NULL;
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
}
}
- #ifdef DBG_XMIT_BUF
- #endif
spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL);
get_list_head(pfree_xmitbuf_queue));
pxmitpriv->free_xmitbuf_cnt++;
- #ifdef DBG_XMIT_BUF
- #endif
spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL);
}
return _SUCCESS;
res = update_attrib(padapter, *ppkt, &pxmitframe->attrib);
if (res == _FAIL) {
- #ifdef DBG_TX_DROP_FRAME
- #endif
rtw_free_xmitframe(pxmitpriv, pxmitframe);
return -1;
}
ptxservq = container_of(sta_plist, struct tx_servq, tx_pending);
sta_plist = get_next(sta_plist);
-#ifdef DBG_XMIT_BUF
-#endif
pframe_queue = &ptxservq->sta_pending;
frame_phead = get_list_head(pframe_queue);
goto exit;
}
-#ifdef DEBUG_CFG80211
-#endif
-
/* for infra./P2PClient mode */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
&& check_fwstate(pmlmepriv, _FW_LINKED)
spin_lock_bh(&pwdev_priv->scan_req_lock);
if (pwdev_priv->scan_request) {
- #ifdef DEBUG_CFG80211
- #endif
-
/* avoid WARN_ON(request != wiphy_to_dev(request->wiphy)->scan_req); */
if (pwdev_priv->scan_request->wiphy != pwdev_priv->rtw_wdev->wiphy)
{
pwdev_priv->scan_request = NULL;
} else {
- #ifdef DEBUG_CFG80211
- #endif
}
spin_unlock_bh(&pwdev_priv->scan_req_lock);
}
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
{
-#ifdef DEBUG_CFG80211
-#endif
-
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS|_FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
{
DBG_8192C("%s, fwstate = 0x%x\n", __func__, pmlmepriv->fw_state);
/* parsing channels, n_channels */
memset(ch, 0, sizeof(struct rtw_ieee80211_channel)*RTW_CHANNEL_SCAN_AMOUNT);
for (i = 0; i < request->n_channels && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
- #ifdef DEBUG_CFG80211
- #endif
ch[i].hw_value = request->channels[i]->hw_value;
ch[i].flags = request->channels[i]->flags;
}
/* cookie generation */
*cookie = (unsigned long) buf;
-#ifdef DEBUG_CFG80211
-#endif /* DEBUG_CFG80211 */
-
/* indicate ack before issue frame to avoid racing with rsp frame */
rtw_cfg80211_mgmt_tx_status(padapter, *cookie, buf, len, ack, GFP_KERNEL);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
- #ifdef DBG_IOCTL
- #endif
-
rtw_ps_deny(padapter, PS_DENY_SCAN);
if (_FAIL == rtw_pwr_wakeup(padapter)) {
ret = -1;
rtw_ps_deny_cancel(padapter, PS_DENY_SCAN);
- #ifdef DBG_IOCTL
- #endif
-
return ret;
}
u32 ret = 0;
signed int wait_status;
- #ifdef DBG_IOCTL
- #endif
-
if (adapter_to_pwrctl(padapter)->brfoffbyhw && padapter->bDriverStopped) {
ret = -EINVAL;
goto exit;
exit:
- #ifdef DBG_IOCTL
- #endif
-
return ret;
}
uint ret = 0, len;
- #ifdef DBG_IOCTL
- #endif
-
rtw_ps_deny(padapter, PS_DENY_JOIN);
if (_FAIL == rtw_pwr_wakeup(padapter)) {
ret = -1;
rtw_ps_deny_cancel(padapter, PS_DENY_JOIN);
- #ifdef DBG_IOCTL
- #endif
-
return ret;
}
s32 res = 0;
if (rtw_if_up(padapter) == false) {
- #ifdef DBG_TX_DROP_FRAME
- #endif
goto drop_packet;
}
res = rtw_xmit(padapter, &pkt);
if (res < 0) {
- #ifdef DBG_TX_DROP_FRAME
- #endif
goto drop_packet;
}