libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
[safe/jmp/linux-2.6] / drivers / net / wireless / libertas / host.h
1 /**
2   * This file function prototypes, data structure
3   * and  definitions for all the host/station commands
4   */
5
6 #ifndef _LBS_HOST_H_
7 #define _LBS_HOST_H_
8
9 #include "11d.h"
10
11 #define DEFAULT_AD_HOC_CHANNEL                  6
12
13 #define CMD_OPTION_WAITFORRSP                   0x0002
14
15 /** Host command IDs */
16
17 /* Return command are almost always the same as the host command, but with
18  * bit 15 set high.  There are a few exceptions, though...
19  */
20 #define CMD_RET(cmd)                            (0x8000 | cmd)
21
22 /* Return command convention exceptions: */
23 #define CMD_RET_802_11_ASSOCIATE                0x8012
24
25 /* Command codes */
26 #define CMD_GET_HW_SPEC                         0x0003
27 #define CMD_EEPROM_UPDATE                       0x0004
28 #define CMD_802_11_RESET                        0x0005
29 #define CMD_802_11_SCAN                         0x0006
30 #define CMD_802_11_GET_LOG                      0x000b
31 #define CMD_MAC_MULTICAST_ADR                   0x0010
32 #define CMD_802_11_AUTHENTICATE                 0x0011
33 #define CMD_802_11_EEPROM_ACCESS                0x0059
34 #define CMD_802_11_ASSOCIATE                    0x0050
35 #define CMD_802_11_SET_WEP                      0x0013
36 #define CMD_802_11_GET_STAT                     0x0014
37 #define CMD_802_3_GET_STAT                      0x0015
38 #define CMD_802_11_SNMP_MIB                     0x0016
39 #define CMD_MAC_REG_MAP                         0x0017
40 #define CMD_BBP_REG_MAP                         0x0018
41 #define CMD_MAC_REG_ACCESS                      0x0019
42 #define CMD_BBP_REG_ACCESS                      0x001a
43 #define CMD_RF_REG_ACCESS                       0x001b
44 #define CMD_802_11_RADIO_CONTROL                0x001c
45 #define CMD_802_11_RF_CHANNEL                   0x001d
46 #define CMD_802_11_RF_TX_POWER                  0x001e
47 #define CMD_802_11_RSSI                         0x001f
48 #define CMD_802_11_RF_ANTENNA                   0x0020
49 #define CMD_802_11_PS_MODE                      0x0021
50 #define CMD_802_11_DATA_RATE                    0x0022
51 #define CMD_RF_REG_MAP                          0x0023
52 #define CMD_802_11_DEAUTHENTICATE               0x0024
53 #define CMD_802_11_REASSOCIATE                  0x0025
54 #define CMD_MAC_CONTROL                         0x0028
55 #define CMD_802_11_AD_HOC_START                 0x002b
56 #define CMD_802_11_AD_HOC_JOIN                  0x002c
57 #define CMD_802_11_QUERY_TKIP_REPLY_CNTRS       0x002e
58 #define CMD_802_11_ENABLE_RSN                   0x002f
59 #define CMD_802_11_SET_AFC                      0x003c
60 #define CMD_802_11_GET_AFC                      0x003d
61 #define CMD_802_11_DEEP_SLEEP                   0x003e
62 #define CMD_802_11_AD_HOC_STOP                  0x0040
63 #define CMD_802_11_HOST_SLEEP_CFG               0x0043
64 #define CMD_802_11_WAKEUP_CONFIRM               0x0044
65 #define CMD_802_11_HOST_SLEEP_ACTIVATE          0x0045
66 #define CMD_802_11_BEACON_STOP                  0x0049
67 #define CMD_802_11_MAC_ADDRESS                  0x004d
68 #define CMD_802_11_LED_GPIO_CTRL                0x004e
69 #define CMD_802_11_EEPROM_ACCESS                0x0059
70 #define CMD_802_11_BAND_CONFIG                  0x0058
71 #define CMD_GSPI_BUS_CONFIG                     0x005a
72 #define CMD_802_11D_DOMAIN_INFO                 0x005b
73 #define CMD_802_11_KEY_MATERIAL                 0x005e
74 #define CMD_802_11_SLEEP_PARAMS                 0x0066
75 #define CMD_802_11_INACTIVITY_TIMEOUT           0x0067
76 #define CMD_802_11_SLEEP_PERIOD                 0x0068
77 #define CMD_802_11_TPC_CFG                      0x0072
78 #define CMD_802_11_PA_CFG                       0x0073
79 #define CMD_802_11_FW_WAKE_METHOD               0x0074
80 #define CMD_802_11_SUBSCRIBE_EVENT              0x0075
81 #define CMD_802_11_RATE_ADAPT_RATESET           0x0076
82 #define CMD_802_11_TX_RATE_QUERY                0x007f
83 #define CMD_GET_TSF                             0x0080
84 #define CMD_BT_ACCESS                           0x0087
85 #define CMD_FWT_ACCESS                          0x0095
86 #define CMD_802_11_MONITOR_MODE                 0x0098
87 #define CMD_MESH_ACCESS                         0x009b
88 #define CMD_MESH_CONFIG_OLD                     0x00a3
89 #define CMD_MESH_CONFIG                         0x00ac
90 #define CMD_SET_BOOT2_VER                       0x00a5
91 #define CMD_FUNC_INIT                           0x00a9
92 #define CMD_FUNC_SHUTDOWN                       0x00aa
93 #define CMD_802_11_BEACON_CTRL                  0x00b0
94
95 /* For the IEEE Power Save */
96 #define CMD_SUBCMD_ENTER_PS                     0x0030
97 #define CMD_SUBCMD_EXIT_PS                      0x0031
98 #define CMD_SUBCMD_SLEEP_CONFIRMED              0x0034
99 #define CMD_SUBCMD_FULL_POWERDOWN               0x0035
100 #define CMD_SUBCMD_FULL_POWERUP                 0x0036
101
102 #define CMD_ENABLE_RSN                          0x0001
103 #define CMD_DISABLE_RSN                         0x0000
104
105 #define CMD_ACT_GET                             0x0000
106 #define CMD_ACT_SET                             0x0001
107
108 /* Define action or option for CMD_802_11_SET_WEP */
109 #define CMD_ACT_ADD                             0x0002
110 #define CMD_ACT_REMOVE                          0x0004
111
112 #define CMD_TYPE_WEP_40_BIT                     0x01
113 #define CMD_TYPE_WEP_104_BIT                    0x02
114
115 #define CMD_NUM_OF_WEP_KEYS                     4
116
117 #define CMD_WEP_KEY_INDEX_MASK                  0x3fff
118
119 /* Define action or option for CMD_802_11_SCAN */
120 #define CMD_BSS_TYPE_BSS                        0x0001
121 #define CMD_BSS_TYPE_IBSS                       0x0002
122 #define CMD_BSS_TYPE_ANY                        0x0003
123
124 /* Define action or option for CMD_802_11_SCAN */
125 #define CMD_SCAN_TYPE_ACTIVE                    0x0000
126 #define CMD_SCAN_TYPE_PASSIVE                   0x0001
127
128 #define CMD_SCAN_RADIO_TYPE_BG                  0
129
130 #define CMD_SCAN_PROBE_DELAY_TIME               0
131
132 /* Define action or option for CMD_MAC_CONTROL */
133 #define CMD_ACT_MAC_RX_ON                       0x0001
134 #define CMD_ACT_MAC_TX_ON                       0x0002
135 #define CMD_ACT_MAC_LOOPBACK_ON                 0x0004
136 #define CMD_ACT_MAC_WEP_ENABLE                  0x0008
137 #define CMD_ACT_MAC_INT_ENABLE                  0x0010
138 #define CMD_ACT_MAC_MULTICAST_ENABLE            0x0020
139 #define CMD_ACT_MAC_BROADCAST_ENABLE            0x0040
140 #define CMD_ACT_MAC_PROMISCUOUS_ENABLE          0x0080
141 #define CMD_ACT_MAC_ALL_MULTICAST_ENABLE        0x0100
142 #define CMD_ACT_MAC_STRICT_PROTECTION_ENABLE    0x0400
143
144 /* Event flags for CMD_802_11_SUBSCRIBE_EVENT */
145 #define CMD_SUBSCRIBE_RSSI_LOW                  0x0001
146 #define CMD_SUBSCRIBE_SNR_LOW                   0x0002
147 #define CMD_SUBSCRIBE_FAILCOUNT                 0x0004
148 #define CMD_SUBSCRIBE_BCNMISS                   0x0008
149 #define CMD_SUBSCRIBE_RSSI_HIGH                 0x0010
150 #define CMD_SUBSCRIBE_SNR_HIGH                  0x0020
151
152 #define RADIO_PREAMBLE_LONG                     0x00
153 #define RADIO_PREAMBLE_SHORT                    0x02
154 #define RADIO_PREAMBLE_AUTO                     0x04
155
156 /* Define action or option for CMD_802_11_RF_CHANNEL */
157 #define CMD_OPT_802_11_RF_CHANNEL_GET           0x00
158 #define CMD_OPT_802_11_RF_CHANNEL_SET           0x01
159
160 /* Define action or option for CMD_802_11_DATA_RATE */
161 #define CMD_ACT_SET_TX_AUTO                     0x0000
162 #define CMD_ACT_SET_TX_FIX_RATE                 0x0001
163 #define CMD_ACT_GET_TX_RATE                     0x0002
164
165 /* Define action or option for CMD_802_11_PS_MODE */
166 #define CMD_TYPE_CAM                            0x0000
167 #define CMD_TYPE_MAX_PSP                        0x0001
168 #define CMD_TYPE_FAST_PSP                       0x0002
169
170 /* Options for CMD_802_11_FW_WAKE_METHOD */
171 #define CMD_WAKE_METHOD_UNCHANGED               0x0000
172 #define CMD_WAKE_METHOD_COMMAND_INT             0x0001
173 #define CMD_WAKE_METHOD_GPIO                    0x0002
174
175 /* Object IDs for CMD_802_11_SNMP_MIB */
176 #define SNMP_MIB_OID_BSS_TYPE                   0x0000
177 #define SNMP_MIB_OID_OP_RATE_SET                0x0001
178 #define SNMP_MIB_OID_BEACON_PERIOD              0x0002  /* Reserved on v9+ */
179 #define SNMP_MIB_OID_DTIM_PERIOD                0x0003  /* Reserved on v9+ */
180 #define SNMP_MIB_OID_ASSOC_TIMEOUT              0x0004  /* Reserved on v9+ */
181 #define SNMP_MIB_OID_RTS_THRESHOLD              0x0005
182 #define SNMP_MIB_OID_SHORT_RETRY_LIMIT          0x0006
183 #define SNMP_MIB_OID_LONG_RETRY_LIMIT           0x0007
184 #define SNMP_MIB_OID_FRAG_THRESHOLD             0x0008
185 #define SNMP_MIB_OID_11D_ENABLE                 0x0009
186 #define SNMP_MIB_OID_11H_ENABLE                 0x000A
187
188 /* Define action or option for CMD_BT_ACCESS */
189 enum cmd_bt_access_opts {
190         /* The bt commands start at 5 instead of 1 because the old dft commands
191          * are mapped to 1-4.  These old commands are no longer maintained and
192          * should not be called.
193          */
194         CMD_ACT_BT_ACCESS_ADD = 5,
195         CMD_ACT_BT_ACCESS_DEL,
196         CMD_ACT_BT_ACCESS_LIST,
197         CMD_ACT_BT_ACCESS_RESET,
198         CMD_ACT_BT_ACCESS_SET_INVERT,
199         CMD_ACT_BT_ACCESS_GET_INVERT
200 };
201
202 /* Define action or option for CMD_FWT_ACCESS */
203 enum cmd_fwt_access_opts {
204         CMD_ACT_FWT_ACCESS_ADD = 1,
205         CMD_ACT_FWT_ACCESS_DEL,
206         CMD_ACT_FWT_ACCESS_LOOKUP,
207         CMD_ACT_FWT_ACCESS_LIST,
208         CMD_ACT_FWT_ACCESS_LIST_ROUTE,
209         CMD_ACT_FWT_ACCESS_LIST_NEIGHBOR,
210         CMD_ACT_FWT_ACCESS_RESET,
211         CMD_ACT_FWT_ACCESS_CLEANUP,
212         CMD_ACT_FWT_ACCESS_TIME,
213 };
214
215 /* Define action or option for CMD_802_11_HOST_SLEEP_CFG */
216 enum cmd_wol_cfg_opts {
217         CMD_ACT_ACTION_NONE = 0,
218         CMD_ACT_SET_WOL_RULE,
219         CMD_ACT_GET_WOL_RULE,
220         CMD_ACT_RESET_WOL_RULE,
221 };
222
223 /* Define action or option for CMD_MESH_ACCESS */
224 enum cmd_mesh_access_opts {
225         CMD_ACT_MESH_GET_TTL = 1,
226         CMD_ACT_MESH_SET_TTL,
227         CMD_ACT_MESH_GET_STATS,
228         CMD_ACT_MESH_GET_ANYCAST,
229         CMD_ACT_MESH_SET_ANYCAST,
230         CMD_ACT_MESH_SET_LINK_COSTS,
231         CMD_ACT_MESH_GET_LINK_COSTS,
232         CMD_ACT_MESH_SET_BCAST_RATE,
233         CMD_ACT_MESH_GET_BCAST_RATE,
234         CMD_ACT_MESH_SET_RREQ_DELAY,
235         CMD_ACT_MESH_GET_RREQ_DELAY,
236         CMD_ACT_MESH_SET_ROUTE_EXP,
237         CMD_ACT_MESH_GET_ROUTE_EXP,
238         CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
239         CMD_ACT_MESH_GET_AUTOSTART_ENABLED,
240         CMD_ACT_MESH_SET_GET_PRB_RSP_LIMIT = 17,
241 };
242
243 /* Define actions and types for CMD_MESH_CONFIG */
244 enum cmd_mesh_config_actions {
245         CMD_ACT_MESH_CONFIG_STOP = 0,
246         CMD_ACT_MESH_CONFIG_START,
247         CMD_ACT_MESH_CONFIG_SET,
248         CMD_ACT_MESH_CONFIG_GET,
249 };
250
251 enum cmd_mesh_config_types {
252         CMD_TYPE_MESH_SET_BOOTFLAG = 1,
253         CMD_TYPE_MESH_SET_BOOTTIME,
254         CMD_TYPE_MESH_SET_DEF_CHANNEL,
255         CMD_TYPE_MESH_SET_MESH_IE,
256         CMD_TYPE_MESH_GET_DEFAULTS,
257         CMD_TYPE_MESH_GET_MESH_IE, /* GET_DEFAULTS is superset of GET_MESHIE */
258 };
259
260 /** Card Event definition */
261 #define MACREG_INT_CODE_TX_PPA_FREE             0
262 #define MACREG_INT_CODE_TX_DMA_DONE             1
263 #define MACREG_INT_CODE_LINK_LOST_W_SCAN        2
264 #define MACREG_INT_CODE_LINK_LOST_NO_SCAN       3
265 #define MACREG_INT_CODE_LINK_SENSED             4
266 #define MACREG_INT_CODE_CMD_FINISHED            5
267 #define MACREG_INT_CODE_MIB_CHANGED             6
268 #define MACREG_INT_CODE_INIT_DONE               7
269 #define MACREG_INT_CODE_DEAUTHENTICATED         8
270 #define MACREG_INT_CODE_DISASSOCIATED           9
271 #define MACREG_INT_CODE_PS_AWAKE                10
272 #define MACREG_INT_CODE_PS_SLEEP                11
273 #define MACREG_INT_CODE_MIC_ERR_MULTICAST       13
274 #define MACREG_INT_CODE_MIC_ERR_UNICAST         14
275 #define MACREG_INT_CODE_WM_AWAKE                15
276 #define MACREG_INT_CODE_DEEP_SLEEP_AWAKE        16
277 #define MACREG_INT_CODE_ADHOC_BCN_LOST          17
278 #define MACREG_INT_CODE_HOST_AWAKE              18
279 #define MACREG_INT_CODE_STOP_TX                 19
280 #define MACREG_INT_CODE_START_TX                20
281 #define MACREG_INT_CODE_CHANNEL_SWITCH          21
282 #define MACREG_INT_CODE_MEASUREMENT_RDY         22
283 #define MACREG_INT_CODE_WMM_CHANGE              23
284 #define MACREG_INT_CODE_BG_SCAN_REPORT          24
285 #define MACREG_INT_CODE_RSSI_LOW                25
286 #define MACREG_INT_CODE_SNR_LOW                 26
287 #define MACREG_INT_CODE_MAX_FAIL                27
288 #define MACREG_INT_CODE_RSSI_HIGH               28
289 #define MACREG_INT_CODE_SNR_HIGH                29
290 #define MACREG_INT_CODE_MESH_AUTO_STARTED       35
291 #define MACREG_INT_CODE_FIRMWARE_READY          48
292
293
294 /* 802.11-related definitions */
295
296 /* TxPD descriptor */
297 struct txpd {
298         /* union to cope up with later FW revisions */
299         union {
300                 /* Current Tx packet status */
301                 __le32 tx_status;
302                 struct {
303                         /* BSS type: client, AP, etc. */
304                         u8 bss_type;
305                         /* BSS number */
306                         u8 bss_num;
307                         /* Reserved */
308                         __le16 reserved;
309                 } bss;
310         } u;
311         /* Tx control */
312         __le32 tx_control;
313         __le32 tx_packet_location;
314         /* Tx packet length */
315         __le16 tx_packet_length;
316         /* First 2 byte of destination MAC address */
317         u8 tx_dest_addr_high[2];
318         /* Last 4 byte of destination MAC address */
319         u8 tx_dest_addr_low[4];
320         /* Pkt Priority */
321         u8 priority;
322         /* Pkt Trasnit Power control */
323         u8 powermgmt;
324         /* Amount of time the packet has been queued (units = 2ms) */
325         u8 pktdelay_2ms;
326         /* reserved */
327         u8 reserved1;
328 } __attribute__ ((packed));
329
330 /* RxPD Descriptor */
331 struct rxpd {
332         /* union to cope up with later FW revisions */
333         union {
334                 /* Current Rx packet status */
335                 __le16 status;
336                 struct {
337                         /* BSS type: client, AP, etc. */
338                         u8 bss_type;
339                         /* BSS number */
340                         u8 bss_num;
341                 } __attribute__ ((packed)) bss;
342         } __attribute__ ((packed)) u;
343
344         /* SNR */
345         u8 snr;
346
347         /* Tx control */
348         u8 rx_control;
349
350         /* Pkt length */
351         __le16 pkt_len;
352
353         /* Noise Floor */
354         u8 nf;
355
356         /* Rx Packet Rate */
357         u8 rx_rate;
358
359         /* Pkt addr */
360         __le32 pkt_ptr;
361
362         /* Next Rx RxPD addr */
363         __le32 next_rxpd_ptr;
364
365         /* Pkt Priority */
366         u8 priority;
367         u8 reserved[3];
368 } __attribute__ ((packed));
369
370 struct cmd_header {
371         __le16 command;
372         __le16 size;
373         __le16 seqnum;
374         __le16 result;
375 } __attribute__ ((packed));
376
377 /* Generic structure to hold all key types. */
378 struct enc_key {
379         u16 len;
380         u16 flags;  /* KEY_INFO_* from defs.h */
381         u16 type; /* KEY_TYPE_* from defs.h */
382         u8 key[32];
383 };
384
385 /* lbs_offset_value */
386 struct lbs_offset_value {
387         u32 offset;
388         u32 value;
389 } __attribute__ ((packed));
390
391 /* Define general data structure */
392 /* cmd_DS_GEN */
393 struct cmd_ds_gen {
394         __le16 command;
395         __le16 size;
396         __le16 seqnum;
397         __le16 result;
398         void *cmdresp[0];
399 } __attribute__ ((packed));
400
401 #define S_DS_GEN sizeof(struct cmd_ds_gen)
402
403
404 /*
405  * Define data structure for CMD_GET_HW_SPEC
406  * This structure defines the response for the GET_HW_SPEC command
407  */
408 struct cmd_ds_get_hw_spec {
409         struct cmd_header hdr;
410
411         /* HW Interface version number */
412         __le16 hwifversion;
413         /* HW version number */
414         __le16 version;
415         /* Max number of TxPD FW can handle */
416         __le16 nr_txpd;
417         /* Max no of Multicast address */
418         __le16 nr_mcast_adr;
419         /* MAC address */
420         u8 permanentaddr[6];
421
422         /* region Code */
423         __le16 regioncode;
424
425         /* Number of antenna used */
426         __le16 nr_antenna;
427
428         /* FW release number, example 0x01030304 = 2.3.4p1 */
429         __le32 fwrelease;
430
431         /* Base Address of TxPD queue */
432         __le32 wcb_base;
433         /* Read Pointer of RxPd queue */
434         __le32 rxpd_rdptr;
435
436         /* Write Pointer of RxPd queue */
437         __le32 rxpd_wrptr;
438
439         /*FW/HW capability */
440         __le32 fwcapinfo;
441 } __attribute__ ((packed));
442
443 struct cmd_ds_802_11_subscribe_event {
444         struct cmd_header hdr;
445
446         __le16 action;
447         __le16 events;
448
449         /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
450          * number of TLVs. From the v5.1 manual, those TLVs would add up to
451          * 40 bytes. However, future firmware might add additional TLVs, so I
452          * bump this up a bit.
453          */
454         uint8_t tlv[128];
455 } __attribute__ ((packed));
456
457 /*
458  * This scan handle Country Information IE(802.11d compliant)
459  * Define data structure for CMD_802_11_SCAN
460  */
461 struct cmd_ds_802_11_scan {
462         struct cmd_header hdr;
463
464         uint8_t bsstype;
465         uint8_t bssid[ETH_ALEN];
466         uint8_t tlvbuffer[0];
467 } __attribute__ ((packed));
468
469 struct cmd_ds_802_11_scan_rsp {
470         struct cmd_header hdr;
471
472         __le16 bssdescriptsize;
473         uint8_t nr_sets;
474         uint8_t bssdesc_and_tlvbuffer[0];
475 } __attribute__ ((packed));
476
477 struct cmd_ds_802_11_get_log {
478         struct cmd_header hdr;
479
480         __le32 mcasttxframe;
481         __le32 failed;
482         __le32 retry;
483         __le32 multiretry;
484         __le32 framedup;
485         __le32 rtssuccess;
486         __le32 rtsfailure;
487         __le32 ackfailure;
488         __le32 rxfrag;
489         __le32 mcastrxframe;
490         __le32 fcserror;
491         __le32 txframe;
492         __le32 wepundecryptable;
493 } __attribute__ ((packed));
494
495 struct cmd_ds_mac_control {
496         struct cmd_header hdr;
497         __le16 action;
498         u16 reserved;
499 } __attribute__ ((packed));
500
501 struct cmd_ds_mac_multicast_adr {
502         struct cmd_header hdr;
503         __le16 action;
504         __le16 nr_of_adrs;
505         u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
506 } __attribute__ ((packed));
507
508 struct cmd_ds_802_11_authenticate {
509         struct cmd_header hdr;
510
511         u8 bssid[ETH_ALEN];
512         u8 authtype;
513         u8 reserved[10];
514 } __attribute__ ((packed));
515
516 struct cmd_ds_802_11_deauthenticate {
517         struct cmd_header hdr;
518
519         u8 macaddr[ETH_ALEN];
520         __le16 reasoncode;
521 } __attribute__ ((packed));
522
523 struct cmd_ds_802_11_associate {
524         struct cmd_header hdr;
525
526         u8 bssid[6];
527         __le16 capability;
528         __le16 listeninterval;
529         __le16 bcnperiod;
530         u8 dtimperiod;
531         u8 iebuf[512];    /* Enough for required and most optional IEs */
532 } __attribute__ ((packed));
533
534 struct cmd_ds_802_11_associate_response {
535         struct cmd_header hdr;
536
537         __le16 capability;
538         __le16 statuscode;
539         __le16 aid;
540         u8 iebuf[512];
541 } __attribute__ ((packed));
542
543 struct cmd_ds_802_11_set_wep {
544         struct cmd_header hdr;
545
546         /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
547         __le16 action;
548
549         /* key Index selected for Tx */
550         __le16 keyindex;
551
552         /* 40, 128bit or TXWEP */
553         uint8_t keytype[4];
554         uint8_t keymaterial[4][16];
555 } __attribute__ ((packed));
556
557 struct cmd_ds_802_11_snmp_mib {
558         struct cmd_header hdr;
559
560         __le16 action;
561         __le16 oid;
562         __le16 bufsize;
563         u8 value[128];
564 } __attribute__ ((packed));
565
566 struct cmd_ds_mac_reg_access {
567         __le16 action;
568         __le16 offset;
569         __le32 value;
570 } __attribute__ ((packed));
571
572 struct cmd_ds_bbp_reg_access {
573         __le16 action;
574         __le16 offset;
575         u8 value;
576         u8 reserved[3];
577 } __attribute__ ((packed));
578
579 struct cmd_ds_rf_reg_access {
580         __le16 action;
581         __le16 offset;
582         u8 value;
583         u8 reserved[3];
584 } __attribute__ ((packed));
585
586 struct cmd_ds_802_11_radio_control {
587         struct cmd_header hdr;
588
589         __le16 action;
590         __le16 control;
591 } __attribute__ ((packed));
592
593 struct cmd_ds_802_11_beacon_control {
594         __le16 action;
595         __le16 beacon_enable;
596         __le16 beacon_period;
597 } __attribute__ ((packed));
598
599 struct cmd_ds_802_11_sleep_params {
600         struct cmd_header hdr;
601
602         /* ACT_GET/ACT_SET */
603         __le16 action;
604
605         /* Sleep clock error in ppm */
606         __le16 error;
607
608         /* Wakeup offset in usec */
609         __le16 offset;
610
611         /* Clock stabilization time in usec */
612         __le16 stabletime;
613
614         /* control periodic calibration */
615         uint8_t calcontrol;
616
617         /* control the use of external sleep clock */
618         uint8_t externalsleepclk;
619
620         /* reserved field, should be set to zero */
621         __le16 reserved;
622 } __attribute__ ((packed));
623
624 struct cmd_ds_802_11_rf_channel {
625         struct cmd_header hdr;
626
627         __le16 action;
628         __le16 channel;
629         __le16 rftype;      /* unused */
630         __le16 reserved;    /* unused */
631         u8 channellist[32]; /* unused */
632 } __attribute__ ((packed));
633
634 struct cmd_ds_802_11_rssi {
635         /* weighting factor */
636         __le16 N;
637
638         __le16 reserved_0;
639         __le16 reserved_1;
640         __le16 reserved_2;
641 } __attribute__ ((packed));
642
643 struct cmd_ds_802_11_rssi_rsp {
644         __le16 SNR;
645         __le16 noisefloor;
646         __le16 avgSNR;
647         __le16 avgnoisefloor;
648 } __attribute__ ((packed));
649
650 struct cmd_ds_802_11_mac_address {
651         struct cmd_header hdr;
652
653         __le16 action;
654         u8 macadd[ETH_ALEN];
655 } __attribute__ ((packed));
656
657 struct cmd_ds_802_11_rf_tx_power {
658         struct cmd_header hdr;
659
660         __le16 action;
661         __le16 curlevel;
662         s8 maxlevel;
663         s8 minlevel;
664 } __attribute__ ((packed));
665
666 struct cmd_ds_802_11_monitor_mode {
667         __le16 action;
668         __le16 mode;
669 } __attribute__ ((packed));
670
671 struct cmd_ds_set_boot2_ver {
672         struct cmd_header hdr;
673
674         __le16 action;
675         __le16 version;
676 } __attribute__ ((packed));
677
678 struct cmd_ds_802_11_fw_wake_method {
679         struct cmd_header hdr;
680
681         __le16 action;
682         __le16 method;
683 } __attribute__ ((packed));
684
685 struct cmd_ds_802_11_ps_mode {
686         __le16 action;
687         __le16 nullpktinterval;
688         __le16 multipledtim;
689         __le16 reserved;
690         __le16 locallisteninterval;
691 } __attribute__ ((packed));
692
693 struct cmd_confirm_sleep {
694         struct cmd_header hdr;
695
696         __le16 action;
697         __le16 nullpktinterval;
698         __le16 multipledtim;
699         __le16 reserved;
700         __le16 locallisteninterval;
701 } __attribute__ ((packed));
702
703 struct cmd_ds_802_11_data_rate {
704         struct cmd_header hdr;
705
706         __le16 action;
707         __le16 reserved;
708         u8 rates[MAX_RATES];
709 } __attribute__ ((packed));
710
711 struct cmd_ds_802_11_rate_adapt_rateset {
712         struct cmd_header hdr;
713         __le16 action;
714         __le16 enablehwauto;
715         __le16 bitmap;
716 } __attribute__ ((packed));
717
718 struct cmd_ds_802_11_ad_hoc_start {
719         struct cmd_header hdr;
720
721         u8 ssid[IW_ESSID_MAX_SIZE];
722         u8 bsstype;
723         __le16 beaconperiod;
724         u8 dtimperiod;   /* Reserved on v9 and later */
725         struct ieee_ie_ibss_param_set ibss;
726         u8 reserved1[4];
727         struct ieee_ie_ds_param_set ds;
728         u8 reserved2[4];
729         __le16 probedelay;  /* Reserved on v9 and later */
730         __le16 capability;
731         u8 rates[MAX_RATES];
732         u8 tlv_memory_size_pad[100];
733 } __attribute__ ((packed));
734
735 struct cmd_ds_802_11_ad_hoc_result {
736         struct cmd_header hdr;
737
738         u8 pad[3];
739         u8 bssid[ETH_ALEN];
740 } __attribute__ ((packed));
741
742 struct adhoc_bssdesc {
743         u8 bssid[ETH_ALEN];
744         u8 ssid[IW_ESSID_MAX_SIZE];
745         u8 type;
746         __le16 beaconperiod;
747         u8 dtimperiod;
748         __le64 timestamp;
749         __le64 localtime;
750         struct ieee_ie_ds_param_set ds;
751         u8 reserved1[4];
752         struct ieee_ie_ibss_param_set ibss;
753         u8 reserved2[4];
754         __le16 capability;
755         u8 rates[MAX_RATES];
756
757         /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
758          * Adhoc join command and will cause a binary layout mismatch with
759          * the firmware
760          */
761 } __attribute__ ((packed));
762
763 struct cmd_ds_802_11_ad_hoc_join {
764         struct cmd_header hdr;
765
766         struct adhoc_bssdesc bss;
767         __le16 failtimeout;   /* Reserved on v9 and later */
768         __le16 probedelay;    /* Reserved on v9 and later */
769 } __attribute__ ((packed));
770
771 struct cmd_ds_802_11_ad_hoc_stop {
772         struct cmd_header hdr;
773 } __attribute__ ((packed));
774
775 struct cmd_ds_802_11_enable_rsn {
776         struct cmd_header hdr;
777
778         __le16 action;
779         __le16 enable;
780 } __attribute__ ((packed));
781
782 struct MrvlIEtype_keyParamSet {
783         /* type ID */
784         __le16 type;
785
786         /* length of Payload */
787         __le16 length;
788
789         /* type of key: WEP=0, TKIP=1, AES=2 */
790         __le16 keytypeid;
791
792         /* key control Info specific to a keytypeid */
793         __le16 keyinfo;
794
795         /* length of key */
796         __le16 keylen;
797
798         /* key material of size keylen */
799         u8 key[32];
800 } __attribute__ ((packed));
801
802 #define MAX_WOL_RULES           16
803
804 struct host_wol_rule {
805         uint8_t rule_no;
806         uint8_t rule_ops;
807         __le16 sig_offset;
808         __le16 sig_length;
809         __le16 reserve;
810         __be32 sig_mask;
811         __be32 signature;
812 } __attribute__ ((packed));
813
814 struct wol_config {
815         uint8_t action;
816         uint8_t pattern;
817         uint8_t no_rules_in_cmd;
818         uint8_t result;
819         struct host_wol_rule rule[MAX_WOL_RULES];
820 } __attribute__ ((packed));
821
822 struct cmd_ds_host_sleep {
823         struct cmd_header hdr;
824         __le32 criteria;
825         uint8_t gpio;
826         uint16_t gap;
827         struct wol_config wol_conf;
828 } __attribute__ ((packed));
829
830
831
832 struct cmd_ds_802_11_key_material {
833         struct cmd_header hdr;
834
835         __le16 action;
836         struct MrvlIEtype_keyParamSet keyParamSet[2];
837 } __attribute__ ((packed));
838
839 struct cmd_ds_802_11_eeprom_access {
840         struct cmd_header hdr;
841         __le16 action;
842         __le16 offset;
843         __le16 len;
844         /* firmware says it returns a maximum of 20 bytes */
845 #define LBS_EEPROM_READ_LEN 20
846         u8 value[LBS_EEPROM_READ_LEN];
847 } __attribute__ ((packed));
848
849 struct cmd_ds_802_11_tpc_cfg {
850         struct cmd_header hdr;
851
852         __le16 action;
853         uint8_t enable;
854         int8_t P0;
855         int8_t P1;
856         int8_t P2;
857         uint8_t usesnr;
858 } __attribute__ ((packed));
859
860
861 struct cmd_ds_802_11_pa_cfg {
862         struct cmd_header hdr;
863
864         __le16 action;
865         uint8_t enable;
866         int8_t P0;
867         int8_t P1;
868         int8_t P2;
869 } __attribute__ ((packed));
870
871
872 struct cmd_ds_802_11_led_ctrl {
873         __le16 action;
874         __le16 numled;
875         u8 data[256];
876 } __attribute__ ((packed));
877
878 struct cmd_ds_802_11_afc {
879         __le16 afc_auto;
880         union {
881                 struct {
882                         __le16 threshold;
883                         __le16 period;
884                 };
885                 struct {
886                         __le16 timing_offset; /* signed */
887                         __le16 carrier_offset; /* signed */
888                 };
889         };
890 } __attribute__ ((packed));
891
892 struct cmd_tx_rate_query {
893         __le16 txrate;
894 } __attribute__ ((packed));
895
896 struct cmd_ds_get_tsf {
897         __le64 tsfvalue;
898 } __attribute__ ((packed));
899
900 struct cmd_ds_bt_access {
901         __le16 action;
902         __le32 id;
903         u8 addr1[ETH_ALEN];
904         u8 addr2[ETH_ALEN];
905 } __attribute__ ((packed));
906
907 struct cmd_ds_fwt_access {
908         __le16 action;
909         __le32 id;
910         u8 valid;
911         u8 da[ETH_ALEN];
912         u8 dir;
913         u8 ra[ETH_ALEN];
914         __le32 ssn;
915         __le32 dsn;
916         __le32 metric;
917         u8 rate;
918         u8 hopcount;
919         u8 ttl;
920         __le32 expiration;
921         u8 sleepmode;
922         __le32 snr;
923         __le32 references;
924         u8 prec[ETH_ALEN];
925 } __attribute__ ((packed));
926
927 struct cmd_ds_mesh_config {
928         struct cmd_header hdr;
929
930         __le16 action;
931         __le16 channel;
932         __le16 type;
933         __le16 length;
934         u8 data[128];   /* last position reserved */
935 } __attribute__ ((packed));
936
937 struct cmd_ds_mesh_access {
938         struct cmd_header hdr;
939
940         __le16 action;
941         __le32 data[32];        /* last position reserved */
942 } __attribute__ ((packed));
943
944 /* Number of stats counters returned by the firmware */
945 #define MESH_STATS_NUM 8
946
947 struct cmd_ds_command {
948         /* command header */
949         __le16 command;
950         __le16 size;
951         __le16 seqnum;
952         __le16 result;
953
954         /* command Body */
955         union {
956                 struct cmd_ds_802_11_ps_mode psmode;
957                 struct cmd_ds_802_11_monitor_mode monitor;
958                 struct cmd_ds_802_11_rssi rssi;
959                 struct cmd_ds_802_11_rssi_rsp rssirsp;
960                 struct cmd_ds_mac_reg_access macreg;
961                 struct cmd_ds_bbp_reg_access bbpreg;
962                 struct cmd_ds_rf_reg_access rfreg;
963
964                 struct cmd_ds_802_11d_domain_info domaininfo;
965                 struct cmd_ds_802_11d_domain_info domaininforesp;
966
967                 struct cmd_ds_802_11_tpc_cfg tpccfg;
968                 struct cmd_ds_802_11_afc afc;
969                 struct cmd_ds_802_11_led_ctrl ledgpio;
970
971                 struct cmd_ds_bt_access bt;
972                 struct cmd_ds_fwt_access fwt;
973                 struct cmd_ds_get_tsf gettsf;
974                 struct cmd_ds_802_11_beacon_control bcn_ctrl;
975         } params;
976 } __attribute__ ((packed));
977
978 #endif