blob: 1f7037292c15785b50e033f75d2ede5cad77adb4 [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);
Shahar Levi49d750ca2011-03-06 16:32:09 +020035int wl128x_cmd_general_parms(struct wl1271 *wl);
Luciano Coelho98b5dd52009-11-23 23:22:17 +020036int wl1271_cmd_radio_parms(struct wl1271 *wl);
Shahar Levi49d750ca2011-03-06 16:32:09 +020037int wl128x_cmd_radio_parms(struct wl1271 *wl);
Juuso Oikarinen644a4862010-10-05 13:11:56 +020038int wl1271_cmd_ext_radio_parms(struct wl1271 *wl);
Juuso Oikarinen15305492010-02-22 08:38:32 +020039int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030040int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
41int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
42int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
Luciano Coelho94210892009-12-11 15:40:55 +020043int wl1271_cmd_data_path(struct wl1271 *wl, bool enable);
Eliad Pellerc8bde242011-02-02 09:59:35 +020044int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode);
Juuso Oikarinen65cddbf2010-08-24 06:28:03 +030045int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
46 size_t len);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030047int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
Juuso Oikarinen606c1482010-04-01 11:38:21 +030048 void *buf, size_t buf_len, int index, u32 rates);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030049int wl1271_cmd_build_null_data(struct wl1271 *wl);
50int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
Kalle Valo818e3062010-03-18 12:26:35 +020051int wl1271_cmd_build_probe_req(struct wl1271 *wl,
52 const u8 *ssid, size_t ssid_len,
53 const u8 *ie, size_t ie_len, u8 band);
Juuso Oikarinen2f6724b2010-11-24 08:16:57 +020054struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
55 struct sk_buff *skb);
Eliad Pellerc5312772010-12-09 11:31:27 +020056int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr);
Kalle Valo023e0822010-03-18 12:26:36 +020057int wl1271_build_qos_null_data(struct wl1271 *wl);
Juuso Oikarinenbfb24c92010-03-26 12:53:31 +020058int wl1271_cmd_build_klv_null_data(struct wl1271 *wl);
Arik Nemtsov98bdaab2010-10-16 18:08:58 +020059int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id);
60int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id);
61int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
62 u8 key_size, const u8 *key, const u8 *addr,
63 u32 tx_seq_32, u16 tx_seq_16);
64int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
65 u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32,
66 u16 tx_seq_16);
Luciano Coelho25a7dc62009-10-12 15:08:42 +030067int wl1271_cmd_disconnect(struct wl1271 *wl);
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +030068int wl1271_cmd_set_sta_state(struct wl1271 *wl);
Arik Nemtsov98bdaab2010-10-16 18:08:58 +020069int wl1271_cmd_start_bss(struct wl1271 *wl);
70int wl1271_cmd_stop_bss(struct wl1271 *wl);
71int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid);
72int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid);
Ido Yariv95dac04f2011-06-06 14:57:06 +030073int wl12xx_cmd_config_fwlog(struct wl1271 *wl);
74int wl12xx_cmd_start_fwlog(struct wl1271 *wl);
75int wl12xx_cmd_stop_fwlog(struct wl1271 *wl);
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030076
77enum wl1271_commands {
78 CMD_INTERROGATE = 1, /*use this to read information elements*/
79 CMD_CONFIGURE = 2, /*use this to write information elements*/
80 CMD_ENABLE_RX = 3,
81 CMD_ENABLE_TX = 4,
82 CMD_DISABLE_RX = 5,
83 CMD_DISABLE_TX = 6,
84 CMD_SCAN = 8,
85 CMD_STOP_SCAN = 9,
86 CMD_START_JOIN = 11,
87 CMD_SET_KEYS = 12,
88 CMD_READ_MEMORY = 13,
89 CMD_WRITE_MEMORY = 14,
90 CMD_SET_TEMPLATE = 19,
91 CMD_TEST = 23,
92 CMD_NOISE_HIST = 28,
93 CMD_LNA_CONTROL = 32,
94 CMD_SET_BCN_MODE = 33,
95 CMD_MEASUREMENT = 34,
96 CMD_STOP_MEASUREMENT = 35,
97 CMD_DISCONNECT = 36,
98 CMD_SET_PS_MODE = 37,
99 CMD_CHANNEL_SWITCH = 38,
100 CMD_STOP_CHANNEL_SWICTH = 39,
101 CMD_AP_DISCOVERY = 40,
102 CMD_STOP_AP_DISCOVERY = 41,
103 CMD_SPS_SCAN = 42,
104 CMD_STOP_SPS_SCAN = 43,
105 CMD_HEALTH_CHECK = 45,
106 CMD_DEBUG = 46,
107 CMD_TRIGGER_SCAN_TO = 47,
108 CMD_CONNECTION_SCAN_CFG = 48,
109 CMD_CONNECTION_SCAN_SSID_CFG = 49,
110 CMD_START_PERIODIC_SCAN = 50,
111 CMD_STOP_PERIODIC_SCAN = 51,
112 CMD_SET_STA_STATE = 52,
Ido Yariv95dac04f2011-06-06 14:57:06 +0300113 CMD_CONFIG_FWLOGGER = 53,
114 CMD_START_FWLOGGER = 54,
115 CMD_STOP_FWLOGGER = 55,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300116
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200117 /* AP mode commands */
118 CMD_BSS_START = 60,
119 CMD_BSS_STOP = 61,
120 CMD_ADD_STA = 62,
121 CMD_REMOVE_STA = 63,
122
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300123 NUM_COMMANDS,
124 MAX_COMMAND_ID = 0xFFFF,
125};
126
127#define MAX_CMD_PARAMS 572
128
Juuso Oikarinenbfb24c92010-03-26 12:53:31 +0200129enum {
130 CMD_TEMPL_KLV_IDX_NULL_DATA = 0,
131 CMD_TEMPL_KLV_IDX_MAX = 4
132};
133
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300134enum cmd_templ {
135 CMD_TEMPL_NULL_DATA = 0,
136 CMD_TEMPL_BEACON,
137 CMD_TEMPL_CFG_PROBE_REQ_2_4,
138 CMD_TEMPL_CFG_PROBE_REQ_5,
139 CMD_TEMPL_PROBE_RESPONSE,
140 CMD_TEMPL_QOS_NULL_DATA,
141 CMD_TEMPL_PS_POLL,
142 CMD_TEMPL_KLV,
143 CMD_TEMPL_DISCONNECT,
144 CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */
145 CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */
146 CMD_TEMPL_BAR, /* for firmware internal use only */
147 CMD_TEMPL_CTS, /*
148 * For CTS-to-self (FastCTS) mechanism
149 * for BT/WLAN coexistence (SoftGemini). */
Eliad Pellerc5312772010-12-09 11:31:27 +0200150 CMD_TEMPL_ARP_RSP,
Eliad Pellerc8bde242011-02-02 09:59:35 +0200151 CMD_TEMPL_LINK_MEASUREMENT_REPORT,
Arik Nemtsove0fe3712010-10-16 18:19:53 +0200152
153 /* AP-mode specific */
154 CMD_TEMPL_AP_BEACON = 13,
155 CMD_TEMPL_AP_PROBE_RESPONSE,
156 CMD_TEMPL_AP_ARP_RSP,
157 CMD_TEMPL_DEAUTH_AP,
158
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300159 CMD_TEMPL_MAX = 0xff
160};
161
162/* unit ms */
163#define WL1271_COMMAND_TIMEOUT 2000
164#define WL1271_CMD_TEMPL_MAX_SIZE 252
Teemu Paasikivi0cbb1032010-05-07 11:39:01 +0300165#define WL1271_EVENT_TIMEOUT 750
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300166
167struct wl1271_cmd_header {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300168 __le16 id;
169 __le16 status;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300170 /* payload */
171 u8 data[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000172} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300173
174#define WL1271_CMD_MAX_PARAMS 572
175
176struct wl1271_command {
177 struct wl1271_cmd_header header;
178 u8 parameters[WL1271_CMD_MAX_PARAMS];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000179} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300180
181enum {
182 CMD_MAILBOX_IDLE = 0,
183 CMD_STATUS_SUCCESS = 1,
184 CMD_STATUS_UNKNOWN_CMD = 2,
185 CMD_STATUS_UNKNOWN_IE = 3,
186 CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11,
187 CMD_STATUS_RX_BUSY = 13,
188 CMD_STATUS_INVALID_PARAM = 14,
189 CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
190 CMD_STATUS_OUT_OF_MEMORY = 16,
191 CMD_STATUS_STA_TABLE_FULL = 17,
192 CMD_STATUS_RADIO_ERROR = 18,
193 CMD_STATUS_WRONG_NESTING = 19,
194 CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/
195 CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/
196 MAX_COMMAND_STATUS = 0xff
197};
198
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300199#define CMDMBOX_HEADER_LEN 4
200#define CMDMBOX_INFO_ELEM_HEADER_LEN 4
201
202enum {
203 BSS_TYPE_IBSS = 0,
204 BSS_TYPE_STA_BSS = 2,
205 BSS_TYPE_AP_BSS = 3,
206 MAX_BSS_TYPE = 0xFF
207};
208
209#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
210#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
Teemu Paasikivia4102642009-10-13 12:47:51 +0300211#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300212
213struct wl1271_cmd_join {
214 struct wl1271_cmd_header header;
215
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300216 __le32 bssid_lsb;
217 __le16 bssid_msb;
218 __le16 beacon_interval; /* in TBTTs */
219 __le32 rx_config_options;
220 __le32 rx_filter_options;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300221
222 /*
223 * The target uses this field to determine the rate at
224 * which to transmit control frame responses (such as
225 * ACK or CTS frames).
226 */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300227 __le32 basic_rate_set;
Eliad Pellerc8bde242011-02-02 09:59:35 +0200228 __le32 supported_rate_set;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300229 u8 dtim_interval;
230 /*
231 * bits 0-2: This bitwise field specifies the type
232 * of BSS to start or join (BSS_TYPE_*).
233 * bit 4: Band - The radio band in which to join
234 * or start.
235 * 0 - 2.4GHz band
236 * 1 - 5GHz band
237 * bits 3, 5-7: Reserved
238 */
239 u8 bss_type;
240 u8 channel;
241 u8 ssid_len;
242 u8 ssid[IW_ESSID_MAX_SIZE];
243 u8 ctrl; /* JOIN_CMD_CTRL_* */
244 u8 reserved[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000245} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300246
247struct cmd_enabledisable_path {
248 struct wl1271_cmd_header header;
249
250 u8 channel;
251 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000252} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300253
Juuso Oikarinen606c1482010-04-01 11:38:21 +0300254#define WL1271_RATE_AUTOMATIC 0
255
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300256struct wl1271_cmd_template_set {
257 struct wl1271_cmd_header header;
258
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300259 __le16 len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300260 u8 template_type;
261 u8 index; /* relevant only for KLV_TEMPLATE type */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300262 __le32 enabled_rates;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300263 u8 short_retry_limit;
264 u8 long_retry_limit;
265 u8 aflags;
266 u8 reserved;
267 u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000268} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300269
270#define TIM_ELE_ID 5
271#define PARTIAL_VBM_MAX 251
272
273struct wl1271_tim {
274 u8 identity;
275 u8 length;
276 u8 dtim_count;
277 u8 dtim_period;
278 u8 bitmap_ctrl;
279 u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000280} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300281
282enum wl1271_cmd_ps_mode {
283 STATION_ACTIVE_MODE,
284 STATION_POWER_SAVE_MODE
285};
286
287struct wl1271_cmd_ps_params {
288 struct wl1271_cmd_header header;
289
290 u8 ps_mode; /* STATION_* */
Eliad Pellerc8bde242011-02-02 09:59:35 +0200291 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000292} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300293
294/* HW encryption keys */
295#define NUM_ACCESS_CATEGORIES_COPY 4
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300296
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300297enum wl1271_cmd_key_action {
298 KEY_ADD_OR_REPLACE = 1,
299 KEY_REMOVE = 2,
300 KEY_SET_ID = 3,
301 MAX_KEY_ACTION = 0xffff,
302};
303
304enum wl1271_cmd_key_type {
305 KEY_NONE = 0,
306 KEY_WEP = 1,
307 KEY_TKIP = 2,
308 KEY_AES = 3,
Juuso Oikarinen7a557242010-09-27 12:42:07 +0200309 KEY_GEM = 4,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300310};
311
312/* FIXME: Add description for key-types */
313
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200314struct wl1271_cmd_set_sta_keys {
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300315 struct wl1271_cmd_header header;
316
317 /* Ignored for default WEP key */
318 u8 addr[ETH_ALEN];
319
320 /* key_action_e */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300321 __le16 key_action;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300322
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300323 __le16 reserved_1;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300324
325 /* key size in bytes */
326 u8 key_size;
327
328 /* key_type_e */
329 u8 key_type;
330 u8 ssid_profile;
331
332 /*
333 * TKIP, AES: frame's key id field.
334 * For WEP default key: key id;
335 */
336 u8 id;
337 u8 reserved_2[6];
338 u8 key[MAX_KEY_SIZE];
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300339 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
340 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000341} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300342
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200343enum wl1271_cmd_lid_key_type {
344 UNICAST_LID_TYPE = 0,
345 BROADCAST_LID_TYPE = 1,
346 WEP_DEFAULT_LID_TYPE = 2
347};
348
349struct wl1271_cmd_set_ap_keys {
350 struct wl1271_cmd_header header;
351
352 /*
353 * Indicates whether the HLID is a unicast key set
354 * or broadcast key set. A special value 0xFF is
355 * used to indicate that the HLID is on WEP-default
356 * (multi-hlids). of type wl1271_cmd_lid_key_type.
357 */
358 u8 hlid;
359
360 /*
361 * In WEP-default network (hlid == 0xFF) used to
362 * indicate which network STA/IBSS/AP role should be
363 * changed
364 */
365 u8 lid_key_type;
366
367 /*
368 * Key ID - For TKIP and AES key types, this field
369 * indicates the value that should be inserted into
370 * the KeyID field of frames transmitted using this
371 * key entry. For broadcast keys the index use as a
372 * marker for TX/RX key.
373 * For WEP default network (HLID=0xFF), this field
374 * indicates the ID of the key to add or remove.
375 */
376 u8 key_id;
377 u8 reserved_1;
378
379 /* key_action_e */
380 __le16 key_action;
381
382 /* key size in bytes */
383 u8 key_size;
384
385 /* key_type_e */
386 u8 key_type;
387
388 /* This field holds the security key data to add to the STA table */
389 u8 key[MAX_KEY_SIZE];
390 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
391 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
392} __packed;
393
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300394struct wl1271_cmd_test_header {
395 u8 id;
396 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000397} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300398
399enum wl1271_channel_tune_bands {
400 WL1271_CHANNEL_TUNE_BAND_2_4,
401 WL1271_CHANNEL_TUNE_BAND_5,
402 WL1271_CHANNEL_TUNE_BAND_4_9
403};
404
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200405#define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300406
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200407#define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
408#define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
409#define TEST_CMD_INI_FILE_RF_EXTENDED_PARAM 0x26
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200410
411struct wl1271_general_parms_cmd {
412 struct wl1271_cmd_header header;
413
414 struct wl1271_cmd_test_header test;
415
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300416 struct wl1271_ini_general_params general_params;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200417
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300418 u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
419 u8 sr_sen_n_p;
420 u8 sr_sen_n_p_gain;
421 u8 sr_sen_nrn;
422 u8 sr_sen_prn;
423 u8 padding[3];
David S. Miller14599f12010-06-11 11:34:06 -0700424} __packed;
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200425
Shahar Levi49d750ca2011-03-06 16:32:09 +0200426struct wl128x_general_parms_cmd {
427 struct wl1271_cmd_header header;
428
429 struct wl1271_cmd_test_header test;
430
431 struct wl128x_ini_general_params general_params;
432
433 u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
434 u8 sr_sen_n_p;
435 u8 sr_sen_n_p_gain;
436 u8 sr_sen_nrn;
437 u8 sr_sen_prn;
438 u8 padding[3];
439} __packed;
440
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200441struct wl1271_radio_parms_cmd {
442 struct wl1271_cmd_header header;
443
444 struct wl1271_cmd_test_header test;
445
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300446 /* Static radio parameters */
447 struct wl1271_ini_band_params_2 static_params_2;
448 struct wl1271_ini_band_params_5 static_params_5;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200449
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300450 /* Dynamic radio parameters */
451 struct wl1271_ini_fem_params_2 dyn_params_2;
452 u8 padding2;
453 struct wl1271_ini_fem_params_5 dyn_params_5;
454 u8 padding3[2];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000455} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300456
Shahar Levi49d750ca2011-03-06 16:32:09 +0200457struct wl128x_radio_parms_cmd {
458 struct wl1271_cmd_header header;
459
460 struct wl1271_cmd_test_header test;
461
462 /* Static radio parameters */
463 struct wl128x_ini_band_params_2 static_params_2;
464 struct wl128x_ini_band_params_5 static_params_5;
465
466 u8 fem_vendor_and_options;
467
468 /* Dynamic radio parameters */
469 struct wl128x_ini_fem_params_2 dyn_params_2;
470 u8 padding2;
471 struct wl128x_ini_fem_params_5 dyn_params_5;
472} __packed;
473
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200474struct wl1271_ext_radio_parms_cmd {
475 struct wl1271_cmd_header header;
476
477 struct wl1271_cmd_test_header test;
478
479 u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
480 u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
481 u8 padding[3];
482} __packed;
483
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300484/*
485 * There are three types of disconnections:
486 *
487 * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
488 * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
489 * we have passed
490 * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
491 * we have passed
492 */
493enum wl1271_disconnect_type {
494 DISCONNECT_IMMEDIATE,
495 DISCONNECT_DEAUTH,
496 DISCONNECT_DISASSOC
497};
498
499struct wl1271_cmd_disconnect {
Luciano Coelho1ed95382010-04-01 11:38:18 +0300500 struct wl1271_cmd_header header;
501
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300502 __le32 rx_config_options;
503 __le32 rx_filter_options;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300504
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300505 __le16 reason;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300506 u8 type;
507
508 u8 padding;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000509} __packed;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300510
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300511#define WL1271_CMD_STA_STATE_CONNECTED 1
512
513struct wl1271_cmd_set_sta_state {
514 struct wl1271_cmd_header header;
515
516 u8 state;
517 u8 padding[3];
Luciano Coelho5082b822010-10-05 14:58:49 +0300518} __packed;
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300519
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200520enum wl1271_ssid_type {
521 SSID_TYPE_PUBLIC = 0,
522 SSID_TYPE_HIDDEN = 1
523};
524
525struct wl1271_cmd_bss_start {
526 struct wl1271_cmd_header header;
527
528 /* wl1271_ssid_type */
529 u8 ssid_type;
530 u8 ssid_len;
531 u8 ssid[IW_ESSID_MAX_SIZE];
532 u8 padding_1[2];
533
534 /* Basic rate set */
535 __le32 basic_rate_set;
536 /* Aging period in seconds*/
537 __le16 aging_period;
538
539 /*
540 * This field specifies the time between target beacon
541 * transmission times (TBTTs), in time units (TUs).
542 * Valid values are 1 to 1024.
543 */
544 __le16 beacon_interval;
545 u8 bssid[ETH_ALEN];
546 u8 bss_index;
547 /* Radio band */
548 u8 band;
549 u8 channel;
550 /* The host link id for the AP's global queue */
551 u8 global_hlid;
552 /* The host link id for the AP's broadcast queue */
553 u8 broadcast_hlid;
554 /* DTIM count */
555 u8 dtim_interval;
556 /* Beacon expiry time in ms */
557 u8 beacon_expiry;
558 u8 padding_2[3];
559} __packed;
560
561struct wl1271_cmd_add_sta {
562 struct wl1271_cmd_header header;
563
564 u8 addr[ETH_ALEN];
565 u8 hlid;
566 u8 aid;
567 u8 psd_type[NUM_ACCESS_CATEGORIES_COPY];
568 __le32 supported_rates;
569 u8 bss_index;
570 u8 sp_len;
571 u8 wmm;
572 u8 padding1;
573} __packed;
574
575struct wl1271_cmd_remove_sta {
576 struct wl1271_cmd_header header;
577
578 u8 hlid;
579 u8 reason_opcode;
580 u8 send_deauth_flag;
581 u8 padding1;
582} __packed;
583
Ido Yariv95dac04f2011-06-06 14:57:06 +0300584/*
585 * Continuous mode - packets are transferred to the host periodically
586 * via the data path.
587 * On demand - Log messages are stored in a cyclic buffer in the
588 * firmware, and only transferred to the host when explicitly requested
589 */
590enum wl12xx_fwlogger_log_mode {
591 WL12XX_FWLOG_CONTINUOUS,
592 WL12XX_FWLOG_ON_DEMAND
593};
594
595/* Include/exclude timestamps from the log messages */
596enum wl12xx_fwlogger_timestamp {
597 WL12XX_FWLOG_TIMESTAMP_DISABLED,
598 WL12XX_FWLOG_TIMESTAMP_ENABLED
599};
600
601/*
602 * Logs can be routed to the debug pinouts (where available), to the host bus
603 * (SDIO/SPI), or dropped
604 */
605enum wl12xx_fwlogger_output {
606 WL12XX_FWLOG_OUTPUT_NONE,
607 WL12XX_FWLOG_OUTPUT_DBG_PINS,
608 WL12XX_FWLOG_OUTPUT_HOST,
609};
610
611struct wl12xx_cmd_config_fwlog {
612 struct wl1271_cmd_header header;
613
614 /* See enum wl12xx_fwlogger_log_mode */
615 u8 logger_mode;
616
617 /* Minimum log level threshold */
618 u8 log_severity;
619
620 /* Include/exclude timestamps from the log messages */
621 u8 timestamp;
622
623 /* See enum wl1271_fwlogger_output */
624 u8 output;
625
626 /* Regulates the frequency of log messages */
627 u8 threshold;
628
629 u8 padding[3];
630} __packed;
631
632struct wl12xx_cmd_start_fwlog {
633 struct wl1271_cmd_header header;
634} __packed;
635
636struct wl12xx_cmd_stop_fwlog {
637 struct wl1271_cmd_header header;
638} __packed;
639
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300640#endif /* __WL1271_CMD_H__ */