Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
[pandora-kernel.git] / drivers / staging / ath6kl / include / common / wmi.h
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2004-2010 Atheros Corporation.  All rights reserved.
3 //
4 //
5 // Permission to use, copy, modify, and/or distribute this software for any
6 // purpose with or without fee is hereby granted, provided that the above
7 // copyright notice and this permission notice appear in all copies.
8 //
9 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 //
17 //
18 //
19 // Author(s): ="Atheros"
20 //------------------------------------------------------------------------------
21
22 /*
23  * This file contains the definitions of the WMI protocol specified in the
24  * Wireless Module Interface (WMI).  It includes definitions of all the
25  * commands and events. Commands are messages from the host to the WM.
26  * Events and Replies are messages from the WM to the host.
27  *
28  * Ownership of correctness in regards to commands
29  * belongs to the host driver and the WMI is not required to validate
30  * parameters for value, proper range, or any other checking.
31  *
32  */
33
34 #ifndef _WMI_H_
35 #define _WMI_H_
36
37 #include "wmix.h"
38 #include "wlan_defs.h"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 #define HTC_PROTOCOL_VERSION    0x0002
45 #define HTC_PROTOCOL_REVISION   0x0000
46
47 #define WMI_PROTOCOL_VERSION    0x0002
48 #define WMI_PROTOCOL_REVISION   0x0000
49
50 #define ATH_MAC_LEN             6               /* length of mac in bytes */
51 #define WMI_CMD_MAX_LEN         100
52 #define WMI_CONTROL_MSG_MAX_LEN     256
53 #define WMI_OPT_CONTROL_MSG_MAX_LEN 1536
54 #define IS_ETHERTYPE(_typeOrLen)        ((_typeOrLen) >= 0x0600)
55 #define RFC1042OUI      {0x00, 0x00, 0x00}
56
57 #define IP_ETHERTYPE 0x0800
58
59 #define WMI_IMPLICIT_PSTREAM 0xFF
60 #define WMI_MAX_THINSTREAM 15
61
62 #ifdef AR6002_REV2
63 #define IBSS_MAX_NUM_STA          4
64 #else
65 #define IBSS_MAX_NUM_STA          8
66 #endif
67
68 PREPACK struct host_app_area_s {
69     u32 wmi_protocol_ver;
70 } POSTPACK;
71
72 /*
73  * Data Path
74  */
75 typedef PREPACK struct {
76     u8 dstMac[ATH_MAC_LEN];
77     u8 srcMac[ATH_MAC_LEN];
78     u16 typeOrLen;
79 } POSTPACK ATH_MAC_HDR;
80
81 typedef PREPACK struct {
82     u8 dsap;
83     u8 ssap;
84     u8 cntl;
85     u8 orgCode[3];
86     u16 etherType;
87 } POSTPACK ATH_LLC_SNAP_HDR;
88
89 typedef enum {
90     DATA_MSGTYPE = 0x0,
91     CNTL_MSGTYPE,
92     SYNC_MSGTYPE,
93     OPT_MSGTYPE,
94 } WMI_MSG_TYPE;
95
96
97 /*
98  * Macros for operating on WMI_DATA_HDR (info) field
99  */
100
101 #define WMI_DATA_HDR_MSG_TYPE_MASK  0x03
102 #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
103 #define WMI_DATA_HDR_UP_MASK        0x07
104 #define WMI_DATA_HDR_UP_SHIFT       2
105 /* In AP mode, the same bit (b5) is used to indicate Power save state in
106  * the Rx dir and More data bit state in the tx direction.
107  */
108 #define WMI_DATA_HDR_PS_MASK        0x1
109 #define WMI_DATA_HDR_PS_SHIFT       5
110
111 #define WMI_DATA_HDR_MORE_MASK      0x1
112 #define WMI_DATA_HDR_MORE_SHIFT     5
113
114 typedef enum {
115     WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
116     WMI_DATA_HDR_DATA_TYPE_802_11,
117     WMI_DATA_HDR_DATA_TYPE_ACL, /* used to be used for the PAL */
118 } WMI_DATA_HDR_DATA_TYPE;
119
120 #define WMI_DATA_HDR_DATA_TYPE_MASK     0x3
121 #define WMI_DATA_HDR_DATA_TYPE_SHIFT    6
122
123 #define WMI_DATA_HDR_SET_MORE_BIT(h) ((h)->info |= (WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT))
124
125 #define WMI_DATA_HDR_IS_MSG_TYPE(h, t)  (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t))
126 #define WMI_DATA_HDR_SET_MSG_TYPE(h, t) (h)->info = (((h)->info & ~(WMI_DATA_HDR_MSG_TYPE_MASK << WMI_DATA_HDR_MSG_TYPE_SHIFT)) | (t << WMI_DATA_HDR_MSG_TYPE_SHIFT))
127 #define WMI_DATA_HDR_GET_UP(h)    (((h)->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK)
128 #define WMI_DATA_HDR_SET_UP(h, p) (h)->info = (((h)->info & ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT)) | (p << WMI_DATA_HDR_UP_SHIFT))
129
130 #define WMI_DATA_HDR_GET_DATA_TYPE(h)   (((h)->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) & WMI_DATA_HDR_DATA_TYPE_MASK)
131 #define WMI_DATA_HDR_SET_DATA_TYPE(h, p) (h)->info = (((h)->info & ~(WMI_DATA_HDR_DATA_TYPE_MASK << WMI_DATA_HDR_DATA_TYPE_SHIFT)) | ((p) << WMI_DATA_HDR_DATA_TYPE_SHIFT))
132
133 #define WMI_DATA_HDR_GET_DOT11(h)   (WMI_DATA_HDR_GET_DATA_TYPE((h)) == WMI_DATA_HDR_DATA_TYPE_802_11)
134 #define WMI_DATA_HDR_SET_DOT11(h, p) WMI_DATA_HDR_SET_DATA_TYPE((h), (p))
135
136 /* Macros for operating on WMI_DATA_HDR (info2) field */
137 #define WMI_DATA_HDR_SEQNO_MASK     0xFFF
138 #define WMI_DATA_HDR_SEQNO_SHIFT    0
139
140 #define WMI_DATA_HDR_AMSDU_MASK     0x1
141 #define WMI_DATA_HDR_AMSDU_SHIFT    12
142
143 #define WMI_DATA_HDR_META_MASK      0x7
144 #define WMI_DATA_HDR_META_SHIFT     13
145
146 #define GET_SEQ_NO(_v)                  ((_v) & WMI_DATA_HDR_SEQNO_MASK)
147 #define GET_ISMSDU(_v)                  ((_v) & WMI_DATA_HDR_AMSDU_MASK)
148
149 #define WMI_DATA_HDR_GET_SEQNO(h)        GET_SEQ_NO((h)->info2 >> WMI_DATA_HDR_SEQNO_SHIFT)
150 #define WMI_DATA_HDR_SET_SEQNO(h, _v)   ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_SEQNO_MASK << WMI_DATA_HDR_SEQNO_SHIFT)) | (GET_SEQ_NO(_v) << WMI_DATA_HDR_SEQNO_SHIFT))
151
152 #define WMI_DATA_HDR_IS_AMSDU(h)        GET_ISMSDU((h)->info2 >> WMI_DATA_HDR_AMSDU_SHIFT)
153 #define WMI_DATA_HDR_SET_AMSDU(h, _v)   ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_AMSDU_MASK << WMI_DATA_HDR_AMSDU_SHIFT)) | (GET_ISMSDU(_v) << WMI_DATA_HDR_AMSDU_SHIFT))
154
155 #define WMI_DATA_HDR_GET_META(h)        (((h)->info2 >> WMI_DATA_HDR_META_SHIFT) & WMI_DATA_HDR_META_MASK)
156 #define WMI_DATA_HDR_SET_META(h, _v)    ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_META_MASK << WMI_DATA_HDR_META_SHIFT)) | ((_v) << WMI_DATA_HDR_META_SHIFT))
157
158 /* Macros for operating on WMI_DATA_HDR (info3) field */
159 #define WMI_DATA_HDR_DEVID_MASK      0xF
160 #define WMI_DATA_HDR_DEVID_SHIFT     0
161 #define GET_DEVID(_v)                ((_v) & WMI_DATA_HDR_DEVID_MASK)
162
163 #define WMI_DATA_HDR_GET_DEVID(h) \
164         (((h)->info3 >> WMI_DATA_HDR_DEVID_SHIFT) & WMI_DATA_HDR_DEVID_MASK)
165 #define WMI_DATA_HDR_SET_DEVID(h, _v) \
166         ((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_DEVID_MASK << WMI_DATA_HDR_DEVID_SHIFT)) | (GET_DEVID(_v) << WMI_DATA_HDR_DEVID_SHIFT))
167
168 typedef PREPACK struct {
169     s8 rssi;
170     u8 info;               /* usage of 'info' field(8-bit):
171                                      *  b1:b0       - WMI_MSG_TYPE
172                                      *  b4:b3:b2    - UP(tid)
173                                      *  b5          - Used in AP mode. More-data in tx dir, PS in rx.
174                                      *  b7:b6       -  Dot3 header(0),
175                                      *                 Dot11 Header(1),
176                                      *                 ACL data(2)
177                                      */
178
179     u16 info2;              /* usage of 'info2' field(16-bit):
180                                      * b11:b0       - seq_no
181                                      * b12          - A-MSDU?
182                                      * b15:b13      - META_DATA_VERSION 0 - 7
183                                      */
184     u16 info3;
185 } POSTPACK WMI_DATA_HDR;
186
187 /*
188  *  TX META VERSION DEFINITIONS
189  */
190 #define WMI_MAX_TX_META_SZ  (12)
191 #define WMI_MAX_TX_META_VERSION (7)
192 #define WMI_META_VERSION_1 (0x01)
193 #define WMI_META_VERSION_2 (0X02)
194
195 #define WMI_ACL_TO_DOT11_HEADROOM   36
196
197 #if 0 /* removed to prevent compile errors for WM.. */
198 typedef PREPACK struct {
199 /* intentionally empty. Default version is no meta data. */
200 } POSTPACK WMI_TX_META_V0;
201 #endif
202
203 typedef PREPACK struct {
204     u8 pktID;           /* The packet ID to identify the tx request */
205     u8 ratePolicyID;    /* The rate policy to be used for the tx of this frame */
206 } POSTPACK WMI_TX_META_V1;
207
208
209 #define WMI_CSUM_DIR_TX (0x1)
210 #define TX_CSUM_CALC_FILL (0x1)
211 typedef PREPACK struct {
212     u8 csumStart;       /*Offset from start of the WMI header for csum calculation to begin */
213     u8 csumDest;        /*Offset from start of WMI header where final csum goes*/
214     u8 csumFlags;    /*number of bytes over which csum is calculated*/
215 } POSTPACK WMI_TX_META_V2;
216
217
218 /*
219  *  RX META VERSION DEFINITIONS
220  */
221 /* if RX meta data is present at all then the meta data field
222  *  will consume WMI_MAX_RX_META_SZ bytes of space between the
223  *  WMI_DATA_HDR and the payload. How much of the available
224  *  Meta data is actually used depends on which meta data
225  *  version is active. */
226 #define WMI_MAX_RX_META_SZ  (12)
227 #define WMI_MAX_RX_META_VERSION (7)
228
229 #define WMI_RX_STATUS_OK            0 /* success */
230 #define WMI_RX_STATUS_DECRYPT_ERR   1 /* decrypt error */
231 #define WMI_RX_STATUS_MIC_ERR       2 /* tkip MIC error */
232 #define WMI_RX_STATUS_ERR           3 /* undefined error */
233
234 #define WMI_RX_FLAGS_AGGR           0x0001 /* part of AGGR */
235 #define WMI_RX_FlAGS_STBC           0x0002 /* used STBC */
236 #define WMI_RX_FLAGS_SGI            0x0004 /* used SGI */
237 #define WMI_RX_FLAGS_HT             0x0008 /* is HT packet */
238 /* the flags field is also used to store the CRYPTO_TYPE of the frame
239  * that value is shifted by WMI_RX_FLAGS_CRYPTO_SHIFT */
240 #define WMI_RX_FLAGS_CRYPTO_SHIFT   4
241 #define WMI_RX_FLAGS_CRYPTO_MASK    0x1f
242 #define WMI_RX_META_GET_CRYPTO(flags) (((flags) >> WMI_RX_FLAGS_CRYPTO_SHIFT) & WMI_RX_FLAGS_CRYPTO_MASK)
243
244 #if 0 /* removed to prevent compile errors for WM.. */
245 typedef PREPACK struct {
246 /* intentionally empty. Default version is no meta data. */
247 } POSTPACK WMI_RX_META_VERSION_0;
248 #endif
249
250 typedef PREPACK struct {
251     u8 status; /* one of WMI_RX_STATUS_... */
252     u8 rix;    /* rate index mapped to rate at which this packet was received. */
253     u8 rssi;   /* rssi of packet */
254     u8 channel;/* rf channel during packet reception */
255     u16 flags;  /* a combination of WMI_RX_FLAGS_... */
256 } POSTPACK WMI_RX_META_V1;
257
258 #define RX_CSUM_VALID_FLAG (0x1)
259 typedef PREPACK struct {
260     u16 csum;
261     u8 csumFlags;/* bit 0 set -partial csum valid
262                              bit 1 set -test mode */
263 } POSTPACK WMI_RX_META_V2;
264
265
266
267 #define WMI_GET_DEVICE_ID(info1) ((info1) & 0xF)
268 /* Macros for operating on WMI_CMD_HDR (info1) field */
269 #define WMI_CMD_HDR_DEVID_MASK      0xF
270 #define WMI_CMD_HDR_DEVID_SHIFT     0
271 #define GET_CMD_DEVID(_v)           ((_v) & WMI_CMD_HDR_DEVID_MASK)
272
273 #define WMI_CMD_HDR_GET_DEVID(h) \
274         (((h)->info1 >> WMI_CMD_HDR_DEVID_SHIFT) & WMI_CMD_HDR_DEVID_MASK)
275 #define WMI_CMD_HDR_SET_DEVID(h, _v) \
276         ((h)->info1 = ((h)->info1 & \
277                 ~(WMI_CMD_HDR_DEVID_MASK << WMI_CMD_HDR_DEVID_SHIFT)) | \
278                  (GET_CMD_DEVID(_v) << WMI_CMD_HDR_DEVID_SHIFT))
279
280 /*
281  * Control Path
282  */
283 typedef PREPACK struct {
284     u16 commandId;
285 /*
286  * info1 - 16 bits
287  * b03:b00 - id
288  * b15:b04 - unused
289  */
290     u16 info1;
291
292     u16 reserved;      /* For alignment */
293 } POSTPACK WMI_CMD_HDR;        /* used for commands and events */
294
295 /*
296  * List of Commnands
297  */
298 typedef enum {
299     WMI_CONNECT_CMDID           = 0x0001,
300     WMI_RECONNECT_CMDID,
301     WMI_DISCONNECT_CMDID,
302     WMI_SYNCHRONIZE_CMDID,
303     WMI_CREATE_PSTREAM_CMDID,
304     WMI_DELETE_PSTREAM_CMDID,
305     WMI_START_SCAN_CMDID,
306     WMI_SET_SCAN_PARAMS_CMDID,
307     WMI_SET_BSS_FILTER_CMDID,
308     WMI_SET_PROBED_SSID_CMDID,               /* 10 */
309     WMI_SET_LISTEN_INT_CMDID,
310     WMI_SET_BMISS_TIME_CMDID,
311     WMI_SET_DISC_TIMEOUT_CMDID,
312     WMI_GET_CHANNEL_LIST_CMDID,
313     WMI_SET_BEACON_INT_CMDID,
314     WMI_GET_STATISTICS_CMDID,
315     WMI_SET_CHANNEL_PARAMS_CMDID,
316     WMI_SET_POWER_MODE_CMDID,
317     WMI_SET_IBSS_PM_CAPS_CMDID,
318     WMI_SET_POWER_PARAMS_CMDID,              /* 20 */
319     WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
320     WMI_ADD_CIPHER_KEY_CMDID,
321     WMI_DELETE_CIPHER_KEY_CMDID,
322     WMI_ADD_KRK_CMDID,
323     WMI_DELETE_KRK_CMDID,
324     WMI_SET_PMKID_CMDID,
325     WMI_SET_TX_PWR_CMDID,
326     WMI_GET_TX_PWR_CMDID,
327     WMI_SET_ASSOC_INFO_CMDID,
328     WMI_ADD_BAD_AP_CMDID,                    /* 30 */
329     WMI_DELETE_BAD_AP_CMDID,
330     WMI_SET_TKIP_COUNTERMEASURES_CMDID,
331     WMI_RSSI_THRESHOLD_PARAMS_CMDID,
332     WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
333     WMI_SET_ACCESS_PARAMS_CMDID,
334     WMI_SET_RETRY_LIMITS_CMDID,
335     WMI_SET_OPT_MODE_CMDID,
336     WMI_OPT_TX_FRAME_CMDID,
337     WMI_SET_VOICE_PKT_SIZE_CMDID,
338     WMI_SET_MAX_SP_LEN_CMDID,                /* 40 */
339     WMI_SET_ROAM_CTRL_CMDID,
340     WMI_GET_ROAM_TBL_CMDID,
341     WMI_GET_ROAM_DATA_CMDID,
342     WMI_ENABLE_RM_CMDID,
343     WMI_SET_MAX_OFFHOME_DURATION_CMDID,
344     WMI_EXTENSION_CMDID,                        /* Non-wireless extensions */
345     WMI_SNR_THRESHOLD_PARAMS_CMDID,
346     WMI_LQ_THRESHOLD_PARAMS_CMDID,
347     WMI_SET_LPREAMBLE_CMDID,
348     WMI_SET_RTS_CMDID,                       /* 50 */
349     WMI_CLR_RSSI_SNR_CMDID,
350     WMI_SET_FIXRATES_CMDID,
351     WMI_GET_FIXRATES_CMDID,
352     WMI_SET_AUTH_MODE_CMDID,
353     WMI_SET_REASSOC_MODE_CMDID,
354     WMI_SET_WMM_CMDID,
355     WMI_SET_WMM_TXOP_CMDID,
356     WMI_TEST_CMDID,
357     /* COEX AR6002 only*/
358     WMI_SET_BT_STATUS_CMDID,                
359     WMI_SET_BT_PARAMS_CMDID,                /* 60 */
360
361     WMI_SET_KEEPALIVE_CMDID,
362     WMI_GET_KEEPALIVE_CMDID,
363     WMI_SET_APPIE_CMDID,
364     WMI_GET_APPIE_CMDID,
365     WMI_SET_WSC_STATUS_CMDID,
366
367     /* Wake on Wireless */
368     WMI_SET_HOST_SLEEP_MODE_CMDID,
369     WMI_SET_WOW_MODE_CMDID,
370     WMI_GET_WOW_LIST_CMDID,
371     WMI_ADD_WOW_PATTERN_CMDID,
372     WMI_DEL_WOW_PATTERN_CMDID,               /* 70 */
373
374     WMI_SET_FRAMERATES_CMDID,
375     WMI_SET_AP_PS_CMDID,
376     WMI_SET_QOS_SUPP_CMDID,
377     /* WMI_THIN_RESERVED_... mark the start and end
378      * values for WMI_THIN_RESERVED command IDs. These
379      * command IDs can be found in wmi_thin.h */
380     WMI_THIN_RESERVED_START = 0x8000,
381     WMI_THIN_RESERVED_END = 0x8fff,
382     /*
383      * Developer commands starts at 0xF000
384      */
385     WMI_SET_BITRATE_CMDID = 0xF000,
386     WMI_GET_BITRATE_CMDID,
387     WMI_SET_WHALPARAM_CMDID,
388
389
390     /*Should add the new command to the tail for compatible with
391      * etna.
392      */
393     WMI_SET_MAC_ADDRESS_CMDID,
394     WMI_SET_AKMP_PARAMS_CMDID,
395     WMI_SET_PMKID_LIST_CMDID,
396     WMI_GET_PMKID_LIST_CMDID,
397     WMI_ABORT_SCAN_CMDID,
398     WMI_SET_TARGET_EVENT_REPORT_CMDID,
399
400     // Unused
401     WMI_UNUSED1,
402     WMI_UNUSED2,
403
404     /*
405      * AP mode commands
406      */
407     WMI_AP_HIDDEN_SSID_CMDID,
408     WMI_AP_SET_NUM_STA_CMDID,
409     WMI_AP_ACL_POLICY_CMDID,
410     WMI_AP_ACL_MAC_LIST_CMDID,
411     WMI_AP_CONFIG_COMMIT_CMDID,
412     WMI_AP_SET_MLME_CMDID,
413     WMI_AP_SET_PVB_CMDID,
414     WMI_AP_CONN_INACT_CMDID,
415     WMI_AP_PROT_SCAN_TIME_CMDID,
416     WMI_AP_SET_COUNTRY_CMDID,
417     WMI_AP_SET_DTIM_CMDID,
418     WMI_AP_MODE_STAT_CMDID,
419
420     WMI_SET_IP_CMDID,
421     WMI_SET_PARAMS_CMDID,
422     WMI_SET_MCAST_FILTER_CMDID,
423     WMI_DEL_MCAST_FILTER_CMDID,
424
425     WMI_ALLOW_AGGR_CMDID,
426     WMI_ADDBA_REQ_CMDID,
427     WMI_DELBA_REQ_CMDID,
428     WMI_SET_HT_CAP_CMDID,
429     WMI_SET_HT_OP_CMDID,
430     WMI_SET_TX_SELECT_RATES_CMDID,
431     WMI_SET_TX_SGI_PARAM_CMDID,
432     WMI_SET_RATE_POLICY_CMDID,
433
434     WMI_HCI_CMD_CMDID,
435     WMI_RX_FRAME_FORMAT_CMDID,
436     WMI_SET_THIN_MODE_CMDID,
437     WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID,
438
439     WMI_AP_SET_11BG_RATESET_CMDID,
440     WMI_SET_PMK_CMDID,
441     WMI_MCAST_FILTER_CMDID,
442     /* COEX CMDID AR6003*/
443     WMI_SET_BTCOEX_FE_ANT_CMDID,
444     WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
445     WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
446     WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
447     WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
448     WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
449     WMI_SET_BTCOEX_DEBUG_CMDID,
450     WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
451     WMI_GET_BTCOEX_STATS_CMDID,
452     WMI_GET_BTCOEX_CONFIG_CMDID,
453
454         WMI_SET_DFS_ENABLE_CMDID,   /* F034 */
455         WMI_SET_DFS_MINRSSITHRESH_CMDID,
456         WMI_SET_DFS_MAXPULSEDUR_CMDID,
457         WMI_DFS_RADAR_DETECTED_CMDID,
458
459         /* P2P CMDS */
460         WMI_P2P_SET_CONFIG_CMDID,    /* F038 */
461         WMI_WPS_SET_CONFIG_CMDID,
462         WMI_SET_REQ_DEV_ATTR_CMDID,
463         WMI_P2P_FIND_CMDID,
464         WMI_P2P_STOP_FIND_CMDID,
465         WMI_P2P_GO_NEG_START_CMDID,
466         WMI_P2P_LISTEN_CMDID,
467
468         WMI_CONFIG_TX_MAC_RULES_CMDID,    /* F040 */
469         WMI_SET_PROMISCUOUS_MODE_CMDID,
470         WMI_RX_FRAME_FILTER_CMDID,
471         WMI_SET_CHANNEL_CMDID,
472
473         /* WAC commands */
474         WMI_ENABLE_WAC_CMDID,
475         WMI_WAC_SCAN_REPLY_CMDID,
476         WMI_WAC_CTRL_REQ_CMDID,
477         WMI_SET_DIV_PARAMS_CMDID,
478
479         WMI_GET_PMK_CMDID,
480         WMI_SET_PASSPHRASE_CMDID,
481         WMI_SEND_ASSOC_RES_CMDID,
482         WMI_SET_ASSOC_REQ_RELAY_CMDID,
483         WMI_GET_RFKILL_MODE_CMDID,
484
485         /* ACS command, consists of sub-commands */
486         WMI_ACS_CTRL_CMDID,
487
488         /* Ultra low power store / recall commands */
489         WMI_STORERECALL_CONFIGURE_CMDID,
490         WMI_STORERECALL_RECALL_CMDID,
491         WMI_STORERECALL_HOST_READY_CMDID,
492         WMI_FORCE_TARGET_ASSERT_CMDID,
493         WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
494 } WMI_COMMAND_ID;
495
496 /*
497  * Frame Types
498  */
499 typedef enum {
500     WMI_FRAME_BEACON        =   0,
501     WMI_FRAME_PROBE_REQ,
502     WMI_FRAME_PROBE_RESP,
503     WMI_FRAME_ASSOC_REQ,
504     WMI_FRAME_ASSOC_RESP,
505     WMI_NUM_MGMT_FRAME
506 } WMI_MGMT_FRAME_TYPE;
507
508 /*
509  * Connect Command
510  */
511 typedef enum {
512     INFRA_NETWORK       = 0x01,
513     ADHOC_NETWORK       = 0x02,
514     ADHOC_CREATOR       = 0x04,
515     AP_NETWORK          = 0x10,
516 } NETWORK_TYPE;
517
518 typedef enum {
519     OPEN_AUTH           = 0x01,
520     SHARED_AUTH         = 0x02,
521     LEAP_AUTH           = 0x04,  /* different from IEEE_AUTH_MODE definitions */
522 } DOT11_AUTH_MODE;
523
524 enum {
525         AUTH_IDLE,
526         AUTH_OPEN_IN_PROGRESS,
527 };
528
529 typedef enum {
530     NONE_AUTH           = 0x01,
531     WPA_AUTH            = 0x02,
532     WPA2_AUTH           = 0x04,
533     WPA_PSK_AUTH        = 0x08,
534     WPA2_PSK_AUTH       = 0x10,
535     WPA_AUTH_CCKM       = 0x20,
536     WPA2_AUTH_CCKM      = 0x40,
537 } AUTH_MODE;
538
539 typedef enum {
540     NONE_CRYPT          = 0x01,
541     WEP_CRYPT           = 0x02,
542     TKIP_CRYPT          = 0x04,
543     AES_CRYPT           = 0x08,
544 #ifdef WAPI_ENABLE
545     WAPI_CRYPT          = 0x10,
546 #endif /*WAPI_ENABLE*/
547 } CRYPTO_TYPE;
548
549 #define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
550 #define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
551
552 #ifdef WAPI_ENABLE
553 #undef WMI_MAX_CRYPTO_TYPE
554 #define WMI_MAX_CRYPTO_TYPE (WAPI_CRYPT + 1)
555 #endif /* WAPI_ENABLE */
556
557 #ifdef WAPI_ENABLE
558 #define IW_ENCODE_ALG_SM4       0x20
559 #define IW_AUTH_WAPI_ENABLED    0x20
560 #endif
561
562 #define WMI_MIN_KEY_INDEX   0
563 #define WMI_MAX_KEY_INDEX   3
564
565 #ifdef WAPI_ENABLE
566 #undef WMI_MAX_KEY_INDEX
567 #define WMI_MAX_KEY_INDEX   7 /* wapi grpKey 0-3, prwKey 4-7 */
568 #endif /* WAPI_ENABLE */
569
570 #define WMI_MAX_KEY_LEN     32
571
572 #define WMI_MAX_SSID_LEN    32
573
574 typedef enum {
575     CONNECT_ASSOC_POLICY_USER           = 0x0001,
576     CONNECT_SEND_REASSOC                = 0x0002,
577     CONNECT_IGNORE_WPAx_GROUP_CIPHER    = 0x0004,
578     CONNECT_PROFILE_MATCH_DONE          = 0x0008,
579     CONNECT_IGNORE_AAC_BEACON           = 0x0010,
580     CONNECT_CSA_FOLLOW_BSS              = 0x0020,
581     CONNECT_DO_WPA_OFFLOAD              = 0x0040,
582     CONNECT_DO_NOT_DEAUTH               = 0x0080,
583 } WMI_CONNECT_CTRL_FLAGS_BITS;
584
585 #define DEFAULT_CONNECT_CTRL_FLAGS    (CONNECT_CSA_FOLLOW_BSS)
586
587 typedef PREPACK struct {
588     u8 networkType;
589     u8 dot11AuthMode;
590     u8 authMode;
591     u8 pairwiseCryptoType;
592     u8 pairwiseCryptoLen;
593     u8 groupCryptoType;
594     u8 groupCryptoLen;
595     u8 ssidLength;
596     u8     ssid[WMI_MAX_SSID_LEN];
597     u16 channel;
598     u8 bssid[ATH_MAC_LEN];
599     u32 ctrl_flags;
600 } POSTPACK WMI_CONNECT_CMD;
601
602 /*
603  * WMI_RECONNECT_CMDID
604  */
605 typedef PREPACK struct {
606     u16 channel;                    /* hint */
607     u8 bssid[ATH_MAC_LEN];         /* mandatory if set */
608 } POSTPACK WMI_RECONNECT_CMD;
609
610 #define WMI_PMK_LEN     32
611 typedef PREPACK struct {
612     u8 pmk[WMI_PMK_LEN];
613 } POSTPACK WMI_SET_PMK_CMD;
614
615 /*
616  * WMI_SET_EXCESS_TX_RETRY_THRES_CMDID
617  */
618 typedef PREPACK struct {
619     u32 threshold;
620 } POSTPACK WMI_SET_EXCESS_TX_RETRY_THRES_CMD;
621
622 /*
623  * WMI_ADD_CIPHER_KEY_CMDID
624  */
625 typedef enum {
626     PAIRWISE_USAGE      = 0x00,
627     GROUP_USAGE         = 0x01,
628     TX_USAGE            = 0x02,     /* default Tx Key - Static WEP only */
629 } KEY_USAGE;
630
631 /*
632  * Bit Flag
633  * Bit 0 - Initialise TSC - default is Initialize
634  */
635 #define KEY_OP_INIT_TSC       0x01
636 #define KEY_OP_INIT_RSC       0x02
637 #ifdef WAPI_ENABLE
638 #define KEY_OP_INIT_WAPIPN    0x10
639 #endif /* WAPI_ENABLE */
640
641 #define KEY_OP_INIT_VAL     0x03     /* Default Initialise the TSC & RSC */
642 #define KEY_OP_VALID_MASK   0x03
643
644 typedef PREPACK struct {
645     u8 keyIndex;
646     u8 keyType;
647     u8 keyUsage;           /* KEY_USAGE */
648     u8 keyLength;
649     u8 keyRSC[8];          /* key replay sequence counter */
650     u8 key[WMI_MAX_KEY_LEN];
651     u8 key_op_ctrl;       /* Additional Key Control information */
652     u8 key_macaddr[ATH_MAC_LEN];
653 } POSTPACK WMI_ADD_CIPHER_KEY_CMD;
654
655 /*
656  * WMI_DELETE_CIPHER_KEY_CMDID
657  */
658 typedef PREPACK struct {
659     u8 keyIndex;
660 } POSTPACK WMI_DELETE_CIPHER_KEY_CMD;
661
662 #define WMI_KRK_LEN     16
663 /*
664  * WMI_ADD_KRK_CMDID
665  */
666 typedef PREPACK struct {
667     u8 krk[WMI_KRK_LEN];
668 } POSTPACK WMI_ADD_KRK_CMD;
669
670 /*
671  * WMI_SET_TKIP_COUNTERMEASURES_CMDID
672  */
673 typedef enum {
674     WMI_TKIP_CM_DISABLE = 0x0,
675     WMI_TKIP_CM_ENABLE  = 0x1,
676 } WMI_TKIP_CM_CONTROL;
677
678 typedef PREPACK struct {
679     u8 cm_en;                     /* WMI_TKIP_CM_CONTROL */
680 } POSTPACK WMI_SET_TKIP_COUNTERMEASURES_CMD;
681
682 /*
683  * WMI_SET_PMKID_CMDID
684  */
685
686 #define WMI_PMKID_LEN 16
687
688 typedef enum {
689    PMKID_DISABLE = 0,
690    PMKID_ENABLE  = 1,
691 } PMKID_ENABLE_FLG;
692
693 typedef PREPACK struct {
694     u8 bssid[ATH_MAC_LEN];
695     u8 enable;                 /* PMKID_ENABLE_FLG */
696     u8 pmkid[WMI_PMKID_LEN];
697 } POSTPACK WMI_SET_PMKID_CMD;
698
699 /*
700  * WMI_START_SCAN_CMD
701  */
702 typedef enum {
703     WMI_LONG_SCAN  = 0,
704     WMI_SHORT_SCAN = 1,
705 } WMI_SCAN_TYPE;
706
707 typedef PREPACK struct {
708     u32   forceFgScan;
709     u32   isLegacy;        /* For Legacy Cisco AP compatibility */
710     u32 homeDwellTime;   /* Maximum duration in the home channel(milliseconds) */
711     u32 forceScanInterval;    /* Time interval between scans (milliseconds)*/
712     u8 scanType;           /* WMI_SCAN_TYPE */
713     u8 numChannels;            /* how many channels follow */
714     u16 channelList[1];         /* channels in Mhz */
715 } POSTPACK WMI_START_SCAN_CMD;
716
717 /*
718  * WMI_SET_SCAN_PARAMS_CMDID
719  */
720 #define WMI_SHORTSCANRATIO_DEFAULT      3
721 /* 
722  *  Warning: ScanCtrlFlag value of 0xFF is used to disable all flags in WMI_SCAN_PARAMS_CMD 
723  *  Do not add any more flags to WMI_SCAN_CTRL_FLAG_BITS
724  */
725 typedef enum {
726     CONNECT_SCAN_CTRL_FLAGS = 0x01,    /* set if can scan in the Connect cmd */
727     SCAN_CONNECTED_CTRL_FLAGS = 0x02,  /* set if scan for the SSID it is */
728                                        /* already connected to */
729     ACTIVE_SCAN_CTRL_FLAGS = 0x04,     /* set if enable active scan */
730     ROAM_SCAN_CTRL_FLAGS = 0x08,       /* set if enable roam scan when bmiss and lowrssi */
731     REPORT_BSSINFO_CTRL_FLAGS = 0x10,   /* set if follows customer BSSINFO reporting rule */
732     ENABLE_AUTO_CTRL_FLAGS = 0x20,      /* if disabled, target doesn't
733                                           scan after a disconnect event  */
734     ENABLE_SCAN_ABORT_EVENT = 0x40      /* Scan complete event with canceled status will be generated when a scan is prempted before it gets completed */
735 } WMI_SCAN_CTRL_FLAGS_BITS;
736
737 #define CAN_SCAN_IN_CONNECT(flags)      (flags & CONNECT_SCAN_CTRL_FLAGS)
738 #define CAN_SCAN_CONNECTED(flags)       (flags & SCAN_CONNECTED_CTRL_FLAGS)
739 #define ENABLE_ACTIVE_SCAN(flags)       (flags & ACTIVE_SCAN_CTRL_FLAGS)
740 #define ENABLE_ROAM_SCAN(flags)         (flags & ROAM_SCAN_CTRL_FLAGS)
741 #define CONFIG_REPORT_BSSINFO(flags)     (flags & REPORT_BSSINFO_CTRL_FLAGS)
742 #define IS_AUTO_SCAN_ENABLED(flags)      (flags & ENABLE_AUTO_CTRL_FLAGS)
743 #define SCAN_ABORT_EVENT_ENABLED(flags) (flags & ENABLE_SCAN_ABORT_EVENT)
744
745 #define DEFAULT_SCAN_CTRL_FLAGS         (CONNECT_SCAN_CTRL_FLAGS| SCAN_CONNECTED_CTRL_FLAGS| ACTIVE_SCAN_CTRL_FLAGS| ROAM_SCAN_CTRL_FLAGS | ENABLE_AUTO_CTRL_FLAGS)
746
747
748 typedef PREPACK struct {
749     u16 fg_start_period;        /* seconds */
750     u16 fg_end_period;          /* seconds */
751     u16 bg_period;              /* seconds */
752     u16 maxact_chdwell_time;    /* msec */
753     u16 pas_chdwell_time;       /* msec */
754     u8 shortScanRatio;         /* how many shorts scan for one long */
755     u8 scanCtrlFlags;
756     u16 minact_chdwell_time;    /* msec */
757     u16 maxact_scan_per_ssid;   /* max active scans per ssid */
758     u32 max_dfsch_act_time;  /* msecs */
759 } POSTPACK WMI_SCAN_PARAMS_CMD;
760
761 /*
762  * WMI_SET_BSS_FILTER_CMDID
763  */
764 typedef enum {
765     NONE_BSS_FILTER = 0x0,              /* no beacons forwarded */
766     ALL_BSS_FILTER,                     /* all beacons forwarded */
767     PROFILE_FILTER,                     /* only beacons matching profile */
768     ALL_BUT_PROFILE_FILTER,             /* all but beacons matching profile */
769     CURRENT_BSS_FILTER,                 /* only beacons matching current BSS */
770     ALL_BUT_BSS_FILTER,                 /* all but beacons matching BSS */
771     PROBED_SSID_FILTER,                 /* beacons matching probed ssid */
772     LAST_BSS_FILTER,                    /* marker only */
773 } WMI_BSS_FILTER;
774
775 typedef PREPACK struct {
776     u8 bssFilter;                      /* see WMI_BSS_FILTER */
777     u8 reserved1;                      /* For alignment */
778     u16 reserved2;                      /* For alignment */
779     u32 ieMask;
780 } POSTPACK WMI_BSS_FILTER_CMD;
781
782 /*
783  * WMI_SET_PROBED_SSID_CMDID
784  */
785 #define MAX_PROBED_SSID_INDEX   9
786
787 typedef enum {
788     DISABLE_SSID_FLAG  = 0,                  /* disables entry */
789     SPECIFIC_SSID_FLAG = 0x01,               /* probes specified ssid */
790     ANY_SSID_FLAG      = 0x02,               /* probes for any ssid */
791 } WMI_SSID_FLAG;
792
793 typedef PREPACK struct {
794     u8 entryIndex;                     /* 0 to MAX_PROBED_SSID_INDEX */
795     u8 flag;                           /* WMI_SSID_FLG */
796     u8 ssidLength;
797     u8 ssid[32];
798 } POSTPACK WMI_PROBED_SSID_CMD;
799
800 /*
801  * WMI_SET_LISTEN_INT_CMDID
802  * The Listen interval is between 15 and 3000 TUs
803  */
804 #define MIN_LISTEN_INTERVAL 15
805 #define MAX_LISTEN_INTERVAL 5000
806 #define MIN_LISTEN_BEACONS 1
807 #define MAX_LISTEN_BEACONS 50
808
809 typedef PREPACK struct {
810     u16 listenInterval;
811     u16 numBeacons;
812 } POSTPACK WMI_LISTEN_INT_CMD;
813
814 /*
815  * WMI_SET_BEACON_INT_CMDID
816  */
817 typedef PREPACK struct {
818     u16 beaconInterval;
819 } POSTPACK WMI_BEACON_INT_CMD;
820
821 /*
822  * WMI_SET_BMISS_TIME_CMDID
823  * valid values are between 1000 and 5000 TUs
824  */
825
826 #define MIN_BMISS_TIME     1000
827 #define MAX_BMISS_TIME     5000
828 #define MIN_BMISS_BEACONS  1
829 #define MAX_BMISS_BEACONS  50
830
831 typedef PREPACK struct {
832     u16 bmissTime;
833     u16 numBeacons;
834 } POSTPACK WMI_BMISS_TIME_CMD;
835
836 /*
837  * WMI_SET_POWER_MODE_CMDID
838  */
839 typedef enum {
840     REC_POWER = 0x01,
841     MAX_PERF_POWER,
842 } WMI_POWER_MODE;
843
844 typedef PREPACK struct {
845     u8 powerMode;      /* WMI_POWER_MODE */
846 } POSTPACK WMI_POWER_MODE_CMD;
847
848 typedef PREPACK struct {
849     s8 status;      /* WMI_SET_PARAMS_REPLY */
850 } POSTPACK WMI_SET_PARAMS_REPLY;
851
852 typedef PREPACK struct {
853     u32 opcode;
854     u32 length;
855     char buffer[1];      /* WMI_SET_PARAMS */
856 } POSTPACK WMI_SET_PARAMS_CMD;
857
858 typedef PREPACK struct {
859     u8 multicast_mac[ATH_MAC_LEN];      /* WMI_SET_MCAST_FILTER */
860 } POSTPACK WMI_SET_MCAST_FILTER_CMD;
861
862 typedef PREPACK struct {
863     u8 enable;      /* WMI_MCAST_FILTER */
864 } POSTPACK WMI_MCAST_FILTER_CMD;
865
866 /*
867  * WMI_SET_POWER_PARAMS_CMDID
868  */
869 typedef enum {
870     IGNORE_DTIM = 0x01,
871     NORMAL_DTIM = 0x02,
872     STICK_DTIM  = 0x03,
873     AUTO_DTIM   = 0x04,
874 } WMI_DTIM_POLICY;
875
876 /* Policy to determnine whether TX should wakeup WLAN if sleeping */
877 typedef enum {
878     TX_WAKEUP_UPON_SLEEP = 1,
879     TX_DONT_WAKEUP_UPON_SLEEP = 2
880 } WMI_TX_WAKEUP_POLICY_UPON_SLEEP;
881
882 /*
883  * Policy to determnine whether power save failure event should be sent to
884  * host during scanning
885  */
886 typedef enum {
887     SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
888     IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN = 2,
889 } POWER_SAVE_FAIL_EVENT_POLICY;
890
891 typedef PREPACK struct {
892     u16 idle_period;             /* msec */
893     u16 pspoll_number;
894     u16 dtim_policy;
895     u16 tx_wakeup_policy;
896     u16 num_tx_to_wakeup;
897     u16 ps_fail_event_policy;
898 } POSTPACK WMI_POWER_PARAMS_CMD;
899
900 /* Adhoc power save types */
901 typedef enum {
902     ADHOC_PS_DISABLE=1,
903     ADHOC_PS_ATH=2,
904     ADHOC_PS_IEEE=3,
905     ADHOC_PS_OTHER=4,
906 } WMI_ADHOC_PS_TYPE;
907
908 typedef PREPACK struct {
909     u8 power_saving;
910     u8 ttl; /* number of beacon periods */
911     u16 atim_windows;          /* msec */
912     u16 timeout_value;         /* msec */
913 } POSTPACK WMI_IBSS_PM_CAPS_CMD;
914
915 /* AP power save types */
916 typedef enum {
917     AP_PS_DISABLE=1,
918     AP_PS_ATH=2,
919 } WMI_AP_PS_TYPE;
920
921 typedef PREPACK struct {
922     u32 idle_time;   /* in msec */
923     u32 ps_period;   /* in usec */
924     u8 sleep_period; /* in ps periods */
925     u8 psType;
926 } POSTPACK WMI_AP_PS_CMD;
927
928 /*
929  * WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID
930  */
931 typedef enum {
932     IGNORE_TIM_ALL_QUEUES_APSD = 0,
933     PROCESS_TIM_ALL_QUEUES_APSD = 1,
934     IGNORE_TIM_SIMULATED_APSD = 2,
935     PROCESS_TIM_SIMULATED_APSD = 3,
936 } APSD_TIM_POLICY;
937
938 typedef PREPACK struct {
939     u16 psPollTimeout;          /* msec */
940     u16 triggerTimeout;         /* msec */
941     u32 apsdTimPolicy;      /* TIM behavior with  ques APSD enabled. Default is IGNORE_TIM_ALL_QUEUES_APSD */
942     u32 simulatedAPSDTimPolicy;      /* TIM behavior with  simulated APSD enabled. Default is PROCESS_TIM_SIMULATED_APSD */
943 } POSTPACK WMI_POWERSAVE_TIMERS_POLICY_CMD;
944
945 /*
946  * WMI_SET_VOICE_PKT_SIZE_CMDID
947  */
948 typedef PREPACK struct {
949     u16 voicePktSize;
950 } POSTPACK WMI_SET_VOICE_PKT_SIZE_CMD;
951
952 /*
953  * WMI_SET_MAX_SP_LEN_CMDID
954  */
955 typedef enum {
956     DELIVER_ALL_PKT = 0x0,
957     DELIVER_2_PKT = 0x1,
958     DELIVER_4_PKT = 0x2,
959     DELIVER_6_PKT = 0x3,
960 } APSD_SP_LEN_TYPE;
961
962 typedef PREPACK struct {
963     u8 maxSPLen;
964 } POSTPACK WMI_SET_MAX_SP_LEN_CMD;
965
966 /*
967  * WMI_SET_DISC_TIMEOUT_CMDID
968  */
969 typedef PREPACK struct {
970     u8 disconnectTimeout;          /* seconds */
971 } POSTPACK WMI_DISC_TIMEOUT_CMD;
972
973 typedef enum {
974     UPLINK_TRAFFIC = 0,
975     DNLINK_TRAFFIC = 1,
976     BIDIR_TRAFFIC = 2,
977 } DIR_TYPE;
978
979 typedef enum {
980     DISABLE_FOR_THIS_AC = 0,
981     ENABLE_FOR_THIS_AC  = 1,
982     ENABLE_FOR_ALL_AC   = 2,
983 } VOICEPS_CAP_TYPE;
984
985 typedef enum {
986     TRAFFIC_TYPE_APERIODIC = 0,
987     TRAFFIC_TYPE_PERIODIC = 1,
988 }TRAFFIC_TYPE;
989
990 /*
991  * WMI_SYNCHRONIZE_CMDID
992  */
993 typedef PREPACK struct {
994     u8 dataSyncMap;
995 } POSTPACK WMI_SYNC_CMD;
996
997 /*
998  * WMI_CREATE_PSTREAM_CMDID
999  */
1000 typedef PREPACK struct {
1001     u32 minServiceInt;           /* in milli-sec */
1002     u32 maxServiceInt;           /* in milli-sec */
1003     u32 inactivityInt;           /* in milli-sec */
1004     u32 suspensionInt;           /* in milli-sec */
1005     u32 serviceStartTime;
1006     u32 minDataRate;             /* in bps */
1007     u32 meanDataRate;            /* in bps */
1008     u32 peakDataRate;            /* in bps */
1009     u32 maxBurstSize;
1010     u32 delayBound;
1011     u32 minPhyRate;              /* in bps */
1012     u32 sba;
1013     u32 mediumTime;
1014     u16 nominalMSDU;             /* in octects */
1015     u16 maxMSDU;                 /* in octects */
1016     u8 trafficClass;
1017     u8 trafficDirection;        /* DIR_TYPE */
1018     u8 rxQueueNum;
1019     u8 trafficType;             /* TRAFFIC_TYPE */
1020     u8 voicePSCapability;       /* VOICEPS_CAP_TYPE */
1021     u8 tsid;
1022     u8 userPriority;            /* 802.1D user priority */
1023     u8 nominalPHY;              /* nominal phy rate */
1024 } POSTPACK WMI_CREATE_PSTREAM_CMD;
1025
1026 /*
1027  * WMI_DELETE_PSTREAM_CMDID
1028  */
1029 typedef PREPACK struct {
1030     u8 txQueueNumber;
1031     u8 rxQueueNumber;
1032     u8 trafficDirection;
1033     u8 trafficClass;
1034     u8 tsid;
1035 } POSTPACK WMI_DELETE_PSTREAM_CMD;
1036
1037 /*
1038  * WMI_SET_CHANNEL_PARAMS_CMDID
1039  */
1040 typedef enum {
1041     WMI_11A_MODE  = 0x1,
1042     WMI_11G_MODE  = 0x2,
1043     WMI_11AG_MODE = 0x3,
1044     WMI_11B_MODE  = 0x4,
1045     WMI_11GONLY_MODE = 0x5,    
1046 } WMI_PHY_MODE;
1047
1048 #define WMI_MAX_CHANNELS        32
1049
1050 typedef PREPACK struct {
1051     u8 reserved1;
1052     u8 scanParam;              /* set if enable scan */
1053     u8 phyMode;                /* see WMI_PHY_MODE */
1054     u8 numChannels;            /* how many channels follow */
1055     u16 channelList[1];         /* channels in Mhz */
1056 } POSTPACK WMI_CHANNEL_PARAMS_CMD;
1057
1058
1059 /*
1060  *  WMI_RSSI_THRESHOLD_PARAMS_CMDID
1061  *  Setting the polltime to 0 would disable polling.
1062  *  Threshold values are in the ascending order, and should agree to:
1063  *  (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
1064  *      < highThreshold_upperVal)
1065  */
1066
1067 typedef PREPACK struct WMI_RSSI_THRESHOLD_PARAMS{
1068     u32 pollTime;               /* Polling time as a factor of LI */
1069     s16 thresholdAbove1_Val;          /* lowest of upper */
1070     s16 thresholdAbove2_Val;
1071     s16 thresholdAbove3_Val;
1072     s16 thresholdAbove4_Val;
1073     s16 thresholdAbove5_Val;
1074     s16 thresholdAbove6_Val;          /* highest of upper */
1075     s16 thresholdBelow1_Val;         /* lowest of bellow */
1076     s16 thresholdBelow2_Val;
1077     s16 thresholdBelow3_Val;
1078     s16 thresholdBelow4_Val;
1079     s16 thresholdBelow5_Val;
1080     s16 thresholdBelow6_Val;         /* highest of bellow */
1081     u8 weight;                  /* "alpha" */
1082     u8 reserved[3];
1083 } POSTPACK  WMI_RSSI_THRESHOLD_PARAMS_CMD;
1084
1085 /*
1086  *  WMI_SNR_THRESHOLD_PARAMS_CMDID
1087  *  Setting the polltime to 0 would disable polling.
1088  */
1089
1090 typedef PREPACK struct WMI_SNR_THRESHOLD_PARAMS{
1091     u32 pollTime;               /* Polling time as a factor of LI */
1092     u8 weight;                  /* "alpha" */
1093     u8 thresholdAbove1_Val;      /* lowest of uppper*/
1094     u8 thresholdAbove2_Val;
1095     u8 thresholdAbove3_Val;
1096     u8 thresholdAbove4_Val;      /* highest of upper */
1097     u8 thresholdBelow1_Val;     /* lowest of bellow */
1098     u8 thresholdBelow2_Val;
1099     u8 thresholdBelow3_Val;
1100     u8 thresholdBelow4_Val;     /* highest of bellow */
1101     u8 reserved[3];
1102 } POSTPACK WMI_SNR_THRESHOLD_PARAMS_CMD;
1103
1104 /*
1105  *  WMI_LQ_THRESHOLD_PARAMS_CMDID
1106  */
1107 typedef PREPACK struct WMI_LQ_THRESHOLD_PARAMS {
1108     u8 enable;
1109     u8 thresholdAbove1_Val;
1110     u8 thresholdAbove2_Val;
1111     u8 thresholdAbove3_Val;
1112     u8 thresholdAbove4_Val;
1113     u8 thresholdBelow1_Val;
1114     u8 thresholdBelow2_Val;
1115     u8 thresholdBelow3_Val;
1116     u8 thresholdBelow4_Val;
1117     u8 reserved[3];
1118 } POSTPACK  WMI_LQ_THRESHOLD_PARAMS_CMD;
1119
1120 typedef enum {
1121     WMI_LPREAMBLE_DISABLED = 0,
1122     WMI_LPREAMBLE_ENABLED
1123 } WMI_LPREAMBLE_STATUS;
1124
1125 typedef enum {
1126     WMI_IGNORE_BARKER_IN_ERP = 0,
1127     WMI_DONOT_IGNORE_BARKER_IN_ERP
1128 } WMI_PREAMBLE_POLICY;
1129
1130 typedef PREPACK struct {
1131     u8 status;
1132     u8 preamblePolicy;
1133 }POSTPACK WMI_SET_LPREAMBLE_CMD;
1134
1135 typedef PREPACK struct {
1136     u16 threshold;
1137 }POSTPACK WMI_SET_RTS_CMD;
1138
1139 /*
1140  *  WMI_TARGET_ERROR_REPORT_BITMASK_CMDID
1141  *  Sets the error reporting event bitmask in target. Target clears it
1142  *  upon an error. Subsequent errors are counted, but not reported
1143  *  via event, unless the bitmask is set again.
1144  */
1145 typedef PREPACK struct {
1146     u32 bitmask;
1147 } POSTPACK  WMI_TARGET_ERROR_REPORT_BITMASK;
1148
1149 /*
1150  * WMI_SET_TX_PWR_CMDID
1151  */
1152 typedef PREPACK struct {
1153     u8 dbM;                  /* in dbM units */
1154 } POSTPACK WMI_SET_TX_PWR_CMD, WMI_TX_PWR_REPLY;
1155
1156 /*
1157  * WMI_SET_ASSOC_INFO_CMDID
1158  *
1159  * A maximum of 2 private IEs can be sent in the [Re]Assoc request.
1160  * A 3rd one, the CCX version IE can also be set from the host.
1161  */
1162 #define WMI_MAX_ASSOC_INFO_TYPE    2
1163 #define WMI_CCX_VER_IE             2 /* ieType to set CCX Version IE */
1164
1165 #define WMI_MAX_ASSOC_INFO_LEN     240
1166
1167 typedef PREPACK struct {
1168     u8 ieType;
1169     u8 bufferSize;
1170     u8 assocInfo[1];       /* up to WMI_MAX_ASSOC_INFO_LEN */
1171 } POSTPACK WMI_SET_ASSOC_INFO_CMD;
1172
1173
1174 /*
1175  * WMI_GET_TX_PWR_CMDID does not take any parameters
1176  */
1177
1178 /*
1179  * WMI_ADD_BAD_AP_CMDID
1180  */
1181 #define WMI_MAX_BAD_AP_INDEX      1
1182
1183 typedef PREPACK struct {
1184     u8 badApIndex;         /* 0 to WMI_MAX_BAD_AP_INDEX */
1185     u8 bssid[ATH_MAC_LEN];
1186 } POSTPACK WMI_ADD_BAD_AP_CMD;
1187
1188 /*
1189  * WMI_DELETE_BAD_AP_CMDID
1190  */
1191 typedef PREPACK struct {
1192     u8 badApIndex;         /* 0 to WMI_MAX_BAD_AP_INDEX */
1193 } POSTPACK WMI_DELETE_BAD_AP_CMD;
1194
1195 /*
1196  * WMI_SET_ACCESS_PARAMS_CMDID
1197  */
1198 #define WMI_DEFAULT_TXOP_ACPARAM    0       /* implies one MSDU */
1199 #define WMI_DEFAULT_ECWMIN_ACPARAM  4       /* corresponds to CWmin of 15 */
1200 #define WMI_DEFAULT_ECWMAX_ACPARAM  10      /* corresponds to CWmax of 1023 */
1201 #define WMI_MAX_CW_ACPARAM          15      /* maximum eCWmin or eCWmax */
1202 #define WMI_DEFAULT_AIFSN_ACPARAM   2
1203 #define WMI_MAX_AIFSN_ACPARAM       15
1204 typedef PREPACK struct {
1205     u16 txop;                      /* in units of 32 usec */
1206     u8 eCWmin;
1207     u8 eCWmax;
1208     u8 aifsn;
1209     u8 ac;
1210 } POSTPACK WMI_SET_ACCESS_PARAMS_CMD;
1211
1212
1213 /*
1214  * WMI_SET_RETRY_LIMITS_CMDID
1215  *
1216  * This command is used to customize the number of retries the
1217  * wlan device will perform on a given frame.
1218  */
1219 #define WMI_MIN_RETRIES 2
1220 #define WMI_MAX_RETRIES 13
1221 typedef enum {
1222     MGMT_FRAMETYPE    = 0,
1223     CONTROL_FRAMETYPE = 1,
1224     DATA_FRAMETYPE    = 2
1225 } WMI_FRAMETYPE;
1226
1227 typedef PREPACK struct {
1228     u8 frameType;                      /* WMI_FRAMETYPE */
1229     u8 trafficClass;                   /* applies only to DATA_FRAMETYPE */
1230     u8 maxRetries;
1231     u8 enableNotify;
1232 } POSTPACK WMI_SET_RETRY_LIMITS_CMD;
1233
1234 /*
1235  * WMI_SET_ROAM_CTRL_CMDID
1236  *
1237  * This command is used to influence the Roaming behaviour
1238  * Set the host biases of the BSSs before setting the roam mode as bias
1239  * based.
1240  */
1241
1242 /*
1243  * Different types of Roam Control
1244  */
1245
1246 typedef enum {
1247         WMI_FORCE_ROAM          = 1,      /* Roam to the specified BSSID */
1248         WMI_SET_ROAM_MODE       = 2,      /* default ,progd bias, no roam */
1249         WMI_SET_HOST_BIAS       = 3,     /* Set the Host Bias */
1250         WMI_SET_LOWRSSI_SCAN_PARAMS = 4, /* Set lowrssi Scan parameters */
1251 } WMI_ROAM_CTRL_TYPE;
1252
1253 #define WMI_MIN_ROAM_CTRL_TYPE WMI_FORCE_ROAM
1254 #define WMI_MAX_ROAM_CTRL_TYPE WMI_SET_LOWRSSI_SCAN_PARAMS
1255
1256 /*
1257  * ROAM MODES
1258  */
1259
1260 typedef enum {
1261         WMI_DEFAULT_ROAM_MODE   = 1,  /* RSSI based ROAM */
1262         WMI_HOST_BIAS_ROAM_MODE = 2, /* HOST BIAS based ROAM */
1263         WMI_LOCK_BSS_MODE  = 3  /* Lock to the Current BSS - no Roam */
1264 } WMI_ROAM_MODE;
1265
1266 /*
1267  * BSS HOST BIAS INFO
1268  */
1269
1270 typedef PREPACK struct {
1271         u8 bssid[ATH_MAC_LEN];
1272         s8 bias;
1273 } POSTPACK WMI_BSS_BIAS;
1274
1275 typedef PREPACK struct {
1276         u8 numBss;
1277         WMI_BSS_BIAS bssBias[1];
1278 } POSTPACK WMI_BSS_BIAS_INFO;
1279
1280 typedef PREPACK struct WMI_LOWRSSI_SCAN_PARAMS {
1281         u16 lowrssi_scan_period;
1282         s16 lowrssi_scan_threshold;
1283         s16 lowrssi_roam_threshold;
1284         u8 roam_rssi_floor;
1285         u8 reserved[1];              /* For alignment */
1286 } POSTPACK WMI_LOWRSSI_SCAN_PARAMS;
1287
1288 typedef PREPACK struct {
1289     PREPACK union {
1290         u8 bssid[ATH_MAC_LEN]; /* WMI_FORCE_ROAM */
1291         u8 roamMode;           /* WMI_SET_ROAM_MODE  */
1292         WMI_BSS_BIAS_INFO bssBiasInfo; /* WMI_SET_HOST_BIAS */
1293         WMI_LOWRSSI_SCAN_PARAMS lrScanParams;
1294     } POSTPACK info;
1295     u8 roamCtrlType ;
1296 } POSTPACK WMI_SET_ROAM_CTRL_CMD;
1297
1298 /*
1299  * WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID
1300  */
1301 typedef enum {
1302     BT_WLAN_CONN_PRECDENCE_WLAN=0,  /* Default */
1303     BT_WLAN_CONN_PRECDENCE_PAL,
1304 } BT_WLAN_CONN_PRECEDENCE;
1305
1306 typedef PREPACK struct {
1307     u8 precedence;
1308 } POSTPACK WMI_SET_BT_WLAN_CONN_PRECEDENCE;
1309
1310 /*
1311  * WMI_ENABLE_RM_CMDID
1312  */
1313 typedef PREPACK struct {
1314         u32 enable_radio_measurements;
1315 } POSTPACK WMI_ENABLE_RM_CMD;
1316
1317 /*
1318  * WMI_SET_MAX_OFFHOME_DURATION_CMDID
1319  */
1320 typedef PREPACK struct {
1321         u8 max_offhome_duration;
1322 } POSTPACK WMI_SET_MAX_OFFHOME_DURATION_CMD;
1323
1324 typedef PREPACK struct {
1325     u32 frequency;
1326     u8 threshold;
1327 } POSTPACK WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD;
1328 /*---------------------- BTCOEX RELATED -------------------------------------*/
1329 /*----------------------COMMON to AR6002 and AR6003 -------------------------*/
1330 typedef enum {
1331     BT_STREAM_UNDEF = 0,
1332     BT_STREAM_SCO,             /* SCO stream */
1333     BT_STREAM_A2DP,            /* A2DP stream */
1334     BT_STREAM_SCAN,            /* BT Discovery or Page */
1335     BT_STREAM_ESCO,
1336     BT_STREAM_MAX
1337 } BT_STREAM_TYPE;
1338
1339 typedef enum {
1340     BT_PARAM_SCO_PSPOLL_LATENCY_ONE_FOURTH =1,
1341     BT_PARAM_SCO_PSPOLL_LATENCY_HALF,
1342     BT_PARAM_SCO_PSPOLL_LATENCY_THREE_FOURTH,
1343 } BT_PARAMS_SCO_PSPOLL_LATENCY;
1344
1345 typedef enum {
1346     BT_PARAMS_SCO_STOMP_SCO_NEVER =1,
1347     BT_PARAMS_SCO_STOMP_SCO_ALWAYS,
1348     BT_PARAMS_SCO_STOMP_SCO_IN_LOWRSSI,
1349 } BT_PARAMS_SCO_STOMP_RULES;
1350
1351 typedef enum {
1352     BT_STATUS_UNDEF = 0,
1353     BT_STATUS_ON,
1354     BT_STATUS_OFF,
1355     BT_STATUS_MAX
1356 } BT_STREAM_STATUS;
1357
1358 typedef PREPACK struct {
1359     u8 streamType;
1360     u8 status;
1361 } POSTPACK WMI_SET_BT_STATUS_CMD;
1362
1363 typedef enum {
1364     BT_ANT_TYPE_UNDEF=0,
1365     BT_ANT_TYPE_DUAL,
1366     BT_ANT_TYPE_SPLITTER,
1367     BT_ANT_TYPE_SWITCH,
1368     BT_ANT_TYPE_HIGH_ISO_DUAL
1369 } BT_ANT_FRONTEND_CONFIG;
1370
1371 typedef enum {
1372     BT_COLOCATED_DEV_BTS4020=0,
1373     BT_COLCATED_DEV_CSR ,
1374     BT_COLOCATED_DEV_VALKYRIE
1375 } BT_COLOCATED_DEV_TYPE;
1376
1377 /*********************** Applicable to AR6002 ONLY ******************************/
1378
1379 typedef enum {
1380     BT_PARAM_SCO = 1,         /* SCO stream parameters */
1381     BT_PARAM_A2DP ,
1382     BT_PARAM_ANTENNA_CONFIG,
1383     BT_PARAM_COLOCATED_BT_DEVICE,
1384     BT_PARAM_ACLCOEX,
1385     BT_PARAM_11A_SEPARATE_ANT,
1386     BT_PARAM_MAX
1387 } BT_PARAM_TYPE;
1388
1389
1390 #define BT_SCO_ALLOW_CLOSE_RANGE_OPT    (1 << 0)
1391 #define BT_SCO_FORCE_AWAKE_OPT          (1 << 1)
1392 #define BT_SCO_SET_RSSI_OVERRIDE(flags)        ((flags) |= (1 << 2))
1393 #define BT_SCO_GET_RSSI_OVERRIDE(flags)        (((flags) >> 2) & 0x1)
1394 #define BT_SCO_SET_RTS_OVERRIDE(flags)   ((flags) |= (1 << 3))
1395 #define BT_SCO_GET_RTS_OVERRIDE(flags)   (((flags) >> 3) & 0x1)
1396 #define BT_SCO_GET_MIN_LOW_RATE_CNT(flags)     (((flags) >> 8) & 0xFF)
1397 #define BT_SCO_GET_MAX_LOW_RATE_CNT(flags)     (((flags) >> 16) & 0xFF)
1398 #define BT_SCO_SET_MIN_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 8)
1399 #define BT_SCO_SET_MAX_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 16)
1400
1401 typedef PREPACK struct {
1402     u32 numScoCyclesForceTrigger;  /* Number SCO cycles after which
1403                                            force a pspoll. default = 10 */
1404     u32 dataResponseTimeout;       /* Timeout Waiting for Downlink pkt
1405                                            in response for ps-poll,
1406                                            default = 10 msecs */
1407     u32 stompScoRules;
1408     u32 scoOptFlags;               /* SCO Options Flags :
1409                                             bits:     meaning:
1410                                              0        Allow Close Range Optimization
1411                                              1        Force awake during close range
1412                                              2        If set use host supplied RSSI for OPT
1413                                              3        If set use host supplied RTS COUNT for OPT
1414                                              4..7     Unused
1415                                              8..15    Low Data Rate Min Cnt
1416                                              16..23   Low Data Rate Max Cnt
1417                                         */
1418
1419     u8 stompDutyCyleVal;           /* Sco cycles to limit ps-poll queuing
1420                                            if stomped */
1421     u8 stompDutyCyleMaxVal;        /*firm ware increases stomp duty cycle
1422                                           gradually uptill this value on need basis*/
1423     u8 psPollLatencyFraction;      /* Fraction of idle
1424                                            period, within which
1425                                            additional ps-polls
1426                                            can be queued */
1427     u8 noSCOSlots;                 /* Number of SCO Tx/Rx slots.
1428                                            HVx, EV3, 2EV3 = 2 */
1429     u8 noIdleSlots;                /* Number of Bluetooth idle slots between
1430                                            consecutive SCO Tx/Rx slots
1431                                            HVx, EV3 = 4
1432                                            2EV3 = 10 */
1433     u8 scoOptOffRssi;/*RSSI value below which we go to ps poll*/
1434     u8 scoOptOnRssi; /*RSSI value above which we reenter opt mode*/
1435     u8 scoOptRtsCount;
1436 } POSTPACK BT_PARAMS_SCO;
1437
1438 #define BT_A2DP_ALLOW_CLOSE_RANGE_OPT  (1 << 0)
1439 #define BT_A2DP_FORCE_AWAKE_OPT        (1 << 1)
1440 #define BT_A2DP_SET_RSSI_OVERRIDE(flags)        ((flags) |= (1 << 2))
1441 #define BT_A2DP_GET_RSSI_OVERRIDE(flags)        (((flags) >> 2) & 0x1)
1442 #define BT_A2DP_SET_RTS_OVERRIDE(flags)   ((flags) |= (1 << 3))
1443 #define BT_A2DP_GET_RTS_OVERRIDE(flags)   (((flags) >> 3) & 0x1)
1444 #define BT_A2DP_GET_MIN_LOW_RATE_CNT(flags)     (((flags) >> 8) & 0xFF)
1445 #define BT_A2DP_GET_MAX_LOW_RATE_CNT(flags)     (((flags) >> 16) & 0xFF)
1446 #define BT_A2DP_SET_MIN_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 8)
1447 #define BT_A2DP_SET_MAX_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 16)
1448
1449 typedef PREPACK struct {
1450     u32 a2dpWlanUsageLimit; /* MAX time firmware uses the medium for
1451                                     wlan, after it identifies the idle time
1452                                     default (30 msecs) */
1453     u32 a2dpBurstCntMin;   /* Minimum number of bluetooth data frames
1454                                    to replenish Wlan Usage  limit (default 3) */
1455     u32 a2dpDataRespTimeout;
1456     u32 a2dpOptFlags;      /* A2DP Option flags:
1457                                        bits:    meaning:
1458                                         0       Allow Close Range Optimization
1459                                         1       Force awake during close range
1460                                         2        If set use host supplied RSSI for OPT
1461                                         3        If set use host supplied RTS COUNT for OPT
1462                                         4..7    Unused
1463                                         8..15   Low Data Rate Min Cnt
1464                                         16..23  Low Data Rate Max Cnt
1465                                  */
1466     u8 isCoLocatedBtRoleMaster;
1467     u8 a2dpOptOffRssi;/*RSSI value below which we go to ps poll*/
1468     u8 a2dpOptOnRssi; /*RSSI value above which we reenter opt mode*/
1469     u8 a2dpOptRtsCount;
1470 }POSTPACK BT_PARAMS_A2DP;
1471
1472 /* During BT ftp/ BT OPP or any another data based acl profile on bluetooth
1473    (non a2dp).*/
1474 typedef PREPACK struct {
1475     u32 aclWlanMediumUsageTime;  /* Wlan usage time during Acl (non-a2dp)
1476                                        coexistence (default 30 msecs) */
1477     u32 aclBtMediumUsageTime;   /* Bt usage time during acl coexistence
1478                                        (default 30 msecs)*/
1479     u32 aclDataRespTimeout;
1480     u32 aclDetectTimeout;      /* ACL coexistence enabled if we get
1481                                        10 Pkts in X msec(default 100 msecs) */
1482     u32 aclmaxPktCnt;          /* No of ACL pkts to receive before
1483                                          enabling ACL coex */
1484
1485 }POSTPACK BT_PARAMS_ACLCOEX;
1486
1487 typedef PREPACK struct {
1488     PREPACK union {
1489         BT_PARAMS_SCO scoParams;
1490         BT_PARAMS_A2DP a2dpParams;
1491         BT_PARAMS_ACLCOEX  aclCoexParams;
1492         u8 antType;         /* 0 -Disabled (default)
1493                                      1 - BT_ANT_TYPE_DUAL
1494                                      2 - BT_ANT_TYPE_SPLITTER
1495                                      3 - BT_ANT_TYPE_SWITCH */
1496         u8 coLocatedBtDev;  /* 0 - BT_COLOCATED_DEV_BTS4020 (default)
1497                                      1 - BT_COLCATED_DEV_CSR
1498                                      2 - BT_COLOCATED_DEV_VALKYRIe
1499                                    */
1500     } POSTPACK info;
1501     u8 paramType ;
1502 } POSTPACK WMI_SET_BT_PARAMS_CMD;
1503
1504 /************************ END AR6002 BTCOEX *******************************/
1505 /*-----------------------AR6003 BTCOEX -----------------------------------*/
1506
1507 /*  ---------------WMI_SET_BTCOEX_FE_ANT_CMDID --------------------------*/
1508 /* Indicates front end antenna configuration. This command needs to be issued
1509  * right after initialization and after WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID.
1510  * AR6003 enables coexistence and antenna switching based on the configuration.
1511  */
1512 typedef enum {
1513     WMI_BTCOEX_NOT_ENABLED = 0,
1514     WMI_BTCOEX_FE_ANT_SINGLE =1,
1515     WMI_BTCOEX_FE_ANT_DUAL=2,
1516     WMI_BTCOEX_FE_ANT_DUAL_HIGH_ISO=3,
1517     WMI_BTCOEX_FE_ANT_TYPE_MAX
1518 }WMI_BTCOEX_FE_ANT_TYPE;
1519
1520 typedef PREPACK struct {
1521         u8 btcoexFeAntType; /* 1 - WMI_BTCOEX_FE_ANT_SINGLE for single antenna front end
1522                                 2 - WMI_BTCOEX_FE_ANT_DUAL for dual antenna front end
1523                                     (for isolations less 35dB, for higher isolation there
1524                                     is not need to pass this command).
1525                                     (not implemented)
1526                               */
1527 }POSTPACK WMI_SET_BTCOEX_FE_ANT_CMD;
1528
1529 /* -------------WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID ----------------*/
1530 /* Indicate the bluetooth chip to the firmware. Firmware can have different algorithm based
1531  * bluetooth chip type.Based on bluetooth device, different coexistence protocol would be used.
1532  */
1533 typedef PREPACK struct {
1534         u8 btcoexCoLocatedBTdev; /*1 - Qcom BT (3 -wire PTA)
1535                                     2 - CSR BT  (3 wire PTA)
1536                                     3 - Atheros 3001 BT (3 wire PTA)
1537                                     4 - STE bluetooth (4-wire ePTA)
1538                                     5 - Atheros 3002 BT (4-wire MCI)
1539                                     defaults= 3 (Atheros 3001 BT )
1540                                     */
1541 }POSTPACK WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD;
1542
1543 /* -------------WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID ------------*/
1544 /* Configuration parameters during bluetooth inquiry and page. Page configuration
1545  * is applicable only on interfaces which can distinguish page (applicable only for ePTA -
1546  * STE bluetooth).
1547  * Bluetooth inquiry start and end is indicated via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID.
1548  * During this the station will be  power-save mode.
1549  */
1550 typedef PREPACK struct {
1551         u32 btInquiryDataFetchFrequency;/* The frequency of querying the AP for data
1552                                             (via pspoll) is configured by this parameter.
1553                                             "default = 10 ms" */
1554
1555         u32 protectBmissDurPostBtInquiry;/* The firmware will continue to be in inquiry state
1556                                              for configured duration, after inquiry completion
1557                                              . This is to ensure other bluetooth transactions
1558                                              (RDP, SDP profiles, link key exchange ...etc)
1559                                              goes through smoothly without wifi stomping.
1560                                              default = 10 secs*/
1561
1562         u32 maxpageStomp;                 /*Applicable only for STE-BT interface. Currently not
1563                                              used */
1564         u32 btInquiryPageFlag;           /* Not used */
1565 }POSTPACK WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD;
1566
1567 /*---------------------WMI_SET_BTCOEX_SCO_CONFIG_CMDID ---------------*/
1568 /* Configure  SCO parameters. These parameters would be used whenever firmware is indicated
1569  * of (e)SCO profile on bluetooth ( via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID).
1570  * Configration of BTCOEX_SCO_CONFIG data structure are common configuration and applies
1571  * ps-poll mode and opt mode.
1572  * Ps-poll Mode - Station is in power-save and retrieves downlink data between sco gaps.
1573  * Opt Mode - station is in awake state and access point can send data to station any time.
1574  * BTCOEX_PSPOLLMODE_SCO_CONFIG - Configuration applied only during ps-poll mode.
1575  * BTCOEX_OPTMODE_SCO_CONFIG - Configuration applied only during opt mode.
1576  */
1577 #define WMI_SCO_CONFIG_FLAG_ALLOW_OPTIMIZATION   (1 << 0)
1578 #define WMI_SCO_CONFIG_FLAG_IS_EDR_CAPABLE       (1 << 1)
1579 #define WMI_SCO_CONFIG_FLAG_IS_BT_MASTER         (1 << 2)
1580 #define WMI_SCO_CONFIG_FLAG_FW_DETECT_OF_PER     (1 << 3)
1581 typedef PREPACK struct {
1582         u32 scoSlots;                                   /* Number of SCO Tx/Rx slots.
1583                                                                                    HVx, EV3, 2EV3 = 2 */
1584         u32 scoIdleSlots;                               /* Number of Bluetooth idle slots between
1585                                                                                    consecutive SCO Tx/Rx slots
1586                                                                                    HVx, EV3 = 4
1587                                                                                    2EV3 = 10
1588                                          */
1589         u32 scoFlags;                              /* SCO Options Flags :
1590                                                                                   bits:    meaning:
1591                                                                                   0   Allow Close Range Optimization
1592                                                                                   1   Is EDR capable or Not
1593                                                                                   2   IS Co-located Bt role Master
1594                                           3   Firmware determines the periodicity of SCO.
1595                                                                                  */
1596
1597     u32 linkId;                      /* applicable to STE-BT - not used */
1598 }POSTPACK BTCOEX_SCO_CONFIG;
1599
1600 typedef PREPACK struct {
1601         u32 scoCyclesForceTrigger;      /* Number SCO cycles after which
1602                                                                                         force a pspoll. default = 10 */
1603     u32 scoDataResponseTimeout;  /* Timeout Waiting for Downlink pkt
1604                                                                                         in response for ps-poll,
1605                                                                                         default = 20 msecs */
1606
1607         u32 scoStompDutyCyleVal;                 /* not implemented */
1608
1609         u32 scoStompDutyCyleMaxVal;     /*Not implemented */
1610
1611         u32 scoPsPollLatencyFraction;    /* Fraction of idle
1612                                                                                         period, within which
1613                                                                                         additional ps-polls can be queued
1614                                             1 - 1/4 of idle duration
1615                                             2 - 1/2 of idle duration
1616                                             3 - 3/4 of idle duration
1617                                             default =2 (1/2)
1618                                            */
1619 }POSTPACK BTCOEX_PSPOLLMODE_SCO_CONFIG;
1620
1621 typedef PREPACK struct {
1622         u32 scoStompCntIn100ms;/*max number of SCO stomp in 100ms allowed in
1623                                    opt mode. If exceeds the configured value,
1624                                    switch to ps-poll mode
1625                                   default = 3 */
1626
1627         u32 scoContStompMax;   /* max number of continuous stomp allowed in opt mode.
1628                                    if exceeded switch to pspoll mode
1629                                     default = 3 */
1630
1631         u32 scoMinlowRateMbps; /* Low rate threshold */
1632
1633         u32 scoLowRateCnt;     /* number of low rate pkts (< scoMinlowRateMbps) allowed in 100 ms.
1634                                    If exceeded switch/stay to ps-poll mode, lower stay in opt mode.
1635                                    default = 36
1636                                  */
1637
1638         u32 scoHighPktRatio;   /*(Total Rx pkts in 100 ms + 1)/
1639                                   ((Total tx pkts in 100 ms - No of high rate pkts in 100 ms) + 1) in 100 ms,
1640                                   if exceeded switch/stay in opt mode and if lower switch/stay in  pspoll mode.
1641                                   default = 5 (80% of high rates)
1642                                  */
1643
1644         u32 scoMaxAggrSize;    /* Max number of Rx subframes allowed in this mode. (Firmware re-negogiates
1645                                    max number of aggregates if it was negogiated to higher value
1646                                    default = 1
1647                                    Recommended value Basic rate headsets = 1, EDR (2-EV3)  =4.
1648                                  */
1649 }POSTPACK BTCOEX_OPTMODE_SCO_CONFIG;
1650
1651 typedef PREPACK struct {
1652     u32 scanInterval;
1653     u32 maxScanStompCnt;
1654 }POSTPACK BTCOEX_WLANSCAN_SCO_CONFIG;
1655
1656 typedef PREPACK struct {
1657         BTCOEX_SCO_CONFIG scoConfig;
1658         BTCOEX_PSPOLLMODE_SCO_CONFIG scoPspollConfig;
1659         BTCOEX_OPTMODE_SCO_CONFIG scoOptModeConfig;
1660         BTCOEX_WLANSCAN_SCO_CONFIG scoWlanScanConfig;
1661 }POSTPACK WMI_SET_BTCOEX_SCO_CONFIG_CMD;
1662
1663 /* ------------------WMI_SET_BTCOEX_A2DP_CONFIG_CMDID -------------------*/
1664 /* Configure A2DP profile parameters. These parameters would be used whenver firmware is indicated
1665  * of A2DP profile on bluetooth ( via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID).
1666  * Configuration of BTCOEX_A2DP_CONFIG data structure are common configuration and applies to
1667  * ps-poll mode and opt mode.
1668  * Ps-poll Mode - Station is in power-save and retrieves downlink data between a2dp data bursts.
1669  * Opt Mode - station is in power save during a2dp bursts and awake in the gaps.
1670  * BTCOEX_PSPOLLMODE_A2DP_CONFIG - Configuration applied only during ps-poll mode.
1671  * BTCOEX_OPTMODE_A2DP_CONFIG - Configuration applied only during opt mode.
1672  */
1673
1674 #define WMI_A2DP_CONFIG_FLAG_ALLOW_OPTIMIZATION    (1 << 0)
1675 #define WMI_A2DP_CONFIG_FLAG_IS_EDR_CAPABLE        (1 << 1)
1676 #define WMI_A2DP_CONFIG_FLAG_IS_BT_ROLE_MASTER     (1 << 2)
1677 #define WMI_A2DP_CONFIG_FLAG_IS_A2DP_HIGH_PRI      (1 << 3)
1678 #define WMI_A2DP_CONFIG_FLAG_FIND_BT_ROLE          (1 << 4)
1679
1680 typedef PREPACK struct {
1681     u32 a2dpFlags;      /* A2DP Option flags:
1682                                         bits:    meaning:
1683                                     0       Allow Close Range Optimization
1684                                 1       IS EDR capable
1685                                 2       IS Co-located Bt role Master
1686                                 3       a2dp traffic is high priority
1687                                 4       Fw detect the role of bluetooth.
1688                              */
1689         u32 linkId;         /* Applicable only to STE-BT - not used */
1690
1691 }POSTPACK BTCOEX_A2DP_CONFIG;
1692
1693 typedef PREPACK struct {
1694     u32 a2dpWlanMaxDur; /* MAX time firmware uses the medium for
1695                                         wlan, after it identifies the idle time
1696                                 default (30 msecs) */
1697
1698     u32 a2dpMinBurstCnt;   /* Minimum number of bluetooth data frames
1699                                                 to replenish Wlan Usage  limit (default 3) */
1700
1701     u32 a2dpDataRespTimeout; /* Max duration firmware waits for downlink
1702                                      by stomping on  bluetooth
1703                                      after ps-poll is acknowledged.
1704                                      default = 20 ms
1705                                    */
1706 }POSTPACK BTCOEX_PSPOLLMODE_A2DP_CONFIG;
1707
1708 typedef PREPACK struct {
1709         u32 a2dpMinlowRateMbps;  /* Low rate threshold */
1710
1711         u32 a2dpLowRateCnt;    /* number of low rate pkts (< a2dpMinlowRateMbps) allowed in 100 ms.
1712                                    If exceeded switch/stay to ps-poll mode, lower stay in opt mode.
1713                                    default = 36
1714                                  */
1715
1716         u32 a2dpHighPktRatio;   /*(Total Rx pkts in 100 ms + 1)/
1717                                   ((Total tx pkts in 100 ms - No of high rate pkts in 100 ms) + 1) in 100 ms,
1718                                   if exceeded switch/stay in opt mode and if lower switch/stay in  pspoll mode.
1719                                   default = 5 (80% of high rates)
1720                                  */
1721
1722         u32 a2dpMaxAggrSize;    /* Max number of Rx subframes allowed in this mode. (Firmware re-negogiates
1723                                    max number of aggregates if it was negogiated to higher value
1724                                    default = 1
1725                                   Recommended value Basic rate headsets = 1, EDR (2-EV3)  =8.
1726                                  */
1727         u32 a2dpPktStompCnt;    /*number of a2dp pkts that can be stomped per burst.
1728                                    default = 6*/
1729
1730 }POSTPACK BTCOEX_OPTMODE_A2DP_CONFIG;
1731
1732 typedef PREPACK struct {
1733         BTCOEX_A2DP_CONFIG a2dpConfig;
1734         BTCOEX_PSPOLLMODE_A2DP_CONFIG a2dppspollConfig;
1735         BTCOEX_OPTMODE_A2DP_CONFIG a2dpOptConfig;
1736 }POSTPACK WMI_SET_BTCOEX_A2DP_CONFIG_CMD;
1737
1738 /*------------ WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID---------------------*/
1739 /* Configure non-A2dp ACL profile parameters.The starts of ACL profile can either be
1740  * indicated via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID orenabled via firmware detection
1741  *  which is configured via "aclCoexFlags".
1742  * Configration of BTCOEX_ACLCOEX_CONFIG data structure are common configuration and applies
1743  * ps-poll mode and opt mode.
1744  * Ps-poll Mode - Station is in power-save and retrieves downlink data during wlan medium.
1745  * Opt Mode - station is in power save during bluetooth medium time and awake during wlan duration.
1746  *             (Not implemented yet)
1747  *
1748  * BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG - Configuration applied only during ps-poll mode.
1749  * BTCOEX_OPTMODE_ACLCOEX_CONFIG - Configuration applied only during opt mode.
1750  */
1751
1752 #define WMI_ACLCOEX_FLAGS_ALLOW_OPTIMIZATION   (1 << 0)
1753 #define WMI_ACLCOEX_FLAGS_DISABLE_FW_DETECTION (1 << 1)
1754
1755 typedef PREPACK struct {
1756     u32 aclWlanMediumDur;           /* Wlan usage time during Acl (non-a2dp)
1757                                                         coexistence (default 30 msecs)
1758                                     */
1759
1760     u32 aclBtMediumDur;            /* Bt usage time during acl coexistence
1761                                                              (default 30 msecs)
1762                                    */
1763
1764         u32 aclDetectTimeout;      /* BT activity observation time limit.
1765                                                                           In this time duration, number of bt pkts are counted.
1766                                                                           If the Cnt reaches "aclPktCntLowerLimit" value
1767                                                                           for "aclIterToEnableCoex" iteration continuously,
1768                                                                           firmware gets into ACL coexistence mode.
1769                                                                           Similarly, if bt traffic count during ACL coexistence
1770                                                                           has not reached "aclPktCntLowerLimit" continuously
1771                                                                           for "aclIterToEnableCoex", then ACL coexistence is
1772                                                                           disabled.
1773                                                                   -default 100 msecs
1774                                     */
1775
1776          u32 aclPktCntLowerLimit;   /* Acl Pkt Cnt to be received in duration of
1777                                                                                 "aclDetectTimeout" for
1778                                                                                 "aclIterForEnDis" times to enabling ACL coex.
1779                                         Similar logic is used to disable acl coexistence.
1780                                         (If "aclPktCntLowerLimit"  cnt of acl pkts
1781                                          are not seen by the for "aclIterForEnDis"
1782                                          then acl coexistence is disabled).
1783                                         default = 10
1784                                    */
1785
1786          u32 aclIterForEnDis;      /* number of Iteration of "aclPktCntLowerLimit" for Enabling and
1787                                        Disabling Acl Coexistence.
1788                                        default = 3
1789                                      */
1790
1791          u32 aclPktCntUpperLimit; /* This is upperBound limit, if there is more than
1792                                                                           "aclPktCntUpperLimit" seen in "aclDetectTimeout",
1793                                                                           ACL coexistence is enabled right away.
1794                                                                           - default 15*/
1795
1796         u32 aclCoexFlags;                       /* A2DP Option flags:
1797                                                   bits:    meaning:
1798                                           0       Allow Close Range Optimization
1799                                           1       disable Firmware detection
1800                                       (Currently supported configuration is aclCoexFlags =0)
1801                                                 */
1802         u32 linkId;                /* Applicable only for STE-BT - not used */
1803
1804 }POSTPACK BTCOEX_ACLCOEX_CONFIG;
1805
1806 typedef PREPACK struct {
1807     u32 aclDataRespTimeout;   /* Max duration firmware waits for downlink
1808                                       by stomping on  bluetooth
1809                                       after ps-poll is acknowledged.
1810                                      default = 20 ms */
1811
1812 }POSTPACK BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG;
1813
1814
1815 /* Not implemented yet*/
1816 typedef PREPACK struct {
1817         u32 aclCoexMinlowRateMbps;
1818         u32 aclCoexLowRateCnt;
1819         u32 aclCoexHighPktRatio;
1820         u32 aclCoexMaxAggrSize;
1821         u32 aclPktStompCnt;
1822 }POSTPACK BTCOEX_OPTMODE_ACLCOEX_CONFIG;
1823
1824 typedef PREPACK struct {
1825         BTCOEX_ACLCOEX_CONFIG aclCoexConfig;
1826         BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG aclCoexPspollConfig;
1827         BTCOEX_OPTMODE_ACLCOEX_CONFIG aclCoexOptConfig;
1828 }POSTPACK WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD;
1829
1830 /* -----------WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID ------------------*/
1831 typedef enum {
1832         WMI_BTCOEX_BT_PROFILE_SCO =1,
1833         WMI_BTCOEX_BT_PROFILE_A2DP,
1834         WMI_BTCOEX_BT_PROFILE_INQUIRY_PAGE,
1835         WMI_BTCOEX_BT_PROFILE_ACLCOEX,
1836 }WMI_BTCOEX_BT_PROFILE;
1837
1838 typedef PREPACK struct {
1839         u32 btProfileType;
1840         u32 btOperatingStatus;
1841         u32 btLinkId;
1842 }WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD;
1843
1844 /*--------------------- WMI_SET_BTCOEX_DEBUG_CMDID ---------------------*/
1845 /* Used for firmware development and debugging */
1846 typedef PREPACK struct {
1847         u32 btcoexDbgParam1;
1848         u32 btcoexDbgParam2;
1849         u32 btcoexDbgParam3;
1850         u32 btcoexDbgParam4;
1851         u32 btcoexDbgParam5;
1852 }WMI_SET_BTCOEX_DEBUG_CMD;
1853
1854 /*---------------------WMI_GET_BTCOEX_CONFIG_CMDID --------------------- */
1855 /* Command to firmware to get configuration parameters of the bt profile
1856  * reported via WMI_BTCOEX_CONFIG_EVENTID */
1857 typedef PREPACK struct {
1858         u32 btProfileType; /* 1 - SCO
1859                                2 - A2DP
1860                                3 - INQUIRY_PAGE
1861                                4 - ACLCOEX
1862                             */
1863         u32 linkId;    /* not used */
1864 }WMI_GET_BTCOEX_CONFIG_CMD;
1865
1866 /*------------------WMI_REPORT_BTCOEX_CONFIG_EVENTID------------------- */
1867 /* Event from firmware to host, sent in response to WMI_GET_BTCOEX_CONFIG_CMDID
1868  * */
1869 typedef PREPACK struct {
1870         u32 btProfileType;
1871         u32 linkId; /* not used */
1872         PREPACK union {
1873                 WMI_SET_BTCOEX_SCO_CONFIG_CMD scoConfigCmd;
1874                 WMI_SET_BTCOEX_A2DP_CONFIG_CMD a2dpConfigCmd;
1875                 WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD aclcoexConfig;
1876         WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD btinquiryPageConfigCmd;
1877     } POSTPACK info;
1878 } POSTPACK WMI_BTCOEX_CONFIG_EVENT;
1879
1880 /*------------- WMI_REPORT_BTCOEX_BTCOEX_STATS_EVENTID--------------------*/
1881 /* Used for firmware development and debugging*/
1882 typedef PREPACK struct {
1883         u32 highRatePktCnt;
1884         u32 firstBmissCnt;
1885         u32 psPollFailureCnt;
1886         u32 nullFrameFailureCnt;
1887         u32 optModeTransitionCnt;
1888 }BTCOEX_GENERAL_STATS;
1889
1890 typedef PREPACK struct {
1891         u32 scoStompCntAvg;
1892         u32 scoStompIn100ms;
1893         u32 scoMaxContStomp;
1894         u32 scoAvgNoRetries;
1895         u32 scoMaxNoRetriesIn100ms;
1896 }BTCOEX_SCO_STATS;
1897
1898 typedef PREPACK struct {
1899         u32 a2dpBurstCnt;
1900         u32 a2dpMaxBurstCnt;
1901         u32 a2dpAvgIdletimeIn100ms;
1902         u32 a2dpAvgStompCnt;
1903 }BTCOEX_A2DP_STATS;
1904
1905 typedef PREPACK struct {
1906         u32 aclPktCntInBtTime;
1907         u32 aclStompCntInWlanTime;
1908         u32 aclPktCntIn100ms;
1909 }BTCOEX_ACLCOEX_STATS;
1910
1911 typedef PREPACK struct {
1912         BTCOEX_GENERAL_STATS coexStats;
1913         BTCOEX_SCO_STATS scoStats;
1914         BTCOEX_A2DP_STATS a2dpStats;
1915         BTCOEX_ACLCOEX_STATS aclCoexStats;
1916 }WMI_BTCOEX_STATS_EVENT;
1917
1918
1919 /*--------------------------END OF BTCOEX -------------------------------------*/
1920 typedef PREPACK struct {
1921     u32 sleepState;
1922 }WMI_REPORT_SLEEP_STATE_EVENT;
1923
1924 typedef enum {
1925     WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP =0,
1926     WMI_REPORT_SLEEP_STATUS_IS_AWAKE
1927 } WMI_REPORT_SLEEP_STATUS;
1928 typedef enum {
1929     DISCONN_EVT_IN_RECONN = 0,  /* default */
1930     NO_DISCONN_EVT_IN_RECONN
1931 } TARGET_EVENT_REPORT_CONFIG;
1932
1933 typedef PREPACK struct {
1934     u32 evtConfig;
1935 } POSTPACK WMI_SET_TARGET_EVENT_REPORT_CMD;
1936
1937
1938 typedef PREPACK struct {
1939     u16 cmd_buf_sz;     /* HCI cmd buffer size */
1940     u8 buf[1];         /* Absolute HCI cmd */
1941 } POSTPACK WMI_HCI_CMD;
1942
1943 /*
1944  * Command Replies
1945  */
1946
1947 /*
1948  * WMI_GET_CHANNEL_LIST_CMDID reply
1949  */
1950 typedef PREPACK struct {
1951     u8 reserved1;
1952     u8 numChannels;            /* number of channels in reply */
1953     u16 channelList[1];         /* channel in Mhz */
1954 } POSTPACK WMI_CHANNEL_LIST_REPLY;
1955
1956 typedef enum {
1957     A_SUCCEEDED = 0,
1958     A_FAILED_DELETE_STREAM_DOESNOT_EXIST=250,
1959     A_SUCCEEDED_MODIFY_STREAM=251,
1960     A_FAILED_INVALID_STREAM = 252,
1961     A_FAILED_MAX_THINSTREAMS = 253,
1962     A_FAILED_CREATE_REMOVE_PSTREAM_FIRST = 254,
1963 } PSTREAM_REPLY_STATUS;
1964
1965 typedef PREPACK struct {
1966     u8 status;                 /* PSTREAM_REPLY_STATUS */
1967     u8 txQueueNumber;
1968     u8 rxQueueNumber;
1969     u8 trafficClass;
1970     u8 trafficDirection;       /* DIR_TYPE */
1971 } POSTPACK WMI_CRE_PRIORITY_STREAM_REPLY;
1972
1973 typedef PREPACK struct {
1974     u8 status;                 /* PSTREAM_REPLY_STATUS */
1975     u8 txQueueNumber;
1976     u8 rxQueueNumber;
1977     u8 trafficDirection;       /* DIR_TYPE */
1978     u8 trafficClass;
1979 } POSTPACK WMI_DEL_PRIORITY_STREAM_REPLY;
1980
1981 /*
1982  * List of Events (target to host)
1983  */
1984 typedef enum {
1985     WMI_READY_EVENTID           = 0x1001,
1986     WMI_CONNECT_EVENTID,
1987     WMI_DISCONNECT_EVENTID,
1988     WMI_BSSINFO_EVENTID,
1989     WMI_CMDERROR_EVENTID,
1990     WMI_REGDOMAIN_EVENTID,
1991     WMI_PSTREAM_TIMEOUT_EVENTID,
1992     WMI_NEIGHBOR_REPORT_EVENTID,
1993     WMI_TKIP_MICERR_EVENTID,
1994     WMI_SCAN_COMPLETE_EVENTID,           /* 0x100a */
1995     WMI_REPORT_STATISTICS_EVENTID,
1996     WMI_RSSI_THRESHOLD_EVENTID,
1997     WMI_ERROR_REPORT_EVENTID,
1998     WMI_OPT_RX_FRAME_EVENTID,
1999     WMI_REPORT_ROAM_TBL_EVENTID,
2000     WMI_EXTENSION_EVENTID,
2001     WMI_CAC_EVENTID,
2002     WMI_SNR_THRESHOLD_EVENTID,
2003     WMI_LQ_THRESHOLD_EVENTID,
2004     WMI_TX_RETRY_ERR_EVENTID,            /* 0x1014 */
2005     WMI_REPORT_ROAM_DATA_EVENTID,
2006     WMI_TEST_EVENTID,
2007     WMI_APLIST_EVENTID,
2008     WMI_GET_WOW_LIST_EVENTID,
2009     WMI_GET_PMKID_LIST_EVENTID,
2010     WMI_CHANNEL_CHANGE_EVENTID,
2011     WMI_PEER_NODE_EVENTID,
2012     WMI_PSPOLL_EVENTID,
2013     WMI_DTIMEXPIRY_EVENTID,
2014     WMI_WLAN_VERSION_EVENTID,
2015     WMI_SET_PARAMS_REPLY_EVENTID,
2016     WMI_ADDBA_REQ_EVENTID,              /*0x1020 */
2017     WMI_ADDBA_RESP_EVENTID,
2018     WMI_DELBA_REQ_EVENTID,
2019     WMI_TX_COMPLETE_EVENTID,
2020     WMI_HCI_EVENT_EVENTID,
2021     WMI_ACL_DATA_EVENTID,
2022     WMI_REPORT_SLEEP_STATE_EVENTID,
2023 #ifdef WAPI_ENABLE
2024     WMI_WAPI_REKEY_EVENTID,
2025 #endif
2026     WMI_REPORT_BTCOEX_STATS_EVENTID,
2027     WMI_REPORT_BTCOEX_CONFIG_EVENTID,
2028         WMI_GET_PMK_EVENTID,
2029
2030         /* DFS Events */
2031         WMI_DFS_HOST_ATTACH_EVENTID,
2032         WMI_DFS_HOST_INIT_EVENTID,
2033         WMI_DFS_RESET_DELAYLINES_EVENTID,
2034         WMI_DFS_RESET_RADARQ_EVENTID,
2035         WMI_DFS_RESET_AR_EVENTID,
2036         WMI_DFS_RESET_ARQ_EVENTID,
2037         WMI_DFS_SET_DUR_MULTIPLIER_EVENTID,
2038         WMI_DFS_SET_BANGRADAR_EVENTID,
2039         WMI_DFS_SET_DEBUGLEVEL_EVENTID,
2040         WMI_DFS_PHYERR_EVENTID,
2041         /* CCX Evants */
2042         WMI_CCX_RM_STATUS_EVENTID,
2043
2044         /* P2P Events */
2045         WMI_P2P_GO_NEG_RESULT_EVENTID,
2046
2047         WMI_WAC_SCAN_DONE_EVENTID,
2048         WMI_WAC_REPORT_BSS_EVENTID,
2049         WMI_WAC_START_WPS_EVENTID,
2050         WMI_WAC_CTRL_REQ_REPLY_EVENTID,
2051
2052         /* RFKILL Events */
2053         WMI_RFKILL_STATE_CHANGE_EVENTID,
2054         WMI_RFKILL_GET_MODE_CMD_EVENTID,
2055         WMI_THIN_RESERVED_START_EVENTID = 0x8000,
2056
2057         /*
2058          * Events in this range are reserved for thinmode
2059          * See wmi_thin.h for actual definitions
2060          */
2061         WMI_THIN_RESERVED_END_EVENTID = 0x8fff,
2062
2063         WMI_SET_CHANNEL_EVENTID,
2064         WMI_ASSOC_REQ_EVENTID,
2065
2066         /* generic ACS event */
2067         WMI_ACS_EVENTID,
2068         WMI_REPORT_WMM_PARAMS_EVENTID
2069 } WMI_EVENT_ID;
2070
2071
2072 typedef enum {
2073     WMI_11A_CAPABILITY   = 1,
2074     WMI_11G_CAPABILITY   = 2,
2075     WMI_11AG_CAPABILITY  = 3,
2076     WMI_11NA_CAPABILITY  = 4,
2077     WMI_11NG_CAPABILITY  = 5,
2078     WMI_11NAG_CAPABILITY = 6,
2079     // END CAPABILITY
2080     WMI_11N_CAPABILITY_OFFSET = (WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY),
2081 } WMI_PHY_CAPABILITY;
2082
2083 typedef PREPACK struct {
2084     u8 macaddr[ATH_MAC_LEN];
2085     u8 phyCapability;              /* WMI_PHY_CAPABILITY */
2086 } POSTPACK WMI_READY_EVENT_1;
2087
2088 typedef PREPACK struct {
2089     u32 sw_version;
2090     u32 abi_version;
2091     u8 macaddr[ATH_MAC_LEN];
2092     u8 phyCapability;              /* WMI_PHY_CAPABILITY */
2093 } POSTPACK WMI_READY_EVENT_2;
2094
2095 #if defined(ATH_TARGET)
2096 #ifdef AR6002_REV2
2097 #define WMI_READY_EVENT WMI_READY_EVENT_1  /* AR6002_REV2 target code */
2098 #else
2099 #define WMI_READY_EVENT WMI_READY_EVENT_2  /* AR6001, AR6002_REV4, AR6002_REV5 */
2100 #endif
2101 #else
2102 #define WMI_READY_EVENT WMI_READY_EVENT_2 /* host code */
2103 #endif
2104
2105
2106 /*
2107  * Connect Event
2108  */
2109 typedef PREPACK struct {
2110     u16 channel;
2111     u8 bssid[ATH_MAC_LEN];
2112     u16 listenInterval;
2113     u16 beaconInterval;
2114     u32 networkType;
2115     u8 beaconIeLen;
2116     u8 assocReqLen;
2117     u8 assocRespLen;
2118     u8 assocInfo[1];
2119 } POSTPACK WMI_CONNECT_EVENT;
2120
2121 /*
2122  * Disconnect Event
2123  */
2124 typedef enum {
2125     NO_NETWORK_AVAIL   = 0x01,
2126     LOST_LINK          = 0x02,     /* bmiss */
2127     DISCONNECT_CMD     = 0x03,
2128     BSS_DISCONNECTED   = 0x04,
2129     AUTH_FAILED        = 0x05,
2130     ASSOC_FAILED       = 0x06,
2131     NO_RESOURCES_AVAIL = 0x07,
2132     CSERV_DISCONNECT   = 0x08,
2133     INVALID_PROFILE    = 0x0a,
2134     DOT11H_CHANNEL_SWITCH = 0x0b,
2135     PROFILE_MISMATCH   = 0x0c,
2136     CONNECTION_EVICTED = 0x0d,
2137     IBSS_MERGE         = 0xe,
2138 } WMI_DISCONNECT_REASON;
2139
2140 typedef PREPACK struct {
2141     u16 protocolReasonStatus;  /* reason code, see 802.11 spec. */
2142     u8 bssid[ATH_MAC_LEN];    /* set if known */
2143     u8 disconnectReason ;      /* see WMI_DISCONNECT_REASON */
2144     u8 assocRespLen;
2145     u8 assocInfo[1];
2146 } POSTPACK WMI_DISCONNECT_EVENT;
2147
2148 /*
2149  * BSS Info Event.
2150  * Mechanism used to inform host of the presence and characteristic of
2151  * wireless networks present.  Consists of bss info header followed by
2152  * the beacon or probe-response frame body.  The 802.11 header is not included.
2153  */
2154 typedef enum {
2155     BEACON_FTYPE = 0x1,
2156     PROBERESP_FTYPE,
2157     ACTION_MGMT_FTYPE,
2158     PROBEREQ_FTYPE,
2159 } WMI_BI_FTYPE;
2160
2161 enum {
2162     BSS_ELEMID_CHANSWITCH = 0x01,
2163     BSS_ELEMID_ATHEROS = 0x02,
2164 };
2165
2166 typedef PREPACK struct {
2167     u16 channel;
2168     u8 frameType;          /* see WMI_BI_FTYPE */
2169     u8 snr;
2170     s16 rssi;
2171     u8 bssid[ATH_MAC_LEN];
2172     u32 ieMask;
2173 } POSTPACK WMI_BSS_INFO_HDR;
2174
2175 /*
2176  * BSS INFO HDR version 2.0
2177  * With 6 bytes HTC header and 6 bytes of WMI header
2178  * WMI_BSS_INFO_HDR cannot be accommodated in the removed 802.11 management
2179  * header space.
2180  * - Reduce the ieMask to 2 bytes as only two bit flags are used
2181  * - Remove rssi and compute it on the host. rssi = snr - 95
2182  */
2183 typedef PREPACK struct {
2184     u16 channel;
2185     u8 frameType;          /* see WMI_BI_FTYPE */
2186     u8 snr;
2187     u8 bssid[ATH_MAC_LEN];
2188     u16 ieMask;
2189 } POSTPACK WMI_BSS_INFO_HDR2;
2190
2191 /*
2192  * Command Error Event
2193  */
2194 typedef enum {
2195     INVALID_PARAM  = 0x01,
2196     ILLEGAL_STATE  = 0x02,
2197     INTERNAL_ERROR = 0x03,
2198 } WMI_ERROR_CODE;
2199
2200 typedef PREPACK struct {
2201     u16 commandId;
2202     u8 errorCode;
2203 } POSTPACK WMI_CMD_ERROR_EVENT;
2204
2205 /*
2206  * New Regulatory Domain Event
2207  */
2208 typedef PREPACK struct {
2209     u32 regDomain;
2210 } POSTPACK WMI_REG_DOMAIN_EVENT;
2211
2212 typedef PREPACK struct {
2213     u8 txQueueNumber;
2214     u8 rxQueueNumber;
2215     u8 trafficDirection;
2216     u8 trafficClass;
2217 } POSTPACK WMI_PSTREAM_TIMEOUT_EVENT;
2218
2219 typedef PREPACK struct {
2220     u8 reserve1;
2221     u8 reserve2;
2222     u8 reserve3;
2223     u8 trafficClass;
2224 } POSTPACK WMI_ACM_REJECT_EVENT;
2225
2226 /*
2227  * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
2228  * the host of BSS's it has found that matches the current profile.
2229  * It can be used by the host to cache PMKs and/to initiate pre-authentication
2230  * if the BSS supports it.  The first bssid is always the current associated
2231  * BSS.
2232  * The bssid and bssFlags information repeats according to the number
2233  * or APs reported.
2234  */
2235 typedef enum {
2236     WMI_DEFAULT_BSS_FLAGS   = 0x00,
2237     WMI_PREAUTH_CAPABLE_BSS = 0x01,
2238     WMI_PMKID_VALID_BSS     = 0x02,
2239 } WMI_BSS_FLAGS;
2240
2241 typedef PREPACK struct {
2242     u8 bssid[ATH_MAC_LEN];
2243     u8 bssFlags;            /* see WMI_BSS_FLAGS */
2244 } POSTPACK WMI_NEIGHBOR_INFO;
2245
2246 typedef PREPACK struct {
2247     s8 numberOfAps;
2248     WMI_NEIGHBOR_INFO neighbor[1];
2249 } POSTPACK WMI_NEIGHBOR_REPORT_EVENT;
2250
2251 /*
2252  * TKIP MIC Error Event
2253  */
2254 typedef PREPACK struct {
2255     u8 keyid;
2256     u8 ismcast;
2257 } POSTPACK WMI_TKIP_MICERR_EVENT;
2258
2259 /*
2260  * WMI_SCAN_COMPLETE_EVENTID - no parameters (old), staus parameter (new)
2261  */
2262 typedef PREPACK struct {
2263     s32 status;
2264 } POSTPACK WMI_SCAN_COMPLETE_EVENT;
2265
2266 #define MAX_OPT_DATA_LEN 1400
2267
2268 /*
2269  * WMI_SET_ADHOC_BSSID_CMDID
2270  */
2271 typedef PREPACK struct {
2272     u8 bssid[ATH_MAC_LEN];
2273 } POSTPACK WMI_SET_ADHOC_BSSID_CMD;
2274
2275 /*
2276  * WMI_SET_OPT_MODE_CMDID
2277  */
2278 typedef enum {
2279     SPECIAL_OFF,
2280     SPECIAL_ON,
2281 } OPT_MODE_TYPE;
2282
2283 typedef PREPACK struct {
2284     u8 optMode;
2285 } POSTPACK WMI_SET_OPT_MODE_CMD;
2286
2287 /*
2288  * WMI_TX_OPT_FRAME_CMDID
2289  */
2290 typedef enum {
2291     OPT_PROBE_REQ   = 0x01,
2292     OPT_PROBE_RESP  = 0x02,
2293     OPT_CPPP_START  = 0x03,
2294     OPT_CPPP_STOP   = 0x04,
2295 } WMI_OPT_FTYPE;
2296
2297 typedef PREPACK struct {
2298     u16 optIEDataLen;
2299     u8 frmType;
2300     u8 dstAddr[ATH_MAC_LEN];
2301     u8 bssid[ATH_MAC_LEN];
2302     u8 reserved;               /* For alignment */
2303     u8 optIEData[1];
2304 } POSTPACK WMI_OPT_TX_FRAME_CMD;
2305
2306 /*
2307  * Special frame receive Event.
2308  * Mechanism used to inform host of the receiption of the special frames.
2309  * Consists of special frame info header followed by special frame body.
2310  * The 802.11 header is not included.
2311  */
2312 typedef PREPACK struct {
2313     u16 channel;
2314     u8 frameType;          /* see WMI_OPT_FTYPE */
2315     s8 snr;
2316     u8 srcAddr[ATH_MAC_LEN];
2317     u8 bssid[ATH_MAC_LEN];
2318 } POSTPACK WMI_OPT_RX_INFO_HDR;
2319
2320 /*
2321  * Reporting statistics.
2322  */
2323 typedef PREPACK struct {
2324     u32 tx_packets;
2325     u32 tx_bytes;
2326     u32 tx_unicast_pkts;
2327     u32 tx_unicast_bytes;
2328     u32 tx_multicast_pkts;
2329     u32 tx_multicast_bytes;
2330     u32 tx_broadcast_pkts;
2331     u32 tx_broadcast_bytes;
2332     u32 tx_rts_success_cnt;
2333     u32 tx_packet_per_ac[4];
2334     u32 tx_errors_per_ac[4];
2335
2336     u32 tx_errors;
2337     u32 tx_failed_cnt;
2338     u32 tx_retry_cnt;
2339     u32 tx_mult_retry_cnt;
2340     u32 tx_rts_fail_cnt;
2341     s32 tx_unicast_rate;
2342 }POSTPACK tx_stats_t;
2343
2344 typedef PREPACK struct {
2345     u32 rx_packets;
2346     u32 rx_bytes;
2347     u32 rx_unicast_pkts;
2348     u32 rx_unicast_bytes;
2349     u32 rx_multicast_pkts;
2350     u32 rx_multicast_bytes;
2351     u32 rx_broadcast_pkts;
2352     u32 rx_broadcast_bytes;
2353     u32 rx_fragment_pkt;
2354
2355     u32 rx_errors;
2356     u32 rx_crcerr;
2357     u32 rx_key_cache_miss;
2358     u32 rx_decrypt_err;
2359     u32 rx_duplicate_frames;
2360     s32 rx_unicast_rate;
2361 }POSTPACK rx_stats_t;
2362
2363 typedef PREPACK struct {
2364     u32 tkip_local_mic_failure;
2365     u32 tkip_counter_measures_invoked;
2366     u32 tkip_replays;
2367     u32 tkip_format_errors;
2368     u32 ccmp_format_errors;
2369     u32 ccmp_replays;
2370 }POSTPACK tkip_ccmp_stats_t;
2371
2372 typedef PREPACK struct {
2373     u32 power_save_failure_cnt;
2374     u16 stop_tx_failure_cnt;
2375     u16 atim_tx_failure_cnt;
2376     u16 atim_rx_failure_cnt;
2377     u16 bcn_rx_failure_cnt;
2378 }POSTPACK pm_stats_t;
2379
2380 typedef PREPACK struct {
2381     u32 cs_bmiss_cnt;
2382     u32 cs_lowRssi_cnt;
2383     u16 cs_connect_cnt;
2384     u16 cs_disconnect_cnt;
2385     s16 cs_aveBeacon_rssi;
2386     u16 cs_roam_count;
2387     s16 cs_rssi;
2388     u8 cs_snr;
2389     u8 cs_aveBeacon_snr;
2390     u8 cs_lastRoam_msec;
2391 } POSTPACK cserv_stats_t;
2392
2393 typedef PREPACK struct {
2394     tx_stats_t          tx_stats;
2395     rx_stats_t          rx_stats;
2396     tkip_ccmp_stats_t   tkipCcmpStats;
2397 }POSTPACK wlan_net_stats_t;
2398
2399 typedef PREPACK struct {
2400     u32 arp_received;
2401     u32 arp_matched;
2402     u32 arp_replied;
2403 } POSTPACK arp_stats_t;
2404
2405 typedef PREPACK struct {
2406     u32 wow_num_pkts_dropped;
2407     u16 wow_num_events_discarded;
2408     u8 wow_num_host_pkt_wakeups;
2409     u8 wow_num_host_event_wakeups;
2410 } POSTPACK wlan_wow_stats_t;
2411
2412 typedef PREPACK struct {
2413     u32 lqVal;
2414     s32 noise_floor_calibation;
2415     pm_stats_t          pmStats;
2416     wlan_net_stats_t    txrxStats;
2417     wlan_wow_stats_t    wowStats;
2418     arp_stats_t         arpStats;
2419     cserv_stats_t       cservStats;
2420 } POSTPACK WMI_TARGET_STATS;
2421
2422 /*
2423  * WMI_RSSI_THRESHOLD_EVENTID.
2424  * Indicate the RSSI events to host. Events are indicated when we breach a
2425  * thresold value.
2426  */
2427 typedef enum{
2428     WMI_RSSI_THRESHOLD1_ABOVE = 0,
2429     WMI_RSSI_THRESHOLD2_ABOVE,
2430     WMI_RSSI_THRESHOLD3_ABOVE,
2431     WMI_RSSI_THRESHOLD4_ABOVE,
2432     WMI_RSSI_THRESHOLD5_ABOVE,
2433     WMI_RSSI_THRESHOLD6_ABOVE,
2434     WMI_RSSI_THRESHOLD1_BELOW,
2435     WMI_RSSI_THRESHOLD2_BELOW,
2436     WMI_RSSI_THRESHOLD3_BELOW,
2437     WMI_RSSI_THRESHOLD4_BELOW,
2438     WMI_RSSI_THRESHOLD5_BELOW,
2439     WMI_RSSI_THRESHOLD6_BELOW
2440 }WMI_RSSI_THRESHOLD_VAL;
2441
2442 typedef PREPACK struct {
2443     s16 rssi;
2444     u8 range;
2445 }POSTPACK WMI_RSSI_THRESHOLD_EVENT;
2446
2447 /*
2448  *  WMI_ERROR_REPORT_EVENTID
2449  */
2450 typedef enum{
2451     WMI_TARGET_PM_ERR_FAIL      = 0x00000001,
2452     WMI_TARGET_KEY_NOT_FOUND    = 0x00000002,
2453     WMI_TARGET_DECRYPTION_ERR   = 0x00000004,
2454     WMI_TARGET_BMISS            = 0x00000008,
2455     WMI_PSDISABLE_NODE_JOIN     = 0x00000010,
2456     WMI_TARGET_COM_ERR          = 0x00000020,
2457     WMI_TARGET_FATAL_ERR        = 0x00000040
2458 } WMI_TARGET_ERROR_VAL;
2459
2460 typedef PREPACK struct {
2461     u32 errorVal;
2462 }POSTPACK  WMI_TARGET_ERROR_REPORT_EVENT;
2463
2464 typedef PREPACK struct {
2465     u8 retrys;
2466 }POSTPACK  WMI_TX_RETRY_ERR_EVENT;
2467
2468 typedef enum{
2469     WMI_SNR_THRESHOLD1_ABOVE = 1,
2470     WMI_SNR_THRESHOLD1_BELOW,
2471     WMI_SNR_THRESHOLD2_ABOVE,
2472     WMI_SNR_THRESHOLD2_BELOW,
2473     WMI_SNR_THRESHOLD3_ABOVE,
2474     WMI_SNR_THRESHOLD3_BELOW,
2475     WMI_SNR_THRESHOLD4_ABOVE,
2476     WMI_SNR_THRESHOLD4_BELOW
2477 } WMI_SNR_THRESHOLD_VAL;
2478
2479 typedef PREPACK struct {
2480     u8 range;  /* WMI_SNR_THRESHOLD_VAL */
2481     u8 snr;
2482 }POSTPACK  WMI_SNR_THRESHOLD_EVENT;
2483
2484 typedef enum{
2485     WMI_LQ_THRESHOLD1_ABOVE = 1,
2486     WMI_LQ_THRESHOLD1_BELOW,
2487     WMI_LQ_THRESHOLD2_ABOVE,
2488     WMI_LQ_THRESHOLD2_BELOW,
2489     WMI_LQ_THRESHOLD3_ABOVE,
2490     WMI_LQ_THRESHOLD3_BELOW,
2491     WMI_LQ_THRESHOLD4_ABOVE,
2492     WMI_LQ_THRESHOLD4_BELOW
2493 } WMI_LQ_THRESHOLD_VAL;
2494
2495 typedef PREPACK struct {
2496     s32 lq;
2497     u8 range;  /* WMI_LQ_THRESHOLD_VAL */
2498 }POSTPACK  WMI_LQ_THRESHOLD_EVENT;
2499 /*
2500  * WMI_REPORT_ROAM_TBL_EVENTID
2501  */
2502 #define MAX_ROAM_TBL_CAND   5
2503
2504 typedef PREPACK struct {
2505     s32 roam_util;
2506     u8 bssid[ATH_MAC_LEN];
2507     s8 rssi;
2508     s8 rssidt;
2509     s8 last_rssi;
2510     s8 util;
2511     s8 bias;
2512     u8 reserved; /* For alignment */
2513 } POSTPACK WMI_BSS_ROAM_INFO;
2514
2515
2516 typedef PREPACK struct {
2517     u16 roamMode;
2518     u16 numEntries;
2519     WMI_BSS_ROAM_INFO bssRoamInfo[1];
2520 } POSTPACK WMI_TARGET_ROAM_TBL;
2521
2522 /*
2523  * WMI_HCI_EVENT_EVENTID
2524  */
2525 typedef PREPACK struct {
2526     u16 evt_buf_sz;     /* HCI event buffer size */
2527     u8 buf[1];         /* HCI  event */
2528 } POSTPACK WMI_HCI_EVENT;
2529
2530 /*
2531  *  WMI_CAC_EVENTID
2532  */
2533 typedef enum {
2534     CAC_INDICATION_ADMISSION = 0x00,
2535     CAC_INDICATION_ADMISSION_RESP = 0x01,
2536     CAC_INDICATION_DELETE = 0x02,
2537     CAC_INDICATION_NO_RESP = 0x03,
2538 }CAC_INDICATION;
2539
2540 #define WMM_TSPEC_IE_LEN   63
2541
2542 typedef PREPACK struct {
2543     u8 ac;
2544     u8 cac_indication;
2545     u8 statusCode;
2546     u8 tspecSuggestion[WMM_TSPEC_IE_LEN];
2547 }POSTPACK  WMI_CAC_EVENT;
2548
2549 /*
2550  * WMI_APLIST_EVENTID
2551  */
2552
2553 typedef enum {
2554     APLIST_VER1 = 1,
2555 } APLIST_VER;
2556
2557 typedef PREPACK struct {
2558     u8 bssid[ATH_MAC_LEN];
2559     u16 channel;
2560 } POSTPACK  WMI_AP_INFO_V1;
2561
2562 typedef PREPACK union {
2563     WMI_AP_INFO_V1  apInfoV1;
2564 } POSTPACK WMI_AP_INFO;
2565
2566 typedef PREPACK struct {
2567     u8 apListVer;
2568     u8 numAP;
2569     WMI_AP_INFO apList[1];
2570 } POSTPACK WMI_APLIST_EVENT;
2571
2572 /*
2573  * developer commands
2574  */
2575
2576 /*
2577  * WMI_SET_BITRATE_CMDID
2578  *
2579  * Get bit rate cmd uses same definition as set bit rate cmd
2580  */
2581 typedef enum {
2582     RATE_AUTO   = -1,
2583     RATE_1Mb    = 0,
2584     RATE_2Mb    = 1,
2585     RATE_5_5Mb  = 2,
2586     RATE_11Mb   = 3,
2587     RATE_6Mb    = 4,
2588     RATE_9Mb    = 5,
2589     RATE_12Mb   = 6,
2590     RATE_18Mb   = 7,
2591     RATE_24Mb   = 8,
2592     RATE_36Mb   = 9,
2593     RATE_48Mb   = 10,
2594     RATE_54Mb   = 11,
2595     RATE_MCS_0_20 = 12,
2596     RATE_MCS_1_20 = 13,
2597     RATE_MCS_2_20 = 14,
2598     RATE_MCS_3_20 = 15,
2599     RATE_MCS_4_20 = 16,
2600     RATE_MCS_5_20 = 17,
2601     RATE_MCS_6_20 = 18,
2602     RATE_MCS_7_20 = 19,
2603     RATE_MCS_0_40 = 20,
2604     RATE_MCS_1_40 = 21,
2605     RATE_MCS_2_40 = 22,
2606     RATE_MCS_3_40 = 23,
2607     RATE_MCS_4_40 = 24,
2608     RATE_MCS_5_40 = 25,
2609     RATE_MCS_6_40 = 26,
2610     RATE_MCS_7_40 = 27,
2611 } WMI_BIT_RATE;
2612
2613 typedef PREPACK struct {
2614     s8 rateIndex;          /* see WMI_BIT_RATE */
2615     s8 mgmtRateIndex;
2616     s8 ctlRateIndex;
2617 } POSTPACK WMI_BIT_RATE_CMD;
2618
2619
2620 typedef PREPACK struct {
2621     s8 rateIndex;          /* see WMI_BIT_RATE */
2622 } POSTPACK  WMI_BIT_RATE_REPLY;
2623
2624
2625 /*
2626  * WMI_SET_FIXRATES_CMDID
2627  *
2628  * Get fix rates cmd uses same definition as set fix rates cmd
2629  */
2630 #define FIX_RATE_1Mb            ((u32)0x1)
2631 #define FIX_RATE_2Mb            ((u32)0x2)
2632 #define FIX_RATE_5_5Mb          ((u32)0x4)
2633 #define FIX_RATE_11Mb           ((u32)0x8)
2634 #define FIX_RATE_6Mb            ((u32)0x10)
2635 #define FIX_RATE_9Mb            ((u32)0x20)
2636 #define FIX_RATE_12Mb           ((u32)0x40)
2637 #define FIX_RATE_18Mb           ((u32)0x80)
2638 #define FIX_RATE_24Mb           ((u32)0x100)
2639 #define FIX_RATE_36Mb           ((u32)0x200)
2640 #define FIX_RATE_48Mb           ((u32)0x400)
2641 #define FIX_RATE_54Mb           ((u32)0x800)
2642 #define FIX_RATE_MCS_0_20       ((u32)0x1000)
2643 #define FIX_RATE_MCS_1_20       ((u32)0x2000)
2644 #define FIX_RATE_MCS_2_20       ((u32)0x4000)
2645 #define FIX_RATE_MCS_3_20       ((u32)0x8000)
2646 #define FIX_RATE_MCS_4_20       ((u32)0x10000)
2647 #define FIX_RATE_MCS_5_20       ((u32)0x20000)
2648 #define FIX_RATE_MCS_6_20       ((u32)0x40000)
2649 #define FIX_RATE_MCS_7_20       ((u32)0x80000)
2650 #define FIX_RATE_MCS_0_40       ((u32)0x100000)
2651 #define FIX_RATE_MCS_1_40       ((u32)0x200000)
2652 #define FIX_RATE_MCS_2_40       ((u32)0x400000)
2653 #define FIX_RATE_MCS_3_40       ((u32)0x800000)
2654 #define FIX_RATE_MCS_4_40       ((u32)0x1000000)
2655 #define FIX_RATE_MCS_5_40       ((u32)0x2000000)
2656 #define FIX_RATE_MCS_6_40       ((u32)0x4000000)
2657 #define FIX_RATE_MCS_7_40       ((u32)0x8000000)
2658
2659 typedef PREPACK struct {
2660     u32 fixRateMask;          /* see WMI_BIT_RATE */
2661 } POSTPACK WMI_FIX_RATES_CMD, WMI_FIX_RATES_REPLY;
2662
2663 typedef PREPACK struct {
2664     u8 bEnableMask;
2665     u8 frameType;               /*type and subtype*/
2666     u32 frameRateMask;          /* see WMI_BIT_RATE */
2667 } POSTPACK WMI_FRAME_RATES_CMD, WMI_FRAME_RATES_REPLY;
2668
2669 /*
2670  * WMI_SET_RECONNECT_AUTH_MODE_CMDID
2671  *
2672  * Set authentication mode
2673  */
2674 typedef enum {
2675     RECONN_DO_AUTH = 0x00,
2676     RECONN_NOT_AUTH = 0x01
2677 } WMI_AUTH_MODE;
2678
2679 typedef PREPACK struct {
2680     u8 mode;
2681 } POSTPACK WMI_SET_AUTH_MODE_CMD;
2682
2683 /*
2684  * WMI_SET_REASSOC_MODE_CMDID
2685  *
2686  * Set authentication mode
2687  */
2688 typedef enum {
2689     REASSOC_DO_DISASSOC = 0x00,
2690     REASSOC_DONOT_DISASSOC = 0x01
2691 } WMI_REASSOC_MODE;
2692
2693 typedef PREPACK struct {
2694     u8 mode;
2695 }POSTPACK WMI_SET_REASSOC_MODE_CMD;
2696
2697 typedef enum {
2698     ROAM_DATA_TIME = 1,            /* Get The Roam Time Data */
2699 } ROAM_DATA_TYPE;
2700
2701 typedef PREPACK struct {
2702     u32 disassoc_time;
2703     u32 no_txrx_time;
2704     u32 assoc_time;
2705     u32 allow_txrx_time;
2706     u8 disassoc_bssid[ATH_MAC_LEN];
2707     s8 disassoc_bss_rssi;
2708     u8 assoc_bssid[ATH_MAC_LEN];
2709     s8 assoc_bss_rssi;
2710 } POSTPACK WMI_TARGET_ROAM_TIME;
2711
2712 typedef PREPACK struct {
2713     PREPACK union {
2714         WMI_TARGET_ROAM_TIME roamTime;
2715     } POSTPACK u;
2716     u8 roamDataType ;
2717 } POSTPACK WMI_TARGET_ROAM_DATA;
2718
2719 typedef enum {
2720     WMI_WMM_DISABLED = 0,
2721     WMI_WMM_ENABLED
2722 } WMI_WMM_STATUS;
2723
2724 typedef PREPACK struct {
2725     u8 status;
2726 }POSTPACK WMI_SET_WMM_CMD;
2727
2728 typedef PREPACK struct {
2729     u8 status;
2730 }POSTPACK WMI_SET_QOS_SUPP_CMD;
2731
2732 typedef enum {
2733     WMI_TXOP_DISABLED = 0,
2734     WMI_TXOP_ENABLED
2735 } WMI_TXOP_CFG;
2736
2737 typedef PREPACK struct {
2738     u8 txopEnable;
2739 }POSTPACK WMI_SET_WMM_TXOP_CMD;
2740
2741 typedef PREPACK struct {
2742     u8 keepaliveInterval;
2743 } POSTPACK WMI_SET_KEEPALIVE_CMD;
2744
2745 typedef PREPACK struct {
2746     u32 configured;
2747     u8 keepaliveInterval;
2748 } POSTPACK WMI_GET_KEEPALIVE_CMD;
2749
2750 /*
2751  * Add Application specified IE to a management frame
2752  */
2753 #define WMI_MAX_IE_LEN  255
2754
2755 typedef PREPACK struct {
2756     u8 mgmtFrmType;  /* one of WMI_MGMT_FRAME_TYPE */
2757     u8 ieLen;    /* Length  of the IE that should be added to the MGMT frame */
2758     u8 ieInfo[1];
2759 } POSTPACK WMI_SET_APPIE_CMD;
2760
2761 /*
2762  * Notify the WSC registration status to the target
2763  */
2764 #define WSC_REG_ACTIVE     1
2765 #define WSC_REG_INACTIVE   0
2766 /* Generic Hal Interface for setting hal paramters. */
2767 /* Add new Set HAL Param cmdIds here for newer params */
2768 typedef enum {
2769    WHAL_SETCABTO_CMDID = 1,
2770 }WHAL_CMDID;
2771
2772 typedef PREPACK struct {
2773     u8 cabTimeOut;
2774 } POSTPACK WHAL_SETCABTO_PARAM;
2775
2776 typedef PREPACK struct {
2777     u8 whalCmdId;
2778     u8 data[1];
2779 } POSTPACK WHAL_PARAMCMD;
2780
2781
2782 #define WOW_MAX_FILTER_LISTS 1 /*4*/
2783 #define WOW_MAX_FILTERS_PER_LIST 4
2784 #define WOW_PATTERN_SIZE 64
2785 #define WOW_MASK_SIZE 64
2786
2787 #define MAC_MAX_FILTERS_PER_LIST 4
2788
2789 typedef PREPACK struct {
2790     u8 wow_valid_filter;
2791     u8 wow_filter_id;
2792     u8 wow_filter_size;
2793     u8 wow_filter_offset;
2794     u8 wow_filter_mask[WOW_MASK_SIZE];
2795     u8 wow_filter_pattern[WOW_PATTERN_SIZE];
2796 } POSTPACK WOW_FILTER;
2797
2798
2799 typedef PREPACK struct {
2800     u8 wow_valid_list;
2801     u8 wow_list_id;
2802     u8 wow_num_filters;
2803     u8 wow_total_list_size;
2804     WOW_FILTER list[WOW_MAX_FILTERS_PER_LIST];
2805 } POSTPACK WOW_FILTER_LIST;
2806
2807 typedef PREPACK struct {
2808     u8 valid_filter;
2809     u8 mac_addr[ATH_MAC_LEN];
2810 } POSTPACK MAC_FILTER;
2811
2812
2813 typedef PREPACK struct {
2814     u8 total_list_size;
2815     u8 enable;
2816     MAC_FILTER list[MAC_MAX_FILTERS_PER_LIST];
2817 } POSTPACK MAC_FILTER_LIST;
2818
2819 #define MAX_IP_ADDRS  2
2820 typedef PREPACK struct {
2821     u32 ips[MAX_IP_ADDRS];  /* IP in Network Byte Order */
2822 } POSTPACK WMI_SET_IP_CMD;
2823
2824 typedef PREPACK struct {
2825     u32 awake;
2826     u32 asleep;
2827 } POSTPACK WMI_SET_HOST_SLEEP_MODE_CMD;
2828
2829 typedef enum {
2830     WOW_FILTER_SSID = 0x1
2831 } WMI_WOW_FILTER;
2832
2833 typedef PREPACK struct {
2834     u32 enable_wow;
2835     WMI_WOW_FILTER filter;
2836     u16 hostReqDelay;
2837 } POSTPACK WMI_SET_WOW_MODE_CMD;
2838
2839 typedef PREPACK struct {
2840     u8 filter_list_id;
2841 } POSTPACK WMI_GET_WOW_LIST_CMD;
2842
2843 /*
2844  * WMI_GET_WOW_LIST_CMD reply
2845  */
2846 typedef PREPACK struct {
2847     u8 num_filters;     /* number of patterns in reply */
2848     u8 this_filter_num; /*  this is filter # x of total num_filters */
2849     u8 wow_mode;
2850     u8 host_mode;
2851     WOW_FILTER  wow_filters[1];
2852 } POSTPACK WMI_GET_WOW_LIST_REPLY;
2853
2854 typedef PREPACK struct {
2855     u8 filter_list_id;
2856     u8 filter_size;
2857     u8 filter_offset;
2858     u8 filter[1];
2859 } POSTPACK WMI_ADD_WOW_PATTERN_CMD;
2860
2861 typedef PREPACK struct {
2862     u16 filter_list_id;
2863     u16 filter_id;
2864 } POSTPACK WMI_DEL_WOW_PATTERN_CMD;
2865
2866 typedef PREPACK struct {
2867     u8 macaddr[ATH_MAC_LEN];
2868 } POSTPACK WMI_SET_MAC_ADDRESS_CMD;
2869
2870 /*
2871  * WMI_SET_AKMP_PARAMS_CMD
2872  */
2873
2874 #define WMI_AKMP_MULTI_PMKID_EN   0x000001
2875
2876 typedef PREPACK struct {
2877     u32 akmpInfo;
2878 } POSTPACK WMI_SET_AKMP_PARAMS_CMD;
2879
2880 typedef PREPACK struct {
2881     u8 pmkid[WMI_PMKID_LEN];
2882 } POSTPACK WMI_PMKID;
2883
2884 /*
2885  * WMI_SET_PMKID_LIST_CMD
2886  */
2887 #define WMI_MAX_PMKID_CACHE   8
2888
2889 typedef PREPACK struct {
2890     u32 numPMKID;
2891     WMI_PMKID   pmkidList[WMI_MAX_PMKID_CACHE];
2892 } POSTPACK WMI_SET_PMKID_LIST_CMD;
2893
2894 /*
2895  * WMI_GET_PMKID_LIST_CMD  Reply
2896  * Following the Number of PMKIDs is the list of PMKIDs
2897  */
2898 typedef PREPACK struct {
2899     u32 numPMKID;
2900     u8 bssidList[ATH_MAC_LEN][1];
2901     WMI_PMKID   pmkidList[1];
2902 } POSTPACK WMI_PMKID_LIST_REPLY;
2903
2904 typedef PREPACK struct {
2905     u16 oldChannel;
2906     u32 newChannel;
2907 } POSTPACK WMI_CHANNEL_CHANGE_EVENT;
2908
2909 typedef PREPACK struct {
2910     u32 version;
2911 } POSTPACK WMI_WLAN_VERSION_EVENT;
2912
2913
2914 /* WMI_ADDBA_REQ_EVENTID */
2915 typedef PREPACK struct {
2916     u8 tid;
2917     u8 win_sz;
2918     u16 st_seq_no;
2919     u8 status;         /* f/w response for ADDBA Req; OK(0) or failure(!=0) */
2920 } POSTPACK WMI_ADDBA_REQ_EVENT;
2921
2922 /* WMI_ADDBA_RESP_EVENTID */
2923 typedef PREPACK struct {
2924     u8 tid;
2925     u8 status;         /* OK(0), failure (!=0) */
2926     u16 amsdu_sz;       /* Three values: Not supported(0), 3839, 8k */
2927 } POSTPACK WMI_ADDBA_RESP_EVENT;
2928
2929 /* WMI_DELBA_EVENTID
2930  * f/w received a DELBA for peer and processed it.
2931  * Host is notified of this
2932  */
2933 typedef PREPACK struct {
2934     u8 tid;
2935     u8 is_peer_initiator;
2936     u16 reason_code;
2937 } POSTPACK WMI_DELBA_EVENT;
2938
2939
2940 #ifdef WAPI_ENABLE
2941 #define WAPI_REKEY_UCAST    1
2942 #define WAPI_REKEY_MCAST    2
2943 typedef PREPACK struct {
2944     u8 type;
2945     u8 macAddr[ATH_MAC_LEN];
2946 } POSTPACK WMI_WAPIREKEY_EVENT;
2947 #endif
2948
2949
2950 /* WMI_ALLOW_AGGR_CMDID
2951  * Configures tid's to allow ADDBA negotiations
2952  * on each tid, in each direction
2953  */
2954 typedef PREPACK struct {
2955     u16 tx_allow_aggr;  /* 16-bit mask to allow uplink ADDBA negotiation - bit position indicates tid*/
2956     u16 rx_allow_aggr;  /* 16-bit mask to allow donwlink ADDBA negotiation - bit position indicates tid*/
2957 } POSTPACK WMI_ALLOW_AGGR_CMD;
2958
2959 /* WMI_ADDBA_REQ_CMDID
2960  * f/w starts performing ADDBA negotiations with peer
2961  * on the given tid
2962  */
2963 typedef PREPACK struct {
2964     u8 tid;
2965 } POSTPACK WMI_ADDBA_REQ_CMD;
2966
2967 /* WMI_DELBA_REQ_CMDID
2968  * f/w would teardown BA with peer.
2969  * is_send_initiator indicates if it's or tx or rx side
2970  */
2971 typedef PREPACK struct {
2972     u8 tid;
2973     u8 is_sender_initiator;
2974
2975 } POSTPACK WMI_DELBA_REQ_CMD;
2976
2977 #define PEER_NODE_JOIN_EVENT 0x00
2978 #define PEER_NODE_LEAVE_EVENT 0x01
2979 #define PEER_FIRST_NODE_JOIN_EVENT 0x10
2980 #define PEER_LAST_NODE_LEAVE_EVENT 0x11
2981 typedef PREPACK struct {
2982     u8 eventCode;
2983     u8 peerMacAddr[ATH_MAC_LEN];
2984 } POSTPACK WMI_PEER_NODE_EVENT;
2985
2986 #define IEEE80211_FRAME_TYPE_MGT          0x00
2987 #define IEEE80211_FRAME_TYPE_CTL          0x04
2988
2989 /*
2990  * Transmit complete event data structure(s)
2991  */
2992
2993
2994 typedef PREPACK struct {
2995 #define TX_COMPLETE_STATUS_SUCCESS 0
2996 #define TX_COMPLETE_STATUS_RETRIES 1
2997 #define TX_COMPLETE_STATUS_NOLINK  2
2998 #define TX_COMPLETE_STATUS_TIMEOUT 3
2999 #define TX_COMPLETE_STATUS_OTHER   4
3000
3001     u8 status; /* one of TX_COMPLETE_STATUS_... */
3002     u8 pktID; /* packet ID to identify parent packet */
3003     u8 rateIdx; /* rate index on successful transmission */
3004     u8 ackFailures; /* number of ACK failures in tx attempt */
3005 #if 0 /* optional params currently omitted. */
3006     u32 queueDelay; // usec delay measured Tx Start time - host delivery time
3007     u32 mediaDelay; // usec delay measured ACK rx time - host delivery time
3008 #endif
3009 } POSTPACK TX_COMPLETE_MSG_V1; /* version 1 of tx complete msg */
3010
3011 typedef PREPACK struct {
3012     u8 numMessages; /* number of tx comp msgs following this struct */
3013     u8 msgLen; /* length in bytes for each individual msg following this struct */
3014     u8 msgType; /* version of tx complete msg data following this struct */
3015     u8 reserved; /* individual messages follow this header */
3016 } POSTPACK WMI_TX_COMPLETE_EVENT;
3017
3018 #define WMI_TXCOMPLETE_VERSION_1 (0x01)
3019
3020
3021 /*
3022  * ------- AP Mode definitions --------------
3023  */
3024
3025 /*
3026  * !!! Warning !!!
3027  * -Changing the following values needs compilation of both driver and firmware
3028  */
3029 #ifdef AR6002_REV2
3030 #define AP_MAX_NUM_STA          4
3031 #else
3032 #define AP_MAX_NUM_STA          8
3033 #endif
3034 #define AP_ACL_SIZE             10
3035 #define IEEE80211_MAX_IE        256
3036 #define MCAST_AID               0xFF /* Spl. AID used to set DTIM flag in the beacons */
3037 #define DEF_AP_COUNTRY_CODE     "US "
3038 #define DEF_AP_WMODE_G          WMI_11G_MODE
3039 #define DEF_AP_WMODE_AG         WMI_11AG_MODE
3040 #define DEF_AP_DTIM             5
3041 #define DEF_BEACON_INTERVAL     100
3042
3043 /* AP mode disconnect reasons */
3044 #define AP_DISCONNECT_STA_LEFT      101
3045 #define AP_DISCONNECT_FROM_HOST     102
3046 #define AP_DISCONNECT_COMM_TIMEOUT  103
3047
3048 /*
3049  * Used with WMI_AP_HIDDEN_SSID_CMDID
3050  */
3051 #define HIDDEN_SSID_FALSE   0
3052 #define HIDDEN_SSID_TRUE    1
3053 typedef PREPACK struct {
3054     u8 hidden_ssid;
3055 } POSTPACK WMI_AP_HIDDEN_SSID_CMD;
3056
3057 /*
3058  * Used with WMI_AP_ACL_POLICY_CMDID
3059  */
3060 #define AP_ACL_DISABLE          0x00
3061 #define AP_ACL_ALLOW_MAC        0x01
3062 #define AP_ACL_DENY_MAC         0x02
3063 #define AP_ACL_RETAIN_LIST_MASK 0x80
3064 typedef PREPACK struct {
3065     u8 policy;
3066 } POSTPACK WMI_AP_ACL_POLICY_CMD;
3067
3068 /*
3069  * Used with WMI_AP_ACL_MAC_LIST_CMDID
3070  */
3071 #define ADD_MAC_ADDR    1
3072 #define DEL_MAC_ADDR    2
3073 typedef PREPACK struct {
3074     u8 action;
3075     u8 index;
3076     u8 mac[ATH_MAC_LEN];
3077     u8 wildcard;
3078 } POSTPACK WMI_AP_ACL_MAC_CMD;
3079
3080 typedef PREPACK struct {
3081     u16 index;
3082     u8 acl_mac[AP_ACL_SIZE][ATH_MAC_LEN];
3083     u8 wildcard[AP_ACL_SIZE];
3084     u8 policy;
3085 } POSTPACK WMI_AP_ACL;
3086
3087 /*
3088  * Used with WMI_AP_SET_NUM_STA_CMDID
3089  */
3090 typedef PREPACK struct {
3091     u8 num_sta;
3092 } POSTPACK WMI_AP_SET_NUM_STA_CMD;
3093
3094 /*
3095  * Used with WMI_AP_SET_MLME_CMDID
3096  */
3097 typedef PREPACK struct {
3098     u8 mac[ATH_MAC_LEN];
3099     u16 reason;              /* 802.11 reason code */
3100     u8 cmd;                 /* operation to perform */
3101 #define WMI_AP_MLME_ASSOC       1   /* associate station */
3102 #define WMI_AP_DISASSOC         2   /* disassociate station */
3103 #define WMI_AP_DEAUTH           3   /* deauthenticate station */
3104 #define WMI_AP_MLME_AUTHORIZE   4   /* authorize station */
3105 #define WMI_AP_MLME_UNAUTHORIZE 5   /* unauthorize station */
3106 } POSTPACK WMI_AP_SET_MLME_CMD;
3107
3108 typedef PREPACK struct {
3109     u32 period;
3110 } POSTPACK WMI_AP_CONN_INACT_CMD;
3111
3112 typedef PREPACK struct {
3113     u32 period_min;
3114     u32 dwell_ms;
3115 } POSTPACK WMI_AP_PROT_SCAN_TIME_CMD;
3116
3117 typedef PREPACK struct {
3118     u32 flag;
3119     u16 aid;
3120 } POSTPACK WMI_AP_SET_PVB_CMD;
3121
3122 #define WMI_DISABLE_REGULATORY_CODE "FF"
3123
3124 typedef PREPACK struct {
3125     u8 countryCode[3];
3126 } POSTPACK WMI_AP_SET_COUNTRY_CMD;
3127
3128 typedef PREPACK struct {
3129     u8 dtim;
3130 } POSTPACK WMI_AP_SET_DTIM_CMD;
3131
3132 typedef PREPACK struct {
3133     u8 band; /* specifies which band to apply these values */
3134     u8 enable; /* allows 11n to be disabled on a per band basis */
3135     u8 chan_width_40M_supported;
3136     u8 short_GI_20MHz;
3137     u8 short_GI_40MHz;
3138     u8 intolerance_40MHz;
3139     u8 max_ampdu_len_exp;
3140 } POSTPACK WMI_SET_HT_CAP_CMD;
3141
3142 typedef PREPACK struct {
3143     u8 sta_chan_width;
3144 } POSTPACK WMI_SET_HT_OP_CMD;
3145
3146 typedef PREPACK struct {
3147     u32 rateMasks[8];
3148 } POSTPACK WMI_SET_TX_SELECT_RATES_CMD;
3149
3150 typedef PREPACK struct {
3151     u32 sgiMask;
3152     u8 sgiPERThreshold;
3153 } POSTPACK WMI_SET_TX_SGI_PARAM_CMD;
3154
3155 #define DEFAULT_SGI_MASK 0x08080000
3156 #define DEFAULT_SGI_PER 10
3157
3158 typedef PREPACK struct {
3159     u32 rateField; /* 1 bit per rate corresponding to index */
3160     u8 id;
3161     u8 shortTrys;
3162     u8 longTrys;
3163     u8 reserved; /* padding */
3164 } POSTPACK WMI_SET_RATE_POLICY_CMD;
3165
3166 typedef PREPACK struct {
3167     u8 metaVersion; /* version of meta data for rx packets <0 = default> (0-7 = valid) */
3168     u8 dot11Hdr; /* 1 == leave .11 header intact , 0 == replace .11 header with .3 <default> */
3169     u8 defragOnHost; /* 1 == defragmentation is performed by host, 0 == performed by target <default> */
3170     u8 reserved[1]; /* alignment */
3171 } POSTPACK WMI_RX_FRAME_FORMAT_CMD;
3172
3173
3174 typedef PREPACK struct {
3175     u8 enable;     /* 1 == device operates in thin mode , 0 == normal mode <default> */
3176     u8 reserved[3];
3177 } POSTPACK WMI_SET_THIN_MODE_CMD;
3178
3179 /* AP mode events */
3180 /* WMI_PS_POLL_EVENT */
3181 typedef PREPACK struct {
3182     u16 aid;
3183 } POSTPACK WMI_PSPOLL_EVENT;
3184
3185 typedef PREPACK struct {
3186     u32 tx_bytes;
3187     u32 tx_pkts;
3188     u32 tx_error;
3189     u32 tx_discard;
3190     u32 rx_bytes;
3191     u32 rx_pkts;
3192     u32 rx_error;
3193     u32 rx_discard;
3194     u32 aid;
3195 } POSTPACK WMI_PER_STA_STAT;
3196
3197 #define AP_GET_STATS    0
3198 #define AP_CLEAR_STATS  1
3199
3200 typedef PREPACK struct {
3201     u32 action;
3202     WMI_PER_STA_STAT    sta[AP_MAX_NUM_STA+1];
3203 } POSTPACK WMI_AP_MODE_STAT;
3204 #define WMI_AP_MODE_STAT_SIZE(numSta) (sizeof(u32) + ((numSta + 1) * sizeof(WMI_PER_STA_STAT)))
3205
3206 #define AP_11BG_RATESET1        1
3207 #define AP_11BG_RATESET2        2
3208 #define DEF_AP_11BG_RATESET     AP_11BG_RATESET1
3209 typedef PREPACK struct {
3210     u8 rateset;
3211 } POSTPACK WMI_AP_SET_11BG_RATESET_CMD;
3212 /*
3213  * End of AP mode definitions
3214  */
3215
3216 #ifdef __cplusplus
3217 }
3218 #endif
3219
3220 #endif /* _WMI_H_ */