blob: 3bd5d3b6037ab8ac0cb09a14ed8d1c1b13c29c0a [file] [log] [blame]
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02001/**
Holger Schurig9e66e702009-10-16 17:32:16 +02002 * This file function prototypes, data structure
3 * and definitions for all the host/station commands
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02004 */
5
Holger Schurig10078322007-11-15 18:05:47 -05006#ifndef _LBS_HOST_H_
7#define _LBS_HOST_H_
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02008
Holger Schurigf4228b42009-10-22 15:30:46 +02009#include "types.h"
10#include "defs.h"
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020011
Holger Schurig9e66e702009-10-16 17:32:16 +020012#define DEFAULT_AD_HOC_CHANNEL 6
13
14#define CMD_OPTION_WAITFORRSP 0x0002
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020015
Holger Schurig6b63cd02007-08-02 11:53:36 -040016/** Host command IDs */
17
18/* Return command are almost always the same as the host command, but with
19 * bit 15 set high. There are a few exceptions, though...
20 */
Holger Schurig9e66e702009-10-16 17:32:16 +020021#define CMD_RET(cmd) (0x8000 | cmd)
Holger Schurig6b63cd02007-08-02 11:53:36 -040022
23/* Return command convention exceptions: */
Holger Schurig9e66e702009-10-16 17:32:16 +020024#define CMD_RET_802_11_ASSOCIATE 0x8012
Holger Schurig6b63cd02007-08-02 11:53:36 -040025
26/* Command codes */
Holger Schurig9e66e702009-10-16 17:32:16 +020027#define CMD_GET_HW_SPEC 0x0003
28#define CMD_EEPROM_UPDATE 0x0004
29#define CMD_802_11_RESET 0x0005
30#define CMD_802_11_SCAN 0x0006
31#define CMD_802_11_GET_LOG 0x000b
32#define CMD_MAC_MULTICAST_ADR 0x0010
33#define CMD_802_11_AUTHENTICATE 0x0011
34#define CMD_802_11_EEPROM_ACCESS 0x0059
35#define CMD_802_11_ASSOCIATE 0x0050
36#define CMD_802_11_SET_WEP 0x0013
37#define CMD_802_11_GET_STAT 0x0014
38#define CMD_802_3_GET_STAT 0x0015
39#define CMD_802_11_SNMP_MIB 0x0016
40#define CMD_MAC_REG_MAP 0x0017
41#define CMD_BBP_REG_MAP 0x0018
42#define CMD_MAC_REG_ACCESS 0x0019
43#define CMD_BBP_REG_ACCESS 0x001a
44#define CMD_RF_REG_ACCESS 0x001b
45#define CMD_802_11_RADIO_CONTROL 0x001c
46#define CMD_802_11_RF_CHANNEL 0x001d
47#define CMD_802_11_RF_TX_POWER 0x001e
48#define CMD_802_11_RSSI 0x001f
49#define CMD_802_11_RF_ANTENNA 0x0020
50#define CMD_802_11_PS_MODE 0x0021
51#define CMD_802_11_DATA_RATE 0x0022
52#define CMD_RF_REG_MAP 0x0023
53#define CMD_802_11_DEAUTHENTICATE 0x0024
54#define CMD_802_11_REASSOCIATE 0x0025
55#define CMD_MAC_CONTROL 0x0028
56#define CMD_802_11_AD_HOC_START 0x002b
57#define CMD_802_11_AD_HOC_JOIN 0x002c
58#define CMD_802_11_QUERY_TKIP_REPLY_CNTRS 0x002e
59#define CMD_802_11_ENABLE_RSN 0x002f
60#define CMD_802_11_SET_AFC 0x003c
61#define CMD_802_11_GET_AFC 0x003d
62#define CMD_802_11_DEEP_SLEEP 0x003e
63#define CMD_802_11_AD_HOC_STOP 0x0040
64#define CMD_802_11_HOST_SLEEP_CFG 0x0043
65#define CMD_802_11_WAKEUP_CONFIRM 0x0044
66#define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045
67#define CMD_802_11_BEACON_STOP 0x0049
68#define CMD_802_11_MAC_ADDRESS 0x004d
69#define CMD_802_11_LED_GPIO_CTRL 0x004e
70#define CMD_802_11_EEPROM_ACCESS 0x0059
71#define CMD_802_11_BAND_CONFIG 0x0058
72#define CMD_GSPI_BUS_CONFIG 0x005a
73#define CMD_802_11D_DOMAIN_INFO 0x005b
74#define CMD_802_11_KEY_MATERIAL 0x005e
75#define CMD_802_11_SLEEP_PARAMS 0x0066
76#define CMD_802_11_INACTIVITY_TIMEOUT 0x0067
77#define CMD_802_11_SLEEP_PERIOD 0x0068
78#define CMD_802_11_TPC_CFG 0x0072
79#define CMD_802_11_PA_CFG 0x0073
80#define CMD_802_11_FW_WAKE_METHOD 0x0074
81#define CMD_802_11_SUBSCRIBE_EVENT 0x0075
82#define CMD_802_11_RATE_ADAPT_RATESET 0x0076
83#define CMD_802_11_TX_RATE_QUERY 0x007f
84#define CMD_GET_TSF 0x0080
85#define CMD_BT_ACCESS 0x0087
86#define CMD_FWT_ACCESS 0x0095
87#define CMD_802_11_MONITOR_MODE 0x0098
88#define CMD_MESH_ACCESS 0x009b
89#define CMD_MESH_CONFIG_OLD 0x00a3
90#define CMD_MESH_CONFIG 0x00ac
91#define CMD_SET_BOOT2_VER 0x00a5
92#define CMD_FUNC_INIT 0x00a9
93#define CMD_FUNC_SHUTDOWN 0x00aa
94#define CMD_802_11_BEACON_CTRL 0x00b0
Brajesh Dave96287ac2007-11-20 17:44:28 -050095
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020096/* For the IEEE Power Save */
Holger Schurig9e66e702009-10-16 17:32:16 +020097#define CMD_SUBCMD_ENTER_PS 0x0030
98#define CMD_SUBCMD_EXIT_PS 0x0031
99#define CMD_SUBCMD_SLEEP_CONFIRMED 0x0034
100#define CMD_SUBCMD_FULL_POWERDOWN 0x0035
101#define CMD_SUBCMD_FULL_POWERUP 0x0036
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200102
Holger Schurig9e66e702009-10-16 17:32:16 +0200103#define CMD_ENABLE_RSN 0x0001
104#define CMD_DISABLE_RSN 0x0000
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200105
Holger Schurig9e66e702009-10-16 17:32:16 +0200106#define CMD_ACT_GET 0x0000
107#define CMD_ACT_SET 0x0001
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200108
Dan Williams0aef64d2007-08-02 11:31:18 -0400109/* Define action or option for CMD_802_11_SET_WEP */
Holger Schurig9e66e702009-10-16 17:32:16 +0200110#define CMD_ACT_ADD 0x0002
111#define CMD_ACT_REMOVE 0x0004
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200112
Holger Schurig9e66e702009-10-16 17:32:16 +0200113#define CMD_TYPE_WEP_40_BIT 0x01
114#define CMD_TYPE_WEP_104_BIT 0x02
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200115
Holger Schurig9e66e702009-10-16 17:32:16 +0200116#define CMD_NUM_OF_WEP_KEYS 4
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200117
Holger Schurig9e66e702009-10-16 17:32:16 +0200118#define CMD_WEP_KEY_INDEX_MASK 0x3fff
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200119
Dan Williams0aef64d2007-08-02 11:31:18 -0400120/* Define action or option for CMD_802_11_SCAN */
Holger Schurig9e66e702009-10-16 17:32:16 +0200121#define CMD_BSS_TYPE_BSS 0x0001
122#define CMD_BSS_TYPE_IBSS 0x0002
123#define CMD_BSS_TYPE_ANY 0x0003
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200124
Dan Williams0aef64d2007-08-02 11:31:18 -0400125/* Define action or option for CMD_802_11_SCAN */
Holger Schurig9e66e702009-10-16 17:32:16 +0200126#define CMD_SCAN_TYPE_ACTIVE 0x0000
127#define CMD_SCAN_TYPE_PASSIVE 0x0001
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200128
Holger Schurig9e66e702009-10-16 17:32:16 +0200129#define CMD_SCAN_RADIO_TYPE_BG 0
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200130
Holger Schurig9e66e702009-10-16 17:32:16 +0200131#define CMD_SCAN_PROBE_DELAY_TIME 0
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200132
Dan Williams0aef64d2007-08-02 11:31:18 -0400133/* Define action or option for CMD_MAC_CONTROL */
Holger Schurig9e66e702009-10-16 17:32:16 +0200134#define CMD_ACT_MAC_RX_ON 0x0001
135#define CMD_ACT_MAC_TX_ON 0x0002
136#define CMD_ACT_MAC_LOOPBACK_ON 0x0004
137#define CMD_ACT_MAC_WEP_ENABLE 0x0008
138#define CMD_ACT_MAC_INT_ENABLE 0x0010
139#define CMD_ACT_MAC_MULTICAST_ENABLE 0x0020
140#define CMD_ACT_MAC_BROADCAST_ENABLE 0x0040
141#define CMD_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
142#define CMD_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
143#define CMD_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200144
Holger Schurig3a188642007-11-26 10:07:14 +0100145/* Event flags for CMD_802_11_SUBSCRIBE_EVENT */
Holger Schurig9e66e702009-10-16 17:32:16 +0200146#define CMD_SUBSCRIBE_RSSI_LOW 0x0001
147#define CMD_SUBSCRIBE_SNR_LOW 0x0002
148#define CMD_SUBSCRIBE_FAILCOUNT 0x0004
149#define CMD_SUBSCRIBE_BCNMISS 0x0008
150#define CMD_SUBSCRIBE_RSSI_HIGH 0x0010
151#define CMD_SUBSCRIBE_SNR_HIGH 0x0020
Holger Schurig3a188642007-11-26 10:07:14 +0100152
Holger Schurig9e66e702009-10-16 17:32:16 +0200153#define RADIO_PREAMBLE_LONG 0x00
154#define RADIO_PREAMBLE_SHORT 0x02
155#define RADIO_PREAMBLE_AUTO 0x04
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200156
157/* Define action or option for CMD_802_11_RF_CHANNEL */
Holger Schurig9e66e702009-10-16 17:32:16 +0200158#define CMD_OPT_802_11_RF_CHANNEL_GET 0x00
159#define CMD_OPT_802_11_RF_CHANNEL_SET 0x01
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200160
Dan Williams0aef64d2007-08-02 11:31:18 -0400161/* Define action or option for CMD_802_11_DATA_RATE */
Holger Schurig9e66e702009-10-16 17:32:16 +0200162#define CMD_ACT_SET_TX_AUTO 0x0000
163#define CMD_ACT_SET_TX_FIX_RATE 0x0001
164#define CMD_ACT_GET_TX_RATE 0x0002
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200165
Dan Williams0aef64d2007-08-02 11:31:18 -0400166/* Define action or option for CMD_802_11_PS_MODE */
Holger Schurig9e66e702009-10-16 17:32:16 +0200167#define CMD_TYPE_CAM 0x0000
168#define CMD_TYPE_MAX_PSP 0x0001
169#define CMD_TYPE_FAST_PSP 0x0002
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200170
David Woodhouseb2c57ee2007-12-17 14:41:13 -0500171/* Options for CMD_802_11_FW_WAKE_METHOD */
Holger Schurig9e66e702009-10-16 17:32:16 +0200172#define CMD_WAKE_METHOD_UNCHANGED 0x0000
173#define CMD_WAKE_METHOD_COMMAND_INT 0x0001
174#define CMD_WAKE_METHOD_GPIO 0x0002
David Woodhouseb2c57ee2007-12-17 14:41:13 -0500175
Dan Williams39fcf7a2008-09-10 12:49:00 -0400176/* Object IDs for CMD_802_11_SNMP_MIB */
Holger Schurig9e66e702009-10-16 17:32:16 +0200177#define SNMP_MIB_OID_BSS_TYPE 0x0000
178#define SNMP_MIB_OID_OP_RATE_SET 0x0001
179#define SNMP_MIB_OID_BEACON_PERIOD 0x0002 /* Reserved on v9+ */
180#define SNMP_MIB_OID_DTIM_PERIOD 0x0003 /* Reserved on v9+ */
181#define SNMP_MIB_OID_ASSOC_TIMEOUT 0x0004 /* Reserved on v9+ */
182#define SNMP_MIB_OID_RTS_THRESHOLD 0x0005
183#define SNMP_MIB_OID_SHORT_RETRY_LIMIT 0x0006
184#define SNMP_MIB_OID_LONG_RETRY_LIMIT 0x0007
185#define SNMP_MIB_OID_FRAG_THRESHOLD 0x0008
186#define SNMP_MIB_OID_11D_ENABLE 0x0009
187#define SNMP_MIB_OID_11H_ENABLE 0x000A
Dan Williams39fcf7a2008-09-10 12:49:00 -0400188
Dan Williams0aef64d2007-08-02 11:31:18 -0400189/* Define action or option for CMD_BT_ACCESS */
Dan Williamsffcae952007-08-02 11:35:46 -0400190enum cmd_bt_access_opts {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200191 /* The bt commands start at 5 instead of 1 because the old dft commands
192 * are mapped to 1-4. These old commands are no longer maintained and
193 * should not be called.
194 */
Dan Williams0aef64d2007-08-02 11:31:18 -0400195 CMD_ACT_BT_ACCESS_ADD = 5,
196 CMD_ACT_BT_ACCESS_DEL,
197 CMD_ACT_BT_ACCESS_LIST,
198 CMD_ACT_BT_ACCESS_RESET,
199 CMD_ACT_BT_ACCESS_SET_INVERT,
200 CMD_ACT_BT_ACCESS_GET_INVERT
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200201};
202
Dan Williams0aef64d2007-08-02 11:31:18 -0400203/* Define action or option for CMD_FWT_ACCESS */
Dan Williamsffcae952007-08-02 11:35:46 -0400204enum cmd_fwt_access_opts {
Dan Williams0aef64d2007-08-02 11:31:18 -0400205 CMD_ACT_FWT_ACCESS_ADD = 1,
206 CMD_ACT_FWT_ACCESS_DEL,
207 CMD_ACT_FWT_ACCESS_LOOKUP,
208 CMD_ACT_FWT_ACCESS_LIST,
Dan Williams79a9a372007-12-11 15:29:10 -0500209 CMD_ACT_FWT_ACCESS_LIST_ROUTE,
210 CMD_ACT_FWT_ACCESS_LIST_NEIGHBOR,
Dan Williams0aef64d2007-08-02 11:31:18 -0400211 CMD_ACT_FWT_ACCESS_RESET,
212 CMD_ACT_FWT_ACCESS_CLEANUP,
213 CMD_ACT_FWT_ACCESS_TIME,
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200214};
215
Anna Neal582c1b52008-10-20 16:46:56 -0700216/* Define action or option for CMD_802_11_HOST_SLEEP_CFG */
217enum cmd_wol_cfg_opts {
218 CMD_ACT_ACTION_NONE = 0,
219 CMD_ACT_SET_WOL_RULE,
220 CMD_ACT_GET_WOL_RULE,
221 CMD_ACT_RESET_WOL_RULE,
222};
223
Dan Williams0aef64d2007-08-02 11:31:18 -0400224/* Define action or option for CMD_MESH_ACCESS */
Dan Williamsffcae952007-08-02 11:35:46 -0400225enum cmd_mesh_access_opts {
Dan Williams0aef64d2007-08-02 11:31:18 -0400226 CMD_ACT_MESH_GET_TTL = 1,
227 CMD_ACT_MESH_SET_TTL,
228 CMD_ACT_MESH_GET_STATS,
229 CMD_ACT_MESH_GET_ANYCAST,
230 CMD_ACT_MESH_SET_ANYCAST,
Dan Williams276c0152007-08-02 11:34:24 -0400231 CMD_ACT_MESH_SET_LINK_COSTS,
232 CMD_ACT_MESH_GET_LINK_COSTS,
233 CMD_ACT_MESH_SET_BCAST_RATE,
234 CMD_ACT_MESH_GET_BCAST_RATE,
235 CMD_ACT_MESH_SET_RREQ_DELAY,
236 CMD_ACT_MESH_GET_RREQ_DELAY,
237 CMD_ACT_MESH_SET_ROUTE_EXP,
238 CMD_ACT_MESH_GET_ROUTE_EXP,
Luis Carlos Coboa9f38d02007-08-02 11:52:29 -0400239 CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
240 CMD_ACT_MESH_GET_AUTOSTART_ENABLED,
Anna Neal6fb53252008-12-09 13:23:45 -0800241 CMD_ACT_MESH_SET_GET_PRB_RSP_LIMIT = 17,
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200242};
243
Javier Cardonaedaea5c2008-05-17 00:55:10 -0700244/* Define actions and types for CMD_MESH_CONFIG */
245enum cmd_mesh_config_actions {
246 CMD_ACT_MESH_CONFIG_STOP = 0,
247 CMD_ACT_MESH_CONFIG_START,
248 CMD_ACT_MESH_CONFIG_SET,
249 CMD_ACT_MESH_CONFIG_GET,
250};
251
252enum cmd_mesh_config_types {
253 CMD_TYPE_MESH_SET_BOOTFLAG = 1,
254 CMD_TYPE_MESH_SET_BOOTTIME,
255 CMD_TYPE_MESH_SET_DEF_CHANNEL,
256 CMD_TYPE_MESH_SET_MESH_IE,
257 CMD_TYPE_MESH_GET_DEFAULTS,
258 CMD_TYPE_MESH_GET_MESH_IE, /* GET_DEFAULTS is superset of GET_MESHIE */
259};
260
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200261/** Card Event definition */
David Woodhouse387a1f02007-12-11 18:53:20 -0500262#define MACREG_INT_CODE_TX_PPA_FREE 0
263#define MACREG_INT_CODE_TX_DMA_DONE 1
264#define MACREG_INT_CODE_LINK_LOST_W_SCAN 2
265#define MACREG_INT_CODE_LINK_LOST_NO_SCAN 3
266#define MACREG_INT_CODE_LINK_SENSED 4
267#define MACREG_INT_CODE_CMD_FINISHED 5
268#define MACREG_INT_CODE_MIB_CHANGED 6
269#define MACREG_INT_CODE_INIT_DONE 7
270#define MACREG_INT_CODE_DEAUTHENTICATED 8
271#define MACREG_INT_CODE_DISASSOCIATED 9
272#define MACREG_INT_CODE_PS_AWAKE 10
273#define MACREG_INT_CODE_PS_SLEEP 11
274#define MACREG_INT_CODE_MIC_ERR_MULTICAST 13
275#define MACREG_INT_CODE_MIC_ERR_UNICAST 14
276#define MACREG_INT_CODE_WM_AWAKE 15
277#define MACREG_INT_CODE_DEEP_SLEEP_AWAKE 16
278#define MACREG_INT_CODE_ADHOC_BCN_LOST 17
279#define MACREG_INT_CODE_HOST_AWAKE 18
280#define MACREG_INT_CODE_STOP_TX 19
281#define MACREG_INT_CODE_START_TX 20
282#define MACREG_INT_CODE_CHANNEL_SWITCH 21
283#define MACREG_INT_CODE_MEASUREMENT_RDY 22
284#define MACREG_INT_CODE_WMM_CHANGE 23
285#define MACREG_INT_CODE_BG_SCAN_REPORT 24
286#define MACREG_INT_CODE_RSSI_LOW 25
287#define MACREG_INT_CODE_SNR_LOW 26
288#define MACREG_INT_CODE_MAX_FAIL 27
289#define MACREG_INT_CODE_RSSI_HIGH 28
290#define MACREG_INT_CODE_SNR_HIGH 29
291#define MACREG_INT_CODE_MESH_AUTO_STARTED 35
292#define MACREG_INT_CODE_FIRMWARE_READY 48
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200293
Holger Schurig9e66e702009-10-16 17:32:16 +0200294
295/* 802.11-related definitions */
296
297/* TxPD descriptor */
298struct txpd {
299 /* union to cope up with later FW revisions */
300 union {
301 /* Current Tx packet status */
302 __le32 tx_status;
303 struct {
304 /* BSS type: client, AP, etc. */
305 u8 bss_type;
306 /* BSS number */
307 u8 bss_num;
308 /* Reserved */
309 __le16 reserved;
310 } bss;
311 } u;
312 /* Tx control */
313 __le32 tx_control;
314 __le32 tx_packet_location;
315 /* Tx packet length */
316 __le16 tx_packet_length;
317 /* First 2 byte of destination MAC address */
318 u8 tx_dest_addr_high[2];
319 /* Last 4 byte of destination MAC address */
320 u8 tx_dest_addr_low[4];
321 /* Pkt Priority */
322 u8 priority;
323 /* Pkt Trasnit Power control */
324 u8 powermgmt;
325 /* Amount of time the packet has been queued (units = 2ms) */
326 u8 pktdelay_2ms;
327 /* reserved */
328 u8 reserved1;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000329} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200330
331/* RxPD Descriptor */
332struct rxpd {
333 /* union to cope up with later FW revisions */
334 union {
335 /* Current Rx packet status */
336 __le16 status;
337 struct {
338 /* BSS type: client, AP, etc. */
339 u8 bss_type;
340 /* BSS number */
341 u8 bss_num;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000342 } __packed bss;
343 } __packed u;
Holger Schurig9e66e702009-10-16 17:32:16 +0200344
345 /* SNR */
346 u8 snr;
347
348 /* Tx control */
349 u8 rx_control;
350
351 /* Pkt length */
352 __le16 pkt_len;
353
354 /* Noise Floor */
355 u8 nf;
356
357 /* Rx Packet Rate */
358 u8 rx_rate;
359
360 /* Pkt addr */
361 __le32 pkt_ptr;
362
363 /* Next Rx RxPD addr */
364 __le32 next_rxpd_ptr;
365
366 /* Pkt Priority */
367 u8 priority;
368 u8 reserved[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000369} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200370
371struct cmd_header {
372 __le16 command;
373 __le16 size;
374 __le16 seqnum;
375 __le16 result;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000376} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200377
Holger Schurig9e66e702009-10-16 17:32:16 +0200378/* Generic structure to hold all key types. */
379struct enc_key {
380 u16 len;
381 u16 flags; /* KEY_INFO_* from defs.h */
382 u16 type; /* KEY_TYPE_* from defs.h */
383 u8 key[32];
384};
385
386/* lbs_offset_value */
387struct lbs_offset_value {
388 u32 offset;
389 u32 value;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000390} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200391
Holger Schurig9e66e702009-10-16 17:32:16 +0200392/*
393 * Define data structure for CMD_GET_HW_SPEC
394 * This structure defines the response for the GET_HW_SPEC command
395 */
396struct cmd_ds_get_hw_spec {
397 struct cmd_header hdr;
398
399 /* HW Interface version number */
400 __le16 hwifversion;
401 /* HW version number */
402 __le16 version;
403 /* Max number of TxPD FW can handle */
404 __le16 nr_txpd;
405 /* Max no of Multicast address */
406 __le16 nr_mcast_adr;
407 /* MAC address */
408 u8 permanentaddr[6];
409
410 /* region Code */
411 __le16 regioncode;
412
413 /* Number of antenna used */
414 __le16 nr_antenna;
415
416 /* FW release number, example 0x01030304 = 2.3.4p1 */
417 __le32 fwrelease;
418
419 /* Base Address of TxPD queue */
420 __le32 wcb_base;
421 /* Read Pointer of RxPd queue */
422 __le32 rxpd_rdptr;
423
424 /* Write Pointer of RxPd queue */
425 __le32 rxpd_wrptr;
426
427 /*FW/HW capability */
428 __le32 fwcapinfo;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000429} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200430
431struct cmd_ds_802_11_subscribe_event {
432 struct cmd_header hdr;
433
434 __le16 action;
435 __le16 events;
436
437 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
438 * number of TLVs. From the v5.1 manual, those TLVs would add up to
439 * 40 bytes. However, future firmware might add additional TLVs, so I
440 * bump this up a bit.
441 */
442 uint8_t tlv[128];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000443} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200444
445/*
446 * This scan handle Country Information IE(802.11d compliant)
447 * Define data structure for CMD_802_11_SCAN
448 */
449struct cmd_ds_802_11_scan {
450 struct cmd_header hdr;
451
452 uint8_t bsstype;
453 uint8_t bssid[ETH_ALEN];
454 uint8_t tlvbuffer[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000455} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200456
457struct cmd_ds_802_11_scan_rsp {
458 struct cmd_header hdr;
459
460 __le16 bssdescriptsize;
461 uint8_t nr_sets;
462 uint8_t bssdesc_and_tlvbuffer[0];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000463} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200464
465struct cmd_ds_802_11_get_log {
466 struct cmd_header hdr;
467
468 __le32 mcasttxframe;
469 __le32 failed;
470 __le32 retry;
471 __le32 multiretry;
472 __le32 framedup;
473 __le32 rtssuccess;
474 __le32 rtsfailure;
475 __le32 ackfailure;
476 __le32 rxfrag;
477 __le32 mcastrxframe;
478 __le32 fcserror;
479 __le32 txframe;
480 __le32 wepundecryptable;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000481} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200482
483struct cmd_ds_mac_control {
484 struct cmd_header hdr;
485 __le16 action;
486 u16 reserved;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000487} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200488
489struct cmd_ds_mac_multicast_adr {
490 struct cmd_header hdr;
491 __le16 action;
492 __le16 nr_of_adrs;
493 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000494} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200495
496struct cmd_ds_802_11_authenticate {
497 struct cmd_header hdr;
498
499 u8 bssid[ETH_ALEN];
500 u8 authtype;
501 u8 reserved[10];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000502} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200503
504struct cmd_ds_802_11_deauthenticate {
505 struct cmd_header hdr;
506
507 u8 macaddr[ETH_ALEN];
508 __le16 reasoncode;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000509} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200510
511struct cmd_ds_802_11_associate {
512 struct cmd_header hdr;
513
514 u8 bssid[6];
515 __le16 capability;
516 __le16 listeninterval;
517 __le16 bcnperiod;
518 u8 dtimperiod;
519 u8 iebuf[512]; /* Enough for required and most optional IEs */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000520} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200521
522struct cmd_ds_802_11_associate_response {
523 struct cmd_header hdr;
524
525 __le16 capability;
526 __le16 statuscode;
527 __le16 aid;
528 u8 iebuf[512];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000529} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200530
531struct cmd_ds_802_11_set_wep {
532 struct cmd_header hdr;
533
534 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
535 __le16 action;
536
537 /* key Index selected for Tx */
538 __le16 keyindex;
539
540 /* 40, 128bit or TXWEP */
541 uint8_t keytype[4];
542 uint8_t keymaterial[4][16];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000543} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200544
545struct cmd_ds_802_11_snmp_mib {
546 struct cmd_header hdr;
547
548 __le16 action;
549 __le16 oid;
550 __le16 bufsize;
551 u8 value[128];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000552} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200553
554struct cmd_ds_mac_reg_access {
555 __le16 action;
556 __le16 offset;
557 __le32 value;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000558} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200559
560struct cmd_ds_bbp_reg_access {
561 __le16 action;
562 __le16 offset;
563 u8 value;
564 u8 reserved[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000565} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200566
567struct cmd_ds_rf_reg_access {
568 __le16 action;
569 __le16 offset;
570 u8 value;
571 u8 reserved[3];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000572} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200573
574struct cmd_ds_802_11_radio_control {
575 struct cmd_header hdr;
576
577 __le16 action;
578 __le16 control;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000579} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200580
581struct cmd_ds_802_11_beacon_control {
582 __le16 action;
583 __le16 beacon_enable;
584 __le16 beacon_period;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000585} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200586
587struct cmd_ds_802_11_sleep_params {
588 struct cmd_header hdr;
589
590 /* ACT_GET/ACT_SET */
591 __le16 action;
592
593 /* Sleep clock error in ppm */
594 __le16 error;
595
596 /* Wakeup offset in usec */
597 __le16 offset;
598
599 /* Clock stabilization time in usec */
600 __le16 stabletime;
601
602 /* control periodic calibration */
603 uint8_t calcontrol;
604
605 /* control the use of external sleep clock */
606 uint8_t externalsleepclk;
607
608 /* reserved field, should be set to zero */
609 __le16 reserved;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000610} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200611
Holger Schurig9e66e702009-10-16 17:32:16 +0200612struct cmd_ds_802_11_rf_channel {
613 struct cmd_header hdr;
614
615 __le16 action;
616 __le16 channel;
617 __le16 rftype; /* unused */
618 __le16 reserved; /* unused */
619 u8 channellist[32]; /* unused */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000620} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200621
622struct cmd_ds_802_11_rssi {
623 /* weighting factor */
624 __le16 N;
625
626 __le16 reserved_0;
627 __le16 reserved_1;
628 __le16 reserved_2;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000629} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200630
631struct cmd_ds_802_11_rssi_rsp {
632 __le16 SNR;
633 __le16 noisefloor;
634 __le16 avgSNR;
635 __le16 avgnoisefloor;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000636} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200637
638struct cmd_ds_802_11_mac_address {
639 struct cmd_header hdr;
640
641 __le16 action;
642 u8 macadd[ETH_ALEN];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000643} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200644
645struct cmd_ds_802_11_rf_tx_power {
646 struct cmd_header hdr;
647
648 __le16 action;
649 __le16 curlevel;
650 s8 maxlevel;
651 s8 minlevel;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000652} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200653
654struct cmd_ds_802_11_monitor_mode {
655 __le16 action;
656 __le16 mode;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000657} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200658
659struct cmd_ds_set_boot2_ver {
660 struct cmd_header hdr;
661
662 __le16 action;
663 __le16 version;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000664} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200665
666struct cmd_ds_802_11_fw_wake_method {
667 struct cmd_header hdr;
668
669 __le16 action;
670 __le16 method;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000671} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200672
673struct cmd_ds_802_11_ps_mode {
674 __le16 action;
675 __le16 nullpktinterval;
676 __le16 multipledtim;
677 __le16 reserved;
678 __le16 locallisteninterval;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000679} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200680
681struct cmd_confirm_sleep {
682 struct cmd_header hdr;
683
684 __le16 action;
685 __le16 nullpktinterval;
686 __le16 multipledtim;
687 __le16 reserved;
688 __le16 locallisteninterval;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000689} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200690
691struct cmd_ds_802_11_data_rate {
692 struct cmd_header hdr;
693
694 __le16 action;
695 __le16 reserved;
696 u8 rates[MAX_RATES];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000697} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200698
699struct cmd_ds_802_11_rate_adapt_rateset {
700 struct cmd_header hdr;
701 __le16 action;
702 __le16 enablehwauto;
703 __le16 bitmap;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000704} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200705
706struct cmd_ds_802_11_ad_hoc_start {
707 struct cmd_header hdr;
708
Holger Schurig243e84e2009-10-22 15:30:47 +0200709 u8 ssid[IEEE80211_MAX_SSID_LEN];
Holger Schurig9e66e702009-10-16 17:32:16 +0200710 u8 bsstype;
711 __le16 beaconperiod;
712 u8 dtimperiod; /* Reserved on v9 and later */
713 struct ieee_ie_ibss_param_set ibss;
714 u8 reserved1[4];
715 struct ieee_ie_ds_param_set ds;
716 u8 reserved2[4];
717 __le16 probedelay; /* Reserved on v9 and later */
718 __le16 capability;
719 u8 rates[MAX_RATES];
720 u8 tlv_memory_size_pad[100];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000721} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200722
723struct cmd_ds_802_11_ad_hoc_result {
724 struct cmd_header hdr;
725
726 u8 pad[3];
727 u8 bssid[ETH_ALEN];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000728} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200729
730struct adhoc_bssdesc {
731 u8 bssid[ETH_ALEN];
Holger Schurig243e84e2009-10-22 15:30:47 +0200732 u8 ssid[IEEE80211_MAX_SSID_LEN];
Holger Schurig9e66e702009-10-16 17:32:16 +0200733 u8 type;
734 __le16 beaconperiod;
735 u8 dtimperiod;
736 __le64 timestamp;
737 __le64 localtime;
738 struct ieee_ie_ds_param_set ds;
739 u8 reserved1[4];
740 struct ieee_ie_ibss_param_set ibss;
741 u8 reserved2[4];
742 __le16 capability;
743 u8 rates[MAX_RATES];
744
745 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
746 * Adhoc join command and will cause a binary layout mismatch with
747 * the firmware
748 */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000749} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200750
751struct cmd_ds_802_11_ad_hoc_join {
752 struct cmd_header hdr;
753
754 struct adhoc_bssdesc bss;
755 __le16 failtimeout; /* Reserved on v9 and later */
756 __le16 probedelay; /* Reserved on v9 and later */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000757} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200758
759struct cmd_ds_802_11_ad_hoc_stop {
760 struct cmd_header hdr;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000761} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200762
763struct cmd_ds_802_11_enable_rsn {
764 struct cmd_header hdr;
765
766 __le16 action;
767 __le16 enable;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000768} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200769
770struct MrvlIEtype_keyParamSet {
771 /* type ID */
772 __le16 type;
773
774 /* length of Payload */
775 __le16 length;
776
777 /* type of key: WEP=0, TKIP=1, AES=2 */
778 __le16 keytypeid;
779
780 /* key control Info specific to a keytypeid */
781 __le16 keyinfo;
782
783 /* length of key */
784 __le16 keylen;
785
786 /* key material of size keylen */
787 u8 key[32];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000788} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200789
790#define MAX_WOL_RULES 16
791
792struct host_wol_rule {
793 uint8_t rule_no;
794 uint8_t rule_ops;
795 __le16 sig_offset;
796 __le16 sig_length;
797 __le16 reserve;
798 __be32 sig_mask;
799 __be32 signature;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000800} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200801
802struct wol_config {
803 uint8_t action;
804 uint8_t pattern;
805 uint8_t no_rules_in_cmd;
806 uint8_t result;
807 struct host_wol_rule rule[MAX_WOL_RULES];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000808} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200809
810struct cmd_ds_host_sleep {
811 struct cmd_header hdr;
812 __le32 criteria;
813 uint8_t gpio;
814 uint16_t gap;
815 struct wol_config wol_conf;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000816} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200817
818
819
820struct cmd_ds_802_11_key_material {
821 struct cmd_header hdr;
822
823 __le16 action;
824 struct MrvlIEtype_keyParamSet keyParamSet[2];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000825} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200826
827struct cmd_ds_802_11_eeprom_access {
828 struct cmd_header hdr;
829 __le16 action;
830 __le16 offset;
831 __le16 len;
832 /* firmware says it returns a maximum of 20 bytes */
833#define LBS_EEPROM_READ_LEN 20
834 u8 value[LBS_EEPROM_READ_LEN];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000835} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200836
837struct cmd_ds_802_11_tpc_cfg {
838 struct cmd_header hdr;
839
840 __le16 action;
841 uint8_t enable;
842 int8_t P0;
843 int8_t P1;
844 int8_t P2;
845 uint8_t usesnr;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000846} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200847
848
849struct cmd_ds_802_11_pa_cfg {
850 struct cmd_header hdr;
851
852 __le16 action;
853 uint8_t enable;
854 int8_t P0;
855 int8_t P1;
856 int8_t P2;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000857} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200858
859
860struct cmd_ds_802_11_led_ctrl {
861 __le16 action;
862 __le16 numled;
863 u8 data[256];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000864} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200865
866struct cmd_ds_802_11_afc {
867 __le16 afc_auto;
868 union {
869 struct {
870 __le16 threshold;
871 __le16 period;
872 };
873 struct {
874 __le16 timing_offset; /* signed */
875 __le16 carrier_offset; /* signed */
876 };
877 };
Eric Dumazetba2d3582010-06-02 18:10:09 +0000878} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200879
880struct cmd_tx_rate_query {
881 __le16 txrate;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000882} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200883
884struct cmd_ds_get_tsf {
885 __le64 tsfvalue;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000886} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200887
888struct cmd_ds_bt_access {
889 __le16 action;
890 __le32 id;
891 u8 addr1[ETH_ALEN];
892 u8 addr2[ETH_ALEN];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000893} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200894
895struct cmd_ds_fwt_access {
896 __le16 action;
897 __le32 id;
898 u8 valid;
899 u8 da[ETH_ALEN];
900 u8 dir;
901 u8 ra[ETH_ALEN];
902 __le32 ssn;
903 __le32 dsn;
904 __le32 metric;
905 u8 rate;
906 u8 hopcount;
907 u8 ttl;
908 __le32 expiration;
909 u8 sleepmode;
910 __le32 snr;
911 __le32 references;
912 u8 prec[ETH_ALEN];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000913} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200914
915struct cmd_ds_mesh_config {
916 struct cmd_header hdr;
917
918 __le16 action;
919 __le16 channel;
920 __le16 type;
921 __le16 length;
922 u8 data[128]; /* last position reserved */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000923} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200924
925struct cmd_ds_mesh_access {
926 struct cmd_header hdr;
927
928 __le16 action;
929 __le32 data[32]; /* last position reserved */
Eric Dumazetba2d3582010-06-02 18:10:09 +0000930} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200931
932/* Number of stats counters returned by the firmware */
933#define MESH_STATS_NUM 8
934
935struct cmd_ds_command {
936 /* command header */
937 __le16 command;
938 __le16 size;
939 __le16 seqnum;
940 __le16 result;
941
942 /* command Body */
943 union {
944 struct cmd_ds_802_11_ps_mode psmode;
945 struct cmd_ds_802_11_monitor_mode monitor;
946 struct cmd_ds_802_11_rssi rssi;
947 struct cmd_ds_802_11_rssi_rsp rssirsp;
948 struct cmd_ds_mac_reg_access macreg;
949 struct cmd_ds_bbp_reg_access bbpreg;
950 struct cmd_ds_rf_reg_access rfreg;
951
Holger Schurig9e66e702009-10-16 17:32:16 +0200952 struct cmd_ds_802_11_tpc_cfg tpccfg;
953 struct cmd_ds_802_11_afc afc;
954 struct cmd_ds_802_11_led_ctrl ledgpio;
955
956 struct cmd_ds_bt_access bt;
957 struct cmd_ds_fwt_access fwt;
Holger Schurig9e66e702009-10-16 17:32:16 +0200958 struct cmd_ds_802_11_beacon_control bcn_ctrl;
959 } params;
Eric Dumazetba2d3582010-06-02 18:10:09 +0000960} __packed;
Holger Schurig9e66e702009-10-16 17:32:16 +0200961
Holger Schurig10078322007-11-15 18:05:47 -0500962#endif