aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/r8188eu/core/rtw_recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_recv.c')
-rw-r--r--drivers/staging/r8188eu/core/rtw_recv.c116
1 files changed, 12 insertions, 104 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index e082edfbaad8..51a13262a226 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -9,6 +9,7 @@
#include "../include/mlme_osdep.h"
#include "../include/usb_ops.h"
#include "../include/wifi.h"
+#include "../include/rtl8188e_recv.h"
static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
@@ -31,7 +32,7 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
spin_lock_init(&psta_recvpriv->lock);
- _rtw_init_queue(&psta_recvpriv->defrag_q);
+ rtw_init_queue(&psta_recvpriv->defrag_q);
}
@@ -45,9 +46,9 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
spin_lock_init(&precvpriv->lock);
- _rtw_init_queue(&precvpriv->free_recv_queue);
- _rtw_init_queue(&precvpriv->recv_pending_queue);
- _rtw_init_queue(&precvpriv->uc_swdec_pending_queue);
+ rtw_init_queue(&precvpriv->free_recv_queue);
+ rtw_init_queue(&precvpriv->recv_pending_queue);
+ rtw_init_queue(&precvpriv->uc_swdec_pending_queue);
precvpriv->adapter = padapter;
@@ -82,7 +83,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
sema_init(&precvpriv->allrxreturnevt, 0);
- res = rtw_hal_init_recv_priv(padapter);
+ res = rtl8188eu_init_recv_priv(padapter);
timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0);
precvpriv->signal_stat_sampling_interval = 1000; /* ms */
@@ -103,7 +104,7 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv)
vfree(precvpriv->pallocated_frame_buf);
- rtw_hal_free_recv_priv(padapter);
+ rtl8188eu_free_recv_priv(padapter);
}
struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
@@ -147,14 +148,6 @@ struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
return precvframe;
}
-void rtw_init_recvframe(struct recv_frame *precvframe, struct recv_priv *precvpriv)
-{
- /* Perry: This can be removed */
- INIT_LIST_HEAD(&precvframe->list);
-
- precvframe->len = 0;
-}
-
int rtw_free_recvframe(struct recv_frame *precvframe, struct __queue *pfree_recv_queue)
{
struct adapter *padapter;
@@ -257,56 +250,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter)
return cnt;
}
-int rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, struct __queue *queue)
-{
- spin_lock_bh(&queue->lock);
-
- list_del_init(&precvbuf->list);
- list_add(&precvbuf->list, get_list_head(queue));
-
- spin_unlock_bh(&queue->lock);
-
- return _SUCCESS;
-}
-
-int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&queue->lock, flags);
-
- list_del_init(&precvbuf->list);
-
- list_add_tail(&precvbuf->list, get_list_head(queue));
- spin_unlock_irqrestore(&queue->lock, flags);
- return _SUCCESS;
-}
-
-struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue)
-{
- struct recv_buf *precvbuf;
- struct list_head *plist, *phead;
- unsigned long flags;
-
- spin_lock_irqsave(&queue->lock, flags);
-
- if (list_empty(&queue->queue)) {
- precvbuf = NULL;
- } else {
- phead = get_list_head(queue);
-
- plist = phead->next;
-
- precvbuf = container_of(plist, struct recv_buf, list);
-
- list_del_init(&precvbuf->list);
- }
-
- spin_unlock_irqrestore(&queue->lock, flags);
-
- return precvbuf;
-}
-
static int recvframe_chkmic(struct adapter *adapter, struct recv_frame *precvframe)
{
int i, res = _SUCCESS;
@@ -418,13 +361,13 @@ static struct recv_frame *decryptor(struct adapter *padapter, struct recv_frame
switch (prxattrib->encrypt) {
case _WEP40_:
case _WEP104_:
- rtw_wep_decrypt(padapter, (u8 *)precv_frame);
+ rtw_wep_decrypt(padapter, precv_frame);
break;
case _TKIP_:
- res = rtw_tkip_decrypt(padapter, (u8 *)precv_frame);
+ res = rtw_tkip_decrypt(padapter, precv_frame);
break;
case _AES_:
- res = rtw_aes_decrypt(padapter, (u8 *)precv_frame);
+ res = rtw_aes_decrypt(padapter, precv_frame);
break;
default:
break;
@@ -523,7 +466,6 @@ static int recv_decache(struct recv_frame *precv_frame, u8 bretry, struct stainf
void process_pwrbit_data(struct adapter *padapter, struct recv_frame *precv_frame);
void process_pwrbit_data(struct adapter *padapter, struct recv_frame *precv_frame)
{
-#ifdef CONFIG_88EU_AP_MODE
unsigned char pwrbit;
u8 *ptr = precv_frame->rx_data;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
@@ -543,13 +485,10 @@ void process_pwrbit_data(struct adapter *padapter, struct recv_frame *precv_fram
wakeup_sta_to_xmit(padapter, psta);
}
}
-
-#endif
}
static void process_wmmps_data(struct adapter *padapter, struct recv_frame *precv_frame)
{
-#ifdef CONFIG_88EU_AP_MODE
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta = NULL;
@@ -598,8 +537,6 @@ static void process_wmmps_data(struct adapter *padapter, struct recv_frame *prec
}
}
}
-
-#endif
}
static void count_rx_stats(struct adapter *padapter, struct recv_frame *prframe, struct sta_info *sta)
@@ -710,14 +647,8 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame,
else
*psta = rtw_get_stainfo(pstapriv, sta_addr); /* get ap_info */
- if (!*psta) {
- if (adapter->registrypriv.mp_mode == 1) {
- if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
- adapter->mppriv.rx_pktloss++;
- }
- ret = _FAIL;
+ if (!*psta)
goto exit;
- }
exit:
@@ -883,7 +814,6 @@ exit:
static int validate_recv_ctrl_frame(struct adapter *padapter,
struct recv_frame *precv_frame)
{
-#ifdef CONFIG_88EU_AP_MODE
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
u8 *pframe = precv_frame->rx_data;
@@ -966,8 +896,6 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
pxmitframe->attrib.triggered = 1;
- rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
-
if (psta->sleepq_len == 0) {
pstapriv->tim_bitmap &= ~BIT(psta->aid);
@@ -998,8 +926,6 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
}
}
-#endif
-
return _FAIL;
}
@@ -1189,7 +1115,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
pattrib->order = GetOrder(ptr);
/* Dump rx packets */
- rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
+ GetHalDefVar8188EUsb(adapter, HAL_DEF_DBG_DUMP_RXPKT, &bDumpRxPkt);
if (bDumpRxPkt == 1) {/* dump all rx packets */
int i;
DBG_88E("#############################\n");
@@ -1860,22 +1786,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, struct recv_frame
static int recv_func_prehandle(struct adapter *padapter, struct recv_frame *rframe)
{
int ret = _SUCCESS;
- struct rx_pkt_attrib *pattrib = &rframe->attrib;
struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
- struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-
- if (padapter->registrypriv.mp_mode == 1) {
- if (pattrib->crc_err == 1)
- padapter->mppriv.rx_crcerrpktcount++;
- else
- padapter->mppriv.rx_pktcount++;
-
- if (!check_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE)) {
- ret = _FAIL;
- rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */
- goto exit;
- }
- }
/* check the frame crtl field and decache */
ret = validate_recv_frame(padapter, rframe);
@@ -1998,9 +1909,6 @@ s32 rtw_recv_entry(struct recv_frame *precvframe)
_recv_entry_drop:
- if (padapter->registrypriv.mp_mode == 1)
- padapter->mppriv.rx_pktloss = precvpriv->rx_drop;
-
return ret;
}