1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef __WLAN_BSSDEF_H__
16#define __WLAN_BSSDEF_H__
17
18
19#define MAX_IE_SZ 768
20
21#define NDIS_802_11_LENGTH_SSID 32
22#define NDIS_802_11_LENGTH_RATES 8
23#define NDIS_802_11_LENGTH_RATES_EX 16
24
25#define NDIS_802_11_RSSI long
26
27struct ndis_802_11_ssid {
28 u32 SsidLength;
29 u8 Ssid[32];
30};
31
32enum NDIS_802_11_NETWORK_TYPE {
33 Ndis802_11FH,
34 Ndis802_11DS,
35 Ndis802_11OFDM5,
36 Ndis802_11OFDM24,
37 Ndis802_11NetworkTypeMax
38};
39
40struct ndis_802_11_config_fh {
41 u32 Length;
42 u32 HopPattern;
43 u32 HopSet;
44 u32 DwellTime;
45};
46
47
48
49
50
51struct ndis_802_11_config {
52 u32 Length;
53 u32 BeaconPeriod;
54 u32 ATIMWindow;
55 u32 DSConfig;
56 struct ndis_802_11_config_fh FHConfig;
57};
58
59enum ndis_802_11_network_infra {
60 Ndis802_11IBSS,
61 Ndis802_11Infrastructure,
62 Ndis802_11AutoUnknown,
63 Ndis802_11InfrastructureMax,
64 Ndis802_11APMode
65};
66
67struct ndis_802_11_fixed_ie {
68 u8 Timestamp[8];
69 u16 BeaconInterval;
70 u16 Capabilities;
71};
72
73
74
75struct ndis_802_11_var_ie {
76 u8 ElementID;
77 u8 Length;
78 u8 data[1];
79};
80
81
82
83
84
85
86
87
88
89
90
91
92enum ndis_802_11_auth_mode {
93 Ndis802_11AuthModeOpen,
94 Ndis802_11AuthModeShared,
95 Ndis802_11AuthModeAutoSwitch,
96 Ndis802_11AuthModeWPA,
97 Ndis802_11AuthModeWPAPSK,
98 Ndis802_11AuthModeWPANone,
99 Ndis802_11AuthModeWAPI,
100 Ndis802_11AuthModeMax
101};
102
103enum ndis_802_11_wep_status {
104 Ndis802_11WEPEnabled,
105 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
106 Ndis802_11WEPDisabled,
107 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
108 Ndis802_11WEPKeyAbsent,
109 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
110 Ndis802_11WEPNotSupported,
111 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
112 Ndis802_11Encryption2Enabled,
113 Ndis802_11Encryption2KeyAbsent,
114 Ndis802_11Encryption3Enabled,
115 Ndis802_11Encryption3KeyAbsent,
116 Ndis802_11_EncryptionWAPI
117};
118
119#define NDIS_802_11_AI_REQFI_CAPABILITIES 1
120#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
121#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
122
123#define NDIS_802_11_AI_RESFI_CAPABILITIES 1
124#define NDIS_802_11_AI_RESFI_STATUSCODE 2
125#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
126
127enum ndis_802_11_reload_def {
128 Ndis802_11ReloadWEPKeys
129};
130
131struct ndis_802_11_wep {
132 u32 Length;
133 u32 KeyIndex;
134
135
136 u32 KeyLength;
137 u8 KeyMaterial[16];
138};
139
140enum ndis_802_11_status_type {
141 Ndis802_11StatusType_Authentication,
142 Ndis802_11StatusType_MediaStreamMode,
143 Ndis802_11StatusType_PMKID_CandidateList,
144 Ndis802_11StatusTypeMax
145
146
147};
148
149
150#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
151#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
152#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
153#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
154#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
155
156
157#define MIC_CHECK_TIME 60000000
158
159#ifndef Ndis802_11APMode
160#define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
161#endif
162
163struct wlan_phy_info {
164 u8 SignalStrength;
165 u8 SignalQuality;
166 u8 Optimum_antenna;
167 u8 Reserved_0;
168};
169
170struct wlan_bcn_info {
171
172
173
174 u8 encryp_protocol;
175 int group_cipher;
176 int pairwise_cipher;
177 int is_8021x;
178
179
180 unsigned short ht_cap_info;
181 unsigned char ht_info_infos_0;
182};
183
184
185
186
187struct wlan_bssid_ex {
188 u32 Length;
189 unsigned char MacAddress[ETH_ALEN];
190 u8 Reserved[2];
191 struct ndis_802_11_ssid Ssid;
192 u32 Privacy;
193 NDIS_802_11_RSSI Rssi;
194 enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
195 struct ndis_802_11_config Configuration;
196 enum ndis_802_11_network_infra InfrastructureMode;
197 unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
198 struct wlan_phy_info PhyInfo;
199 u32 ie_length;
200 u8 ies[MAX_IE_SZ];
201
202
203} __packed;
204
205static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
206{
207 return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->ie_length;
208}
209
210struct wlan_network {
211 struct list_head list;
212 int network_type;
213 int fixed;
214
215
216 unsigned long last_scanned;
217 int aid;
218 int join_res;
219 struct wlan_bssid_ex network;
220 struct wlan_bcn_info BcnInfo;
221};
222
223enum VRTL_CARRIER_SENSE {
224 DISABLE_VCS,
225 ENABLE_VCS,
226 AUTO_VCS
227};
228
229enum VCS_TYPE {
230 NONE_VCS,
231 RTS_CTS,
232 CTS_TO_SELF
233};
234
235#define PWR_CAM 0
236#define PWR_MINPS 1
237#define PWR_MAXPS 2
238#define PWR_UAPSD 3
239#define PWR_VOIP 4
240
241enum UAPSD_MAX_SP {
242 NO_LIMIT,
243 TWO_MSDU,
244 FOUR_MSDU,
245 SIX_MSDU
246};
247
248#define NUM_PRE_AUTH_KEY 16
249#define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
250
251#endif
252