blob: 719da737aaf0839beac136ca8a0c3db298c90591 [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 /* command response */
Dan Williams7ad994d2007-12-11 12:33:30 -050078 int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *);
David Woodhouse1309b552007-12-10 13:36:10 -050079 unsigned long callback_arg;
Holger Schurig675787e2007-12-05 17:58:11 +010080 /* command data */
Dan Williamsddac4522007-12-11 13:49:39 -050081 struct cmd_header *cmdbuf;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020082 /* wait queue */
83 u16 cmdwaitqwoken;
84 wait_queue_head_t cmdwait_q;
85};
86
Dan Williams1443b652007-08-02 10:45:55 -040087/* Generic structure to hold all key types. */
88struct enc_key {
89 u16 len;
Holger Schurig10078322007-11-15 18:05:47 -050090 u16 flags; /* KEY_INFO_* from defs.h */
91 u16 type; /* KEY_TYPE_* from defs.h */
Dan Williams1443b652007-08-02 10:45:55 -040092 u8 key[32];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020093};
94
Holger Schurig10078322007-11-15 18:05:47 -050095/* lbs_offset_value */
96struct lbs_offset_value {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020097 u32 offset;
98 u32 value;
99};
100
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200101/* Define general data structure */
102/* cmd_DS_GEN */
103struct cmd_ds_gen {
David Woodhouse981f1872007-05-25 23:36:54 -0400104 __le16 command;
105 __le16 size;
106 __le16 seqnum;
107 __le16 result;
Holger Schurig675787e2007-12-05 17:58:11 +0100108 void *cmdresp[0];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200109};
110
111#define S_DS_GEN sizeof(struct cmd_ds_gen)
Holger Schurig675787e2007-12-05 17:58:11 +0100112
113
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200114/*
Dan Williams0aef64d2007-08-02 11:31:18 -0400115 * Define data structure for CMD_GET_HW_SPEC
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200116 * This structure defines the response for the GET_HW_SPEC command
117 */
118struct cmd_ds_get_hw_spec {
Dan Williams6e66f032007-12-11 12:42:16 -0500119 struct cmd_header hdr;
120
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200121 /* HW Interface version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400122 __le16 hwifversion;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200123 /* HW version number */
David Woodhouse981f1872007-05-25 23:36:54 -0400124 __le16 version;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200125 /* Max number of TxPD FW can handle */
David Woodhouse981f1872007-05-25 23:36:54 -0400126 __le16 nr_txpd;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200127 /* Max no of Multicast address */
David Woodhouse981f1872007-05-25 23:36:54 -0400128 __le16 nr_mcast_adr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200129 /* MAC address */
130 u8 permanentaddr[6];
131
132 /* region Code */
David Woodhouse981f1872007-05-25 23:36:54 -0400133 __le16 regioncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200134
135 /* Number of antenna used */
David Woodhouse981f1872007-05-25 23:36:54 -0400136 __le16 nr_antenna;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200137
David Woodhousee5b3d472007-05-25 23:40:21 -0400138 /* FW release number, example 1,2,3,4 = 3.2.1p4 */
139 u8 fwreleasenumber[4];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200140
141 /* Base Address of TxPD queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400142 __le32 wcb_base;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200143 /* Read Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400144 __le32 rxpd_rdptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200145
146 /* Write Pointer of RxPd queue */
David Woodhouse981f1872007-05-25 23:36:54 -0400147 __le32 rxpd_wrptr;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200148
149 /*FW/HW capability */
David Woodhouse981f1872007-05-25 23:36:54 -0400150 __le32 fwcapinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200151} __attribute__ ((packed));
152
153struct cmd_ds_802_11_reset {
David Woodhouse981f1872007-05-25 23:36:54 -0400154 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200155};
156
157struct cmd_ds_802_11_subscribe_event {
David Woodhouse981f1872007-05-25 23:36:54 -0400158 __le16 action;
159 __le16 events;
Holger Schurig3a188642007-11-26 10:07:14 +0100160
161 /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
162 * number of TLVs. From the v5.1 manual, those TLVs would add up to
163 * 40 bytes. However, future firmware might add additional TLVs, so I
164 * bump this up a bit.
165 */
166 u8 tlv[128];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200167};
168
169/*
170 * This scan handle Country Information IE(802.11d compliant)
Dan Williams0aef64d2007-08-02 11:31:18 -0400171 * Define data structure for CMD_802_11_SCAN
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200172 */
173struct cmd_ds_802_11_scan {
174 u8 bsstype;
Dan Williams492b6da2007-08-02 11:16:07 -0400175 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200176 u8 tlvbuffer[1];
177#if 0
178 mrvlietypes_ssidparamset_t ssidParamSet;
179 mrvlietypes_chanlistparamset_t ChanListParamSet;
180 mrvlietypes_ratesparamset_t OpRateSet;
181#endif
182};
183
184struct cmd_ds_802_11_scan_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400185 __le16 bssdescriptsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200186 u8 nr_sets;
187 u8 bssdesc_and_tlvbuffer[1];
188};
189
190struct cmd_ds_802_11_get_log {
David Woodhouse981f1872007-05-25 23:36:54 -0400191 __le32 mcasttxframe;
192 __le32 failed;
193 __le32 retry;
194 __le32 multiretry;
195 __le32 framedup;
196 __le32 rtssuccess;
197 __le32 rtsfailure;
198 __le32 ackfailure;
199 __le32 rxfrag;
200 __le32 mcastrxframe;
201 __le32 fcserror;
202 __le32 txframe;
203 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200204};
205
206struct cmd_ds_mac_control {
David Woodhouse981f1872007-05-25 23:36:54 -0400207 __le16 action;
208 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200209};
210
211struct cmd_ds_mac_multicast_adr {
David Woodhouse981f1872007-05-25 23:36:54 -0400212 __le16 action;
213 __le16 nr_of_adrs;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200214 u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
215};
216
217struct cmd_ds_802_11_authenticate {
218 u8 macaddr[ETH_ALEN];
219 u8 authtype;
220 u8 reserved[10];
221};
222
223struct cmd_ds_802_11_deauthenticate {
224 u8 macaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400225 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200226};
227
228struct cmd_ds_802_11_associate {
229 u8 peerstaaddr[6];
Dan Williams0c9ca692007-08-02 10:43:44 -0400230 __le16 capability;
David Woodhouse981f1872007-05-25 23:36:54 -0400231 __le16 listeninterval;
232 __le16 bcnperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200233 u8 dtimperiod;
234
235#if 0
236 mrvlietypes_ssidparamset_t ssidParamSet;
237 mrvlietypes_phyparamset_t phyparamset;
238 mrvlietypes_ssparamset_t ssparamset;
239 mrvlietypes_ratesparamset_t ratesParamSet;
240#endif
241} __attribute__ ((packed));
242
243struct cmd_ds_802_11_disassociate {
244 u8 destmacaddr[6];
David Woodhouse981f1872007-05-25 23:36:54 -0400245 __le16 reasoncode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200246};
247
248struct cmd_ds_802_11_associate_rsp {
249 struct ieeetypes_assocrsp assocRsp;
250};
251
252struct cmd_ds_802_11_ad_hoc_result {
Dan Williamsea8da922007-08-02 11:18:23 -0400253 u8 pad[3];
254 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200255};
256
257struct cmd_ds_802_11_set_wep {
258 /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
David Woodhouse981f1872007-05-25 23:36:54 -0400259 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200260
261 /* key Index selected for Tx */
David Woodhouse981f1872007-05-25 23:36:54 -0400262 __le16 keyindex;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200263
264 /* 40, 128bit or TXWEP */
265 u8 keytype[4];
266 u8 keymaterial[4][16];
267};
268
269struct cmd_ds_802_3_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400270 __le32 xmitok;
271 __le32 rcvok;
272 __le32 xmiterror;
273 __le32 rcverror;
274 __le32 rcvnobuffer;
275 __le32 rcvcrcerror;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200276};
277
278struct cmd_ds_802_11_get_stat {
David Woodhouse981f1872007-05-25 23:36:54 -0400279 __le32 txfragmentcnt;
280 __le32 mcasttxframecnt;
281 __le32 failedcnt;
282 __le32 retrycnt;
283 __le32 Multipleretrycnt;
284 __le32 rtssuccesscnt;
285 __le32 rtsfailurecnt;
286 __le32 ackfailurecnt;
287 __le32 frameduplicatecnt;
288 __le32 rxfragmentcnt;
289 __le32 mcastrxframecnt;
290 __le32 fcserrorcnt;
291 __le32 bcasttxframecnt;
292 __le32 bcastrxframecnt;
293 __le32 txbeacon;
294 __le32 rxbeacon;
295 __le32 wepundecryptable;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200296};
297
298struct cmd_ds_802_11_snmp_mib {
David Woodhouse981f1872007-05-25 23:36:54 -0400299 __le16 querytype;
300 __le16 oid;
301 __le16 bufsize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200302 u8 value[128];
303};
304
305struct cmd_ds_mac_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_bbp_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400312 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200313 u8 regmap[128];
David Woodhouse981f1872007-05-25 23:36:54 -0400314 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200315};
316
317struct cmd_ds_rf_reg_map {
David Woodhouse981f1872007-05-25 23:36:54 -0400318 __le16 buffersize;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200319 u8 regmap[64];
David Woodhouse981f1872007-05-25 23:36:54 -0400320 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200321};
322
323struct cmd_ds_mac_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400324 __le16 action;
325 __le16 offset;
326 __le32 value;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200327};
328
329struct cmd_ds_bbp_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400330 __le16 action;
331 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200332 u8 value;
333 u8 reserved[3];
334};
335
336struct cmd_ds_rf_reg_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400337 __le16 action;
338 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200339 u8 value;
340 u8 reserved[3];
341};
342
343struct cmd_ds_802_11_radio_control {
David Woodhouse981f1872007-05-25 23:36:54 -0400344 __le16 action;
345 __le16 control;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200346};
347
Brajesh Dave96287ac2007-11-20 17:44:28 -0500348struct cmd_ds_802_11_beacon_control {
349 __le16 action;
350 __le16 beacon_enable;
351 __le16 beacon_period;
352};
353
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200354struct cmd_ds_802_11_sleep_params {
355 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400356 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200357
358 /* Sleep clock error in ppm */
David Woodhouse981f1872007-05-25 23:36:54 -0400359 __le16 error;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200360
361 /* Wakeup offset in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400362 __le16 offset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200363
364 /* Clock stabilization time in usec */
David Woodhouse981f1872007-05-25 23:36:54 -0400365 __le16 stabletime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200366
367 /* control periodic calibration */
368 u8 calcontrol;
369
370 /* control the use of external sleep clock */
371 u8 externalsleepclk;
372
373 /* reserved field, should be set to zero */
David Woodhouse981f1872007-05-25 23:36:54 -0400374 __le16 reserved;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200375};
376
377struct cmd_ds_802_11_inactivity_timeout {
378 /* ACT_GET/ACT_SET */
David Woodhouse981f1872007-05-25 23:36:54 -0400379 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200380
381 /* Inactivity timeout in msec */
David Woodhouse981f1872007-05-25 23:36:54 -0400382 __le16 timeout;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200383};
384
385struct cmd_ds_802_11_rf_channel {
Dan Williams2dd4b262007-12-11 16:54:15 -0500386 struct cmd_header hdr;
387
David Woodhouse981f1872007-05-25 23:36:54 -0400388 __le16 action;
Dan Williams2dd4b262007-12-11 16:54:15 -0500389 __le16 channel;
390 __le16 rftype; /* unused */
391 __le16 reserved; /* unused */
392 u8 channellist[32]; /* unused */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200393};
394
395struct cmd_ds_802_11_rssi {
396 /* weighting factor */
David Woodhouse981f1872007-05-25 23:36:54 -0400397 __le16 N;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200398
David Woodhouse981f1872007-05-25 23:36:54 -0400399 __le16 reserved_0;
400 __le16 reserved_1;
401 __le16 reserved_2;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200402};
403
404struct cmd_ds_802_11_rssi_rsp {
David Woodhouse981f1872007-05-25 23:36:54 -0400405 __le16 SNR;
406 __le16 noisefloor;
407 __le16 avgSNR;
408 __le16 avgnoisefloor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200409};
410
411struct cmd_ds_802_11_mac_address {
David Woodhouse981f1872007-05-25 23:36:54 -0400412 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200413 u8 macadd[ETH_ALEN];
414};
415
416struct cmd_ds_802_11_rf_tx_power {
David Woodhouse981f1872007-05-25 23:36:54 -0400417 __le16 action;
418 __le16 currentlevel;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200419};
420
421struct cmd_ds_802_11_rf_antenna {
David Woodhouse981f1872007-05-25 23:36:54 -0400422 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200423
424 /* Number of antennas or 0xffff(diversity) */
David Woodhouse981f1872007-05-25 23:36:54 -0400425 __le16 antennamode;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200426
427};
428
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400429struct cmd_ds_802_11_monitor_mode {
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000430 __le16 action;
431 __le16 mode;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400432};
433
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400434struct cmd_ds_set_boot2_ver {
Dan Williams7ad994d2007-12-11 12:33:30 -0500435 struct cmd_header hdr;
436
Holger Schurigc2df2ef2007-12-07 15:30:44 +0000437 __le16 action;
438 __le16 version;
Luis Carlos Cobo63f00232007-08-02 13:19:24 -0400439};
440
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200441struct cmd_ds_802_11_ps_mode {
David Woodhouse981f1872007-05-25 23:36:54 -0400442 __le16 action;
443 __le16 nullpktinterval;
444 __le16 multipledtim;
445 __le16 reserved;
446 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200447};
448
449struct PS_CMD_ConfirmSleep {
David Woodhouse981f1872007-05-25 23:36:54 -0400450 __le16 command;
451 __le16 size;
452 __le16 seqnum;
453 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200454
David Woodhouse981f1872007-05-25 23:36:54 -0400455 __le16 action;
456 __le16 reserved1;
457 __le16 multipledtim;
458 __le16 reserved;
459 __le16 locallisteninterval;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200460};
461
462struct cmd_ds_802_11_data_rate {
Dan Williams8e3c91b2007-12-11 15:50:59 -0500463 struct cmd_header hdr;
464
David Woodhouse981f1872007-05-25 23:36:54 -0400465 __le16 action;
Dan Williams8c512762007-08-02 11:40:45 -0400466 __le16 reserved;
467 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200468};
469
470struct cmd_ds_802_11_rate_adapt_rateset {
David Woodhouse981f1872007-05-25 23:36:54 -0400471 __le16 action;
472 __le16 enablehwauto;
473 __le16 bitmap;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200474};
475
476struct cmd_ds_802_11_ad_hoc_start {
Dan Williamsb44898e2007-08-02 11:18:40 -0400477 u8 ssid[IW_ESSID_MAX_SIZE];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200478 u8 bsstype;
David Woodhouse981f1872007-05-25 23:36:54 -0400479 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200480 u8 dtimperiod;
481 union IEEEtypes_ssparamset ssparamset;
482 union ieeetypes_phyparamset phyparamset;
David Woodhouse981f1872007-05-25 23:36:54 -0400483 __le16 probedelay;
Dan Williams0c9ca692007-08-02 10:43:44 -0400484 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400485 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200486 u8 tlv_memory_size_pad[100];
487} __attribute__ ((packed));
488
489struct adhoc_bssdesc {
Dan Williams0c9ca692007-08-02 10:43:44 -0400490 u8 bssid[6];
491 u8 ssid[32];
492 u8 type;
David Woodhouse981f1872007-05-25 23:36:54 -0400493 __le16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200494 u8 dtimperiod;
David Woodhouse981f1872007-05-25 23:36:54 -0400495 __le64 timestamp;
496 __le64 localtime;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200497 union ieeetypes_phyparamset phyparamset;
498 union IEEEtypes_ssparamset ssparamset;
Dan Williams0c9ca692007-08-02 10:43:44 -0400499 __le16 capability;
Dan Williams8c512762007-08-02 11:40:45 -0400500 u8 rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200501
502 /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
503 * Adhoc join command and will cause a binary layout mismatch with
504 * the firmware
505 */
506} __attribute__ ((packed));
507
508struct cmd_ds_802_11_ad_hoc_join {
Dan Williams0c9ca692007-08-02 10:43:44 -0400509 struct adhoc_bssdesc bss;
David Woodhouse981f1872007-05-25 23:36:54 -0400510 __le16 failtimeout;
511 __le16 probedelay;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200512
513} __attribute__ ((packed));
514
515struct cmd_ds_802_11_enable_rsn {
David Woodhouse981f1872007-05-25 23:36:54 -0400516 __le16 action;
517 __le16 enable;
Dan Williams18c96c342007-06-18 12:01:12 -0400518} __attribute__ ((packed));
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200519
520struct MrvlIEtype_keyParamSet {
521 /* type ID */
David Woodhouse981f1872007-05-25 23:36:54 -0400522 __le16 type;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200523
524 /* length of Payload */
David Woodhouse981f1872007-05-25 23:36:54 -0400525 __le16 length;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200526
527 /* type of key: WEP=0, TKIP=1, AES=2 */
David Woodhouse981f1872007-05-25 23:36:54 -0400528 __le16 keytypeid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200529
530 /* key control Info specific to a keytypeid */
David Woodhouse981f1872007-05-25 23:36:54 -0400531 __le16 keyinfo;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200532
533 /* length of key */
David Woodhouse981f1872007-05-25 23:36:54 -0400534 __le16 keylen;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200535
536 /* key material of size keylen */
537 u8 key[32];
538};
539
David Woodhouse6ce4fd22007-12-12 15:19:29 -0500540struct cmd_ds_host_sleep {
541 struct cmd_header hdr;
542 __le32 criteria;
543 uint8_t gpio;
544 uint8_t gap;
545} __attribute__ ((packed));
546
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200547struct cmd_ds_802_11_key_material {
David Woodhouse981f1872007-05-25 23:36:54 -0400548 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200549 struct MrvlIEtype_keyParamSet keyParamSet[2];
550} __attribute__ ((packed));
551
552struct cmd_ds_802_11_eeprom_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400553 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200554
555 /* multiple 4 */
David Woodhouse981f1872007-05-25 23:36:54 -0400556 __le16 offset;
557 __le16 bytecount;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200558 u8 value;
559} __attribute__ ((packed));
560
561struct cmd_ds_802_11_tpc_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400562 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200563 u8 enable;
564 s8 P0;
565 s8 P1;
566 s8 P2;
567 u8 usesnr;
568} __attribute__ ((packed));
569
570struct cmd_ds_802_11_led_ctrl {
David Woodhouse981f1872007-05-25 23:36:54 -0400571 __le16 action;
572 __le16 numled;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200573 u8 data[256];
574} __attribute__ ((packed));
575
576struct cmd_ds_802_11_pwr_cfg {
David Woodhouse981f1872007-05-25 23:36:54 -0400577 __le16 action;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200578 u8 enable;
579 s8 PA_P0;
580 s8 PA_P1;
581 s8 PA_P2;
582} __attribute__ ((packed));
583
584struct cmd_ds_802_11_afc {
David Woodhouse981f1872007-05-25 23:36:54 -0400585 __le16 afc_auto;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200586 union {
587 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400588 __le16 threshold;
589 __le16 period;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200590 };
591 struct {
David Woodhouse981f1872007-05-25 23:36:54 -0400592 __le16 timing_offset; /* signed */
593 __le16 carrier_offset; /* signed */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200594 };
595 };
596} __attribute__ ((packed));
597
598struct cmd_tx_rate_query {
David Woodhouse981f1872007-05-25 23:36:54 -0400599 __le16 txrate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200600} __attribute__ ((packed));
601
602struct cmd_ds_get_tsf {
603 __le64 tsfvalue;
604} __attribute__ ((packed));
605
606struct cmd_ds_bt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400607 __le16 action;
608 __le32 id;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200609 u8 addr1[ETH_ALEN];
610 u8 addr2[ETH_ALEN];
611} __attribute__ ((packed));
612
613struct cmd_ds_fwt_access {
David Woodhouse981f1872007-05-25 23:36:54 -0400614 __le16 action;
615 __le32 id;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400616 u8 valid;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200617 u8 da[ETH_ALEN];
618 u8 dir;
619 u8 ra[ETH_ALEN];
David Woodhouse981f1872007-05-25 23:36:54 -0400620 __le32 ssn;
621 __le32 dsn;
622 __le32 metric;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400623 u8 rate;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200624 u8 hopcount;
625 u8 ttl;
David Woodhouse981f1872007-05-25 23:36:54 -0400626 __le32 expiration;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200627 u8 sleepmode;
David Woodhouse981f1872007-05-25 23:36:54 -0400628 __le32 snr;
629 __le32 references;
Luis Carlos Cobo90e8eaf2007-05-25 13:53:26 -0400630 u8 prec[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200631} __attribute__ ((packed));
632
David Woodhouse23a397a2007-12-11 18:56:42 -0500633
634struct cmd_ds_mesh_config {
635 struct cmd_header hdr;
636
637 __le16 action;
638 __le16 channel;
639 __le16 type;
640 __le16 length;
641 u8 data[128]; /* last position reserved */
642} __attribute__ ((packed));
643
644
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200645struct cmd_ds_mesh_access {
David Woodhouse301eacb2007-12-11 15:23:59 -0500646 struct cmd_header hdr;
647
David Woodhouse981f1872007-05-25 23:36:54 -0400648 __le16 action;
649 __le32 data[32]; /* last position reserved */
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200650} __attribute__ ((packed));
651
Javier Cardona0601e7e2007-05-25 12:12:06 -0400652/* Number of stats counters returned by the firmware */
653#define MESH_STATS_NUM 8
654
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200655struct cmd_ds_command {
656 /* command header */
David Woodhouse981f1872007-05-25 23:36:54 -0400657 __le16 command;
658 __le16 size;
659 __le16 seqnum;
660 __le16 result;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200661
662 /* command Body */
663 union {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200664 struct cmd_ds_802_11_ps_mode psmode;
665 struct cmd_ds_802_11_scan scan;
666 struct cmd_ds_802_11_scan_rsp scanresp;
667 struct cmd_ds_mac_control macctrl;
668 struct cmd_ds_802_11_associate associate;
669 struct cmd_ds_802_11_deauthenticate deauth;
670 struct cmd_ds_802_11_set_wep wep;
671 struct cmd_ds_802_11_ad_hoc_start ads;
672 struct cmd_ds_802_11_reset reset;
673 struct cmd_ds_802_11_ad_hoc_result result;
674 struct cmd_ds_802_11_get_log glog;
675 struct cmd_ds_802_11_authenticate auth;
676 struct cmd_ds_802_11_get_stat gstat;
677 struct cmd_ds_802_3_get_stat gstat_8023;
678 struct cmd_ds_802_11_snmp_mib smib;
679 struct cmd_ds_802_11_rf_tx_power txp;
680 struct cmd_ds_802_11_rf_antenna rant;
Luis Carlos Cobo965f8bb2007-08-02 13:16:55 -0400681 struct cmd_ds_802_11_monitor_mode monitor;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200682 struct cmd_ds_802_11_rate_adapt_rateset rateset;
683 struct cmd_ds_mac_multicast_adr madr;
684 struct cmd_ds_802_11_ad_hoc_join adj;
685 struct cmd_ds_802_11_radio_control radio;
686 struct cmd_ds_802_11_rf_channel rfchannel;
687 struct cmd_ds_802_11_rssi rssi;
688 struct cmd_ds_802_11_rssi_rsp rssirsp;
689 struct cmd_ds_802_11_disassociate dassociate;
690 struct cmd_ds_802_11_mac_address macadd;
691 struct cmd_ds_802_11_enable_rsn enbrsn;
692 struct cmd_ds_802_11_key_material keymaterial;
693 struct cmd_ds_mac_reg_access macreg;
694 struct cmd_ds_bbp_reg_access bbpreg;
695 struct cmd_ds_rf_reg_access rfreg;
696 struct cmd_ds_802_11_eeprom_access rdeeprom;
697
698 struct cmd_ds_802_11d_domain_info domaininfo;
699 struct cmd_ds_802_11d_domain_info domaininforesp;
700
701 struct cmd_ds_802_11_sleep_params sleep_params;
702 struct cmd_ds_802_11_inactivity_timeout inactivity_timeout;
703 struct cmd_ds_802_11_tpc_cfg tpccfg;
704 struct cmd_ds_802_11_pwr_cfg pwrcfg;
705 struct cmd_ds_802_11_afc afc;
706 struct cmd_ds_802_11_led_ctrl ledgpio;
707
708 struct cmd_tx_rate_query txrate;
709 struct cmd_ds_bt_access bt;
710 struct cmd_ds_fwt_access fwt;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200711 struct cmd_ds_get_tsf gettsf;
712 struct cmd_ds_802_11_subscribe_event subscribe_event;
Brajesh Dave96287ac2007-11-20 17:44:28 -0500713 struct cmd_ds_802_11_beacon_control bcn_ctrl;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200714 } params;
715} __attribute__ ((packed));
716
717#endif