1
2
3
4
5
6
7
8
9 #ifndef __WL1251_RX_H__
10 #define __WL1251_RX_H__
11
12 #include <linux/bitops.h>
13
14 #include "wl1251.h"
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #define WL1251_RX_MAX_RSSI -30
33 #define WL1251_RX_MIN_RSSI -95
34
35 #define WL1251_RX_ALIGN_TO 4
36 #define WL1251_RX_ALIGN(len) (((len) + WL1251_RX_ALIGN_TO - 1) & \
37 ~(WL1251_RX_ALIGN_TO - 1))
38
39 #define SHORT_PREAMBLE_BIT BIT(0)
40 #define OFDM_RATE_BIT BIT(6)
41 #define PBCC_RATE_BIT BIT(7)
42
43 #define PLCP_HEADER_LENGTH 8
44 #define RX_DESC_PACKETID_SHIFT 11
45 #define RX_MAX_PACKET_ID 3
46
47 #define RX_DESC_VALID_FCS 0x0001
48 #define RX_DESC_MATCH_RXADDR1 0x0002
49 #define RX_DESC_MCAST 0x0004
50 #define RX_DESC_STAINTIM 0x0008
51 #define RX_DESC_VIRTUAL_BM 0x0010
52 #define RX_DESC_BCAST 0x0020
53 #define RX_DESC_MATCH_SSID 0x0040
54 #define RX_DESC_MATCH_BSSID 0x0080
55 #define RX_DESC_ENCRYPTION_MASK 0x0300
56 #define RX_DESC_MEASURMENT 0x0400
57 #define RX_DESC_SEQNUM_MASK 0x1800
58 #define RX_DESC_MIC_FAIL 0x2000
59 #define RX_DESC_DECRYPT_FAIL 0x4000
60
61 struct wl1251_rx_descriptor {
62 u32 timestamp;
63 u16 length;
64 u16 flags;
65
66
67
68
69
70
71
72 u8 type;
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 u8 rate;
91
92 u8 mod_pre;
93 u8 channel;
94
95
96
97
98
99 u8 band;
100
101 s8 rssi;
102 u8 rcpi;
103 u8 snr;
104 } __packed;
105
106 void wl1251_rx(struct wl1251 *wl);
107
108 #endif