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