Path: blob/master/ALFA-W1F1/RTL8814AU/hal/rtl8814a/rtl8814a_rxdesc.c
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13*****************************************************************************/14#define _RTL8814A_RXDESC_C_1516/* #include <drv_types.h> */17#include <rtl8814a_hal.h>1819void rtl8814_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc)20{21struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;2223_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));24pattrib->bw = CHANNEL_WIDTH_MAX;2526/* Offset 0 */27pattrib->pkt_len = (u16)GET_RX_STATUS_DESC_PKT_LEN_8814A(pdesc);/* (le32_to_cpu(pdesc->rxdw0)&0x00003fff) */28pattrib->crc_err = (u8)GET_RX_STATUS_DESC_CRC32_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw0) >> 14) & 0x1); */29pattrib->icv_err = (u8)GET_RX_STATUS_DESC_ICV_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw0) >> 15) & 0x1); */30pattrib->drvinfo_sz = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE_8814A(pdesc) * 8;/* ((le32_to_cpu(pdesc->rxdw0) >> 16) & 0xf) * 8; */ /* uint 2^3 = 8 bytes */31pattrib->encrypt = (u8)GET_RX_STATUS_DESC_SECURITY_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw0) >> 20) & 0x7); */32pattrib->qos = (u8)GET_RX_STATUS_DESC_QOS_8814A(pdesc);/* (( le32_to_cpu( pdesc->rxdw0 ) >> 23) & 0x1); */ /* Qos data, wireless lan header length is 26 */33pattrib->shift_sz = (u8)GET_RX_STATUS_DESC_SHIFT_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw0) >> 24) & 0x3); */34pattrib->physt = (u8)GET_RX_STATUS_DESC_PHY_STATUS_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw0) >> 26) & 0x1); */35pattrib->bdecrypted = !GET_RX_STATUS_DESC_SWDEC_8814A(pdesc);/* (le32_to_cpu(pdesc->rxdw0) & BIT(27))? 0:1; */3637/* Offset 4 */38pattrib->priority = (u8)GET_RX_STATUS_DESC_TID_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw1) >> 8) & 0xf); */39pattrib->mdata = (u8)GET_RX_STATUS_DESC_MORE_DATA_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw1) >> 26) & 0x1); */40pattrib->mfrag = (u8)GET_RX_STATUS_DESC_MORE_FRAG_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw1) >> 27) & 0x1); */ /* more fragment bit */4142/* Offset 8 */43pattrib->seq_num = (u16)GET_RX_STATUS_DESC_SEQ_8814A(pdesc);/* (le32_to_cpu(pdesc->rxdw2) & 0x00000fff); */44pattrib->frag_num = (u8)GET_RX_STATUS_DESC_FRAG_8814A(pdesc);/* ((le32_to_cpu(pdesc->rxdw2) >> 12) & 0xf); */ /* fragmentation number */454647if (GET_RX_STATUS_DESC_RPT_SEL_8814A(pdesc))48pattrib->pkt_rpt_type = C2H_PACKET;49else5051pattrib->pkt_rpt_type = NORMAL_RX;5253/* Offset 12 */54pattrib->data_rate = (u8)GET_RX_STATUS_DESC_RX_RATE_8814A(pdesc); /* ((le32_to_cpu(pdesc->rxdw3))&0x7f); */5556/* Offset 16 */57/* Offset 20 */5859}606162