blob: 463ff977995c47a34f3775248174d8ce22d2e399 [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;
59 } bss;
60 } 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 {
253 u8 macaddr[ETH_ALEN];
254 u8 authtype;
255 u8 reserved[10];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800256} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200257
258struct cmd_ds_802_11_deauthenticate {
Dan Williams191bb402008-08-21 17:46:18 -0400259 struct cmd_header hdr;
260
261 u8 macaddr[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400262 __le16 reasoncode;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800263} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200264
265struct cmd_ds_802_11_associate {
266 u8 peerstaaddr[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400267 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400268 __le16 listeninterval;
269 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200270 u8 dtimperiod;
271
272#if 0
273 mrvlietypes_ssidparamset_t ssidParamSet;
274 mrvlietypes_phyparamset_t phyparamset;
275 mrvlietypes_ssparamset_t ssparamset;
276 mrvlietypes_ratesparamset_t ratesParamSet;
277#endif
278} __attribute__ ((packed));
279
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200280struct cmd_ds_802_11_associate_rsp {
Dan Williams5fd164e2009-05-22 20:01:21 -0400281 struct ieee_assoc_response response;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800282} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200283
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200284struct cmd_ds_802_11_set_wep {
David Woodhousef70dd452007-12-18 00:18:05 -0500285 struct cmd_header hdr;
286
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200287 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400288 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200289
290 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400291 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200292
293 /* 40, 128bit or TXWEP */
David Woodhousef70dd452007-12-18 00:18:05 -0500294 uint8_t keytype[4];
295 uint8_t keymaterial[4][16];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800296} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200297
298struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400299 __le32 xmitok;
300 __le32 rcvok;
301 __le32 xmiterror;
302 __le32 rcverror;
303 __le32 rcvnobuffer;
304 __le32 rcvcrcerror;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800305} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200306
307struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400308 __le32 txfragmentcnt;
309 __le32 mcasttxframecnt;
310 __le32 failedcnt;
311 __le32 retrycnt;
312 __le32 Multipleretrycnt;
313 __le32 rtssuccesscnt;
314 __le32 rtsfailurecnt;
315 __le32 ackfailurecnt;
316 __le32 frameduplicatecnt;
317 __le32 rxfragmentcnt;
318 __le32 mcastrxframecnt;
319 __le32 fcserrorcnt;
320 __le32 bcasttxframecnt;
321 __le32 bcastrxframecnt;
322 __le32 txbeacon;
323 __le32 rxbeacon;
324 __le32 wepundecryptable;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800325} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200326
327struct cmd_ds_802_11_snmp_mib {
Dan Williams39fcf7a2008-09-10 12:49:00 -0400328 struct cmd_header hdr;
329
330 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400331 __le16 oid;
332 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200333 u8 value[128];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800334} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200335
336struct cmd_ds_mac_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400337 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200338 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400339 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800340} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200341
342struct cmd_ds_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400343 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200344 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400345 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800346} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200347
348struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400349 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200350 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400351 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800352} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200353
354struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400355 __le16 action;
356 __le16 offset;
357 __le32 value;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800358} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200359
360struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400361 __le16 action;
362 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200363 u8 value;
364 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800365} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200366
367struct cmd_ds_rf_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400368 __le16 action;
369 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200370 u8 value;
371 u8 reserved[3];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800372} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200373
374struct cmd_ds_802_11_radio_control {
David Woodhousea7c45892007-12-17 22:43:48 -0500375 struct cmd_header hdr;
376
David Woodhouse981f1872007-05-25 23:36:54 -0400377 __le16 action;
378 __le16 control;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800379} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200380
Brajesh Dave96287ac2007-11-20 17:44:28 -0500381struct cmd_ds_802_11_beacon_control {
382 __le16 action;
383 __le16 beacon_enable;
384 __le16 beacon_period;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800385} __attribute__ ((packed));
Brajesh Dave96287ac2007-11-20 17:44:28 -0500386
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200387struct cmd_ds_802_11_sleep_params {
David Woodhouse3fbe1042007-12-17 23:48:31 -0500388 struct cmd_header hdr;
389
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200390 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400391 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200392
393 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400394 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200395
396 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400397 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200398
399 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400400 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200401
402 /* control periodic calibration */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500403 uint8_t calcontrol;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200404
405 /* control the use of external sleep clock */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500406 uint8_t externalsleepclk;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200407
408 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400409 __le16 reserved;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800410} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200411
412struct cmd_ds_802_11_inactivity_timeout {
David Woodhouse6e5cc4f2007-12-17 23:04:37 -0500413 struct cmd_header hdr;
414
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200415 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400416 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200417
418 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400419 __le16 timeout;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800420} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200421
422struct cmd_ds_802_11_rf_channel {
Dan Williams2dd4b262007-12-11 16:54:15 -0500423 struct cmd_header hdr;
424
David Woodhouse981f1872007-05-25 23:36:54 -0400425 __le16 action;
Dan Williams2dd4b262007-12-11 16:54:15 -0500426 __le16 channel;
427 __le16 rftype; /* unused */
428 __le16 reserved; /* unused */
429 u8 channellist[32]; /* unused */
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800430} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200431
432struct cmd_ds_802_11_rssi {
433 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400434 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200435
David Woodhouse981f1872007-05-25 23:36:54 -0400436 __le16 reserved_0;
437 __le16 reserved_1;
438 __le16 reserved_2;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800439} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200440
441struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400442 __le16 SNR;
443 __le16 noisefloor;
444 __le16 avgSNR;
445 __le16 avgnoisefloor;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800446} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200447
448struct cmd_ds_802_11_mac_address {
Holger Schurig2af9f032008-03-26 09:58:32 +0100449 struct cmd_header hdr;
450
David Woodhouse981f1872007-05-25 23:36:54 -0400451 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200452 u8 macadd[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800453} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200454
455struct cmd_ds_802_11_rf_tx_power {
Dan Williams87c8c722008-08-19 15:15:35 -0400456 struct cmd_header hdr;
457
David Woodhouse981f1872007-05-25 23:36:54 -0400458 __le16 action;
Dan Williams87c8c722008-08-19 15:15:35 -0400459 __le16 curlevel;
460 s8 maxlevel;
461 s8 minlevel;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800462} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200463
464struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400465 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200466
467 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400468 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200469
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800470} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200471
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400472struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000473 __le16 action;
474 __le16 mode;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800475} __attribute__ ((packed));
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400476
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400477struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500478 struct cmd_header hdr;
479
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000480 __le16 action;
481 __le16 version;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800482} __attribute__ ((packed));
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400483
David Woodhousec6ad3732007-12-16 21:43:40 -0500484struct cmd_ds_802_11_fw_wake_method {
485 struct cmd_header hdr;
486
487 __le16 action;
488 __le16 method;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800489} __attribute__ ((packed));
David Woodhousec6ad3732007-12-16 21:43:40 -0500490
491struct cmd_ds_802_11_sleep_period {
492 struct cmd_header hdr;
493
494 __le16 action;
495 __le16 period;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800496} __attribute__ ((packed));
David Woodhousec6ad3732007-12-16 21:43:40 -0500497
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200498struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400499 __le16 action;
500 __le16 nullpktinterval;
501 __le16 multipledtim;
502 __le16 reserved;
503 __le16 locallisteninterval;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800504} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200505
Holger Schurigf539f2e2008-03-26 13:22:11 +0100506struct cmd_confirm_sleep {
507 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200508
David Woodhouse981f1872007-05-25 23:36:54 -0400509 __le16 action;
Holger Schurigf539f2e2008-03-26 13:22:11 +0100510 __le16 nullpktinterval;
David Woodhouse981f1872007-05-25 23:36:54 -0400511 __le16 multipledtim;
512 __le16 reserved;
513 __le16 locallisteninterval;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800514} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200515
516struct cmd_ds_802_11_data_rate {
Dan Williams8e3c91b2007-12-11 15:50:59 -0500517 struct cmd_header hdr;
518
David Woodhouse981f1872007-05-25 23:36:54 -0400519 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400520 __le16 reserved;
521 u8 rates[MAX_RATES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800522} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200523
524struct cmd_ds_802_11_rate_adapt_rateset {
Javier Cardona85319f92008-05-24 10:59:49 +0100525 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400526 __le16 action;
527 __le16 enablehwauto;
528 __le16 bitmap;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800529} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200530
531struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400532 struct cmd_header hdr;
533
Dan Williamsb44898e2007-08-02 11:18:40 -0400534 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200535 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400536 __le16 beaconperiod;
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400537 u8 dtimperiod; /* Reserved on v9 and later */
Dan Williams5fd164e2009-05-22 20:01:21 -0400538 struct ieee_ie_ibss_param_set ibss;
539 u8 reserved1[4];
540 struct ieee_ie_ds_param_set ds;
541 u8 reserved2[4];
542 __le16 probedelay; /* Reserved on v9 and later */
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 u8 tlv_memory_size_pad[100];
546} __attribute__ ((packed));
547
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400548struct cmd_ds_802_11_ad_hoc_result {
549 struct cmd_header hdr;
550
551 u8 pad[3];
552 u8 bssid[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800553} __attribute__ ((packed));
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400554
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200555struct adhoc_bssdesc {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400556 u8 bssid[ETH_ALEN];
557 u8 ssid[IW_ESSID_MAX_SIZE];
Dan Williams0c9ca692007-08-02 10:43:44 -0400558 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400559 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200560 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400561 __le64 timestamp;
562 __le64 localtime;
Dan Williams5fd164e2009-05-22 20:01:21 -0400563 struct ieee_ie_ds_param_set ds;
564 u8 reserved1[4];
565 struct ieee_ie_ibss_param_set ibss;
566 u8 reserved2[4];
Dan Williams0c9ca692007-08-02 10:43:44 -0400567 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400568 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200569
570 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
571 * Adhoc join command and will cause a binary layout mismatch with
572 * the firmware
573 */
574} __attribute__ ((packed));
575
576struct cmd_ds_802_11_ad_hoc_join {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400577 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200578
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400579 struct adhoc_bssdesc bss;
580 __le16 failtimeout; /* Reserved on v9 and later */
581 __le16 probedelay; /* Reserved on v9 and later */
582} __attribute__ ((packed));
583
584struct cmd_ds_802_11_ad_hoc_stop {
585 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200586} __attribute__ ((packed));
587
588struct cmd_ds_802_11_enable_rsn {
David Woodhouse4f59abf2007-12-18 00:47:17 -0500589 struct cmd_header hdr;
590
David Woodhouse981f1872007-05-25 23:36:54 -0400591 __le16 action;
592 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400593} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200594
595struct MrvlIEtype_keyParamSet {
596 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400597 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200598
599 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400600 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200601
602 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400603 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200604
605 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400606 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200607
608 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400609 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200610
611 /* key material of size keylen */
612 u8 key[32];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800613} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200614
Anna Neal582c1b52008-10-20 16:46:56 -0700615#define MAX_WOL_RULES 16
616
617struct host_wol_rule {
618 uint8_t rule_no;
619 uint8_t rule_ops;
620 __le16 sig_offset;
621 __le16 sig_length;
622 __le16 reserve;
623 __be32 sig_mask;
624 __be32 signature;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800625} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700626
627struct wol_config {
628 uint8_t action;
629 uint8_t pattern;
630 uint8_t no_rules_in_cmd;
631 uint8_t result;
632 struct host_wol_rule rule[MAX_WOL_RULES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800633} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700634
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500635struct cmd_ds_host_sleep {
636 struct cmd_header hdr;
637 __le32 criteria;
638 uint8_t gpio;
Anna Neal582c1b52008-10-20 16:46:56 -0700639 uint16_t gap;
640 struct wol_config wol_conf;
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500641} __attribute__ ((packed));
642
Anna Neal582c1b52008-10-20 16:46:56 -0700643
644
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200645struct cmd_ds_802_11_key_material {
David Woodhouse9e1228d2008-03-03 12:15:39 +0100646 struct cmd_header hdr;
647
David Woodhouse981f1872007-05-25 23:36:54 -0400648 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200649 struct MrvlIEtype_keyParamSet keyParamSet[2];
650} __attribute__ ((packed));
651
652struct cmd_ds_802_11_eeprom_access {
Holger Schurig7460f5a2008-03-26 10:03:48 +0100653 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400654 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400655 __le16 offset;
Holger Schurig7460f5a2008-03-26 10:03:48 +0100656 __le16 len;
657 /* firmware says it returns a maximum of 20 bytes */
658#define LBS_EEPROM_READ_LEN 20
659 u8 value[LBS_EEPROM_READ_LEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200660} __attribute__ ((packed));
661
662struct cmd_ds_802_11_tpc_cfg {
Anna Neal0112c9e2008-09-11 11:17:25 -0700663 struct cmd_header hdr;
664
David Woodhouse981f1872007-05-25 23:36:54 -0400665 __le16 action;
Anna Neal0112c9e2008-09-11 11:17:25 -0700666 uint8_t enable;
667 int8_t P0;
668 int8_t P1;
669 int8_t P2;
670 uint8_t usesnr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200671} __attribute__ ((packed));
672
Anna Neal0112c9e2008-09-11 11:17:25 -0700673
674struct cmd_ds_802_11_pa_cfg {
675 struct cmd_header hdr;
676
677 __le16 action;
678 uint8_t enable;
679 int8_t P0;
680 int8_t P1;
681 int8_t P2;
682} __attribute__ ((packed));
683
684
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200685struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400686 __le16 action;
687 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200688 u8 data[256];
689} __attribute__ ((packed));
690
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200691struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400692 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200693 union {
694 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400695 __le16 threshold;
696 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200697 };
698 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400699 __le16 timing_offset; /* signed */
700 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200701 };
702 };
703} __attribute__ ((packed));
704
705struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400706 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200707} __attribute__ ((packed));
708
709struct cmd_ds_get_tsf {
710 __le64 tsfvalue;
711} __attribute__ ((packed));
712
713struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400714 __le16 action;
715 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200716 u8 addr1[ETH_ALEN];
717 u8 addr2[ETH_ALEN];
718} __attribute__ ((packed));
719
720struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400721 __le16 action;
722 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400723 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200724 u8 da[ETH_ALEN];
725 u8 dir;
726 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400727 __le32 ssn;
728 __le32 dsn;
729 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400730 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200731 u8 hopcount;
732 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400733 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200734 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400735 __le32 snr;
736 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400737 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200738} __attribute__ ((packed));
739
David Woodhouse23a397a2007-12-11 18:56:42 -0500740
741struct cmd_ds_mesh_config {
742 struct cmd_header hdr;
743
744 __le16 action;
745 __le16 channel;
746 __le16 type;
747 __le16 length;
748 u8 data[128]; /* last position reserved */
749} __attribute__ ((packed));
750
751
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200752struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500753 struct cmd_header hdr;
754
David Woodhouse981f1872007-05-25 23:36:54 -0400755 __le16 action;
756 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200757} __attribute__ ((packed));
758
Javier Cardona0601e7e2007-05-25 12:12:06 -0400759/* Number of stats counters returned by the firmware */
760#define MESH_STATS_NUM 8
761
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200762struct cmd_ds_command {
763 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400764 __le16 command;
765 __le16 size;
766 __le16 seqnum;
767 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200768
769 /* command Body */
770 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200771 struct cmd_ds_802_11_ps_mode psmode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200772 struct cmd_ds_802_11_associate associate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200773 struct cmd_ds_802_11_authenticate auth;
774 struct cmd_ds_802_11_get_stat gstat;
775 struct cmd_ds_802_3_get_stat gstat_8023;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200776 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400777 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200778 struct cmd_ds_802_11_rssi rssi;
779 struct cmd_ds_802_11_rssi_rsp rssirsp;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200780 struct cmd_ds_mac_reg_access macreg;
781 struct cmd_ds_bbp_reg_access bbpreg;
782 struct cmd_ds_rf_reg_access rfreg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200783
784 struct cmd_ds_802_11d_domain_info domaininfo;
785 struct cmd_ds_802_11d_domain_info domaininforesp;
786
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200787 struct cmd_ds_802_11_tpc_cfg tpccfg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200788 struct cmd_ds_802_11_afc afc;
789 struct cmd_ds_802_11_led_ctrl ledgpio;
790
791 struct cmd_tx_rate_query txrate;
792 struct cmd_ds_bt_access bt;
793 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200794 struct cmd_ds_get_tsf gettsf;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500795 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200796 } params;
797} __attribute__ ((packed));
798
799#endif