blob: c9909e09cd9d464941589925f365f48d136a3a2c [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,
Arik Nemtsove0fe3712010-10-16 18:19:53 +0200143
144 /* AP-mode specific */
145 CMD_TEMPL_AP_BEACON = 13,
146 CMD_TEMPL_AP_PROBE_RESPONSE,
147 CMD_TEMPL_AP_ARP_RSP,
148 CMD_TEMPL_DEAUTH_AP,
149
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300150 CMD_TEMPL_MAX = 0xff
151};
152
153/* unit ms */
154#define WL1271_COMMAND_TIMEOUT 2000
155#define WL1271_CMD_TEMPL_MAX_SIZE 252
Teemu Paasikivi0cbb1032010-05-07 11:39:01 +0300156#define WL1271_EVENT_TIMEOUT 750
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300157
158struct wl1271_cmd_header {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300159 __le16 id;
160 __le16 status;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300161 /* payload */
162 u8 data[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000163} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300164
165#define WL1271_CMD_MAX_PARAMS 572
166
167struct wl1271_command {
168 struct wl1271_cmd_header header;
169 u8 parameters[WL1271_CMD_MAX_PARAMS];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000170} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300171
172enum {
173 CMD_MAILBOX_IDLE = 0,
174 CMD_STATUS_SUCCESS = 1,
175 CMD_STATUS_UNKNOWN_CMD = 2,
176 CMD_STATUS_UNKNOWN_IE = 3,
177 CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11,
178 CMD_STATUS_RX_BUSY = 13,
179 CMD_STATUS_INVALID_PARAM = 14,
180 CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
181 CMD_STATUS_OUT_OF_MEMORY = 16,
182 CMD_STATUS_STA_TABLE_FULL = 17,
183 CMD_STATUS_RADIO_ERROR = 18,
184 CMD_STATUS_WRONG_NESTING = 19,
185 CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/
186 CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/
187 MAX_COMMAND_STATUS = 0xff
188};
189
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300190#define CMDMBOX_HEADER_LEN 4
191#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
192
193enum {
194 BSS_TYPE_IBSS = 0,
195 BSS_TYPE_STA_BSS = 2,
196 BSS_TYPE_AP_BSS = 3,
197 MAX_BSS_TYPE = 0xFF
198};
199
200#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
201#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
Teemu Paasikivia4102642009-10-13 12:47:51 +0300202#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300203
204struct wl1271_cmd_join {
205 struct wl1271_cmd_header header;
206
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300207 __le32 bssid_lsb;
208 __le16 bssid_msb;
209 __le16 beacon_interval; /* in TBTTs */
210 __le32 rx_config_options;
211 __le32 rx_filter_options;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300212
213 /*
214 * The target uses this field to determine the rate at
215 * which to transmit control frame responses (such as
216 * ACK or CTS frames).
217 */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300218 __le32 basic_rate_set;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300219 u8 dtim_interval;
220 /*
221 * bits 0-2: This bitwise field specifies the type
222 * of BSS to start or join (BSS_TYPE_*).
223 * bit 4: Band - The radio band in which to join
224 * or start.
225 * 0 - 2.4GHz band
226 * 1 - 5GHz band
227 * bits 3, 5-7: Reserved
228 */
229 u8 bss_type;
230 u8 channel;
231 u8 ssid_len;
232 u8 ssid[IW_ESSID_MAX_SIZE];
233 u8 ctrl; /* JOIN_CMD_CTRL_* */
234 u8 reserved[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000235} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300236
237struct cmd_enabledisable_path {
238 struct wl1271_cmd_header header;
239
240 u8 channel;
241 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000242} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300243
Juuso Oikarinen606c1482010-04-01 11:38:21 +0300244#define WL1271_RATE_AUTOMATIC 0
245
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300246struct wl1271_cmd_template_set {
247 struct wl1271_cmd_header header;
248
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300249 __le16 len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300250 u8 template_type;
251 u8 index; /* relevant only for KLV_TEMPLATE type */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300252 __le32 enabled_rates;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300253 u8 short_retry_limit;
254 u8 long_retry_limit;
255 u8 aflags;
256 u8 reserved;
257 u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000258} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300259
260#define TIM_ELE_ID 5
261#define PARTIAL_VBM_MAX 251
262
263struct wl1271_tim {
264 u8 identity;
265 u8 length;
266 u8 dtim_count;
267 u8 dtim_period;
268 u8 bitmap_ctrl;
269 u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000270} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300271
272enum wl1271_cmd_ps_mode {
273 STATION_ACTIVE_MODE,
274 STATION_POWER_SAVE_MODE
275};
276
277struct wl1271_cmd_ps_params {
278 struct wl1271_cmd_header header;
279
280 u8 ps_mode; /* STATION_* */
281 u8 send_null_data; /* Do we have to send NULL data packet ? */
282 u8 retries; /* Number of retires for the initial NULL data packet */
283
284 /*
285 * TUs during which the target stays awake after switching
286 * to power save mode.
287 */
288 u8 hang_over_period;
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300289 __le32 null_data_rate;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000290} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300291
292/* HW encryption keys */
293#define NUM_ACCESS_CATEGORIES_COPY 4
294#define MAX_KEY_SIZE 32
295
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300296enum wl1271_cmd_key_action {
297 KEY_ADD_OR_REPLACE = 1,
298 KEY_REMOVE = 2,
299 KEY_SET_ID = 3,
300 MAX_KEY_ACTION = 0xffff,
301};
302
303enum wl1271_cmd_key_type {
304 KEY_NONE = 0,
305 KEY_WEP = 1,
306 KEY_TKIP = 2,
307 KEY_AES = 3,
Juuso Oikarinen7a557242010-09-27 12:42:07 +0200308 KEY_GEM = 4,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300309};
310
311/* FIXME: Add description for key-types */
312
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200313struct wl1271_cmd_set_sta_keys {
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300314 struct wl1271_cmd_header header;
315
316 /* Ignored for default WEP key */
317 u8 addr[ETH_ALEN];
318
319 /* key_action_e */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300320 __le16 key_action;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300321
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300322 __le16 reserved_1;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300323
324 /* key size in bytes */
325 u8 key_size;
326
327 /* key_type_e */
328 u8 key_type;
329 u8 ssid_profile;
330
331 /*
332 * TKIP, AES: frame's key id field.
333 * For WEP default key: key id;
334 */
335 u8 id;
336 u8 reserved_2[6];
337 u8 key[MAX_KEY_SIZE];
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300338 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
339 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000340} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300341
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200342enum wl1271_cmd_lid_key_type {
343 UNICAST_LID_TYPE = 0,
344 BROADCAST_LID_TYPE = 1,
345 WEP_DEFAULT_LID_TYPE = 2
346};
347
348struct wl1271_cmd_set_ap_keys {
349 struct wl1271_cmd_header header;
350
351 /*
352 * Indicates whether the HLID is a unicast key set
353 * or broadcast key set. A special value 0xFF is
354 * used to indicate that the HLID is on WEP-default
355 * (multi-hlids). of type wl1271_cmd_lid_key_type.
356 */
357 u8 hlid;
358
359 /*
360 * In WEP-default network (hlid == 0xFF) used to
361 * indicate which network STA/IBSS/AP role should be
362 * changed
363 */
364 u8 lid_key_type;
365
366 /*
367 * Key ID - For TKIP and AES key types, this field
368 * indicates the value that should be inserted into
369 * the KeyID field of frames transmitted using this
370 * key entry. For broadcast keys the index use as a
371 * marker for TX/RX key.
372 * For WEP default network (HLID=0xFF), this field
373 * indicates the ID of the key to add or remove.
374 */
375 u8 key_id;
376 u8 reserved_1;
377
378 /* key_action_e */
379 __le16 key_action;
380
381 /* key size in bytes */
382 u8 key_size;
383
384 /* key_type_e */
385 u8 key_type;
386
387 /* This field holds the security key data to add to the STA table */
388 u8 key[MAX_KEY_SIZE];
389 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
390 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
391} __packed;
392
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300393struct wl1271_cmd_test_header {
394 u8 id;
395 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000396} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300397
398enum wl1271_channel_tune_bands {
399 WL1271_CHANNEL_TUNE_BAND_2_4,
400 WL1271_CHANNEL_TUNE_BAND_5,
401 WL1271_CHANNEL_TUNE_BAND_4_9
402};
403
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200404#define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300405
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200406#define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
407#define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
408#define TEST_CMD_INI_FILE_RF_EXTENDED_PARAM 0x26
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200409
410struct wl1271_general_parms_cmd {
411 struct wl1271_cmd_header header;
412
413 struct wl1271_cmd_test_header test;
414
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300415 struct wl1271_ini_general_params general_params;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200416
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300417 u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
418 u8 sr_sen_n_p;
419 u8 sr_sen_n_p_gain;
420 u8 sr_sen_nrn;
421 u8 sr_sen_prn;
422 u8 padding[3];
David S. Miller14599f12010-06-11 11:34:06 -0700423} __packed;
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200424
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200425struct wl1271_radio_parms_cmd {
426 struct wl1271_cmd_header header;
427
428 struct wl1271_cmd_test_header test;
429
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300430 /* Static radio parameters */
431 struct wl1271_ini_band_params_2 static_params_2;
432 struct wl1271_ini_band_params_5 static_params_5;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200433
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300434 /* Dynamic radio parameters */
435 struct wl1271_ini_fem_params_2 dyn_params_2;
436 u8 padding2;
437 struct wl1271_ini_fem_params_5 dyn_params_5;
438 u8 padding3[2];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000439} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300440
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200441struct wl1271_ext_radio_parms_cmd {
442 struct wl1271_cmd_header header;
443
444 struct wl1271_cmd_test_header test;
445
446 u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
447 u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
448 u8 padding[3];
449} __packed;
450
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300451/*
452 * There are three types of disconnections:
453 *
454 * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
455 * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
456 * we have passed
457 * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
458 * we have passed
459 */
460enum wl1271_disconnect_type {
461 DISCONNECT_IMMEDIATE,
462 DISCONNECT_DEAUTH,
463 DISCONNECT_DISASSOC
464};
465
466struct wl1271_cmd_disconnect {
Luciano Coelho1ed95382010-04-01 11:38:18 +0300467 struct wl1271_cmd_header header;
468
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300469 __le32 rx_config_options;
470 __le32 rx_filter_options;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300471
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300472 __le16 reason;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300473 u8 type;
474
475 u8 padding;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000476} __packed;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300477
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300478#define WL1271_CMD_STA_STATE_CONNECTED 1
479
480struct wl1271_cmd_set_sta_state {
481 struct wl1271_cmd_header header;
482
483 u8 state;
484 u8 padding[3];
Luciano Coelho5082b822010-10-05 14:58:49 +0300485} __packed;
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300486
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200487enum wl1271_ssid_type {
488 SSID_TYPE_PUBLIC = 0,
489 SSID_TYPE_HIDDEN = 1
490};
491
492struct wl1271_cmd_bss_start {
493 struct wl1271_cmd_header header;
494
495 /* wl1271_ssid_type */
496 u8 ssid_type;
497 u8 ssid_len;
498 u8 ssid[IW_ESSID_MAX_SIZE];
499 u8 padding_1[2];
500
501 /* Basic rate set */
502 __le32 basic_rate_set;
503 /* Aging period in seconds*/
504 __le16 aging_period;
505
506 /*
507 * This field specifies the time between target beacon
508 * transmission times (TBTTs), in time units (TUs).
509 * Valid values are 1 to 1024.
510 */
511 __le16 beacon_interval;
512 u8 bssid[ETH_ALEN];
513 u8 bss_index;
514 /* Radio band */
515 u8 band;
516 u8 channel;
517 /* The host link id for the AP's global queue */
518 u8 global_hlid;
519 /* The host link id for the AP's broadcast queue */
520 u8 broadcast_hlid;
521 /* DTIM count */
522 u8 dtim_interval;
523 /* Beacon expiry time in ms */
524 u8 beacon_expiry;
525 u8 padding_2[3];
526} __packed;
527
528struct wl1271_cmd_add_sta {
529 struct wl1271_cmd_header header;
530
531 u8 addr[ETH_ALEN];
532 u8 hlid;
533 u8 aid;
534 u8 psd_type[NUM_ACCESS_CATEGORIES_COPY];
535 __le32 supported_rates;
536 u8 bss_index;
537 u8 sp_len;
538 u8 wmm;
539 u8 padding1;
540} __packed;
541
542struct wl1271_cmd_remove_sta {
543 struct wl1271_cmd_header header;
544
545 u8 hlid;
546 u8 reason_opcode;
547 u8 send_deauth_flag;
548 u8 padding1;
549} __packed;
550
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300551#endif /* __WL1271_CMD_H__ */