Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtl8712_recv.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
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  * 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
17  *
18  * Modifications for inclusion into the Linux staging tree are
19  * Copyright(c) 2010 Larry Finger. All rights reserved.
20  *
21  * Contact information:
22  * WLAN FAE <[email protected]>
23  * Larry Finger <[email protected]>
24  *
25  ******************************************************************************/
26 #ifndef _RTL8712_RECV_H_
27 #define _RTL8712_RECV_H_
28 
29 #include "osdep_service.h"
30 #include "drv_types.h"
31 
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
34  * unwise.
35  */
36 #define NR_RECVBUFF (8)
37 
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 9100
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)*/
51 
52 struct recv_stat {
53  unsigned int rxdw0;
54  unsigned int rxdw1;
55  unsigned int rxdw2;
56  unsigned int rxdw3;
57  unsigned int rxdw4;
58  unsigned int rxdw5;
59 };
60 
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. */
68 };
69 
70 struct phy_stat {
71  unsigned int phydw0;
72  unsigned int phydw1;
73  unsigned int phydw2;
74  unsigned int phydw3;
75  unsigned int phydw4;
76  unsigned int phydw5;
77  unsigned int phydw6;
78  unsigned int phydw7;
79 };
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
92 
93 union recvstat {
95  unsigned int value[RXDESC_SIZE>>2];
96 };
97 
98 
99 struct recv_buf {
100  struct list_head list;
103  struct _adapter *adapter;
104  struct urb *purb;
116 };
117 
118 /*
119  head ----->
120  data ----->
121  payload
122  tail ----->
123  end ----->
124  len = (unsigned int )(tail - data);
125 */
127  struct list_head list;
130  struct _adapter *adapter;
138  void *precvbuf;
139  struct sta_info *psta;
140  /*for A-MPDU Rx reordering buffer control*/
142 };
143 
144 union recv_frame {
145  union {
146  struct list_head list;
148  } u;
149 };
150 
151 int r8712_init_recvbuf(struct _adapter *padapter, struct recv_buf *precvbuf);
152 void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf);
154 void r8712_reordering_ctrl_timeout_handler(void *pcontext);
155 
156 #endif
157