1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef __LINUX_UNIFI_NATIVE_H__
18#define __LINUX_UNIFI_NATIVE_H__ 1
19
20#include <linux/kernel.h>
21#include <linux/if_arp.h>
22
23
24
25
26
27
28typedef struct scan_info {
29
30
31
32 unsigned char *info_elems;
33 int info_elem_length;
34
35} scan_info_t;
36
37
38#define IE_VECTOR_MAXLEN 1024
39
40#ifdef CSR_SUPPORT_WEXT
41
42
43
44struct wext_config {
45
46
47 int channel;
48
49
50 int mode;
51
52
53 int capability;
54
55
56 int beacon_period;
57
58
59
60
61
62 int assoc_listen_interval;
63
64
65 unsigned char desired_ssid[UNIFI_MAX_SSID_LEN];
66 int power_mode;
67
68 int wakeup_for_dtims;
69
70
71 int wep_key_id;
72
73 wep_key_t wep_keys[NUM_WEPKEYS];
74
75
76 int privacy;
77
78 u32 join_failure_timeout;
79 u32 auth_failure_timeout;
80 u32 assoc_failure_timeout;
81
82 unsigned char generic_ie[IE_VECTOR_MAXLEN];
83 int generic_ie_len;
84
85 struct iw_statistics wireless_stats;
86
87
88
89 unsigned char current_ssid[UNIFI_MAX_SSID_LEN];
90
91 unsigned char current_bssid[6];
92
93
94
95
96
97
98 unsigned char wpa_version;
99
100
101
102
103
104
105
106
107
108 unsigned char pairwise_cipher_used;
109 unsigned char group_cipher_used;
110
111 unsigned int frag_thresh;
112 unsigned int rts_thresh;
113
114
115 unsigned char wmm_bss_uapsd_mask;
116
117 unsigned int bss_wmm_capabilities;
118
119
120 int disable_join_on_ssid_set;
121
122
123#define UNIFI_MAX_SCANS 32
124 scan_info_t scan_list[UNIFI_MAX_SCANS];
125 int num_scan_info;
126
127
128
129
130
131 unsigned int flag_associated : 1;
132};
133
134#endif
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153void unifi_clear_scan_table(unifi_priv_t *priv);
154scan_info_t *unifi_get_scan_report(unifi_priv_t *priv, int index);
155
156
157
158
159
160const unsigned char *unifi_find_info_element(int id,
161 const unsigned char *info,
162 int len);
163int unifi_add_info_element(unsigned char *info,
164 int ie_id,
165 const unsigned char *ie_data,
166 int ie_len);
167
168
169
170
171
172int unifi_autojoin(unifi_priv_t *priv, const char *ssid);
173
174
175
176
177int unifi_set_powermode(unifi_priv_t *priv);
178int unifi_join_ap(unifi_priv_t *priv, scan_info_t *si);
179int unifi_join_bss(unifi_priv_t *priv, unsigned char *macaddr);
180int unifi_leave(unifi_priv_t *priv);
181unsigned int unifi_get_wmm_bss_capabilities(unifi_priv_t *priv,
182 unsigned char *ie_vector,
183 int ie_len, int *ap_capabilities);
184
185
186
187
188int uf_init_wext_interface(unifi_priv_t *priv);
189void uf_deinit_wext_interface(unifi_priv_t *priv);
190
191
192
193
194int unifi_reset_state(unifi_priv_t *priv, unsigned char *macaddr, unsigned char set_default_mib);
195
196
197
198
199
200
201int uf_abort_mlme(unifi_priv_t *priv);
202
203int unifi_mlme_blocking_request(unifi_priv_t *priv, ul_client_t *pcli,
204 CSR_SIGNAL *sig, bulk_data_param_t *data_ptrs,
205 int timeout);
206void unifi_mlme_copy_reply_and_wakeup_client(ul_client_t *pcli,
207 CSR_SIGNAL *signal, int signal_len,
208 const bulk_data_param_t *bulkdata);
209
210
211
212
213const char *lookup_reason_code(int reason);
214const char *lookup_result_code(int result);
215
216
217
218
219
220int uf_sme_init(unifi_priv_t *priv);
221void uf_sme_deinit(unifi_priv_t *priv);
222int sme_sys_suspend(unifi_priv_t *priv);
223int sme_sys_resume(unifi_priv_t *priv);
224int sme_mgt_wifi_on(unifi_priv_t *priv);
225
226
227void sme_native_log_event(ul_client_t *client,
228 const u8 *sig_packed, int sig_len,
229 const bulk_data_param_t *bulkdata,
230 int dir);
231
232void sme_native_mlme_event_handler(ul_client_t *pcli,
233 const u8 *sig_packed, int sig_len,
234 const bulk_data_param_t *bulkdata,
235 int dir);
236
237
238#define UF_SME_STATS_WQ_TIMEOUT 2000
239void uf_sme_stats_wq(struct work_struct *work);
240
241void uf_native_process_udi_signal(ul_client_t *pcli,
242 const u8 *packed_signal,
243 int packed_signal_len,
244 const bulk_data_param_t *bulkdata, int dir);
245#ifdef UNIFI_SNIFF_ARPHRD
246
247
248
249int uf_start_sniff(unifi_priv_t *priv);
250
251
252
253
254
255#endif
256
257#endif
258