xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8189fs/hal/rtl8188f/rtl8188f_rxdesc.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  *****************************************************************************/
15 #define _RTL8188F_REDESC_C_
16 
17 #include <rtl8188f_hal.h>
18 
rtl8188f_query_rx_desc_status(union recv_frame * precvframe,u8 * pdesc)19 void rtl8188f_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc)
20 {
21 	struct rx_pkt_attrib *pattrib;
22 
23 
24 	pattrib = &precvframe->u.hdr.attrib;
25 	_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
26 
27 	pattrib->pkt_len = (u16)GET_RX_STATUS_DESC_PKT_LEN_8188F(pdesc);
28 	pattrib->pkt_rpt_type = GET_RX_STATUS_DESC_RPT_SEL_8188F(pdesc) ? C2H_PACKET : NORMAL_RX;
29 
30 	if (pattrib->pkt_rpt_type == NORMAL_RX) {
31 		/* Offset 0 */
32 		pattrib->crc_err = (u8)GET_RX_STATUS_DESC_CRC32_8188F(pdesc);
33 		pattrib->icv_err = (u8)GET_RX_STATUS_DESC_ICV_8188F(pdesc);
34 		pattrib->drvinfo_sz = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE_8188F(pdesc) << 3;
35 		pattrib->encrypt = (u8)GET_RX_STATUS_DESC_SECURITY_8188F(pdesc);
36 		pattrib->qos = (u8)GET_RX_STATUS_DESC_QOS_8188F(pdesc);
37 		pattrib->shift_sz = (u8)GET_RX_STATUS_DESC_SHIFT_8188F(pdesc);
38 		pattrib->physt = (u8)GET_RX_STATUS_DESC_PHY_STATUS_8188F(pdesc);
39 		pattrib->bdecrypted = (u8)GET_RX_STATUS_DESC_SWDEC_8188F(pdesc) ? 0 : 1;
40 
41 		/* Offset 4 */
42 		pattrib->priority = (u8)GET_RX_STATUS_DESC_TID_8188F(pdesc);
43 		pattrib->amsdu = (u8)GET_RX_STATUS_DESC_AMSDU_8188F(pdesc);
44 		pattrib->mdata = (u8)GET_RX_STATUS_DESC_MORE_DATA_8188F(pdesc);
45 		pattrib->mfrag = (u8)GET_RX_STATUS_DESC_MORE_FRAG_8188F(pdesc);
46 
47 		/* Offset 8 */
48 		pattrib->seq_num = (u16)GET_RX_STATUS_DESC_SEQ_8188F(pdesc);
49 		pattrib->frag_num = (u8)GET_RX_STATUS_DESC_FRAG_8188F(pdesc);
50 
51 		/* Offset 12 */
52 		pattrib->data_rate = (u8)GET_RX_STATUS_DESC_RX_RATE_8188F(pdesc);
53 
54 		/* Offset 16 */
55 		pattrib->sgi = (u8)GET_RX_STATUS_DESC_SPLCP_8188F(pdesc);
56 		pattrib->ldpc = (u8)GET_RX_STATUS_DESC_LDPC_8188F(pdesc);
57 		pattrib->stbc = (u8)GET_RX_STATUS_DESC_STBC_8188F(pdesc);
58 		pattrib->bw = (u8)GET_RX_STATUS_DESC_BW_8188F(pdesc);
59 
60 		/* Offset 20 */
61 		/* pattrib->tsfl=(u8)GET_RX_STATUS_DESC_TSFL_8188F(pdesc); */
62 	}
63 }
64