2015-08-18 19:03:09 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
2019-11-09 10:12:08 +00:00
|
|
|
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
2015-08-18 19:03:09 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
2019-11-09 10:12:08 +00:00
|
|
|
*****************************************************************************/
|
2015-08-18 19:03:09 +00:00
|
|
|
#ifndef _RTW_RECV_H_
|
|
|
|
#define _RTW_RECV_H_
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#define RTW_RX_MSDU_ACT_NONE 0
|
|
|
|
#define RTW_RX_MSDU_ACT_INDICATE BIT0
|
|
|
|
#define RTW_RX_MSDU_ACT_FORWARD BIT1
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
#ifdef PLATFORM_OS_XP
|
|
|
|
#ifdef CONFIG_SDIO_HCI
|
2019-11-09 10:12:08 +00:00
|
|
|
#define NR_RECVBUFF 1024/* 512 */ /* 128 */
|
2015-08-18 19:03:09 +00:00
|
|
|
#else
|
|
|
|
#define NR_RECVBUFF (16)
|
|
|
|
#endif
|
|
|
|
#elif defined(PLATFORM_OS_CE)
|
|
|
|
#ifdef CONFIG_SDIO_HCI
|
|
|
|
#define NR_RECVBUFF (128)
|
|
|
|
#else
|
|
|
|
#define NR_RECVBUFF (4)
|
|
|
|
#endif
|
2019-11-09 10:12:08 +00:00
|
|
|
#else /* PLATFORM_LINUX /PLATFORM_BSD */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_SINGLE_RECV_BUF
|
|
|
|
#define NR_RECVBUFF (1)
|
|
|
|
#else
|
|
|
|
#if defined(CONFIG_GSPI_HCI)
|
|
|
|
#define NR_RECVBUFF (32)
|
|
|
|
#elif defined(CONFIG_SDIO_HCI)
|
2019-11-09 10:12:08 +00:00
|
|
|
#define NR_RECVBUFF (8)
|
2015-08-18 19:03:09 +00:00
|
|
|
#else
|
|
|
|
#define NR_RECVBUFF (8)
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
|
|
|
#endif /* CONFIG_SINGLE_RECV_BUF */
|
2017-05-11 18:47:23 +00:00
|
|
|
#ifdef CONFIG_PREALLOC_RX_SKB_BUFFER
|
|
|
|
#define NR_PREALLOC_RECV_SKB (rtw_rtkm_get_nr_recv_skb()>>1)
|
|
|
|
#else /*!CONFIG_PREALLOC_RX_SKB_BUFFER */
|
|
|
|
#define NR_PREALLOC_RECV_SKB 8
|
|
|
|
#endif /* CONFIG_PREALLOC_RX_SKB_BUFFER */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_RTW_NAPI
|
|
|
|
#define RTL_NAPI_WEIGHT (32)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(CONFIG_RTL8821C) && defined(CONFIG_SDIO_HCI) && defined(CONFIG_RECV_THREAD_MODE)
|
|
|
|
#ifdef NR_RECVBUFF
|
|
|
|
#undef NR_RECVBUFF
|
|
|
|
#define NR_RECVBUFF (32)
|
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define NR_RECVFRAME 256
|
|
|
|
|
|
|
|
#define RXFRAME_ALIGN 8
|
|
|
|
#define RXFRAME_ALIGN_SZ (1<<RXFRAME_ALIGN)
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#define DRVINFO_SZ 4 /* unit is 8bytes */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#define MAX_RXFRAME_CNT 512
|
|
|
|
#define MAX_RX_NUMBLKS (32)
|
|
|
|
#define RECVFRAME_HDR_ALIGN 128
|
2017-05-11 18:47:23 +00:00
|
|
|
#define MAX_CONTINUAL_NORXPACKET_COUNT 4 /* In MAX_CONTINUAL_NORXPACKET_COUNT*2 sec , no rx traffict would issue DELBA*/
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#define PHY_RSSI_SLID_WIN_MAX 100
|
|
|
|
#define PHY_LINKQUALITY_SLID_WIN_MAX 20
|
|
|
|
|
|
|
|
|
|
|
|
#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
|
|
|
|
|
|
|
|
#define RX_MPDU_QUEUE 0
|
|
|
|
#define RX_CMD_QUEUE 1
|
|
|
|
#define RX_MAX_QUEUE 2
|
|
|
|
|
|
|
|
#define MAX_SUBFRAME_COUNT 64
|
|
|
|
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
|
2019-11-09 10:12:08 +00:00
|
|
|
extern u8 rtw_bridge_tunnel_header[];
|
|
|
|
extern u8 rtw_rfc1042_header[];
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2021-08-24 12:36:21 +00:00
|
|
|
#define LLC_HEADER_SIZE 6
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* for Rx reordering buffer control */
|
|
|
|
struct recv_reorder_ctrl {
|
2015-08-18 19:03:09 +00:00
|
|
|
_adapter *padapter;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 tid;
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 enable;
|
2019-11-09 10:12:08 +00:00
|
|
|
u16 indicate_seq;/* =wstart_b, init_value=0xffff */
|
2015-08-18 19:03:09 +00:00
|
|
|
u16 wend_b;
|
|
|
|
u8 wsize_b;
|
2017-05-11 18:47:23 +00:00
|
|
|
u8 ampdu_size;
|
2015-08-18 19:03:09 +00:00
|
|
|
_queue pending_recvframe_queue;
|
|
|
|
_timer reordering_ctrl_timer;
|
2017-05-11 18:47:23 +00:00
|
|
|
u8 bReorderWaiting;
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct stainfo_rxcache {
|
2019-11-09 10:12:08 +00:00
|
|
|
u16 tid_rxseq[16];
|
|
|
|
u8 iv[16][8];
|
|
|
|
u8 last_tid;
|
|
|
|
#if 0
|
|
|
|
unsigned short tid0_rxseq;
|
|
|
|
unsigned short tid1_rxseq;
|
|
|
|
unsigned short tid2_rxseq;
|
|
|
|
unsigned short tid3_rxseq;
|
|
|
|
unsigned short tid4_rxseq;
|
|
|
|
unsigned short tid5_rxseq;
|
|
|
|
unsigned short tid6_rxseq;
|
|
|
|
unsigned short tid7_rxseq;
|
|
|
|
unsigned short tid8_rxseq;
|
|
|
|
unsigned short tid9_rxseq;
|
|
|
|
unsigned short tid10_rxseq;
|
|
|
|
unsigned short tid11_rxseq;
|
|
|
|
unsigned short tid12_rxseq;
|
|
|
|
unsigned short tid13_rxseq;
|
|
|
|
unsigned short tid14_rxseq;
|
|
|
|
unsigned short tid15_rxseq;
|
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct smooth_rssi_data {
|
2019-11-09 10:12:08 +00:00
|
|
|
u32 elements[100]; /* array to store values */
|
|
|
|
u32 index; /* index to current array to store */
|
|
|
|
u32 total_num; /* num of valid elements */
|
|
|
|
u32 total_val; /* sum of valid elements */
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct signal_stat {
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 update_req; /* used to indicate */
|
|
|
|
u8 avg_val; /* avg of valid elements */
|
|
|
|
u32 total_num; /* num of valid elements */
|
|
|
|
u32 total_val; /* sum of valid elements */
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
struct rx_raw_rssi {
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 data_rate;
|
|
|
|
u8 pwdball;
|
|
|
|
s8 pwr_all;
|
2019-11-09 10:12:08 +00:00
|
|
|
|
2017-05-11 18:47:23 +00:00
|
|
|
u8 mimo_signal_strength[4];/* in 0~100 index */
|
|
|
|
u8 mimo_signal_quality[4];
|
2019-11-09 10:12:08 +00:00
|
|
|
|
2017-05-11 18:35:20 +00:00
|
|
|
s8 ofdm_pwr[4];
|
|
|
|
u8 ofdm_snr[4];
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
2017-05-11 18:47:23 +00:00
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#include "cmn_info/rtw_sta_info.h"
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
struct rx_pkt_attrib {
|
|
|
|
u16 pkt_len;
|
|
|
|
u8 physt;
|
|
|
|
u8 drvinfo_sz;
|
|
|
|
u8 shift_sz;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 hdrlen; /* the WLAN Header Len */
|
|
|
|
u8 to_fr_ds;
|
|
|
|
u8 amsdu;
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 qos;
|
|
|
|
u8 priority;
|
|
|
|
u8 pw_save;
|
|
|
|
u8 mdata;
|
|
|
|
u16 seq_num;
|
|
|
|
u8 frag_num;
|
|
|
|
u8 mfrag;
|
|
|
|
u8 order;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 privacy; /* in frame_ctrl field */
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 bdecrypted;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 encrypt; /* when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith */
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 iv_len;
|
|
|
|
u8 icv_len;
|
|
|
|
u8 crc_err;
|
|
|
|
u8 icv_err;
|
|
|
|
|
|
|
|
u16 eth_type;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 dst[ETH_ALEN];
|
|
|
|
u8 src[ETH_ALEN];
|
|
|
|
u8 ta[ETH_ALEN];
|
|
|
|
u8 ra[ETH_ALEN];
|
|
|
|
u8 bssid[ETH_ALEN];
|
|
|
|
#ifdef CONFIG_RTW_MESH
|
|
|
|
u8 msa[ETH_ALEN]; /* mesh sa */
|
|
|
|
u8 mda[ETH_ALEN]; /* mesh da */
|
|
|
|
u8 mesh_ctrl_present;
|
|
|
|
u8 mesh_ctrl_len; /* length of mesh control field */
|
|
|
|
#endif
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 ack_policy;
|
2019-11-09 10:12:08 +00:00
|
|
|
|
|
|
|
u8 key_index;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
u8 data_rate;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 ch; /* RX channel */
|
2017-05-11 18:47:23 +00:00
|
|
|
u8 bw;
|
|
|
|
u8 stbc;
|
|
|
|
u8 ldpc;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 sgi;
|
|
|
|
u8 pkt_rpt_type;
|
2017-05-11 18:47:23 +00:00
|
|
|
u32 tsfl;
|
2019-11-09 10:12:08 +00:00
|
|
|
u32 MacIDValidEntry[2]; /* 64 bits present 64 entry. */
|
|
|
|
u8 ppdu_cnt;
|
|
|
|
u32 free_cnt; /* free run counter */
|
|
|
|
struct phydm_phyinfo_struct phy_info;
|
|
|
|
|
|
|
|
#ifdef CONFIG_TCP_CSUM_OFFLOAD_RX
|
|
|
|
/* checksum offload realted varaiables */
|
|
|
|
u8 csum_valid; /* Checksum valid, 0: not check, 1: checked */
|
|
|
|
u8 csum_err; /* Checksum Error occurs */
|
|
|
|
#endif /* CONFIG_TCP_CSUM_OFFLOAD_RX */
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_RTW_MESH
|
|
|
|
#define RATTRIB_GET_MCTRL_LEN(rattrib) ((rattrib)->mesh_ctrl_len)
|
|
|
|
#else
|
|
|
|
#define RATTRIB_GET_MCTRL_LEN(rattrib) 0
|
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* These definition is used for Rx packet reordering. */
|
|
|
|
#define SN_LESS(a, b) (((a-b) & 0x800) != 0)
|
2015-08-18 19:03:09 +00:00
|
|
|
#define SN_EQUAL(a, b) (a == b)
|
2019-11-09 10:12:08 +00:00
|
|
|
/* #define REORDER_WIN_SIZE 128 */
|
|
|
|
/* #define REORDER_ENTRY_NUM 128 */
|
|
|
|
#define REORDER_WAIT_TIME (50) /* (ms) */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if defined(CONFIG_PLATFORM_RTK390X) && defined(CONFIG_USB_HCI)
|
|
|
|
#define RECVBUFF_ALIGN_SZ 32
|
2017-05-11 18:35:20 +00:00
|
|
|
#else
|
2019-11-09 10:12:08 +00:00
|
|
|
#define RECVBUFF_ALIGN_SZ 8
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_TRX_BD_ARCH
|
|
|
|
#define RX_WIFI_INFO_SIZE 24
|
|
|
|
#elif (defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B)) && defined(CONFIG_PCI_HCI)
|
|
|
|
#define RXBD_SIZE sizeof(struct recv_stat)
|
2017-05-11 18:35:20 +00:00
|
|
|
#endif
|
2019-11-09 10:12:08 +00:00
|
|
|
|
|
|
|
#define RXDESC_SIZE 24
|
2015-08-18 19:03:09 +00:00
|
|
|
#define RXDESC_OFFSET RXDESC_SIZE
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_TRX_BD_ARCH
|
|
|
|
struct rx_buf_desc {
|
|
|
|
/* RX has exactly one segment */
|
|
|
|
#ifdef CONFIG_64BIT_DMA
|
|
|
|
unsigned int dword[4];
|
|
|
|
#else
|
|
|
|
unsigned int dword[2];
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct recv_stat {
|
|
|
|
unsigned int rxdw[8];
|
|
|
|
};
|
|
|
|
#else
|
|
|
|
struct recv_stat {
|
2015-08-18 19:03:09 +00:00
|
|
|
unsigned int rxdw0;
|
|
|
|
|
|
|
|
unsigned int rxdw1;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if !((defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)) && defined(CONFIG_PCI_HCI)) /* exclude 8192ee, 8814ae, 8822be, 8821ce */
|
2015-08-18 19:03:09 +00:00
|
|
|
unsigned int rxdw2;
|
|
|
|
|
|
|
|
unsigned int rxdw3;
|
2017-05-11 18:35:20 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2017-05-11 18:35:20 +00:00
|
|
|
#ifndef BUF_DESC_ARCH
|
2015-08-18 19:03:09 +00:00
|
|
|
unsigned int rxdw4;
|
|
|
|
|
|
|
|
unsigned int rxdw5;
|
|
|
|
|
|
|
|
#ifdef CONFIG_PCI_HCI
|
|
|
|
unsigned int rxdw6;
|
|
|
|
|
|
|
|
unsigned int rxdw7;
|
|
|
|
#endif
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* if BUF_DESC_ARCH is defined, rx_buf_desc occupy 4 double words */
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#define EOR BIT(30)
|
|
|
|
|
|
|
|
#ifdef CONFIG_PCI_HCI
|
2019-11-09 10:12:08 +00:00
|
|
|
#define PCI_MAX_RX_QUEUE 1/* MSDU packet queue, Rx Command Queue */
|
2015-08-18 19:03:09 +00:00
|
|
|
#define PCI_MAX_RX_COUNT 128
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_TRX_BD_ARCH
|
|
|
|
#define RX_BD_NUM PCI_MAX_RX_COUNT /* alias */
|
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
struct rtw_rx_ring {
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_TRX_BD_ARCH
|
|
|
|
struct rx_buf_desc *buf_desc;
|
|
|
|
#else
|
2015-08-18 19:03:09 +00:00
|
|
|
struct recv_stat *desc;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
dma_addr_t dma;
|
|
|
|
unsigned int idx;
|
|
|
|
struct sk_buff *rx_buf[PCI_MAX_RX_COUNT];
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
accesser of recv_priv: rtw_recv_entry(dispatch / passive level); recv_thread(passive) ; returnpkt(dispatch)
|
|
|
|
; halt(passive) ;
|
|
|
|
|
|
|
|
using enter_critical section to protect
|
|
|
|
*/
|
2019-11-09 10:12:08 +00:00
|
|
|
|
|
|
|
#ifndef DBG_RX_BH_TRACKING
|
|
|
|
#define DBG_RX_BH_TRACKING 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct recv_priv {
|
2015-08-18 19:03:09 +00:00
|
|
|
_lock lock;
|
|
|
|
|
|
|
|
#ifdef CONFIG_RECV_THREAD_MODE
|
|
|
|
_sema recv_sema;
|
2019-11-09 10:12:08 +00:00
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
#endif
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* _queue blk_strms[MAX_RX_NUMBLKS]; */ /* keeping the block ack frame until return ack */
|
2015-08-18 19:03:09 +00:00
|
|
|
_queue free_recv_queue;
|
|
|
|
_queue recv_pending_queue;
|
|
|
|
_queue uc_swdec_pending_queue;
|
|
|
|
|
|
|
|
|
|
|
|
u8 *pallocated_frame_buf;
|
|
|
|
u8 *precv_frame_buf;
|
|
|
|
|
|
|
|
uint free_recvframe_cnt;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if DBG_RX_BH_TRACKING
|
|
|
|
u32 rx_bh_stage;
|
|
|
|
u32 rx_bh_buf_dq_cnt;
|
|
|
|
void *rx_bh_lbuf;
|
|
|
|
void *rx_bh_cbuf;
|
|
|
|
void *rx_bh_cbuf_data;
|
|
|
|
u32 rx_bh_cbuf_dlen;
|
|
|
|
u32 rx_bh_cbuf_pos;
|
|
|
|
void *rx_bh_cframe;
|
|
|
|
#endif
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
_adapter *adapter;
|
|
|
|
|
|
|
|
#ifdef PLATFORM_WINDOWS
|
|
|
|
_nic_hdl RxPktPoolHdl;
|
|
|
|
_nic_hdl RxBufPoolHdl;
|
|
|
|
|
|
|
|
#ifdef PLATFORM_OS_XP
|
|
|
|
PMDL pbytecnt_mdl;
|
|
|
|
#endif
|
2019-11-09 10:12:08 +00:00
|
|
|
uint counter; /* record the number that up-layer will return to drv; only when counter==0 can we release recv_priv */
|
|
|
|
NDIS_EVENT recv_resource_evt ;
|
2015-08-18 19:03:09 +00:00
|
|
|
#endif
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
|
|
|
|
u32 is_any_non_be_pkts;
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
u64 rx_bytes;
|
|
|
|
u64 rx_pkts;
|
|
|
|
u64 rx_drop;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
u64 dbg_rx_drop_count;
|
|
|
|
u64 dbg_rx_ampdu_drop_count;
|
|
|
|
u64 dbg_rx_ampdu_forced_indicate_count;
|
|
|
|
u64 dbg_rx_ampdu_loss_count;
|
|
|
|
u64 dbg_rx_dup_mgt_frame_drop_count;
|
|
|
|
u64 dbg_rx_ampdu_window_shift_cnt;
|
|
|
|
u64 dbg_rx_conflic_mac_addr_cnt;
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
uint rx_icv_err;
|
|
|
|
uint rx_largepacket_crcerr;
|
|
|
|
uint rx_smallpacket_crcerr;
|
|
|
|
uint rx_middlepacket_crcerr;
|
|
|
|
|
|
|
|
#ifdef CONFIG_USB_HCI
|
2019-11-09 10:12:08 +00:00
|
|
|
/* u8 *pallocated_urb_buf; */
|
2015-08-18 19:03:09 +00:00
|
|
|
_sema allrxreturnevt;
|
|
|
|
uint ff_hwaddr;
|
2021-08-02 19:27:18 +00:00
|
|
|
atomic_t rx_pending_cnt;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
|
|
|
|
#ifdef PLATFORM_LINUX
|
|
|
|
PURB int_in_urb;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
u8 *int_in_buf;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* CONFIG_USB_INTERRUPT_IN_PIPE */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
#if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
|
|
|
|
#ifdef PLATFORM_FREEBSD
|
|
|
|
struct task irq_prepare_beacon_tasklet;
|
|
|
|
struct task recv_tasklet;
|
2019-11-09 10:12:08 +00:00
|
|
|
#else /* PLATFORM_FREEBSD */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct tasklet_struct irq_prepare_beacon_tasklet;
|
|
|
|
struct tasklet_struct recv_tasklet;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* PLATFORM_FREEBSD */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct sk_buff_head free_recv_skb_queue;
|
|
|
|
struct sk_buff_head rx_skb_queue;
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_RTW_NAPI
|
|
|
|
struct sk_buff_head rx_napi_skb_queue;
|
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
#ifdef CONFIG_RX_INDICATE_QUEUE
|
|
|
|
struct task rx_indicate_tasklet;
|
|
|
|
struct ifqueue rx_indicate_queue;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* CONFIG_RX_INDICATE_QUEUE */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
u8 *pallocated_recv_buf;
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 *precv_buf; /* 4 alignment */
|
2015-08-18 19:03:09 +00:00
|
|
|
_queue free_recv_buf_queue;
|
|
|
|
u32 free_recv_buf_queue_cnt;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_USB_HCI)
|
2015-08-18 19:03:09 +00:00
|
|
|
_queue recv_buf_pending_queue;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_PCI_HCI
|
2019-11-09 10:12:08 +00:00
|
|
|
/* Rx */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct rtw_rx_ring rx_ring[PCI_MAX_RX_QUEUE];
|
2019-11-09 10:12:08 +00:00
|
|
|
int rxringcount; /* size should be PCI_MAX_RX_QUEUE */
|
2015-08-18 19:03:09 +00:00
|
|
|
u16 rxbuffersize;
|
|
|
|
#endif
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* For display the phy informatiom */
|
|
|
|
u8 is_signal_dbg; /* for debug */
|
|
|
|
u8 signal_strength_dbg; /* for debug */
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
u8 signal_strength;
|
|
|
|
u8 signal_qual;
|
2019-11-09 10:12:08 +00:00
|
|
|
s8 rssi; /* translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct rx_raw_rssi raw_rssi_info;
|
2019-11-09 10:12:08 +00:00
|
|
|
/* s8 rxpwdb; */
|
|
|
|
/* int RxSNRdB[2]; */
|
|
|
|
/* s8 RxRssi[2]; */
|
|
|
|
/* int FalseAlmCnt_all; */
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
|
|
|
_timer signal_stat_timer;
|
|
|
|
u32 signal_stat_sampling_interval;
|
2019-11-09 10:12:08 +00:00
|
|
|
/* u32 signal_stat_converging_constant; */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct signal_stat signal_qual_data;
|
|
|
|
struct signal_stat signal_strength_data;
|
2019-11-09 10:12:08 +00:00
|
|
|
#else /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct smooth_rssi_data signal_qual_data;
|
|
|
|
struct smooth_rssi_data signal_strength_data;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
|
|
|
u16 sink_udpport, pre_rtp_rxseq, cur_rtp_rxseq;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2017-05-11 18:47:23 +00:00
|
|
|
BOOLEAN store_law_data_flag;
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#define RX_BH_STG_UNKNOWN 0
|
|
|
|
#define RX_BH_STG_HDL_ENTER 1
|
|
|
|
#define RX_BH_STG_HDL_EXIT 2
|
|
|
|
#define RX_BH_STG_NEW_BUF 3
|
|
|
|
#define RX_BH_STG_NEW_FRAME 4
|
|
|
|
#define RX_BH_STG_NORMAL_RX 5
|
|
|
|
#define RX_BH_STG_NORMAL_RX_END 6
|
|
|
|
#define RX_BH_STG_C2H 7
|
|
|
|
#define RX_BH_STG_C2H_END 8
|
|
|
|
|
|
|
|
#if DBG_RX_BH_TRACKING
|
|
|
|
void rx_bh_tk_set_stage(struct recv_priv *recv, u32 s);
|
|
|
|
void rx_bh_tk_set_buf(struct recv_priv *recv, void *buf, void *data, u32 dlen);
|
|
|
|
void rx_bh_tk_set_buf_pos(struct recv_priv *recv, void *pos);
|
|
|
|
void rx_bh_tk_set_frame(struct recv_priv *recv, void *frame);
|
|
|
|
void dump_rx_bh_tk(void *sel, struct recv_priv *recv);
|
|
|
|
#else
|
|
|
|
#define rx_bh_tk_set_stage(recv, s) do {} while (0)
|
|
|
|
#define rx_bh_tk_set_buf(recv, buf, data, dlen) do {} while (0)
|
|
|
|
#define rx_bh_tk_set_buf_pos(recv, pos) do {} while (0)
|
|
|
|
#define rx_bh_tk_set_frame(recv, frame) do {} while (0)
|
|
|
|
#define dump_rx_bh_tk(sel, recv) do {} while (0)
|
|
|
|
#endif
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
|
|
|
#define rtw_set_signal_stat_timer(recvpriv) _set_timer(&(recvpriv)->signal_stat_timer, (recvpriv)->signal_stat_sampling_interval)
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
struct sta_recv_priv {
|
|
|
|
|
|
|
|
_lock lock;
|
|
|
|
sint option;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* _queue blk_strms[MAX_RX_NUMBLKS]; */
|
|
|
|
_queue defrag_q; /* keeping the fragment frame until defrag */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
struct stainfo_rxcache rxcache;
|
2019-11-09 10:12:08 +00:00
|
|
|
u16 bmc_tid_rxseq[16];
|
|
|
|
u16 nonqos_rxseq;
|
|
|
|
u16 nonqos_bmc_rxseq;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* uint sta_rx_bytes; */
|
|
|
|
/* uint sta_rx_pkts; */
|
|
|
|
/* uint sta_rx_fail; */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
struct recv_buf {
|
2015-08-18 19:03:09 +00:00
|
|
|
_list list;
|
|
|
|
|
|
|
|
_lock recvbuf_lock;
|
|
|
|
|
|
|
|
u32 ref_cnt;
|
|
|
|
|
|
|
|
PADAPTER adapter;
|
|
|
|
|
|
|
|
u8 *pbuf;
|
|
|
|
u8 *pallocated_buf;
|
|
|
|
|
|
|
|
u32 len;
|
|
|
|
u8 *phead;
|
|
|
|
u8 *pdata;
|
|
|
|
u8 *ptail;
|
|
|
|
u8 *pend;
|
|
|
|
|
|
|
|
#ifdef CONFIG_USB_HCI
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if defined(PLATFORM_OS_XP) || defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
|
2015-08-18 19:03:09 +00:00
|
|
|
PURB purb;
|
|
|
|
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
|
|
|
|
u32 alloc_sz;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef PLATFORM_OS_XP
|
2015-08-18 19:03:09 +00:00
|
|
|
PIRP pirp;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef PLATFORM_OS_CE
|
2015-08-18 19:03:09 +00:00
|
|
|
USB_TRANSFER usb_transfer_read_port;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
u8 irp_pending;
|
|
|
|
int transfer_len;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if defined(PLATFORM_LINUX)
|
|
|
|
_pkt *pskb;
|
|
|
|
#elif defined(PLATFORM_FREEBSD) /* skb solution */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct sk_buff *pskb;
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
head ----->
|
|
|
|
|
|
|
|
data ----->
|
|
|
|
|
|
|
|
payload
|
|
|
|
|
|
|
|
tail ----->
|
|
|
|
|
|
|
|
|
|
|
|
end ----->
|
|
|
|
|
|
|
|
len = (unsigned int )(tail - data);
|
|
|
|
|
|
|
|
*/
|
2019-11-09 10:12:08 +00:00
|
|
|
struct recv_frame_hdr {
|
2015-08-18 19:03:09 +00:00
|
|
|
_list list;
|
2019-11-09 10:12:08 +00:00
|
|
|
_pkt *pkt;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
_adapter *adapter;
|
|
|
|
|
|
|
|
u8 fragcnt;
|
|
|
|
|
|
|
|
int frame_tag;
|
|
|
|
|
|
|
|
struct rx_pkt_attrib attrib;
|
|
|
|
|
|
|
|
uint len;
|
|
|
|
u8 *rx_head;
|
|
|
|
u8 *rx_data;
|
|
|
|
u8 *rx_tail;
|
|
|
|
u8 *rx_end;
|
|
|
|
|
|
|
|
void *precvbuf;
|
|
|
|
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct sta_info *psta;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* for A-MPDU Rx reordering buffer control */
|
2015-08-18 19:03:09 +00:00
|
|
|
struct recv_reorder_ctrl *preorder_ctrl;
|
|
|
|
|
|
|
|
#ifdef CONFIG_WAPI_SUPPORT
|
|
|
|
u8 UserPriority;
|
|
|
|
u8 WapiTempPN[16];
|
|
|
|
u8 WapiSrcAddr[6];
|
|
|
|
u8 bWapiCheckPNInDecrypt;
|
|
|
|
u8 bIsWaiPacket;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
union recv_frame {
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
union {
|
2015-08-18 19:03:09 +00:00
|
|
|
_list list;
|
|
|
|
struct recv_frame_hdr hdr;
|
2019-11-09 10:12:08 +00:00
|
|
|
uint mem[RECVFRAME_HDR_ALIGN >> 2];
|
|
|
|
} u;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* uint mem[MAX_RXSZ>>2]; */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-05-11 18:47:23 +00:00
|
|
|
bool rtw_rframe_del_wfd_ie(union recv_frame *rframe, u8 ies_offset);
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
typedef enum _RX_PACKET_TYPE {
|
|
|
|
NORMAL_RX,/* Normal rx packet */
|
|
|
|
TX_REPORT1,/* CCX */
|
|
|
|
TX_REPORT2,/* TX RPT */
|
|
|
|
HIS_REPORT,/* USB HISR RPT */
|
2015-08-18 19:03:09 +00:00
|
|
|
C2H_PACKET
|
2019-11-09 10:12:08 +00:00
|
|
|
} RX_PACKET_TYPE, *PRX_PACKET_TYPE;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
extern union recv_frame *_rtw_alloc_recvframe(_queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */
|
|
|
|
extern union recv_frame *rtw_alloc_recvframe(_queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */
|
|
|
|
extern void rtw_init_recvframe(union recv_frame *precvframe , struct recv_priv *precvpriv);
|
2015-08-18 19:03:09 +00:00
|
|
|
extern int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue);
|
|
|
|
|
|
|
|
#define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
|
|
|
|
extern int _rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue);
|
|
|
|
extern int rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue);
|
|
|
|
|
|
|
|
extern void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue);
|
|
|
|
u32 rtw_free_uc_swdec_pending_queue(_adapter *adapter);
|
|
|
|
|
|
|
|
sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, _queue *queue);
|
|
|
|
sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue);
|
2019-11-09 10:12:08 +00:00
|
|
|
struct recv_buf *rtw_dequeue_recvbuf(_queue *queue);
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#if defined(CONFIG_80211N_HT) && defined(CONFIG_RECV_REORDERING_CTRL)
|
2015-08-18 19:03:09 +00:00
|
|
|
void rtw_reordering_ctrl_timeout_handler(void *pcontext);
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2017-05-11 18:47:23 +00:00
|
|
|
void rx_query_phy_status(union recv_frame *rframe, u8 *phy_stat);
|
|
|
|
int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index);
|
|
|
|
void rtw_reset_continual_no_rx_packet(struct sta_info *sta, int tid_index);
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#ifdef CONFIG_RECV_THREAD_MODE
|
|
|
|
thread_return rtw_recv_thread(thread_context context);
|
|
|
|
#endif
|
|
|
|
|
2015-08-18 19:03:09 +00:00
|
|
|
__inline static u8 *get_rxmem(union recv_frame *precvframe)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
/* always return rx_head... */
|
|
|
|
if (precvframe == NULL)
|
2015-08-18 19:03:09 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return precvframe->u.hdr.rx_head;
|
|
|
|
}
|
|
|
|
|
|
|
|
__inline static u8 *get_rx_status(union recv_frame *precvframe)
|
|
|
|
{
|
|
|
|
|
|
|
|
return get_rxmem(precvframe);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
__inline static u8 *get_recvframe_data(union recv_frame *precvframe)
|
|
|
|
{
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* alwasy return rx_data */
|
|
|
|
if (precvframe == NULL)
|
2015-08-18 19:03:09 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return precvframe->u.hdr.rx_data;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
__inline static u8 *recvframe_push(union recv_frame *precvframe, sint sz)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
/* append data before rx_data */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
/* add data to the start of recv_frame
|
2019-11-09 10:12:08 +00:00
|
|
|
*
|
|
|
|
* This function extends the used data area of the recv_frame at the buffer
|
|
|
|
* start. rx_data must be still larger than rx_head, after pushing.
|
|
|
|
*/
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe == NULL)
|
2015-08-18 19:03:09 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
precvframe->u.hdr.rx_data -= sz ;
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head) {
|
2015-08-18 19:03:09 +00:00
|
|
|
precvframe->u.hdr.rx_data += sz ;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
precvframe->u.hdr.len += sz;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
return precvframe->u.hdr.rx_data;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
__inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
/* rx_data += sz; move rx_data sz bytes hereafter */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe == NULL)
|
2015-08-18 19:03:09 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
precvframe->u.hdr.rx_data += sz;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
|
2015-08-18 19:03:09 +00:00
|
|
|
precvframe->u.hdr.rx_data -= sz;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
precvframe->u.hdr.len -= sz;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
return precvframe->u.hdr.rx_data;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
__inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
/* rx_tai += sz; move rx_tail sz bytes hereafter */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* used for append sz bytes from ptr to rx_tail, update rx_tail and return the updated rx_tail to the caller */
|
|
|
|
/* after putting, rx_tail must be still larger than rx_end. */
|
|
|
|
unsigned char *prev_rx_tail;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* RTW_INFO("recvframe_put: len=%d\n", sz); */
|
2017-05-11 18:47:23 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe == NULL)
|
2015-08-18 19:03:09 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
prev_rx_tail = precvframe->u.hdr.rx_tail;
|
|
|
|
|
|
|
|
precvframe->u.hdr.rx_tail += sz;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) {
|
2015-08-18 19:03:09 +00:00
|
|
|
precvframe->u.hdr.rx_tail -= sz;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
precvframe->u.hdr.len += sz;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
return precvframe->u.hdr.rx_tail;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
/* rmv data from rx_tail (by yitsen) */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
/* used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller */
|
|
|
|
/* after pulling, rx_end must be still larger than rx_data. */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe == NULL)
|
2015-08-18 19:03:09 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
precvframe->u.hdr.rx_tail -= sz;
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {
|
2015-08-18 19:03:09 +00:00
|
|
|
precvframe->u.hdr.rx_tail += sz;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
precvframe->u.hdr.len -= sz;
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
return precvframe->u.hdr.rx_tail;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
__inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
/* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */
|
|
|
|
/* from any given member of recv_frame. */
|
|
|
|
/* rxmem indicates the any member/address in recv_frame */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
return (union recv_frame *)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
|
2015-08-18 19:03:09 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
__inline static sint get_recvframe_len(union recv_frame *precvframe)
|
|
|
|
{
|
|
|
|
return precvframe->u.hdr.len;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
__inline static s32 translate_percentage_to_dbm(u32 SignalStrengthIndex)
|
|
|
|
{
|
2019-11-09 10:12:08 +00:00
|
|
|
s32 SignalPower; /* in dBm. */
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2017-05-11 18:47:23 +00:00
|
|
|
/* Translate to dBm (x=y-100) */
|
|
|
|
SignalPower = SignalStrengthIndex - 100;
|
2015-08-18 19:03:09 +00:00
|
|
|
return SignalPower;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct sta_info;
|
|
|
|
|
|
|
|
extern void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);
|
|
|
|
|
|
|
|
extern void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame);
|
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
u8 adapter_allow_bmc_data_rx(_adapter *adapter);
|
|
|
|
s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status);
|
|
|
|
void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_info *sta);
|
2015-08-18 19:03:09 +00:00
|
|
|
|
2019-11-09 10:12:08 +00:00
|
|
|
#endif
|