blob: f2f92e237c4a23a80dff3e7ec6795354542819d1 [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;
35};
36
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];
66};
67
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;
100};
101
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];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200110};
111
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];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200166};
167
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
183};
184
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];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200191};
192
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;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200209};
210
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;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200215};
216
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];
222};
223
224struct cmd_ds_802_11_authenticate {
225 u8 macaddr[ETH_ALEN];
226 u8 authtype;
227 u8 reserved[10];
228};
229
230struct cmd_ds_802_11_deauthenticate {
Dan Williams191bb402008-08-21 17:46:18 -0400231 struct cmd_header hdr;
232
233 u8 macaddr[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400234 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200235};
236
237struct cmd_ds_802_11_associate {
238 u8 peerstaaddr[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400239 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400240 __le16 listeninterval;
241 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200242 u8 dtimperiod;
243
244#if 0
245 mrvlietypes_ssidparamset_t ssidParamSet;
246 mrvlietypes_phyparamset_t phyparamset;
247 mrvlietypes_ssparamset_t ssparamset;
248 mrvlietypes_ratesparamset_t ratesParamSet;
249#endif
250} __attribute__ ((packed));
251
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200252struct cmd_ds_802_11_associate_rsp {
253 struct ieeetypes_assocrsp assocRsp;
254};
255
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200256struct cmd_ds_802_11_set_wep {
David Woodhousef70dd452007-12-18 00:18:05 -0500257 struct cmd_header hdr;
258
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200259 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400260 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200261
262 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400263 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200264
265 /* 40, 128bit or TXWEP */
David Woodhousef70dd452007-12-18 00:18:05 -0500266 uint8_t keytype[4];
267 uint8_t keymaterial[4][16];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200268};
269
270struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400271 __le32 xmitok;
272 __le32 rcvok;
273 __le32 xmiterror;
274 __le32 rcverror;
275 __le32 rcvnobuffer;
276 __le32 rcvcrcerror;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200277};
278
279struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400280 __le32 txfragmentcnt;
281 __le32 mcasttxframecnt;
282 __le32 failedcnt;
283 __le32 retrycnt;
284 __le32 Multipleretrycnt;
285 __le32 rtssuccesscnt;
286 __le32 rtsfailurecnt;
287 __le32 ackfailurecnt;
288 __le32 frameduplicatecnt;
289 __le32 rxfragmentcnt;
290 __le32 mcastrxframecnt;
291 __le32 fcserrorcnt;
292 __le32 bcasttxframecnt;
293 __le32 bcastrxframecnt;
294 __le32 txbeacon;
295 __le32 rxbeacon;
296 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200297};
298
299struct cmd_ds_802_11_snmp_mib {
David Woodhouse981f1872007-05-25 23:36:54 -0400300 __le16 querytype;
301 __le16 oid;
302 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200303 u8 value[128];
304};
305
306struct cmd_ds_mac_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400307 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200308 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400309 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200310};
311
312struct cmd_ds_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400313 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200314 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400315 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200316};
317
318struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400319 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200320 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400321 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200322};
323
324struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400325 __le16 action;
326 __le16 offset;
327 __le32 value;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200328};
329
330struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400331 __le16 action;
332 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200333 u8 value;
334 u8 reserved[3];
335};
336
337struct cmd_ds_rf_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400338 __le16 action;
339 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200340 u8 value;
341 u8 reserved[3];
342};
343
344struct cmd_ds_802_11_radio_control {
David Woodhousea7c45892007-12-17 22:43:48 -0500345 struct cmd_header hdr;
346
David Woodhouse981f1872007-05-25 23:36:54 -0400347 __le16 action;
348 __le16 control;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200349};
350
Brajesh Dave96287ac2007-11-20 17:44:28 -0500351struct cmd_ds_802_11_beacon_control {
352 __le16 action;
353 __le16 beacon_enable;
354 __le16 beacon_period;
355};
356
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200357struct cmd_ds_802_11_sleep_params {
David Woodhouse3fbe1042007-12-17 23:48:31 -0500358 struct cmd_header hdr;
359
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200360 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400361 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200362
363 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400364 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200365
366 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400367 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200368
369 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400370 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200371
372 /* control periodic calibration */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500373 uint8_t calcontrol;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200374
375 /* control the use of external sleep clock */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500376 uint8_t externalsleepclk;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200377
378 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400379 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200380};
381
382struct cmd_ds_802_11_inactivity_timeout {
David Woodhouse6e5cc4f2007-12-17 23:04:37 -0500383 struct cmd_header hdr;
384
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200385 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400386 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200387
388 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400389 __le16 timeout;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200390};
391
392struct cmd_ds_802_11_rf_channel {
Dan Williams2dd4b262007-12-11 16:54:15 -0500393 struct cmd_header hdr;
394
David Woodhouse981f1872007-05-25 23:36:54 -0400395 __le16 action;
Dan Williams2dd4b262007-12-11 16:54:15 -0500396 __le16 channel;
397 __le16 rftype; /* unused */
398 __le16 reserved; /* unused */
399 u8 channellist[32]; /* unused */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200400};
401
402struct cmd_ds_802_11_rssi {
403 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400404 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200405
David Woodhouse981f1872007-05-25 23:36:54 -0400406 __le16 reserved_0;
407 __le16 reserved_1;
408 __le16 reserved_2;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200409};
410
411struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400412 __le16 SNR;
413 __le16 noisefloor;
414 __le16 avgSNR;
415 __le16 avgnoisefloor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200416};
417
418struct cmd_ds_802_11_mac_address {
Holger Schurig2af9f032008-03-26 09:58:32 +0100419 struct cmd_header hdr;
420
David Woodhouse981f1872007-05-25 23:36:54 -0400421 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200422 u8 macadd[ETH_ALEN];
423};
424
425struct cmd_ds_802_11_rf_tx_power {
Dan Williams87c8c722008-08-19 15:15:35 -0400426 struct cmd_header hdr;
427
David Woodhouse981f1872007-05-25 23:36:54 -0400428 __le16 action;
Dan Williams87c8c722008-08-19 15:15:35 -0400429 __le16 curlevel;
430 s8 maxlevel;
431 s8 minlevel;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200432};
433
434struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400435 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200436
437 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400438 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200439
440};
441
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400442struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000443 __le16 action;
444 __le16 mode;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400445};
446
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400447struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500448 struct cmd_header hdr;
449
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000450 __le16 action;
451 __le16 version;
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400452};
453
David Woodhousec6ad3732007-12-16 21:43:40 -0500454struct cmd_ds_802_11_fw_wake_method {
455 struct cmd_header hdr;
456
457 __le16 action;
458 __le16 method;
459};
460
461struct cmd_ds_802_11_sleep_period {
462 struct cmd_header hdr;
463
464 __le16 action;
465 __le16 period;
466};
467
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200468struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400469 __le16 action;
470 __le16 nullpktinterval;
471 __le16 multipledtim;
472 __le16 reserved;
473 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200474};
475
Holger Schurigf539f2e2008-03-26 13:22:11 +0100476struct cmd_confirm_sleep {
477 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200478
David Woodhouse981f1872007-05-25 23:36:54 -0400479 __le16 action;
Holger Schurigf539f2e2008-03-26 13:22:11 +0100480 __le16 nullpktinterval;
David Woodhouse981f1872007-05-25 23:36:54 -0400481 __le16 multipledtim;
482 __le16 reserved;
483 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200484};
485
486struct cmd_ds_802_11_data_rate {
Dan Williams8e3c91b2007-12-11 15:50:59 -0500487 struct cmd_header hdr;
488
David Woodhouse981f1872007-05-25 23:36:54 -0400489 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400490 __le16 reserved;
491 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200492};
493
494struct cmd_ds_802_11_rate_adapt_rateset {
Javier Cardona85319f92008-05-24 10:59:49 +0100495 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400496 __le16 action;
497 __le16 enablehwauto;
498 __le16 bitmap;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200499};
500
501struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400502 struct cmd_header hdr;
503
Dan Williamsb44898e2007-08-02 11:18:40 -0400504 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200505 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400506 __le16 beaconperiod;
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400507 u8 dtimperiod; /* Reserved on v9 and later */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200508 union IEEEtypes_ssparamset ssparamset;
509 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400510 __le16 probedelay;
Dan Williams0c9ca692007-08-02 10:43:44 -0400511 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400512 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200513 u8 tlv_memory_size_pad[100];
514} __attribute__ ((packed));
515
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400516struct cmd_ds_802_11_ad_hoc_result {
517 struct cmd_header hdr;
518
519 u8 pad[3];
520 u8 bssid[ETH_ALEN];
521};
522
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200523struct adhoc_bssdesc {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400524 u8 bssid[ETH_ALEN];
525 u8 ssid[IW_ESSID_MAX_SIZE];
Dan Williams0c9ca692007-08-02 10:43:44 -0400526 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400527 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200528 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400529 __le64 timestamp;
530 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200531 union ieeetypes_phyparamset phyparamset;
532 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca692007-08-02 10:43:44 -0400533 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400534 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200535
536 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
537 * Adhoc join command and will cause a binary layout mismatch with
538 * the firmware
539 */
540} __attribute__ ((packed));
541
542struct cmd_ds_802_11_ad_hoc_join {
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400543 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200544
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400545 struct adhoc_bssdesc bss;
546 __le16 failtimeout; /* Reserved on v9 and later */
547 __le16 probedelay; /* Reserved on v9 and later */
548} __attribute__ ((packed));
549
550struct cmd_ds_802_11_ad_hoc_stop {
551 struct cmd_header hdr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200552} __attribute__ ((packed));
553
554struct cmd_ds_802_11_enable_rsn {
David Woodhouse4f59abf2007-12-18 00:47:17 -0500555 struct cmd_header hdr;
556
David Woodhouse981f1872007-05-25 23:36:54 -0400557 __le16 action;
558 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400559} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200560
561struct MrvlIEtype_keyParamSet {
562 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400563 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200564
565 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400566 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200567
568 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400569 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200570
571 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400572 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200573
574 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400575 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200576
577 /* key material of size keylen */
578 u8 key[32];
579};
580
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500581struct cmd_ds_host_sleep {
582 struct cmd_header hdr;
583 __le32 criteria;
584 uint8_t gpio;
585 uint8_t gap;
586} __attribute__ ((packed));
587
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200588struct cmd_ds_802_11_key_material {
David Woodhouse9e1228d2008-03-03 12:15:39 +0100589 struct cmd_header hdr;
590
David Woodhouse981f1872007-05-25 23:36:54 -0400591 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200592 struct MrvlIEtype_keyParamSet keyParamSet[2];
593} __attribute__ ((packed));
594
595struct cmd_ds_802_11_eeprom_access {
Holger Schurig7460f5a2008-03-26 10:03:48 +0100596 struct cmd_header hdr;
David Woodhouse981f1872007-05-25 23:36:54 -0400597 __le16 action;
David Woodhouse981f1872007-05-25 23:36:54 -0400598 __le16 offset;
Holger Schurig7460f5a2008-03-26 10:03:48 +0100599 __le16 len;
600 /* firmware says it returns a maximum of 20 bytes */
601#define LBS_EEPROM_READ_LEN 20
602 u8 value[LBS_EEPROM_READ_LEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200603} __attribute__ ((packed));
604
605struct cmd_ds_802_11_tpc_cfg {
Anna Neal0112c9e2008-09-11 11:17:25 -0700606 struct cmd_header hdr;
607
David Woodhouse981f1872007-05-25 23:36:54 -0400608 __le16 action;
Anna Neal0112c9e2008-09-11 11:17:25 -0700609 uint8_t enable;
610 int8_t P0;
611 int8_t P1;
612 int8_t P2;
613 uint8_t usesnr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200614} __attribute__ ((packed));
615
Anna Neal0112c9e2008-09-11 11:17:25 -0700616
617struct cmd_ds_802_11_pa_cfg {
618 struct cmd_header hdr;
619
620 __le16 action;
621 uint8_t enable;
622 int8_t P0;
623 int8_t P1;
624 int8_t P2;
625} __attribute__ ((packed));
626
627
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200628struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400629 __le16 action;
630 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200631 u8 data[256];
632} __attribute__ ((packed));
633
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200634struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400635 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200636 union {
637 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400638 __le16 threshold;
639 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200640 };
641 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400642 __le16 timing_offset; /* signed */
643 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200644 };
645 };
646} __attribute__ ((packed));
647
648struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400649 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200650} __attribute__ ((packed));
651
652struct cmd_ds_get_tsf {
653 __le64 tsfvalue;
654} __attribute__ ((packed));
655
656struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400657 __le16 action;
658 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200659 u8 addr1[ETH_ALEN];
660 u8 addr2[ETH_ALEN];
661} __attribute__ ((packed));
662
663struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400664 __le16 action;
665 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400666 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200667 u8 da[ETH_ALEN];
668 u8 dir;
669 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400670 __le32 ssn;
671 __le32 dsn;
672 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400673 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200674 u8 hopcount;
675 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400676 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200677 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400678 __le32 snr;
679 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400680 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200681} __attribute__ ((packed));
682
David Woodhouse23a397a2007-12-11 18:56:42 -0500683
684struct cmd_ds_mesh_config {
685 struct cmd_header hdr;
686
687 __le16 action;
688 __le16 channel;
689 __le16 type;
690 __le16 length;
691 u8 data[128]; /* last position reserved */
692} __attribute__ ((packed));
693
694
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200695struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500696 struct cmd_header hdr;
697
David Woodhouse981f1872007-05-25 23:36:54 -0400698 __le16 action;
699 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200700} __attribute__ ((packed));
701
Javier Cardona0601e7e2007-05-25 12:12:06 -0400702/* Number of stats counters returned by the firmware */
703#define MESH_STATS_NUM 8
704
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200705struct cmd_ds_command {
706 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400707 __le16 command;
708 __le16 size;
709 __le16 seqnum;
710 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200711
712 /* command Body */
713 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200714 struct cmd_ds_802_11_ps_mode psmode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200715 struct cmd_ds_802_11_associate associate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200716 struct cmd_ds_802_11_authenticate auth;
717 struct cmd_ds_802_11_get_stat gstat;
718 struct cmd_ds_802_3_get_stat gstat_8023;
719 struct cmd_ds_802_11_snmp_mib smib;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200720 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400721 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200722 struct cmd_ds_802_11_rssi rssi;
723 struct cmd_ds_802_11_rssi_rsp rssirsp;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200724 struct cmd_ds_mac_reg_access macreg;
725 struct cmd_ds_bbp_reg_access bbpreg;
726 struct cmd_ds_rf_reg_access rfreg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200727
728 struct cmd_ds_802_11d_domain_info domaininfo;
729 struct cmd_ds_802_11d_domain_info domaininforesp;
730
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200731 struct cmd_ds_802_11_tpc_cfg tpccfg;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200732 struct cmd_ds_802_11_afc afc;
733 struct cmd_ds_802_11_led_ctrl ledgpio;
734
735 struct cmd_tx_rate_query txrate;
736 struct cmd_ds_bt_access bt;
737 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200738 struct cmd_ds_get_tsf gettsf;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500739 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200740 } params;
741} __attribute__ ((packed));
742
743#endif