This source file includes following definitions.
- translate_percentage_to_dbm
1
2
3
4
5
6
7 #ifndef _RTW_RECV_H_
8 #define _RTW_RECV_H_
9
10 #include <osdep_service.h>
11 #include <drv_types.h>
12
13
14 #define NR_RECVFRAME 256
15
16 #define RXFRAME_ALIGN 8
17 #define RXFRAME_ALIGN_SZ (1<<RXFRAME_ALIGN)
18
19 #define MAX_RXFRAME_CNT 512
20 #define MAX_RX_NUMBLKS (32)
21 #define RECVFRAME_HDR_ALIGN 128
22
23 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
24
25 #define MAX_SUBFRAME_COUNT 64
26
27
28 struct recv_reorder_ctrl {
29 struct adapter *padapter;
30 bool enable;
31 u16 indicate_seq;
32 u16 wend_b;
33 u8 wsize_b;
34 struct __queue pending_recvframe_queue;
35 struct timer_list reordering_ctrl_timer;
36 };
37
38 struct stainfo_rxcache {
39 u16 tid_rxseq[16];
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 };
59
60 struct signal_stat {
61 u8 update_req;
62 u8 avg_val;
63 u32 total_num;
64 u32 total_val;
65 };
66 #define MAX_PATH_NUM_92CS 3
67 struct phy_info {
68 u8 RxPWDBAll;
69 u8 SignalQuality;
70 u8 RxMIMOSignalQuality[MAX_PATH_NUM_92CS];
71 u8 RxMIMOSignalStrength[MAX_PATH_NUM_92CS];
72 s8 RxPower;
73
74
75
76 s8 recvpower;
77 u8 BTRxRSSIPercentage;
78 u8 SignalStrength;
79 u8 RxPwr[MAX_PATH_NUM_92CS];
80 u8 RxSNR[MAX_PATH_NUM_92CS];
81 };
82
83 struct rx_pkt_attrib {
84 u16 pkt_len;
85 u8 physt;
86 u8 drvinfo_sz;
87 u8 shift_sz;
88 u8 hdrlen;
89 u8 to_fr_ds;
90 u8 amsdu;
91 u8 qos;
92 u8 priority;
93 u8 pw_save;
94 u8 mdata;
95 u16 seq_num;
96 u8 frag_num;
97 u8 mfrag;
98 u8 order;
99 u8 privacy;
100 u8 bdecrypted;
101 u8 encrypt;
102
103
104 u8 iv_len;
105 u8 icv_len;
106 u8 crc_err;
107 u8 icv_err;
108
109 u16 eth_type;
110
111 u8 dst[ETH_ALEN];
112 u8 src[ETH_ALEN];
113 u8 ta[ETH_ALEN];
114 u8 ra[ETH_ALEN];
115 u8 bssid[ETH_ALEN];
116
117 u8 ack_policy;
118
119 u8 key_index;
120
121 u8 mcs_rate;
122 u8 rxht;
123 u8 sgi;
124 u8 pkt_rpt_type;
125 u32 MacIDValidEntry[2];
126
127 struct phy_info phy_info;
128 };
129
130
131
132 #define SN_LESS(a, b) (((a - b) & 0x800) != 0)
133 #define SN_EQUAL(a, b) (a == b)
134 #define REORDER_WAIT_TIME (50)
135
136 #define RXDESC_SIZE 24
137 #define RXDESC_OFFSET RXDESC_SIZE
138
139 struct recv_stat {
140 __le32 rxdw0;
141 __le32 rxdw1;
142 __le32 rxdw2;
143 __le32 rxdw3;
144 __le32 rxdw4;
145 __le32 rxdw5;
146 };
147
148
149
150
151
152
153
154
155 struct recv_priv {
156 struct __queue free_recv_queue;
157 struct __queue recv_pending_queue;
158 struct __queue uc_swdec_pending_queue;
159 void *pallocated_frame_buf;
160 struct adapter *adapter;
161 u32 bIsAnyNonBEPkts;
162 u64 rx_bytes;
163 u64 rx_pkts;
164 u64 rx_drop;
165 u64 last_rx_bytes;
166
167 struct tasklet_struct irq_prepare_beacon_tasklet;
168 struct tasklet_struct recv_tasklet;
169 struct sk_buff_head free_recv_skb_queue;
170 struct sk_buff_head rx_skb_queue;
171 struct recv_buf *precv_buf;
172 struct __queue free_recv_buf_queue;
173
174 s8 rssi;
175 s8 rxpwdb;
176 u8 signal_strength;
177 u8 signal_qual;
178 u8 noise;
179 s8 RxRssi[2];
180
181 struct timer_list signal_stat_timer;
182 u32 signal_stat_sampling_interval;
183 struct signal_stat signal_qual_data;
184 struct signal_stat signal_strength_data;
185 };
186
187 #define rtw_set_signal_stat_timer(recvpriv) \
188 mod_timer(&(recvpriv)->signal_stat_timer, jiffies + \
189 msecs_to_jiffies((recvpriv)->signal_stat_sampling_interval))
190
191 struct sta_recv_priv {
192 spinlock_t lock;
193 int option;
194 struct __queue defrag_q;
195 struct stainfo_rxcache rxcache;
196 };
197
198 struct recv_buf {
199 struct adapter *adapter;
200 struct urb *purb;
201 struct sk_buff *pskb;
202 u8 reuse;
203 };
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 struct recv_frame {
221 struct list_head list;
222 struct sk_buff *pkt;
223 struct adapter *adapter;
224 struct rx_pkt_attrib attrib;
225 struct sta_info *psta;
226
227 struct recv_reorder_ctrl *preorder_ctrl;
228 };
229
230 struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
231 struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
232 void rtw_init_recvframe(struct recv_frame *precvframe,
233 struct recv_priv *precvpriv);
234 int rtw_free_recvframe(struct recv_frame *precvframe,
235 struct __queue *pfree_recv_queue);
236 #define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
237 int _rtw_enqueue_recvframe(struct recv_frame *precvframe,
238 struct __queue *queue);
239 int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue);
240 void rtw_free_recvframe_queue(struct __queue *pframequeue,
241 struct __queue *pfree_recv_queue);
242 u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);
243
244 void rtw_reordering_ctrl_timeout_handler(struct timer_list *t);
245
246 static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
247 {
248 s32 power;
249
250
251 power = (s32)((sig_stren_index + 1) >> 1);
252 power -= 95;
253
254 return power;
255 }
256
257
258 struct sta_info;
259
260 void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);
261
262 void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame);
263
264 #endif