0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _RTL8712_RECV_H_
0015 #define _RTL8712_RECV_H_
0016
0017 #include "osdep_service.h"
0018 #include "drv_types.h"
0019
0020
0021
0022
0023
0024 #define NR_RECVBUFF (8)
0025
0026 #define NR_PREALLOC_RECV_SKB (8)
0027 #define RXDESC_SIZE 24
0028 #define RXDESC_OFFSET RXDESC_SIZE
0029 #define RECV_BLK_SZ 512
0030 #define RECV_BLK_CNT 16
0031 #define RECV_BLK_TH RECV_BLK_CNT
0032 #define MAX_RECVBUF_SZ 9100
0033 #define RECVBUFF_ALIGN_SZ 512
0034 #define RSVD_ROOM_SZ (0)
0035
0036 #define SN_LESS(a, b) (((a-b) & 0x800) != 0)
0037 #define SN_EQUAL(a, b) (a == b)
0038 #define REORDER_WAIT_TIME 30
0039
0040 struct recv_stat {
0041 __le32 rxdw0;
0042 __le32 rxdw1;
0043 __le32 rxdw2;
0044 __le32 rxdw3;
0045 __le32 rxdw4;
0046 __le32 rxdw5;
0047 };
0048
0049 struct phy_cck_rx_status {
0050
0051
0052
0053
0054 u8 adc_pwdb_X[4];
0055 u8 sq_rpt;
0056 u8 cck_agc_rpt;
0057 };
0058
0059 struct phy_stat {
0060 __le32 phydw0;
0061 __le32 phydw1;
0062 __le32 phydw2;
0063 __le32 phydw3;
0064 __le32 phydw4;
0065 __le32 phydw5;
0066 __le32 phydw6;
0067 __le32 phydw7;
0068 };
0069
0070 #define PHY_STAT_GAIN_TRSW_SHT 0
0071 #define PHY_STAT_PWDB_ALL_SHT 4
0072 #define PHY_STAT_CFOSHO_SHT 5
0073 #define PHY_STAT_CCK_AGC_RPT_SHT 5
0074 #define PHY_STAT_CFOTAIL_SHT 9
0075 #define PHY_STAT_RXEVM_SHT 13
0076 #define PHY_STAT_RXSNR_SHT 15
0077 #define PHY_STAT_PDSNR_SHT 19
0078 #define PHY_STAT_CSI_CURRENT_SHT 21
0079 #define PHY_STAT_CSI_TARGET_SHT 23
0080 #define PHY_STAT_SIGEVM_SHT 25
0081 #define PHY_STAT_MAX_EX_PWR_SHT 26
0082
0083 union recvstat {
0084 struct recv_stat recv_stat;
0085 unsigned int value[RXDESC_SIZE>>2];
0086 };
0087
0088 struct recv_buf {
0089 struct list_head list;
0090 spinlock_t recvbuf_lock;
0091 u32 ref_cnt;
0092 struct _adapter *adapter;
0093 struct urb *purb;
0094 _pkt *pskb;
0095 u8 irp_pending;
0096 u32 transfer_len;
0097 uint len;
0098 u8 *phead;
0099 u8 *pdata;
0100 u8 *ptail;
0101 u8 *pend;
0102 u8 *pbuf;
0103 u8 *pallocated_buf;
0104 };
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114 struct recv_frame_hdr {
0115 struct list_head list;
0116 _pkt *pkt;
0117 _pkt *pkt_newalloc;
0118 struct _adapter *adapter;
0119 u8 fragcnt;
0120 struct rx_pkt_attrib attrib;
0121 uint len;
0122 u8 *rx_head;
0123 u8 *rx_data;
0124 u8 *rx_tail;
0125 u8 *rx_end;
0126 void *precvbuf;
0127 struct sta_info *psta;
0128
0129 struct recv_reorder_ctrl *preorder_ctrl;
0130 };
0131
0132 union recv_frame {
0133 union {
0134 struct list_head list;
0135 struct recv_frame_hdr hdr;
0136 } u;
0137 };
0138
0139 void r8712_init_recvbuf(struct _adapter *padapter, struct recv_buf *precvbuf);
0140 void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf);
0141 s32 r8712_signal_scale_mapping(s32 cur_sig);
0142 void r8712_reordering_ctrl_timeout_handler(void *pcontext);
0143
0144 #endif
0145