blob: ed502b74fa3c9c83264707a72af2aa79ff21812e [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
68struct cmd_ctrl_node {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020069 struct list_head list;
Holger Schurig675787e2007-12-05 17:58:11 +010070 /* wait for finish or not */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020071 u16 wait_option;
Holger Schurig675787e2007-12-05 17:58:11 +010072 /* command response */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020073 void *pdata_buf;
David Woodhouse1309b552007-12-10 13:36:10 -050074 int (*callback)(struct lbs_private *priv, unsigned long arg, struct cmd_ds_command *resp);
75 unsigned long callback_arg;
Holger Schurig675787e2007-12-05 17:58:11 +010076 /* command data */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020077 u8 *bufvirtualaddr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020078 /* wait queue */
79 u16 cmdwaitqwoken;
80 wait_queue_head_t cmdwait_q;
81};
82
Dan Williams1443b652007-08-02 10:45:55 -040083/* Generic structure to hold all key types. */
84struct enc_key {
85 u16 len;
Holger Schurig10078322007-11-15 18:05:47 -050086 u16 flags; /* KEY_INFO_* from defs.h */
87 u16 type; /* KEY_TYPE_* from defs.h */
Dan Williams1443b652007-08-02 10:45:55 -040088 u8 key[32];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020089};
90
Holger Schurig10078322007-11-15 18:05:47 -050091/* lbs_offset_value */
92struct lbs_offset_value {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020093 u32 offset;
94 u32 value;
95};
96
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020097/* Define general data structure */
98/* cmd_DS_GEN */
99struct cmd_ds_gen {
David Woodhouse981f1872007-05-25 23:36:54 -0400100 __le16 command;
101 __le16 size;
102 __le16 seqnum;
103 __le16 result;
Holger Schurig675787e2007-12-05 17:58:11 +0100104 void *cmdresp[0];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200105};
106
107#define S_DS_GEN sizeof(struct cmd_ds_gen)
Holger Schurig675787e2007-12-05 17:58:11 +0100108
109
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200110/*
Dan Williams0aef64d2007-08-02 11:31:18 -0400111 * Define data structure for CMD_GET_HW_SPEC
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200112 * This structure defines the response for the GET_HW_SPEC command
113 */
114struct cmd_ds_get_hw_spec {
115 /* HW Interface version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400116 __le16 hwifversion;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200117 /* HW version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400118 __le16 version;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200119 /* Max number of TxPD FW can handle */
David Woodhouse981f1872007-05-25 23:36:54 -0400120 __le16 nr_txpd;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200121 /* Max no of Multicast address */
David Woodhouse981f1872007-05-25 23:36:54 -0400122 __le16 nr_mcast_adr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200123 /* MAC address */
124 u8 permanentaddr[6];
125
126 /* region Code */
David Woodhouse981f1872007-05-25 23:36:54 -0400127 __le16 regioncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200128
129 /* Number of antenna used */
David Woodhouse981f1872007-05-25 23:36:54 -0400130 __le16 nr_antenna;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200131
David Woodhousee5b3d472007-05-25 23:40:21 -0400132 /* FW release number, example 1,2,3,4 = 3.2.1p4 */
133 u8 fwreleasenumber[4];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200134
135 /* Base Address of TxPD queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400136 __le32 wcb_base;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200137 /* Read Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400138 __le32 rxpd_rdptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200139
140 /* Write Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400141 __le32 rxpd_wrptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200142
143 /*FW/HW capability */
David Woodhouse981f1872007-05-25 23:36:54 -0400144 __le32 fwcapinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200145} __attribute__ ((packed));
146
147struct cmd_ds_802_11_reset {
David Woodhouse981f1872007-05-25 23:36:54 -0400148 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200149};
150
151struct cmd_ds_802_11_subscribe_event {
David Woodhouse981f1872007-05-25 23:36:54 -0400152 __le16 action;
153 __le16 events;
Holger Schurig3a188642007-11-26 10:07:14 +0100154
155 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
156 * number of TLVs. From the v5.1 manual, those TLVs would add up to
157 * 40 bytes. However, future firmware might add additional TLVs, so I
158 * bump this up a bit.
159 */
160 u8 tlv[128];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200161};
162
163/*
164 * This scan handle Country Information IE(802.11d compliant)
Dan Williams0aef64d2007-08-02 11:31:18 -0400165 * Define data structure for CMD_802_11_SCAN
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200166 */
167struct cmd_ds_802_11_scan {
168 u8 bsstype;
Dan Williams492b6da2007-08-02 11:16:07 -0400169 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200170 u8 tlvbuffer[1];
171#if 0
172 mrvlietypes_ssidparamset_t ssidParamSet;
173 mrvlietypes_chanlistparamset_t ChanListParamSet;
174 mrvlietypes_ratesparamset_t OpRateSet;
175#endif
176};
177
178struct cmd_ds_802_11_scan_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400179 __le16 bssdescriptsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200180 u8 nr_sets;
181 u8 bssdesc_and_tlvbuffer[1];
182};
183
184struct cmd_ds_802_11_get_log {
David Woodhouse981f1872007-05-25 23:36:54 -0400185 __le32 mcasttxframe;
186 __le32 failed;
187 __le32 retry;
188 __le32 multiretry;
189 __le32 framedup;
190 __le32 rtssuccess;
191 __le32 rtsfailure;
192 __le32 ackfailure;
193 __le32 rxfrag;
194 __le32 mcastrxframe;
195 __le32 fcserror;
196 __le32 txframe;
197 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200198};
199
200struct cmd_ds_mac_control {
David Woodhouse981f1872007-05-25 23:36:54 -0400201 __le16 action;
202 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200203};
204
205struct cmd_ds_mac_multicast_adr {
David Woodhouse981f1872007-05-25 23:36:54 -0400206 __le16 action;
207 __le16 nr_of_adrs;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200208 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
209};
210
211struct cmd_ds_802_11_authenticate {
212 u8 macaddr[ETH_ALEN];
213 u8 authtype;
214 u8 reserved[10];
215};
216
217struct cmd_ds_802_11_deauthenticate {
218 u8 macaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400219 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200220};
221
222struct cmd_ds_802_11_associate {
223 u8 peerstaaddr[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400224 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400225 __le16 listeninterval;
226 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200227 u8 dtimperiod;
228
229#if 0
230 mrvlietypes_ssidparamset_t ssidParamSet;
231 mrvlietypes_phyparamset_t phyparamset;
232 mrvlietypes_ssparamset_t ssparamset;
233 mrvlietypes_ratesparamset_t ratesParamSet;
234#endif
235} __attribute__ ((packed));
236
237struct cmd_ds_802_11_disassociate {
238 u8 destmacaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400239 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200240};
241
242struct cmd_ds_802_11_associate_rsp {
243 struct ieeetypes_assocrsp assocRsp;
244};
245
246struct cmd_ds_802_11_ad_hoc_result {
Dan Williamsea8da922007-08-02 11:18:23 -0400247 u8 pad[3];
248 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200249};
250
251struct cmd_ds_802_11_set_wep {
252 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400253 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200254
255 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400256 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200257
258 /* 40, 128bit or TXWEP */
259 u8 keytype[4];
260 u8 keymaterial[4][16];
261};
262
263struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400264 __le32 xmitok;
265 __le32 rcvok;
266 __le32 xmiterror;
267 __le32 rcverror;
268 __le32 rcvnobuffer;
269 __le32 rcvcrcerror;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200270};
271
272struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400273 __le32 txfragmentcnt;
274 __le32 mcasttxframecnt;
275 __le32 failedcnt;
276 __le32 retrycnt;
277 __le32 Multipleretrycnt;
278 __le32 rtssuccesscnt;
279 __le32 rtsfailurecnt;
280 __le32 ackfailurecnt;
281 __le32 frameduplicatecnt;
282 __le32 rxfragmentcnt;
283 __le32 mcastrxframecnt;
284 __le32 fcserrorcnt;
285 __le32 bcasttxframecnt;
286 __le32 bcastrxframecnt;
287 __le32 txbeacon;
288 __le32 rxbeacon;
289 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200290};
291
292struct cmd_ds_802_11_snmp_mib {
David Woodhouse981f1872007-05-25 23:36:54 -0400293 __le16 querytype;
294 __le16 oid;
295 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200296 u8 value[128];
297};
298
299struct cmd_ds_mac_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400300 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200301 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400302 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200303};
304
305struct cmd_ds_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400306 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200307 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400308 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200309};
310
311struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400312 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200313 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400314 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200315};
316
317struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400318 __le16 action;
319 __le16 offset;
320 __le32 value;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200321};
322
323struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400324 __le16 action;
325 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200326 u8 value;
327 u8 reserved[3];
328};
329
330struct cmd_ds_rf_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_802_11_radio_control {
David Woodhouse981f1872007-05-25 23:36:54 -0400338 __le16 action;
339 __le16 control;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200340};
341
Brajesh Dave96287ac2007-11-20 17:44:28 -0500342struct cmd_ds_802_11_beacon_control {
343 __le16 action;
344 __le16 beacon_enable;
345 __le16 beacon_period;
346};
347
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200348struct cmd_ds_802_11_sleep_params {
349 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400350 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200351
352 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400353 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200354
355 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400356 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200357
358 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400359 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200360
361 /* control periodic calibration */
362 u8 calcontrol;
363
364 /* control the use of external sleep clock */
365 u8 externalsleepclk;
366
367 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400368 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200369};
370
371struct cmd_ds_802_11_inactivity_timeout {
372 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400373 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200374
375 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400376 __le16 timeout;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200377};
378
379struct cmd_ds_802_11_rf_channel {
David Woodhouse981f1872007-05-25 23:36:54 -0400380 __le16 action;
381 __le16 currentchannel;
382 __le16 rftype;
383 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200384 u8 channellist[32];
385};
386
387struct cmd_ds_802_11_rssi {
388 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400389 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200390
David Woodhouse981f1872007-05-25 23:36:54 -0400391 __le16 reserved_0;
392 __le16 reserved_1;
393 __le16 reserved_2;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200394};
395
396struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400397 __le16 SNR;
398 __le16 noisefloor;
399 __le16 avgSNR;
400 __le16 avgnoisefloor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200401};
402
403struct cmd_ds_802_11_mac_address {
David Woodhouse981f1872007-05-25 23:36:54 -0400404 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200405 u8 macadd[ETH_ALEN];
406};
407
408struct cmd_ds_802_11_rf_tx_power {
David Woodhouse981f1872007-05-25 23:36:54 -0400409 __le16 action;
410 __le16 currentlevel;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200411};
412
413struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400414 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200415
416 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400417 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200418
419};
420
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400421struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000422 __le16 action;
423 __le16 mode;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400424};
425
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400426struct cmd_ds_set_boot2_ver {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000427 __le16 action;
428 __le16 version;
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400429};
430
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200431struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400432 __le16 action;
433 __le16 nullpktinterval;
434 __le16 multipledtim;
435 __le16 reserved;
436 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200437};
438
439struct PS_CMD_ConfirmSleep {
David Woodhouse981f1872007-05-25 23:36:54 -0400440 __le16 command;
441 __le16 size;
442 __le16 seqnum;
443 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200444
David Woodhouse981f1872007-05-25 23:36:54 -0400445 __le16 action;
446 __le16 reserved1;
447 __le16 multipledtim;
448 __le16 reserved;
449 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200450};
451
452struct cmd_ds_802_11_data_rate {
David Woodhouse981f1872007-05-25 23:36:54 -0400453 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400454 __le16 reserved;
455 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200456};
457
458struct cmd_ds_802_11_rate_adapt_rateset {
David Woodhouse981f1872007-05-25 23:36:54 -0400459 __le16 action;
460 __le16 enablehwauto;
461 __le16 bitmap;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200462};
463
464struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsb44898e2007-08-02 11:18:40 -0400465 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200466 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400467 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200468 u8 dtimperiod;
469 union IEEEtypes_ssparamset ssparamset;
470 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400471 __le16 probedelay;
Dan Williams0c9ca692007-08-02 10:43:44 -0400472 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400473 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200474 u8 tlv_memory_size_pad[100];
475} __attribute__ ((packed));
476
477struct adhoc_bssdesc {
Dan Williams0c9ca692007-08-02 10:43:44 -0400478 u8 bssid[6];
479 u8 ssid[32];
480 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400481 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200482 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400483 __le64 timestamp;
484 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200485 union ieeetypes_phyparamset phyparamset;
486 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca692007-08-02 10:43:44 -0400487 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400488 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200489
490 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
491 * Adhoc join command and will cause a binary layout mismatch with
492 * the firmware
493 */
494} __attribute__ ((packed));
495
496struct cmd_ds_802_11_ad_hoc_join {
Dan Williams0c9ca692007-08-02 10:43:44 -0400497 struct adhoc_bssdesc bss;
David Woodhouse981f1872007-05-25 23:36:54 -0400498 __le16 failtimeout;
499 __le16 probedelay;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200500
501} __attribute__ ((packed));
502
503struct cmd_ds_802_11_enable_rsn {
David Woodhouse981f1872007-05-25 23:36:54 -0400504 __le16 action;
505 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400506} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200507
508struct MrvlIEtype_keyParamSet {
509 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400510 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200511
512 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400513 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200514
515 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400516 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200517
518 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400519 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200520
521 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400522 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200523
524 /* key material of size keylen */
525 u8 key[32];
526};
527
528struct cmd_ds_802_11_key_material {
David Woodhouse981f1872007-05-25 23:36:54 -0400529 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200530 struct MrvlIEtype_keyParamSet keyParamSet[2];
531} __attribute__ ((packed));
532
533struct cmd_ds_802_11_eeprom_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400534 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200535
536 /* multiple 4 */
David Woodhouse981f1872007-05-25 23:36:54 -0400537 __le16 offset;
538 __le16 bytecount;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200539 u8 value;
540} __attribute__ ((packed));
541
542struct cmd_ds_802_11_tpc_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400543 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200544 u8 enable;
545 s8 P0;
546 s8 P1;
547 s8 P2;
548 u8 usesnr;
549} __attribute__ ((packed));
550
551struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400552 __le16 action;
553 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200554 u8 data[256];
555} __attribute__ ((packed));
556
557struct cmd_ds_802_11_pwr_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400558 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200559 u8 enable;
560 s8 PA_P0;
561 s8 PA_P1;
562 s8 PA_P2;
563} __attribute__ ((packed));
564
565struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400566 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200567 union {
568 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400569 __le16 threshold;
570 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200571 };
572 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400573 __le16 timing_offset; /* signed */
574 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200575 };
576 };
577} __attribute__ ((packed));
578
579struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400580 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200581} __attribute__ ((packed));
582
583struct cmd_ds_get_tsf {
584 __le64 tsfvalue;
585} __attribute__ ((packed));
586
587struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400588 __le16 action;
589 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200590 u8 addr1[ETH_ALEN];
591 u8 addr2[ETH_ALEN];
592} __attribute__ ((packed));
593
594struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400595 __le16 action;
596 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400597 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200598 u8 da[ETH_ALEN];
599 u8 dir;
600 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400601 __le32 ssn;
602 __le32 dsn;
603 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400604 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200605 u8 hopcount;
606 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400607 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200608 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400609 __le32 snr;
610 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400611 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200612} __attribute__ ((packed));
613
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200614struct cmd_ds_mesh_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400615 __le16 action;
616 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200617} __attribute__ ((packed));
618
Javier Cardona0601e7e2007-05-25 12:12:06 -0400619/* Number of stats counters returned by the firmware */
620#define MESH_STATS_NUM 8
621
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200622struct cmd_ds_command {
623 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400624 __le16 command;
625 __le16 size;
626 __le16 seqnum;
627 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200628
629 /* command Body */
630 union {
631 struct cmd_ds_get_hw_spec hwspec;
632 struct cmd_ds_802_11_ps_mode psmode;
633 struct cmd_ds_802_11_scan scan;
634 struct cmd_ds_802_11_scan_rsp scanresp;
635 struct cmd_ds_mac_control macctrl;
636 struct cmd_ds_802_11_associate associate;
637 struct cmd_ds_802_11_deauthenticate deauth;
638 struct cmd_ds_802_11_set_wep wep;
639 struct cmd_ds_802_11_ad_hoc_start ads;
640 struct cmd_ds_802_11_reset reset;
641 struct cmd_ds_802_11_ad_hoc_result result;
642 struct cmd_ds_802_11_get_log glog;
643 struct cmd_ds_802_11_authenticate auth;
644 struct cmd_ds_802_11_get_stat gstat;
645 struct cmd_ds_802_3_get_stat gstat_8023;
646 struct cmd_ds_802_11_snmp_mib smib;
647 struct cmd_ds_802_11_rf_tx_power txp;
648 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400649 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200650 struct cmd_ds_802_11_data_rate drate;
651 struct cmd_ds_802_11_rate_adapt_rateset rateset;
652 struct cmd_ds_mac_multicast_adr madr;
653 struct cmd_ds_802_11_ad_hoc_join adj;
654 struct cmd_ds_802_11_radio_control radio;
655 struct cmd_ds_802_11_rf_channel rfchannel;
656 struct cmd_ds_802_11_rssi rssi;
657 struct cmd_ds_802_11_rssi_rsp rssirsp;
658 struct cmd_ds_802_11_disassociate dassociate;
659 struct cmd_ds_802_11_mac_address macadd;
660 struct cmd_ds_802_11_enable_rsn enbrsn;
661 struct cmd_ds_802_11_key_material keymaterial;
662 struct cmd_ds_mac_reg_access macreg;
663 struct cmd_ds_bbp_reg_access bbpreg;
664 struct cmd_ds_rf_reg_access rfreg;
665 struct cmd_ds_802_11_eeprom_access rdeeprom;
666
667 struct cmd_ds_802_11d_domain_info domaininfo;
668 struct cmd_ds_802_11d_domain_info domaininforesp;
669
670 struct cmd_ds_802_11_sleep_params sleep_params;
671 struct cmd_ds_802_11_inactivity_timeout inactivity_timeout;
672 struct cmd_ds_802_11_tpc_cfg tpccfg;
673 struct cmd_ds_802_11_pwr_cfg pwrcfg;
674 struct cmd_ds_802_11_afc afc;
675 struct cmd_ds_802_11_led_ctrl ledgpio;
676
677 struct cmd_tx_rate_query txrate;
678 struct cmd_ds_bt_access bt;
679 struct cmd_ds_fwt_access fwt;
680 struct cmd_ds_mesh_access mesh;
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400681 struct cmd_ds_set_boot2_ver boot2_ver;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200682 struct cmd_ds_get_tsf gettsf;
683 struct cmd_ds_802_11_subscribe_event subscribe_event;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500684 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200685 } params;
686} __attribute__ ((packed));
687
688#endif