blob: c8a1998d4744270021931124e7650a93bd3dea5b [file] [log] [blame]
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02001/*
2 * This file contains the function prototypes, data structure
3 * and defines for all the host/station commands
4 */
Holger Schurig10078322007-11-15 18:05:47 -05005#ifndef _LBS_HOSTCMD_H
6#define _LBS_HOSTCMD_H
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02007
8#include <linux/wireless.h>
9#include "11d.h"
10#include "types.h"
11
12/* 802.11-related definitions */
13
14/* TxPD descriptor */
15struct txpd {
Bing Zhao684d6b32009-03-25 09:51:16 -070016 /* union to cope up with later FW revisions */
17 union {
18 /* Current Tx packet status */
19 __le32 tx_status;
20 struct {
21 /* BSS type: client, AP, etc. */
22 u8 bss_type;
23 /* BSS number */
24 u8 bss_num;
25 /* Reserved */
26 __le16 reserved;
27 } bss;
28 } u;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020029 /* Tx control */
David Woodhouse981f1872007-05-25 23:36:54 -040030 __le32 tx_control;
31 __le32 tx_packet_location;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020032 /* Tx packet length */
David Woodhouse981f1872007-05-25 23:36:54 -040033 __le16 tx_packet_length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020034 /* First 2 byte of destination MAC address */
35 u8 tx_dest_addr_high[2];
36 /* Last 4 byte of destination MAC address */
37 u8 tx_dest_addr_low[4];
38 /* Pkt Priority */
39 u8 priority;
40 /* Pkt Trasnit Power control */
41 u8 powermgmt;
42 /* Amount of time the packet has been queued in the driver (units = 2ms) */
43 u8 pktdelay_2ms;
44 /* reserved */
45 u8 reserved1;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -080046} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020047
48/* RxPD Descriptor */
49struct rxpd {
Bing Zhao684d6b32009-03-25 09:51:16 -070050 /* union to cope up with later FW revisions */
51 union {
52 /* Current Rx packet status */
53 __le16 status;
54 struct {
55 /* BSS type: client, AP, etc. */
56 u8 bss_type;
57 /* BSS number */
58 u8 bss_num;
Bob Dunlopdd1f57e2009-08-06 12:01:03 -040059 } __attribute__ ((packed)) bss;
60 } __attribute__ ((packed)) u;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020061
62 /* SNR */
63 u8 snr;
64
65 /* Tx control */
66 u8 rx_control;
67
68 /* Pkt length */
David Woodhouse981f1872007-05-25 23:36:54 -040069 __le16 pkt_len;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020070
71 /* Noise Floor */
72 u8 nf;
73
74 /* Rx Packet Rate */
75 u8 rx_rate;
76
77 /* Pkt addr */
David Woodhouse981f1872007-05-25 23:36:54 -040078 __le32 pkt_ptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020079
80 /* Next Rx RxPD addr */
David Woodhouse981f1872007-05-25 23:36:54 -040081 __le32 next_rxpd_ptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020082
83 /* Pkt Priority */
84 u8 priority;
85 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -080086} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020087
Dan Williams7ad994d2007-12-11 12:33:30 -050088struct cmd_header {
89 __le16 command;
90 __le16 size;
91 __le16 seqnum;
92 __le16 result;
93} __attribute__ ((packed));
94
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020095struct cmd_ctrl_node {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020096 struct list_head list;
David Woodhouseae125bf2007-12-15 04:22:52 -050097 int result;
Holger Schurig675787e2007-12-05 17:58:11 +010098 /* command response */
Dan Williams7ad994d2007-12-11 12:33:30 -050099 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
David Woodhouse1309b552007-12-10 13:36:10 -0500100 unsigned long callback_arg;
Holger Schurig675787e2007-12-05 17:58:11 +0100101 /* command data */
Dan Williamsddac4522007-12-11 13:49:39 -0500102 struct cmd_header *cmdbuf;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200103 /* wait queue */
104 u16 cmdwaitqwoken;
105 wait_queue_head_t cmdwait_q;
106};
107
Dan Williams1443b652007-08-02 10:45:55 -0400108/* Generic structure to hold all key types. */
109struct enc_key {
110 u16 len;
Holger Schurig10078322007-11-15 18:05:47 -0500111 u16 flags; /* KEY_INFO_* from defs.h */
112 u16 type; /* KEY_TYPE_* from defs.h */
Dan Williams1443b652007-08-02 10:45:55 -0400113 u8 key[32];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200114};
115
Holger Schurig10078322007-11-15 18:05:47 -0500116/* lbs_offset_value */
117struct lbs_offset_value {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200118 u32 offset;
119 u32 value;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800120} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200121
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200122/* Define general data structure */
123/* cmd_DS_GEN */
124struct cmd_ds_gen {
David Woodhouse981f1872007-05-25 23:36:54 -0400125 __le16 command;
126 __le16 size;
127 __le16 seqnum;
128 __le16 result;
Holger Schurig675787e2007-12-05 17:58:11 +0100129 void *cmdresp[0];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800130} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200131
132#define S_DS_GEN sizeof(struct cmd_ds_gen)
Holger Schurig675787e2007-12-05 17:58:11 +0100133
134
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200135/*
Dan Williams0aef64d2007-08-02 11:31:18 -0400136 * Define data structure for CMD_GET_HW_SPEC
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200137 * This structure defines the response for the GET_HW_SPEC command
138 */
139struct cmd_ds_get_hw_spec {
Dan Williams6e66f032007-12-11 12:42:16 -0500140 struct cmd_header hdr;
141
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200142 /* HW Interface version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400143 __le16 hwifversion;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200144 /* HW version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400145 __le16 version;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200146 /* Max number of TxPD FW can handle */
David Woodhouse981f1872007-05-25 23:36:54 -0400147 __le16 nr_txpd;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200148 /* Max no of Multicast address */
David Woodhouse981f1872007-05-25 23:36:54 -0400149 __le16 nr_mcast_adr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200150 /* MAC address */
151 u8 permanentaddr[6];
152
153 /* region Code */
David Woodhouse981f1872007-05-25 23:36:54 -0400154 __le16 regioncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200155
156 /* Number of antenna used */
David Woodhouse981f1872007-05-25 23:36:54 -0400157 __le16 nr_antenna;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200158
Holger Schurigdac10a92008-01-16 15:55:22 +0100159 /* FW release number, example 0x01030304 = 2.3.4p1 */
160 __le32 fwrelease;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200161
162 /* Base Address of TxPD queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400163 __le32 wcb_base;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200164 /* Read Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400165 __le32 rxpd_rdptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200166
167 /* Write Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400168 __le32 rxpd_wrptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200169
170 /*FW/HW capability */
David Woodhouse981f1872007-05-25 23:36:54 -0400171 __le32 fwcapinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200172} __attribute__ ((packed));
173
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200174struct cmd_ds_802_11_subscribe_event {
David Woodhouse5844d122007-12-18 02:01:37 -0500175 struct cmd_header hdr;
176
David Woodhouse981f1872007-05-25 23:36:54 -0400177 __le16 action;
178 __le16 events;
Holger Schurig3a188642007-11-26 10:07:14 +0100179
180 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
181 * number of TLVs. From the v5.1 manual, those TLVs would add up to
182 * 40 bytes. However, future firmware might add additional TLVs, so I
183 * bump this up a bit.
184 */
David Woodhouse5844d122007-12-18 02:01:37 -0500185 uint8_t tlv[128];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800186} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200187
188/*
189 * This scan handle Country Information IE(802.11d compliant)
Dan Williams0aef64d2007-08-02 11:31:18 -0400190 * Define data structure for CMD_802_11_SCAN
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200191 */
192struct cmd_ds_802_11_scan {
David Woodhousefa62f992008-03-03 12:18:03 +0100193 struct cmd_header hdr;
194
195 uint8_t bsstype;
196 uint8_t bssid[ETH_ALEN];
197 uint8_t tlvbuffer[0];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200198#if 0
199 mrvlietypes_ssidparamset_t ssidParamSet;
200 mrvlietypes_chanlistparamset_t ChanListParamSet;
201 mrvlietypes_ratesparamset_t OpRateSet;
202#endif
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800203} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200204
205struct cmd_ds_802_11_scan_rsp {
David Woodhousefa62f992008-03-03 12:18:03 +0100206 struct cmd_header hdr;
207
David Woodhouse981f1872007-05-25 23:36:54 -0400208 __le16 bssdescriptsize;
David Woodhousefa62f992008-03-03 12:18:03 +0100209 uint8_t nr_sets;
210 uint8_t bssdesc_and_tlvbuffer[0];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800211} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200212
213struct cmd_ds_802_11_get_log {
Holger Schurigc49c3b72008-03-17 12:45:58 +0100214 struct cmd_header hdr;
215
David Woodhouse981f1872007-05-25 23:36:54 -0400216 __le32 mcasttxframe;
217 __le32 failed;
218 __le32 retry;
219 __le32 multiretry;
220 __le32 framedup;
221 __le32 rtssuccess;
222 __le32 rtsfailure;
223 __le32 ackfailure;
224 __le32 rxfrag;
225 __le32 mcastrxframe;
226 __le32 fcserror;
227 __le32 txframe;
228 __le32 wepundecryptable;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800229} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200230
231struct cmd_ds_mac_control {
Holger Schurig835d3ac2008-03-12 16:05:40 +0100232 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400233 __le16 action;
Holger Schurig835d3ac2008-03-12 16:05:40 +0100234 u16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800235} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200236
237struct cmd_ds_mac_multicast_adr {
David Woodhouse75bf45a2008-05-20 13:32:45 +0100238 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400239 __le16 action;
240 __le16 nr_of_adrs;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200241 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800242} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200243
Colin McCabeb4836592009-01-02 19:00:22 -0800244struct cmd_ds_gspi_bus_config {
245 struct cmd_header hdr;
246 __le16 action;
247 __le16 bus_delay_mode;
248 __le16 host_time_delay_to_read_port;
249 __le16 host_time_delay_to_read_register;
250} __attribute__ ((packed));
251
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200252struct cmd_ds_802_11_authenticate {
Dan Williamsbe0d76e2009-05-22 20:05:25 -0400253 struct cmd_header hdr;
254
255 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200256 u8 authtype;
257 u8 reserved[10];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800258} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200259
260struct cmd_ds_802_11_deauthenticate {
Dan Williams191bb402008-08-21 17:46:18 -0400261 struct cmd_header hdr;
262
263 u8 macaddr[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400264 __le16 reasoncode;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800265} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200266
267struct cmd_ds_802_11_associate {
Dan Williams822ac032009-05-22 20:07:14 -0400268 struct cmd_header hdr;
269
270 u8 bssid[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400271 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400272 __le16 listeninterval;
273 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200274 u8 dtimperiod;
Dan Williams822ac032009-05-22 20:07:14 -0400275 u8 iebuf[512]; /* Enough for required and most optional IEs */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200276} __attribute__ ((packed));
277
Dan Williams822ac032009-05-22 20:07:14 -0400278struct cmd_ds_802_11_associate_response {
279 struct cmd_header hdr;
280
281 __le16 capability;
282 __le16 statuscode;
283 __le16 aid;
284 u8 iebuf[512];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800285} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200286
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200287struct cmd_ds_802_11_set_wep {
David Woodhousef70dd452007-12-18 00:18:05 -0500288 struct cmd_header hdr;
289
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200290 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400291 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200292
293 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400294 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200295
296 /* 40, 128bit or TXWEP */
David Woodhousef70dd452007-12-18 00:18:05 -0500297 uint8_t keytype[4];
298 uint8_t keymaterial[4][16];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800299} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200300
301struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400302 __le32 xmitok;
303 __le32 rcvok;
304 __le32 xmiterror;
305 __le32 rcverror;
306 __le32 rcvnobuffer;
307 __le32 rcvcrcerror;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800308} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200309
310struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400311 __le32 txfragmentcnt;
312 __le32 mcasttxframecnt;
313 __le32 failedcnt;
314 __le32 retrycnt;
315 __le32 Multipleretrycnt;
316 __le32 rtssuccesscnt;
317 __le32 rtsfailurecnt;
318 __le32 ackfailurecnt;
319 __le32 frameduplicatecnt;
320 __le32 rxfragmentcnt;
321 __le32 mcastrxframecnt;
322 __le32 fcserrorcnt;
323 __le32 bcasttxframecnt;
324 __le32 bcastrxframecnt;
325 __le32 txbeacon;
326 __le32 rxbeacon;
327 __le32 wepundecryptable;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800328} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200329
330struct cmd_ds_802_11_snmp_mib {
Dan Williams39fcf7a2008-09-10 12:49:00 -0400331 struct cmd_header hdr;
332
333 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400334 __le16 oid;
335 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200336 u8 value[128];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800337} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200338
339struct cmd_ds_mac_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400340 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200341 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400342 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800343} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200344
345struct cmd_ds_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400346 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200347 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400348 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800349} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200350
351struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400352 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200353 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400354 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800355} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200356
357struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400358 __le16 action;
359 __le16 offset;
360 __le32 value;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800361} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200362
363struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400364 __le16 action;
365 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200366 u8 value;
367 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800368} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200369
370struct cmd_ds_rf_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400371 __le16 action;
372 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200373 u8 value;
374 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800375} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200376
377struct cmd_ds_802_11_radio_control {
David Woodhousea7c45892007-12-17 22:43:48 -0500378 struct cmd_header hdr;
379
David Woodhouse981f1872007-05-25 23:36:54 -0400380 __le16 action;
381 __le16 control;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800382} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200383
Brajesh Dave96287ac2007-11-20 17:44:28 -0500384struct cmd_ds_802_11_beacon_control {
385 __le16 action;
386 __le16 beacon_enable;
387 __le16 beacon_period;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800388} __attribute__ ((packed));
Brajesh Dave96287ac2007-11-20 17:44:28 -0500389
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200390struct cmd_ds_802_11_sleep_params {
David Woodhouse3fbe1042007-12-17 23:48:31 -0500391 struct cmd_header hdr;
392
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200393 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400394 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200395
396 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400397 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200398
399 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400400 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200401
402 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400403 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200404
405 /* control periodic calibration */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500406 uint8_t calcontrol;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200407
408 /* control the use of external sleep clock */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500409 uint8_t externalsleepclk;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200410
411 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400412 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800413} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200414
415struct cmd_ds_802_11_inactivity_timeout {
David Woodhouse6e5cc4f2007-12-17 23:04:37 -0500416 struct cmd_header hdr;
417
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200418 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400419 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200420
421 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400422 __le16 timeout;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800423} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200424
425struct cmd_ds_802_11_rf_channel {
Dan Williams2dd4b262007-12-11 16:54:15 -0500426 struct cmd_header hdr;
427
David Woodhouse981f1872007-05-25 23:36:54 -0400428 __le16 action;
Dan Williams2dd4b262007-12-11 16:54:15 -0500429 __le16 channel;
430 __le16 rftype; /* unused */
431 __le16 reserved; /* unused */
432 u8 channellist[32]; /* unused */
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800433} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200434
435struct cmd_ds_802_11_rssi {
436 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400437 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200438
David Woodhouse981f1872007-05-25 23:36:54 -0400439 __le16 reserved_0;
440 __le16 reserved_1;
441 __le16 reserved_2;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800442} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200443
444struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400445 __le16 SNR;
446 __le16 noisefloor;
447 __le16 avgSNR;
448 __le16 avgnoisefloor;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800449} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200450
451struct cmd_ds_802_11_mac_address {
Holger Schurig2af9f032008-03-26 09:58:32 +0100452 struct cmd_header hdr;
453
David Woodhouse981f1872007-05-25 23:36:54 -0400454 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200455 u8 macadd[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800456} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200457
458struct cmd_ds_802_11_rf_tx_power {
Dan Williams87c8c722008-08-19 15:15:35 -0400459 struct cmd_header hdr;
460
David Woodhouse981f1872007-05-25 23:36:54 -0400461 __le16 action;
Dan Williams87c8c722008-08-19 15:15:35 -0400462 __le16 curlevel;
463 s8 maxlevel;
464 s8 minlevel;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800465} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200466
467struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400468 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200469
470 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400471 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200472
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800473} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200474
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400475struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000476 __le16 action;
477 __le16 mode;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800478} __attribute__ ((packed));
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400479
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400480struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500481 struct cmd_header hdr;
482
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000483 __le16 action;
484 __le16 version;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800485} __attribute__ ((packed));
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400486
David Woodhousec6ad3732007-12-16 21:43:40 -0500487struct cmd_ds_802_11_fw_wake_method {
488 struct cmd_header hdr;
489
490 __le16 action;
491 __le16 method;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800492} __attribute__ ((packed));
David Woodhousec6ad3732007-12-16 21:43:40 -0500493
494struct cmd_ds_802_11_sleep_period {
495 struct cmd_header hdr;
496
497 __le16 action;
498 __le16 period;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800499} __attribute__ ((packed));
David Woodhousec6ad3732007-12-16 21:43:40 -0500500
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200501struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400502 __le16 action;
503 __le16 nullpktinterval;
504 __le16 multipledtim;
505 __le16 reserved;
506 __le16 locallisteninterval;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800507} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200508
Holger Schurigf539f2e2008-03-26 13:22:11 +0100509struct cmd_confirm_sleep {
510 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200511
David Woodhouse981f1872007-05-25 23:36:54 -0400512 __le16 action;
Holger Schurigf539f2e2008-03-26 13:22:11 +0100513 __le16 nullpktinterval;
David Woodhouse981f1872007-05-25 23:36:54 -0400514 __le16 multipledtim;
515 __le16 reserved;
516 __le16 locallisteninterval;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800517} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200518
519struct cmd_ds_802_11_data_rate {
Dan Williams8e3c91b2007-12-11 15:50:59 -0500520 struct cmd_header hdr;
521
David Woodhouse981f1872007-05-25 23:36:54 -0400522 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400523 __le16 reserved;
524 u8 rates[MAX_RATES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800525} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200526
527struct cmd_ds_802_11_rate_adapt_rateset {
Javier Cardona85319f92008-05-24 10:59:49 +0100528 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400529 __le16 action;
530 __le16 enablehwauto;
531 __le16 bitmap;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800532} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200533
534struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400535 struct cmd_header hdr;
536
Dan Williamsb44898e2007-08-02 11:18:40 -0400537 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200538 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400539 __le16 beaconperiod;
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400540 u8 dtimperiod; /* Reserved on v9 and later */
Dan Williams5fd164e2009-05-22 20:01:21 -0400541 struct ieee_ie_ibss_param_set ibss;
542 u8 reserved1[4];
543 struct ieee_ie_ds_param_set ds;
544 u8 reserved2[4];
545 __le16 probedelay; /* Reserved on v9 and later */
Dan Williams0c9ca692007-08-02 10:43:44 -0400546 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400547 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200548 u8 tlv_memory_size_pad[100];
549} __attribute__ ((packed));
550
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400551struct cmd_ds_802_11_ad_hoc_result {
552 struct cmd_header hdr;
553
554 u8 pad[3];
555 u8 bssid[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800556} __attribute__ ((packed));
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400557
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200558struct adhoc_bssdesc {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400559 u8 bssid[ETH_ALEN];
560 u8 ssid[IW_ESSID_MAX_SIZE];
Dan Williams0c9ca692007-08-02 10:43:44 -0400561 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400562 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200563 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400564 __le64 timestamp;
565 __le64 localtime;
Dan Williams5fd164e2009-05-22 20:01:21 -0400566 struct ieee_ie_ds_param_set ds;
567 u8 reserved1[4];
568 struct ieee_ie_ibss_param_set ibss;
569 u8 reserved2[4];
Dan Williams0c9ca692007-08-02 10:43:44 -0400570 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400571 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200572
573 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
574 * Adhoc join command and will cause a binary layout mismatch with
575 * the firmware
576 */
577} __attribute__ ((packed));
578
579struct cmd_ds_802_11_ad_hoc_join {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400580 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200581
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400582 struct adhoc_bssdesc bss;
583 __le16 failtimeout; /* Reserved on v9 and later */
584 __le16 probedelay; /* Reserved on v9 and later */
585} __attribute__ ((packed));
586
587struct cmd_ds_802_11_ad_hoc_stop {
588 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200589} __attribute__ ((packed));
590
591struct cmd_ds_802_11_enable_rsn {
David Woodhouse4f59abf2007-12-18 00:47:17 -0500592 struct cmd_header hdr;
593
David Woodhouse981f1872007-05-25 23:36:54 -0400594 __le16 action;
595 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400596} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200597
598struct MrvlIEtype_keyParamSet {
599 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400600 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200601
602 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400603 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200604
605 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400606 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200607
608 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400609 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200610
611 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400612 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200613
614 /* key material of size keylen */
615 u8 key[32];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800616} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200617
Anna Neal582c1b52008-10-20 16:46:56 -0700618#define MAX_WOL_RULES 16
619
620struct host_wol_rule {
621 uint8_t rule_no;
622 uint8_t rule_ops;
623 __le16 sig_offset;
624 __le16 sig_length;
625 __le16 reserve;
626 __be32 sig_mask;
627 __be32 signature;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800628} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700629
630struct wol_config {
631 uint8_t action;
632 uint8_t pattern;
633 uint8_t no_rules_in_cmd;
634 uint8_t result;
635 struct host_wol_rule rule[MAX_WOL_RULES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800636} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700637
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500638struct cmd_ds_host_sleep {
639 struct cmd_header hdr;
640 __le32 criteria;
641 uint8_t gpio;
Anna Neal582c1b52008-10-20 16:46:56 -0700642 uint16_t gap;
643 struct wol_config wol_conf;
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500644} __attribute__ ((packed));
645
Anna Neal582c1b52008-10-20 16:46:56 -0700646
647
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200648struct cmd_ds_802_11_key_material {
David Woodhouse9e1228d2008-03-03 12:15:39 +0100649 struct cmd_header hdr;
650
David Woodhouse981f1872007-05-25 23:36:54 -0400651 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200652 struct MrvlIEtype_keyParamSet keyParamSet[2];
653} __attribute__ ((packed));
654
655struct cmd_ds_802_11_eeprom_access {
Holger Schurig7460f5a2008-03-26 10:03:48 +0100656 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400657 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400658 __le16 offset;
Holger Schurig7460f5a2008-03-26 10:03:48 +0100659 __le16 len;
660 /* firmware says it returns a maximum of 20 bytes */
661#define LBS_EEPROM_READ_LEN 20
662 u8 value[LBS_EEPROM_READ_LEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200663} __attribute__ ((packed));
664
665struct cmd_ds_802_11_tpc_cfg {
Anna Neal0112c9e2008-09-11 11:17:25 -0700666 struct cmd_header hdr;
667
David Woodhouse981f1872007-05-25 23:36:54 -0400668 __le16 action;
Anna Neal0112c9e2008-09-11 11:17:25 -0700669 uint8_t enable;
670 int8_t P0;
671 int8_t P1;
672 int8_t P2;
673 uint8_t usesnr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200674} __attribute__ ((packed));
675
Anna Neal0112c9e2008-09-11 11:17:25 -0700676
677struct cmd_ds_802_11_pa_cfg {
678 struct cmd_header hdr;
679
680 __le16 action;
681 uint8_t enable;
682 int8_t P0;
683 int8_t P1;
684 int8_t P2;
685} __attribute__ ((packed));
686
687
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200688struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400689 __le16 action;
690 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200691 u8 data[256];
692} __attribute__ ((packed));
693
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200694struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400695 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200696 union {
697 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400698 __le16 threshold;
699 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200700 };
701 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400702 __le16 timing_offset; /* signed */
703 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200704 };
705 };
706} __attribute__ ((packed));
707
708struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400709 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200710} __attribute__ ((packed));
711
712struct cmd_ds_get_tsf {
713 __le64 tsfvalue;
714} __attribute__ ((packed));
715
716struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400717 __le16 action;
718 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200719 u8 addr1[ETH_ALEN];
720 u8 addr2[ETH_ALEN];
721} __attribute__ ((packed));
722
723struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400724 __le16 action;
725 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400726 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200727 u8 da[ETH_ALEN];
728 u8 dir;
729 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400730 __le32 ssn;
731 __le32 dsn;
732 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400733 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200734 u8 hopcount;
735 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400736 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200737 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400738 __le32 snr;
739 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400740 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200741} __attribute__ ((packed));
742
David Woodhouse23a397a2007-12-11 18:56:42 -0500743
744struct cmd_ds_mesh_config {
745 struct cmd_header hdr;
746
747 __le16 action;
748 __le16 channel;
749 __le16 type;
750 __le16 length;
751 u8 data[128]; /* last position reserved */
752} __attribute__ ((packed));
753
754
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200755struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500756 struct cmd_header hdr;
757
David Woodhouse981f1872007-05-25 23:36:54 -0400758 __le16 action;
759 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200760} __attribute__ ((packed));
761
Javier Cardona0601e7e2007-05-25 12:12:06 -0400762/* Number of stats counters returned by the firmware */
763#define MESH_STATS_NUM 8
764
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200765struct cmd_ds_command {
766 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400767 __le16 command;
768 __le16 size;
769 __le16 seqnum;
770 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200771
772 /* command Body */
773 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200774 struct cmd_ds_802_11_ps_mode psmode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200775 struct cmd_ds_802_11_get_stat gstat;
776 struct cmd_ds_802_3_get_stat gstat_8023;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200777 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400778 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200779 struct cmd_ds_802_11_rssi rssi;
780 struct cmd_ds_802_11_rssi_rsp rssirsp;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200781 struct cmd_ds_mac_reg_access macreg;
782 struct cmd_ds_bbp_reg_access bbpreg;
783 struct cmd_ds_rf_reg_access rfreg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200784
785 struct cmd_ds_802_11d_domain_info domaininfo;
786 struct cmd_ds_802_11d_domain_info domaininforesp;
787
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200788 struct cmd_ds_802_11_tpc_cfg tpccfg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200789 struct cmd_ds_802_11_afc afc;
790 struct cmd_ds_802_11_led_ctrl ledgpio;
791
792 struct cmd_tx_rate_query txrate;
793 struct cmd_ds_bt_access bt;
794 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200795 struct cmd_ds_get_tsf gettsf;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500796 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200797 } params;
798} __attribute__ ((packed));
799
800#endif