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