1 /******************************************************************************
3 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
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.
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
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 * Modifications for inclusion into the Linux staging tree are
19 * Copyright(c) 2010 Larry Finger. All rights reserved.
21 * Contact information:
22 * WLAN FAE <wlanfae@realtek.com>
23 * Larry Finger <Larry.Finger@lwfinger.net>
25 ******************************************************************************/
26 #ifndef _RTL8712_RECV_H_
27 #define _RTL8712_RECV_H_
29 #include "osdep_service.h"
30 #include "drv_types.h"
32 /* Realtek's v2.6.6 reduced this to 4. However, under heavy network and CPU
33 * loads, even 8 receive buffers might not be enough; cutting it to 4 seemed
36 #define NR_RECVBUFF (8)
38 #define NR_PREALLOC_RECV_SKB (8)
39 #define RXDESC_SIZE 24
40 #define RXDESC_OFFSET RXDESC_SIZE
41 #define RECV_BLK_SZ 512
42 #define RECV_BLK_CNT 16
43 #define RECV_BLK_TH RECV_BLK_CNT
44 #define MAX_RECVBUF_SZ (30720) /* 30K */
45 #define RECVBUFF_ALIGN_SZ 512
46 #define RSVD_ROOM_SZ (0)
47 /*These definition is used for Rx packet reordering.*/
48 #define SN_LESS(a, b) (((a-b) & 0x800) != 0)
49 #define SN_EQUAL(a, b) (a == b)
50 #define REORDER_WAIT_TIME 30 /* (ms)*/
61 struct phy_cck_rx_status
{
62 /* For CCK rate descriptor. This is a unsigned 8:1 variable.
63 * LSB bit present 0.5. And MSB 7 bts present a signed value.
64 * Range from -64~+63.5. */
80 #define PHY_STAT_GAIN_TRSW_SHT 0
81 #define PHY_STAT_PWDB_ALL_SHT 4
82 #define PHY_STAT_CFOSHO_SHT 5
83 #define PHY_STAT_CCK_AGC_RPT_SHT 5
84 #define PHY_STAT_CFOTAIL_SHT 9
85 #define PHY_STAT_RXEVM_SHT 13
86 #define PHY_STAT_RXSNR_SHT 15
87 #define PHY_STAT_PDSNR_SHT 19
88 #define PHY_STAT_CSI_CURRENT_SHT 21
89 #define PHY_STAT_CSI_TARGET_SHT 23
90 #define PHY_STAT_SIGEVM_SHT 25
91 #define PHY_STAT_MAX_EX_PWR_SHT 26
94 struct recv_stat recv_stat
;
95 unsigned int value
[RXDESC_SIZE
>>2];
100 struct list_head list
;
101 spinlock_t recvbuf_lock
;
103 struct _adapter
*adapter
;
124 len = (unsigned int )(tail - data);
126 struct recv_frame_hdr
{
127 struct list_head list
;
130 struct _adapter
*adapter
;
132 struct rx_pkt_attrib attrib
;
139 struct sta_info
*psta
;
140 /*for A-MPDU Rx reordering buffer control*/
141 struct recv_reorder_ctrl
*preorder_ctrl
;
146 struct list_head list
;
147 struct recv_frame_hdr hdr
;
151 int r8712_init_recvbuf(struct _adapter
*padapter
, struct recv_buf
*precvbuf
);
152 void r8712_rxcmd_event_hdl(struct _adapter
*padapter
, void *prxcmdbuf
);
153 s32
r8712_signal_scale_mapping(s32 cur_sig
);
154 void r8712_reordering_ctrl_timeout_handler(void *pcontext
);