blob: 8c8e47c792a007881694398c96f2e9f67ce8b8ba [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 {
Bing Zhao5e6e3a92011-03-21 18:00:50 -070026 MWIFIEX_SCAN_TYPE_UNCHANGED = 0,
27 MWIFIEX_SCAN_TYPE_ACTIVE,
28 MWIFIEX_SCAN_TYPE_PASSIVE
29};
30
Bing Zhao5e6e3a92011-03-21 18:00:50 -070031struct mwifiex_user_scan {
32 u32 scan_cfg_len;
33 u8 scan_cfg_buf[1];
34};
35
Bing Zhao5e6e3a92011-03-21 18:00:50 -070036#define MWIFIEX_PROMISC_MODE 1
37#define MWIFIEX_MULTICAST_MODE 2
38#define MWIFIEX_ALL_MULTI_MODE 4
39#define MWIFIEX_MAX_MULTICAST_LIST_SIZE 32
40
41struct mwifiex_multicast_list {
42 u32 mode;
43 u32 num_multicast_addr;
44 u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
45};
46
Bing Zhao5e6e3a92011-03-21 18:00:50 -070047struct mwifiex_chan_freq {
48 u32 channel;
49 u32 freq;
50};
51
Bing Zhao5e6e3a92011-03-21 18:00:50 -070052struct mwifiex_ssid_bssid {
Amitkumar Karwarb9be5f32012-02-27 22:04:14 -080053 struct cfg80211_ssid ssid;
Bing Zhao5e6e3a92011-03-21 18:00:50 -070054 u8 bssid[ETH_ALEN];
55};
56
57enum {
58 BAND_B = 1,
59 BAND_G = 2,
60 BAND_A = 4,
61 BAND_GN = 8,
62 BAND_AN = 16,
63};
64
Avinash Patilf752dcd2012-05-08 18:30:26 -070065#define MWIFIEX_WPA_PASSHPHRASE_LEN 64
66struct wpa_param {
67 u8 pairwise_cipher_wpa;
68 u8 pairwise_cipher_wpa2;
69 u8 group_cipher;
70 u32 length;
71 u8 passphrase[MWIFIEX_WPA_PASSHPHRASE_LEN];
72};
73
74#define KEY_MGMT_ON_HOST 0x03
75#define MWIFIEX_AUTH_MODE_AUTO 0xFF
Avinash Patil4db16a12012-05-08 18:30:20 -070076#define BAND_CONFIG_MANUAL 0x00
77struct mwifiex_uap_bss_param {
78 u8 channel;
79 u8 band_cfg;
Avinash Patil9b930ea2012-05-08 18:30:23 -070080 u16 rts_threshold;
81 u16 frag_threshold;
82 u8 retry_limit;
Avinash Patil12190c52012-05-08 18:30:24 -070083 struct mwifiex_802_11_ssid ssid;
84 u8 bcast_ssid_ctl;
85 u8 radio_ctl;
86 u8 dtim_period;
87 u16 beacon_period;
Avinash Patilf752dcd2012-05-08 18:30:26 -070088 u16 auth_mode;
89 u16 protocol;
90 u16 key_mgmt;
91 u16 key_mgmt_operation;
92 struct wpa_param wpa_cfg;
Avinash Patil22281252012-06-15 12:21:53 -070093 struct ieee80211_ht_cap ht_cap;
Avinash Patil4db16a12012-05-08 18:30:20 -070094};
95
Bing Zhao5e6e3a92011-03-21 18:00:50 -070096enum {
97 ADHOC_IDLE,
98 ADHOC_STARTED,
99 ADHOC_JOINED,
100 ADHOC_COALESCED
101};
102
103struct mwifiex_ds_get_stats {
104 u32 mcast_tx_frame;
105 u32 failed;
106 u32 retry;
107 u32 multi_retry;
108 u32 frame_dup;
109 u32 rts_success;
110 u32 rts_failure;
111 u32 ack_failure;
112 u32 rx_frag;
113 u32 mcast_rx_frame;
114 u32 fcs_error;
115 u32 tx_frame;
116 u32 wep_icv_error[4];
117};
118
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700119#define MWIFIEX_MAX_VER_STR_LEN 128
120
121struct mwifiex_ver_ext {
122 u32 version_str_sel;
123 char version_str[MWIFIEX_MAX_VER_STR_LEN];
124};
125
126struct mwifiex_bss_info {
127 u32 bss_mode;
Amitkumar Karwarb9be5f32012-02-27 22:04:14 -0800128 struct cfg80211_ssid ssid;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700129 u32 bss_chan;
Amitkumar Karwar5e218b72012-04-09 20:06:55 -0700130 u8 country_code[3];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700131 u32 media_connected;
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700132 u32 max_power_level;
133 u32 min_power_level;
134 u32 adhoc_state;
135 signed int bcn_nf_last;
136 u32 wep_status;
137 u32 is_hs_configured;
138 u32 is_deep_sleep;
139 u8 bssid[ETH_ALEN];
140};
141
142#define MAX_NUM_TID 8
143
144#define MAX_RX_WINSIZE 64
145
146struct mwifiex_ds_rx_reorder_tbl {
147 u16 tid;
148 u8 ta[ETH_ALEN];
149 u32 start_win;
150 u32 win_size;
151 u32 buffer[MAX_RX_WINSIZE];
152};
153
154struct mwifiex_ds_tx_ba_stream_tbl {
155 u16 tid;
156 u8 ra[ETH_ALEN];
157};
158
159#define DBG_CMD_NUM 5
160
161struct mwifiex_debug_info {
162 u32 int_counter;
163 u32 packets_out[MAX_NUM_TID];
164 u32 max_tx_buf_size;
165 u32 tx_buf_size;
166 u32 curr_tx_buf_size;
167 u32 tx_tbl_num;
168 struct mwifiex_ds_tx_ba_stream_tbl
169 tx_tbl[MWIFIEX_MAX_TX_BASTREAM_SUPPORTED];
170 u32 rx_tbl_num;
171 struct mwifiex_ds_rx_reorder_tbl rx_tbl
172 [MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
173 u16 ps_mode;
174 u32 ps_state;
175 u8 is_deep_sleep;
176 u8 pm_wakeup_card_req;
177 u32 pm_wakeup_fw_try;
178 u8 is_hs_configured;
179 u8 hs_activated;
180 u32 num_cmd_host_to_card_failure;
181 u32 num_cmd_sleep_cfm_host_to_card_failure;
182 u32 num_tx_host_to_card_failure;
183 u32 num_event_deauth;
184 u32 num_event_disassoc;
185 u32 num_event_link_lost;
186 u32 num_cmd_deauth;
187 u32 num_cmd_assoc_success;
188 u32 num_cmd_assoc_failure;
189 u32 num_tx_timeout;
190 u32 num_cmd_timeout;
191 u16 timeout_cmd_id;
192 u16 timeout_cmd_act;
193 u16 last_cmd_id[DBG_CMD_NUM];
194 u16 last_cmd_act[DBG_CMD_NUM];
195 u16 last_cmd_index;
196 u16 last_cmd_resp_id[DBG_CMD_NUM];
197 u16 last_cmd_resp_index;
198 u16 last_event[DBG_CMD_NUM];
199 u16 last_event_index;
200 u8 data_sent;
201 u8 cmd_sent;
202 u8 cmd_resp_received;
203 u8 event_received;
204};
205
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700206#define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700207#define WAPI_RXPN_LEN 16
208
209struct mwifiex_ds_encrypt_key {
210 u32 key_disable;
211 u32 key_index;
212 u32 key_len;
Amitkumar Karwara3731652011-04-15 20:50:41 -0700213 u8 key_material[WLAN_MAX_KEY_LEN];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700214 u8 mac_addr[ETH_ALEN];
215 u32 is_wapi_key;
216 u8 wapi_rxpn[WAPI_RXPN_LEN];
217};
218
219struct mwifiex_rate_cfg {
220 u32 action;
221 u32 is_rate_auto;
222 u32 rate;
223};
224
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700225struct mwifiex_power_cfg {
226 u32 is_power_auto;
227 u32 power_level;
228};
229
230struct mwifiex_ds_hs_cfg {
231 u32 is_invoke_hostcmd;
232 /* Bit0: non-unicast data
233 * Bit1: unicast data
234 * Bit2: mac events
235 * Bit3: magic packet
236 */
237 u32 conditions;
238 u32 gpio;
239 u32 gap;
240};
241
242#define DEEP_SLEEP_ON 1
Amitkumar Karwara0490932011-07-13 20:51:59 -0700243#define DEEP_SLEEP_OFF 0
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700244#define DEEP_SLEEP_IDLE_TIME 100
Bing Zhaoa8c48562011-05-10 20:47:36 -0700245#define PS_MODE_AUTO 1
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700246
247struct mwifiex_ds_auto_ds {
248 u16 auto_ds;
249 u16 idle_time;
250};
251
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700252struct mwifiex_ds_pm_cfg {
253 union {
254 u32 ps_mode;
255 struct mwifiex_ds_hs_cfg hs_cfg;
256 struct mwifiex_ds_auto_ds auto_deep_sleep;
257 u32 sleep_period;
258 } param;
259};
260
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700261struct mwifiex_ds_11n_tx_cfg {
262 u16 tx_htcap;
263 u16 tx_htinfo;
264};
265
266struct mwifiex_ds_11n_amsdu_aggr_ctrl {
267 u16 enable;
268 u16 curr_buf_size;
269};
270
271#define MWIFIEX_NUM_OF_CMD_BUFFER 20
272#define MWIFIEX_SIZE_OF_CMD_BUFFER 2048
273
274enum {
275 MWIFIEX_IE_TYPE_GEN_IE = 0,
276 MWIFIEX_IE_TYPE_ARP_FILTER,
277};
278
279enum {
280 MWIFIEX_REG_MAC = 1,
281 MWIFIEX_REG_BBP,
282 MWIFIEX_REG_RF,
283 MWIFIEX_REG_PMIC,
284 MWIFIEX_REG_CAU,
285};
286
287struct mwifiex_ds_reg_rw {
288 __le32 type;
289 __le32 offset;
290 __le32 value;
291};
292
293#define MAX_EEPROM_DATA 256
294
295struct mwifiex_ds_read_eeprom {
296 __le16 offset;
297 __le16 byte_count;
298 u8 value[MAX_EEPROM_DATA];
299};
300
Bing Zhao67a50032011-07-13 18:38:34 -0700301#define IEEE_MAX_IE_SIZE 256
302
Avinash Patilede98bf2012-05-08 18:30:28 -0700303#define MWIFIEX_IE_HDR_SIZE (sizeof(struct mwifiex_ie) - IEEE_MAX_IE_SIZE)
304
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700305struct mwifiex_ds_misc_gen_ie {
306 u32 type;
307 u32 len;
Bing Zhao67a50032011-07-13 18:38:34 -0700308 u8 ie_data[IEEE_MAX_IE_SIZE];
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700309};
310
311struct mwifiex_ds_misc_cmd {
312 u32 len;
313 u8 cmd[MWIFIEX_SIZE_OF_CMD_BUFFER];
314};
315
Amitkumar Karwarfa444bf2012-03-15 20:51:51 -0700316#define BITMASK_BCN_RSSI_LOW BIT(0)
317#define BITMASK_BCN_RSSI_HIGH BIT(4)
318
319enum subsc_evt_rssi_state {
320 EVENT_HANDLED,
321 RSSI_LOW_RECVD,
322 RSSI_HIGH_RECVD
323};
324
325struct subsc_evt_cfg {
326 u8 abs_value;
327 u8 evt_freq;
328};
329
330struct mwifiex_ds_misc_subsc_evt {
331 u16 action;
332 u16 events;
333 struct subsc_evt_cfg bcn_l_rssi_cfg;
334 struct subsc_evt_cfg bcn_h_rssi_cfg;
335};
336
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700337#define MWIFIEX_MAX_VSIE_LEN (256)
338#define MWIFIEX_MAX_VSIE_NUM (8)
Avinash Patil13d7ba72012-04-09 20:06:56 -0700339#define MWIFIEX_VSIE_MASK_CLEAR 0x00
Bing Zhao5e6e3a92011-03-21 18:00:50 -0700340#define MWIFIEX_VSIE_MASK_SCAN 0x01
341#define MWIFIEX_VSIE_MASK_ASSOC 0x02
342#define MWIFIEX_VSIE_MASK_ADHOC 0x04
343
344enum {
345 MWIFIEX_FUNC_INIT = 1,
346 MWIFIEX_FUNC_SHUTDOWN,
347};
348
349#endif /* !_MWIFIEX_IOCTL_H_ */