blob: a899aeb676bbbeb744dadb0bc313fe427611fd86 [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 {
16 /* Current Tx packet status */
David Woodhouse981f1872007-05-25 23:36:54 -040017 __le32 tx_status;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020018 /* Tx control */
David Woodhouse981f1872007-05-25 23:36:54 -040019 __le32 tx_control;
20 __le32 tx_packet_location;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020021 /* Tx packet length */
David Woodhouse981f1872007-05-25 23:36:54 -040022 __le16 tx_packet_length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020023 /* First 2 byte of destination MAC address */
24 u8 tx_dest_addr_high[2];
25 /* Last 4 byte of destination MAC address */
26 u8 tx_dest_addr_low[4];
27 /* Pkt Priority */
28 u8 priority;
29 /* Pkt Trasnit Power control */
30 u8 powermgmt;
31 /* Amount of time the packet has been queued in the driver (units = 2ms) */
32 u8 pktdelay_2ms;
33 /* reserved */
34 u8 reserved1;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -080035} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020036
37/* RxPD Descriptor */
38struct rxpd {
39 /* Current Rx packet status */
David Woodhouse981f1872007-05-25 23:36:54 -040040 __le16 status;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020041
42 /* SNR */
43 u8 snr;
44
45 /* Tx control */
46 u8 rx_control;
47
48 /* Pkt length */
David Woodhouse981f1872007-05-25 23:36:54 -040049 __le16 pkt_len;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020050
51 /* Noise Floor */
52 u8 nf;
53
54 /* Rx Packet Rate */
55 u8 rx_rate;
56
57 /* Pkt addr */
David Woodhouse981f1872007-05-25 23:36:54 -040058 __le32 pkt_ptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020059
60 /* Next Rx RxPD addr */
David Woodhouse981f1872007-05-25 23:36:54 -040061 __le32 next_rxpd_ptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020062
63 /* Pkt Priority */
64 u8 priority;
65 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -080066} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020067
Dan Williams7ad994d2007-12-11 12:33:30 -050068struct cmd_header {
69 __le16 command;
70 __le16 size;
71 __le16 seqnum;
72 __le16 result;
73} __attribute__ ((packed));
74
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020075struct cmd_ctrl_node {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020076 struct list_head list;
David Woodhouseae125bf2007-12-15 04:22:52 -050077 int result;
Holger Schurig675787e2007-12-05 17:58:11 +010078 /* command response */
Dan Williams7ad994d2007-12-11 12:33:30 -050079 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
David Woodhouse1309b552007-12-10 13:36:10 -050080 unsigned long callback_arg;
Holger Schurig675787e2007-12-05 17:58:11 +010081 /* command data */
Dan Williamsddac4522007-12-11 13:49:39 -050082 struct cmd_header *cmdbuf;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020083 /* wait queue */
84 u16 cmdwaitqwoken;
85 wait_queue_head_t cmdwait_q;
86};
87
Dan Williams1443b652007-08-02 10:45:55 -040088/* Generic structure to hold all key types. */
89struct enc_key {
90 u16 len;
Holger Schurig10078322007-11-15 18:05:47 -050091 u16 flags; /* KEY_INFO_* from defs.h */
92 u16 type; /* KEY_TYPE_* from defs.h */
Dan Williams1443b652007-08-02 10:45:55 -040093 u8 key[32];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020094};
95
Holger Schurig10078322007-11-15 18:05:47 -050096/* lbs_offset_value */
97struct lbs_offset_value {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020098 u32 offset;
99 u32 value;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800100} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200101
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200102/* Define general data structure */
103/* cmd_DS_GEN */
104struct cmd_ds_gen {
David Woodhouse981f1872007-05-25 23:36:54 -0400105 __le16 command;
106 __le16 size;
107 __le16 seqnum;
108 __le16 result;
Holger Schurig675787e2007-12-05 17:58:11 +0100109 void *cmdresp[0];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800110} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200111
112#define S_DS_GEN sizeof(struct cmd_ds_gen)
Holger Schurig675787e2007-12-05 17:58:11 +0100113
114
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200115/*
Dan Williams0aef64d2007-08-02 11:31:18 -0400116 * Define data structure for CMD_GET_HW_SPEC
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200117 * This structure defines the response for the GET_HW_SPEC command
118 */
119struct cmd_ds_get_hw_spec {
Dan Williams6e66f032007-12-11 12:42:16 -0500120 struct cmd_header hdr;
121
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200122 /* HW Interface version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400123 __le16 hwifversion;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200124 /* HW version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400125 __le16 version;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200126 /* Max number of TxPD FW can handle */
David Woodhouse981f1872007-05-25 23:36:54 -0400127 __le16 nr_txpd;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200128 /* Max no of Multicast address */
David Woodhouse981f1872007-05-25 23:36:54 -0400129 __le16 nr_mcast_adr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200130 /* MAC address */
131 u8 permanentaddr[6];
132
133 /* region Code */
David Woodhouse981f1872007-05-25 23:36:54 -0400134 __le16 regioncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200135
136 /* Number of antenna used */
David Woodhouse981f1872007-05-25 23:36:54 -0400137 __le16 nr_antenna;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200138
Holger Schurigdac10a92008-01-16 15:55:22 +0100139 /* FW release number, example 0x01030304 = 2.3.4p1 */
140 __le32 fwrelease;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200141
142 /* Base Address of TxPD queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400143 __le32 wcb_base;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200144 /* Read Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400145 __le32 rxpd_rdptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200146
147 /* Write Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400148 __le32 rxpd_wrptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200149
150 /*FW/HW capability */
David Woodhouse981f1872007-05-25 23:36:54 -0400151 __le32 fwcapinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200152} __attribute__ ((packed));
153
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200154struct cmd_ds_802_11_subscribe_event {
David Woodhouse5844d122007-12-18 02:01:37 -0500155 struct cmd_header hdr;
156
David Woodhouse981f1872007-05-25 23:36:54 -0400157 __le16 action;
158 __le16 events;
Holger Schurig3a188642007-11-26 10:07:14 +0100159
160 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
161 * number of TLVs. From the v5.1 manual, those TLVs would add up to
162 * 40 bytes. However, future firmware might add additional TLVs, so I
163 * bump this up a bit.
164 */
David Woodhouse5844d122007-12-18 02:01:37 -0500165 uint8_t tlv[128];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800166} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200167
168/*
169 * This scan handle Country Information IE(802.11d compliant)
Dan Williams0aef64d2007-08-02 11:31:18 -0400170 * Define data structure for CMD_802_11_SCAN
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200171 */
172struct cmd_ds_802_11_scan {
David Woodhousefa62f992008-03-03 12:18:03 +0100173 struct cmd_header hdr;
174
175 uint8_t bsstype;
176 uint8_t bssid[ETH_ALEN];
177 uint8_t tlvbuffer[0];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200178#if 0
179 mrvlietypes_ssidparamset_t ssidParamSet;
180 mrvlietypes_chanlistparamset_t ChanListParamSet;
181 mrvlietypes_ratesparamset_t OpRateSet;
182#endif
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800183} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200184
185struct cmd_ds_802_11_scan_rsp {
David Woodhousefa62f992008-03-03 12:18:03 +0100186 struct cmd_header hdr;
187
David Woodhouse981f1872007-05-25 23:36:54 -0400188 __le16 bssdescriptsize;
David Woodhousefa62f992008-03-03 12:18:03 +0100189 uint8_t nr_sets;
190 uint8_t bssdesc_and_tlvbuffer[0];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800191} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200192
193struct cmd_ds_802_11_get_log {
Holger Schurigc49c3b72008-03-17 12:45:58 +0100194 struct cmd_header hdr;
195
David Woodhouse981f1872007-05-25 23:36:54 -0400196 __le32 mcasttxframe;
197 __le32 failed;
198 __le32 retry;
199 __le32 multiretry;
200 __le32 framedup;
201 __le32 rtssuccess;
202 __le32 rtsfailure;
203 __le32 ackfailure;
204 __le32 rxfrag;
205 __le32 mcastrxframe;
206 __le32 fcserror;
207 __le32 txframe;
208 __le32 wepundecryptable;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800209} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200210
211struct cmd_ds_mac_control {
Holger Schurig835d3ac2008-03-12 16:05:40 +0100212 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400213 __le16 action;
Holger Schurig835d3ac2008-03-12 16:05:40 +0100214 u16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800215} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200216
217struct cmd_ds_mac_multicast_adr {
David Woodhouse75bf45a2008-05-20 13:32:45 +0100218 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400219 __le16 action;
220 __le16 nr_of_adrs;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200221 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800222} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200223
Colin McCabeb4836592009-01-02 19:00:22 -0800224struct cmd_ds_gspi_bus_config {
225 struct cmd_header hdr;
226 __le16 action;
227 __le16 bus_delay_mode;
228 __le16 host_time_delay_to_read_port;
229 __le16 host_time_delay_to_read_register;
230} __attribute__ ((packed));
231
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200232struct cmd_ds_802_11_authenticate {
233 u8 macaddr[ETH_ALEN];
234 u8 authtype;
235 u8 reserved[10];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800236} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200237
238struct cmd_ds_802_11_deauthenticate {
Dan Williams191bb402008-08-21 17:46:18 -0400239 struct cmd_header hdr;
240
241 u8 macaddr[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400242 __le16 reasoncode;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800243} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200244
245struct cmd_ds_802_11_associate {
246 u8 peerstaaddr[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400247 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400248 __le16 listeninterval;
249 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200250 u8 dtimperiod;
251
252#if 0
253 mrvlietypes_ssidparamset_t ssidParamSet;
254 mrvlietypes_phyparamset_t phyparamset;
255 mrvlietypes_ssparamset_t ssparamset;
256 mrvlietypes_ratesparamset_t ratesParamSet;
257#endif
258} __attribute__ ((packed));
259
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200260struct cmd_ds_802_11_associate_rsp {
261 struct ieeetypes_assocrsp assocRsp;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800262} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200263
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200264struct cmd_ds_802_11_set_wep {
David Woodhousef70dd452007-12-18 00:18:05 -0500265 struct cmd_header hdr;
266
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200267 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400268 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200269
270 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400271 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200272
273 /* 40, 128bit or TXWEP */
David Woodhousef70dd452007-12-18 00:18:05 -0500274 uint8_t keytype[4];
275 uint8_t keymaterial[4][16];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800276} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200277
278struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400279 __le32 xmitok;
280 __le32 rcvok;
281 __le32 xmiterror;
282 __le32 rcverror;
283 __le32 rcvnobuffer;
284 __le32 rcvcrcerror;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800285} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200286
287struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400288 __le32 txfragmentcnt;
289 __le32 mcasttxframecnt;
290 __le32 failedcnt;
291 __le32 retrycnt;
292 __le32 Multipleretrycnt;
293 __le32 rtssuccesscnt;
294 __le32 rtsfailurecnt;
295 __le32 ackfailurecnt;
296 __le32 frameduplicatecnt;
297 __le32 rxfragmentcnt;
298 __le32 mcastrxframecnt;
299 __le32 fcserrorcnt;
300 __le32 bcasttxframecnt;
301 __le32 bcastrxframecnt;
302 __le32 txbeacon;
303 __le32 rxbeacon;
304 __le32 wepundecryptable;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800305} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200306
307struct cmd_ds_802_11_snmp_mib {
Dan Williams39fcf7a2008-09-10 12:49:00 -0400308 struct cmd_header hdr;
309
310 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400311 __le16 oid;
312 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200313 u8 value[128];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800314} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200315
316struct cmd_ds_mac_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400317 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200318 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400319 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800320} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200321
322struct cmd_ds_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400323 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200324 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400325 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800326} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200327
328struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400329 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200330 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400331 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800332} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200333
334struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400335 __le16 action;
336 __le16 offset;
337 __le32 value;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800338} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200339
340struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400341 __le16 action;
342 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200343 u8 value;
344 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800345} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200346
347struct cmd_ds_rf_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400348 __le16 action;
349 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200350 u8 value;
351 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800352} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200353
354struct cmd_ds_802_11_radio_control {
David Woodhousea7c45892007-12-17 22:43:48 -0500355 struct cmd_header hdr;
356
David Woodhouse981f1872007-05-25 23:36:54 -0400357 __le16 action;
358 __le16 control;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800359} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200360
Brajesh Dave96287ac2007-11-20 17:44:28 -0500361struct cmd_ds_802_11_beacon_control {
362 __le16 action;
363 __le16 beacon_enable;
364 __le16 beacon_period;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800365} __attribute__ ((packed));
Brajesh Dave96287ac2007-11-20 17:44:28 -0500366
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200367struct cmd_ds_802_11_sleep_params {
David Woodhouse3fbe1042007-12-17 23:48:31 -0500368 struct cmd_header hdr;
369
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200370 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400371 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200372
373 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400374 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200375
376 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400377 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200378
379 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400380 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200381
382 /* control periodic calibration */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500383 uint8_t calcontrol;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200384
385 /* control the use of external sleep clock */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500386 uint8_t externalsleepclk;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200387
388 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400389 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800390} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200391
392struct cmd_ds_802_11_inactivity_timeout {
David Woodhouse6e5cc4f2007-12-17 23:04:37 -0500393 struct cmd_header hdr;
394
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200395 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400396 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200397
398 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400399 __le16 timeout;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800400} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200401
402struct cmd_ds_802_11_rf_channel {
Dan Williams2dd4b262007-12-11 16:54:15 -0500403 struct cmd_header hdr;
404
David Woodhouse981f1872007-05-25 23:36:54 -0400405 __le16 action;
Dan Williams2dd4b262007-12-11 16:54:15 -0500406 __le16 channel;
407 __le16 rftype; /* unused */
408 __le16 reserved; /* unused */
409 u8 channellist[32]; /* unused */
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800410} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200411
412struct cmd_ds_802_11_rssi {
413 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400414 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200415
David Woodhouse981f1872007-05-25 23:36:54 -0400416 __le16 reserved_0;
417 __le16 reserved_1;
418 __le16 reserved_2;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800419} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200420
421struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400422 __le16 SNR;
423 __le16 noisefloor;
424 __le16 avgSNR;
425 __le16 avgnoisefloor;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800426} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200427
428struct cmd_ds_802_11_mac_address {
Holger Schurig2af9f032008-03-26 09:58:32 +0100429 struct cmd_header hdr;
430
David Woodhouse981f1872007-05-25 23:36:54 -0400431 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200432 u8 macadd[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800433} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200434
435struct cmd_ds_802_11_rf_tx_power {
Dan Williams87c8c722008-08-19 15:15:35 -0400436 struct cmd_header hdr;
437
David Woodhouse981f1872007-05-25 23:36:54 -0400438 __le16 action;
Dan Williams87c8c722008-08-19 15:15:35 -0400439 __le16 curlevel;
440 s8 maxlevel;
441 s8 minlevel;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800442} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200443
444struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400445 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200446
447 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400448 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200449
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800450} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200451
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400452struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000453 __le16 action;
454 __le16 mode;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800455} __attribute__ ((packed));
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400456
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400457struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500458 struct cmd_header hdr;
459
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000460 __le16 action;
461 __le16 version;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800462} __attribute__ ((packed));
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400463
David Woodhousec6ad3732007-12-16 21:43:40 -0500464struct cmd_ds_802_11_fw_wake_method {
465 struct cmd_header hdr;
466
467 __le16 action;
468 __le16 method;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800469} __attribute__ ((packed));
David Woodhousec6ad3732007-12-16 21:43:40 -0500470
471struct cmd_ds_802_11_sleep_period {
472 struct cmd_header hdr;
473
474 __le16 action;
475 __le16 period;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800476} __attribute__ ((packed));
David Woodhousec6ad3732007-12-16 21:43:40 -0500477
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200478struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400479 __le16 action;
480 __le16 nullpktinterval;
481 __le16 multipledtim;
482 __le16 reserved;
483 __le16 locallisteninterval;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800484} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200485
Holger Schurigf539f2e2008-03-26 13:22:11 +0100486struct cmd_confirm_sleep {
487 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200488
David Woodhouse981f1872007-05-25 23:36:54 -0400489 __le16 action;
Holger Schurigf539f2e2008-03-26 13:22:11 +0100490 __le16 nullpktinterval;
David Woodhouse981f1872007-05-25 23:36:54 -0400491 __le16 multipledtim;
492 __le16 reserved;
493 __le16 locallisteninterval;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800494} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200495
496struct cmd_ds_802_11_data_rate {
Dan Williams8e3c91b2007-12-11 15:50:59 -0500497 struct cmd_header hdr;
498
David Woodhouse981f1872007-05-25 23:36:54 -0400499 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400500 __le16 reserved;
501 u8 rates[MAX_RATES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800502} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200503
504struct cmd_ds_802_11_rate_adapt_rateset {
Javier Cardona85319f92008-05-24 10:59:49 +0100505 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400506 __le16 action;
507 __le16 enablehwauto;
508 __le16 bitmap;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800509} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200510
511struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400512 struct cmd_header hdr;
513
Dan Williamsb44898e2007-08-02 11:18:40 -0400514 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200515 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400516 __le16 beaconperiod;
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400517 u8 dtimperiod; /* Reserved on v9 and later */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200518 union IEEEtypes_ssparamset ssparamset;
519 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400520 __le16 probedelay;
Dan Williams0c9ca692007-08-02 10:43:44 -0400521 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400522 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200523 u8 tlv_memory_size_pad[100];
524} __attribute__ ((packed));
525
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400526struct cmd_ds_802_11_ad_hoc_result {
527 struct cmd_header hdr;
528
529 u8 pad[3];
530 u8 bssid[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800531} __attribute__ ((packed));
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400532
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200533struct adhoc_bssdesc {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400534 u8 bssid[ETH_ALEN];
535 u8 ssid[IW_ESSID_MAX_SIZE];
Dan Williams0c9ca692007-08-02 10:43:44 -0400536 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400537 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200538 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400539 __le64 timestamp;
540 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200541 union ieeetypes_phyparamset phyparamset;
542 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca692007-08-02 10:43:44 -0400543 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400544 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200545
546 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
547 * Adhoc join command and will cause a binary layout mismatch with
548 * the firmware
549 */
550} __attribute__ ((packed));
551
552struct cmd_ds_802_11_ad_hoc_join {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400553 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200554
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400555 struct adhoc_bssdesc bss;
556 __le16 failtimeout; /* Reserved on v9 and later */
557 __le16 probedelay; /* Reserved on v9 and later */
558} __attribute__ ((packed));
559
560struct cmd_ds_802_11_ad_hoc_stop {
561 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200562} __attribute__ ((packed));
563
564struct cmd_ds_802_11_enable_rsn {
David Woodhouse4f59abf2007-12-18 00:47:17 -0500565 struct cmd_header hdr;
566
David Woodhouse981f1872007-05-25 23:36:54 -0400567 __le16 action;
568 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400569} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200570
571struct MrvlIEtype_keyParamSet {
572 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400573 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200574
575 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400576 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200577
578 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400579 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200580
581 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400582 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200583
584 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400585 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200586
587 /* key material of size keylen */
588 u8 key[32];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800589} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200590
Anna Neal582c1b52008-10-20 16:46:56 -0700591#define MAX_WOL_RULES 16
592
593struct host_wol_rule {
594 uint8_t rule_no;
595 uint8_t rule_ops;
596 __le16 sig_offset;
597 __le16 sig_length;
598 __le16 reserve;
599 __be32 sig_mask;
600 __be32 signature;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800601} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700602
603struct wol_config {
604 uint8_t action;
605 uint8_t pattern;
606 uint8_t no_rules_in_cmd;
607 uint8_t result;
608 struct host_wol_rule rule[MAX_WOL_RULES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800609} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700610
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500611struct cmd_ds_host_sleep {
612 struct cmd_header hdr;
613 __le32 criteria;
614 uint8_t gpio;
Anna Neal582c1b52008-10-20 16:46:56 -0700615 uint16_t gap;
616 struct wol_config wol_conf;
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500617} __attribute__ ((packed));
618
Anna Neal582c1b52008-10-20 16:46:56 -0700619
620
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200621struct cmd_ds_802_11_key_material {
David Woodhouse9e1228d2008-03-03 12:15:39 +0100622 struct cmd_header hdr;
623
David Woodhouse981f1872007-05-25 23:36:54 -0400624 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200625 struct MrvlIEtype_keyParamSet keyParamSet[2];
626} __attribute__ ((packed));
627
628struct cmd_ds_802_11_eeprom_access {
Holger Schurig7460f5a2008-03-26 10:03:48 +0100629 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400630 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400631 __le16 offset;
Holger Schurig7460f5a2008-03-26 10:03:48 +0100632 __le16 len;
633 /* firmware says it returns a maximum of 20 bytes */
634#define LBS_EEPROM_READ_LEN 20
635 u8 value[LBS_EEPROM_READ_LEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200636} __attribute__ ((packed));
637
638struct cmd_ds_802_11_tpc_cfg {
Anna Neal0112c9e2008-09-11 11:17:25 -0700639 struct cmd_header hdr;
640
David Woodhouse981f1872007-05-25 23:36:54 -0400641 __le16 action;
Anna Neal0112c9e2008-09-11 11:17:25 -0700642 uint8_t enable;
643 int8_t P0;
644 int8_t P1;
645 int8_t P2;
646 uint8_t usesnr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200647} __attribute__ ((packed));
648
Anna Neal0112c9e2008-09-11 11:17:25 -0700649
650struct cmd_ds_802_11_pa_cfg {
651 struct cmd_header hdr;
652
653 __le16 action;
654 uint8_t enable;
655 int8_t P0;
656 int8_t P1;
657 int8_t P2;
658} __attribute__ ((packed));
659
660
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200661struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400662 __le16 action;
663 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200664 u8 data[256];
665} __attribute__ ((packed));
666
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200667struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400668 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200669 union {
670 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400671 __le16 threshold;
672 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200673 };
674 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400675 __le16 timing_offset; /* signed */
676 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200677 };
678 };
679} __attribute__ ((packed));
680
681struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400682 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200683} __attribute__ ((packed));
684
685struct cmd_ds_get_tsf {
686 __le64 tsfvalue;
687} __attribute__ ((packed));
688
689struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400690 __le16 action;
691 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200692 u8 addr1[ETH_ALEN];
693 u8 addr2[ETH_ALEN];
694} __attribute__ ((packed));
695
696struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400697 __le16 action;
698 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400699 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200700 u8 da[ETH_ALEN];
701 u8 dir;
702 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400703 __le32 ssn;
704 __le32 dsn;
705 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400706 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200707 u8 hopcount;
708 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400709 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200710 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400711 __le32 snr;
712 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400713 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200714} __attribute__ ((packed));
715
David Woodhouse23a397a2007-12-11 18:56:42 -0500716
717struct cmd_ds_mesh_config {
718 struct cmd_header hdr;
719
720 __le16 action;
721 __le16 channel;
722 __le16 type;
723 __le16 length;
724 u8 data[128]; /* last position reserved */
725} __attribute__ ((packed));
726
727
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200728struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500729 struct cmd_header hdr;
730
David Woodhouse981f1872007-05-25 23:36:54 -0400731 __le16 action;
732 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200733} __attribute__ ((packed));
734
Javier Cardona0601e7e2007-05-25 12:12:06 -0400735/* Number of stats counters returned by the firmware */
736#define MESH_STATS_NUM 8
737
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200738struct cmd_ds_command {
739 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400740 __le16 command;
741 __le16 size;
742 __le16 seqnum;
743 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200744
745 /* command Body */
746 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200747 struct cmd_ds_802_11_ps_mode psmode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200748 struct cmd_ds_802_11_associate associate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200749 struct cmd_ds_802_11_authenticate auth;
750 struct cmd_ds_802_11_get_stat gstat;
751 struct cmd_ds_802_3_get_stat gstat_8023;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200752 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400753 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200754 struct cmd_ds_802_11_rssi rssi;
755 struct cmd_ds_802_11_rssi_rsp rssirsp;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200756 struct cmd_ds_mac_reg_access macreg;
757 struct cmd_ds_bbp_reg_access bbpreg;
758 struct cmd_ds_rf_reg_access rfreg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200759
760 struct cmd_ds_802_11d_domain_info domaininfo;
761 struct cmd_ds_802_11d_domain_info domaininforesp;
762
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200763 struct cmd_ds_802_11_tpc_cfg tpccfg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200764 struct cmd_ds_802_11_afc afc;
765 struct cmd_ds_802_11_led_ctrl ledgpio;
766
767 struct cmd_tx_rate_query txrate;
768 struct cmd_ds_bt_access bt;
769 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200770 struct cmd_ds_get_tsf gettsf;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500771 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200772 } params;
773} __attribute__ ((packed));
774
775#endif