blob: 75128141400612d59af471f01a6bdde5a92f3924 [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
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300294
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300295enum wl1271_cmd_key_action {
296 KEY_ADD_OR_REPLACE = 1,
297 KEY_REMOVE = 2,
298 KEY_SET_ID = 3,
299 MAX_KEY_ACTION = 0xffff,
300};
301
302enum wl1271_cmd_key_type {
303 KEY_NONE = 0,
304 KEY_WEP = 1,
305 KEY_TKIP = 2,
306 KEY_AES = 3,
Juuso Oikarinen7a557242010-09-27 12:42:07 +0200307 KEY_GEM = 4,
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300308};
309
310/* FIXME: Add description for key-types */
311
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200312struct wl1271_cmd_set_sta_keys {
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300313 struct wl1271_cmd_header header;
314
315 /* Ignored for default WEP key */
316 u8 addr[ETH_ALEN];
317
318 /* key_action_e */
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300319 __le16 key_action;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300320
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300321 __le16 reserved_1;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300322
323 /* key size in bytes */
324 u8 key_size;
325
326 /* key_type_e */
327 u8 key_type;
328 u8 ssid_profile;
329
330 /*
331 * TKIP, AES: frame's key id field.
332 * For WEP default key: key id;
333 */
334 u8 id;
335 u8 reserved_2[6];
336 u8 key[MAX_KEY_SIZE];
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300337 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
338 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000339} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300340
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200341enum wl1271_cmd_lid_key_type {
342 UNICAST_LID_TYPE = 0,
343 BROADCAST_LID_TYPE = 1,
344 WEP_DEFAULT_LID_TYPE = 2
345};
346
347struct wl1271_cmd_set_ap_keys {
348 struct wl1271_cmd_header header;
349
350 /*
351 * Indicates whether the HLID is a unicast key set
352 * or broadcast key set. A special value 0xFF is
353 * used to indicate that the HLID is on WEP-default
354 * (multi-hlids). of type wl1271_cmd_lid_key_type.
355 */
356 u8 hlid;
357
358 /*
359 * In WEP-default network (hlid == 0xFF) used to
360 * indicate which network STA/IBSS/AP role should be
361 * changed
362 */
363 u8 lid_key_type;
364
365 /*
366 * Key ID - For TKIP and AES key types, this field
367 * indicates the value that should be inserted into
368 * the KeyID field of frames transmitted using this
369 * key entry. For broadcast keys the index use as a
370 * marker for TX/RX key.
371 * For WEP default network (HLID=0xFF), this field
372 * indicates the ID of the key to add or remove.
373 */
374 u8 key_id;
375 u8 reserved_1;
376
377 /* key_action_e */
378 __le16 key_action;
379
380 /* key size in bytes */
381 u8 key_size;
382
383 /* key_type_e */
384 u8 key_type;
385
386 /* This field holds the security key data to add to the STA table */
387 u8 key[MAX_KEY_SIZE];
388 __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
389 __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
390} __packed;
391
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300392struct wl1271_cmd_test_header {
393 u8 id;
394 u8 padding[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000395} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300396
397enum wl1271_channel_tune_bands {
398 WL1271_CHANNEL_TUNE_BAND_2_4,
399 WL1271_CHANNEL_TUNE_BAND_5,
400 WL1271_CHANNEL_TUNE_BAND_4_9
401};
402
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200403#define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300404
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200405#define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
406#define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
407#define TEST_CMD_INI_FILE_RF_EXTENDED_PARAM 0x26
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200408
409struct wl1271_general_parms_cmd {
410 struct wl1271_cmd_header header;
411
412 struct wl1271_cmd_test_header test;
413
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300414 struct wl1271_ini_general_params general_params;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200415
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300416 u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
417 u8 sr_sen_n_p;
418 u8 sr_sen_n_p_gain;
419 u8 sr_sen_nrn;
420 u8 sr_sen_prn;
421 u8 padding[3];
David S. Miller14599f12010-06-11 11:34:06 -0700422} __packed;
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200423
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200424struct wl1271_radio_parms_cmd {
425 struct wl1271_cmd_header header;
426
427 struct wl1271_cmd_test_header test;
428
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300429 /* Static radio parameters */
430 struct wl1271_ini_band_params_2 static_params_2;
431 struct wl1271_ini_band_params_5 static_params_5;
Luciano Coelho98b5dd52009-11-23 23:22:17 +0200432
Juuso Oikarineneb70eb72010-05-14 10:46:22 +0300433 /* Dynamic radio parameters */
434 struct wl1271_ini_fem_params_2 dyn_params_2;
435 u8 padding2;
436 struct wl1271_ini_fem_params_5 dyn_params_5;
437 u8 padding3[2];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000438} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300439
Juuso Oikarinen644a4862010-10-05 13:11:56 +0200440struct wl1271_ext_radio_parms_cmd {
441 struct wl1271_cmd_header header;
442
443 struct wl1271_cmd_test_header test;
444
445 u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
446 u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
447 u8 padding[3];
448} __packed;
449
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300450/*
451 * There are three types of disconnections:
452 *
453 * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
454 * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
455 * we have passed
456 * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
457 * we have passed
458 */
459enum wl1271_disconnect_type {
460 DISCONNECT_IMMEDIATE,
461 DISCONNECT_DEAUTH,
462 DISCONNECT_DISASSOC
463};
464
465struct wl1271_cmd_disconnect {
Luciano Coelho1ed95382010-04-01 11:38:18 +0300466 struct wl1271_cmd_header header;
467
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300468 __le32 rx_config_options;
469 __le32 rx_filter_options;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300470
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300471 __le16 reason;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300472 u8 type;
473
474 u8 padding;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000475} __packed;
Luciano Coelho25a7dc62009-10-12 15:08:42 +0300476
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300477#define WL1271_CMD_STA_STATE_CONNECTED 1
478
479struct wl1271_cmd_set_sta_state {
480 struct wl1271_cmd_header header;
481
482 u8 state;
483 u8 padding[3];
Luciano Coelho5082b822010-10-05 14:58:49 +0300484} __packed;
Juuso Oikarinenbe86cbe2010-05-27 12:53:01 +0300485
Arik Nemtsov98bdaab2010-10-16 18:08:58 +0200486enum wl1271_ssid_type {
487 SSID_TYPE_PUBLIC = 0,
488 SSID_TYPE_HIDDEN = 1
489};
490
491struct wl1271_cmd_bss_start {
492 struct wl1271_cmd_header header;
493
494 /* wl1271_ssid_type */
495 u8 ssid_type;
496 u8 ssid_len;
497 u8 ssid[IW_ESSID_MAX_SIZE];
498 u8 padding_1[2];
499
500 /* Basic rate set */
501 __le32 basic_rate_set;
502 /* Aging period in seconds*/
503 __le16 aging_period;
504
505 /*
506 * This field specifies the time between target beacon
507 * transmission times (TBTTs), in time units (TUs).
508 * Valid values are 1 to 1024.
509 */
510 __le16 beacon_interval;
511 u8 bssid[ETH_ALEN];
512 u8 bss_index;
513 /* Radio band */
514 u8 band;
515 u8 channel;
516 /* The host link id for the AP's global queue */
517 u8 global_hlid;
518 /* The host link id for the AP's broadcast queue */
519 u8 broadcast_hlid;
520 /* DTIM count */
521 u8 dtim_interval;
522 /* Beacon expiry time in ms */
523 u8 beacon_expiry;
524 u8 padding_2[3];
525} __packed;
526
527struct wl1271_cmd_add_sta {
528 struct wl1271_cmd_header header;
529
530 u8 addr[ETH_ALEN];
531 u8 hlid;
532 u8 aid;
533 u8 psd_type[NUM_ACCESS_CATEGORIES_COPY];
534 __le32 supported_rates;
535 u8 bss_index;
536 u8 sp_len;
537 u8 wmm;
538 u8 padding1;
539} __packed;
540
541struct wl1271_cmd_remove_sta {
542 struct wl1271_cmd_header header;
543
544 u8 hlid;
545 u8 reason_opcode;
546 u8 send_deauth_flag;
547 u8 padding1;
548} __packed;
549
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300550#endif /* __WL1271_CMD_H__ */