blob: fffec11d06551641b1c956bc7d8f0c2b41f491c0 [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
David Woodhousee5b3d472007-05-25 23:40:21 -0400139 /* FW release number, example 1,2,3,4 = 3.2.1p4 */
140 u8 fwreleasenumber[4];
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
154struct cmd_ds_802_11_reset {
David Woodhouse981f1872007-05-25 23:36:54 -0400155 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200156};
157
158struct cmd_ds_802_11_subscribe_event {
David Woodhouse981f1872007-05-25 23:36:54 -0400159 __le16 action;
160 __le16 events;
Holger Schurig3a188642007-11-26 10:07:14 +0100161
162 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
163 * number of TLVs. From the v5.1 manual, those TLVs would add up to
164 * 40 bytes. However, future firmware might add additional TLVs, so I
165 * bump this up a bit.
166 */
167 u8 tlv[128];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200168};
169
170/*
171 * This scan handle Country Information IE(802.11d compliant)
Dan Williams0aef64d2007-08-02 11:31:18 -0400172 * Define data structure for CMD_802_11_SCAN
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200173 */
174struct cmd_ds_802_11_scan {
175 u8 bsstype;
Dan Williams492b6da2007-08-02 11:16:07 -0400176 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200177 u8 tlvbuffer[1];
178#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 Woodhouse981f1872007-05-25 23:36:54 -0400186 __le16 bssdescriptsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200187 u8 nr_sets;
188 u8 bssdesc_and_tlvbuffer[1];
189};
190
191struct cmd_ds_802_11_get_log {
David Woodhouse981f1872007-05-25 23:36:54 -0400192 __le32 mcasttxframe;
193 __le32 failed;
194 __le32 retry;
195 __le32 multiretry;
196 __le32 framedup;
197 __le32 rtssuccess;
198 __le32 rtsfailure;
199 __le32 ackfailure;
200 __le32 rxfrag;
201 __le32 mcastrxframe;
202 __le32 fcserror;
203 __le32 txframe;
204 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200205};
206
207struct cmd_ds_mac_control {
David Woodhouse981f1872007-05-25 23:36:54 -0400208 __le16 action;
209 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200210};
211
212struct cmd_ds_mac_multicast_adr {
David Woodhouse981f1872007-05-25 23:36:54 -0400213 __le16 action;
214 __le16 nr_of_adrs;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200215 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
216};
217
218struct cmd_ds_802_11_authenticate {
219 u8 macaddr[ETH_ALEN];
220 u8 authtype;
221 u8 reserved[10];
222};
223
224struct cmd_ds_802_11_deauthenticate {
225 u8 macaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400226 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200227};
228
229struct cmd_ds_802_11_associate {
230 u8 peerstaaddr[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400231 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400232 __le16 listeninterval;
233 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200234 u8 dtimperiod;
235
236#if 0
237 mrvlietypes_ssidparamset_t ssidParamSet;
238 mrvlietypes_phyparamset_t phyparamset;
239 mrvlietypes_ssparamset_t ssparamset;
240 mrvlietypes_ratesparamset_t ratesParamSet;
241#endif
242} __attribute__ ((packed));
243
244struct cmd_ds_802_11_disassociate {
245 u8 destmacaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400246 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200247};
248
249struct cmd_ds_802_11_associate_rsp {
250 struct ieeetypes_assocrsp assocRsp;
251};
252
253struct cmd_ds_802_11_ad_hoc_result {
Dan Williamsea8da922007-08-02 11:18:23 -0400254 u8 pad[3];
255 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200256};
257
258struct cmd_ds_802_11_set_wep {
David Woodhousef70dd452007-12-18 00:18:05 -0500259 struct cmd_header hdr;
260
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200261 /* 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 */
David Woodhousef70dd452007-12-18 00:18:05 -0500268 uint8_t keytype[4];
269 uint8_t keymaterial[4][16];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200270};
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 Woodhousea7c45892007-12-17 22:43:48 -0500347 struct cmd_header hdr;
348
David Woodhouse981f1872007-05-25 23:36:54 -0400349 __le16 action;
350 __le16 control;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200351};
352
Brajesh Dave96287ac2007-11-20 17:44:28 -0500353struct cmd_ds_802_11_beacon_control {
354 __le16 action;
355 __le16 beacon_enable;
356 __le16 beacon_period;
357};
358
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200359struct cmd_ds_802_11_sleep_params {
David Woodhouse3fbe1042007-12-17 23:48:31 -0500360 struct cmd_header hdr;
361
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200362 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400363 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200364
365 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400366 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200367
368 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400369 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200370
371 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400372 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200373
374 /* control periodic calibration */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500375 uint8_t calcontrol;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200376
377 /* control the use of external sleep clock */
David Woodhouse3fbe1042007-12-17 23:48:31 -0500378 uint8_t externalsleepclk;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200379
380 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400381 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200382};
383
384struct cmd_ds_802_11_inactivity_timeout {
David Woodhouse6e5cc4f2007-12-17 23:04:37 -0500385 struct cmd_header hdr;
386
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200387 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400388 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200389
390 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400391 __le16 timeout;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200392};
393
394struct cmd_ds_802_11_rf_channel {
Dan Williams2dd4b262007-12-11 16:54:15 -0500395 struct cmd_header hdr;
396
David Woodhouse981f1872007-05-25 23:36:54 -0400397 __le16 action;
Dan Williams2dd4b262007-12-11 16:54:15 -0500398 __le16 channel;
399 __le16 rftype; /* unused */
400 __le16 reserved; /* unused */
401 u8 channellist[32]; /* unused */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200402};
403
404struct cmd_ds_802_11_rssi {
405 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400406 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200407
David Woodhouse981f1872007-05-25 23:36:54 -0400408 __le16 reserved_0;
409 __le16 reserved_1;
410 __le16 reserved_2;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200411};
412
413struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400414 __le16 SNR;
415 __le16 noisefloor;
416 __le16 avgSNR;
417 __le16 avgnoisefloor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200418};
419
420struct cmd_ds_802_11_mac_address {
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 {
David Woodhouse981f1872007-05-25 23:36:54 -0400426 __le16 action;
427 __le16 currentlevel;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200428};
429
430struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400431 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200432
433 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400434 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200435
436};
437
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400438struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000439 __le16 action;
440 __le16 mode;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400441};
442
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400443struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500444 struct cmd_header hdr;
445
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000446 __le16 action;
447 __le16 version;
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400448};
449
David Woodhousec6ad3732007-12-16 21:43:40 -0500450struct cmd_ds_802_11_fw_wake_method {
451 struct cmd_header hdr;
452
453 __le16 action;
454 __le16 method;
455};
456
457struct cmd_ds_802_11_sleep_period {
458 struct cmd_header hdr;
459
460 __le16 action;
461 __le16 period;
462};
463
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200464struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400465 __le16 action;
466 __le16 nullpktinterval;
467 __le16 multipledtim;
468 __le16 reserved;
469 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200470};
471
472struct PS_CMD_ConfirmSleep {
David Woodhouse981f1872007-05-25 23:36:54 -0400473 __le16 command;
474 __le16 size;
475 __le16 seqnum;
476 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200477
David Woodhouse981f1872007-05-25 23:36:54 -0400478 __le16 action;
479 __le16 reserved1;
480 __le16 multipledtim;
481 __le16 reserved;
482 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200483};
484
485struct cmd_ds_802_11_data_rate {
Dan Williams8e3c91b2007-12-11 15:50:59 -0500486 struct cmd_header hdr;
487
David Woodhouse981f1872007-05-25 23:36:54 -0400488 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400489 __le16 reserved;
490 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200491};
492
493struct cmd_ds_802_11_rate_adapt_rateset {
David Woodhouse981f1872007-05-25 23:36:54 -0400494 __le16 action;
495 __le16 enablehwauto;
496 __le16 bitmap;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200497};
498
499struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsb44898e2007-08-02 11:18:40 -0400500 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200501 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400502 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200503 u8 dtimperiod;
504 union IEEEtypes_ssparamset ssparamset;
505 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400506 __le16 probedelay;
Dan Williams0c9ca692007-08-02 10:43:44 -0400507 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400508 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200509 u8 tlv_memory_size_pad[100];
510} __attribute__ ((packed));
511
512struct adhoc_bssdesc {
Dan Williams0c9ca692007-08-02 10:43:44 -0400513 u8 bssid[6];
514 u8 ssid[32];
515 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400516 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200517 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400518 __le64 timestamp;
519 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200520 union ieeetypes_phyparamset phyparamset;
521 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca692007-08-02 10:43:44 -0400522 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400523 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200524
525 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
526 * Adhoc join command and will cause a binary layout mismatch with
527 * the firmware
528 */
529} __attribute__ ((packed));
530
531struct cmd_ds_802_11_ad_hoc_join {
Dan Williams0c9ca692007-08-02 10:43:44 -0400532 struct adhoc_bssdesc bss;
David Woodhouse981f1872007-05-25 23:36:54 -0400533 __le16 failtimeout;
534 __le16 probedelay;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200535
536} __attribute__ ((packed));
537
538struct cmd_ds_802_11_enable_rsn {
David Woodhouse4f59abf2007-12-18 00:47:17 -0500539 struct cmd_header hdr;
540
David Woodhouse981f1872007-05-25 23:36:54 -0400541 __le16 action;
542 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400543} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200544
545struct MrvlIEtype_keyParamSet {
546 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400547 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200548
549 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400550 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200551
552 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400553 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200554
555 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400556 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200557
558 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400559 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200560
561 /* key material of size keylen */
562 u8 key[32];
563};
564
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500565struct cmd_ds_host_sleep {
566 struct cmd_header hdr;
567 __le32 criteria;
568 uint8_t gpio;
569 uint8_t gap;
570} __attribute__ ((packed));
571
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200572struct cmd_ds_802_11_key_material {
David Woodhouse981f1872007-05-25 23:36:54 -0400573 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200574 struct MrvlIEtype_keyParamSet keyParamSet[2];
575} __attribute__ ((packed));
576
577struct cmd_ds_802_11_eeprom_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400578 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200579
580 /* multiple 4 */
David Woodhouse981f1872007-05-25 23:36:54 -0400581 __le16 offset;
582 __le16 bytecount;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200583 u8 value;
584} __attribute__ ((packed));
585
586struct cmd_ds_802_11_tpc_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400587 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200588 u8 enable;
589 s8 P0;
590 s8 P1;
591 s8 P2;
592 u8 usesnr;
593} __attribute__ ((packed));
594
595struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400596 __le16 action;
597 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200598 u8 data[256];
599} __attribute__ ((packed));
600
601struct cmd_ds_802_11_pwr_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400602 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200603 u8 enable;
604 s8 PA_P0;
605 s8 PA_P1;
606 s8 PA_P2;
607} __attribute__ ((packed));
608
609struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400610 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200611 union {
612 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400613 __le16 threshold;
614 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200615 };
616 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400617 __le16 timing_offset; /* signed */
618 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200619 };
620 };
621} __attribute__ ((packed));
622
623struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400624 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200625} __attribute__ ((packed));
626
627struct cmd_ds_get_tsf {
628 __le64 tsfvalue;
629} __attribute__ ((packed));
630
631struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400632 __le16 action;
633 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200634 u8 addr1[ETH_ALEN];
635 u8 addr2[ETH_ALEN];
636} __attribute__ ((packed));
637
638struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400639 __le16 action;
640 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400641 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200642 u8 da[ETH_ALEN];
643 u8 dir;
644 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400645 __le32 ssn;
646 __le32 dsn;
647 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400648 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200649 u8 hopcount;
650 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400651 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200652 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400653 __le32 snr;
654 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400655 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200656} __attribute__ ((packed));
657
David Woodhouse23a397a2007-12-11 18:56:42 -0500658
659struct cmd_ds_mesh_config {
660 struct cmd_header hdr;
661
662 __le16 action;
663 __le16 channel;
664 __le16 type;
665 __le16 length;
666 u8 data[128]; /* last position reserved */
667} __attribute__ ((packed));
668
669
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200670struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500671 struct cmd_header hdr;
672
David Woodhouse981f1872007-05-25 23:36:54 -0400673 __le16 action;
674 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200675} __attribute__ ((packed));
676
Javier Cardona0601e7e2007-05-25 12:12:06 -0400677/* Number of stats counters returned by the firmware */
678#define MESH_STATS_NUM 8
679
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200680struct cmd_ds_command {
681 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400682 __le16 command;
683 __le16 size;
684 __le16 seqnum;
685 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200686
687 /* command Body */
688 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200689 struct cmd_ds_802_11_ps_mode psmode;
690 struct cmd_ds_802_11_scan scan;
691 struct cmd_ds_802_11_scan_rsp scanresp;
692 struct cmd_ds_mac_control macctrl;
693 struct cmd_ds_802_11_associate associate;
694 struct cmd_ds_802_11_deauthenticate deauth;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200695 struct cmd_ds_802_11_ad_hoc_start ads;
696 struct cmd_ds_802_11_reset reset;
697 struct cmd_ds_802_11_ad_hoc_result result;
698 struct cmd_ds_802_11_get_log glog;
699 struct cmd_ds_802_11_authenticate auth;
700 struct cmd_ds_802_11_get_stat gstat;
701 struct cmd_ds_802_3_get_stat gstat_8023;
702 struct cmd_ds_802_11_snmp_mib smib;
703 struct cmd_ds_802_11_rf_tx_power txp;
704 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400705 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200706 struct cmd_ds_802_11_rate_adapt_rateset rateset;
707 struct cmd_ds_mac_multicast_adr madr;
708 struct cmd_ds_802_11_ad_hoc_join adj;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200709 struct cmd_ds_802_11_rssi rssi;
710 struct cmd_ds_802_11_rssi_rsp rssirsp;
711 struct cmd_ds_802_11_disassociate dassociate;
712 struct cmd_ds_802_11_mac_address macadd;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200713 struct cmd_ds_802_11_key_material keymaterial;
714 struct cmd_ds_mac_reg_access macreg;
715 struct cmd_ds_bbp_reg_access bbpreg;
716 struct cmd_ds_rf_reg_access rfreg;
717 struct cmd_ds_802_11_eeprom_access rdeeprom;
718
719 struct cmd_ds_802_11d_domain_info domaininfo;
720 struct cmd_ds_802_11d_domain_info domaininforesp;
721
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200722 struct cmd_ds_802_11_tpc_cfg tpccfg;
723 struct cmd_ds_802_11_pwr_cfg pwrcfg;
724 struct cmd_ds_802_11_afc afc;
725 struct cmd_ds_802_11_led_ctrl ledgpio;
726
727 struct cmd_tx_rate_query txrate;
728 struct cmd_ds_bt_access bt;
729 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200730 struct cmd_ds_get_tsf gettsf;
731 struct cmd_ds_802_11_subscribe_event subscribe_event;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500732 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200733 } params;
734} __attribute__ ((packed));
735
736#endif