diff options
author | 2016-04-11 10:41:07 +0300 | |
---|---|---|
committer | 2016-04-13 08:17:18 +0300 | |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/staging/rtl8188eu/core/rtw_recv.c | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/staging/rtl8188eu/core/rtw_recv.c')
-rw-r--r-- | kernel/drivers/staging/rtl8188eu/core/rtw_recv.c | 66 |
1 files changed, 22 insertions, 44 deletions
diff --git a/kernel/drivers/staging/rtl8188eu/core/rtw_recv.c b/kernel/drivers/staging/rtl8188eu/core/rtw_recv.c index cda725a8f..110b8c0b6 100644 --- a/kernel/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/kernel/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -19,10 +19,13 @@ ******************************************************************************/ #define _RTW_RECV_C_ +#include <linux/ieee80211.h> + #include <osdep_service.h> #include <drv_types.h> #include <recv_osdep.h> #include <mlme_osdep.h> +#include <mon.h> #include <wifi.h> #include <linux/vmalloc.h> @@ -72,10 +75,8 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(struct recv_frame) + RXFRAME_ALIGN_SZ); - if (precvpriv->pallocated_frame_buf == NULL) { - res = _FAIL; - goto exit; - } + if (!precvpriv->pallocated_frame_buf) + return _FAIL; precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ); @@ -87,7 +88,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) list_add_tail(&(precvframe->list), &(precvpriv->free_recv_queue.queue)); - res = rtw_os_recv_resource_alloc(padapter, precvframe); + rtw_os_recv_resource_alloc(precvframe); precvframe->len = 0; @@ -105,8 +106,6 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->signal_stat_sampling_interval = 1000; /* ms */ rtw_set_signal_stat_timer(precvpriv); -exit: - return res; } @@ -115,7 +114,6 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) { struct adapter *padapter = precvpriv->adapter; - rtw_free_uc_swdec_pending_queue(padapter); if (precvpriv->pallocated_frame_buf) { @@ -151,7 +149,6 @@ struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue) } } - return (struct recv_frame *)hdr; } @@ -168,14 +165,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) { @@ -206,7 +195,6 @@ int rtw_free_recvframe(struct recv_frame *precvframe, spin_unlock_bh(&pfree_recv_queue->lock); - return _SUCCESS; } @@ -215,7 +203,6 @@ int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue) struct adapter *padapter = precvframe->adapter; struct recv_priv *precvpriv = &padapter->recvpriv; - list_del_init(&(precvframe->list)); list_add_tail(&(precvframe->list), get_list_head(queue)); @@ -224,7 +211,6 @@ int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue) precvpriv->free_recvframe_cnt++; } - return _SUCCESS; } @@ -419,7 +405,6 @@ static int recvframe_chkmic(struct adapter *adapter, exit: - return res; } @@ -481,7 +466,6 @@ static struct recv_frame *decryptor(struct adapter *padapter, return_packet = NULL; } - return return_packet; } @@ -500,7 +484,6 @@ static struct recv_frame *portctrl(struct adapter *adapter, struct rx_pkt_attrib *pattrib; __be16 be_tmp; - pstapriv = &adapter->stapriv; auth_alg = adapter->securitypriv.dot11AuthAlgrthm; @@ -559,7 +542,6 @@ static struct recv_frame *portctrl(struct adapter *adapter, prtnframe = precv_frame; } - return prtnframe; } @@ -571,7 +553,6 @@ static int recv_decache(struct recv_frame *precv_frame, u8 bretry, u16 seq_ctrl = ((precv_frame->attrib.seq_num&0xffff) << 4) | (precv_frame->attrib.frag_num & 0xf); - if (tid > 15) { RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, (tid>15)! seq_ctrl=0x%x, tid=0x%x\n", seq_ctrl, tid)); @@ -588,7 +569,6 @@ static int recv_decache(struct recv_frame *precv_frame, u8 bretry, prxcache->tid_rxseq[tid] = seq_ctrl; - return _SUCCESS; } @@ -725,7 +705,6 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame, u8 *sta_addr = NULL; int bmcast = IS_MCAST(pattrib->dst); - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { /* filter packets that SA is myself or multicast or broadcast */ @@ -813,7 +792,6 @@ static int ap2sta_data_frame( u8 *myhwaddr = myid(&adapter->eeprompriv); int bmcast = IS_MCAST(pattrib->dst); - if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) && (check_fwstate(pmlmepriv, _FW_LINKED) == true || check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) { @@ -905,7 +883,6 @@ static int ap2sta_data_frame( exit: - return ret; } @@ -920,7 +897,6 @@ static int sta2ap_data_frame(struct adapter *adapter, unsigned char *mybssid = get_bssid(pmlmepriv); int ret = _SUCCESS; - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { /* For AP mode, RA = BSSID, TX = STA(SRC_ADDR), A3 = DST_ADDR */ if (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) { @@ -965,7 +941,6 @@ static int sta2ap_data_frame(struct adapter *adapter, exit: - return ret; } @@ -1147,7 +1122,6 @@ static int validate_recv_data_frame(struct adapter *adapter, struct security_priv *psecuritypriv = &adapter->securitypriv; int ret = _SUCCESS; - bretry = GetRetry(ptr); pda = get_da(ptr); psa = get_sa(ptr); @@ -1251,7 +1225,6 @@ static int validate_recv_data_frame(struct adapter *adapter, exit: - return ret; } @@ -1271,7 +1244,6 @@ static int validate_recv_frame(struct adapter *adapter, u8 ver = (unsigned char)(*ptr)&0x3; struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; - if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter)); if (ch_set_idx >= 0) @@ -1305,7 +1277,7 @@ static int validate_recv_frame(struct adapter *adapter, int i; DBG_88E("#############################\n"); - for (i = 0; i < 64; i = i+8) + for (i = 0; i < 64; i += 8) DBG_88E("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2), *(ptr+i+3), *(ptr+i+4), *(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_88E("#############################\n"); @@ -1314,7 +1286,7 @@ static int validate_recv_frame(struct adapter *adapter, int i; DBG_88E("#############################\n"); - for (i = 0; i < 64; i = i+8) + for (i = 0; i < 64; i += 8) DBG_88E("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2), *(ptr+i+3), *(ptr+i+4), *(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_88E("#############################\n"); @@ -1324,7 +1296,7 @@ static int validate_recv_frame(struct adapter *adapter, int i; DBG_88E("#############################\n"); - for (i = 0; i < 64; i = i+8) + for (i = 0; i < 64; i += 8) DBG_88E("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2), *(ptr+i+3), *(ptr+i+4), *(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_88E("#############################\n"); @@ -1358,8 +1330,20 @@ static int validate_recv_frame(struct adapter *adapter, break; } -exit: + /* + * This is the last moment before management and control frames get + * discarded. So we need to forward them to the monitor now or never. + * + * At the same time data frames can still be encrypted if software + * decryption is in use. However, decryption can occur not until later + * (see recv_func()). + * + * Hence forward the frame to the monitor anyway to preserve the order + * in which frames were received. + */ + rtl88eu_mon_recv_hook(adapter->pmondev, precv_frame); +exit: return retval; } @@ -1443,7 +1427,6 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, struct recv_frame *prframe, *pnextrframe; struct __queue *pfree_recv_queue; - curfragnum = 0; pfree_recv_queue = &adapter->recvpriv.free_recv_queue; @@ -1508,7 +1491,6 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("Performance defrag!!!!!\n")); - return prframe; } @@ -1526,7 +1508,6 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, struct recv_frame *prtnframe = NULL; struct __queue *pfree_recv_queue, *pdefrag_q; - pstapriv = &padapter->stapriv; pfhdr = precv_frame; @@ -1610,7 +1591,6 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, } } - return prtnframe; } @@ -2114,7 +2094,6 @@ s32 rtw_recv_entry(struct recv_frame *precvframe) struct recv_priv *precvpriv; s32 ret = _SUCCESS; - padapter = precvframe->adapter; precvpriv = &padapter->recvpriv; @@ -2127,7 +2106,6 @@ s32 rtw_recv_entry(struct recv_frame *precvframe) precvpriv->rx_pkts++; - return ret; _recv_entry_drop: |