blob: b7e457110b4f497021ee8c956e993b0c77fb034e [file] [log] [blame]
Bing Zhao5e6e3a92011-03-21 18:00:50 -07001/*
2 * Marvell Wireless LAN device driver: ioctl data structures & APIs
3 *
4 * Copyright (C) 2011, Marvell International Ltd.
5 *
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
13 *
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
18 */
19
20#ifndef _MWIFIEX_IOCTL_H_
21#define _MWIFIEX_IOCTL_H_
22
23#include <net/mac80211.h>
24
25enum {
26 MWIFIEX_SCAN_MODE_UNCHANGED = 0,
27 MWIFIEX_SCAN_MODE_BSS,
28 MWIFIEX_SCAN_MODE_IBSS,
29 MWIFIEX_SCAN_MODE_ANY
30};
31
32enum {
33 MWIFIEX_SCAN_TYPE_UNCHANGED = 0,
34 MWIFIEX_SCAN_TYPE_ACTIVE,
35 MWIFIEX_SCAN_TYPE_PASSIVE
36};
37
38struct mwifiex_get_scan_table_fixed {
39 u8 bssid[ETH_ALEN];
40 u8 channel;
41 u8 rssi;
42 long long network_tsf;
43};
44
45struct mwifiex_scan_time_params {
46 u32 specific_scan_time;
47 u32 active_scan_time;
48 u32 passive_scan_time;
49};
50
51struct mwifiex_user_scan {
52 u32 scan_cfg_len;
53 u8 scan_cfg_buf[1];
54};
55
56struct mwifiex_scan_req {
57 u32 scan_mode;
58 u32 scan_type;
59 struct mwifiex_802_11_ssid scan_ssid;
60 struct mwifiex_scan_time_params scan_time;
61 struct mwifiex_user_scan user_scan;
62};
63
64struct mwifiex_scan_resp {
65 u32 num_in_scan_table;
66 u8 *scan_table;
67};
68
69enum {
70 MWIFIEX_BSS_MODE_INFRA = 1,
71 MWIFIEX_BSS_MODE_IBSS,
72 MWIFIEX_BSS_MODE_AUTO
73};
74
75#define MWIFIEX_PROMISC_MODE 1
76#define MWIFIEX_MULTICAST_MODE 2
77#define MWIFIEX_ALL_MULTI_MODE 4
78#define MWIFIEX_MAX_MULTICAST_LIST_SIZE 32
79
80struct mwifiex_multicast_list {
81 u32 mode;
82 u32 num_multicast_addr;
83 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
84};
85
86#define MWIFIEX_MAX_CHANNEL_NUM 128
87
88struct mwifiex_chan_freq {
89 u32 channel;
90 u32 freq;
91};
92
93struct mwifiex_chan_list {
94 u32 num_of_chan;
95 struct mwifiex_chan_freq cf[MWIFIEX_MAX_CHANNEL_NUM];
96};
97
98struct mwifiex_ssid_bssid {
99 struct mwifiex_802_11_ssid ssid;
100 u8 bssid[ETH_ALEN];
101};
102
103enum {
104 BAND_B = 1,
105 BAND_G = 2,
106 BAND_A = 4,
107 BAND_GN = 8,
108 BAND_AN = 16,
109};
110
111#define NO_SEC_CHANNEL 0
112#define SEC_CHANNEL_ABOVE 1
113#define SEC_CHANNEL_BELOW 3
114
115struct mwifiex_ds_band_cfg {
116 u32 config_bands;
117 u32 adhoc_start_band;
118 u32 adhoc_channel;
119 u32 sec_chan_offset;
120};
121
122enum {
123 ADHOC_IDLE,
124 ADHOC_STARTED,
125 ADHOC_JOINED,
126 ADHOC_COALESCED
127};
128
129struct mwifiex_ds_get_stats {
130 u32 mcast_tx_frame;
131 u32 failed;
132 u32 retry;
133 u32 multi_retry;
134 u32 frame_dup;
135 u32 rts_success;
136 u32 rts_failure;
137 u32 ack_failure;
138 u32 rx_frag;
139 u32 mcast_rx_frame;
140 u32 fcs_error;
141 u32 tx_frame;
142 u32 wep_icv_error[4];
143};
144
145#define BCN_RSSI_LAST_MASK 0x00000001
146#define BCN_RSSI_AVG_MASK 0x00000002
147#define DATA_RSSI_LAST_MASK 0x00000004
148#define DATA_RSSI_AVG_MASK 0x00000008
149#define BCN_SNR_LAST_MASK 0x00000010
150#define BCN_SNR_AVG_MASK 0x00000020
151#define DATA_SNR_LAST_MASK 0x00000040
152#define DATA_SNR_AVG_MASK 0x00000080
153#define BCN_NF_LAST_MASK 0x00000100
154#define BCN_NF_AVG_MASK 0x00000200
155#define DATA_NF_LAST_MASK 0x00000400
156#define DATA_NF_AVG_MASK 0x00000800
157#define ALL_RSSI_INFO_MASK 0x00000fff
158
159struct mwifiex_ds_get_signal {
160 /*
161 * Bit0: Last Beacon RSSI, Bit1: Average Beacon RSSI,
162 * Bit2: Last Data RSSI, Bit3: Average Data RSSI,
163 * Bit4: Last Beacon SNR, Bit5: Average Beacon SNR,
164 * Bit6: Last Data SNR, Bit7: Average Data SNR,
165 * Bit8: Last Beacon NF, Bit9: Average Beacon NF,
166 * Bit10: Last Data NF, Bit11: Average Data NF
167 */
168 u16 selector;
169 s16 bcn_rssi_last;
170 s16 bcn_rssi_avg;
171 s16 data_rssi_last;
172 s16 data_rssi_avg;
173 s16 bcn_snr_last;
174 s16 bcn_snr_avg;
175 s16 data_snr_last;
176 s16 data_snr_avg;
177 s16 bcn_nf_last;
178 s16 bcn_nf_avg;
179 s16 data_nf_last;
180 s16 data_nf_avg;
181};
182
183struct mwifiex_fw_info {
184 u32 fw_ver;
185 u8 mac_addr[ETH_ALEN];
186};
187
188#define MWIFIEX_MAX_VER_STR_LEN 128
189
190struct mwifiex_ver_ext {
191 u32 version_str_sel;
192 char version_str[MWIFIEX_MAX_VER_STR_LEN];
193};
194
195struct mwifiex_bss_info {
196 u32 bss_mode;
197 struct mwifiex_802_11_ssid ssid;
198 u32 scan_table_idx;
199 u32 bss_chan;
200 u32 region_code;
201 u32 media_connected;
202 u32 radio_on;
203 u32 max_power_level;
204 u32 min_power_level;
205 u32 adhoc_state;
206 signed int bcn_nf_last;
207 u32 wep_status;
208 u32 is_hs_configured;
209 u32 is_deep_sleep;
210 u8 bssid[ETH_ALEN];
211};
212
213#define MAX_NUM_TID 8
214
215#define MAX_RX_WINSIZE 64
216
217struct mwifiex_ds_rx_reorder_tbl {
218 u16 tid;
219 u8 ta[ETH_ALEN];
220 u32 start_win;
221 u32 win_size;
222 u32 buffer[MAX_RX_WINSIZE];
223};
224
225struct mwifiex_ds_tx_ba_stream_tbl {
226 u16 tid;
227 u8 ra[ETH_ALEN];
228};
229
230#define DBG_CMD_NUM 5
231
232struct mwifiex_debug_info {
233 u32 int_counter;
234 u32 packets_out[MAX_NUM_TID];
235 u32 max_tx_buf_size;
236 u32 tx_buf_size;
237 u32 curr_tx_buf_size;
238 u32 tx_tbl_num;
239 struct mwifiex_ds_tx_ba_stream_tbl
240 tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
241 u32 rx_tbl_num;
242 struct mwifiex_ds_rx_reorder_tbl rx_tbl
243 [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
244 u16 ps_mode;
245 u32 ps_state;
246 u8 is_deep_sleep;
247 u8 pm_wakeup_card_req;
248 u32 pm_wakeup_fw_try;
249 u8 is_hs_configured;
250 u8 hs_activated;
251 u32 num_cmd_host_to_card_failure;
252 u32 num_cmd_sleep_cfm_host_to_card_failure;
253 u32 num_tx_host_to_card_failure;
254 u32 num_event_deauth;
255 u32 num_event_disassoc;
256 u32 num_event_link_lost;
257 u32 num_cmd_deauth;
258 u32 num_cmd_assoc_success;
259 u32 num_cmd_assoc_failure;
260 u32 num_tx_timeout;
261 u32 num_cmd_timeout;
262 u16 timeout_cmd_id;
263 u16 timeout_cmd_act;
264 u16 last_cmd_id[DBG_CMD_NUM];
265 u16 last_cmd_act[DBG_CMD_NUM];
266 u16 last_cmd_index;
267 u16 last_cmd_resp_id[DBG_CMD_NUM];
268 u16 last_cmd_resp_index;
269 u16 last_event[DBG_CMD_NUM];
270 u16 last_event_index;
271 u8 data_sent;
272 u8 cmd_sent;
273 u8 cmd_resp_received;
274 u8 event_received;
275};
276
277enum {
278 MWIFIEX_AUTH_MODE_OPEN = 0x00,
279 MWIFIEX_AUTH_MODE_SHARED = 0x01,
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700280};
281
282enum {
283 MWIFIEX_ENCRYPTION_MODE_NONE = 0,
284 MWIFIEX_ENCRYPTION_MODE_WEP40 = 1,
285 MWIFIEX_ENCRYPTION_MODE_TKIP = 2,
286 MWIFIEX_ENCRYPTION_MODE_CCMP = 3,
287 MWIFIEX_ENCRYPTION_MODE_WEP104 = 4,
288};
289
290#define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
291#define MWIFIEX_MAX_KEY_LENGTH 32
292#define WAPI_RXPN_LEN 16
293
294struct mwifiex_ds_encrypt_key {
295 u32 key_disable;
296 u32 key_index;
297 u32 key_len;
298 u8 key_material[MWIFIEX_MAX_KEY_LENGTH];
299 u8 mac_addr[ETH_ALEN];
300 u32 is_wapi_key;
301 u8 wapi_rxpn[WAPI_RXPN_LEN];
302};
303
304struct mwifiex_rate_cfg {
305 u32 action;
306 u32 is_rate_auto;
307 u32 rate;
308};
309
310struct mwifiex_data_rate {
311 u32 tx_data_rate;
312 u32 rx_data_rate;
313};
314
315struct mwifiex_power_cfg {
316 u32 is_power_auto;
317 u32 power_level;
318};
319
320struct mwifiex_ds_hs_cfg {
321 u32 is_invoke_hostcmd;
322 /* Bit0: non-unicast data
323 * Bit1: unicast data
324 * Bit2: mac events
325 * Bit3: magic packet
326 */
327 u32 conditions;
328 u32 gpio;
329 u32 gap;
330};
331
332#define DEEP_SLEEP_ON 1
333#define DEEP_SLEEP_OFF 0
334
335#define DEEP_SLEEP_IDLE_TIME 100
336
337struct mwifiex_ds_auto_ds {
338 u16 auto_ds;
339 u16 idle_time;
340};
341
342#define PS_MODE_UNCHANGED 0
343#define PS_MODE_AUTO 1
344#define PS_MODE_POLL 2
345#define PS_MODE_NULL 3
346
347
348struct mwifiex_ds_pm_cfg {
349 union {
350 u32 ps_mode;
351 struct mwifiex_ds_hs_cfg hs_cfg;
352 struct mwifiex_ds_auto_ds auto_deep_sleep;
353 u32 sleep_period;
354 } param;
355};
356
357struct mwifiex_ioctl_wmm_queue_status_ac {
358 u8 wmm_acm;
359 u8 flow_required;
360 u8 flow_created;
361 u8 disabled;
362};
363
364struct mwifiex_ds_wmm_queue_status {
365 struct mwifiex_ioctl_wmm_queue_status_ac
366 ac_status[IEEE80211_MAX_QUEUES];
367};
368
369struct mwifiex_ds_11n_tx_cfg {
370 u16 tx_htcap;
371 u16 tx_htinfo;
372};
373
374struct mwifiex_ds_11n_amsdu_aggr_ctrl {
375 u16 enable;
376 u16 curr_buf_size;
377};
378
379#define MWIFIEX_NUM_OF_CMD_BUFFER 20
380#define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
381
382enum {
383 MWIFIEX_IE_TYPE_GEN_IE = 0,
384 MWIFIEX_IE_TYPE_ARP_FILTER,
385};
386
387enum {
388 MWIFIEX_REG_MAC = 1,
389 MWIFIEX_REG_BBP,
390 MWIFIEX_REG_RF,
391 MWIFIEX_REG_PMIC,
392 MWIFIEX_REG_CAU,
393};
394
395struct mwifiex_ds_reg_rw {
396 __le32 type;
397 __le32 offset;
398 __le32 value;
399};
400
401#define MAX_EEPROM_DATA 256
402
403struct mwifiex_ds_read_eeprom {
404 __le16 offset;
405 __le16 byte_count;
406 u8 value[MAX_EEPROM_DATA];
407};
408
409struct mwifiex_ds_misc_gen_ie {
410 u32 type;
411 u32 len;
412 u8 ie_data[IW_CUSTOM_MAX];
413};
414
415struct mwifiex_ds_misc_cmd {
416 u32 len;
417 u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
418};
419
420#define MWIFIEX_MAX_VSIE_LEN (256)
421#define MWIFIEX_MAX_VSIE_NUM (8)
422#define MWIFIEX_VSIE_MASK_SCAN 0x01
423#define MWIFIEX_VSIE_MASK_ASSOC 0x02
424#define MWIFIEX_VSIE_MASK_ADHOC 0x04
425
426enum {
427 MWIFIEX_FUNC_INIT = 1,
428 MWIFIEX_FUNC_SHUTDOWN,
429};
430
431#endif /* !_MWIFIEX_IOCTL_H_ */