blob: 072bf3c2f24b044ecdd7c331ddeb4c91ccc8e165 [file] [log] [blame]
Luciano Coelhof5fc0f82009-08-06 16:25:28 +03001/*
2 * This file is part of wl1271
3 *
4 * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
5 * Copyright (C) 2009 Nokia Corporation
6 *
7 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
Shahar Levi00d20102010-11-08 11:20:10 +000025#ifndef __CMD_H__
26#define __CMD_H__
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030027
Shahar Levi00d20102010-11-08 11:20:10 +000028#include "wl12xx.h"
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030029
30struct acx_header;
31
Juuso Oikarinenfa867e72009-11-02 20:22:13 +020032int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len,
33 size_t res_len);
Luciano Coelho98b5dd52009-11-23 23:22:17 +020034int wl1271_cmd_general_parms(struct wl1271 *wl);
35int wl1271_cmd_radio_parms(struct wl1271 *wl);
Juuso Oikarinen644a4862010-10-05 13:11:56 +020036int wl1271_cmd_ext_radio_parms(struct wl1271 *wl);
Juuso Oikarinen15305492010-02-22 08:38:32 +020037int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030038int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
39int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
40int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
Luciano Coelho94210892009-12-11 15:40:55 +020041int wl1271_cmd_data_path(struct wl1271 *wl, bool enable);
Juuso Oikarinen65cddbf2010-08-24 06:28:03 +030042int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send);
43int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
44 size_t len);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030045int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
Juuso Oikarinen606c1482010-04-01 11:38:21 +030046 void *buf, size_t buf_len, int index, u32 rates);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030047int wl1271_cmd_build_null_data(struct wl1271 *wl);
48int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
Kalle Valo818e3062010-03-18 12:26:35 +020049int wl1271_cmd_build_probe_req(struct wl1271 *wl,
50 const u8 *ssid, size_t ssid_len,
51 const u8 *ie, size_t ie_len, u8 band);
Juuso Oikarinen2f6724b2010-11-24 08:16:57 +020052struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
53 struct sk_buff *skb);
Eliad Pellerc5312772010-12-09 11:31:27 +020054int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr);
Kalle Valo023e0822010-03-18 12:26:36 +020055int wl1271_build_qos_null_data(struct wl1271 *wl);
Juuso Oikarinenbfb24c92010-03-26 12:53:31 +020056int wl1271_cmd_build_klv_null_data(struct wl1271 *wl);
Arik Nemtsov98bdaab2010-10-16 18:08:58 +020057int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id);
58int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id);
59int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
60 u8 key_size, const u8 *key, const u8 *addr,
61 u32 tx_seq_32, u16 tx_seq_16);
62int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
63 u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32,
64 u16 tx_seq_16);
Luciano Coelho25a7dc62009-10-12 15:08:42 +030065int wl1271_cmd_disconnect(struct wl1271 *wl);
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +030066int wl1271_cmd_set_sta_state(struct wl1271 *wl);
Arik Nemtsov98bdaab2010-10-16 18:08:58 +020067int wl1271_cmd_start_bss(struct wl1271 *wl);
68int wl1271_cmd_stop_bss(struct wl1271 *wl);
69int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid);
70int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030071
72enum wl1271_commands {
73 CMD_INTERROGATE = 1, /*use this to read information elements*/
74 CMD_CONFIGURE = 2, /*use this to write information elements*/
75 CMD_ENABLE_RX = 3,
76 CMD_ENABLE_TX = 4,
77 CMD_DISABLE_RX = 5,
78 CMD_DISABLE_TX = 6,
79 CMD_SCAN = 8,
80 CMD_STOP_SCAN = 9,
81 CMD_START_JOIN = 11,
82 CMD_SET_KEYS = 12,
83 CMD_READ_MEMORY = 13,
84 CMD_WRITE_MEMORY = 14,
85 CMD_SET_TEMPLATE = 19,
86 CMD_TEST = 23,
87 CMD_NOISE_HIST = 28,
88 CMD_LNA_CONTROL = 32,
89 CMD_SET_BCN_MODE = 33,
90 CMD_MEASUREMENT = 34,
91 CMD_STOP_MEASUREMENT = 35,
92 CMD_DISCONNECT = 36,
93 CMD_SET_PS_MODE = 37,
94 CMD_CHANNEL_SWITCH = 38,
95 CMD_STOP_CHANNEL_SWICTH = 39,
96 CMD_AP_DISCOVERY = 40,
97 CMD_STOP_AP_DISCOVERY = 41,
98 CMD_SPS_SCAN = 42,
99 CMD_STOP_SPS_SCAN = 43,
100 CMD_HEALTH_CHECK = 45,
101 CMD_DEBUG = 46,
102 CMD_TRIGGER_SCAN_TO = 47,
103 CMD_CONNECTION_SCAN_CFG = 48,
104 CMD_CONNECTION_SCAN_SSID_CFG = 49,
105 CMD_START_PERIODIC_SCAN = 50,
106 CMD_STOP_PERIODIC_SCAN = 51,
107 CMD_SET_STA_STATE = 52,
108
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200109 /* AP mode commands */
110 CMD_BSS_START = 60,
111 CMD_BSS_STOP = 61,
112 CMD_ADD_STA = 62,
113 CMD_REMOVE_STA = 63,
114
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300115 NUM_COMMANDS,
116 MAX_COMMAND_ID = 0xFFFF,
117};
118
119#define MAX_CMD_PARAMS 572
120
Juuso Oikarinenbfb24c92010-03-26 12:53:31 +0200121enum {
122 CMD_TEMPL_KLV_IDX_NULL_DATA = 0,
123 CMD_TEMPL_KLV_IDX_MAX = 4
124};
125
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300126enum cmd_templ {
127 CMD_TEMPL_NULL_DATA = 0,
128 CMD_TEMPL_BEACON,
129 CMD_TEMPL_CFG_PROBE_REQ_2_4,
130 CMD_TEMPL_CFG_PROBE_REQ_5,
131 CMD_TEMPL_PROBE_RESPONSE,
132 CMD_TEMPL_QOS_NULL_DATA,
133 CMD_TEMPL_PS_POLL,
134 CMD_TEMPL_KLV,
135 CMD_TEMPL_DISCONNECT,
136 CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */
137 CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */
138 CMD_TEMPL_BAR, /* for firmware internal use only */
139 CMD_TEMPL_CTS, /*
140 * For CTS-to-self (FastCTS) mechanism
141 * for BT/WLAN coexistence (SoftGemini). */
Eliad Pellerc5312772010-12-09 11:31:27 +0200142 CMD_TEMPL_ARP_RSP,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300143 CMD_TEMPL_MAX = 0xff
144};
145
146/* unit ms */
147#define WL1271_COMMAND_TIMEOUT 2000
148#define WL1271_CMD_TEMPL_MAX_SIZE 252
Teemu Paasikivi0cbb1032010-05-07 11:39:01 +0300149#define WL1271_EVENT_TIMEOUT 750
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300150
151struct wl1271_cmd_header {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300152 __le16 id;
153 __le16 status;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300154 /* payload */
155 u8 data[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000156} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300157
158#define WL1271_CMD_MAX_PARAMS 572
159
160struct wl1271_command {
161 struct wl1271_cmd_header header;
162 u8 parameters[WL1271_CMD_MAX_PARAMS];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000163} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300164
165enum {
166 CMD_MAILBOX_IDLE = 0,
167 CMD_STATUS_SUCCESS = 1,
168 CMD_STATUS_UNKNOWN_CMD = 2,
169 CMD_STATUS_UNKNOWN_IE = 3,
170 CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11,
171 CMD_STATUS_RX_BUSY = 13,
172 CMD_STATUS_INVALID_PARAM = 14,
173 CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
174 CMD_STATUS_OUT_OF_MEMORY = 16,
175 CMD_STATUS_STA_TABLE_FULL = 17,
176 CMD_STATUS_RADIO_ERROR = 18,
177 CMD_STATUS_WRONG_NESTING = 19,
178 CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/
179 CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/
180 MAX_COMMAND_STATUS = 0xff
181};
182
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300183#define CMDMBOX_HEADER_LEN 4
184#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
185
186enum {
187 BSS_TYPE_IBSS = 0,
188 BSS_TYPE_STA_BSS = 2,
189 BSS_TYPE_AP_BSS = 3,
190 MAX_BSS_TYPE = 0xFF
191};
192
193#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
194#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
Teemu Paasikivia4102642009-10-13 12:47:51 +0300195#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300196
197struct wl1271_cmd_join {
198 struct wl1271_cmd_header header;
199
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300200 __le32 bssid_lsb;
201 __le16 bssid_msb;
202 __le16 beacon_interval; /* in TBTTs */
203 __le32 rx_config_options;
204 __le32 rx_filter_options;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300205
206 /*
207 * The target uses this field to determine the rate at
208 * which to transmit control frame responses (such as
209 * ACK or CTS frames).
210 */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300211 __le32 basic_rate_set;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300212 u8 dtim_interval;
213 /*
214 * bits 0-2: This bitwise field specifies the type
215 * of BSS to start or join (BSS_TYPE_*).
216 * bit 4: Band - The radio band in which to join
217 * or start.
218 * 0 - 2.4GHz band
219 * 1 - 5GHz band
220 * bits 3, 5-7: Reserved
221 */
222 u8 bss_type;
223 u8 channel;
224 u8 ssid_len;
225 u8 ssid[IW_ESSID_MAX_SIZE];
226 u8 ctrl; /* JOIN_CMD_CTRL_* */
227 u8 reserved[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000228} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300229
230struct cmd_enabledisable_path {
231 struct wl1271_cmd_header header;
232
233 u8 channel;
234 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000235} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300236
Juuso Oikarinen606c1482010-04-01 11:38:21 +0300237#define WL1271_RATE_AUTOMATIC 0
238
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300239struct wl1271_cmd_template_set {
240 struct wl1271_cmd_header header;
241
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300242 __le16 len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300243 u8 template_type;
244 u8 index; /* relevant only for KLV_TEMPLATE type */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300245 __le32 enabled_rates;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300246 u8 short_retry_limit;
247 u8 long_retry_limit;
248 u8 aflags;
249 u8 reserved;
250 u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000251} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300252
253#define TIM_ELE_ID 5
254#define PARTIAL_VBM_MAX 251
255
256struct wl1271_tim {
257 u8 identity;
258 u8 length;
259 u8 dtim_count;
260 u8 dtim_period;
261 u8 bitmap_ctrl;
262 u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000263} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300264
265enum wl1271_cmd_ps_mode {
266 STATION_ACTIVE_MODE,
267 STATION_POWER_SAVE_MODE
268};
269
270struct wl1271_cmd_ps_params {
271 struct wl1271_cmd_header header;
272
273 u8 ps_mode; /* STATION_* */
274 u8 send_null_data; /* Do we have to send NULL data packet ? */
275 u8 retries; /* Number of retires for the initial NULL data packet */
276
277 /*
278 * TUs during which the target stays awake after switching
279 * to power save mode.
280 */
281 u8 hang_over_period;
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300282 __le32 null_data_rate;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000283} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300284
285/* HW encryption keys */
286#define NUM_ACCESS_CATEGORIES_COPY 4
287#define MAX_KEY_SIZE 32
288
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300289enum wl1271_cmd_key_action {
290 KEY_ADD_OR_REPLACE = 1,
291 KEY_REMOVE = 2,
292 KEY_SET_ID = 3,
293 MAX_KEY_ACTION = 0xffff,
294};
295
296enum wl1271_cmd_key_type {
297 KEY_NONE = 0,
298 KEY_WEP = 1,
299 KEY_TKIP = 2,
300 KEY_AES = 3,
Juuso Oikarinen7a557242010-09-27 12:42:07 +0200301 KEY_GEM = 4,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300302};
303
304/* FIXME: Add description for key-types */
305
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200306struct wl1271_cmd_set_sta_keys {
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300307 struct wl1271_cmd_header header;
308
309 /* Ignored for default WEP key */
310 u8 addr[ETH_ALEN];
311
312 /* key_action_e */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300313 __le16 key_action;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300314
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300315 __le16 reserved_1;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300316
317 /* key size in bytes */
318 u8 key_size;
319
320 /* key_type_e */
321 u8 key_type;
322 u8 ssid_profile;
323
324 /*
325 * TKIP, AES: frame's key id field.
326 * For WEP default key: key id;
327 */
328 u8 id;
329 u8 reserved_2[6];
330 u8 key[MAX_KEY_SIZE];
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300331 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
332 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000333} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300334
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200335enum wl1271_cmd_lid_key_type {
336 UNICAST_LID_TYPE = 0,
337 BROADCAST_LID_TYPE = 1,
338 WEP_DEFAULT_LID_TYPE = 2
339};
340
341struct wl1271_cmd_set_ap_keys {
342 struct wl1271_cmd_header header;
343
344 /*
345 * Indicates whether the HLID is a unicast key set
346 * or broadcast key set. A special value 0xFF is
347 * used to indicate that the HLID is on WEP-default
348 * (multi-hlids). of type wl1271_cmd_lid_key_type.
349 */
350 u8 hlid;
351
352 /*
353 * In WEP-default network (hlid == 0xFF) used to
354 * indicate which network STA/IBSS/AP role should be
355 * changed
356 */
357 u8 lid_key_type;
358
359 /*
360 * Key ID - For TKIP and AES key types, this field
361 * indicates the value that should be inserted into
362 * the KeyID field of frames transmitted using this
363 * key entry. For broadcast keys the index use as a
364 * marker for TX/RX key.
365 * For WEP default network (HLID=0xFF), this field
366 * indicates the ID of the key to add or remove.
367 */
368 u8 key_id;
369 u8 reserved_1;
370
371 /* key_action_e */
372 __le16 key_action;
373
374 /* key size in bytes */
375 u8 key_size;
376
377 /* key_type_e */
378 u8 key_type;
379
380 /* This field holds the security key data to add to the STA table */
381 u8 key[MAX_KEY_SIZE];
382 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
383 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
384} __packed;
385
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300386struct wl1271_cmd_test_header {
387 u8 id;
388 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000389} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300390
391enum wl1271_channel_tune_bands {
392 WL1271_CHANNEL_TUNE_BAND_2_4,
393 WL1271_CHANNEL_TUNE_BAND_5,
394 WL1271_CHANNEL_TUNE_BAND_4_9
395};
396
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200397#define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300398
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200399#define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
400#define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
401#define TEST_CMD_INI_FILE_RF_EXTENDED_PARAM 0x26
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200402
403struct wl1271_general_parms_cmd {
404 struct wl1271_cmd_header header;
405
406 struct wl1271_cmd_test_header test;
407
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300408 struct wl1271_ini_general_params general_params;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200409
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300410 u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
411 u8 sr_sen_n_p;
412 u8 sr_sen_n_p_gain;
413 u8 sr_sen_nrn;
414 u8 sr_sen_prn;
415 u8 padding[3];
David S. Miller14599f12010-06-11 11:34:06 -0700416} __packed;
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200417
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200418struct wl1271_radio_parms_cmd {
419 struct wl1271_cmd_header header;
420
421 struct wl1271_cmd_test_header test;
422
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300423 /* Static radio parameters */
424 struct wl1271_ini_band_params_2 static_params_2;
425 struct wl1271_ini_band_params_5 static_params_5;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200426
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300427 /* Dynamic radio parameters */
428 struct wl1271_ini_fem_params_2 dyn_params_2;
429 u8 padding2;
430 struct wl1271_ini_fem_params_5 dyn_params_5;
431 u8 padding3[2];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000432} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300433
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200434struct wl1271_ext_radio_parms_cmd {
435 struct wl1271_cmd_header header;
436
437 struct wl1271_cmd_test_header test;
438
439 u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
440 u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
441 u8 padding[3];
442} __packed;
443
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300444/*
445 * There are three types of disconnections:
446 *
447 * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
448 * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
449 * we have passed
450 * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
451 * we have passed
452 */
453enum wl1271_disconnect_type {
454 DISCONNECT_IMMEDIATE,
455 DISCONNECT_DEAUTH,
456 DISCONNECT_DISASSOC
457};
458
459struct wl1271_cmd_disconnect {
Luciano Coelho1ed95382010-04-01 11:38:18 +0300460 struct wl1271_cmd_header header;
461
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300462 __le32 rx_config_options;
463 __le32 rx_filter_options;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300464
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300465 __le16 reason;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300466 u8 type;
467
468 u8 padding;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000469} __packed;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300470
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300471#define WL1271_CMD_STA_STATE_CONNECTED 1
472
473struct wl1271_cmd_set_sta_state {
474 struct wl1271_cmd_header header;
475
476 u8 state;
477 u8 padding[3];
Luciano Coelho5082b822010-10-05 14:58:49 +0300478} __packed;
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300479
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200480enum wl1271_ssid_type {
481 SSID_TYPE_PUBLIC = 0,
482 SSID_TYPE_HIDDEN = 1
483};
484
485struct wl1271_cmd_bss_start {
486 struct wl1271_cmd_header header;
487
488 /* wl1271_ssid_type */
489 u8 ssid_type;
490 u8 ssid_len;
491 u8 ssid[IW_ESSID_MAX_SIZE];
492 u8 padding_1[2];
493
494 /* Basic rate set */
495 __le32 basic_rate_set;
496 /* Aging period in seconds*/
497 __le16 aging_period;
498
499 /*
500 * This field specifies the time between target beacon
501 * transmission times (TBTTs), in time units (TUs).
502 * Valid values are 1 to 1024.
503 */
504 __le16 beacon_interval;
505 u8 bssid[ETH_ALEN];
506 u8 bss_index;
507 /* Radio band */
508 u8 band;
509 u8 channel;
510 /* The host link id for the AP's global queue */
511 u8 global_hlid;
512 /* The host link id for the AP's broadcast queue */
513 u8 broadcast_hlid;
514 /* DTIM count */
515 u8 dtim_interval;
516 /* Beacon expiry time in ms */
517 u8 beacon_expiry;
518 u8 padding_2[3];
519} __packed;
520
521struct wl1271_cmd_add_sta {
522 struct wl1271_cmd_header header;
523
524 u8 addr[ETH_ALEN];
525 u8 hlid;
526 u8 aid;
527 u8 psd_type[NUM_ACCESS_CATEGORIES_COPY];
528 __le32 supported_rates;
529 u8 bss_index;
530 u8 sp_len;
531 u8 wmm;
532 u8 padding1;
533} __packed;
534
535struct wl1271_cmd_remove_sta {
536 struct wl1271_cmd_header header;
537
538 u8 hlid;
539 u8 reason_opcode;
540 u8 send_deauth_flag;
541 u8 padding1;
542} __packed;
543
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300544#endif /* __WL1271_CMD_H__ */