blob: 391c54ab2b0902e2396cdf51cd74366bddbdbb1d [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 {
281 struct ieeetypes_assocrsp assocRsp;
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 */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200538 union IEEEtypes_ssparamset ssparamset;
539 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400540 __le16 probedelay;
Dan Williams0c9ca692007-08-02 10:43:44 -0400541 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400542 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200543 u8 tlv_memory_size_pad[100];
544} __attribute__ ((packed));
545
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400546struct cmd_ds_802_11_ad_hoc_result {
547 struct cmd_header hdr;
548
549 u8 pad[3];
550 u8 bssid[ETH_ALEN];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800551} __attribute__ ((packed));
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400552
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200553struct adhoc_bssdesc {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400554 u8 bssid[ETH_ALEN];
555 u8 ssid[IW_ESSID_MAX_SIZE];
Dan Williams0c9ca692007-08-02 10:43:44 -0400556 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400557 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200558 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400559 __le64 timestamp;
560 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200561 union ieeetypes_phyparamset phyparamset;
562 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca692007-08-02 10:43:44 -0400563 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400564 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200565
566 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
567 * Adhoc join command and will cause a binary layout mismatch with
568 * the firmware
569 */
570} __attribute__ ((packed));
571
572struct cmd_ds_802_11_ad_hoc_join {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400573 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200574
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400575 struct adhoc_bssdesc bss;
576 __le16 failtimeout; /* Reserved on v9 and later */
577 __le16 probedelay; /* Reserved on v9 and later */
578} __attribute__ ((packed));
579
580struct cmd_ds_802_11_ad_hoc_stop {
581 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200582} __attribute__ ((packed));
583
584struct cmd_ds_802_11_enable_rsn {
David Woodhouse4f59abf2007-12-18 00:47:17 -0500585 struct cmd_header hdr;
586
David Woodhouse981f1872007-05-25 23:36:54 -0400587 __le16 action;
588 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400589} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200590
591struct MrvlIEtype_keyParamSet {
592 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400593 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200594
595 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400596 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200597
598 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400599 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200600
601 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400602 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200603
604 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400605 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200606
607 /* key material of size keylen */
608 u8 key[32];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800609} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200610
Anna Neal582c1b52008-10-20 16:46:56 -0700611#define MAX_WOL_RULES 16
612
613struct host_wol_rule {
614 uint8_t rule_no;
615 uint8_t rule_ops;
616 __le16 sig_offset;
617 __le16 sig_length;
618 __le16 reserve;
619 __be32 sig_mask;
620 __be32 signature;
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800621} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700622
623struct wol_config {
624 uint8_t action;
625 uint8_t pattern;
626 uint8_t no_rules_in_cmd;
627 uint8_t result;
628 struct host_wol_rule rule[MAX_WOL_RULES];
Andrey Yurovskyd71038c2009-01-12 13:14:27 -0800629} __attribute__ ((packed));
Anna Neal582c1b52008-10-20 16:46:56 -0700630
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500631struct cmd_ds_host_sleep {
632 struct cmd_header hdr;
633 __le32 criteria;
634 uint8_t gpio;
Anna Neal582c1b52008-10-20 16:46:56 -0700635 uint16_t gap;
636 struct wol_config wol_conf;
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500637} __attribute__ ((packed));
638
Anna Neal582c1b52008-10-20 16:46:56 -0700639
640
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200641struct cmd_ds_802_11_key_material {
David Woodhouse9e1228d2008-03-03 12:15:39 +0100642 struct cmd_header hdr;
643
David Woodhouse981f1872007-05-25 23:36:54 -0400644 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200645 struct MrvlIEtype_keyParamSet keyParamSet[2];
646} __attribute__ ((packed));
647
648struct cmd_ds_802_11_eeprom_access {
Holger Schurig7460f5a2008-03-26 10:03:48 +0100649 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400650 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400651 __le16 offset;
Holger Schurig7460f5a2008-03-26 10:03:48 +0100652 __le16 len;
653 /* firmware says it returns a maximum of 20 bytes */
654#define LBS_EEPROM_READ_LEN 20
655 u8 value[LBS_EEPROM_READ_LEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200656} __attribute__ ((packed));
657
658struct cmd_ds_802_11_tpc_cfg {
Anna Neal0112c9e2008-09-11 11:17:25 -0700659 struct cmd_header hdr;
660
David Woodhouse981f1872007-05-25 23:36:54 -0400661 __le16 action;
Anna Neal0112c9e2008-09-11 11:17:25 -0700662 uint8_t enable;
663 int8_t P0;
664 int8_t P1;
665 int8_t P2;
666 uint8_t usesnr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200667} __attribute__ ((packed));
668
Anna Neal0112c9e2008-09-11 11:17:25 -0700669
670struct cmd_ds_802_11_pa_cfg {
671 struct cmd_header hdr;
672
673 __le16 action;
674 uint8_t enable;
675 int8_t P0;
676 int8_t P1;
677 int8_t P2;
678} __attribute__ ((packed));
679
680
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200681struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400682 __le16 action;
683 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200684 u8 data[256];
685} __attribute__ ((packed));
686
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200687struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400688 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200689 union {
690 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400691 __le16 threshold;
692 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200693 };
694 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400695 __le16 timing_offset; /* signed */
696 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200697 };
698 };
699} __attribute__ ((packed));
700
701struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400702 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200703} __attribute__ ((packed));
704
705struct cmd_ds_get_tsf {
706 __le64 tsfvalue;
707} __attribute__ ((packed));
708
709struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400710 __le16 action;
711 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200712 u8 addr1[ETH_ALEN];
713 u8 addr2[ETH_ALEN];
714} __attribute__ ((packed));
715
716struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400717 __le16 action;
718 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400719 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200720 u8 da[ETH_ALEN];
721 u8 dir;
722 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400723 __le32 ssn;
724 __le32 dsn;
725 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400726 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200727 u8 hopcount;
728 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400729 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200730 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400731 __le32 snr;
732 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400733 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200734} __attribute__ ((packed));
735
David Woodhouse23a397a2007-12-11 18:56:42 -0500736
737struct cmd_ds_mesh_config {
738 struct cmd_header hdr;
739
740 __le16 action;
741 __le16 channel;
742 __le16 type;
743 __le16 length;
744 u8 data[128]; /* last position reserved */
745} __attribute__ ((packed));
746
747
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200748struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500749 struct cmd_header hdr;
750
David Woodhouse981f1872007-05-25 23:36:54 -0400751 __le16 action;
752 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200753} __attribute__ ((packed));
754
Javier Cardona0601e7e2007-05-25 12:12:06 -0400755/* Number of stats counters returned by the firmware */
756#define MESH_STATS_NUM 8
757
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200758struct cmd_ds_command {
759 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400760 __le16 command;
761 __le16 size;
762 __le16 seqnum;
763 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200764
765 /* command Body */
766 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200767 struct cmd_ds_802_11_ps_mode psmode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200768 struct cmd_ds_802_11_associate associate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200769 struct cmd_ds_802_11_authenticate auth;
770 struct cmd_ds_802_11_get_stat gstat;
771 struct cmd_ds_802_3_get_stat gstat_8023;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200772 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400773 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200774 struct cmd_ds_802_11_rssi rssi;
775 struct cmd_ds_802_11_rssi_rsp rssirsp;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200776 struct cmd_ds_mac_reg_access macreg;
777 struct cmd_ds_bbp_reg_access bbpreg;
778 struct cmd_ds_rf_reg_access rfreg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200779
780 struct cmd_ds_802_11d_domain_info domaininfo;
781 struct cmd_ds_802_11d_domain_info domaininforesp;
782
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200783 struct cmd_ds_802_11_tpc_cfg tpccfg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200784 struct cmd_ds_802_11_afc afc;
785 struct cmd_ds_802_11_led_ctrl ledgpio;
786
787 struct cmd_tx_rate_query txrate;
788 struct cmd_ds_bt_access bt;
789 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200790 struct cmd_ds_get_tsf gettsf;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500791 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200792 } params;
793} __attribute__ ((packed));
794
795#endif