blob: e5e2106cd5ac39c589948985e31ea1cad422094b [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;
Holger Schurig675787e2007-12-05 17:58:11 +010077 /* wait for finish or not */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020078 u16 wait_option;
Holger Schurig675787e2007-12-05 17:58:11 +010079 /* command response */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020080 void *pdata_buf;
Dan Williams7ad994d2007-12-11 12:33:30 -050081 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
David Woodhouse1309b552007-12-10 13:36:10 -050082 unsigned long callback_arg;
Holger Schurig675787e2007-12-05 17:58:11 +010083 /* command data */
Dan Williamsddac4522007-12-11 13:49:39 -050084 struct cmd_header *cmdbuf;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020085 /* wait queue */
86 u16 cmdwaitqwoken;
87 wait_queue_head_t cmdwait_q;
88};
89
Dan Williams1443b652007-08-02 10:45:55 -040090/* Generic structure to hold all key types. */
91struct enc_key {
92 u16 len;
Holger Schurig10078322007-11-15 18:05:47 -050093 u16 flags; /* KEY_INFO_* from defs.h */
94 u16 type; /* KEY_TYPE_* from defs.h */
Dan Williams1443b652007-08-02 10:45:55 -040095 u8 key[32];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020096};
97
Holger Schurig10078322007-11-15 18:05:47 -050098/* lbs_offset_value */
99struct lbs_offset_value {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200100 u32 offset;
101 u32 value;
102};
103
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200104/* Define general data structure */
105/* cmd_DS_GEN */
106struct cmd_ds_gen {
David Woodhouse981f1872007-05-25 23:36:54 -0400107 __le16 command;
108 __le16 size;
109 __le16 seqnum;
110 __le16 result;
Holger Schurig675787e2007-12-05 17:58:11 +0100111 void *cmdresp[0];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200112};
113
114#define S_DS_GEN sizeof(struct cmd_ds_gen)
Holger Schurig675787e2007-12-05 17:58:11 +0100115
116
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200117/*
Dan Williams0aef64d2007-08-02 11:31:18 -0400118 * Define data structure for CMD_GET_HW_SPEC
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200119 * This structure defines the response for the GET_HW_SPEC command
120 */
121struct cmd_ds_get_hw_spec {
Dan Williams6e66f032007-12-11 12:42:16 -0500122 struct cmd_header hdr;
123
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200124 /* HW Interface version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400125 __le16 hwifversion;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200126 /* HW version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400127 __le16 version;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200128 /* Max number of TxPD FW can handle */
David Woodhouse981f1872007-05-25 23:36:54 -0400129 __le16 nr_txpd;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200130 /* Max no of Multicast address */
David Woodhouse981f1872007-05-25 23:36:54 -0400131 __le16 nr_mcast_adr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200132 /* MAC address */
133 u8 permanentaddr[6];
134
135 /* region Code */
David Woodhouse981f1872007-05-25 23:36:54 -0400136 __le16 regioncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200137
138 /* Number of antenna used */
David Woodhouse981f1872007-05-25 23:36:54 -0400139 __le16 nr_antenna;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200140
David Woodhousee5b3d472007-05-25 23:40:21 -0400141 /* FW release number, example 1,2,3,4 = 3.2.1p4 */
142 u8 fwreleasenumber[4];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200143
144 /* Base Address of TxPD queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400145 __le32 wcb_base;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200146 /* Read Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400147 __le32 rxpd_rdptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200148
149 /* Write Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400150 __le32 rxpd_wrptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200151
152 /*FW/HW capability */
David Woodhouse981f1872007-05-25 23:36:54 -0400153 __le32 fwcapinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200154} __attribute__ ((packed));
155
156struct cmd_ds_802_11_reset {
David Woodhouse981f1872007-05-25 23:36:54 -0400157 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200158};
159
160struct cmd_ds_802_11_subscribe_event {
David Woodhouse981f1872007-05-25 23:36:54 -0400161 __le16 action;
162 __le16 events;
Holger Schurig3a188642007-11-26 10:07:14 +0100163
164 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
165 * number of TLVs. From the v5.1 manual, those TLVs would add up to
166 * 40 bytes. However, future firmware might add additional TLVs, so I
167 * bump this up a bit.
168 */
169 u8 tlv[128];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200170};
171
172/*
173 * This scan handle Country Information IE(802.11d compliant)
Dan Williams0aef64d2007-08-02 11:31:18 -0400174 * Define data structure for CMD_802_11_SCAN
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200175 */
176struct cmd_ds_802_11_scan {
177 u8 bsstype;
Dan Williams492b6da2007-08-02 11:16:07 -0400178 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200179 u8 tlvbuffer[1];
180#if 0
181 mrvlietypes_ssidparamset_t ssidParamSet;
182 mrvlietypes_chanlistparamset_t ChanListParamSet;
183 mrvlietypes_ratesparamset_t OpRateSet;
184#endif
185};
186
187struct cmd_ds_802_11_scan_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400188 __le16 bssdescriptsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200189 u8 nr_sets;
190 u8 bssdesc_and_tlvbuffer[1];
191};
192
193struct cmd_ds_802_11_get_log {
David Woodhouse981f1872007-05-25 23:36:54 -0400194 __le32 mcasttxframe;
195 __le32 failed;
196 __le32 retry;
197 __le32 multiretry;
198 __le32 framedup;
199 __le32 rtssuccess;
200 __le32 rtsfailure;
201 __le32 ackfailure;
202 __le32 rxfrag;
203 __le32 mcastrxframe;
204 __le32 fcserror;
205 __le32 txframe;
206 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200207};
208
209struct cmd_ds_mac_control {
David Woodhouse981f1872007-05-25 23:36:54 -0400210 __le16 action;
211 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200212};
213
214struct cmd_ds_mac_multicast_adr {
David Woodhouse981f1872007-05-25 23:36:54 -0400215 __le16 action;
216 __le16 nr_of_adrs;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200217 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
218};
219
220struct cmd_ds_802_11_authenticate {
221 u8 macaddr[ETH_ALEN];
222 u8 authtype;
223 u8 reserved[10];
224};
225
226struct cmd_ds_802_11_deauthenticate {
227 u8 macaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400228 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200229};
230
231struct cmd_ds_802_11_associate {
232 u8 peerstaaddr[6];
Dan Williams0c9ca6902007-08-02 10:43:44 -0400233 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400234 __le16 listeninterval;
235 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200236 u8 dtimperiod;
237
238#if 0
239 mrvlietypes_ssidparamset_t ssidParamSet;
240 mrvlietypes_phyparamset_t phyparamset;
241 mrvlietypes_ssparamset_t ssparamset;
242 mrvlietypes_ratesparamset_t ratesParamSet;
243#endif
244} __attribute__ ((packed));
245
246struct cmd_ds_802_11_disassociate {
247 u8 destmacaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400248 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200249};
250
251struct cmd_ds_802_11_associate_rsp {
252 struct ieeetypes_assocrsp assocRsp;
253};
254
255struct cmd_ds_802_11_ad_hoc_result {
Dan Williamsea8da922007-08-02 11:18:23 -0400256 u8 pad[3];
257 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200258};
259
260struct cmd_ds_802_11_set_wep {
261 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400262 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200263
264 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400265 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200266
267 /* 40, 128bit or TXWEP */
268 u8 keytype[4];
269 u8 keymaterial[4][16];
270};
271
272struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400273 __le32 xmitok;
274 __le32 rcvok;
275 __le32 xmiterror;
276 __le32 rcverror;
277 __le32 rcvnobuffer;
278 __le32 rcvcrcerror;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200279};
280
281struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400282 __le32 txfragmentcnt;
283 __le32 mcasttxframecnt;
284 __le32 failedcnt;
285 __le32 retrycnt;
286 __le32 Multipleretrycnt;
287 __le32 rtssuccesscnt;
288 __le32 rtsfailurecnt;
289 __le32 ackfailurecnt;
290 __le32 frameduplicatecnt;
291 __le32 rxfragmentcnt;
292 __le32 mcastrxframecnt;
293 __le32 fcserrorcnt;
294 __le32 bcasttxframecnt;
295 __le32 bcastrxframecnt;
296 __le32 txbeacon;
297 __le32 rxbeacon;
298 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200299};
300
301struct cmd_ds_802_11_snmp_mib {
David Woodhouse981f1872007-05-25 23:36:54 -0400302 __le16 querytype;
303 __le16 oid;
304 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200305 u8 value[128];
306};
307
308struct cmd_ds_mac_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400309 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200310 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400311 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200312};
313
314struct cmd_ds_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400315 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200316 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400317 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200318};
319
320struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400321 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200322 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400323 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200324};
325
326struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400327 __le16 action;
328 __le16 offset;
329 __le32 value;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200330};
331
332struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400333 __le16 action;
334 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200335 u8 value;
336 u8 reserved[3];
337};
338
339struct cmd_ds_rf_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400340 __le16 action;
341 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200342 u8 value;
343 u8 reserved[3];
344};
345
346struct cmd_ds_802_11_radio_control {
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 {
358 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400359 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200360
361 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400362 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200363
364 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400365 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200366
367 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400368 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200369
370 /* control periodic calibration */
371 u8 calcontrol;
372
373 /* control the use of external sleep clock */
374 u8 externalsleepclk;
375
376 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400377 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200378};
379
380struct cmd_ds_802_11_inactivity_timeout {
381 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400382 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200383
384 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400385 __le16 timeout;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200386};
387
388struct cmd_ds_802_11_rf_channel {
David Woodhouse981f1872007-05-25 23:36:54 -0400389 __le16 action;
390 __le16 currentchannel;
391 __le16 rftype;
392 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200393 u8 channellist[32];
394};
395
396struct cmd_ds_802_11_rssi {
397 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400398 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200399
David Woodhouse981f1872007-05-25 23:36:54 -0400400 __le16 reserved_0;
401 __le16 reserved_1;
402 __le16 reserved_2;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200403};
404
405struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400406 __le16 SNR;
407 __le16 noisefloor;
408 __le16 avgSNR;
409 __le16 avgnoisefloor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200410};
411
412struct cmd_ds_802_11_mac_address {
David Woodhouse981f1872007-05-25 23:36:54 -0400413 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200414 u8 macadd[ETH_ALEN];
415};
416
417struct cmd_ds_802_11_rf_tx_power {
David Woodhouse981f1872007-05-25 23:36:54 -0400418 __le16 action;
419 __le16 currentlevel;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200420};
421
422struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400423 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200424
425 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400426 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200427
428};
429
Luis Carlos Cobo965f8bbc2007-08-02 13:16:55 -0400430struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000431 __le16 action;
432 __le16 mode;
Luis Carlos Cobo965f8bbc2007-08-02 13:16:55 -0400433};
434
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400435struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500436 struct cmd_header hdr;
437
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000438 __le16 action;
439 __le16 version;
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400440};
441
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200442struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400443 __le16 action;
444 __le16 nullpktinterval;
445 __le16 multipledtim;
446 __le16 reserved;
447 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200448};
449
450struct PS_CMD_ConfirmSleep {
David Woodhouse981f1872007-05-25 23:36:54 -0400451 __le16 command;
452 __le16 size;
453 __le16 seqnum;
454 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200455
David Woodhouse981f1872007-05-25 23:36:54 -0400456 __le16 action;
457 __le16 reserved1;
458 __le16 multipledtim;
459 __le16 reserved;
460 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200461};
462
463struct cmd_ds_802_11_data_rate {
David Woodhouse981f1872007-05-25 23:36:54 -0400464 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400465 __le16 reserved;
466 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200467};
468
469struct cmd_ds_802_11_rate_adapt_rateset {
David Woodhouse981f1872007-05-25 23:36:54 -0400470 __le16 action;
471 __le16 enablehwauto;
472 __le16 bitmap;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200473};
474
475struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsb44898e2007-08-02 11:18:40 -0400476 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200477 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400478 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200479 u8 dtimperiod;
480 union IEEEtypes_ssparamset ssparamset;
481 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400482 __le16 probedelay;
Dan Williams0c9ca6902007-08-02 10:43:44 -0400483 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400484 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200485 u8 tlv_memory_size_pad[100];
486} __attribute__ ((packed));
487
488struct adhoc_bssdesc {
Dan Williams0c9ca6902007-08-02 10:43:44 -0400489 u8 bssid[6];
490 u8 ssid[32];
491 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400492 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200493 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400494 __le64 timestamp;
495 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200496 union ieeetypes_phyparamset phyparamset;
497 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca6902007-08-02 10:43:44 -0400498 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400499 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200500
501 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
502 * Adhoc join command and will cause a binary layout mismatch with
503 * the firmware
504 */
505} __attribute__ ((packed));
506
507struct cmd_ds_802_11_ad_hoc_join {
Dan Williams0c9ca6902007-08-02 10:43:44 -0400508 struct adhoc_bssdesc bss;
David Woodhouse981f1872007-05-25 23:36:54 -0400509 __le16 failtimeout;
510 __le16 probedelay;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200511
512} __attribute__ ((packed));
513
514struct cmd_ds_802_11_enable_rsn {
David Woodhouse981f1872007-05-25 23:36:54 -0400515 __le16 action;
516 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400517} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200518
519struct MrvlIEtype_keyParamSet {
520 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400521 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200522
523 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400524 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200525
526 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400527 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200528
529 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400530 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200531
532 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400533 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200534
535 /* key material of size keylen */
536 u8 key[32];
537};
538
539struct cmd_ds_802_11_key_material {
David Woodhouse981f1872007-05-25 23:36:54 -0400540 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200541 struct MrvlIEtype_keyParamSet keyParamSet[2];
542} __attribute__ ((packed));
543
544struct cmd_ds_802_11_eeprom_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400545 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200546
547 /* multiple 4 */
David Woodhouse981f1872007-05-25 23:36:54 -0400548 __le16 offset;
549 __le16 bytecount;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200550 u8 value;
551} __attribute__ ((packed));
552
553struct cmd_ds_802_11_tpc_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400554 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200555 u8 enable;
556 s8 P0;
557 s8 P1;
558 s8 P2;
559 u8 usesnr;
560} __attribute__ ((packed));
561
562struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400563 __le16 action;
564 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200565 u8 data[256];
566} __attribute__ ((packed));
567
568struct cmd_ds_802_11_pwr_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400569 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200570 u8 enable;
571 s8 PA_P0;
572 s8 PA_P1;
573 s8 PA_P2;
574} __attribute__ ((packed));
575
576struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400577 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200578 union {
579 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400580 __le16 threshold;
581 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200582 };
583 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400584 __le16 timing_offset; /* signed */
585 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200586 };
587 };
588} __attribute__ ((packed));
589
590struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400591 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200592} __attribute__ ((packed));
593
594struct cmd_ds_get_tsf {
595 __le64 tsfvalue;
596} __attribute__ ((packed));
597
598struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400599 __le16 action;
600 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200601 u8 addr1[ETH_ALEN];
602 u8 addr2[ETH_ALEN];
603} __attribute__ ((packed));
604
605struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400606 __le16 action;
607 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400608 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200609 u8 da[ETH_ALEN];
610 u8 dir;
611 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400612 __le32 ssn;
613 __le32 dsn;
614 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400615 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200616 u8 hopcount;
617 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400618 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200619 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400620 __le32 snr;
621 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400622 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200623} __attribute__ ((packed));
624
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200625struct cmd_ds_mesh_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400626 __le16 action;
627 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200628} __attribute__ ((packed));
629
Javier Cardona0601e7e2007-05-25 12:12:06 -0400630/* Number of stats counters returned by the firmware */
631#define MESH_STATS_NUM 8
632
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200633struct cmd_ds_command {
634 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400635 __le16 command;
636 __le16 size;
637 __le16 seqnum;
638 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200639
640 /* command Body */
641 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200642 struct cmd_ds_802_11_ps_mode psmode;
643 struct cmd_ds_802_11_scan scan;
644 struct cmd_ds_802_11_scan_rsp scanresp;
645 struct cmd_ds_mac_control macctrl;
646 struct cmd_ds_802_11_associate associate;
647 struct cmd_ds_802_11_deauthenticate deauth;
648 struct cmd_ds_802_11_set_wep wep;
649 struct cmd_ds_802_11_ad_hoc_start ads;
650 struct cmd_ds_802_11_reset reset;
651 struct cmd_ds_802_11_ad_hoc_result result;
652 struct cmd_ds_802_11_get_log glog;
653 struct cmd_ds_802_11_authenticate auth;
654 struct cmd_ds_802_11_get_stat gstat;
655 struct cmd_ds_802_3_get_stat gstat_8023;
656 struct cmd_ds_802_11_snmp_mib smib;
657 struct cmd_ds_802_11_rf_tx_power txp;
658 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bbc2007-08-02 13:16:55 -0400659 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200660 struct cmd_ds_802_11_data_rate drate;
661 struct cmd_ds_802_11_rate_adapt_rateset rateset;
662 struct cmd_ds_mac_multicast_adr madr;
663 struct cmd_ds_802_11_ad_hoc_join adj;
664 struct cmd_ds_802_11_radio_control radio;
665 struct cmd_ds_802_11_rf_channel rfchannel;
666 struct cmd_ds_802_11_rssi rssi;
667 struct cmd_ds_802_11_rssi_rsp rssirsp;
668 struct cmd_ds_802_11_disassociate dassociate;
669 struct cmd_ds_802_11_mac_address macadd;
670 struct cmd_ds_802_11_enable_rsn enbrsn;
671 struct cmd_ds_802_11_key_material keymaterial;
672 struct cmd_ds_mac_reg_access macreg;
673 struct cmd_ds_bbp_reg_access bbpreg;
674 struct cmd_ds_rf_reg_access rfreg;
675 struct cmd_ds_802_11_eeprom_access rdeeprom;
676
677 struct cmd_ds_802_11d_domain_info domaininfo;
678 struct cmd_ds_802_11d_domain_info domaininforesp;
679
680 struct cmd_ds_802_11_sleep_params sleep_params;
681 struct cmd_ds_802_11_inactivity_timeout inactivity_timeout;
682 struct cmd_ds_802_11_tpc_cfg tpccfg;
683 struct cmd_ds_802_11_pwr_cfg pwrcfg;
684 struct cmd_ds_802_11_afc afc;
685 struct cmd_ds_802_11_led_ctrl ledgpio;
686
687 struct cmd_tx_rate_query txrate;
688 struct cmd_ds_bt_access bt;
689 struct cmd_ds_fwt_access fwt;
690 struct cmd_ds_mesh_access mesh;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200691 struct cmd_ds_get_tsf gettsf;
692 struct cmd_ds_802_11_subscribe_event subscribe_event;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500693 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200694 } params;
695} __attribute__ ((packed));
696
697#endif