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
14#define NDIS_802_11_LENGTH_SSID 32
15#define NDIS_802_11_LENGTH_RATES 8
16#define NDIS_802_11_LENGTH_RATES_EX 16
17
18typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
19typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];
20typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX];
21
22struct ndis_802_11_ssid {
23 u32 ssid_length;
24 u8 ssid[32];
25};
26
27enum ndis_802_11_network_type {
28 Ndis802_11FH,
29 Ndis802_11DS,
30 Ndis802_11OFDM5,
31 Ndis802_11OFDM24,
32 Ndis802_11NetworkTypeMax
33};
34
35
36
37
38
39struct ndis_802_11_conf {
40 u32 length;
41 u32 beacon_period;
42 u32 atim_window;
43 u32 ds_config;
44};
45
46enum ndis_802_11_network_infrastructure {
47 Ndis802_11IBSS,
48 Ndis802_11Infrastructure,
49 Ndis802_11AutoUnknown,
50 Ndis802_11InfrastructureMax,
51 Ndis802_11APMode,
52};
53
54struct ndis_802_11_fix_ie {
55 u8 time_stamp[8];
56 u16 beacon_interval;
57 u16 capabilities;
58};
59
60struct ndis_80211_var_ie {
61 u8 element_id;
62 u8 length;
63 u8 data[];
64};
65
66
67
68
69
70
71
72
73
74
75enum ndis_802_11_authentication_mode {
76 Ndis802_11AuthModeOpen,
77 Ndis802_11AuthModeShared,
78 Ndis802_11AuthModeAutoSwitch,
79 Ndis802_11AuthModeWPA,
80 Ndis802_11AuthModeWPAPSK,
81 Ndis802_11AuthModeWPANone,
82 Ndis802_11AuthModeWAPI,
83 Ndis802_11AuthModeMax
84};
85
86enum {
87 Ndis802_11WEPEnabled,
88 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
89 Ndis802_11WEPDisabled,
90 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
91 Ndis802_11WEPKeyAbsent,
92 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
93 Ndis802_11WEPNotSupported,
94 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
95 Ndis802_11Encryption2Enabled,
96 Ndis802_11Encryption2KeyAbsent,
97 Ndis802_11Encryption3Enabled,
98 Ndis802_11Encryption3KeyAbsent,
99 Ndis802_11_EncrypteionWAPI
100};
101
102#define NDIS_802_11_AI_REQFI_CAPABILITIES 1
103#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
104#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
105
106#define NDIS_802_11_AI_RESFI_CAPABILITIES 1
107#define NDIS_802_11_AI_RESFI_STATUSCODE 2
108#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
109
110
111
112struct ndis_802_11_wep {
113 u32 length;
114 u32 key_index;
115 u32 key_length;
116 u8 key_material[16];
117};
118
119
120#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
121#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
122#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
123#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
124#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
125
126
127#define MIC_CHECK_TIME 60000000
128
129#ifndef Ndis802_11APMode
130#define Ndis802_11APMode (Ndis802_11InfrastructureMax + 1)
131#endif
132
133struct wlan_phy_info {
134 u8 signal_strength;
135 u8 signal_quality;
136 u8 optimum_antenna;
137 u8 reserved_0;
138};
139
140struct wlan_bcn_info {
141
142
143 u8 encryp_protocol;
144 int group_cipher;
145 int pairwise_cipher;
146 int is_8021x;
147
148
149 unsigned short ht_cap_info;
150 unsigned char ht_info_infos_0;
151};
152
153
154
155
156struct wlan_bssid_ex {
157 u32 length;
158 NDIS_802_11_MAC_ADDRESS mac_address;
159 u8 reserved[2];
160 struct ndis_802_11_ssid ssid;
161 u32 privacy;
162 long rssi;
163 enum ndis_802_11_network_type network_type_in_use;
164 struct ndis_802_11_conf configuration;
165 enum ndis_802_11_network_infrastructure infrastructure_mode;
166 NDIS_802_11_RATES_EX supported_rates;
167 struct wlan_phy_info phy_info;
168 u32 ie_length;
169 u8 ies[MAX_IE_SZ];
170} __packed;
171
172static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
173{
174 return (sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->ie_length);
175}
176
177struct wlan_network {
178 struct list_head list;
179 int network_type;
180 int fixed;
181 unsigned long last_scanned;
182 int aid;
183 int join_res;
184 struct wlan_bssid_ex network;
185 struct wlan_bcn_info bcn_info;
186};
187
188enum {
189 DISABLE_VCS,
190 ENABLE_VCS,
191 AUTO_VCS
192};
193
194enum {
195 NONE_VCS,
196 RTS_CTS,
197 CTS_TO_SELF
198};
199
200#define PWR_CAM 0
201#define PWR_MINPS 1
202#define PWR_MAXPS 2
203#define PWR_UAPSD 3
204#define PWR_VOIP 4
205
206enum {
207 NO_LIMIT,
208 TWO_MSDU,
209 FOUR_MSDU,
210 SIX_MSDU
211};
212
213#define NUM_PRE_AUTH_KEY 16
214#define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
215
216#endif
217