blob: de23c08738a0ee90caa645232030dac0591dcf5e [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
25#ifndef __WL1271_CMD_H__
26#define __WL1271_CMD_H__
27
28#include "wl1271.h"
29
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 Oikarinend94cd292009-10-08 21:56:25 +030036int wl1271_cmd_join(struct wl1271 *wl);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030037int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
38int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
39int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
40int wl1271_cmd_data_path(struct wl1271 *wl, u8 channel, bool enable);
41int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode);
42int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
43 size_t len);
44int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +030045 u8 active_scan, u8 high_prio, u8 band,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030046 u8 probe_requests);
47int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
48 void *buf, size_t buf_len);
49int wl1271_cmd_build_null_data(struct wl1271 *wl);
50int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +030051int wl1271_cmd_build_probe_req(struct wl1271 *wl, u8 *ssid, size_t ssid_len,
52 u8 band);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030053int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id);
54int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
Juuso Oikarinenac4e4ce2009-10-08 21:56:19 +030055 u8 key_size, const u8 *key, const u8 *addr,
56 u32 tx_seq_32, u16 tx_seq_16);
Luciano Coelho25a7dc62009-10-12 15:08:42 +030057int wl1271_cmd_disconnect(struct wl1271 *wl);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030058
59enum wl1271_commands {
60 CMD_INTERROGATE = 1, /*use this to read information elements*/
61 CMD_CONFIGURE = 2, /*use this to write information elements*/
62 CMD_ENABLE_RX = 3,
63 CMD_ENABLE_TX = 4,
64 CMD_DISABLE_RX = 5,
65 CMD_DISABLE_TX = 6,
66 CMD_SCAN = 8,
67 CMD_STOP_SCAN = 9,
68 CMD_START_JOIN = 11,
69 CMD_SET_KEYS = 12,
70 CMD_READ_MEMORY = 13,
71 CMD_WRITE_MEMORY = 14,
72 CMD_SET_TEMPLATE = 19,
73 CMD_TEST = 23,
74 CMD_NOISE_HIST = 28,
75 CMD_LNA_CONTROL = 32,
76 CMD_SET_BCN_MODE = 33,
77 CMD_MEASUREMENT = 34,
78 CMD_STOP_MEASUREMENT = 35,
79 CMD_DISCONNECT = 36,
80 CMD_SET_PS_MODE = 37,
81 CMD_CHANNEL_SWITCH = 38,
82 CMD_STOP_CHANNEL_SWICTH = 39,
83 CMD_AP_DISCOVERY = 40,
84 CMD_STOP_AP_DISCOVERY = 41,
85 CMD_SPS_SCAN = 42,
86 CMD_STOP_SPS_SCAN = 43,
87 CMD_HEALTH_CHECK = 45,
88 CMD_DEBUG = 46,
89 CMD_TRIGGER_SCAN_TO = 47,
90 CMD_CONNECTION_SCAN_CFG = 48,
91 CMD_CONNECTION_SCAN_SSID_CFG = 49,
92 CMD_START_PERIODIC_SCAN = 50,
93 CMD_STOP_PERIODIC_SCAN = 51,
94 CMD_SET_STA_STATE = 52,
95
96 NUM_COMMANDS,
97 MAX_COMMAND_ID = 0xFFFF,
98};
99
100#define MAX_CMD_PARAMS 572
101
102enum cmd_templ {
103 CMD_TEMPL_NULL_DATA = 0,
104 CMD_TEMPL_BEACON,
105 CMD_TEMPL_CFG_PROBE_REQ_2_4,
106 CMD_TEMPL_CFG_PROBE_REQ_5,
107 CMD_TEMPL_PROBE_RESPONSE,
108 CMD_TEMPL_QOS_NULL_DATA,
109 CMD_TEMPL_PS_POLL,
110 CMD_TEMPL_KLV,
111 CMD_TEMPL_DISCONNECT,
112 CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */
113 CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */
114 CMD_TEMPL_BAR, /* for firmware internal use only */
115 CMD_TEMPL_CTS, /*
116 * For CTS-to-self (FastCTS) mechanism
117 * for BT/WLAN coexistence (SoftGemini). */
118 CMD_TEMPL_MAX = 0xff
119};
120
121/* unit ms */
122#define WL1271_COMMAND_TIMEOUT 2000
123#define WL1271_CMD_TEMPL_MAX_SIZE 252
124
125struct wl1271_cmd_header {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300126 __le16 id;
127 __le16 status;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300128 /* payload */
129 u8 data[0];
130} __attribute__ ((packed));
131
132#define WL1271_CMD_MAX_PARAMS 572
133
134struct wl1271_command {
135 struct wl1271_cmd_header header;
136 u8 parameters[WL1271_CMD_MAX_PARAMS];
137} __attribute__ ((packed));
138
139enum {
140 CMD_MAILBOX_IDLE = 0,
141 CMD_STATUS_SUCCESS = 1,
142 CMD_STATUS_UNKNOWN_CMD = 2,
143 CMD_STATUS_UNKNOWN_IE = 3,
144 CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11,
145 CMD_STATUS_RX_BUSY = 13,
146 CMD_STATUS_INVALID_PARAM = 14,
147 CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
148 CMD_STATUS_OUT_OF_MEMORY = 16,
149 CMD_STATUS_STA_TABLE_FULL = 17,
150 CMD_STATUS_RADIO_ERROR = 18,
151 CMD_STATUS_WRONG_NESTING = 19,
152 CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/
153 CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/
154 MAX_COMMAND_STATUS = 0xff
155};
156
157
158/*
159 * CMD_READ_MEMORY
160 *
161 * The host issues this command to read the WiLink device memory/registers.
162 *
163 * Note: The Base Band address has special handling (16 bits registers and
164 * addresses). For more information, see the hardware specification.
165 */
166/*
167 * CMD_WRITE_MEMORY
168 *
169 * The host issues this command to write the WiLink device memory/registers.
170 *
171 * The Base Band address has special handling (16 bits registers and
172 * addresses). For more information, see the hardware specification.
173 */
174#define MAX_READ_SIZE 256
175
176struct cmd_read_write_memory {
177 struct wl1271_cmd_header header;
178
179 /* The address of the memory to read from or write to.*/
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300180 __le32 addr;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300181
182 /* The amount of data in bytes to read from or write to the WiLink
183 * device.*/
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300184 __le32 size;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300185
186 /* The actual value read from or written to the Wilink. The source
187 of this field is the Host in WRITE command or the Wilink in READ
188 command. */
189 u8 value[MAX_READ_SIZE];
Luciano Coelhofb46f262009-10-15 10:33:30 +0300190} __attribute__ ((packed));
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300191
192#define CMDMBOX_HEADER_LEN 4
193#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
194
195enum {
196 BSS_TYPE_IBSS = 0,
197 BSS_TYPE_STA_BSS = 2,
198 BSS_TYPE_AP_BSS = 3,
199 MAX_BSS_TYPE = 0xFF
200};
201
202#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
203#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
Teemu Paasikivia4102642009-10-13 12:47:51 +0300204#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300205
206struct wl1271_cmd_join {
207 struct wl1271_cmd_header header;
208
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300209 __le32 bssid_lsb;
210 __le16 bssid_msb;
211 __le16 beacon_interval; /* in TBTTs */
212 __le32 rx_config_options;
213 __le32 rx_filter_options;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300214
215 /*
216 * The target uses this field to determine the rate at
217 * which to transmit control frame responses (such as
218 * ACK or CTS frames).
219 */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300220 __le32 basic_rate_set;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300221 u8 dtim_interval;
222 /*
223 * bits 0-2: This bitwise field specifies the type
224 * of BSS to start or join (BSS_TYPE_*).
225 * bit 4: Band - The radio band in which to join
226 * or start.
227 * 0 - 2.4GHz band
228 * 1 - 5GHz band
229 * bits 3, 5-7: Reserved
230 */
231 u8 bss_type;
232 u8 channel;
233 u8 ssid_len;
234 u8 ssid[IW_ESSID_MAX_SIZE];
235 u8 ctrl; /* JOIN_CMD_CTRL_* */
236 u8 reserved[3];
237} __attribute__ ((packed));
238
239struct cmd_enabledisable_path {
240 struct wl1271_cmd_header header;
241
242 u8 channel;
243 u8 padding[3];
244} __attribute__ ((packed));
245
246struct 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];
258} __attribute__ ((packed));
259
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 */
270} __attribute__ ((packed));
271
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;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300290} __attribute__ ((packed));
291
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,
308 KEY_GEM = 4
309};
310
311/* FIXME: Add description for key-types */
312
313struct wl1271_cmd_set_keys {
314 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];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300340} __attribute__ ((packed));
341
342
343#define WL1271_SCAN_MAX_CHANNELS 24
344#define WL1271_SCAN_DEFAULT_TAG 1
345#define WL1271_SCAN_CURRENT_TX_PWR 0
346#define WL1271_SCAN_OPT_ACTIVE 0
347#define WL1271_SCAN_OPT_PASSIVE 1
348#define WL1271_SCAN_OPT_PRIORITY_HIGH 4
349#define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */
350#define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300351#define WL1271_SCAN_BAND_2_4_GHZ 0
352#define WL1271_SCAN_BAND_5_GHZ 1
353#define WL1271_SCAN_BAND_DUAL 2
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300354
355struct basic_scan_params {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300356 __le32 rx_config_options;
357 __le32 rx_filter_options;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300358 /* Scan option flags (WL1271_SCAN_OPT_*) */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300359 __le16 scan_options;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300360 /* Number of scan channels in the list (maximum 30) */
361 u8 num_channels;
362 /* This field indicates the number of probe requests to send
363 per channel for an active scan */
364 u8 num_probe_requests;
365 /* Rate bit field for sending the probes */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300366 __le32 tx_rate;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300367 u8 tid_trigger;
368 u8 ssid_len;
369 /* in order to align */
370 u8 padding1[2];
371 u8 ssid[IW_ESSID_MAX_SIZE];
372 /* Band to scan */
373 u8 band;
374 u8 use_ssid_list;
375 u8 scan_tag;
376 u8 padding2;
377} __attribute__ ((packed));
378
379struct basic_scan_channel_params {
380 /* Duration in TU to wait for frames on a channel for active scan */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300381 __le32 min_duration;
382 __le32 max_duration;
383 __le32 bssid_lsb;
384 __le16 bssid_msb;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300385 u8 early_termination;
386 u8 tx_power_att;
387 u8 channel;
388 /* FW internal use only! */
389 u8 dfs_candidate;
390 u8 activity_detected;
391 u8 pad;
392} __attribute__ ((packed));
393
394struct wl1271_cmd_scan {
395 struct wl1271_cmd_header header;
396
397 struct basic_scan_params params;
398 struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];
399} __attribute__ ((packed));
400
401struct wl1271_cmd_trigger_scan_to {
402 struct wl1271_cmd_header header;
403
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300404 __le32 timeout;
Luciano Coelhofb46f262009-10-15 10:33:30 +0300405} __attribute__ ((packed));
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300406
407struct wl1271_cmd_test_header {
408 u8 id;
409 u8 padding[3];
Luciano Coelhofb46f262009-10-15 10:33:30 +0300410} __attribute__ ((packed));
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300411
412enum wl1271_channel_tune_bands {
413 WL1271_CHANNEL_TUNE_BAND_2_4,
414 WL1271_CHANNEL_TUNE_BAND_5,
415 WL1271_CHANNEL_TUNE_BAND_4_9
416};
417
418#define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
419
420#define TEST_CMD_P2G_CAL 0x02
421#define TEST_CMD_CHANNEL_TUNE 0x0d
422#define TEST_CMD_UPDATE_PD_REFERENCE_POINT 0x1d
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200423#define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
424#define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
425
426struct wl1271_general_parms_cmd {
427 struct wl1271_cmd_header header;
428
429 struct wl1271_cmd_test_header test;
430
431 u8 ref_clk;
432 u8 settling_time;
433 u8 clk_valid_on_wakeup;
434 u8 dc2dcmode;
435 u8 single_dual_band;
436
437 u8 tx_bip_fem_autodetect;
438 u8 tx_bip_fem_manufacturer;
439 u8 settings;
440} __attribute__ ((packed));
441
442struct wl1271_radio_parms_cmd {
443 struct wl1271_cmd_header header;
444
445 struct wl1271_cmd_test_header test;
446
447 /* Static radio parameters */
448 /* 2.4GHz */
449 u8 rx_trace_loss;
450 u8 tx_trace_loss;
451 s8 rx_rssi_and_proc_compens[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
452
453 /* 5GHz */
454 u8 rx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
455 u8 tx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
456 s8 rx_rssi_and_proc_compens_5[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
457
458 /* Dynamic radio parameters */
459 /* 2.4GHz */
460 __le16 tx_ref_pd_voltage;
Luciano Coelho937a67e2009-12-11 15:40:40 +0200461 u8 tx_ref_power;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200462 s8 tx_offset_db;
463
464 s8 tx_rate_limits_normal[CONF_NUMBER_OF_RATE_GROUPS];
465 s8 tx_rate_limits_degraded[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelho937a67e2009-12-11 15:40:40 +0200466 s8 tx_rate_limits_extreme[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200467
468 s8 tx_channel_limits_11b[CONF_NUMBER_OF_CHANNELS_2_4];
469 s8 tx_channel_limits_ofdm[CONF_NUMBER_OF_CHANNELS_2_4];
470 s8 tx_pdv_rate_offsets[CONF_NUMBER_OF_RATE_GROUPS];
471
472 u8 tx_ibias[CONF_NUMBER_OF_RATE_GROUPS];
473 u8 rx_fem_insertion_loss;
474
Luciano Coelho937a67e2009-12-11 15:40:40 +0200475 u8 degraded_low_to_normal_threshold;
476 u8 degraded_normal_to_high_threshold;
477
478 u8 padding1; /* our own padding, not in ref driver */
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200479
480 /* 5GHz */
481 __le16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
Luciano Coelho937a67e2009-12-11 15:40:40 +0200482 u8 tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5];
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200483 s8 tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5];
484
485 s8 tx_rate_limits_normal_5[CONF_NUMBER_OF_RATE_GROUPS];
486 s8 tx_rate_limits_degraded_5[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelho937a67e2009-12-11 15:40:40 +0200487 s8 tx_rate_limits_extreme_5[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200488
489 s8 tx_channel_limits_ofdm_5[CONF_NUMBER_OF_CHANNELS_5];
490 s8 tx_pdv_rate_offsets_5[CONF_NUMBER_OF_RATE_GROUPS];
491
492 /* FIXME: this is inconsistent with the types for 2.4GHz */
493 s8 tx_ibias_5[CONF_NUMBER_OF_RATE_GROUPS];
494 s8 rx_fem_insertion_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
495
Luciano Coelho937a67e2009-12-11 15:40:40 +0200496 u8 degraded_low_to_normal_threshold_5;
497 u8 degraded_normal_to_high_threshold_5;
498
499 u8 padding2[2];
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200500} __attribute__ ((packed));
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300501
502struct wl1271_cmd_cal_channel_tune {
503 struct wl1271_cmd_header header;
504
505 struct wl1271_cmd_test_header test;
506
507 u8 band;
508 u8 channel;
509
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300510 __le16 radio_status;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300511} __attribute__ ((packed));
512
513struct wl1271_cmd_cal_update_ref_point {
514 struct wl1271_cmd_header header;
515
516 struct wl1271_cmd_test_header test;
517
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300518 __le32 ref_power;
519 __le32 ref_detector;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300520 u8 sub_band;
521 u8 padding[3];
522} __attribute__ ((packed));
523
524#define MAX_TLV_LENGTH 400
525#define MAX_NVS_VERSION_LENGTH 12
526
527#define WL1271_CAL_P2G_BAND_B_G BIT(0)
528
529struct wl1271_cmd_cal_p2g {
530 struct wl1271_cmd_header header;
531
532 struct wl1271_cmd_test_header test;
533
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300534 __le16 len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300535 u8 buf[MAX_TLV_LENGTH];
536 u8 type;
537 u8 padding;
538
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300539 __le16 radio_status;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300540 u8 nvs_version[MAX_NVS_VERSION_LENGTH];
541
542 u8 sub_band_mask;
543 u8 padding2;
544} __attribute__ ((packed));
545
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300546
547/*
548 * There are three types of disconnections:
549 *
550 * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
551 * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
552 * we have passed
553 * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
554 * we have passed
555 */
556enum wl1271_disconnect_type {
557 DISCONNECT_IMMEDIATE,
558 DISCONNECT_DEAUTH,
559 DISCONNECT_DISASSOC
560};
561
562struct wl1271_cmd_disconnect {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300563 __le32 rx_config_options;
564 __le32 rx_filter_options;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300565
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300566 __le16 reason;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300567 u8 type;
568
569 u8 padding;
570} __attribute__ ((packed));
571
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300572#endif /* __WL1271_CMD_H__ */