For nest-cam v350 release

Bug: 259322762
diff --git a/artagent/Android.mk b/artagent/Android.mk
new file mode 100755
index 0000000..dc09243
--- /dev/null
+++ b/artagent/Android.mk
@@ -0,0 +1,27 @@
+#-------------------------------------------------
+# Copyright (c) 2012 Qualcomm Atheros, Inc..
+# All Rights Reserved.
+# Qualcomm Atheros Confidential and Proprietary.
+#-------------------------------------------------
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := artagent
+
+LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libtcmd \
+
+LOCAL_CFLAGS+=
+
+LOCAL_SRC_FILES:= \ artagent.c
+
+LOCAL_LDLIBS += -lpthread -lrt
+
+LOCAL_MODULE_TAGS := optional eng
+
+LOCAL_SHARED_LIBRARIES += libcutils
+LOCAL_SHARED_LIBRARIES += libnl_2
+LOCAL_STATIC_LIBRARIES += libtcmd
+
+include $(BUILD_EXECUTABLE)
diff --git a/artagent/COPYING b/artagent/COPYING
new file mode 100644
index 0000000..77650bc
--- /dev/null
+++ b/artagent/COPYING
@@ -0,0 +1,13 @@
+Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/artagent/Makefile b/artagent/Makefile
new file mode 100644
index 0000000..8f4e719
--- /dev/null
+++ b/artagent/Makefile
@@ -0,0 +1,23 @@
+CC = gcc
+CFLAGS += -Wall -g
+
+PREFIX ?= /usr
+SBINDIR ?= $(PREFIX)/sbin
+INSTALL ?= install
+
+NLLIBNAME = libnl-1
+LIBTCMD_DIR := ../libtcmd
+
+#LDLIBS += -L/home/mattwagner/ambarella-a5s-sdk/packages/wireless/dist/usr/lib/libnl-3.so  -lrt -ltcmd
+override LDLIBS += -lrt -ltcmd $(shell pkg-config --libs $(NLLIBNAME)) 
+override CFLAGS += $(shell pkg-config --cflags $(NLLIBNAME)) -I$(LIBTCMD_DIR) -L$(LIBTCMD_DIR) -L../../dist/usr/lib/
+
+artagent: artagent.c artagent.h
+	$(MAKE) -C $(LIBTCMD_DIR)
+	$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
+
+install: artagent
+	install -m 755 artagent $(DESTDIR)$(SBINDIR)
+
+clean:
+	rm -f artagent
diff --git a/artagent/artagent b/artagent/artagent
new file mode 100755
index 0000000..1a0e2de
--- /dev/null
+++ b/artagent/artagent
Binary files differ
diff --git a/artagent/artagent.c b/artagent/artagent.c
new file mode 100755
index 0000000..ab1ee57
--- /dev/null
+++ b/artagent/artagent.c
@@ -0,0 +1,383 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/errno.h>
+#include <sys/socket.h>
+#include <linux/types.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <time.h>
+#include "artagent.h"
+#include "libtcmd.h"
+
+static int sid, cid, aid;
+static char ar6kifname[32];
+unsigned int readLength = 0;
+unsigned char  line[LINE_ARRAY_SIZE];
+int cmdId,cmdLen;
+
+void callback_rx(void *buf, int len)
+{
+    int length, version;
+
+     /* skip cmd id, act */
+    buf += 2 * sizeof(unsigned int);
+    unsigned char *reply = (unsigned char*)buf;
+    length = *(unsigned short *)&(reply[0]);
+    version = (unsigned char)(reply[2]);
+
+    readLength = *(unsigned int *)&(reply[4]);
+    //printf("Version %d rx length %d read Length %d\n",version,length,readLength);
+    memcpy((void*)line, (void*)&(reply[8]),readLength);
+}
+
+static int initInterface(char *ifname)
+{
+    int err = 0;
+    err = tcmd_tx_init(ifname, callback_rx);
+    return err;
+}
+
+static int wmiSend(unsigned char *cmdBuf, unsigned int len, unsigned int totalLen, unsigned char version, bool resp)
+{
+    TC_CMDS tCmd;
+    int err=0;
+
+    memset(&tCmd,0,sizeof(tCmd));
+
+    tCmd.hdr.testCmdId = TC_CMDS_ID;
+    tCmd.hdr.u.parm.length = totalLen;
+    tCmd.hdr.u.parm.version = version;
+    tCmd.hdr.u.parm.bufLen = len;   // less than 256
+    memcpy((void*)tCmd.buf, (void*)cmdBuf, len);
+
+    if ((err = tcmd_tx((char*)&tCmd, sizeof(tCmd), resp))) {
+        fprintf(stderr, "tcmd_tx had error: %s!\n", strerror(err));
+        return 0;
+    }
+
+    return 1;
+}
+
+static void cleanup(int sig)
+{
+    if (cid>=0) {
+        close(cid);
+    }
+    if (sid>=0) {
+        close(sid);
+    }
+}
+
+int sock_init(int port)
+{
+    int                sockid;
+    struct sockaddr_in myaddr;
+    socklen_t          sinsize;
+    int                i, res;
+
+    /* Create socket */
+    sockid = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (sockid == -1) {
+        perror(__FUNCTION__);
+        printf("Create socket to PC failed\n");
+        return -1;
+    }
+
+    i = 1;
+    res = setsockopt(sockid, SOL_SOCKET, SO_REUSEADDR, (char *)&i, sizeof(i));
+    if (res == -1) {
+        close(sockid);
+        return -1;
+    }
+
+    i = 1;
+    res = setsockopt(sockid, IPPROTO_TCP, TCP_NODELAY, (char *)&i, sizeof(i));
+    if (res == -1) {
+        close(sockid);
+        return -1;
+    }
+
+    myaddr.sin_family      = AF_INET;
+    myaddr.sin_port        = htons(port);
+    myaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+
+    memset(&(myaddr.sin_zero), 0, 8);
+
+    res = bind(sockid, (struct sockaddr *)&myaddr, sizeof(struct sockaddr));
+
+    if (res != 0) {
+        perror(__FUNCTION__);
+        printf("Bind failed\n");
+		close(sockid);
+        return -1;
+    }
+
+    if (listen(sockid, 4) == -1) {
+        perror(__FUNCTION__);
+        printf("Listen failed\n");
+		close(sockid);
+        return -1;
+    }
+
+    printf("Waiting for client to connect...\n");
+
+    sinsize = sizeof(struct sockaddr_in);
+    if ((cid = accept(sockid, (struct sockaddr *)&myaddr, &sinsize)) == -1) {
+        printf("Accept failed\n");
+		close(sockid);
+        return -1;
+    }
+
+    i = 1;
+    res = setsockopt(cid, IPPROTO_TCP, TCP_NODELAY, (char *)&i, sizeof(i));
+    if (res == -1) {
+        printf("cannot set NOdelay for cid\n");
+        close(sockid);
+        return -1;
+    }
+    printf("Client connected!\n");
+
+    return sockid;
+}
+
+int sock_recv(int sockid, unsigned char *buf, int buflen)
+{
+    int recvbytes;
+    recvbytes = recv(sockid, buf, buflen, 0);
+    if (recvbytes == 0) {
+        printf("Connection close!? zero bytes received\n");
+        return -1;
+    } else if (recvbytes > 0) {
+        return recvbytes;
+    }
+    return -1;
+}
+
+int sock_send(int sockid, unsigned char *buf, int bytes)
+{
+    int cnt;
+    unsigned char* bufpos = buf;
+    while (bytes) {
+        cnt = write(sockid, bufpos, bytes);
+
+        if (!cnt) {
+            break;
+        }
+        if (cnt == -1) {
+            if (errno == EINTR) {
+                continue;
+            } else {
+                return -1;
+            }
+        }
+
+        bytes -= cnt;
+        bufpos += cnt;
+    }
+    return (bufpos - buf);
+}
+
+static void print_help(char *pname)
+{
+    printf("An agent program to connect ART host and AR6K device, must be\n");
+    printf("started after AR6K device driver is installed.\n\n");
+    printf("Usage: %s ifname fragsize\n\n", pname);
+    printf("  ifname      AR6K interface name\n");
+    printf("  fragsize    Fragment size, must be multiple of 4\n\n");
+    printf("Example:\n");
+    printf("%s eth1 80\n\n", pname);
+}
+
+int main (int argc, char **argv)
+{
+    int recvbytes=0,bytesRcvd=0;
+    int chunkLen = 0;
+    unsigned char *bufpos;
+    int reducedARTPacket = 1;
+    int frag_size = 200;
+    //int i=0;
+    int port = ART_PORT;
+    bool resp = false;
+    bool firstpacket = true;
+
+    struct sigaction sa;
+
+    printf("setup signal\n");
+    memset(&sa, 0, sizeof(struct sigaction));
+
+    sa.sa_flags = SA_NOCLDSTOP;
+    sa.sa_handler = cleanup;
+
+    printf("before call sigaction\n");
+    sigaction(SIGTERM, &sa, NULL);
+    sigaction(SIGINT,  &sa, NULL);
+    sigaction(SIGHUP, &sa, NULL);
+    sigaction(SIGABRT, &sa, NULL);
+
+    cid = sid = aid = -1;
+    printf("setup ifname\n");
+    memset(ar6kifname, '\0', sizeof(ar6kifname));
+
+    if (argc == 1 ) {
+        print_help(argv[0]);
+        return -1;
+    }
+
+    if (argc > 1 ) {
+        strcpy(ar6kifname, argv[1]);
+    }
+    else {
+        strcpy(ar6kifname, "wlan0");
+    }
+
+    if (argc > 2) {
+        frag_size = atoi(argv[2]);
+    }
+
+    if (argc > 3) {
+        port = atoi(argv[3]);
+    }
+
+    if (port == 0)
+	port = ART_PORT;
+    else if (port < 0 || port >65534) {
+	printf("Invalid port number\n");
+	goto main_exit;
+    }
+
+    //NOTE: issue with bigger size on ath6kl driver..
+    if ( ((frag_size == 0) || ((frag_size % 4) != 0)) || (frag_size > 200) ) {
+        printf("Invalid fragsize, should be multiple of 4 and frag size less than 200\n");
+        goto main_exit;
+    }
+
+    if ( initInterface(ar6kifname) ) {
+        printf("Init interface cfg80211 failed\n");
+        cleanup(0);
+        return -1;
+    }
+
+    printf("open sock\n");
+    sid = sock_init(port);
+    if (sid < 0) {
+        printf("Create socket to ART failed\n");
+        cleanup(0);
+        return -1;
+    }
+
+    if ((recvbytes=sock_recv(cid, line, LINE_ARRAY_SIZE)) < 0) {
+        printf("Cannot nego packet size\n");
+        cleanup(0);
+        return -1;
+    }
+
+    printf("Get nego bytes %d\n", recvbytes);
+
+    if (1 == (*(unsigned int *)line)) {
+	reducedARTPacket = 1;
+        printf("Not supporting reducedARTPacket\n");
+        goto main_exit;
+    }
+    else {
+	reducedARTPacket = 0;
+    }
+
+    sock_send(cid, &(line[0]), 1);
+
+    printf("Ready to loop for art packet reduce %d\n", reducedARTPacket);
+
+    while (1) {
+        //printf("wait for tcp socket\n");
+        if ((recvbytes = sock_recv(cid, line, LINE_ARRAY_SIZE)) < 0) {
+            printf("Cannot recv packet size %d\n", recvbytes);
+            cleanup(0);
+            return -1;
+        }
+
+        bytesRcvd = recvbytes;
+        readLength = 0;
+        resp = false;
+
+        if ( firstpacket == true )
+        {
+            cmdLen = *(unsigned short *)&(line[0]);
+            cmdId = *(unsigned char *)&(line[2]);
+
+            printf("->FW len %d Command %d recvbytes %d\n",cmdLen,cmdId,recvbytes);
+            firstpacket = false;
+        }
+
+        if (!reducedARTPacket) {
+            //printf("Recived bytes from NART %d frag size %d\n",recvbytes,frag_size);
+            bufpos = line;
+
+            while (recvbytes) {
+                if (recvbytes > frag_size) {
+                    chunkLen = frag_size;
+                } else {
+                    chunkLen = recvbytes;
+                }
+
+                //we have to find out whether we need a resp or not for the last packet..
+                recvbytes-=chunkLen;
+
+                if ( recvbytes <=0 )
+                {
+                    resp = true;
+                    firstpacket = true; //look for first packet again..
+                }
+
+                //printf("Chunk Len %d total size %d respNeeded %d\n",chunkLen,bytesRcvd,resp);
+                wmiSend(bufpos, chunkLen, bytesRcvd, 1, resp);
+
+                bufpos+=chunkLen;
+            }
+        }
+
+        //line and readLength is populated in the callback
+        if ((REG_WRITE_CMD_ID != line[0]) && (MEM_WRITE_CMD_ID != line[0]) &&
+            (M_PCI_WRITE_CMD_ID != line[0]) && (M_PLL_PROGRAM_CMD_ID != line[0]) &&
+            (M_CREATE_DESC_CMD_ID != line[0])) {
+            printf("<- N/ART len %d Command %d status %d\n", readLength,(int)line[0],(int)line[4]);
+            sock_send(cid, line, readLength);
+        } else {
+            printf("<- N/ART ACK Command %d\n", (int)line[0]);
+            sock_send(cid, &(line[0]), 1);
+        }
+    }
+
+
+main_exit:
+    printf("Normal exit\n");
+    cleanup(0);
+    return 0;
+}
diff --git a/artagent/artagent.h b/artagent/artagent.h
new file mode 100755
index 0000000..0aa3227
--- /dev/null
+++ b/artagent/artagent.h
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#ifndef _ARTAGENT_H_
+#define _ARTAGENT_H_
+
+/* ATHENV */
+#define ART_PORT                5454
+//#define ART_PORT                33120
+/* ATHENV */
+#define LINE_ARRAY_SIZE         4096
+#define SEND_ENDPOINT	        0
+#define HTC_RAW_WRITE_MAX_LEN   (16 * 5) // 96, 112
+#define TC_CMDS_SIZE_MAX  255
+
+#ifndef POSTPACK
+#ifdef __GNUC__
+#define POSTPACK __attribute__ ((packed))
+#else
+#define POSTPACK
+#endif
+#endif
+
+#ifndef PREPACK
+#ifdef __GNUC__
+#define PREPACK
+#else
+#define PREPACK
+#endif
+#endif
+
+typedef enum {
+    TCMD_CONT_TX_ID,
+    TCMD_CONT_RX_ID,
+    TCMD_PM_ID,
+    TC_CMDS_ID,
+    TCMD_SET_REG_ID,
+
+    INVALID_CMD_ID=255,
+} TCMD_ID;
+
+typedef enum {
+    TCMD_CONT_RX_PROMIS =0,
+    TCMD_CONT_RX_FILTER,
+    TCMD_CONT_RX_REPORT,
+    TCMD_CONT_RX_SETMAC,
+    TCMD_CONT_RX_SET_ANT_SWITCH_TABLE,
+
+    TC_CMD_RESP,
+} TCMD_CONT_RX_ACT;
+
+typedef struct cmdReply {
+        unsigned int replyCmdLen;
+        unsigned int replyCmdId; // command ID of command to which this is a reply
+        unsigned int status; // status of the command
+        unsigned char cmdBytes[4000]; // bytes of the command reply
+} CMD_REPLY;
+
+typedef PREPACK struct {
+    unsigned int   testCmdId;
+    unsigned int   act;
+    PREPACK union {
+        unsigned int  enANI;    // to be identical to CONT_RX struct
+        struct PREPACK {
+            unsigned short   length;
+            unsigned char    version;
+            unsigned char    bufLen;
+        } POSTPACK parm;
+    } POSTPACK u;
+} POSTPACK TC_CMDS_HDR;
+
+typedef PREPACK struct {
+    TC_CMDS_HDR  hdr;
+    unsigned char      buf[TC_CMDS_SIZE_MAX+1];
+} POSTPACK TC_CMDS;
+
+
+enum COMMAND_IDS {
+	INIT_F2_CMD_ID,                         //0
+	SELECT_HW_CMD_ID,						//1
+	MEM_WRITE_CMD_ID,						//2
+	MEM_READ_CMD_ID,						//3
+	REG_READ_CMD_ID,						//4
+	REG_WRITE_CMD_ID,						//5
+	CFG_READ_CMD_ID,						//6
+	CFG_WRITE_CMD_ID,					//7
+	MEM_ALLOC_CMD_ID,					//8
+	MEM_FREE_CMD_ID,					//9
+	MEM_WRITE_BLOCK_CMD_ID,				//10
+	MEM_READ_BLOCK_CMD_ID,				//11
+	REMAP_HW_CMD_ID,					//12
+	CREATE_EVENT_CMD_ID,				//13
+	ANY_EVENTS_CMD_ID,					//14
+	GET_EVENT_CMD_ID,					//15
+	DISCONNECT_PIPE_CMD_ID,				//16
+	CLOSE_PIPE_CMD_ID,					//17
+	ISR_FEATURE_ENABLE_CMD_ID,			//18
+	ISR_GET_RX_STATS_CMD_ID,			//19
+	ISR_GET_TX_STATS_CMD_ID,			//20
+	ISR_SINGLE_RX_STAT_CMD_ID,			//21
+	ISR_SINGLE_TX_STAT_CMD_ID,			//22
+	WAIT_ON_EVENT_CMD_ID,				//23
+	WAIT_ON_TIME_CMD_ID,					//24
+	ISR_FEATURE_DISABLE_CMD_ID,				//25
+	M_EEPROM_READ_CMD_ID,					//26
+	M_EEPROM_WRITE_CMD_ID,					//27
+	M_EEPROM_READ_BLOCK_CMD_ID,				//28
+	M_EEPROM_WRITE_BLOCK_CMD_ID,			//29
+	M_RESET_DEVICE_CMD_ID,					//30
+	M_GENERIC_CMD_ID,						//31
+	M_CHECK_REGS_CMD_ID,				//31
+	M_CHANGE_CHANNEL_CMD_ID,			//33
+	M_CHECK_PROM_CMD_ID,				//34
+	M_REREAD_PROM_CMD_ID,				//35
+	M_TX_DATA_SETUP_CMD_ID,				//36
+	M_TX_DATA_BEGIN_CMD_ID,				//37
+	M_TX_DATA_START_CMD_ID,					//38
+	M_TX_DATA_COMPLETE_CMD_ID,				//39
+	M_RX_DATA_SETUP_CMD_ID,				//40
+	M_RX_DATA_BEGIN_CMD_ID,				//41
+	M_RX_DATA_START_CMD_ID,					//42
+	M_RX_DATA_COMPLETE_CMD_ID,				//43
+	M_RX_STATS_SNAPSHOT_CMD_ID,				//44
+	M_TXRX_DATA_BEGIN_CMD_ID,			//45
+	M_CLEANUP_TXRX_MEMORY_CMD_ID,			//46
+	M_TX_GET_STATS_CMD_ID,				//47
+	M_RX_GET_STATS_CMD_ID,				//48
+	M_RX_GET_DATA_CMD_ID,				//49
+	M_TX_CONT_BEGIN_CMD_ID,				//50
+	M_TX_CONT_FRAME_BEGIN_CMD_ID,			//51
+	M_TX_CONT_END_CMD_ID,				//52
+	M_SET_ANTENNA_CMD_ID,				//53
+	M_SET_POWER_SCALE_CMD_ID,			//54
+	M_SET_TRANSMIT_POWER_CMD_ID,		//55
+	M_SET_SINGLE_TRANSMIT_POWER_CMD_ID,	//56
+	M_DEV_SLEEP_CMD_ID,					//57
+	M_CLOSE_DEVICE_CMD_ID,				//58
+	M_CHANGE_FIELD_CMD_ID,					//59
+	M_ENABLE_WEP_CMD_ID,					//60
+	M_ENABLE_PA_PRE_DIST_CMD_ID,			//61
+	M_DUMP_REGS_CMD_ID,						//62
+	M_DUMP_PCI_WRITES_CMD_ID,				//63
+	M_TEST_LIB_CMD_ID,						//64
+	M_DISPLAY_FIELD_VALUES_CMD_ID,			//65
+	M_GET_FIELD_VALUE_CMD_ID,				//66
+	M_READ_FIELD_CMD_ID,					//67
+	M_WRITE_FIELD_CMD_ID,					//68
+	M_SET_RESET_PARAMS_CMD_ID,				//69
+	M_CHANGE_MULTIPLE_FIELDS_ALL_MODES_CMD_ID, //70
+	M_CHANGE_MULTIPLE_FIELDS_CMD_ID,		//71
+	M_GET_FIELD_FOR_MODE_CMD_ID,			//72
+	LOAD_AND_RUN_CODE_CMD_ID,				//73
+	M_FORCE_SINGLE_PCDAC_TABLE_CMD_ID,		//74
+	M_FORCE_PCDAC_TABLE_CMD_ID,				//75
+	M_FORCE_POWER_TX_MAX_CMD_ID,			//76
+	M_GET_EEPROM_STRUCT_CMD_ID,				//77
+	M_GET_DEVICE_INFO_CMD_ID,				//78
+	M_WRITE_PROD_DATA_CMD_ID,				//79
+	M_WRITE_NEW_PROD_DATA_CMD_ID,			//80
+	M_SPECIFY_SUBSYSTEM_CMD_ID,				//81
+	M_FORCE_SINGLE_POWER_TX_MAX_CMD_ID,		//82
+	M_SET_QUEUE_CMD_ID,						//83
+	M_MAP_QUEUE_CMD_ID,						//84
+	M_CLEAR_KEY_CACHE_CMD_ID,				//85
+	RUN_SCREENING_TEST_CMD_ID,				//86
+	DIAG_CMD,								//87
+	ENABLE_HW_CAL_CMD,						//88
+	TRAM_WRITE_BLOCK_CMD_ID,				//89
+	TRAM_READ_BLOCK_CMD_ID,					//90
+	M_GET_MAX_POWER_CMD_ID,					//91
+	M_GET_PCDAC_FOR_POWER_CMD_ID,			//92
+	M_FALSE_DETECT_BACKOFF_VALS_CMD_ID,		//93
+	M_GET_MAC_ADDR_CMD_ID,					//94
+	M_MASK_TRIGGER_SWEEP_CMD_ID,			//95
+	M_MASK_DETECT_SIGNAL_CMD_ID,			//96
+	M_MASK_SET_DEV_NUMS_CMD_ID,				//97
+	M_MASK_FORCE_MIN_CCAPWR_CMD_ID,			//98
+	M_MASK_CONFIG_CAPTURE_CMD_ID,			//99
+	AP_REG_READ_CMD_ID,						//100
+	AP_REG_WRITE_CMD_ID,					//101
+	M_SET_LIB_CONFIG_CMD_ID,				//102
+	M_GET_XPDGAIN_CMD_ID,					//103
+	M_SELECT_DEV_NUM_CMD_ID,				//104
+	M_GET_POWER_INDEX_CMD_ID,				//105
+	M_GET_ART_ANI_LEVEL_CMD_ID,				//106
+	M_SET_ART_ANI_LEVEL_CMD_ID,				//107
+	M_FTP_DOWNLOAD_FILE_CMD_ID,				//108
+	M_GET_CTL_INFO_CMD_ID,					//109
+	M_GET_MAX_LIN_PWR_CMD_ID,				//110
+	M_HW_RESET_CMD_ID,						//111
+	M_PLL_PROGRAM_CMD_ID,					//112
+	M_PCI_WRITE_CMD_ID,						//113
+	M_CAL_CHECK_CMD_ID,						//114
+	M_FILL_TX_STATS_CMD_ID,					//115
+	M_CREATE_DESC_CMD_ID,					//116
+	LOAD_AND_PROGRAM_CODE_CMD_ID,			//117
+	M_FORCE_SINGLE_PCDAC_TABLE_GRIFFIN_CMD_ID,		//118
+	PHS_CHANNEL_TOGGLE_CMD_ID,				//119
+	STOP_PHS_CHANNEL_TOGGLE_CMD_ID,					//120
+	GENERIC_FN_CALL_CMD_ID,					//121
+	SEND_FRAME_CMD_ID,					// 122
+	RECV_FRAME_CMD_ID,					// 123
+	M_EEPROM_READ_LOCS_CMD_ID,				//124
+	GET_REF_CLK_SPEED_CMD_ID,				//125
+	SLEEP_CMD_ID,				//126
+
+        ART_IMAGE_DOWNLOAD_ID,       //127
+	ART_TEST_UITRON,					//128
+	ART_TEST_CLIENT,					//129
+
+	ART_CLIENT_REWIND_ID,     //130
+	ART_THROUGHPUT_TEST_CMD_ID,   //131
+	ART_THROUGHPUT_TEST_CMD_ID_1,   //132
+
+	ART_BMI_WRITE_SOC_REGISTER_ID,     //133
+	ART_BMI_WRITE_SOC_MEMORY_ID,               //134
+	ART_BMI_OP_DONE_ID,           //135
+        ART_BMI_READ_SOC_REGISTER_ID,     //136
+        ART_BMI_READ_SOC_TARGET_ID //137
+
+};
+
+
+#endif /* _ARTAGENT_H_ */
diff --git a/ath6kl-tcmd/.gitignore b/ath6kl-tcmd/.gitignore
new file mode 100644
index 0000000..1a72503
--- /dev/null
+++ b/ath6kl-tcmd/.gitignore
@@ -0,0 +1,2 @@
+/athtestcmd
+*~
diff --git a/ath6kl-tcmd/Android.mk b/ath6kl-tcmd/Android.mk
new file mode 100755
index 0000000..214f4ba
--- /dev/null
+++ b/ath6kl-tcmd/Android.mk
@@ -0,0 +1,52 @@
+#-------------------------------------------------
+# Copyright (c) 2012 Qualcomm Atheros, Inc..
+# All Rights Reserved.
+# Qualcomm Atheros Confidential and Proprietary.
+#-------------------------------------------------
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := athtestcmd 
+
+LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libtcmd \
+
+LOCAL_CFLAGS+=
+
+LOCAL_SRC_FILES:= \
+    athtestcmd.c  \
+    sinit_common.c
+
+LOCAL_LDLIBS += -lpthread -lrt
+
+LOCAL_MODULE_TAGS := optional eng
+
+LOCAL_SHARED_LIBRARIES += libcutils
+LOCAL_SHARED_LIBRARIES += libnl_2
+LOCAL_STATIC_LIBRARIES += libtcmd
+
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := psatUtil
+
+LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libtcmd \
+
+LOCAL_CFLAGS+=
+
+LOCAL_SRC_FILES:= \
+    psatUtil.c \
+    sinit_common.c
+
+LOCAL_LDLIBS += -lpthread -lrt
+
+LOCAL_MODULE_TAGS := optional eng
+
+LOCAL_SHARED_LIBRARIES += libcutils
+LOCAL_SHARED_LIBRARIES += libnl_2
+LOCAL_STATIC_LIBRARIES += libtcmd
+
+include $(BUILD_EXECUTABLE)
+
diff --git a/ath6kl-tcmd/COPYING b/ath6kl-tcmd/COPYING
new file mode 100644
index 0000000..77650bc
--- /dev/null
+++ b/ath6kl-tcmd/COPYING
@@ -0,0 +1,13 @@
+Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/ath6kl-tcmd/Makefile b/ath6kl-tcmd/Makefile
new file mode 100644
index 0000000..00d99fc
--- /dev/null
+++ b/ath6kl-tcmd/Makefile
@@ -0,0 +1,31 @@
+CC = gcc
+CFLAGS = -Wall -g
+
+NLLIBNAME = libnl-1
+LIBTCMD_DIR := ../libtcmd
+
+PREFIX ?= /usr
+SBINDIR ?= $(PREFIX)/sbin
+INSTALL ?= install
+
+override LDLIBS += $(shell pkg-config --libs $(NLLIBNAME)) -lrt -ltcmd -lm 
+override CFLAGS += $(shell pkg-config --cflags $(NLLIBNAME)) -I$(LIBTCMD_DIR) -L$(LIBTCMD_DIR)
+
+all:
+	$(MAKE) athtestcmd
+	$(MAKE) psatUtil
+
+athtestcmd: athtestcmd.c athtestcmd.h testcmd.h sinit_common.h sinit_common.c sinit_eep.h
+	$(MAKE) -C $(LIBTCMD_DIR)
+	$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
+
+psatUtil: psatUtil.c athtestcmd.h testcmd.h sinit_common.h sinit_common.c
+	$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
+
+install: psatUtil athtestcmd
+	install -m 755 psatUtil $(DESTDIR)$(SBINDIR)
+	install -m 755 athtestcmd $(DESTDIR)$(SBINDIR)
+
+clean:
+	rm -f athtestcmd
+	rm -f psatUtil
diff --git a/ath6kl-tcmd/athtestcmd.c b/ath6kl-tcmd/athtestcmd.c
new file mode 100644
index 0000000..ecd6bc4
--- /dev/null
+++ b/ath6kl-tcmd/athtestcmd.c
@@ -0,0 +1,1557 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/types.h>
+#include <net/if.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+#include <ctype.h>
+#include <math.h>
+#include <time.h>
+
+#include "athtestcmd.h"
+#include "libtcmd.h"
+#include "testcmd.h"
+#include "sinit_eep.h"
+#include "sinit_common.h"
+
+const char *progname;
+const char commands[] = "commands:\n"
+	"--tx <sine/frame/tx99/tx100/off>\n"
+	"--txfreq <Tx channel or freq(default 2412)>\n"
+	"--txrate <rate index>\n"
+        "--txpwr <frame/tx99/tx100: 0-30dBm,0.5dBm resolution; sine: 0-60, PCDAC vaule>\n"
+	"--txantenna <1/2/0 (auto)>\n"
+	"--txpktsz <pkt size, [32-1500](default 1500)>\n"
+	"--txpattern <tx data pattern, 0: all zeros; 1: all ones;"
+	" 2: repeating 10; 3: PN7; 4: PN9; 5: PN15\n"
+	"--ani (Enable ANI. The ANI is disabled if this option is not specified)\n"
+	"--scrambleroff (Disable scrambler. The scrambler is enabled by default)\n"
+	"--aifsn <AIFS slots num,[0-252](Used only under '--tx frame' mode)>\n"
+	"--shortguard (use short guard)\n"
+	"--mode <ht40plus/ht40minus/ht20>\n"
+	"--setlongpreamble <1/0>\n"
+	"--numpackets <number of packets to send 0-65535>\n"
+        "--tx sine --txfreq <Tx channel or freq(default 2412)>\n"
+	"--rx <promis/filter/report>\n"
+	"--rxfreq <Rx channel or freq(default 2412)>\n"
+	"--rxantenna <1/2/0 (auto)>\n"
+	"--mode <ht40plus/ht40minus>\n"
+	"--pm <wakeup/sleep/deepsleep>\n"
+	"--setmac <mac addr like 00:03:7f:be:ef:11>\n"
+	"--getmac\n"
+	"--SetAntSwitchTable <table1 in decimal value>"
+	" <table2 in decimal value>  (Set table1=0 and table2=0 will"
+	" restore the default AntSwitchTable)\n"
+        "--efusedump --start <start address> --end <end address>\n"
+        "--efusewrite --start <start address> --data <data> (could be one or multiple data in quotation marks)\n"
+        "--otpwrite --data (could be one or multiple data in quotation marks)\n"
+        "--otpdump\n";
+
+#define A_ERR(ret, args...) printf(args); exit(ret);
+
+#define A_FREQ_MIN              4920
+#define A_FREQ_MAX              5825
+
+#define A_CHAN0_FREQ            5000
+#define A_CHAN_MAX              ((A_FREQ_MAX - A_CHAN0_FREQ)/5)
+
+#define BG_FREQ_MIN             2412
+#define BG_FREQ_MAX             2484
+
+#define BG_CHAN0_FREQ           2407
+#define BG_CHAN_MIN             ((BG_FREQ_MIN - BG_CHAN0_FREQ)/5)
+#define BG_CHAN_MAX             14	/* corresponding to 2484 MHz */
+
+#define A_20MHZ_BAND_FREQ_MAX   5000
+
+#define INVALID_FREQ    0
+#define A_OK            0
+
+#define ATH6KL_INTERFACE "wlan0"
+
+#define A_RATE_NUM      28
+#define G_RATE_NUM      28
+
+#define RATE_STR_LEN    20
+#define VENUS_OTP_SIZE  512
+typedef const char RATE_STR[RATE_STR_LEN];
+
+const RATE_STR bgRateStrTbl[G_RATE_NUM] = {
+	{"1   Mb"},
+	{"2   Mb"},
+	{"5.5 Mb"},
+	{"11  Mb"},
+	{"6   Mb"},
+	{"9   Mb"},
+	{"12  Mb"},
+	{"18  Mb"},
+	{"24  Mb"},
+	{"36  Mb"},
+	{"48  Mb"},
+	{"54  Mb"},
+	{"HT20 MCS0 6.5  Mb"},
+	{"HT20 MCS1 13  Mb"},
+	{"HT20 MCS2 19.5  Mb"},
+	{"HT20 MCS3 26  Mb"},
+	{"HT20 MCS4 39  Mb"},
+	{"HT20 MCS5 52  Mb"},
+	{"HT20 MCS6 58.5  Mb"},
+	{"HT20 MCS7 65  Mb"},
+	{"HT40 MCS0 13.5  Mb"},
+	{"HT40 MCS1 27.0  Mb"},
+	{"HT40 MCS2 40.5  Mb"},
+	{"HT40 MCS3 54  Mb"},
+	{"HT40 MCS4 81  Mb"},
+	{"HT40 MCS5 108  Mb"},
+	{"HT40 MCS6 121.5  Mb"},
+	{"HT40 MCS7 135  Mb"}
+};
+#if !defined(_printf)
+#define _printf printf
+#endif
+
+#define _NAME_MAX  256
+#define _LABEL_MAX  16
+
+typedef struct _calSetup {
+    double         attenDUT2PM_5G;
+    double         attenDUT2PM_2G;
+    char           testflowBinFilename[_NAME_MAX];
+    char           goldenBinFilename[_NAME_MAX];
+    char           outputBinFilename[_NAME_MAX];
+    char           label[_LABEL_MAX];
+} _CAL_SETUP;
+_CAL_SETUP  calSetup = {
+    19.0,
+    18.0,
+    "calTestFlow.bin",
+#ifdef ANDROID
+    "/system/etc/firmware/ath6k/AR6003/hw2.1.1/bdata.bin",
+#else
+    "/lib/firmware/ath6k/AR6003/hw2.1.1/bdata.bin",
+#endif
+#ifdef ANDROID
+    "/persist/bdata.bin",
+#else
+    "new_bdata.bin",
+#endif
+    "wbgf10_010_d0001",
+};
+
+uint32_t  AR6003_EEPROM_SIZE;
+uint32_t  AR6K_EEPROM_SIZE;
+static bool bCalResult;
+#define FIRST_WAIT_INTERVAL	2
+#define POLLING_INTERVAL	1
+#define MAX_WAIT_CYCLE		20
+
+static time_t startTime, endTime;
+static void rxReport(void *buf);
+static void rx_cb(void *buf, int len);
+static uint32_t freqValid(uint32_t val);
+static uint16_t wmic_ieee2freq(uint32_t chan);
+static void prtRateTbl(uint32_t freq);
+static uint32_t rateValid(uint32_t val, uint32_t freq);
+static uint32_t antValid(uint32_t val);
+static bool txPwrValid(TCMD_CONT_TX * txCmd);
+static int ath_ether_aton(const char *orig, uint8_t * eth);
+static uint32_t pktSzValid(uint32_t val);
+static void updateCALData(_CAL_SETUP *pCalSetup, TC_MSG *pTCMsg);
+static bool dumpPSATCharResult2File(TC_MSG *pTCMsg);
+
+static bool isHex(char c) {
+    return (((c >= '0') && (c <= '9')) ||
+            ((c >= 'A') && (c <= 'F')) ||
+            ((c >= 'a') && (c <= 'f')));
+}
+
+static int usage(void)
+{
+	fprintf(stderr, "usage:\n%s [-i device] commands\n", progname);
+	fprintf(stderr, "%s\n", commands);
+	prtRateTbl(INVALID_FREQ);
+	A_ERR(-1, "Incorrect usage");
+}
+
+unsigned int cmd = 0;
+unsigned int act = 0;
+uint16_t data_length = 0;
+uint16_t efuse_begin = 0, efuse_end = (VENUS_OTP_SIZE - 1);
+static TC_CMDS sTcCmds;
+
+int main(int argc, char **argv)
+{
+	int c, err,i;
+	char ifname[IFNAMSIZ];
+	progname = argv[0];
+	char buf[2048];
+	bool resp = false;
+	TCMD_CONT_TX *txCmd = (TCMD_CONT_TX *) buf;
+	TCMD_CONT_RX *rxCmd = (TCMD_CONT_RX *) buf;
+	TCMD_PM *pmCmd = (TCMD_PM *) buf;
+        TCMD_SET_REG *setRegCmd = (TCMD_SET_REG *)buf;
+        TC_CMDS  *tCmds = (TC_CMDS *)buf;
+        char efuseBuf[VENUS_OTP_SIZE];
+        char efuseWriteBuf[VENUS_OTP_SIZE];
+        int bufferLength = sizeof(*txCmd);
+
+	txCmd->numPackets = 0;
+	txCmd->wlanMode = TCMD_WLAN_MODE_NOHT;
+        txCmd->tpcm = TPC_TX_PWR;
+	rxCmd->u.para.wlanMode = TCMD_WLAN_MODE_NOHT;
+        rxCmd->u.para.freq = 2412;
+
+	if (argc == 1) {
+		usage();
+	}
+
+	/* Log The Start time */
+	startTime = time(NULL);
+
+	while (1) {
+		int option_index = 0;
+
+                static struct option long_options[] = {
+			{"version", 0, NULL, 'v'},
+			{"interface", 1, NULL, 'i'},
+			{"tx", 1, NULL, 't'},
+			{"txfreq", 1, NULL, 'f'},
+			{"txrate", 1, NULL, 'g'},
+			{"txpwr", 1, NULL, 'h'},
+			{"tgtpwr", 0, NULL, 'H'},
+			{"pcdac", 1, NULL, 'I'},
+			{"txantenna", 1, NULL, 'j'},
+			{"txpktsz", 1, NULL, 'z'},
+			{"txpattern", 1, NULL, 'e'},
+			{"rx", 1, NULL, 'r'},
+			{"rxfreq", 1, NULL, 'p'},
+			{"rxantenna", 1, NULL, 'q'},
+			{"pm", 1, NULL, 'x'},
+			{"setmac", 1, NULL, 's'},
+			{"getmac", 0, NULL, 'C'},
+			{"ani", 0, NULL, 'a'},
+			{"scrambleroff", 0, NULL, 'o'},
+			{"aifsn", 1, NULL, 'u'},
+			{"SetAntSwitchTable", 1, NULL, 'S'},
+			{"shortguard", 0, NULL, 'G'},
+			{"numpackets", 1, NULL, 'n'},
+			{"mode", 1, NULL, 'M'},
+			{"setlongpreamble", 1, NULL, 'l'},
+			{"setreg", 1, NULL, 'R'},
+			{"regval", 1, NULL, 'V'},
+			{"flag", 1, NULL, 'F'},
+			{"writeotp", 0, NULL, 'w'},
+			{"otpregdmn", 1, NULL, 'E'},
+			{"efusedump", 0, NULL, 'm'},
+			{"efusewrite", 0, NULL, 'W'},
+			{"start", 1, NULL, 'A'},
+			{"end", 1, NULL, 'L'},
+			{"data", 1, NULL, 'U'},
+			{"otpwrite", 0, NULL, 'O'},
+			{"otpdump", 0, NULL, 'P'},
+			{"btaddr", 1, NULL, 'B'},
+			{"therm", 0, NULL, 'c'},
+			{"selfInit", 0, NULL, TCMD_PSAT_CAL},
+			{"selfInit_result", 0, NULL, TCMD_PSAT_CAL_RESULT},
+			{"psat_char", 1, NULL, TCMD_CHAR_PSAT},
+			{"psat_char_result", 0, NULL, TCMD_CHAR_PSAT_RESULT},
+			{"sinit", 0, NULL, TCMD_SINIT_WAIT},
+			{0, 0, 0, 0}
+		};
+
+		c = getopt_long(argc, argv, "vi:t:f:g:h:HI:r:p:q:x:u:ao:M:A:L:mU:WOP",
+                         long_options, &option_index);
+
+		if (c == -1)
+			break;
+
+        switch (c) {
+        case 'i':
+            memset(ifname, '\0', 8);
+            strcpy(ifname, optarg);
+            break;
+        case 't':
+            cmd = TESTMODE_CONT_TX;
+	    txCmd->testCmdId = TCMD_CONT_TX_ID;
+            if (!strcmp(optarg, "sine")) {
+                txCmd->mode = TCMD_CONT_TX_SINE;
+            } else if (!strcmp(optarg, "offset")) {
+                txCmd->mode = TCMD_CONT_TX_OFFSETTONE;
+            } else if (!strcmp(optarg, "frame")) {
+                txCmd->mode = TCMD_CONT_TX_FRAME;
+            } else if (!strcmp(optarg, "tx99")) {
+                txCmd->mode = TCMD_CONT_TX_TX99;
+            } else if (!strcmp(optarg, "tx100")) {
+                txCmd->mode = TCMD_CONT_TX_TX100;
+            } else if (!strcmp(optarg, "off")) {
+                txCmd->mode = TCMD_CONT_TX_OFF;
+            }else {
+                cmd = 0;
+            }
+            break;
+        case 'f':
+          if (TESTMODE_CMDS == cmd) {
+                uint32_t freq = freqValid(atoi(optarg));
+                uint8_t  freqBin;
+                // TBD: temporarily borrow the length's high B for freq 
+                if (freq < 4900) {
+                    freqBin = FREQ2FBIN(atoi(optarg), 1);
+                }
+                else {
+                    freqBin = FREQ2FBIN(atoi(optarg), 0);
+                }
+                tCmds->hdr.u.parm.length &= 0x00ff;
+                tCmds->hdr.u.parm.length |= (freqBin << 8) & 0xff00;
+            } 
+            else {
+                txCmd->freq = freqValid(atoi(optarg));
+            }
+            break;
+        case 'G':
+            txCmd->shortGuard = 1;
+            break;
+        case 'M':
+            if(cmd == TESTMODE_CONT_TX) {
+                if (!strcmp(optarg, "ht20")) {
+                    txCmd->wlanMode = TCMD_WLAN_MODE_HT20;
+                } else if (!strcmp(optarg, "ht40plus")) {
+                    txCmd->wlanMode = TCMD_WLAN_MODE_HT40PLUS;
+                } else if (!strcmp(optarg, "ht40minus")) {
+                    txCmd->wlanMode = TCMD_WLAN_MODE_HT40MINUS;
+                }
+            } else if(cmd == TESTMODE_CONT_RX) {
+                if (!strcmp(optarg, "ht20")) {
+                    rxCmd->u.para.wlanMode = TCMD_WLAN_MODE_HT20;
+                } else if (!strcmp(optarg, "ht40plus")) {
+                    rxCmd->u.para.wlanMode = TCMD_WLAN_MODE_HT40PLUS;
+                } else if (!strcmp(optarg, "ht40minus")) {
+                    rxCmd->u.para.wlanMode = TCMD_WLAN_MODE_HT40MINUS;
+                }
+            }
+            break;
+        case 'n':
+            txCmd->numPackets = atoi(optarg);
+            break;
+        case 'g':
+            /* let user input index of rateTable instead of string parse */
+            txCmd->dataRate = rateValid(atoi(optarg), txCmd->freq);
+            break;
+        case 'h':
+        {
+            int txPowerAsInt;
+            /* Get tx power from user.  This is given in the form of a number
+             * that's supposed to be either an integer, or an integer + 0.5
+             */
+            double txPowerIndBm = atof(optarg);
+
+            /*
+             * Check to make sure that the number given is either an integer
+             * or an integer + 0.5
+             */
+            txPowerAsInt = (int)txPowerIndBm;
+            if (((txPowerIndBm - (double)txPowerAsInt) == 0) ||
+                (((txPowerIndBm - (double)txPowerAsInt)) == 0.5) ||
+                (((txPowerIndBm - (double)txPowerAsInt)) == -0.5)) {
+                if ((txCmd->mode != TCMD_CONT_TX_SINE) && (txCmd->mode != TCMD_CONT_TX_OFFSETTONE)) {
+                    txCmd->txPwr = txPowerIndBm * 2;
+                } else {
+                    txCmd->txPwr = txPowerIndBm;
+                }
+           } else {
+                printf("Bad argument to --txpwr, must be in steps of 0.5 dBm\n");
+                cmd = 0;
+           }
+
+            txCmd->tpcm = TPC_TX_PWR;
+        }
+            break;
+        case 'H':
+            txCmd->tpcm = TPC_TGT_PWR;
+            break;
+        case 'I':
+            txCmd->tpcm = TPC_FORCED_GAIN;
+            txCmd->txPwr = atof(optarg);
+            break;
+        case 'j':
+            txCmd->antenna = antValid(atoi(optarg));
+            break;
+        case 'z':
+            txCmd->pktSz = pktSzValid(atoi(optarg));
+            break;
+        case 'e':
+            txCmd->txPattern = atoi(optarg);
+            break;
+        case 'r':
+            cmd = TESTMODE_CONT_RX;
+	    rxCmd->testCmdId = TCMD_CONT_RX_ID;
+            if (!strcmp(optarg, "promis")) {
+                rxCmd->act = TCMD_CONT_RX_PROMIS;
+		printf(" Its cont Rx promis mode \n");
+            } else if (!strcmp(optarg, "filter")) {
+                rxCmd->act = TCMD_CONT_RX_FILTER;
+		printf(" Its cont Rx  filter  mode \n");
+            } else if (!strcmp(optarg, "report")) {
+		printf(" Its cont Rx report  mode \n");
+                rxCmd->act = TCMD_CONT_RX_REPORT;
+                resp = true;
+            } else {
+                cmd = 0;
+            }
+            break;
+        case 'p':
+            rxCmd->u.para.freq = freqValid(atoi(optarg));
+            break;
+        case 'q':
+            rxCmd->u.para.antenna = antValid(atoi(optarg));
+            break;
+        case 'x':
+            cmd = TESTMODE_PM;
+	    pmCmd->testCmdId = TCMD_PM_ID;
+            if (!strcmp(optarg, "wakeup")) {
+                pmCmd->mode = TCMD_PM_WAKEUP;
+            } else if (!strcmp(optarg, "sleep")) {
+                pmCmd->mode = TCMD_PM_SLEEP;
+            } else if (!strcmp(optarg, "deepsleep")) {
+                pmCmd->mode = TCMD_PM_DEEPSLEEP;
+            } else {
+                cmd = 0;
+            }
+            break;
+        case 's':
+            {
+                uint8_t mac[ATH_MAC_LEN];
+
+                cmd = TESTMODE_CONT_RX;
+                rxCmd->testCmdId = TCMD_CONT_RX_ID;
+                rxCmd->act = TCMD_CONT_RX_SETMAC;
+                if (ath_ether_aton(optarg, mac) != 0) {
+                    printf("Invalid mac address format! \n");
+                }
+                memcpy(rxCmd->u.mac.addr, mac, ATH_MAC_LEN);
+                printf("JLU: tcmd: setmac 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
+                        mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+                break;
+            }
+        case 'C':
+            cmd = TESTMODE_CONT_RX;
+            rxCmd->testCmdId = TCMD_CONT_RX_ID;
+            act = rxCmd->act = TCMD_CONT_RX_GETMAC;
+            resp = true;
+            break;
+        case 'u':
+            {
+                txCmd->aifsn = atoi(optarg) & 0xff;
+                printf("AIFS:%d\n", txCmd->aifsn);
+            }
+            break;
+        case 'a':
+            if(cmd == TESTMODE_CONT_TX) {
+                txCmd->enANI = true;
+            } else if(cmd == TESTMODE_CONT_RX) {
+                rxCmd->enANI = true;
+            }
+            break;
+        case 'o':
+            txCmd->scramblerOff = true;
+            break;
+        case 'S':
+            if (argc < 4)
+                usage();
+            cmd = TESTMODE_CONT_RX;
+            rxCmd->testCmdId = TCMD_CONT_RX_ID;
+            rxCmd->act = TCMD_CONT_RX_SET_ANT_SWITCH_TABLE;
+            rxCmd->u.antswitchtable.antswitch1 = strtoul(argv[2], (char **)NULL,0);
+            rxCmd->u.antswitchtable.antswitch2 = strtoul(argv[3], (char **)NULL,0);
+            break;
+        case 'l':
+            printf("Not supported\n");
+            return 0;
+            break;
+        case 'R':
+            if (argc < 5) {
+                printf("usage:athtestcmd -i wlan0 --setreg 0x1234 --regval 0x01 --flag 0\n");
+            }
+            cmd = TESTMODE_SETREG;
+            setRegCmd->testCmdId = TCMD_SET_REG_ID;
+            setRegCmd->regAddr   = strtoul(optarg, (char **)NULL, 0);//atoi(optarg);
+            break;
+        case 'V':
+            setRegCmd->val = strtoul(optarg, (char **)NULL, 0);
+            break;
+        case 'F':
+            setRegCmd->flag = atoi(optarg);
+            break;
+        case 'w':
+            rxCmd->u.mac.otpWriteFlag = 1;
+            break;
+        case 'E':
+            rxCmd->u.mac.regDmn[0] = 0xffff&(strtoul(optarg, (char **)NULL, 0));
+            rxCmd->u.mac.regDmn[1] = 0xffff&(strtoul(optarg, (char **)NULL, 0)>>16);
+            break;
+        case 'B':
+            {
+                uint8_t btaddr[ATH_MAC_LEN];
+                if (ath_ether_aton(optarg, btaddr) != 0) {
+                    printf("Invalid mac address format! \n");
+                }
+                memcpy(rxCmd->u.mac.btaddr, btaddr, ATH_MAC_LEN);
+                printf("JLU: tcmd: setbtaddr 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
+                        btaddr[0], btaddr[1], btaddr[2], btaddr[3], btaddr[4], btaddr[5]);
+            }
+            break;
+        case 'c':
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId = TC_CMDS_ID;
+            {
+                tCmds->hdr.u.parm.length = 0;
+                tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;
+                act = tCmds->hdr.act = TC_CMDS_READTHERMAL;//TC_CMDS_CAL_THERMALVOLT;
+                resp = true;
+            }
+            break;
+        case 'A':
+            efuse_begin = atoi(optarg);
+            break;
+
+        case 'L':
+            efuse_end = atoi(optarg);
+            break;
+
+        case 'U':
+            {
+                uint8_t* pucArg = (uint8_t*)optarg;
+                uint8_t  c;
+                uint8_t  strBuf[256];
+                uint8_t  pos = 0;
+                uint16_t length = 0;
+                uint32_t  data;
+
+                /* Sweep string to end */
+                while (1) {
+                    c = *pucArg++;
+                    if (isHex(c)) {
+                        strBuf[pos++] = c;
+                    } else {
+                        strBuf[pos] = '\0';
+                        pos = 0;
+                        sscanf(((char *)&strBuf), "%x", &data);
+                        efuseWriteBuf[length++] = (data & 0xFF);
+
+                        /* End of arg string */
+                        if (c == '\0') {
+                            break;
+                        }
+                    }
+                }
+
+                data_length = length;
+            }
+            break;
+
+        case 'm':
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId      = TC_CMDS_ID;
+            act = tCmds->hdr.act      = TC_CMDS_EFUSEDUMP;
+            resp = true;
+            break;
+
+        case 'W':
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId      = TC_CMDS_ID;
+            act = tCmds->hdr.act      = TC_CMDS_EFUSEWRITE;
+            resp = true;
+            break;
+
+        case 'O':
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId      = TC_CMDS_ID;
+            act = tCmds->hdr.act      = TC_CMDS_OTPSTREAMWRITE;
+            resp = true;
+            break;
+
+        case 'P':
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId      = TC_CMDS_ID;
+            act = tCmds->hdr.act      = TC_CMDS_OTPDUMP;
+            resp = true;
+            break;
+
+        case TCMD_PSAT_CAL:
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId = TC_CMDS_ID;
+            tCmds->hdr.u.parm.length = 0;    
+            tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;    
+            tCmds->hdr.act = TC_CMDS_PSAT_CAL;
+            resp = true;
+            break;
+
+        case TCMD_SINIT_WAIT:
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId = TC_CMDS_ID;
+            tCmds->hdr.u.parm.length = (uint16_t)0;    
+            tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;    
+            tCmds->hdr.act = TC_CMDS_SINIT_WAIT;
+            resp = true;
+            break;
+
+        case TCMD_PSAT_CAL_RESULT:
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId = TC_CMDS_ID;
+            {
+                tCmds->hdr.u.parm.length = 0;    
+                tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;    
+                tCmds->hdr.act = TC_CMDS_PSAT_CAL_RESULT;
+            }
+            resp = true;
+            bCalResult = false;
+            break;
+
+        case TCMD_CHAR_PSAT:
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId = TC_CMDS_ID;
+            {
+                tCmds->hdr.u.parm.length = 0;    
+                tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;    
+                tCmds->hdr.act = TC_CMDS_CHAR_PSAT;
+            }
+            // TBD: temporarily borrow the length's lower B for sweep entry
+            tCmds->hdr.u.parm.length &= 0xff00;
+            tCmds->hdr.u.parm.length |= (atoi(optarg)) & 0xff;
+            printf("optarg %s %d\n", optarg, tCmds->hdr.u.parm.length );
+
+            break;
+
+        case TCMD_CHAR_PSAT_RESULT:
+            cmd = TESTMODE_CMDS;
+            tCmds->hdr.testCmdId = TC_CMDS_ID;
+            {
+                tCmds->hdr.u.parm.length = NUM_PSAT_CHAR_PARMS;    
+                tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;    
+                tCmds->hdr.act = TC_CMDS_CHAR_PSAT_RESULT;
+            }
+            resp = true;
+            break;
+
+        default:
+            usage();
+        }
+     }
+
+     if ( cmd == TESTMODE_CMDS )
+     {
+         if ( tCmds->hdr.act == TC_CMDS_EFUSEWRITE )
+         {
+            int i;
+            /* Error check */
+            if (data_length == 0) {
+                printf("No data to write, exit..\n");
+                return 0;
+            } else if ((efuse_begin + data_length + 4) > TC_CMDS_SIZE_MAX) {
+                printf("Exceed eFuse border: %d, exit..\n", (TC_CMDS_SIZE_MAX - 1));
+                return 0;
+            }
+
+            /* PRINT */
+            printf("eFuse data (%d Bytes): ", data_length);
+            for (i = 0; i < data_length; i++) {
+                printf("%02X ", efuseWriteBuf[i]);
+            }
+            printf("\n");
+
+            /* Write address and data length */
+            tCmds->buf[0] = (efuse_begin & 0xFF);
+            tCmds->buf[1] = (efuse_begin >> 8) & 0xFF;
+            tCmds->buf[2] = (data_length & 0xFF);
+            tCmds->buf[3] = (data_length >> 8) & 0xFF;
+
+            /* Copy data to tcmd buffer. The first 4 bytes are the ID and length */
+            memcpy((void*)&(tCmds->buf[4]), (void*)&(efuseWriteBuf[0]), data_length);
+
+            /* Construct eFuse Write */
+            tCmds->hdr.u.parm.length  = (4 + data_length);
+            tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;
+        }
+        else if ( tCmds->hdr.act == TC_CMDS_OTPSTREAMWRITE )
+        {
+            int i;
+
+            /* Error check */
+            if (data_length == 0) {
+                printf("No data to write, exit..\n");
+                return 0;
+            } else if ((data_length + 4) > TC_CMDS_SIZE_MAX) {
+                printf("Exceed OTP size: %d, exit..\n", data_length);
+                return 0;
+            }
+
+            /* PRINT */
+            printf("Write OTP data (%d Bytes): ", data_length);
+            for (i = 0; i < data_length; i++) {
+                printf("%02X ", efuseWriteBuf[i]);
+            }
+            printf("\n");
+
+            /* Copy data to tcmd buffer. The first 4 bytes are the ID and length */
+            memcpy((void*)&(tCmds->buf[0]), (void*)&(efuseWriteBuf[0]), data_length);
+
+            /* Construct eFuse Write */
+            tCmds->hdr.u.parm.length  = data_length;
+            tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;
+        }
+        else if ( tCmds->hdr.act == TC_CMDS_OTPDUMP )
+        {
+            tCmds->hdr.u.parm.length  = 0;
+            tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;
+        }
+        else if ( tCmds->hdr.act == TC_CMDS_CHAR_PSAT )
+        {
+            uint32_t ii = tCmds->hdr.u.parm.length & 0xff;
+            uint8_t freq= (uint8_t)((tCmds->hdr.u.parm.length >> 8) & 0xff);
+            tCmds->hdr.u.parm.length = NUM_PSAT_CHAR_PARMS;
+            tCmds->buf[0] = psatSweepTbl[ii].an_txrf3_rdiv2g;
+            tCmds->buf[1] = psatSweepTbl[ii].an_txrf3_pdpredist2g;
+            tCmds->buf[2] = psatSweepTbl[ii].an_rxtx2_mxrgain;
+            tCmds->buf[3] = psatSweepTbl[ii].an_rxrf_bias1_pwd_ic25mxr2gh;
+            tCmds->buf[4] = psatSweepTbl[ii].an_bias2_pwd_ic25rxrf;
+            tCmds->buf[5] = psatSweepTbl[ii].an_bb1_i2v_curr2x;
+            tCmds->buf[6] = psatSweepTbl[ii].an_txrf3_capdiv2g;
+            tCmds->buf[7] = freq;
+            printf("freq %d %d %d %d %d %d %d %d\n", tCmds->buf[7], tCmds->buf[0], tCmds->buf[1], tCmds->buf[2], tCmds->buf[3],tCmds->buf[4], tCmds->buf[5], tCmds->buf[6]);
+        }
+    }
+
+    /* default bufferLength = sizeof(*txCmd)*/
+    if ( cmd == TESTMODE_CONT_TX )
+    {
+	bufferLength = sizeof(*txCmd);
+    }
+    else if ( cmd == TESTMODE_CONT_RX )
+    {
+	bufferLength = sizeof(*rxCmd);
+    }
+    else if ( cmd == TESTMODE_PM )
+    {
+	bufferLength = sizeof(*pmCmd);
+    }
+    else if ( cmd == TESTMODE_SETREG)
+    {
+	bufferLength = sizeof(*setRegCmd);
+    }
+    else if ( cmd == TESTMODE_CMDS )
+    {
+	bufferLength = sizeof(*tCmds);
+    }
+
+     printf("Cmd %d length %d respNeeded %d\n",cmd,bufferLength,resp);
+
+     err = tcmd_tx_init(ATH6KL_INTERFACE, rx_cb);
+
+     if (err)
+        return err;
+
+     if ( (cmd == TESTMODE_CMDS) && (tCmds->hdr.act == TC_CMDS_EFUSEDUMP) )
+     {
+        int i, k;
+        int blkNum;
+        uint16_t efuseEnd   = efuse_end;
+        uint16_t efuseBegin = efuse_begin;
+        uint16_t efusePrintAnkor;
+        uint16_t numPlaceHolder;
+
+        /* Input check */
+        if (efuseEnd > (VENUS_OTP_SIZE - 1)) {
+            efuseEnd = (VENUS_OTP_SIZE - 1);
+        }
+
+        if (efuseBegin > efuseEnd) {
+            efuseBegin = efuseEnd;
+        }
+
+        efusePrintAnkor = efuseBegin;
+
+        blkNum = ((efuseEnd - efuseBegin) / TC_CMDS_SIZE_MAX) + 1;
+
+        /* Request data in several trys */
+        for (i = 0; i < blkNum; i++) {
+            tCmds->hdr.testCmdId      = TC_CMDS_ID;
+            tCmds->hdr.act            = TC_CMDS_EFUSEDUMP;
+            tCmds->hdr.u.parm.length  = 4;
+            tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;
+
+            tCmds->buf[0] = (efuseBegin & 0xFF);
+            tCmds->buf[1] = (efuseBegin >> 8) & 0xFF;
+            tCmds->buf[2] = (efuseEnd & 0xFF);
+            tCmds->buf[3] = (efuseEnd >> 8) & 0xFF;
+
+            /* This field may get polluted so needs a refresh here */
+            tCmds->hdr.u.parm.bufLen = 4;
+
+            if ((err = tcmd_tx(buf, bufferLength /* weak */, resp))) {
+	        fprintf(stderr, "tcmd_tx had error: %s!\n", strerror(-err));
+                return 0;
+            }
+
+            /* Last block? */
+            //sTcCmds populated in the callback..
+            if ((efuseEnd - efuseBegin + 1) < TC_CMDS_SIZE_MAX) {
+                memcpy((void*)(efuseBuf + efuseBegin), (void*)&(sTcCmds.buf[0]), (efuseEnd - efuseBegin + 1));
+            } else {
+                memcpy((void*)(efuseBuf + efuseBegin), (void*)&(sTcCmds.buf[0]), TC_CMDS_SIZE_MAX);
+            }
+
+            /* Adjust the efuseBegin but keep efuseEnd unchanged */
+            efuseBegin += TC_CMDS_SIZE_MAX;
+         }
+
+         /* Output Dump */
+         printf("------------------- eFuse Dump ----------------------");
+         for (i = efusePrintAnkor; i <= efuseEnd; i++) {
+             /* Cosmetics */
+             if (i == efusePrintAnkor) {
+                 numPlaceHolder = (efusePrintAnkor & 0x0F);
+                 printf("\n%04X:", (efusePrintAnkor & 0xFFF0));
+                 for (k = 0; k < numPlaceHolder; k++) {
+                     printf("   ");
+                  }
+             } else if ((i & 0x0F) == 0) {
+                 printf("\n%04X:", i);
+             }
+
+             printf(" %02X", efuseBuf[i]);
+         }
+         printf("\n\n");
+     }
+     else if ( (cmd == TESTMODE_CMDS) && (tCmds->hdr.act == TC_CMDS_SINIT_WAIT) )
+     {
+         if ((err = tcmd_tx(buf, bufferLength /* weak */, resp))) {
+	    fprintf(stderr, "tcmd_tx had error: %s!\n", strerror(-err));
+            return 0;
+          }
+
+         sleep(FIRST_WAIT_INTERVAL); /* Wait 2s first */
+
+         /* Request data in several trys */
+         for (i = 0; i < MAX_WAIT_CYCLE; i++) {
+             tCmds->hdr.testCmdId      = TC_CMDS_ID;
+             tCmds->hdr.u.parm.length  = (uint16_t)0;    
+             tCmds->hdr.u.parm.version = TC_CMDS_VERSION_TS;    
+             tCmds->hdr.act            = TC_CMDS_PSAT_CAL_RESULT;
+             resp = true;
+             bCalResult = false;
+
+             if ((err = tcmd_tx(buf, bufferLength /* weak */, resp))) {
+	        /*don't let main return bcs the reply may not be ready. Try again.*/
+                /*fprintf(stderr, "tcmd_tx had error: %s!\n", strerror(-err));*/
+                /*return 0;*/
+             }
+             if (!bCalResult) {
+                 sleep(POLLING_INTERVAL);
+                 printf(".");
+             } else {
+                 endTime = time(NULL);
+                 printf("Wait time = %ld(s)\n", (endTime - startTime));
+                 break;
+             }
+          }
+     }
+     else
+     {
+         if ((err = tcmd_tx(buf, bufferLength /* weak */, resp))) {
+	    fprintf(stderr, "tcmd_tx had error: %s!\n", strerror(-err));
+          }
+    }
+
+     return 0;
+}
+
+static void rxReport(void *buf)
+{
+	struct TCMD_CONT_RX_REPORT *report = &((TCMD_CONT_RX *) buf)->u.report;
+	uint32_t pkt = report->totalPkt;
+	int32_t rssi = report->rssiInDBm;
+	uint32_t crcError = report->crcErrPkt;
+	uint32_t secErr = report->secErrPkt;
+	uint16_t *rateCnt = report->rateCnt;
+	uint16_t *rateCntShortGuard = report->rateCntShortGuard;
+
+	printf
+	    ("total pkt %d ; crcError pkt %d ; secErr pkt %d ;  average rssi %d\n",
+	     pkt, crcError, secErr,
+	     (int32_t) (pkt ? (rssi / (int32_t) pkt) : 0));
+
+	printf("1Mbps     %d\n", rateCnt[0]);
+	printf("2Mbps     %d\n", rateCnt[1]);
+	printf("5.5Mbps   %d\n", rateCnt[2]);
+	printf("11Mbps    %d\n", rateCnt[3]);
+	printf("6Mbps     %d\n", rateCnt[4]);
+	printf("9Mbps     %d\n", rateCnt[5]);
+	printf("12Mbps    %d\n", rateCnt[6]);
+	printf("18Mbps    %d\n", rateCnt[7]);
+	printf("24Mbps    %d\n", rateCnt[8]);
+	printf("36Mbps    %d\n", rateCnt[9]);
+	printf("48Mbps    %d\n", rateCnt[10]);
+	printf("54Mbps    %d\n", rateCnt[11]);
+	printf("\n");
+	printf("HT20 MCS0 6.5Mbps   %d (SGI: %d)\n", rateCnt[12],
+	       rateCntShortGuard[12]);
+	printf("HT20 MCS1 13Mbps    %d (SGI: %d)\n", rateCnt[13],
+	       rateCntShortGuard[13]);
+	printf("HT20 MCS2 19.5Mbps  %d (SGI: %d)\n", rateCnt[14],
+	       rateCntShortGuard[14]);
+	printf("HT20 MCS3 26Mbps    %d (SGI: %d)\n", rateCnt[15],
+	       rateCntShortGuard[15]);
+	printf("HT20 MCS4 39Mbps    %d (SGI: %d)\n", rateCnt[16],
+	       rateCntShortGuard[16]);
+	printf("HT20 MCS5 52Mbps    %d (SGI: %d)\n", rateCnt[17],
+	       rateCntShortGuard[17]);
+	printf("HT20 MCS6 58.5Mbps  %d (SGI: %d)\n", rateCnt[18],
+	       rateCntShortGuard[18]);
+	printf("HT20 MCS7 65Mbps    %d (SGI: %d)\n", rateCnt[19],
+	       rateCntShortGuard[19]);
+	printf("\n");
+	printf("HT40 MCS0 13.5Mbps    %d (SGI: %d)\n", rateCnt[20],
+	       rateCntShortGuard[20]);
+	printf("HT40 MCS1 27.0Mbps    %d (SGI: %d)\n", rateCnt[21],
+	       rateCntShortGuard[21]);
+	printf("HT40 MCS2 40.5Mbps    %d (SGI: %d)\n", rateCnt[22],
+	       rateCntShortGuard[22]);
+	printf("HT40 MCS3 54Mbps      %d (SGI: %d)\n", rateCnt[23],
+	       rateCntShortGuard[23]);
+	printf("HT40 MCS4 81Mbps      %d (SGI: %d)\n", rateCnt[24],
+	       rateCntShortGuard[24]);
+	printf("HT40 MCS5 108Mbps     %d (SGI: %d)\n", rateCnt[25],
+	       rateCntShortGuard[25]);
+	printf("HT40 MCS6 121.5Mbps   %d (SGI: %d)\n", rateCnt[26],
+	       rateCntShortGuard[26]);
+	printf("HT40 MCS7 135Mbps     %d (SGI: %d)\n", rateCnt[27],
+	       rateCntShortGuard[27]);
+
+}
+
+static void readThermal(void *buf,int len)
+{
+    TC_CMDS *tCmd;
+
+    tCmd = (TC_CMDS *)buf;
+
+    printf("Length rx cb rcvd %d\n",len);
+    printf("act %d version %d length %d\n",tCmd->hdr.act,tCmd->hdr.u.parm.version,tCmd->hdr.u.parm.length);
+    printf("chip thermal value:%d\n", tCmd->buf[0]);
+    return;
+}
+
+static void getMac(void *buf,int len)
+{
+    TC_CMDS *tCmd;
+
+    tCmd = (TC_CMDS *)buf;
+
+    printf("Length rx cb rcvd %d\n",len);
+    printf("act %d version %d length %d\n",tCmd->hdr.act,tCmd->hdr.u.parm.version,tCmd->hdr.u.parm.length);
+    printf("MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n", tCmd->buf[0], tCmd->buf[1], tCmd->buf[2], tCmd->buf[3], tCmd->buf[4], tCmd->buf[5]);
+    return;
+}
+
+static void cmdReply(void *buf, int len)
+{
+    TC_CMDS  tCmdReply;
+    TC_MSG *pTCMsg;
+    uint32_t act;
+    uint16_t wBytes;
+    int i=0;
+
+    printf("Length rx cb rcvd %d\n",len);
+
+    buf = (void*)((uint8_t*)buf + (2 * sizeof(unsigned int)));
+
+    uint8_t *reply = (uint8_t*)buf;
+
+    tCmdReply.hdr.u.parm.length = *(uint16_t *)&(reply[0]);
+    tCmdReply.hdr.u.parm.version = (uint8_t)(reply[2]);
+    act = tCmdReply.hdr.u.parm.version;
+    pTCMsg = (TC_MSG *)&(tCmdReply.buf[0]);
+
+    /* Error Check */
+    if (tCmdReply.hdr.u.parm.length > (TC_CMDS_SIZE_MAX + 1)) {
+        printf("Error: Reply lenth=%d, limit=%d\n", tCmdReply.hdr.u.parm.length, TC_CMDS_SIZE_MAX);
+        return;
+    } else {
+        ;
+    }
+
+    if (tCmdReply.hdr.u.parm.length > 0) {
+        memcpy((void*)&(tCmdReply.buf), (void*)((uint8_t*)buf+4),  tCmdReply.hdr.u.parm.length);
+        memcpy((void*)&(sTcCmds.buf[0]), (void*)&(tCmdReply.buf[0]),  tCmdReply.hdr.u.parm.length);
+        sTcCmds.hdr.u.parm.length = tCmdReply.hdr.u.parm.length;
+   }
+
+    switch (act) {
+        case TC_CMDS_EFUSEDUMP:
+            printf("eFuse data:\n");
+            break;
+        case TC_CMDS_EFUSEWRITE:
+            printf("(write eFuse data)\n");
+            wBytes = ((sTcCmds.buf[1] << 8) | sTcCmds.buf[0]);
+            printf("%d bytes written to eFuse.\n", wBytes);
+            break;
+        case TC_CMDS_OTPSTREAMWRITE:
+            printf("(OTP stream write)\n");
+
+            if (sTcCmds.buf[0] == A_OK) {
+                printf("Write %d bytes to OTP\n", data_length);
+            } else {
+                printf("Failed to write OTP\n");
+            }
+            break;
+        case TC_CMDS_OTPDUMP:
+            printf("OTP Dump\n");
+            if (sTcCmds.hdr.u.parm.length) {
+                /* Received bytes are in sTcCmds */
+                for (i = 0; i < sTcCmds.hdr.u.parm.length; i++) {
+                    printf("%02x ", sTcCmds.buf[i]);
+                }
+                printf("\n");
+            } else {
+                printf("No valid stream found in OTP!\n");
+            }
+            break;
+        case TC_CMDS_PSAT_CAL:
+            break;
+        case TC_CMDS_SINIT_WAIT:
+            if (TC_MSG_PSAT_CAL_ACK == (TC_MSG_ID)pTCMsg->msgId) {
+                printf("ACK Received.\n");
+            }
+            break;
+        case TC_CMDS_PSAT_CAL_RESULT:
+            if (TC_MSG_PSAT_CAL_RESULTS == (TC_MSG_ID)pTCMsg->msgId) {
+              // update CAL data, read eeprom bin,  re-generate eeprom bin
+              updateCALData(&calSetup, pTCMsg);
+              bCalResult = true;
+            }
+            break;
+        case TC_CMDS_CHAR_PSAT:
+            break;
+        case TC_CMDS_CHAR_PSAT_RESULT:
+            if (TC_MSG_CHAR_PSAT_RESULTS == (TC_MSG_ID)pTCMsg->msgId) {
+              dumpPSATCharResult2File(pTCMsg);
+            }
+            break;
+        default:
+            printf("Invalid action!\n");
+            break;
+    }
+}
+
+static void rx_cb(void *buf, int len)
+{
+	TCMD_ID tcmd;
+
+	if ( cmd == TESTMODE_CMDS )
+        {
+            if ( act == TC_CMDS_READTHERMAL )
+            {
+                readThermal(buf,len);
+	    }
+            else
+            {
+               cmdReply(buf,len);
+            }
+
+            return;
+        }
+
+	if ( cmd == TESTMODE_CONT_RX )
+	{
+            if ( act == TCMD_CONT_RX_GETMAC )
+            {
+                getMac(buf, len);
+            }
+	}
+
+	tcmd = * ((uint32_t *) buf + 1);
+
+	switch (tcmd) {
+	case TCMD_CONT_RX_REPORT:
+		rxReport(buf);
+		break;
+	default:
+		 break;
+	}
+
+}
+
+static uint32_t freqValid(uint32_t val)
+{
+	do {
+		if (val <= A_CHAN_MAX) {
+			uint16_t freq;
+
+			if (val < BG_CHAN_MIN)
+				break;
+
+			freq = wmic_ieee2freq(val);
+			if (INVALID_FREQ == freq)
+				break;
+			else
+				return freq;
+		}
+
+		if ((val == BG_FREQ_MAX) ||
+		    ((val < BG_FREQ_MAX) && (val >= BG_FREQ_MIN)
+		     && !((val - BG_FREQ_MIN) % 5)))
+			return val;
+		else if ((val >= A_FREQ_MIN) && (val < A_20MHZ_BAND_FREQ_MAX)
+			 && !((val - A_FREQ_MIN) % 20))
+			return val;
+		else if ((val >= A_20MHZ_BAND_FREQ_MAX) && (val <= A_FREQ_MAX)
+			 && !((val - A_20MHZ_BAND_FREQ_MAX) % 5))
+			return val;
+	} while (false);
+
+	A_ERR(-1, "Invalid channel or freq #: %d !\n", val);
+	return 0;
+}
+
+static uint32_t rateValid(uint32_t val, uint32_t freq)
+{
+	if (((freq >= A_FREQ_MIN) && (freq <= A_FREQ_MAX)
+	     && (val >= A_RATE_NUM)) || ((freq >= BG_FREQ_MIN)
+					 && (freq <= BG_FREQ_MAX)
+					 && (val >= G_RATE_NUM))) {
+		printf("Invalid rate value %d for frequency %d! \n", val, freq);
+		prtRateTbl(freq);
+		A_ERR(-1, "Invalid rate value %d for frequency %d! \n", val,
+		      freq);
+	}
+
+	return val;
+}
+
+static void prtRateTbl(uint32_t freq)
+{
+	int i;
+
+	for (i = 0; i < G_RATE_NUM; i++) {
+		printf("<rate> %d \t \t %s \n", i, bgRateStrTbl[i]);
+	}
+	printf("\n");
+}
+
+/*
+ * converts ieee channel number to frequency
+ */
+static uint16_t wmic_ieee2freq(uint32_t chan)
+{
+	if (chan == BG_CHAN_MAX) {
+		return BG_FREQ_MAX;
+	}
+	if (chan < BG_CHAN_MAX) {	/* 0-13 */
+		return (BG_CHAN0_FREQ + (chan * 5));
+	}
+	if (chan <= A_CHAN_MAX) {
+		return (A_CHAN0_FREQ + (chan * 5));
+	} else {
+		return INVALID_FREQ;
+	}
+}
+
+static uint32_t antValid(uint32_t val)
+{
+	if (val > 2) {
+		A_ERR(-1,
+		      "Invalid antenna setting! <0: auto;  1/2: ant 1/2>\n");
+	}
+
+	return val;
+}
+
+static bool txPwrValid(TCMD_CONT_TX * txCmd)
+{
+	bool rc = false;
+	if (txCmd->mode == TCMD_CONT_TX_SINE) {
+		if ((txCmd->txPwr >= 0) && (txCmd->txPwr <= 150))
+			rc = true;
+	} else if (txCmd->mode == TCMD_CONT_TX_OFFSETTONE) {
+		if ((txCmd->txPwr >= 0) && (txCmd->txPwr <= 150))
+			rc = true;
+	} else if (txCmd->mode != TCMD_CONT_TX_OFF) {
+		if (txCmd->tpcm != TPC_FORCED_GAIN) {
+			if ((txCmd->txPwr >= -30) && (txCmd->txPwr <= 60))
+				rc = true;
+		} else {
+			if ((txCmd->txPwr >= 0) && (txCmd->txPwr <= 120))
+				rc = true;
+		}
+	} else if (txCmd->mode == TCMD_CONT_TX_OFF) {
+		rc = true;
+	}
+
+	if (!rc)
+		A_ERR(1,
+		"Invalid Tx Power value! \nTx data: [-15 - 14]dBm  \nTx sine: [  0 - 150]PCDAC value\n");
+	return rc;
+}
+
+static uint32_t pktSzValid(uint32_t val)
+{
+	if ((val < 32) || (val > 1500)) {
+		A_ERR(-1, "Invalid package size! < 32 - 1500 >\n");
+	}
+	return val;
+}
+
+#ifdef NOTYET
+
+// Validate a hex character
+static bool _is_hex(char c)
+{
+	return (((c >= '0') && (c <= '9')) ||
+		((c >= 'A') && (c <= 'F')) || ((c >= 'a') && (c <= 'f')));
+}
+
+// Convert a single hex nibble
+static int _from_hex(char c)
+{
+	int ret = 0;
+
+	if ((c >= '0') && (c <= '9')) {
+		ret = (c - '0');
+	} else if ((c >= 'a') && (c <= 'f')) {
+		ret = (c - 'a' + 0x0a);
+	} else if ((c >= 'A') && (c <= 'F')) {
+		ret = (c - 'A' + 0x0A);
+	}
+	return ret;
+}
+
+// Convert a character to lower case
+static char _tolower(char c)
+{
+	if ((c >= 'A') && (c <= 'Z')) {
+		c = (c - 'A') + 'a';
+	}
+	return c;
+}
+
+// Validate alpha
+static bool isalpha(int c)
+{
+	return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
+}
+
+// Validate digit
+static bool isdigit(int c)
+{
+	return ((c >= '0') && (c <= '9'));
+}
+
+// Validate alphanum
+static bool isalnum(int c)
+{
+	return (isalpha(c) || isdigit(c));
+}
+#endif
+
+/*------------------------------------------------------------------*/
+/*
+ * Input an Ethernet address and convert to binary.
+ */
+static int ath_ether_aton(const char *orig, uint8_t * eth)
+{
+	int mac[6];
+	if (sscanf(orig, "%02x:%02x:%02X:%02X:%02X:%02X",
+		   &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]) == 6) {
+		int i;
+#ifdef DEBUG
+		if (*(orig + 12 + 5) != 0) {
+			fprintf(stderr, "%s: trailing junk '%s'!\n", __func__,
+				orig);
+			return -1;
+		}
+#endif
+		for (i = 0; i < 6; ++i)
+			eth[i] = mac[i] & 0xff;
+		return 0;
+	}
+	return -1;
+}
+
+// Read "golden" eeprom bin
+// Update it with CAL data
+
+bool readCalDataFromFileBin(char *fileName, AR6003_EEPROM *eepromData)
+{
+    FILE *fp;
+    bool rc=true;
+    uint32_t numBytes;
+
+    printf("readCalDataFromFile - reading EEPROM file %s\n",fileName);
+    if( (fp = fopen(fileName, "rb")) == NULL) {
+        _printf("Could not open %s to read\n", fileName);
+        return false;
+    }
+
+    if (AR6K_EEPROM_SIZE_LARGEST == (numBytes = fread((uint8_t *)eepromData, 1, AR6K_EEPROM_SIZE_LARGEST, fp))) {
+        printf("Read %d from %s\n", numBytes, fileName);  
+        rc = true;
+    }
+    else {
+        if (feof(fp)) {
+            printf("good Read %d from %s\n", numBytes, fileName);  
+            rc = true;
+        } 
+        else if (ferror(fp)) {
+            _printf("Error reading %s\n", fileName);
+            rc = false;
+        }
+        else { _printf("Unknown fread rc\n"); rc = false; }
+    }
+    if (fp) fclose(fp);
+
+    if (rc) {
+        if ((eepromData->baseEepHeader.version & AR6003_EEP_VER_MINOR_MASK) >= AR6003_EEP_MINOR_VER10) {
+            if (AR6K_EEPROM_SIZE_LARGEST != numBytes) {
+                printf("Num of bytes read %d mismatch expected %d\n", numBytes, AR6K_EEPROM_SIZE_LARGEST);
+                rc = false;
+            }
+            else {
+                AR6K_EEPROM_SIZE = AR6003_EEPROM_SIZE = AR6K_EEPROM_SIZE_LARGEST;
+                printf("New TPC scheme selected! %x %d\n", eepromData->baseEepHeader.version, AR6K_EEPROM_SIZE);
+            }
+        }
+        else {
+            _printf("EEPROM file version %d not supported, please re-calibrate it.\n", eepromData->baseEepHeader.version);
+            rc = false;
+        }
+    }
+    return rc;
+}
+
+#define _PSAT_COMMON_4_HOST
+
+// if host doesn't support math.h, this section can be skipped, it is purely for data gathering
+static double cmacPwr(double cmac)
+{
+    double pwr;
+    double vfull=1.0, cycles = -15.0;
+
+    pwr = 10*log10(4*((double)cmac)*((double)pow(2.0, cycles))*((double)pow(vfull/512, 2)));
+    return(pwr);
+}
+static bool dumpPSATCharResult2File(TC_MSG *pTCMsg)
+{
+    FILE *dbgFp;
+    int i;
+    uint32_t cmac_i;
+
+#ifdef ANDROID
+    if ( (dbgFp = fopen("/persist/psatCharData.csv", "a+")) == NULL) {
+        printf("Error: open _psatCharData.csv\n");
+        return(false);
+    }
+#else
+    if ( (dbgFp = fopen("_psatCharData.csv", "a+")) == NULL) {
+        printf("Error: open _psatCharData.csv\n");
+        return(false);
+    }
+#endif
+    
+    fprintf(dbgFp, "%d, %d, %d, %d, %d, %d, %d, %d\n", 
+    pTCMsg->msg.psatCharResults.freq, 
+    pTCMsg->msg.psatCharResults.an_txrf3_rdiv2g, 
+    pTCMsg->msg.psatCharResults.an_txrf3_pdpredist2g, 
+    pTCMsg->msg.psatCharResults.an_rxtx2_mxrgain, 
+    pTCMsg->msg.psatCharResults.an_rxrf_bias1_pwd_ic25mxr2gh, 
+    pTCMsg->msg.psatCharResults.an_bias2_pwd_ic25rxrf, 
+    pTCMsg->msg.psatCharResults.an_bb1_i2v_curr2x, 
+    pTCMsg->msg.psatCharResults.an_txrf3_capdiv2g); 
+    for (i=0;i<_MAX_TX_GAIN_ENTRIES;i++) {
+        cmac_i = pTCMsg->msg.psatCharResults.cmac_i[i]; 
+        fprintf(dbgFp, "%d, %d, %f, %d\n", pTCMsg->msg.psatCharResults.pcdac[i], cmac_i, cmacPwr(cmac_i), cmac2Pwr_t10(cmac_i)); 
+    }
+
+    if (dbgFp) fclose(dbgFp);
+    return(true); 
+}
+   
+uint16_t computeChecksumOnly(uint16_t *pHalf, uint16_t length)
+{
+    uint16_t sum = 0, i;
+    for (i = 0; i < length; i++) { sum ^= *pHalf++; }
+    return(sum);
+}
+
+void computeChecksum(AR6003_EEPROM *pEepStruct)
+{
+  uint16_t sum, *pHalf;
+  uint8_t eepromVersion;
+    
+  eepromVersion = pEepStruct->baseEepHeader.version & AR6003_EEP_VER_MINOR_MASK;
+  if (eepromVersion >= AR6003_EEP_MINOR_VER5) {
+    // first checksum
+    pEepStruct->baseEepHeader.checksum = 0x0000;
+    pHalf = (uint16_t *)pEepStruct;
+    sum = computeChecksumOnly(pHalf, AR6K_EEPROM_SIZE_PRIOR_VER4/2);
+    pEepStruct->baseEepHeader.checksum = 0xFFFF ^ sum;
+
+    // second (expanded checksum)
+    pEepStruct->checksumExpanded = 0x0000;
+    pHalf = (uint16_t *)pEepStruct;
+    pHalf += AR6K_EEPROM_SIZE_PRIOR_VER4/2;
+    sum = computeChecksumOnly(pHalf, (AR6003_EEPROM_SIZE - AR6K_EEPROM_SIZE_PRIOR_VER4)/2);
+    pEepStruct->checksumExpanded = 0xFFFF ^ sum;
+
+    _printf("--computeChecksum old 0x%x expanded 0x%x\n", pEepStruct->baseEepHeader.checksum, pEepStruct->checksumExpanded);
+  }
+  else {
+    pEepStruct->baseEepHeader.checksum = 0x0000;
+    pHalf = (uint16_t *)pEepStruct;
+    sum = computeChecksumOnly(pHalf, AR6K_EEPROM_SIZE_PRIOR_VER4/2);
+    pEepStruct->baseEepHeader.checksum = 0xFFFF ^ sum;
+    _printf("--computeChecksum old 0x%x\n", pEepStruct->baseEepHeader.checksum);
+  }
+}
+
+bool genEepromBinFile(char *fileName, AR6003_EEPROM *pEepStruct) 
+{
+    FILE *fp;
+    
+    // re-computing checksum
+    pEepStruct->baseEepHeader.checksum = 0;
+    computeChecksum(pEepStruct);
+
+    if ( (fp = fopen(fileName, "wb")) == NULL) {
+        _printf("Error: open to write eeprom bin %s \n", fileName);
+        return false;
+    }
+    if (sizeof(AR6003_EEPROM) != fwrite((uint8_t *)pEepStruct, 1, sizeof(AR6003_EEPROM), fp)) {
+        _printf("Error: writing to %s\n", fileName);
+    }
+    if (fp) fclose(fp);
+    return(true);
+}
+
+static void updateCALData(_CAL_SETUP *pCalSetup, TC_MSG *pTCMsg)
+{
+    bool rc;
+    AR6003_EEPROM     eepromData, *pEeprom=&eepromData;
+    AR6003_BASE_EEP_HEADER   *pBase;
+    AR6003_CAL_DATA_PER_FREQ_OLPC_EXPANDED *pRawDataSet2G_ext, *pRawDataSet5G_ext;
+    uint8_t  *pCalChans2G, *pCalChans5G;
+    uint32_t numPiers2G, numPiers5G;
+    uint32_t i; 
+    
+    // read in golden bin 
+    rc = readCalDataFromFileBin(pCalSetup->goldenBinFilename, pEeprom);
+    assert(rc);
+    printf("Read %s\n", pCalSetup->goldenBinFilename);
+
+    numPiers2G = numPiers5G = 0;
+    pBase = &(pEeprom->baseEepHeader);
+
+    {
+        if (pBase->opCapFlags & WLAN_11G_CAPABILITY) { 
+            pRawDataSet2G_ext = pEeprom->calPierData2GExpanded;
+            pCalChans2G = pEeprom->calFreqPier2GExpanded;
+            for (numPiers2G = 0; numPiers2G < AR6003_NUM_2G_CAL_PIERS_EXPANDED; numPiers2G++) {
+                if (pCalChans2G[numPiers2G] == AR6003_BCHAN_UNUSED) {
+                    break;
+                }
+            }
+        }
+
+        if (pBase->opCapFlags & WLAN_11A_CAPABILITY) {
+            pRawDataSet5G_ext = pEeprom->calPierData5GExpanded;
+            pCalChans5G = pEeprom->calFreqPier5GExpanded;
+            for (numPiers5G = 0; numPiers5G < AR6003_NUM_5G_CAL_PIERS_EXPANDED; numPiers5G++) {
+                if (pCalChans5G[numPiers5G] == AR6003_BCHAN_UNUSED) {
+                    break;
+                }
+            }
+        }
+    }
+
+    PSAT_CAL_RESULTS *pPsatCalResults = &(pTCMsg->msg.psatCalResults);
+
+    for (i=0;i<numPiers2G;i++) {
+                printf("%d %d %d %d %d %.2f %.2f %d %d 0x%x %d %d 0x%x\n", pPsatCalResults->olpcGainTherm2G[i].olpcGainDelta_diff, pPsatCalResults->olpcGainTherm2G[i].olpcGainDelta_abs, pPsatCalResults->olpcGainTherm2G[i].thermCalVal,
+                    pPsatCalResults->olpcGainTherm2G[i].cmac_psat, pPsatCalResults->olpcGainTherm2G[i].cmac_olpc,
+                    cmacPwr(pPsatCalResults->olpcGainTherm2G[i].cmac_psat), cmacPwr(pPsatCalResults->olpcGainTherm2G[i].cmac_olpc),
+                    pPsatCalResults->olpcGainTherm2G[i].cmac_psat_pcdac, pPsatCalResults->olpcGainTherm2G[i].cmac_olpc_pcdac,
+                    pPsatCalResults->olpcGainTherm2G[i].numTryBF, 
+                    pPsatCalResults->olpcGainTherm2G[i].lineSlope, pPsatCalResults->olpcGainTherm2G[i].lineVariance,
+                    pPsatCalResults->olpcGainTherm2G[i].psatParm);
+            //}
+    }
+    for (i=0;i<numPiers5G ;i++) {
+                printf("%d %d %d %d %d %.2f %.2f %d %d 0x%x\n", pPsatCalResults->olpcGainTherm5G[i].olpcGainDelta_diff, pPsatCalResults->olpcGainTherm5G[i].olpcGainDelta_abs, pPsatCalResults->olpcGainTherm5G[i].thermCalVal,
+                    pPsatCalResults->olpcGainTherm5G[i].cmac_psat, pPsatCalResults->olpcGainTherm5G[i].cmac_olpc,
+                    cmacPwr(pPsatCalResults->olpcGainTherm5G[i].cmac_psat), cmacPwr(pPsatCalResults->olpcGainTherm5G[i].cmac_olpc),
+                    pPsatCalResults->olpcGainTherm5G[i].cmac_psat_pcdac, pPsatCalResults->olpcGainTherm5G[i].cmac_olpc_pcdac,
+                    pPsatCalResults->olpcGainTherm5G[i].numTryBF);
+            //}
+    }
+
+    for (i=0;i<numPiers2G;i++) {
+        if (pEeprom->baseEepHeader.boardFlagsExt & AR6003_BOARDFLAGSEXT_PSAT_CAL_ABS) {
+            pRawDataSet2G_ext[i].olpcBasic.olpcGainDelta = (int8_t)  (pPsatCalResults->olpcGainTherm2G[i].olpcGainDelta_abs); 
+            pRawDataSet2G_ext[i].olpcGainDelta_t10       = (int16_t) (pPsatCalResults->olpcGainTherm2G[i].olpcGainDelta_abs *5);
+        }
+        else {
+            pRawDataSet2G_ext[i].olpcBasic.olpcGainDelta = (int8_t)  (pPsatCalResults->olpcGainTherm2G[i].olpcGainDelta_diff); 
+            pRawDataSet2G_ext[i].olpcGainDelta_t10       = (int16_t) (pPsatCalResults->olpcGainTherm2G[i].olpcGainDelta_diff *5);
+        }
+        pRawDataSet2G_ext[i].olpcBasic.thermCalVal   = (uint8_t) pPsatCalResults->olpcGainTherm2G[i].thermCalVal;
+    }
+
+    for (i=0;i<numPiers5G;i++) {
+        if (pEeprom->baseEepHeader.boardFlagsExt & AR6003_BOARDFLAGSEXT_PSAT_CAL_ABS) {
+        pRawDataSet5G_ext[i].olpcBasic.olpcGainDelta = (int8_t)pPsatCalResults->olpcGainTherm5G[i].olpcGainDelta_abs; 
+        }
+        else {
+        pRawDataSet5G_ext[i].olpcBasic.olpcGainDelta = (int8_t)pPsatCalResults->olpcGainTherm5G[i].olpcGainDelta_diff; 
+        }
+        pRawDataSet5G_ext[i].olpcBasic.thermCalVal   = (uint8_t)pPsatCalResults->olpcGainTherm5G[i].thermCalVal;
+        pRawDataSet5G_ext[i].olpcGainDelta_t10       = (int16_t)(pPsatCalResults->olpcGainTherm5G[i].olpcGainDelta_diff * 5); 
+    }
+    
+    memcpy((void*)&(pEeprom->baseEepHeader.custData[0]), pCalSetup->label, sizeof(pCalSetup->label));
+    
+    // Generate bin
+    if (pEeprom->baseEepHeader.boardFlagsExt & AR6003_BOARDFLAGSEXT_PSAT_CAL_GEN_EEPROM) {
+    rc = genEepromBinFile(pCalSetup->outputBinFilename, pEeprom);
+    assert(rc);
+    }
+
+    return;
+}
+
diff --git a/ath6kl-tcmd/athtestcmd.h b/ath6kl-tcmd/athtestcmd.h
new file mode 100644
index 0000000..0b0977f
--- /dev/null
+++ b/ath6kl-tcmd/athtestcmd.h
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#ifndef _TCMD_H_
+#define _TCMD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+enum {
+    TESTMODE_CONT_TX = 801,     /* something that doesn't collide with ascii */
+    TESTMODE_CONT_RX,
+    TESTMODE_PM,
+    TESTMODE_SETLPREAMBLE,
+    TESTMODE_SETREG,
+    TESTMODE_CMDS,
+};
+
+enum {
+    TCMD_SET_RX_LPL=501,     /* something that doesn't collide with ascii */
+    TCMD_EFUSE_START=502,
+    TCMD_EFUSE_END=503,
+    TCMD_EFUSE_DATA=504,
+    TCMD_EFUSE_DUMP=505,
+    TCMD_EFUSE_WRITE=506,
+    TCMD_OTP_DUMP=507,
+    TCMD_OTP_WRITE=508,
+    TCMD_READ_THERMAL=509,
+    TCMD_PSAT_CAL=510,
+    TCMD_PSAT_CAL_RESULT,
+    TCMD_PM_CAL_RESULT, 
+    TCMD_PM_CAL,
+    TCMD_UPDATE_CAL_OTP, 
+    TCMD_CHAR_PSAT,
+    TCMD_CHAR_PSAT_RESULT,    
+    TCMD_SINIT_WAIT,
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif				/* _TCMD_H_ */
diff --git a/ath6kl-tcmd/psatUtil b/ath6kl-tcmd/psatUtil
new file mode 100755
index 0000000..223a0a9
--- /dev/null
+++ b/ath6kl-tcmd/psatUtil
Binary files differ
diff --git a/ath6kl-tcmd/psatUtil.c b/ath6kl-tcmd/psatUtil.c
new file mode 100644
index 0000000..b8a79ef
--- /dev/null
+++ b/ath6kl-tcmd/psatUtil.c
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/types.h>
+#include <linux/if.h>
+#include <linux/wireless.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <assert.h>
+#include <ctype.h>
+#include <math.h>
+
+#include "testcmd.h"
+#include "athtestcmd.h"
+#include "sinit_common.h"
+
+#ifdef ATHTESTCMD_LIB
+#include <setjmp.h>
+extern void testcmd_error(int code, const char *fmt, ...);
+#define A_ERR testcmd_error
+#else
+#define A_ERR err
+#endif
+
+// defines
+
+#define strnicmp strncmp
+
+typedef unsigned long A_UINT32;
+typedef unsigned char A_UINT8;
+typedef int           A_BOOL;
+
+#ifdef ANDROID
+#define _TCMD_PATH "/system/bin/athtestcmd -i wlan0"
+#else
+#define _TCMD_PATH "./athtestcmd -i wlan0"
+#endif
+
+int main(void)
+{
+    char  cmd[128];
+    A_UINT32 i;
+    A_UINT32 freq;
+
+#ifdef ANDROID
+    system("insmod /system/lib/modules/cfg80211.ko");
+    sleep(2);
+
+    system("insmod /system/lib/modules/ath6kl_sdio.ko testmode=2");
+    sleep(3);
+#else
+    system("insmod /lib/modules/`uname -r`/kernel/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko testmode=2");
+    sleep(3);
+#endif
+
+    freq=2412;
+
+    for (i = 0; i < NumEntriesPSTSweepTable; i++) 
+    {
+            sprintf(cmd, "%s --psat_char %ld --txfreq %ld", _TCMD_PATH, i, freq);
+            //printf("%s\n", cmd);
+            system(cmd);
+            sprintf(cmd, "%s --psat_char_result", _TCMD_PATH);
+            //printf("%s\n", cmd);
+            system(cmd);
+            sleep(1);
+    }
+
+#ifdef ANDROID
+    system("rmmod ath6kl_sdio");
+    sleep(1);
+    system("rmmod cfg80211");
+#else
+    system("rmmod ath6kl_sdio.ko");
+#endif
+
+    return 0;
+}
+
diff --git a/ath6kl-tcmd/sinit_common.c b/ath6kl-tcmd/sinit_common.c
new file mode 100644
index 0000000..56214ce
--- /dev/null
+++ b/ath6kl-tcmd/sinit_common.c
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#include <stdint.h>
+#include "testcmd.h"
+#include "sinit_common.h"
+
+PSAT_SWEEP_TABLE psatSweepTbl[] = {
+{0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+{3, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+{0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
+{3, 1, 0, 0, 0, 0, 0, 0, 0, 0},
+{0, 0, 3, 0, 0, 0, 0, 0, 0, 0},
+{3, 0, 3, 0, 0, 0, 0, 0, 0, 0},
+{0, 1, 3, 0, 0, 0, 0, 0, 0, 0},
+{3, 1, 3, 0, 0, 0, 0, 0, 0, 0},
+{0, 0, 0, 3, 0, 0, 0, 0, 0, 0},
+{3, 0, 0, 3, 0, 0, 0, 0, 0, 0},
+{0, 1, 0, 3, 0, 0, 0, 0, 0, 0},
+{3, 1, 0, 3, 0, 0, 0, 0, 0, 0},
+{0, 0, 3, 3, 0, 0, 0, 0, 0, 0},
+{3, 0, 3, 3, 0, 0, 0, 0, 0, 0},
+{0, 1, 3, 3, 0, 0, 0, 0, 0, 0},
+{3, 1, 3, 3, 0, 0, 0, 0, 0, 0},
+{0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
+{3, 0, 0, 0, 3, 0, 0, 0, 0, 0},
+{0, 1, 0, 0, 3, 0, 0, 0, 0, 0},
+{3, 1, 0, 0, 3, 0, 0, 0, 0, 0},
+{0, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+{3, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+{0, 1, 3, 0, 3, 0, 0, 0, 0, 0},
+{3, 1, 3, 0, 3, 0, 0, 0, 0, 0},
+{0, 0, 0, 3, 3, 0, 0, 0, 0, 0},
+{3, 0, 0, 3, 3, 0, 0, 0, 0, 0},
+{0, 1, 0, 3, 3, 0, 0, 0, 0, 0},
+{3, 1, 0, 3, 3, 0, 0, 0, 0, 0},
+{0, 0, 3, 3, 3, 0, 0, 0, 0, 0},
+{3, 0, 3, 3, 3, 0, 0, 0, 0, 0},
+{0, 1, 3, 3, 3, 0, 0, 0, 0, 0},
+{3, 1, 3, 3, 3, 0, 0, 0, 0, 0},
+{0, 0, 0, 0, 0, 1, 0, 0, 0, 0},
+{3, 0, 0, 0, 0, 1, 0, 0, 0, 0},
+{0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
+{3, 1, 0, 0, 0, 1, 0, 0, 0, 0},
+{0, 0, 3, 0, 0, 1, 0, 0, 0, 0},
+{3, 0, 3, 0, 0, 1, 0, 0, 0, 0},
+{0, 1, 3, 0, 0, 1, 0, 0, 0, 0},
+{3, 1, 3, 0, 0, 1, 0, 0, 0, 0},
+{0, 0, 0, 3, 0, 1, 0, 0, 0, 0},
+{3, 0, 0, 3, 0, 1, 0, 0, 0, 0},
+{0, 1, 0, 3, 0, 1, 0, 0, 0, 0},
+{3, 1, 0, 3, 0, 1, 0, 0, 0, 0},
+{0, 0, 3, 3, 0, 1, 0, 0, 0, 0},
+{3, 0, 3, 3, 0, 1, 0, 0, 0, 0},
+{0, 1, 3, 3, 0, 1, 0, 0, 0, 0},
+{3, 1, 3, 3, 0, 1, 0, 0, 0, 0},
+{0, 0, 0, 0, 3, 1, 0, 0, 0, 0},
+{3, 0, 0, 0, 3, 1, 0, 0, 0, 0},
+{0, 1, 0, 0, 3, 1, 0, 0, 0, 0},
+{3, 1, 0, 0, 3, 1, 0, 0, 0, 0},
+{0, 0, 3, 0, 3, 1, 0, 0, 0, 0},
+{3, 0, 3, 0, 3, 1, 0, 0, 0, 0},
+{0, 1, 3, 0, 3, 1, 0, 0, 0, 0},
+{3, 1, 3, 0, 3, 1, 0, 0, 0, 0},
+{0, 0, 0, 3, 3, 1, 0, 0, 0, 0},
+{3, 0, 0, 3, 3, 1, 0, 0, 0, 0},
+{0, 1, 0, 3, 3, 1, 0, 0, 0, 0},
+{3, 1, 0, 3, 3, 1, 0, 0, 0, 0},
+{0, 0, 3, 3, 3, 1, 0, 0, 0, 0},
+{3, 0, 3, 3, 3, 1, 0, 0, 0, 0},
+{0, 1, 3, 3, 3, 1, 0, 0, 0, 0},
+{3, 1, 3, 3, 3, 1, 0, 0, 0, 0},
+{0, 0, 0, 0, 0, 0, 15, 0, 0, 0},
+{3, 0, 0, 0, 0, 0, 15, 0, 0, 0},
+{0, 1, 0, 0, 0, 0, 15, 0, 0, 0},
+{3, 1, 0, 0, 0, 0, 15, 0, 0, 0},
+{0, 0, 3, 0, 0, 0, 15, 0, 0, 0},
+{3, 0, 3, 0, 0, 0, 15, 0, 0, 0},
+{0, 1, 3, 0, 0, 0, 15, 0, 0, 0},
+{3, 1, 3, 0, 0, 0, 15, 0, 0, 0},
+{0, 0, 0, 3, 0, 0, 15, 0, 0, 0},
+{3, 0, 0, 3, 0, 0, 15, 0, 0, 0},
+{0, 1, 0, 3, 0, 0, 15, 0, 0, 0},
+{3, 1, 0, 3, 0, 0, 15, 0, 0, 0},
+{0, 0, 3, 3, 0, 0, 15, 0, 0, 0},
+{3, 0, 3, 3, 0, 0, 15, 0, 0, 0},
+{0, 1, 3, 3, 0, 0, 15, 0, 0, 0},
+{3, 1, 3, 3, 0, 0, 15, 0, 0, 0},
+{0, 0, 0, 0, 3, 0, 15, 0, 0, 0},
+{3, 0, 0, 0, 3, 0, 15, 0, 0, 0},
+{0, 1, 0, 0, 3, 0, 15, 0, 0, 0},
+{3, 1, 0, 0, 3, 0, 15, 0, 0, 0},
+{0, 0, 3, 0, 3, 0, 15, 0, 0, 0},
+{3, 0, 3, 0, 3, 0, 15, 0, 0, 0},
+{0, 1, 3, 0, 3, 0, 15, 0, 0, 0},
+{3, 1, 3, 0, 3, 0, 15, 0, 0, 0},
+{0, 0, 0, 3, 3, 0, 15, 0, 0, 0},
+{3, 0, 0, 3, 3, 0, 15, 0, 0, 0},
+{0, 1, 0, 3, 3, 0, 15, 0, 0, 0},
+{3, 1, 0, 3, 3, 0, 15, 0, 0, 0},
+{0, 0, 3, 3, 3, 0, 15, 0, 0, 0},
+{3, 0, 3, 3, 3, 0, 15, 0, 0, 0},
+{0, 1, 3, 3, 3, 0, 15, 0, 0, 0},
+{3, 1, 3, 3, 3, 0, 15, 0, 0, 0},
+{0, 0, 0, 0, 0, 1, 15, 0, 0, 0},
+{3, 0, 0, 0, 0, 1, 15, 0, 0, 0},
+{0, 1, 0, 0, 0, 1, 15, 0, 0, 0},
+{3, 1, 0, 0, 0, 1, 15, 0, 0, 0},
+{0, 0, 3, 0, 0, 1, 15, 0, 0, 0},
+{3, 0, 3, 0, 0, 1, 15, 0, 0, 0},
+{0, 1, 3, 0, 0, 1, 15, 0, 0, 0},
+{3, 1, 3, 0, 0, 1, 15, 0, 0, 0},
+{0, 0, 0, 3, 0, 1, 15, 0, 0, 0},
+{3, 0, 0, 3, 0, 1, 15, 0, 0, 0},
+{0, 1, 0, 3, 0, 1, 15, 0, 0, 0},
+{3, 1, 0, 3, 0, 1, 15, 0, 0, 0},
+{0, 0, 3, 3, 0, 1, 15, 0, 0, 0},
+{3, 0, 3, 3, 0, 1, 15, 0, 0, 0},
+{0, 1, 3, 3, 0, 1, 15, 0, 0, 0},
+{3, 1, 3, 3, 0, 1, 15, 0, 0, 0},
+{0, 0, 0, 0, 3, 1, 15, 0, 0, 0},
+{3, 0, 0, 0, 3, 1, 15, 0, 0, 0},
+{0, 1, 0, 0, 3, 1, 15, 0, 0, 0},
+{3, 1, 0, 0, 3, 1, 15, 0, 0, 0},
+{0, 0, 3, 0, 3, 1, 15, 0, 0, 0},
+{3, 0, 3, 0, 3, 1, 15, 0, 0, 0},
+{0, 1, 3, 0, 3, 1, 15, 0, 0, 0},
+{3, 1, 3, 0, 3, 1, 15, 0, 0, 0},
+{0, 0, 0, 3, 3, 1, 15, 0, 0, 0},
+{3, 0, 0, 3, 3, 1, 15, 0, 0, 0},
+{0, 1, 0, 3, 3, 1, 15, 0, 0, 0},
+{3, 1, 0, 3, 3, 1, 15, 0, 0, 0},
+{0, 0, 3, 3, 3, 1, 15, 0, 0, 0},
+{3, 0, 3, 3, 3, 1, 15, 0, 0, 0},
+{0, 1, 3, 3, 3, 1, 15, 0, 0, 0},
+{3, 1, 3, 3, 3, 1, 15, 0, 0, 0},
+};
+
+_CMAP_PWR_MAPPING CmacPwrLkupTbl[] = { 
+{100000, -433},
+{110000, -429},
+{120000, -425},
+{130000, -421},
+{140000, -418},
+{150000, -415},
+{160000, -412},
+{170000, -410},
+{180000, -407},
+{190000, -405},
+{200000, -403},
+{210000, -400},
+{220000, -398},
+{230000, -397},
+{240000, -395},
+{250000, -393},
+{260000, -391},
+{280000, -388},
+{290000, -386},
+{310000, -384},
+{330000, -381},
+{350000, -378},
+{380000, -375},
+{400000, -372},
+{430000, -369},
+{460000, -366},
+{500000, -363},
+{550000, -359},
+{600000, -355},
+{650000, -351},
+{700000, -348},
+{750000, -345},
+{800000, -342},
+{850000, -340},
+{900000, -337},
+{950000, -335},
+{1000000, -333},
+{1100000, -329},
+{1200000, -325},
+{1300000, -321},
+{1400000, -318},
+{1500000, -315},
+{1600000, -312},
+{1700000, -310},
+{1800000, -307},
+{1900000, -305},
+{2000000, -303},
+{2100000, -300},
+{2200000, -298},
+{2400000, -295},
+{2500000, -293},
+{2700000, -290},
+{2800000, -288},
+{3000000, -285},
+{3200000, -282},
+{3500000, -278},
+{3800000, -275},
+{4000000, -272},
+{4200000, -270},
+{4400000, -268},
+{4800000, -265},
+{5200000, -261},
+{5400000, -259},
+{5800000, -256},
+{6200000, -253},
+{6800000, -249},
+{7400000, -246},
+{7800000, -243},
+{8400000, -240},
+{8600000, -239},
+{9300000, -236},
+{10200000, -232},
+{10800000, -229},
+{11700000, -226},
+{12400000, -223},
+{13600000, -219},
+{14800000, -216},
+{15600000, -213},
+{16800000, -210},
+{17600000, -208},
+{18800000, -205},
+{20500000, -202},
+{21500000, -199},
+{23500000, -196},
+{25000000, -193},
+{26500000, -190},
+{29000000, -186},
+{33500000, -180},
+{42000000, -170},
+{53000000, -160},
+{67000000, -150},
+{84000000, -140},
+{106000000, -130},
+{135000000, -120},
+{155000000, -114},
+{175000000, -109},
+{200000000, -103},
+{230000000, -97},
+{265000000, -91},
+{300000000, -85},
+{330000000, -81},
+{360000000, -78},
+{390000000, -74},
+{430000000, -70},
+{470000000, -66},
+{520000000, -62},
+{570000000, -58},
+{620000000, -54},
+{680000000, -50},
+{750000000, -46},
+};
+
+uint16_t NumEntriesPSTSweepTable = sizeof(psatSweepTbl)/sizeof(PSAT_SWEEP_TABLE);
+
+int32_t
+interpolate_round(int32_t target, int32_t srcLeft, int32_t srcRight,
+            int32_t targetLeft, int32_t targetRight, int32_t roundUp)
+{
+    int32_t rv, tmp;
+
+    if (srcRight == srcLeft) {
+        rv = targetLeft;
+    } else {
+        tmp = srcRight - srcLeft;
+        rv = (((target - srcLeft) * targetRight) / tmp) +
+             (((srcRight - target) * targetLeft) / tmp);
+    }
+
+    return(rv);
+}
+
+
+int16_t cmac2Pwr_t10(uint32_t cmac)
+{
+   uint32_t i;
+   int16_t cmacResult;
+   for (i=0;i<CMAC_PWR_LOOKUP_MAX;i++) {
+       if (cmac < CmacPwrLkupTbl[i].cmac) {
+           break;
+       }
+   } 
+   if (0 == i) {
+       return(CmacPwrLkupTbl[0].pwr_t10);
+   }
+   else if (CMAC_PWR_LOOKUP_MAX == i) {
+       return(CmacPwrLkupTbl[CMAC_PWR_LOOKUP_MAX -1].pwr_t10);
+   }
+   else {
+        /* Added a "DEVIDE_COEFF" to avoid the overflow */      
+        cmacResult = interpolate_round((cmac / DEVIDE_COEFF), (CmacPwrLkupTbl[i-1].cmac / DEVIDE_COEFF), (CmacPwrLkupTbl[i].cmac / DEVIDE_COEFF), 
+            CmacPwrLkupTbl[i-1].pwr_t10, CmacPwrLkupTbl[i].pwr_t10, 10);
+   }
+
+   return(cmacResult);
+}
+
+
diff --git a/ath6kl-tcmd/sinit_common.h b/ath6kl-tcmd/sinit_common.h
new file mode 100644
index 0000000..b19770f
--- /dev/null
+++ b/ath6kl-tcmd/sinit_common.h
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#ifndef  _PSAT_COMMON_H_
+#define  _PSAT_COMMON_H_
+
+#include <stdint.h>
+#include "testcmd.h"
+
+#define DEVIDE_COEFF 10000
+
+// CMAC to power lookup table, for platform such as embedded without sophisticated math function 
+typedef struct {
+    uint32_t cmac;
+    int32_t  pwr_t10;
+} _CMAP_PWR_MAPPING;
+
+extern _CMAP_PWR_MAPPING CmacPwrLkupTbl[];
+#define CMAC_PWR_LOOKUP_MAX (sizeof(CmacPwrLkupTbl) / sizeof(_CMAP_PWR_MAPPING))
+
+extern PSAT_SWEEP_TABLE psatSweepTbl[];
+extern uint16_t NumEntriesPSTSweepTable;
+
+int32_t interpolate_round(int32_t target, int32_t srcLeft, int32_t srcRight,
+            int32_t targetLeft, int32_t targetRight, int32_t roundUp);
+int16_t cmac2Pwr_t10(uint32_t cmac);
+
+#endif //#ifndef _PSAT_COMMON_H_
diff --git a/ath6kl-tcmd/sinit_eep.h b/ath6kl-tcmd/sinit_eep.h
new file mode 100644
index 0000000..709be34
--- /dev/null
+++ b/ath6kl-tcmd/sinit_eep.h
@@ -0,0 +1,359 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#ifndef _AR6003_EEPROM_STRUCT_H_
+#define _AR6003_EEPROM_STRUCT_H_
+
+#include <stdint.h>
+
+#define PREPACK
+#define POSTPACK __attribute__ ((packed))
+
+#define AR6003_EEP_VER_MINOR_MASK    0xFFF
+#define AR6003_EEP_MINOR_VER5        0x5  
+#define AR6003_EEP_MINOR_VER10        0xA
+#define AR6K_EEPROM_SIZE_PRIOR_VER4   1024
+#define AR6K_EEPROM_SIZE_LARGEST      2048
+
+#define AR6003_NUM_5G_CAL_PIERS      8
+#define AR6003_NUM_2G_CAL_PIERS      3
+#define AR6003_NUM_5G_CAL_PIERS_EXPANDED      32
+#define AR6003_NUM_2G_CAL_PIERS_EXPANDED      16
+#define AR6003_BCHAN_UNUSED          0xFF
+
+#define AR6003_BOARDFLAGSEXT_PSAT_CAL_GEN_EEPROM    0x04
+#define AR6003_BOARDFLAGSEXT_PSAT_CAL_ABS           0x08
+
+#define FREQ2FBIN(x,y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5))
+#define FBIN2FREQ(x,y) ((y) ? ((x) + 2300) : (((x) * 5) + 4800))
+#define AR6003_MAX_CHAINS            1
+#define AR6003_EEPROM_MODAL_SPURS    5
+#define AR6003_NUM_ALPHATHERM_CHAN_PIERS        4
+#define AR6003_NUM_ALPHATHERM_TEMP_PIERS        4
+#define AR6003_NUM_5G_20_TARGET_POWERS  8
+#define AR6003_NUM_5G_40_TARGET_POWERS  8
+#define AR6003_NUM_2G_CCK_TARGET_POWERS 2
+#define AR6003_NUM_2G_20_TARGET_POWERS  3
+#define AR6003_NUM_2G_40_TARGET_POWERS  3
+#define AR6003_NUM_CTLS              21
+#define AR6003_NUM_BAND_EDGES        8
+#define AR6003_NUM_PD_GAINS          4
+#define NUM_ATECAL_CHANS_2G  4
+#define NUM_ATECAL_CHANS_5G  10
+#define AR6003_PD_GAIN_ICEPTS        5
+#define STICKY_REG_TBL_SIZE_MAX 8
+#define MAX_CUSTDATA_BYTES 16
+
+typedef enum {
+    WLAN_11A_CAPABILITY   = 1,
+    WLAN_11G_CAPABILITY   = 2,
+    WLAN_11AG_CAPABILITY  = 3,
+}WALN_CAPABILITY;
+
+typedef enum {
+    TGTPWR_LEG_6_24 = 0,
+    TGTPWR_LEG_36,
+    TGTPWR_LEG_48,
+    TGTPWR_LEG_54,
+    TGTPWR_LEG_LAST
+} TGTPWR_LEG;
+
+typedef enum {
+    TGTPWR_HT_0 = 0,
+    TGTPWR_HT_1,
+    TGTPWR_HT_2,
+    TGTPWR_HT_3,
+    TGTPWR_HT_4,
+    TGTPWR_HT_5,
+    TGTPWR_HT_6,
+    TGTPWR_HT_7,
+    TGTPWR_HT_LAST
+} TGTPWR_HT;
+
+typedef PREPACK struct Ar6003_spurChanStruct {
+    uint8_t   spurChan;                      /*spur mitigation enabled in the channel bitmap, 1 bit 1 channel*/
+    uint8_t   spurABChoose;              /*choose which is master spur ,spur_A or spur_B*/
+    uint8_t   spurA_PrimSecChoose; /*choose primary and secondary spur which produce by spur_A*/            
+    uint8_t   spurB_PrimSecChoose; /*choose primary and secondary spur which produce by spur_B*/            
+} POSTPACK AR6003_SPUR_CHAN;
+
+typedef union Ar6003_obdbStruct {
+    uint16_t value;
+    struct g_bits {
+        uint16_t paloff   :  3,
+                 qam      :  3,
+                 psk      :  3,
+                 cck      :  3,
+                 db       :  3,
+                 unused   :  1;
+    } g_obdb;
+    struct a_bits {
+        uint16_t d2b      :  3,
+                 d3b      :  3,
+                 d4b      :  3,
+                 ob       :  3,
+                 unused   :  4;
+    } a_obdb;
+} POSTPACK AR6003_OBDB;
+
+typedef PREPACK struct Ar6003_BaseEepHeader {
+    uint32_t  length;                                                  // 4 B
+    uint16_t  checksum;                                                // 2 B
+    uint16_t  version;                                                 // 2 B
+    uint16_t  opCapFlags;                                              // 2 B
+    uint16_t  boardFlags;                                              // 2 B
+    uint16_t  regDmn[2];                                               // 4 B
+    uint16_t  subSystemId;                                             // 2 B
+    uint16_t  blueToothOptions;                                        // 2 B 
+    uint16_t  binBuildNumber; // major(4):minor(5):build(7)            // 2 B   
+    uint8_t   macAddr[6];                                              // 6 B
+    uint8_t   bdAddr[6];                                               // 6 B
+    uint8_t   rxMask;                                                  // 1 B
+    uint8_t   txMask;                                                  // 1 B
+    int8_t    cckOfdmDelta;                                            // 1 B
+    uint8_t   custData[MAX_CUSTDATA_BYTES];                            // 16 B    
+    uint8_t   reserved[4];                                             // 4 B reserved for custData. Sometimes custData exceed the max bytes
+    uint8_t   spurBaseA;                                               // 1 B
+    uint8_t   spurBaseB;                                               // 1 B
+    uint8_t   spurRssiThresh;                                          // 1 B
+    uint8_t   HTCapFlags;                                              // 1 B 
+    uint8_t   boardFlagsExt;                                           // 1 B
+    uint8_t   futureBase[6];                                           // 6 B
+} POSTPACK AR6003_BASE_EEP_HEADER;                                     // 68 B
+
+// Notes:
+// - IQ CAL is done by sw for every reset, here we store the default values in case IQ CAL 
+//   is not done for whatever reason.
+typedef PREPACK struct Ar6003_ModalEepHeader {
+    uint32_t  antCtrlChain[AR6003_MAX_CHAINS];                         // 4B, "chn_b0_switch_table", AntE only  
+    uint32_t  antCtrlCom1;                                             // 4B, "com1_switch_table", AntA, B, C, D
+    uint32_t  antCtrlCom2;                                             // 4B, "com2_switch_table"
+    AR6003_OBDB ob_db;                                                 // 2B, a number of ob, db fields
+    uint8_t   anaXtalConfig[6];                                        // 6B, tbd?: for xtal/synth related fields, tobe replaced with a struct
+    int8_t    antennaGainCh[AR6003_MAX_CHAINS];                        // 1B, affect antenna gain calculation
+    uint8_t   switchSettling;                                          // 1B, "time_switch_settling"
+    uint8_t   swSettleHt40;                                            // 1B, "time_switch_settling" for HT40 
+    uint8_t   xatten1Db[AR6003_MAX_CHAINS];                            // 1B, "xatten1_db_0"
+    uint8_t   xatten1Margin[AR6003_MAX_CHAINS];                        // 1B, "xatten1_margin_0"    
+    uint8_t   xatten1Hyst[AR6003_MAX_CHAINS];                          // 1B, "xatten1_hyst_margin_0"
+    uint8_t   xatten2Db[AR6003_MAX_CHAINS];                            // 1B, "xatten2_db_0"
+    uint8_t   xatten2Margin[AR6003_MAX_CHAINS];                        // 1B, "xatten2_margin_0"    
+    uint8_t   xatten2Hyst[AR6003_MAX_CHAINS];                          // 1B, "xatten2_hyst_margin_0"    
+    int8_t    adcDesiredSize;                                          // 1B, "adc_desired_size"
+    uint8_t   txEndToXpaOff;                                           // 1B, "tx_end_to_xpaa_off", "tx_end_to_xpab_off"
+    uint8_t   txEndToRxOn;                                             // 1B, "tx_end_to_a2_rx_on"
+    uint8_t   txFrameToXpaOn;                                          // 1B, "tx_frame_to_xpaa_on", "tx_frame_to_xpab_on"
+    uint8_t   txFrameToDataStart;                                      // 1B, "tx_frame_to_tx_d_start"
+    uint8_t   txFrameToPaOn;                                           // 1B, "tx_frame_to_pa_on"
+    uint8_t   thresh62;                                                // 1B, "cf_thresh62"
+    int8_t    noiseFloorThreshCh[AR6003_MAX_CHAINS];                   // 1B, tbd?: what to set?
+    int8_t    rxIqCalICh[AR6003_MAX_CHAINS];                           // 1B, "rx_iqcorr_q_i_coff_0"  
+    int8_t    rxIqCalQCh[AR6003_MAX_CHAINS];                           // 1B, "rx_iqcorr_q_q_coff_0"
+    uint8_t   xpaBiasLvl;                                              // 1B, "an_top_xpabiaslvl"
+    uint8_t   ht40PowerIncForPdadc;                                    // 1B, affect tx power in HT40
+    uint8_t   enableXpa;                                               // 1B, "bb_enable_xpab | bb_enable_xpaa"
+    AR6003_SPUR_CHAN spurChans[AR6003_EEPROM_MODAL_SPURS];             // 4 * 5 = 20 B, tbd?:     
+    uint8_t   alphaTherm;                                              // 1B, "alpha_therm"
+    uint8_t   alphaThermPalOn;                                         // 1B, "alpha_therm_pal_on"
+    uint8_t   alphaVolt;                                               // 1B, "alpha_volt"
+    uint8_t   alphaVoltPalOn;                                          // 1B, "alpha_volt_pal_on"
+    int8_t    adcDesiredSizeHT40;                                      // 1B, "adc_desired_size" for HT40
+    uint8_t   paprdQuickDrop;                                          // 1B, "bb_paprd_trainer_cntl3_cf_paprd_quick_drop"
+    uint8_t   txGainTbl_0;           // bb_tx_gain_table_0
+    uint8_t   txGainTblDelta[16];    // bb_tx_gain_table_x (_1 to _32, 4 bits per delta) for PAL OFF??
+    uint8_t   reserved[3];
+    uint32_t  antCtrlExtCommon1;
+    uint32_t  antCtrlExtCommon2;
+    uint8_t   alphaThermChans[AR6003_NUM_ALPHATHERM_CHAN_PIERS];        // 4B, "alpha therm channels"
+    uint8_t   alphaThermTbl[AR6003_NUM_ALPHATHERM_CHAN_PIERS][AR6003_NUM_ALPHATHERM_TEMP_PIERS];      // 16B, "alpha_therm_tbl" lowtemp midtemp1 midtemp2 hightemp
+    uint8_t   areg_lvlctr;                                              // 1 B
+    uint8_t   pareg_lvlctr;                                             // 1 B
+    uint8_t   txGainTblMax;                                             // 1 B
+    uint8_t   cckInitRfGain;                                            // 1 B
+    uint16_t  paprdMinCorrThreshold;                                    // 2 B
+    uint8_t   an_rxrf_bias1_pwd_ic25vga5g;                              // 1 B
+    uint8_t   futureModal[5];                                           // 5 B  
+} POSTPACK AR6003_MODAL_EEP_HEADER;                                     // 128 B
+
+typedef PREPACK struct Ar6003_calDataPerFreq {
+    uint8_t pwrPdg[AR6003_NUM_PD_GAINS][AR6003_PD_GAIN_ICEPTS];        // 20 B
+    uint8_t vpdPdg[AR6003_NUM_PD_GAINS][AR6003_PD_GAIN_ICEPTS];        // 20 B
+} POSTPACK AR6003_CAL_DATA_PER_FREQ;                                   // 40 B
+
+typedef PREPACK struct Ar6003_calDataPerFreqOlpc {
+    int8_t  olpcGainDelta;                                             // 1B, "olpc_gain_delta"
+    uint8_t thermCalVal;                                               // 1B, "therm_cal_value"
+    uint8_t voltCalVal;                                                // 1B, "volt_cal_value"
+    int8_t  olpcGainDeltaPALOn;                                        // 1B, "olpc_gain_delta_pal_on"
+} POSTPACK AR6003_CAL_DATA_PER_FREQ_OLPC;                              // 4 B
+
+typedef PREPACK struct Ar6003_calDataPerFreqOlpcExpanded {
+    AR6003_CAL_DATA_PER_FREQ_OLPC olpcBasic;                            // 4B
+    int16_t  olpcGainDelta_t10;                                         // 2B  "untruncated olpc gain delta 0.1dB resolution"
+    uint8_t  desiredScaleCck_t10;                                       // 1B, "desired_scale_cck"
+    uint8_t  desiredScale6M_t10;                                        // 1B
+    uint8_t  desiredScale36M_t10;                                       // 1B
+    uint8_t  desiredScale54M_t10;                                       // 1B
+    uint8_t  desiredScaleMCS0HT20_t10;                                  // 1B
+    uint8_t  desiredScaleMCS7HT20_t10;                                  // 1B
+    uint8_t  desiredScaleMCS0HT40_t10;                                  // 1B
+    uint8_t  desiredScaleMCS7HT40_t10;                                  // 1B
+} POSTPACK AR6003_CAL_DATA_PER_FREQ_OLPC_EXPANDED;                      // 14 B
+
+typedef PREPACK struct Ar6003_calDataPerFreqOlpcATEDelta {
+    int16_t olpcGainDelta_t10;                                         // 2B  
+} POSTPACK AR6003_CAL_DATA_PER_FREQ_OLPC_FE_DELTA;                     // 2B
+
+typedef PREPACK struct Ar6003_CalTargetPowerLegacy {
+    uint8_t  bChannel;
+    uint8_t  tPow2x[4];
+} POSTPACK AR6003_CAL_TARGET_POWER_LEG;     // 5B
+
+typedef PREPACK struct Ar6003_CalTargetPowerHt {
+    uint8_t  bChannel;
+    uint8_t  tPow2x[8];
+} POSTPACK AR6003_CAL_TARGET_POWER_HT;
+
+typedef PREPACK struct Ar6003_CalCtlEdges {
+    uint8_t  bChannel;
+    uint8_t  tPower :6,
+             flag   :2;
+} POSTPACK AR6003_CAL_CTL_EDGES;
+
+typedef PREPACK struct Ar6003_CalCtlData {
+    AR6003_CAL_CTL_EDGES  ctlEdges[AR6003_MAX_CHAINS][AR6003_NUM_BAND_EDGES];                     // 2 * 8 = 16 B 
+} POSTPACK AR6003_CAL_CTL_DATA;  // 16 B
+
+typedef PREPACK struct Ar6003_CalDataPerChip {
+    int16_t     thermAdcScaledGain;   // 2B, "therm_adc_scaled_gain"
+    int8_t      thermAdcOffset;       // 1B, "therm_adc_offset"
+    uint8_t     xtalCapOutDac;        // 1B, "xtal_capoutdac"
+    uint8_t     xtalCapInDac;         // 1B, "xtal_capindac"
+    uint8_t     refBiasTrim;          // 1B, tbd?: what field? 
+} POSTPACK AR6003_CAL_DATA_PER_CHIP;  // 6 B
+
+typedef PREPACK struct ateProvided {
+    uint8_t GoldenTherm;
+    uint8_t GoldenVolt;
+    uint8_t pcDac;
+    uint8_t vtestLCodeGolden;           
+    int8_t  vtestLVoltGolden;            
+    uint8_t vtestHCodeGolden;             
+    int8_t  vtestHVoltGolden;              
+    uint8_t numCalChans5G;
+    uint8_t numCalChans2G;                            // 1B
+    uint8_t calFreqPier5G[NUM_ATECAL_CHANS_5G];       // 10B
+    uint8_t calFreqPier2G[NUM_ATECAL_CHANS_2G];       // 4B
+    uint8_t ateZeroCalFlag;                           // 1B
+} POSTPACK AR6003_ATE_PROVIDED_DATA;                  // 24B
+
+typedef PREPACK struct stickyRegTbl {
+	uint32_t address;
+	uint32_t value;
+} POSTPACK AR6003_STICKY_REG_TABLE;             // 8B
+
+#define PSAT_AN_TXRF3_RDIV2G_LSB                    0        // an_txrf3_rdiv2g;
+#define PSAT_AN_TXRF3_RDIV2G_MASK                   0x3      // an_txrf3_rdiv2g;
+#define PSAT_AN_TXRF3_PDPREDIST2G_LSB               2        // an_txrf3_pdpredist2g;               
+#define PSAT_AN_TXRF3_PDPREDIST2G_MASK              0x1      // an_txrf3_pdpredist2g;               
+#define PSAT_AN_RXTX2_MXRGAIN_LSB                   3        // an_rxtx2_mxrgain;            
+#define PSAT_AN_RXTX2_MXRGAIN_MASK                  0x3      // an_rxtx2_mxrgain;            
+#define PSAT_AN_RXRF_BIAS1_PWD_IC25MXR2GH_LSB       5        // an_rxrf_bias1_pwd_ic25mxr2gh;
+#define PSAT_AN_RXRF_BIAS1_PWD_IC25MXR2GH_MASK      0x7      // an_rxrf_bias1_pwd_ic25mxr2gh;
+#define PSAT_AN_BIAS2_PWD_IC25RXRF_LSB              8        // an_bias2_pwd_ic25rxrf;      
+#define PSAT_AN_BIAS2_PWD_IC25RXRF_MASK             0x7      // an_bias2_pwd_ic25rxrf;      
+#define PSAT_AN_BB1_I2V_CURR2X_LSB                  11       // an_bb1_i2v_curr2x;         
+#define PSAT_AN_BB1_I2V_CURR2X_MASK                 0x1      // an_bb1_i2v_curr2x;         
+#define PSAT_AN_TXRF6_CAPDIV2G_LSB                  12       // an_txrf6_capdiv2g;         
+#define PSAT_AN_TXRF6_CAPDIV2G_MASK                 0xF      // an_txrf6_capdiv2g;         
+
+typedef PREPACK struct ar6kPSATCAL {
+    int16_t    psat_t10;
+    int16_t    ofdmCwDelta_t10;
+    int16_t    cmacOlpcPsatDeltaGu_t10;
+    int16_t    olpcGainDeltaGu_t10;
+    uint8_t    olpcPcdac;
+    uint8_t    psatPcdac;
+    uint16_t   psatTuneParms;
+    uint16_t   psatTuneParmsAlt1;
+} POSTPACK AR6003_PSAT_CAL_PARMS;             
+
+typedef PREPACK struct ar6kEeprom {
+    // base
+    AR6003_BASE_EEP_HEADER       baseEepHeader;                                                // 68 B
+    // modal
+    AR6003_MODAL_EEP_HEADER      modalHeader[2];                                               // 256 B
+
+    // CAL section
+    uint8_t                      calFreqPier5G[AR6003_NUM_5G_CAL_PIERS];                       // 8 B
+    uint8_t                      calFreqPier2G[AR6003_NUM_2G_CAL_PIERS];                       // 3 B
+    uint8_t                      padding1;                                                     // 1 B
+    AR6003_CAL_DATA_PER_FREQ_OLPC calPierData5G[AR6003_NUM_5G_CAL_PIERS];                      // 4 * 8 = 32 B
+    AR6003_CAL_DATA_PER_FREQ_OLPC calPierData2G[AR6003_NUM_2G_CAL_PIERS];                      // 4 * 3 = 12 B 
+    // ATE CAL data from OTP
+    AR6003_CAL_DATA_PER_CHIP     calPerChip;                                                   // 6 B
+    // future expansion of CAL data
+    AR6003_PSAT_CAL_PARMS        psatCAL;                                                      // 14B
+
+    // target power
+    AR6003_CAL_TARGET_POWER_LEG  calTargetPower5G[AR6003_NUM_5G_20_TARGET_POWERS];             // 5 * 8 = 40 B 
+    AR6003_CAL_TARGET_POWER_HT   calTargetPower5GHT20[AR6003_NUM_5G_20_TARGET_POWERS];         // 9 * 8 = 72 B 
+    AR6003_CAL_TARGET_POWER_HT   calTargetPower5GHT40[AR6003_NUM_5G_40_TARGET_POWERS];         // 9 * 8 = 72 B
+    AR6003_CAL_TARGET_POWER_LEG  calTargetPowerCck[AR6003_NUM_2G_CCK_TARGET_POWERS];           // 5 * 2 = 10 B 
+    AR6003_CAL_TARGET_POWER_LEG  calTargetPower2G[AR6003_NUM_2G_20_TARGET_POWERS];             // 5 * 3 = 15 B  
+    AR6003_CAL_TARGET_POWER_HT   calTargetPower2GHT20[AR6003_NUM_2G_20_TARGET_POWERS];         // 9 * 3 = 27 B
+    AR6003_CAL_TARGET_POWER_HT   calTargetPower2GHT40[AR6003_NUM_2G_40_TARGET_POWERS];         // 9 * 3 = 27 B    // 263B  
+    uint8_t                      psatTuneParmsAlt4_H;                                          // 1 B             // 264B
+    // CTL
+    uint8_t                      ctlIndex[AR6003_NUM_CTLS];                                    // 21 B
+    uint8_t                      psatTuneParmsAlt4_L;                                          // 1 B             
+    uint16_t                     psatTuneParmsAlt2;                                            // 2 B             
+    AR6003_CAL_CTL_DATA          ctlData[AR6003_NUM_CTLS];                                     // 16 * 21 = 336 B  // 360B 
+                                                                                               // total: 1024B
+    uint8_t                      calFreqPier5GExpanded[AR6003_NUM_5G_CAL_PIERS_EXPANDED];      // 32 B
+    uint8_t                      calFreqPier2GExpanded[AR6003_NUM_2G_CAL_PIERS_EXPANDED];      // 16 B
+    AR6003_CAL_DATA_PER_FREQ_OLPC_EXPANDED calPierData5GExpanded[AR6003_NUM_5G_CAL_PIERS_EXPANDED]; // 14 * 32 = 448 B
+    AR6003_CAL_DATA_PER_FREQ_OLPC_EXPANDED calPierData2GExpanded[AR6003_NUM_2G_CAL_PIERS_EXPANDED]; // 14 * 16 = 224 B 
+
+    AR6003_ATE_PROVIDED_DATA     ateProvidedData;                                              // 24B
+
+    int8_t                       calTgtPwrBkoff2GLeg[TGTPWR_LEG_LAST];                         // 4B
+    int8_t                       calTgtPwrBkoff2GHT20[TGTPWR_HT_LAST];                         // 8B
+    int8_t                       calTgtPwrBkoff2GHT40[TGTPWR_HT_LAST];                         // 8B
+
+    uint16_t                     psatTuneParmsAlt3;                                            // 2B
+    uint16_t                     checksumExpanded;                                             // 2B
+                                                                                               // total: 768B 
+    AR6003_CAL_DATA_PER_FREQ_OLPC_FE_DELTA calDataFEDelta5G[AR6003_NUM_5G_CAL_PIERS_EXPANDED];                  // 2 * 32 =  64 B	
+    AR6003_CAL_DATA_PER_FREQ_OLPC_FE_DELTA calDataFEDelta2G[AR6003_NUM_2G_CAL_PIERS_EXPANDED];                  // 2 * 16 = 32 B
+    uint16_t                    psatTuneParmsAlt7;                                               // 2B
+    uint16_t                    psatTuneParmsAlt8;                                               // 2B
+    uint16_t                    psatTuneParmsAlt9;                                               // 2B
+    int16_t                     cmacOlpcPsatDeltaGuMid_t10;                                      // 2B
+    int16_t                     cmacOlpcPsatDeltaGuHigh_t10;                                     // 2B
+    uint16_t                    psatTuneParmsAltSet[10];                                         // 20B
+    int8_t                      psatTuneParmsOlpcPsatCmacDelta[20];                              // 20B               
+    uint8_t                     padding5[42];                                                    // 42B 
+	  //uint32_t                   pllClkModa;                                                          
+    AR6003_STICKY_REG_TABLE stickyRegTable[STICKY_REG_TBL_SIZE_MAX];                             // 64B
+    //uint8_t                     stickyRegTableSize;                                            
+    uint16_t                    psatTuneParmsAlt5;                                               // 2B 
+    uint16_t                    psatTuneParmsAlt6;                                               // 2B 
+    //uint16_t                    checksum0CAL;                                                  
+                                                                                                 // total: 256B
+} POSTPACK AR6003_EEPROM;                                                                        // 1024 + 768 + 256 = 2048B
+
+#endif //_AR6003_EEPROM_STRUCT_H_
diff --git a/ath6kl-tcmd/testcmd.h b/ath6kl-tcmd/testcmd.h
new file mode 100644
index 0000000..f543e39
--- /dev/null
+++ b/ath6kl-tcmd/testcmd.h
@@ -0,0 +1,364 @@
+/*
+* Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+*
+* Permission to use, copy, modify, and/or distribute this software for any
+* purpose with or without fee is hereby granted, provided that the above
+* copyright notice and this permission notice appear in all copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#ifndef  TESTCMD_H_
+#define  TESTCMD_H_
+
+#include <stdint.h>
+
+#ifdef AR6002_REV2
+#define TCMD_MAX_RATES 12
+#else
+#define TCMD_MAX_RATES 28
+#endif
+
+#define PREPACK
+#define POSTPACK __attribute__ ((packed))
+
+#define ATH_MAC_LEN 6
+#define TC_CMDS_SIZE_MAX  256
+
+typedef enum {
+	ZEROES_PATTERN = 0,
+	ONES_PATTERN,
+	REPEATING_10,
+	PN7_PATTERN,
+	PN9_PATTERN,
+	PN15_PATTERN
+} TX_DATA_PATTERN;
+
+/* Continous tx
+   mode : TCMD_CONT_TX_OFF - Disabling continous tx
+          TCMD_CONT_TX_SINE - Enable continuous unmodulated tx
+          TCMD_CONT_TX_FRAME- Enable continuous modulated tx
+   freq : Channel freq in Mhz. (e.g 2412 for channel 1 in 11 g)
+dataRate: 0 - 1 Mbps
+          1 - 2 Mbps
+          2 - 5.5 Mbps
+          3 - 11 Mbps
+          4 - 6 Mbps
+          5 - 9 Mbps
+          6 - 12 Mbps
+          7 - 18 Mbps
+          8 - 24 Mbps
+          9 - 36 Mbps
+         10 - 28 Mbps
+         11 - 54 Mbps
+  txPwr: Tx power in dBm[5 -11] for unmod Tx, [5-14] for mod Tx
+antenna:  1 - one antenna
+          2 - two antenna
+Note : Enable/disable continuous tx test cmd works only when target is awake.
+*/
+
+typedef enum {
+	TCMD_CONT_TX_OFF = 0,
+	TCMD_CONT_TX_SINE,
+	TCMD_CONT_TX_FRAME,
+	TCMD_CONT_TX_TX99,
+	TCMD_CONT_TX_TX100,
+	TCMD_CONT_TX_OFFSETTONE,
+} TCMD_CONT_TX_MODE;
+
+typedef enum {
+	TCMD_WLAN_MODE_NOHT = 0,
+	TCMD_WLAN_MODE_HT20 = 1,
+	TCMD_WLAN_MODE_HT40PLUS = 2,
+	TCMD_WLAN_MODE_HT40MINUS = 3,
+        TCMD_WLAN_MODE_CCK = 4,
+
+        TCMD_WLAN_MODE_MAX,
+        TCMD_WLAN_MODE_INVALID = TCMD_WLAN_MODE_MAX
+} TCMD_WLAN_MODE;
+
+typedef enum {
+    TPC_TX_PWR = 0,
+    TPC_FORCED_GAIN,
+    TPC_TGT_PWR
+} TPC_TYPE;
+
+typedef PREPACK struct {
+	uint32_t testCmdId;
+	uint32_t mode;
+	uint32_t freq;
+	uint32_t dataRate;
+	int32_t txPwr;
+	uint32_t antenna;
+	uint32_t enANI;
+	uint32_t scramblerOff;
+	uint32_t aifsn;
+	uint16_t pktSz;
+	uint16_t txPattern;
+	uint32_t shortGuard;
+	uint32_t numPackets;
+	uint32_t wlanMode;
+        uint32_t tpcm;
+} POSTPACK TCMD_CONT_TX;
+
+#define TCMD_TXPATTERN_ZERONE                 0x1
+#define TCMD_TXPATTERN_ZERONE_DIS_SCRAMBLE    0x2
+
+/* Continuous Rx
+ act: TCMD_CONT_RX_PROMIS - promiscuous mode (accept all incoming frames)
+      TCMD_CONT_RX_FILTER - filter mode (accept only frames with dest
+                                             address equal specified
+                                             mac address (set via act =3)
+      TCMD_CONT_RX_REPORT  off mode  (disable cont rx mode and get the
+                                          report from the last cont
+                                          Rx test)
+
+     TCMD_CONT_RX_SETMAC - set MacAddr mode (sets the MAC address for the
+                                                 target. This Overrides
+                                                 the default MAC address.)
+
+*/
+typedef enum {
+	TCMD_CONT_RX_PROMIS = 0,
+	TCMD_CONT_RX_FILTER,
+	TCMD_CONT_RX_REPORT,
+	TCMD_CONT_RX_SETMAC,
+	TCMD_CONT_RX_SET_ANT_SWITCH_TABLE,
+	TC_CMD_RESP,
+	TCMD_CONT_RX_GETMAC,
+} TCMD_CONT_RX_ACT;
+
+typedef PREPACK struct {
+	uint32_t testCmdId;
+	uint32_t act;
+	uint32_t enANI;
+	PREPACK union {
+		struct PREPACK TCMD_CONT_RX_PARA {
+			uint32_t freq;
+			uint32_t antenna;
+			uint32_t wlanMode;
+		} POSTPACK para;
+		struct PREPACK TCMD_CONT_RX_REPORT {
+			uint32_t totalPkt;
+			int32_t rssiInDBm;
+			uint32_t crcErrPkt;
+			uint32_t secErrPkt;
+			uint16_t rateCnt[TCMD_MAX_RATES];
+			uint16_t rateCntShortGuard[TCMD_MAX_RATES];
+		} POSTPACK report;
+		struct PREPACK TCMD_CONT_RX_MAC {
+			char addr[ATH_MAC_LEN];
+			char btaddr[ATH_MAC_LEN];
+                        uint16_t regDmn[2];
+                        uint32_t otpWriteFlag;
+		} POSTPACK mac;
+		struct PREPACK TCMD_CONT_RX_ANT_SWITCH_TABLE {
+			uint32_t antswitch1;
+			uint32_t antswitch2;
+		} POSTPACK antswitchtable;
+	} POSTPACK u;
+} POSTPACK TCMD_CONT_RX;
+
+/* Force sleep/wake  test cmd
+ mode: TCMD_PM_WAKEUP - Wakeup the target
+       TCMD_PM_SLEEP - Force the target to sleep.
+ */
+typedef enum {
+	TCMD_PM_WAKEUP = 1,	/* be consistent with target */
+	TCMD_PM_SLEEP,
+	TCMD_PM_DEEPSLEEP
+} TCMD_PM_MODE;
+
+typedef enum {
+    TC_CMDS_VERSION_RESERVED=0,
+    TC_CMDS_VERSION_MDK,
+    TC_CMDS_VERSION_TS,
+    TC_CMDS_VERSION_LAST,
+} TC_CMDS_VERSION;
+
+typedef enum {
+    TC_CMDS_TS =0,
+    TC_CMDS_CAL,
+    TC_CMDS_TPCCAL = TC_CMDS_CAL,
+    TC_CMDS_TPCCAL_WITH_OTPWRITE,
+    TC_CMDS_OTPDUMP,
+    TC_CMDS_OTPSTREAMWRITE,
+    TC_CMDS_EFUSEDUMP,
+    TC_CMDS_EFUSEWRITE,
+    TC_CMDS_READTHERMAL,
+    TC_CMDS_PM_CAL,
+    TC_CMDS_PSAT_CAL,
+    TC_CMDS_PSAT_CAL_RESULT,
+    TC_CMDS_CAL_PWRS,
+    TC_CMDS_WRITE_CAL_2_OTP,
+    TC_CMDS_CHAR_PSAT,
+    TC_CMDS_CHAR_PSAT_RESULT,
+    TC_CMDS_PM_CAL_RESULT,
+    TC_CMDS_SINIT_WAIT,
+    TC_CMDS_COUNT
+} TC_CMDS_ACT;
+
+typedef PREPACK struct {
+    uint32_t   testCmdId;
+    uint32_t   act;
+    PREPACK union {
+        uint32_t  enANI;    // to be identical to CONT_RX struct
+        struct PREPACK {
+            uint16_t   length;
+            uint8_t    version;
+            uint8_t    bufLen;
+        } POSTPACK parm;
+    } POSTPACK u;
+} POSTPACK TC_CMDS_HDR;
+
+typedef PREPACK struct {
+    TC_CMDS_HDR  hdr;
+    char buf[TC_CMDS_SIZE_MAX];
+} POSTPACK TC_CMDS;
+
+typedef PREPACK struct {
+    uint32_t    testCmdId;
+    uint32_t    regAddr;
+    uint32_t    val;
+    uint16_t    flag;
+} POSTPACK TCMD_SET_REG;
+
+typedef PREPACK struct {
+	uint32_t testCmdId;
+	uint32_t mode;
+} POSTPACK TCMD_PM;
+
+typedef enum {
+	TCMD_CONT_TX_ID,
+	TCMD_CONT_RX_ID,
+	TCMD_PM_ID,
+        TC_CMDS_ID,
+        TCMD_SET_REG_ID,
+
+	/*For synergy purpose we added the following tcmd id but these
+	tcmd's will not go to the firmware instead we will write values
+	to the NV area */
+
+	TCMD_NIC_MAC = 100,
+	TCMD_CAL_FILE_INDEX = 101,
+} TCMD_ID;
+
+typedef PREPACK struct
+{
+    uint32_t  testCmdId;
+    char   mac_address[ATH_MAC_LEN];
+} POSTPACK TCMD_NIC_MAC_S;
+
+typedef PREPACK struct
+{
+       uint32_t  testCmdId;
+       uint32_t  cal_file_index;
+} POSTPACK TCMD_CAL_FILE_INDEX_S;
+
+typedef PREPACK union {
+	TCMD_CONT_TX contTx;
+	TCMD_CONT_RX contRx;
+	TCMD_PM pm;
+          // New test cmds from ART/MDK ...
+        TC_CMDS              tcCmds;
+        TCMD_SET_REG setReg;
+} POSTPACK TEST_CMD;
+
+/* New structure for selfinit */
+typedef enum {
+    TC_MSG_RESERVED,
+    TC_MSG_PSAT_CAL_RESULTS,
+    TC_MSG_CAL_POWER,
+    TC_MSG_CHAR_PSAT_RESULTS,
+    TC_MSG_PM_CAL_RESULTS,
+    TC_MSG_PSAT_CAL_ACK,
+    TC_MSG_COUNT
+} TC_MSG_ID;
+
+typedef PREPACK struct {
+    int8_t  olpcGainDelta_diff;
+    int8_t  olpcGainDelta_abs;
+    uint8_t thermCalVal;
+    uint8_t numTryBF;
+    uint32_t  cmac_olpc;
+    uint32_t  cmac_psat;
+    uint16_t  cmac_olpc_pcdac;
+    uint16_t  cmac_psat_pcdac;
+    int16_t   lineSlope;
+    int16_t   lineVariance;
+    uint16_t  psatParm;
+    uint8_t reserved[2];
+} POSTPACK OLPCGAIN_THERM_DUPLET;
+
+#define WHAL_NUM_11G_CAL_PIERS_EXT 16
+#define WHAL_NUM_11A_CAL_PIERS_EXT 32
+#define PSAT_WHAL_NUM_11G_CAL_PIERS_MAX 3
+#define PSAT_WHAL_NUM_11A_CAL_PIERS_MAX 5
+#define NUM_PSAT_CHAR_PARMS  7
+#define _MAX_TX_GAIN_ENTRIES 32
+
+typedef PREPACK struct {
+    OLPCGAIN_THERM_DUPLET olpcGainTherm2G[PSAT_WHAL_NUM_11G_CAL_PIERS_MAX];
+    OLPCGAIN_THERM_DUPLET olpcGainTherm5G[PSAT_WHAL_NUM_11A_CAL_PIERS_MAX];
+} POSTPACK PSAT_CAL_RESULTS;
+
+typedef PREPACK struct {
+    uint32_t  cmac_i[_MAX_TX_GAIN_ENTRIES];
+    uint8_t pcdac[_MAX_TX_GAIN_ENTRIES];
+
+    uint8_t freq;
+    uint8_t an_txrf3_rdiv2g;
+    uint8_t an_txrf3_pdpredist2g;
+    uint8_t an_rxtx2_mxrgain;
+    uint8_t an_rxrf_bias1_pwd_ic25mxr2gh;
+    uint8_t an_bias2_pwd_ic25rxrf;
+    uint8_t an_bb1_i2v_curr2x;
+    uint8_t an_txrf3_capdiv2g;
+
+} POSTPACK CHAR_PSAT_RESULTS;
+
+typedef PREPACK struct {
+    int16_t txPwr2G_t10[WHAL_NUM_11G_CAL_PIERS_EXT];
+    int16_t txPwr5G_t10[WHAL_NUM_11A_CAL_PIERS_EXT];
+} POSTPACK CAL_TXPWR;
+
+typedef PREPACK struct {
+    uint8_t thermCalVal;
+    uint8_t future[3];
+} POSTPACK PM_CAL_RESULTS;
+
+typedef PREPACK struct {
+    TC_MSG_ID msgId;
+    PREPACK union {
+        PSAT_CAL_RESULTS  psatCalResults;
+        CAL_TXPWR txPwrs;
+        CHAR_PSAT_RESULTS psatCharResults;
+        PM_CAL_RESULTS  pmCalResults;
+    } POSTPACK msg;
+
+} POSTPACK TC_MSG;
+
+typedef struct _psat_sweep_table {
+    uint8_t  an_txrf3_rdiv2g;
+    uint8_t  an_txrf3_pdpredist2g;
+    uint8_t  an_rxtx2_mxrgain;
+    uint8_t  an_rxrf_bias1_pwd_ic25mxr2gh;
+    uint8_t  an_bias2_pwd_ic25rxrf;
+    uint8_t  an_bb1_i2v_curr2x;
+    uint8_t  an_txrf3_capdiv2g;
+    int8_t   olpcPsatCmacDelta;
+    uint16_t psatParm;
+    uint16_t padding2;
+} PSAT_SWEEP_TABLE;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TESTCMD_H_ */
diff --git a/ath6kl-wmiconfig/Android.mk b/ath6kl-wmiconfig/Android.mk
new file mode 100755
index 0000000..9f62851
--- /dev/null
+++ b/ath6kl-wmiconfig/Android.mk
@@ -0,0 +1,28 @@
+#------------------------------------------------
+# Copyright (c) 2012 Qualcomm Atheros, Inc..
+# All Rights Reserved.
+# Qualcomm Atheros Confidential and Proprietary.
+#------------------------------------------------
+

+LOCAL_PATH := $(call my-dir)

+

+include $(CLEAR_VARS)

+

+LOCAL_MODULE := wmiconfig

+LOCAL_C_INCLUDES := \

+	$(TARGET_OUT_HEADERS)/libtcmd \

+	$(LOCAL_PATH)/include \

+	$(LOCAL_PATH)/../../bionic/libc/kernel/common \

+	#$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \

+

+

+LOCAL_CFLAGS+=-DUSER_KEYS

+LOCAL_SRC_FILES:= wmiconfig.c

+

+LOCAL_MODULE_TAGS := debug eng optional

+LOCAL_SHARED_LIBRARIES += libcutils

+LOCAL_SHARED_LIBRARIES += libnl_2

+LOCAL_STATIC_LIBRARIES += libtcmd

+include $(BUILD_EXECUTABLE)

+

+

diff --git a/ath6kl-wmiconfig/Makefile b/ath6kl-wmiconfig/Makefile
new file mode 100755
index 0000000..10d4832
--- /dev/null
+++ b/ath6kl-wmiconfig/Makefile
@@ -0,0 +1,31 @@
+#------------------------------------------------
+# Copyright (c) 2012 Qualcomm Atheros, Inc..
+# All Rights Reserved.
+# Qualcomm Atheros Confidential and Proprietary.
+#------------------------------------------------
+-include .config

+

+LDFLAGS +=  $(shell pkg-config --cflags --libs glib-2.0)

+

+CC :=$(ATH_CROSS_COMPILE_TYPE)gcc

+APP=wmiconfig

+

+NLLIBNAME = libnl-1

+LIBTCMD_DIR := ../libtcmd

+
+PREFIX ?= /usr
+SBINDIR ?= $(PREFIX)/sbin
+INSTALL ?= install
+
+

+override LDFLAGS += -ltcmd $(shell pkg-config --libs $(NLLIBNAME)) -lrt
+override CFLAGS += $(shell pkg-config --cflags $(NLLIBNAME)) -I$(LIBTCMD_DIR) -L$(LIBTCMD_DIR)

+all:

+	$(CC) -Wall -DUSER_KEYS -g -I$(KERNEL_SRC)/include -Iinclude wmiconfig.c -o $(APP) $(CFLAGS) $(LDFLAGS)
+
+install: wmiconfig
+	install -m 755 wmiconfig $(DESTDIR)$(SBINDIR)
+	
+

+clean:

+	$(RM) $(APP)

diff --git a/ath6kl-wmiconfig/include/a_config.h b/ath6kl-wmiconfig/include/a_config.h
new file mode 100755
index 0000000..93d3d08
--- /dev/null
+++ b/ath6kl-wmiconfig/include/a_config.h
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+//==============================================================================

+// This file contains software configuration options that enables

+// specific software "features"

+//

+// Author(s): ="Atheros"

+//==============================================================================

+#ifndef _A_CONFIG_H_

+#define _A_CONFIG_H_

+

+#ifdef ATHR_WM_NWF

+#include "../os/windows/include/config.h"

+#endif

+

+#ifdef ATHR_CE_LEGACY

+#include "../os/windows/include/config.h"

+#endif

+

+#if defined(__linux__) && !defined(LINUX_EMULATION)

+//#include "/config_linux.h"

+#endif

+

+#ifdef REXOS

+#include "../os/rexos/include/common/config_rexos.h"

+#endif

+

+#ifdef ATHR_WIN_NWF

+#include "../os/windows/include/config.h"

+#pragma warning( disable:4242)

+#pragma warning( disable:4100)

+#pragma warning( disable:4189)

+#pragma warning( disable:4244)

+#pragma warning( disable:4701)

+#pragma warning( disable:4389)

+#pragma warning( disable:4057)

+#pragma warning( disable:28193)

+#endif

+

+#endif

+

diff --git a/ath6kl-wmiconfig/include/a_osapi.h b/ath6kl-wmiconfig/include/a_osapi.h
new file mode 100755
index 0000000..6396255
--- /dev/null
+++ b/ath6kl-wmiconfig/include/a_osapi.h
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+//==============================================================================

+// This file contains the definitions of the basic atheros data types.

+// It is used to map the data types in atheros files to a platform specific

+// type.

+//

+// Author(s): ="Atheros"

+//==============================================================================

+#ifndef _A_OSAPI_H_

+#define _A_OSAPI_H_

+

+#if defined(__linux__) && !defined(LINUX_EMULATION)

+#include "osapi_linux.h"

+#endif

+

+#ifdef ATHR_WM_NWF

+#include "../os/windows/include/osapi.h"

+#include "../os/windows/include/netbuf.h"

+#endif

+

+#ifdef ATHR_CE_LEGACY

+#include "../os/windows/include/osapi.h"

+#include "../os/windows/include/netbuf.h"

+#endif

+

+#ifdef REXOS

+#include "../os/rexos/include/common/osapi_rexos.h"

+#endif

+

+#if defined ART_WIN

+#include "../os/win_art/include/osapi_win.h"

+#include "../os/win_art/include/netbuf.h"

+#endif

+

+#ifdef ATHR_WIN_NWF

+#include "../os/windows/include/win/osapi_win.h"

+#include "../os/windows/include/netbuf.h"

+#endif

+

+#endif /* _OSAPI_H_ */

+

diff --git a/ath6kl-wmiconfig/include/a_types.h b/ath6kl-wmiconfig/include/a_types.h
new file mode 100755
index 0000000..d489337
--- /dev/null
+++ b/ath6kl-wmiconfig/include/a_types.h
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+//==============================================================================

+// This file contains the definitions of the basic atheros data types.

+// It is used to map the data types in atheros files to a platform specific

+// type.

+//

+// Author(s): ="Atheros"

+//==============================================================================

+#ifndef _A_TYPES_H_

+#define _A_TYPES_H_

+

+#if defined(__linux__) && !defined(LINUX_EMULATION)

+#include "athtypes_linux.h"

+#endif

+

+#ifdef ATHR_WM_NWF

+#include "../os/windows/include/athtypes.h"

+#endif

+

+#ifdef ATHR_CE_LEGACY

+#include "../os/windows/include/athtypes.h"

+#endif

+

+#ifdef REXOS

+#include "../os/rexos/include/common/athtypes_rexos.h"

+#endif

+

+#if defined ART_WIN

+#include "../os/win_art/include/athtypes_win.h"

+#endif

+

+#ifdef ATHR_WIN_NWF

+#include <athtypes_win.h>

+#endif

+

+#endif /* _ATHTYPES_H_ */

+

diff --git a/ath6kl-wmiconfig/include/athdefs.h b/ath6kl-wmiconfig/include/athdefs.h
new file mode 100755
index 0000000..8ba5945
--- /dev/null
+++ b/ath6kl-wmiconfig/include/athdefs.h
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+#ifndef __ATHDEFS_H__

+#define __ATHDEFS_H__

+

+/*

+ * This file contains definitions that may be used across both

+ * Host and Target software.  Nothing here is module-dependent

+ * or platform-dependent.

+ */

+

+/*

+ * Generic error codes that can be used by hw, sta, ap, sim, dk

+ * and any other environments. Since these are enums, feel free to

+ * add any more codes that you need.

+ */

+

+typedef enum {

+    A_ERROR = -1,               /* Generic error return */

+    A_OK = 0,                   /* success */

+                                /* Following values start at 1 */

+    A_DEVICE_NOT_FOUND,         /* not able to find PCI device */

+    A_NO_MEMORY,                /* not able to allocate memory, not available */

+    A_MEMORY_NOT_AVAIL,         /* memory region is not free for mapping */

+    A_NO_FREE_DESC,             /* no free descriptors available */

+    A_BAD_ADDRESS,              /* address does not match descriptor */

+    A_WIN_DRIVER_ERROR,         /* used in NT_HW version, if problem at init */

+    A_REGS_NOT_MAPPED,          /* registers not correctly mapped */

+    A_EPERM,                    /* Not superuser */

+    A_EACCES,                   /* Access denied */

+    A_ENOENT,                   /* No such entry, search failed, etc. */

+    A_EEXIST,                   /* The object already exists (can't create) */

+    A_EFAULT,                   /* Bad address fault */

+    A_EBUSY,                    /* Object is busy */

+    A_EINVAL,                   /* Invalid parameter */

+    A_EMSGSIZE,                 /* Inappropriate message buffer length */

+    A_ECANCELED,                /* Operation canceled */

+    A_ENOTSUP,                  /* Operation not supported */

+    A_ECOMM,                    /* Communication error on send */

+    A_EPROTO,                   /* Protocol error */

+    A_ENODEV,                   /* No such device */

+    A_EDEVNOTUP,                /* device is not UP */

+    A_NO_RESOURCE,              /* No resources for requested operation */

+    A_HARDWARE,                 /* Hardware failure */

+    A_PENDING,                  /* Asynchronous routine; will send up results la

+ter (typically in callback) */

+    A_EBADCHANNEL,              /* The channel cannot be used */

+    A_DECRYPT_ERROR,            /* Decryption error */

+    A_PHY_ERROR,                /* RX PHY error */

+    A_CONSUMED                  /* Object was consumed */

+} A_STATUS;

+

+#define A_SUCCESS(x)        (x == A_OK)

+#define A_FAILED(x)         (!A_SUCCESS(x))

+

+#ifndef TRUE

+#define TRUE 1

+#endif

+

+#ifndef FALSE

+#define FALSE 0

+#endif

+

+#endif /* __ATHDEFS_H__ */

+

diff --git a/ath6kl-wmiconfig/include/athdrv_linux.h b/ath6kl-wmiconfig/include/athdrv_linux.h
new file mode 100755
index 0000000..71a7578
--- /dev/null
+++ b/ath6kl-wmiconfig/include/athdrv_linux.h
@@ -0,0 +1,1461 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef _ATHDRV_LINUX_H

+#define _ATHDRV_LINUX_H

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+

+/*

+ * There are two types of ioctl's here: Standard ioctls and

+ * eXtended ioctls.  All extended ioctls (XIOCTL) are multiplexed

+ * off of the single ioctl command, AR6000_IOCTL_EXTENDED.  The

+ * arguments for every XIOCTL starts with a 32-bit command word

+ * that is used to select which extended ioctl is in use.  After

+ * the command word are command-specific arguments.

+ */

+

+/* Linux standard Wireless Extensions, private ioctl interfaces */

+#define IEEE80211_IOCTL_SETPARAM             (SIOCIWFIRSTPRIV+0)

+#define IEEE80211_IOCTL_SETKEY               (SIOCIWFIRSTPRIV+1)

+#define IEEE80211_IOCTL_DELKEY               (SIOCIWFIRSTPRIV+2)

+#define IEEE80211_IOCTL_SETMLME              (SIOCIWFIRSTPRIV+3)

+#define IEEE80211_IOCTL_ADDPMKID             (SIOCIWFIRSTPRIV+4)

+#define IEEE80211_IOCTL_SETOPTIE             (SIOCIWFIRSTPRIV+5)

+//#define IEEE80211_IOCTL_GETPARAM             (SIOCIWFIRSTPRIV+6)

+//#define IEEE80211_IOCTL_SETWMMPARAMS         (SIOCIWFIRSTPRIV+7)

+//#define IEEE80211_IOCTL_GETWMMPARAMS         (SIOCIWFIRSTPRIV+8)

+//#define IEEE80211_IOCTL_GETOPTIE             (SIOCIWFIRSTPRIV+9)

+//#define IEEE80211_IOCTL_SETAUTHALG           (SIOCIWFIRSTPRIV+10)

+#define IEEE80211_IOCTL_LASTONE              (SIOCIWFIRSTPRIV+10)

+

+

+

+/*                      ====WMI Ioctls====                                    */

+/*

+ *

+ * Many ioctls simply provide WMI services to application code:

+ * an application makes such an ioctl call with a set of arguments

+ * that are packaged into the corresponding WMI message, and sent

+ * to the Target.

+ */

+

+#define AR6000_IOCTL_WMI_GETREV              (SIOCIWFIRSTPRIV+11)

+/*

+ * arguments:

+ *   ar6000_version *revision

+ */

+

+#define AR6000_IOCTL_WMI_SETPWR              (SIOCIWFIRSTPRIV+12)

+/*

+ * arguments:

+ *   WMI_POWER_MODE_CMD pwrModeCmd (see include/wmi.h)

+ * uses: WMI_SET_POWER_MODE_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SETSCAN             (SIOCIWFIRSTPRIV+13)

+/*

+ * arguments:

+ *   WMI_SCAN_PARAMS_CMD scanParams (see include/wmi.h)

+ * uses: WMI_SET_SCAN_PARAMS_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SETLISTENINT        (SIOCIWFIRSTPRIV+14)

+/*

+ * arguments:

+ *   UINT32 listenInterval

+ * uses: WMI_SET_LISTEN_INT_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SETBSSFILTER        (SIOCIWFIRSTPRIV+15)

+/*

+ * arguments:

+ *   WMI_BSS_FILTER filter (see include/wmi.h)

+ * uses: WMI_SET_BSS_FILTER_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_CHANNELPARAMS   (SIOCIWFIRSTPRIV+16)

+/*

+ * arguments:

+ *   WMI_CHANNEL_PARAMS_CMD chParams

+ * uses: WMI_SET_CHANNEL_PARAMS_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_PROBEDSSID      (SIOCIWFIRSTPRIV+17)

+/*

+ * arguments:

+ *   WMI_PROBED_SSID_CMD probedSsids (see include/wmi.h)

+ * uses: WMI_SETPROBED_SSID_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_PMPARAMS        (SIOCIWFIRSTPRIV+18)

+/*

+ * arguments:

+ *   WMI_POWER_PARAMS_CMD powerParams (see include/wmi.h)

+ * uses: WMI_SET_POWER_PARAMS_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_BADAP           (SIOCIWFIRSTPRIV+19)

+/*

+ * arguments:

+ *   WMI_ADD_BAD_AP_CMD badAPs (see include/wmi.h)

+ * uses: WMI_ADD_BAD_AP_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_GET_QOS_QUEUE       (SIOCIWFIRSTPRIV+20)

+/*

+ * arguments:

+ *   ar6000_queuereq queueRequest (see below)

+ */

+

+#define AR6000_IOCTL_WMI_CREATE_QOS          (SIOCIWFIRSTPRIV+21)

+/*

+ * arguments:

+ *   WMI_CREATE_PSTREAM createPstreamCmd (see include/wmi.h)

+ * uses: WMI_CREATE_PSTREAM_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_DELETE_QOS          (SIOCIWFIRSTPRIV+22)

+/*

+ * arguments:

+ *   WMI_DELETE_PSTREAM_CMD deletePstreamCmd (see include/wmi.h)

+ * uses: WMI_DELETE_PSTREAM_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_SNRTHRESHOLD   (SIOCIWFIRSTPRIV+23)

+/*

+ * arguments:

+ *   WMI_SNR_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h)

+ * uses: WMI_SNR_THRESHOLD_PARAMS_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK (SIOCIWFIRSTPRIV+24)

+/*

+ * arguments:

+ *   WMI_TARGET_ERROR_REPORT_BITMASK errorReportBitMask (see include/wmi.h)

+ * uses: WMI_TARGET_ERROR_REPORT_BITMASK_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_GET_TARGET_STATS    (SIOCIWFIRSTPRIV+25)

+/*

+ * arguments:

+ *   TARGET_STATS *targetStats (see below)

+ * uses: WMI_GET_STATISTICS_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_ASSOC_INFO      (SIOCIWFIRSTPRIV+26)

+/*

+ * arguments:

+ *   WMI_SET_ASSOC_INFO_CMD setAssocInfoCmd

+ * uses: WMI_SET_ASSOC_INFO_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_ACCESS_PARAMS   (SIOCIWFIRSTPRIV+27)

+/*

+ * arguments:

+ *   WMI_SET_ACCESS_PARAMS_CMD setAccessParams (see include/wmi.h)

+ * uses: WMI_SET_ACCESS_PARAMS_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_BMISS_TIME      (SIOCIWFIRSTPRIV+28)

+/*

+ * arguments:

+ *   UINT32 beaconMissTime

+ * uses: WMI_SET_BMISS_TIME_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_DISC_TIMEOUT    (SIOCIWFIRSTPRIV+29)

+/*

+ * arguments:

+ *   WMI_DISC_TIMEOUT_CMD disconnectTimeoutCmd (see include/wmi.h)

+ * uses: WMI_SET_DISC_TIMEOUT_CMDID

+ */

+

+#define AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS    (SIOCIWFIRSTPRIV+30)

+/*

+ * arguments:

+ *   WMI_IBSS_PM_CAPS_CMD ibssPowerMgmtCapsCmd

+ * uses: WMI_SET_IBSS_PM_CAPS_CMDID

+ */

+

+/*

+ * There is a very small space available for driver-private

+ * wireless ioctls.  In order to circumvent this limitation,

+ * we multiplex a bunch of ioctls (XIOCTLs) on top of a

+ * single AR6000_IOCTL_EXTENDED ioctl.

+ */

+#define AR6000_IOCTL_EXTENDED                (SIOCIWFIRSTPRIV+31)

+

+typedef enum {

+    AR6000_XIOCTL_BMI_DONE = 1,

+    AR6000_XIOCTL_BMI_READ_MEMORY,

+    AR6000_XIOCTL_BMI_WRITE_MEMORY,

+    AR6000_XIOCTL_BMI_EXECUTE,

+    AR6000_XIOCTL_BMI_SET_APP_START,

+    AR6000_XIOCTL_BMI_READ_SOC_REGISTER,

+    AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER,

+    AR6000_XIOCTL_BMI_TEST,

+    AR6000_XIOCTL_UNUSED9,

+    AR6000_XIOCTL_UNUSED10, /* 10 */

+    AR6000_XIOCTL_UNUSED11,

+    AR6000_XIOCTL_FORCE_TARGET_RESET,

+    AR6000_XIOCTL_HTC_RAW_OPEN,

+    AR6000_XIOCTL_HTC_RAW_CLOSE,

+    AR6000_XIOCTL_HTC_RAW_READ,

+    AR6000_XIOCTL_HTC_RAW_WRITE,

+    AR6000_XIOCTL_CHECK_TARGET_READY,

+    AR6000_XIOCTL_GPIO_OUTPUT_SET,

+    AR6000_XIOCTL_GPIO_INPUT_GET,

+    AR6000_XIOCTL_GPIO_REGISTER_SET,  /* 20 */

+    AR6000_XIOCTL_GPIO_REGISTER_GET,

+    AR6000_XIOCTL_GPIO_INTR_ACK,

+    AR6000_XIOCTL_GPIO_INTR_WAIT,

+    AR6000_XIOCTL_SET_ADHOC_BSSID,

+    AR6000_XIOCTL_UNUSED25,

+    AR6000_XIOCTL_UNUSED26,

+    AR6000_XIOCTL_SET_BEACON_INTVAL,

+    IEEE80211_IOCTL_SETAUTHALG,

+    AR6000_XIOCTL_SET_VOICE_PKT_SIZE,

+    AR6000_XIOCTL_SET_MAX_SP,   /* 30 */

+    AR6000_XIOCTL_WMI_GET_ROAM_TBL,

+    AR6000_XIOCTL_WMI_SET_ROAM_CTRL,

+    AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS,

+    AR6000_XIOCTRL_WMI_GET_POWER_MODE,

+    AR6000_XIOCTRL_WMI_SET_WLAN_STATE,

+    AR6000_XIOCTL_WMI_GET_ROAM_DATA,

+    AR6000_XIOCTL_WMI_SETRETRYLIMITS,

+    AR6000_XIOCTL_TCMD_CONT_TX,

+    AR6000_XIOCTL_TCMD_CONT_RX,

+    AR6000_XIOCTL_TCMD_PM,  /* 40 */

+    AR6000_XIOCTL_WMI_STARTSCAN,

+    AR6000_XIOCTL_WMI_SETFIXRATES,

+    AR6000_XIOCTL_WMI_GETFIXRATES,

+    AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD,

+    AR6000_XIOCTL_WMI_CLR_RSSISNR,                   

+    AR6000_XIOCTL_WMI_SET_LQTHRESHOLD,               

+    AR6000_XIOCTL_WMI_SET_RTS,

+    AR6000_XIOCTL_WMI_SET_LPREAMBLE,

+    AR6000_XIOCTL_WMI_SET_AUTHMODE,

+    AR6000_XIOCTL_WMI_SET_REASSOCMODE, /* 50 */

+    AR6000_XIOCTL_WMI_SET_WMM,

+    AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS,

+    AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP,

+    AR6000_XIOCTL_WMI_GET_RD,

+    AR6000_XIOCTL_DIAG_READ,

+    AR6000_XIOCTL_DIAG_WRITE,

+    AR6000_XIOCTL_WMI_SET_TXOP,

+    AR6000_XIOCTL_USER_SETKEYS,

+    AR6000_XIOCTL_WMI_SET_KEEPALIVE,

+    AR6000_XIOCTL_WMI_GET_KEEPALIVE, /* 60 */

+    AR6000_XIOCTL_BMI_ROMPATCH_INSTALL,

+    AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL,

+    AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE,

+    AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE,

+    AR6000_XIOCTL_WMI_SET_APPIE,

+    AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER,

+    AR6000_XIOCTL_DBGLOG_CFG_MODULE,

+    AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS,

+    AR6000_XIOCTL_WMI_SET_WSC_STATUS = 70,  /* 70 */

+    AR6000_XIOCTL_WMI_SET_BT_STATUS,

+    AR6000_XIOCTL_WMI_SET_BT_PARAMS,

+    AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE,

+    AR6000_XIOCTL_WMI_SET_WOW_MODE,

+    AR6000_XIOCTL_WMI_GET_WOW_LIST,

+    AR6000_XIOCTL_WMI_ADD_WOW_PATTERN,

+    AR6000_XIOCTL_WMI_DEL_WOW_PATTERN,

+    AR6000_XIOCTL_TARGET_INFO,

+    AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE,

+    AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE,  /* 80 */

+    AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS,

+    AR6000_XIOCTL_WMI_SET_AKMP_PARAMS,

+    AR6000_XIOCTL_WMI_GET_PMKID_LIST,

+    AR6000_XIOCTL_WMI_SET_PMKID_LIST,

+    AR6000_XIOCTL_WMI_SET_PARAMS,

+    AR6000_XIOCTL_WMI_SET_MCAST_FILTER,

+    AR6000_XIOCTL_WMI_DEL_MCAST_FILTER,

+    AR6000_XIOCTL_UNUSED90 = 90,  /* 90 */

+    AR6000_XIOCTL_BMI_LZ_STREAM_START,

+    AR6000_XIOCTL_BMI_LZ_DATA,

+    AR6000_XIOCTL_PROF_CFG,

+    AR6000_XIOCTL_PROF_ADDR_SET,

+    AR6000_XIOCTL_PROF_START,

+    AR6000_XIOCTL_PROF_STOP,

+    AR6000_XIOCTL_PROF_COUNT_GET,

+    AR6000_XIOCTL_WMI_ABORT_SCAN,

+    AR6000_XIOCTL_AP_GET_STA_LIST,

+    AR6000_XIOCTL_AP_HIDDEN_SSID, /* 100 */

+    AR6000_XIOCTL_AP_SET_NUM_STA,

+    AR6000_XIOCTL_AP_SET_ACL_MAC,

+    AR6000_XIOCTL_AP_GET_ACL_LIST,

+    AR6000_XIOCTL_AP_COMMIT_CONFIG,

+    IEEE80211_IOCTL_GETWPAIE,

+    AR6000_XIOCTL_AP_CONN_INACT_TIME,

+    AR6000_XIOCTL_AP_PROT_SCAN_TIME,

+    AR6000_XIOCTL_AP_SET_COUNTRY,

+    AR6000_XIOCTL_AP_SET_DTIM,

+    AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT, /* 110 */

+    AR6000_XIOCTL_SET_IP,

+    AR6000_XIOCTL_AP_SET_ACL_POLICY,

+    AR6000_XIOCTL_AP_CTRL_BSS_COMM,

+    AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO,

+    AR6000_XIOCTL_MODULE_DEBUG_SET_MASK,

+    AR6000_XIOCTL_MODULE_DEBUG_GET_MASK,

+    AR6000_XIOCTL_DUMP_RCV_AGGR_STATS,

+    AR6000_XIOCTL_SET_HT_CAP,

+    AR6000_XIOCTL_SET_HT_OP,

+    AR6000_XIOCTL_AP_GET_STAT, /* 120 */

+    AR6000_XIOCTL_SET_TX_SELECT_RATES,

+    AR6000_XIOCTL_SETUP_AGGR,

+    AR6000_XIOCTL_ALLOW_AGGR,

+    AR6000_XIOCTL_AP_GET_HIDDEN_SSID,

+    AR6000_XIOCTL_AP_GET_COUNTRY,

+    AR6000_XIOCTL_AP_GET_WMODE,

+    AR6000_XIOCTL_AP_GET_DTIM,

+    AR6000_XIOCTL_AP_GET_BINTVL,

+    AR6000_XIOCTL_AP_GET_RTS,

+    AR6000_XIOCTL_DELE_AGGR, /* 130 */

+    AR6000_XIOCTL_FETCH_TARGET_REGS,

+    AR6000_XIOCTL_HCI_CMD,

+    AR6000_XIOCTL_ACL_DATA,

+    AR6000_XIOCTL_WLAN_CONN_PRECEDENCE,

+    AR6000_XIOCTL_AP_SET_11BG_RATESET,

+    AR6000_XIOCTL_WMI_SET_AP_PS,

+    AR6000_XIOCTL_WMI_MCAST_FILTER,

+    AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT,

+    AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV,

+    AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG, /* 140 */

+    AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG,

+    AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG,

+    AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG,

+    AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG,

+    AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS,

+    AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG,

+    AR6000_XIOCTL_WMI_GET_BTCOEX_STATS,

+    AR6000_XIOCTL_WMI_SET_QOS_SUPP,

+    AR6000_XIOCTL_AP_SET_DFS,

+    AR6000_XIOCTL_WMI_P2P_DISCOVER, /* 150 */

+    AR6000_XIOCTL_WMI_P2P_STOP_FIND,

+    AR6000_XIOCTL_WMI_P2P_CANCEL,

+    AR6000_XIOCTL_WMI_P2P_LISTEN,

+    AR6000_XIOCTL_WMI_P2P_GO_NEG,

+    AR6000_XIOCTL_WMI_P2P_AUTH_GO_NEG,

+    AR6000_XIOCTL_WMI_P2P_REJECT,

+    AR6000_XIOCTL_WMI_P2P_CONFIG,

+    AR6000_XIOCTL_WMI_WPS_CONFIG,

+    AR6000_XIOCTL_WMI_P2P_FINDNODE,

+    AR6000_XIOCTL_WMI_P2P_GRP_INIT, /* 160 */

+    AR6000_XIOCTL_WMI_P2P_GRP_FORMATION_DONE,

+    AR6000_XIOCTL_WMI_P2P_INVITE,

+    AR6000_XIOCTL_WMI_P2P_PROV_DISC,

+    AR6000_XIOCTL_WMI_P2P_SET,

+    AR6000_XIOCTL_WMI_P2P_PEER,

+    AR6000_XIOCTL_WMI_P2P_FLUSH,

+    AR6000_XIOCTL_WMI_GET_GO_PARAMS,

+    AR6000_XIOCTL_P2P_AUTH_INVITE,

+    AR6000_XIOCTL_WMI_P2P_GET_IF_ADDR,

+    AR6000_XIOCTL_WMI_P2P_GET_DEV_ADDR, /* 170 */

+    AR6000_XIOCTL_WMI_P2P_SDPD_TX_CMD,

+    AR6000_XIOTCL_WMI_P2P_SD_CANCEL_REQUEST,

+    AR6000_XIOCTL_SET_BT_HW_POWER_STATE,

+    AR6000_XIOCTL_GET_BT_HW_POWER_STATE,

+    AR6000_XIOCTL_GET_WLAN_SLEEP_STATE,

+    AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM,

+    AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM,

+    AR6000_XIOCTL_WAC_SCAN_REPLY,

+    AR6000_XIOCTL_WMI_WAC_CTRL_REQ,

+    AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE, /* 180 */

+    AR6000_XIOCTL_WMI_SET_PASSPHRASE,

+    AR6000_XIOCTL_BMI_NVRAM_PROCESS,

+    AR6000_XIOCTL_WMI_SET_DIVERSITY_PARAM,

+    AR6000_XIOCTL_WMI_FORCE_ASSERT,

+    AR6000_XIOCTL_WMI_ENABLE_PKTLOG,

+    AR6000_XIOCTL_WMI_DISABLE_PKTLOG,

+    AR6000_XIOCTL_WMI_GET_PKTLOG,

+    AR6000_XIOCTL_AP_ACS_DISABLE_HI_CHANNELS,

+    AR6000_XIOCTL_TCMD_CMDS,

+    AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES, /* 190 */

+    AR6000_XIOCTL_AP_GET_NUM_STA,

+    AR6000_XIOCTL_SUSPEND_DRIVER,

+    AR6000_XIOCTL_RESUME_DRIVER,

+    AR6000_XIOCTL_GET_SUBMODE,

+    AR6000_XIOCTL_WMI_AP_SET_APSD,

+    AR6000_XIOCTL_TCMD_SETREG, 

+    AR6000_XIOCTL_GET_HT_CAP,

+    AR6000_XIOCTL_WMI_GET_P2P_IE, /* 198 */

+    AR6000_XIOCTL_WMI_P2P_GET_OWN_INFO,

+} XTND_IOCLTS; 

+

+

+

+///*                         ====BMI Extended Ioctls====                        */

+//

+//#define AR6000_XIOCTL_BMI_DONE                                  1

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_DONE)

+// * uses: BMI_DONE

+// */

+//

+//#define AR6000_XIOCTL_BMI_READ_MEMORY                           2

+///*

+// * arguments:

+// *   union {

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_BMI_READ_MEMORY)

+// *       UINT32 address

+// *       UINT32 length

+// *     }

+// *     char results[length]

+// *   }

+// * uses: BMI_READ_MEMORY

+// */

+//

+//#define AR6000_XIOCTL_BMI_WRITE_MEMORY                          3

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_WRITE_MEMORY)

+// *   UINT32 address

+// *   UINT32 length

+// *   char data[length]

+// * uses: BMI_WRITE_MEMORY

+// */

+//

+//#define AR6000_XIOCTL_BMI_EXECUTE                               4

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_EXECUTE)

+// *   UINT32 TargetAddress

+// *   UINT32 parameter

+// * uses: BMI_EXECUTE

+// */

+//

+//#define AR6000_XIOCTL_BMI_SET_APP_START                         5

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_SET_APP_START)

+// *   UINT32 TargetAddress

+// * uses: BMI_SET_APP_START

+// */

+//

+//#define AR6000_XIOCTL_BMI_READ_SOC_REGISTER                     6

+///*

+// * arguments:

+// *   union {

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_BMI_READ_SOC_REGISTER)

+// *       UINT32 TargetAddress, 32-bit aligned

+// *     }

+// *     UINT32 result

+// *   }

+// * uses: BMI_READ_SOC_REGISTER

+// */

+//

+//#define AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER                    7

+///*

+// * arguments:

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER)

+// *       UINT32 TargetAddress, 32-bit aligned

+// *       UINT32 newValue

+// *     }

+// * uses: BMI_WRITE_SOC_REGISTER

+// */

+//

+//#define AR6000_XIOCTL_BMI_TEST                                  8

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_TEST)

+// *   UINT32 address

+// *   UINT32 length

+// *   UINT32 count

+// */

+//

+//

+//

+///* Historical Host-side DataSet support */

+//#define AR6000_XIOCTL_UNUSED9                                   9

+//#define AR6000_XIOCTL_UNUSED10                                  10

+//#define AR6000_XIOCTL_UNUSED11                                  11

+//

+///*                      ====Misc Extended Ioctls====                          */

+//

+//#define AR6000_XIOCTL_FORCE_TARGET_RESET                        12

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_FORCE_TARGET_RESET)

+// */

+//

+//

+//#ifdef HTC_RAW_INTERFACE

+///* HTC Raw Interface Ioctls */

+//#define AR6000_XIOCTL_HTC_RAW_OPEN                              13

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_HTC_RAW_OPEN)

+// */

+//

+//#define AR6000_XIOCTL_HTC_RAW_CLOSE                             14

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_HTC_RAW_CLOSE)

+// */

+//

+//#define AR6000_XIOCTL_HTC_RAW_READ                              15

+///*

+// * arguments:

+// *   union {

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_HTC_RAW_READ)

+// *       UINT32 mailboxID

+// *       UINT32 length

+// *     }

+// *     results[length]

+// *   }

+// */

+//

+//#define AR6000_XIOCTL_HTC_RAW_WRITE                             16

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_HTC_RAW_WRITE)

+// *   UINT32 mailboxID

+// *   UINT32 length

+// *   char buffer[length]

+// */

+//#endif /* HTC_RAW_INTERFACE */

+//

+//#define AR6000_XIOCTL_CHECK_TARGET_READY                        17

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_CHECK_TARGET_READY)

+// */

+//

+//

+//

+///*                ====GPIO (General Purpose I/O) Extended Ioctls====          */

+//

+//#define AR6000_XIOCTL_GPIO_OUTPUT_SET                           18

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_GPIO_OUTPUT_SET)

+// *   ar6000_gpio_output_set_cmd_s (see below)

+// * uses: WMIX_GPIO_OUTPUT_SET_CMDID

+// */

+//

+//#define AR6000_XIOCTL_GPIO_INPUT_GET                            19

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_GPIO_INPUT_GET)

+// * uses: WMIX_GPIO_INPUT_GET_CMDID

+// */

+//

+//#define AR6000_XIOCTL_GPIO_REGISTER_SET                         20

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_GPIO_REGISTER_SET)

+// *   ar6000_gpio_register_cmd_s (see below)

+// * uses: WMIX_GPIO_REGISTER_SET_CMDID

+// */

+//

+//#define AR6000_XIOCTL_GPIO_REGISTER_GET                         21

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_GPIO_REGISTER_GET)

+// *   ar6000_gpio_register_cmd_s (see below)

+// * uses: WMIX_GPIO_REGISTER_GET_CMDID

+// */

+//

+//#define AR6000_XIOCTL_GPIO_INTR_ACK                             22

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_GPIO_INTR_ACK)

+// *   ar6000_cpio_intr_ack_cmd_s (see below)

+// * uses: WMIX_GPIO_INTR_ACK_CMDID

+// */

+//

+//#define AR6000_XIOCTL_GPIO_INTR_WAIT                            23

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_GPIO_INTR_WAIT)

+// */

+//

+//

+//

+///*                    ====more wireless commands====                          */

+//

+//#define AR6000_XIOCTL_SET_ADHOC_BSSID                           24

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_SET_ADHOC_BSSID)

+// *   WMI_SET_ADHOC_BSSID_CMD setAdHocBssidCmd (see include/wmi.h)

+// */

+//

+//#define AR6000_XIOCTL_SET_OPT_MODE                              25

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_SET_OPT_MODE)

+// *   WMI_SET_OPT_MODE_CMD setOptModeCmd (see include/wmi.h)

+// * uses: WMI_SET_OPT_MODE_CMDID

+// */

+//

+//#define AR6000_XIOCTL_OPT_SEND_FRAME                            26

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_OPT_SEND_FRAME)

+// *   WMI_OPT_TX_FRAME_CMD optTxFrameCmd (see include/wmi.h)

+// * uses: WMI_OPT_TX_FRAME_CMDID

+// */

+//

+//#define AR6000_XIOCTL_SET_BEACON_INTVAL                         27

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_SET_BEACON_INTVAL)

+// *   WMI_BEACON_INT_CMD beaconIntCmd (see include/wmi.h)

+// * uses: WMI_SET_BEACON_INT_CMDID

+// */

+//

+//

+//#define IEEE80211_IOCTL_SETAUTHALG                              28

+//

+//

+//#define AR6000_XIOCTL_SET_VOICE_PKT_SIZE                        29

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_SET_VOICE_PKT_SIZE)

+// *   WMI_SET_VOICE_PKT_SIZE_CMD setVoicePktSizeCmd (see include/wmi.h)

+// * uses: WMI_SET_VOICE_PKT_SIZE_CMDID

+// */

+//

+//

+//#define AR6000_XIOCTL_SET_MAX_SP                                30

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_SET_MAX_SP)

+// *   WMI_SET_MAX_SP_LEN_CMD maxSPLen(see include/wmi.h)

+// * uses: WMI_SET_MAX_SP_LEN_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_GET_ROAM_TBL                          31

+//

+//#define AR6000_XIOCTL_WMI_SET_ROAM_CTRL                         32

+//

+//#define AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS                 33

+//

+//

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS)

+// *   WMI_SET_POWERSAVE_TIMERS_CMD powerSaveTimers(see include/wmi.h)

+// *   WMI_SET_POWERSAVE_TIMERS_CMDID

+// */

+//

+//#define AR6000_XIOCTRL_WMI_GET_POWER_MODE                        34

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTRL_WMI_GET_POWER_MODE)

+// */

+//

+//#define AR6000_XIOCTRL_WMI_SET_WLAN_STATE                       35

+

+typedef enum {

+    WLAN_DISABLED,

+    WLAN_ENABLED

+} AR6000_WLAN_STATE;

+

+///*

+// * arguments:

+// * enable/disable

+// */

+//

+//#define AR6000_XIOCTL_WMI_GET_ROAM_DATA                         36

+//

+//#define AR6000_XIOCTL_WMI_SETRETRYLIMITS                37

+///*

+// * arguments:

+// *   WMI_SET_RETRY_LIMITS_CMD ibssSetRetryLimitsCmd

+// * uses: WMI_SET_RETRY_LIMITS_CMDID

+// */

+//

+//#ifdef CONFIG_HOST_TCMD_SUPPORT

+///*       ====extended commands for radio test ====                          */

+//

+//#define AR6000_XIOCTL_TCMD_CONT_TX                      38

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_TCMD_CONT_TX)

+// *   WMI_TCMD_CONT_TX_CMD contTxCmd (see include/wmi.h)

+// * uses: WMI_TCMD_CONT_TX_CMDID

+// */

+//

+//#define AR6000_XIOCTL_TCMD_CONT_RX                      39

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_TCMD_CONT_RX)

+// *   WMI_TCMD_CONT_RX_CMD rxCmd (see include/wmi.h)

+// * uses: WMI_TCMD_CONT_RX_CMDID

+// */

+//

+//#define AR6000_XIOCTL_TCMD_PM                           40

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_TCMD_PM)

+// *   WMI_TCMD_PM_CMD pmCmd (see include/wmi.h)

+// * uses: WMI_TCMD_PM_CMDID

+// */

+//

+//#endif /* CONFIG_HOST_TCMD_SUPPORT */

+//

+//#define AR6000_XIOCTL_WMI_STARTSCAN                     41

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_WMI_STARTSCAN)

+// *   UINT8  scanType

+// *   UINT8  scanConnected

+// *   A_BOOL forceFgScan

+// * uses: WMI_START_SCAN_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_SETFIXRATES                   42

+//

+//#define AR6000_XIOCTL_WMI_GETFIXRATES                   43

+//

+//

+//#define AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD             44

+///*

+// * arguments:

+// *   WMI_RSSI_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h)

+// * uses: WMI_RSSI_THRESHOLD_PARAMS_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_CLR_RSSISNR                   45

+///*

+// * arguments:

+// *   WMI_CLR_RSSISNR_CMD thresholdParams (see include/wmi.h)

+// * uses: WMI_CLR_RSSISNR_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_LQTHRESHOLD               46

+///*

+// * arguments:

+// *   WMI_LQ_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h)

+// * uses: WMI_LQ_THRESHOLD_PARAMS_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_RTS                        47

+///*

+// * arguments:

+// *   WMI_SET_RTS_MODE_CMD (see include/wmi.h)

+// * uses: WMI_SET_RTS_MODE_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_LPREAMBLE                 48

+//

+//#define AR6000_XIOCTL_WMI_SET_AUTHMODE                  49

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_WMI_SET_AUTHMODE)

+// *   UINT8  mode

+// * uses: WMI_SET_RECONNECT_AUTH_MODE_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_REASSOCMODE               50

+//

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_WMI_SET_WMM)

+// *   UINT8  mode

+// * uses: WMI_SET_WMM_CMDID

+// */

+//#define AR6000_XIOCTL_WMI_SET_WMM                       51

+//

+///*

+// * arguments:

+// * UINT32 cmd (AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS)

+// * UINT32 frequency

+// * UINT8  threshold

+// */

+//#define AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS  52

+//

+///*

+// * arguments:

+// * UINT32 cmd (AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP)

+// * UINT32 cookie

+// */

+//#define AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP         53

+//

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_WMI_GET_RD)

+// *   UINT32 regDomain

+// */

+//#define AR6000_XIOCTL_WMI_GET_RD                        54

+//

+//#define AR6000_XIOCTL_DIAG_READ                         55

+//

+//#define AR6000_XIOCTL_DIAG_WRITE                        56

+//

+///*

+// * arguments cmd (AR6000_XIOCTL_SET_TXOP)

+// * WMI_TXOP_CFG  txopEnable

+// */

+//#define AR6000_XIOCTL_WMI_SET_TXOP                      57

+//

+//#ifdef USER_KEYS

+///*

+// * arguments:

+// * UINT32 cmd (AR6000_XIOCTL_USER_SETKEYS)

+// * UINT32 keyOpCtrl

+// * uses AR6000_USER_SETKEYS_INFO

+// */

+//#define AR6000_XIOCTL_USER_SETKEYS                      58

+//#endif /* USER_KEYS */

+//

+//#define AR6000_XIOCTL_WMI_SET_KEEPALIVE                 59

+///*

+// * arguments:

+// *   UINT8 cmd (AR6000_XIOCTL_WMI_SET_KEEPALIVE)

+// *   UINT8 keepaliveInterval

+// * uses: WMI_SET_KEEPALIVE_CMDID

+// */

+//

+//#define AR6000_XIOCTL_WMI_GET_KEEPALIVE                 60

+///*

+// * arguments:

+// *   UINT8 cmd (AR6000_XIOCTL_WMI_GET_KEEPALIVE)

+// *   UINT8 keepaliveInterval

+// *   A_BOOL configured

+// * uses: WMI_GET_KEEPALIVE_CMDID

+// */

+//

+///*               ====ROM Patching Extended Ioctls====                       */

+//

+//#define AR6000_XIOCTL_BMI_ROMPATCH_INSTALL              61

+///*

+// * arguments:

+// *     union {

+// *       struct {

+// *         UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_INSTALL)

+// *         UINT32 ROM Address

+// *         UINT32 RAM Address

+// *         UINT32 number of bytes

+// *         UINT32 activate? (0 or 1)

+// *       }

+// *       A_UINT32 resulting rompatch ID

+// *     }

+// * uses: BMI_ROMPATCH_INSTALL

+// */

+//

+//#define AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL            62

+///*

+// * arguments:

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL)

+// *       UINT32 rompatch ID

+// *     }

+// * uses: BMI_ROMPATCH_UNINSTALL

+// */

+//

+//#define AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE             63

+///*

+// * arguments:

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE)

+// *       UINT32 rompatch count

+// *       UINT32 rompatch IDs[rompatch count]

+// *     }

+// * uses: BMI_ROMPATCH_ACTIVATE

+// */

+//

+//#define AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE           64

+///*

+// * arguments:

+// *     struct {

+// *       UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE)

+// *       UINT32 rompatch count

+// *       UINT32 rompatch IDs[rompatch count]

+// *     }

+// * uses: BMI_ROMPATCH_DEACTIVATE

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_APPIE             65

+///*

+// * arguments:

+// *      struct {

+// *          UINT32 cmd (AR6000_XIOCTL_WMI_SET_APPIE)

+// *          UINT32  app_frmtype;

+// *          UINT32  app_buflen;

+// *          UINT8   app_buf[];

+// *      }

+// */

+//#define AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER    66

+///*

+// * arguments:

+// *      A_UINT32 filter_type;

+// */

+//

+//#define AR6000_XIOCTL_DBGLOG_CFG_MODULE             67

+//

+//#define AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS         68

+//

+//#define AR6000_XIOCTL_WMI_SET_WSC_STATUS            70

+///*

+// * arguments:

+// *      A_UINT32 wsc_status;

+// *            (WSC_REG_INACTIVE or WSC_REG_ACTIVE)

+// */

+//

+///*

+// * arguments:

+// *      struct {

+// *          A_UINT8 streamType;

+// *          A_UINT8 status;

+// *      }

+// * uses: WMI_SET_BT_STATUS_CMDID

+// */

+//#define AR6000_XIOCTL_WMI_SET_BT_STATUS             71

+//

+///*

+// * arguments:

+// *      struct {

+// *           A_UINT8 paramType;

+// *           union {

+// *               A_UINT8 noSCOPkts;

+// *               BT_PARAMS_A2DP a2dpParams;

+// *               BT_COEX_REGS regs;

+// *           };

+// *      }

+// * uses: WMI_SET_BT_PARAM_CMDID

+// */

+//#define AR6000_XIOCTL_WMI_SET_BT_PARAMS             72

+//

+//#define AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE       73

+//#define AR6000_XIOCTL_WMI_SET_WOW_MODE              74

+//#define AR6000_XIOCTL_WMI_GET_WOW_LIST              75

+//#define AR6000_XIOCTL_WMI_ADD_WOW_PATTERN           76

+//#define AR6000_XIOCTL_WMI_DEL_WOW_PATTERN           77

+//

+//

+//

+//#define AR6000_XIOCTL_TARGET_INFO                   78

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_TARGET_INFO)

+// *   A_UINT32 TargetVersion (returned)

+// *   A_UINT32 TargetType    (returned)

+// * (See also bmi_msg.h target_ver and target_type)

+// */

+//

+//#define AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE         79

+///*

+// * arguments:

+// *      none

+// */

+//

+//#define AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE       80

+///*

+// * This ioctl is used to emulate traffic activity

+// * timeouts.  Activity/inactivity will trigger the driver

+// * to re-balance credits.

+// *

+// * arguments:

+// *      ar6000_traffic_activity_change

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS    81

+///*

+// * This ioctl is used to set the connect control flags

+// *

+// * arguments:

+// *      A_UINT32 connectCtrlFlags

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_AKMP_PARAMS              82

+///*

+// * This IOCTL sets any Authentication,Key Management and Protection

+// * related parameters. This is used along with the information set in

+// * Connect Command.

+// * Currently this enables Multiple PMKIDs to an AP.

+// *

+// * arguments:

+// *      struct {

+// *          A_UINT32    akmpInfo;

+// *      }

+// * uses: WMI_SET_AKMP_PARAMS_CMD

+// */

+//

+//#define AR6000_XIOCTL_WMI_GET_PMKID_LIST            83

+//

+//#define AR6000_XIOCTL_WMI_SET_PMKID_LIST            84

+///*

+// * This IOCTL is used to set a list of PMKIDs. This list of

+// * PMKIDs is used in the [Re]AssocReq Frame. This list is used

+// * only if the MultiPMKID option is enabled via the

+// * AR6000_XIOCTL_WMI_SET_AKMP_PARAMS  IOCTL.

+// *

+// * arguments:

+// *      struct {

+// *          A_UINT32    numPMKID;

+// *          WMI_PMKID   pmkidList[WMI_MAX_PMKID_CACHE];

+// *      }

+// * uses: WMI_SET_PMKIDLIST_CMD

+// */

+//

+//#define AR6000_XIOCTL_WMI_SET_PARAMS                85

+//#define AR6000_XIOCTL_WMI_SET_MCAST_FILTER     86

+//#define AR6000_XIOCTL_WMI_DEL_MCAST_FILTER     87

+//

+//

+///* Historical DSETPATCH support for INI patches */

+//#define AR6000_XIOCTL_UNUSED90                      90

+//

+//

+///* Support LZ-compressed firmware download */

+//#define AR6000_XIOCTL_BMI_LZ_STREAM_START           91

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_LZ_STREAM_START)

+// *   UINT32 address

+// * uses: BMI_LZ_STREAM_START

+// */

+//

+//#define AR6000_XIOCTL_BMI_LZ_DATA                   92

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_LZ_DATA)

+// *   UINT32 length

+// *   char data[length]

+// * uses: BMI_LZ_DATA

+// */

+//

+//#define AR6000_XIOCTL_PROF_CFG                      93

+///*

+// * arguments:

+// *   A_UINT32 period

+// *   A_UINT32 nbins

+// */

+//

+//#define AR6000_XIOCTL_PROF_ADDR_SET                 94

+///*

+// * arguments:

+// *   A_UINT32 Target address

+// */

+//

+//#define AR6000_XIOCTL_PROF_START                    95

+//

+//#define AR6000_XIOCTL_PROF_STOP                     96

+//

+//#define AR6000_XIOCTL_PROF_COUNT_GET                97

+//

+//#define AR6000_XIOCTL_WMI_ABORT_SCAN                98

+//

+///*

+// * AP mode

+// */

+//#define AR6000_XIOCTL_AP_GET_STA_LIST               99

+//

+//#define AR6000_XIOCTL_AP_HIDDEN_SSID                100

+//

+//#define AR6000_XIOCTL_AP_SET_NUM_STA                101

+//

+//#define AR6000_XIOCTL_AP_SET_ACL_MAC                102

+//

+//#define AR6000_XIOCTL_AP_GET_ACL_LIST               103

+//

+//#define AR6000_XIOCTL_AP_COMMIT_CONFIG              104

+//

+//#define IEEE80211_IOCTL_GETWPAIE                    105

+//

+//#define AR6000_XIOCTL_AP_CONN_INACT_TIME            106

+//

+//#define AR6000_XIOCTL_AP_PROT_SCAN_TIME             107

+//

+//#define AR6000_XIOCTL_AP_SET_COUNTRY                108

+//

+//#define AR6000_XIOCTL_AP_SET_DTIM                   109

+//

+//

+//

+//

+//#define AR6000_XIOCTL_WMI_TARGET_EVENT_REPORT       110

+//

+//#define AR6000_XIOCTL_SET_IP                        111

+//

+//#define AR6000_XIOCTL_AP_SET_ACL_POLICY             112

+//

+//#define AR6000_XIOCTL_AP_CTRL_BSS_COMM              113

+//

+//#define AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO        114

+//

+//#define AR6000_XIOCTL_MODULE_DEBUG_SET_MASK         115

+//

+//#define AR6000_XIOCTL_MODULE_DEBUG_GET_MASK         116

+//

+//#define AR6000_XIOCTL_DUMP_RCV_AGGR_STATS           117

+//

+//#define AR6000_XIOCTL_SET_HT_CAP                    118

+//

+//#define AR6000_XIOCTL_SET_HT_OP                     119

+//

+//#define AR6000_XIOCTL_AP_GET_STAT                   120

+//

+//#define AR6000_XIOCTL_SET_TX_SELECT_RATES           121

+//

+//#define AR6000_XIOCTL_SETUP_AGGR                    122

+//

+//#define AR6000_XIOCTL_ALLOW_AGGR                    123

+//

+//#define AR6000_XIOCTL_AP_GET_HIDDEN_SSID            124

+//

+//#define AR6000_XIOCTL_AP_GET_COUNTRY                125

+//

+//#define AR6000_XIOCTL_AP_GET_WMODE                  126

+//

+//#define AR6000_XIOCTL_AP_GET_DTIM                   127

+//

+//#define AR6000_XIOCTL_AP_GET_BINTVL                 128

+//

+//#define AR6000_XIOCTL_AP_GET_RTS                    129

+//

+//#define AR6000_XIOCTL_DELE_AGGR                     130

+//

+//#define AR6000_XIOCTL_FETCH_TARGET_REGS             131

+//

+//#define AR6000_XIOCTL_HCI_CMD                       132

+//

+//#define AR6000_XIOCTL_ACL_DATA                      133

+//

+//#define AR6000_XIOCTL_WLAN_CONN_PRECEDENCE          134

+//

+//#define AR6000_XIOCTL_AP_SET_11BG_RATESET           135

+//

+//#define AR6000_XIOCTL_WMI_SET_AP_PS                 136

+//

+//#define AR6000_XIOCTL_WMI_MCAST_FILTER              137

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_FE_ANT                 138

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_COLOCATED_BT_DEV           139

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG  140

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_SCO_CONFIG             141

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_A2DP_CONFIG                142

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_ACLCOEX_CONFIG         143

+//

+//#define AR6000_XIOCTL_WMI_SET_BTCOEX_DEBUG                      144

+//

+//#define AR6000_XIOCTL_WMI_SET_BT_OPERATING_STATUS               145

+//

+//#define AR6000_XIOCTL_WMI_GET_BTCOEX_CONFIG                 146

+//

+//#define AR6000_XIOCTL_WMI_GET_BTCOEX_STATS                      147

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_WMI_SET_QOS_SUPP)

+// *   UINT8  mode

+// * uses: WMI_SET_QOS_SUPP_CMDID

+// */

+//#define AR6000_XIOCTL_WMI_SET_QOS_SUPP                  148 

+//

+//#define AR6000_XIOCTL_AP_SET_DFS                        149

+//

+//#ifdef P2P

+//#define AR6000_XIOCTL_WMI_P2P_DISCOVER            150

+//#define AR6000_XIOCTL_WMI_P2P_LISTEN              151

+//#define AR6000_XIOCTL_WMI_P2P_GO_NEG              152

+//#define AR6000_XIOCTL_WMI_P2P_CONFIG              153

+//#define AR6000_XIOCTL_WMI_WPS_CONFIG              154

+//#define AR6000_XIOCTL_WMI_P2P_FINDNODE            155

+//#endif

+//#define AR6000_XIOCTL_SET_BT_HW_POWER_STATE             156 

+//#define AR6000_XIOCTL_GET_BT_HW_POWER_STATE             157 

+//#define AR6000_XIOCTL_GET_WLAN_SLEEP_STATE              158

+//#define AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM              159

+///*

+// * arguments:

+// *   WMI_AP_PS_CMD apPsCmd

+// * uses: WMI_AP_PS_CMDID

+// */

+//

+//

+//// WAC

+//#define AR6000_XIOCTL_WMI_ENABLE_WAC_PARAM              160

+//

+//#define AR6000_XIOCTL_WAC_SCAN_REPLY                    161

+//

+//#define AR6000_XIOCTL_WMI_WAC_CTRL_REQ                  162

+//

+//#define AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE         163

+//

+//#define AR6000_XIOCTL_WMI_SET_PASSPHRASE                164

+//

+//#define AR6000_XIOCTL_BMI_NVRAM_PROCESS                 165

+//

+//#define AR6000_XIOCTL_AP_ACS_DISABLE_HI_CHANNELS        166

+//

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_BMI_NVRAM_PROCESS)

+// *   UINT8  name[BMI_NVRAM_SEG_NAME_SZ]

+// * uses: BMI_NVRAM_PROCESS

+// */

+//

+//

+//#ifdef CONFIG_HOST_TCMD_SUPPORT

+///*       ====additional extended commands for radio test ====                          */

+//

+//#define AR6000_XIOCTL_TCMD_CMDS                          167

+///*

+// * arguments:

+// *   UINT32 cmd (AR6000_XIOCTL_TCMD_CMDS)

+// *   WMI_TCMD_CMDS_CMD cmdsCmd (see include/wmi.h)

+// * uses: WMI_TCMD_CMDS_CMDID

+// */

+//

+//#endif //ifdef CONFIG_HOST_TCMD_SUPPORT

+//

+//#define AR6000_XIOCTL_WMI_SET_DIVERSITY_PARAM           168

+//

+//#define AR6000_XIOCTL_WMI_FORCE_ASSERT                  169

+//

+//#define AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES     170

+//

+//#define AR6000_XIOCTL_AP_GET_NUM_STA                    171

+//

+//#define AR6000_XIOCTL_SUSPEND_DRIVER                    172

+//

+//#define AR6000_XIOCTL_RESUME_DRIVER                     173

+

+/* used by AR6000_IOCTL_WMI_GETREV */

+struct ar6000_version {

+    A_UINT32        host_ver;

+    A_UINT32        target_ver;

+    A_UINT32        wlan_ver;

+    A_UINT32        abi_ver;

+    A_UINT32        targetconf_ver;

+};

+

+/* used by AR6000_IOCTL_WMI_GET_QOS_QUEUE */

+struct ar6000_queuereq {

+    A_UINT8         trafficClass;

+    A_UINT16        activeTsids;

+};

+

+/* used by AR6000_IOCTL_WMI_GET_TARGET_STATS */

+typedef struct targetStats_t {

+    A_UINT64    tx_packets;

+    A_UINT64    tx_bytes;

+    A_UINT64    tx_unicast_pkts;

+    A_UINT64    tx_unicast_bytes;

+    A_UINT64    tx_multicast_pkts;

+    A_UINT64    tx_multicast_bytes;

+    A_UINT64    tx_broadcast_pkts;

+    A_UINT64    tx_broadcast_bytes;

+    A_UINT64    tx_rts_success_cnt;

+    A_UINT64    tx_packet_per_ac[4];

+

+    A_UINT64    tx_errors;

+    A_UINT64    tx_failed_cnt;

+    A_UINT64    tx_retry_cnt;

+    A_UINT64    tx_mult_retry_cnt;

+    A_UINT64    tx_rts_fail_cnt;

+

+    A_UINT64    rx_packets;

+    A_UINT64    rx_bytes;

+    A_UINT64    rx_unicast_pkts;

+    A_UINT64    rx_unicast_bytes;

+    A_UINT64    rx_multicast_pkts;

+    A_UINT64    rx_multicast_bytes;

+    A_UINT64    rx_broadcast_pkts;

+    A_UINT64    rx_broadcast_bytes;

+    A_UINT64    rx_fragment_pkt;

+

+    A_UINT64    rx_errors;

+    A_UINT64    rx_crcerr;

+    A_UINT64    rx_key_cache_miss;

+    A_UINT64    rx_decrypt_err;

+    A_UINT64    rx_duplicate_frames;

+

+    A_UINT64    tkip_local_mic_failure;

+    A_UINT64    tkip_counter_measures_invoked;

+    A_UINT64    tkip_replays;

+    A_UINT64    tkip_format_errors;

+    A_UINT64    ccmp_format_errors;

+    A_UINT64    ccmp_replays;

+

+    A_UINT64    power_save_failure_cnt;

+

+    A_UINT64    cs_bmiss_cnt;

+    A_UINT64    cs_lowRssi_cnt;

+    A_UINT64    cs_connect_cnt;

+    A_UINT64    cs_disconnect_cnt;

+

+    A_INT32     tx_unicast_rate;

+    A_INT32     rx_unicast_rate;

+

+    A_UINT32    lq_val;

+

+    A_UINT32    wow_num_pkts_dropped;

+    A_UINT16    wow_num_events_discarded;

+

+    A_INT16     noise_floor_calibation;

+    A_INT16     cs_rssi;

+    A_INT16     cs_aveBeacon_rssi;

+    A_UINT8     cs_aveBeacon_snr;

+    A_UINT8     cs_lastRoam_msec;

+    A_UINT8     cs_snr;

+

+    A_UINT8     wow_num_host_pkt_wakeups;

+    A_UINT8     wow_num_host_event_wakeups;

+

+    A_UINT32   arp_received;

+    A_UINT32   arp_matched;

+    A_UINT32   arp_replied;

+}TARGET_STATS;

+

+typedef struct targetStats_cmd_t {

+    TARGET_STATS targetStats;

+    int clearStats;

+} TARGET_STATS_CMD;

+

+/* used by AR6000_XIOCTL_USER_SETKEYS */

+

+/*

+ * Setting this bit to 1 doesnot initialize the RSC on the firmware

+ */

+#define AR6000_XIOCTL_USER_SETKEYS_RSC_CTRL    1

+#define AR6000_USER_SETKEYS_RSC_UNCHANGED     0x00000002

+

+typedef struct {

+    A_UINT32  keyOpCtrl;  /* Bit Map of Key Mgmt Ctrl Flags */

+} AR6000_USER_SETKEYS_INFO;

+

+

+/* used by AR6000_XIOCTL_GPIO_OUTPUT_SET */

+struct ar6000_gpio_output_set_cmd_s {

+    A_UINT32 set_mask;

+    A_UINT32 clear_mask;

+    A_UINT32 enable_mask;

+    A_UINT32 disable_mask;

+};

+

+/*

+ * used by AR6000_XIOCTL_GPIO_REGISTER_GET and AR6000_XIOCTL_GPIO_REGISTER_SET

+ */

+struct ar6000_gpio_register_cmd_s {

+    A_UINT32 gpioreg_id;

+    A_UINT32 value;

+};

+

+/* used by AR6000_XIOCTL_GPIO_INTR_ACK */

+struct ar6000_gpio_intr_ack_cmd_s {

+    A_UINT32 ack_mask;

+};

+

+/* used by AR6000_XIOCTL_GPIO_INTR_WAIT */

+struct ar6000_gpio_intr_wait_cmd_s {

+    A_UINT32 intr_mask;

+    A_UINT32 input_values;

+};

+

+/* used by the AR6000_XIOCTL_DBGLOG_CFG_MODULE */

+typedef struct ar6000_dbglog_module_config_s {

+    A_UINT32 valid;

+    A_UINT16 mmask;

+    A_UINT16 tsr;

+    A_BOOL   rep;

+    A_UINT16 size;

+} DBGLOG_MODULE_CONFIG;

+

+typedef struct user_rssi_thold_t {

+    A_INT16     tag;

+    A_INT16     rssi;

+} USER_RSSI_THOLD;

+

+typedef struct user_rssi_params_t {

+    A_UINT8            weight;

+    A_UINT32           pollTime;

+    USER_RSSI_THOLD    tholds[12];

+} USER_RSSI_PARAMS;

+

+typedef struct ar6000_get_btcoex_config_cmd_t{

+    A_UINT32 btProfileType;

+    A_UINT32 linkId;

+ }AR6000_GET_BTCOEX_CONFIG_CMD;

+

+typedef struct ar6000_btcoex_config_t {

+    AR6000_GET_BTCOEX_CONFIG_CMD  configCmd;

+    A_UINT32 * configEvent;

+} AR6000_BTCOEX_CONFIG;

+

+typedef struct ar6000_btcoex_stats_t {

+    A_UINT32 * statsEvent;

+ }AR6000_BTCOEX_STATS;

+/*

+ * Host driver may have some config parameters. Typically, these

+ * config params are one time config parameters. These could

+ * correspond to any of the underlying modules. Host driver exposes

+ * an api for the underlying modules to get this config.

+ */

+#define AR6000_DRIVER_CFG_BASE                  0x8000

+

+/* Should driver perform wlan node caching? */

+#define AR6000_DRIVER_CFG_GET_WLANNODECACHING   0x8001

+/*Should we log raw WMI msgs */

+#define AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS      0x8002

+

+/* used by AR6000_XIOCTL_DIAG_READ & AR6000_XIOCTL_DIAG_WRITE */

+struct ar6000_diag_window_cmd_s {

+    unsigned int addr;

+    unsigned int value;

+};

+

+

+struct ar6000_traffic_activity_change {

+    A_UINT32    StreamID;   /* stream ID to indicate activity change */

+    A_UINT32    Active;     /* active (1) or inactive (0) */

+};

+

+/* Used with AR6000_XIOCTL_PROF_COUNT_GET */

+struct prof_count_s {

+    A_UINT32    addr;       /* bin start address */

+    A_UINT32    count;      /* hit count */

+};

+

+

+/* used by AR6000_XIOCTL_MODULE_DEBUG_SET_MASK */

+/*         AR6000_XIOCTL_MODULE_DEBUG_GET_MASK */

+/*         AR6000_XIOCTL_DUMP_MODULE_DEBUG_INFO */

+struct drv_debug_module_s {

+    A_CHAR      modulename[128];   /* name of module */

+    A_UINT32    mask;              /* new mask to set .. or .. current mask */

+};

+

+/* used by AR6000_XIOCTL_P2P_AUTH_INVITE */

+#define ATH_MAC_LEN 6

+typedef PREPACK struct {

+    A_UINT32 auth;

+    A_UINT8 peer_addr[ATH_MAC_LEN];

+}POSTPACK P2P_AUTH_INVITE_CMD;

+

+/* All HCI related rx events are sent up to the host app

+ * via a wmi event id. It can contain ACL data or HCI event, 

+ * based on which it will be de-multiplexed.

+ */

+typedef enum {

+    PAL_HCI_EVENT = 0,

+    PAL_HCI_RX_DATA,

+} WMI_PAL_EVENT_INFO;

+

+

+#ifdef __cplusplus

+}

+#endif

+#endif

diff --git a/ath6kl-wmiconfig/include/athtypes_linux.h b/ath6kl-wmiconfig/include/athtypes_linux.h
new file mode 100755
index 0000000..b51b053
--- /dev/null
+++ b/ath6kl-wmiconfig/include/athtypes_linux.h
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+//------------------------------------------------------------------------------

+//

+// This file contains the definitions of the basic atheros data types.

+// It is used to map the data types in atheros files to a platform specific

+// type.

+//

+// Author(s): ="Atheros"

+//------------------------------------------------------------------------------

+

+#ifndef _ATHTYPES_LINUX_H_

+#define _ATHTYPES_LINUX_H_

+

+#ifdef __KERNEL__

+#include <linux/types.h>

+#else

+#include <sys/types.h>

+#endif

+

+typedef int8_t      A_INT8;

+typedef int16_t     A_INT16;

+typedef int32_t     A_INT32;

+typedef int64_t     A_INT64;

+

+typedef u_int8_t     A_UINT8;

+typedef u_int16_t    A_UINT16;

+typedef u_int32_t    A_UINT32;

+typedef u_int64_t    A_UINT64;

+

+typedef int             A_BOOL;

+typedef char            A_CHAR;

+typedef unsigned char   A_UCHAR;

+typedef unsigned long   A_ATH_TIMER;

+

+#endif /* _ATHTYPES_LINUX_H_ */

+

diff --git a/ath6kl-wmiconfig/include/config_linux.h b/ath6kl-wmiconfig/include/config_linux.h
new file mode 100755
index 0000000..35a5904
--- /dev/null
+++ b/ath6kl-wmiconfig/include/config_linux.h
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef _CONFIG_LINUX_H_

+#define _CONFIG_LINUX_H_

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+#include <linux/version.h>

+

+/*

+ * Host-side GPIO support is optional.

+ * If run-time access to GPIO pins is not required, then

+ * this should be changed to #undef.

+ */

+#define CONFIG_HOST_GPIO_SUPPORT

+

+/*

+ * Host side Test Command support

+ * Note: when HCI SDIO is enabled, a low stack IRQ or statck overflow is

+ *       hit on FC10. So with HCI SDIO, minimize the stack allocation by 

+ *       mutually exclude TCMD_SUPPORT, which allocates large buffers 

+ *       in AR_TCMD_RESP in AR_SOFTC_T

+ *

+ */

+#ifndef HCI_TRANSPORT_SDIO

+#define CONFIG_HOST_TCMD_SUPPORT

+#endif

+

+/* Host-side support for Target-side profiling */

+#undef CONFIG_TARGET_PROFILE_SUPPORT

+/*DIX OFFLOAD SUPPORT*/

+/*#define DIX_RX_OFFLOAD*/

+/*#define DIX_TX_OFFLOAD*/

+

+/* IP/TCP checksum offload */

+/* Checksum offload is currently not supported for 64 bit platforms */

+#ifndef __LP64__

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)

+#define CONFIG_CHECKSUM_OFFLOAD

+#endif

+#endif /* __LP64__ */

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif

+

diff --git a/ath6kl-wmiconfig/include/dbglog.h b/ath6kl-wmiconfig/include/dbglog.h
new file mode 100755
index 0000000..61924dd
--- /dev/null
+++ b/ath6kl-wmiconfig/include/dbglog.h
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef _DBGLOG_H_

+#define _DBGLOG_H_

+

+#ifndef ATH_TARGET

+//#include "athstartpack.h"

+#endif

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+#define DBGLOG_TIMESTAMP_OFFSET          0

+#define DBGLOG_TIMESTAMP_MASK            0x0000FFFF /* Bit 0-15. Contains bit

+                                                       8-23 of the LF0 timer */

+#define DBGLOG_DBGID_OFFSET              16

+#define DBGLOG_DBGID_MASK                0x03FF0000 /* Bit 16-25 */

+#define DBGLOG_DBGID_NUM_MAX             256 /* Upper limit is width of mask */

+

+#define DBGLOG_MODULEID_OFFSET           26

+#define DBGLOG_MODULEID_MASK             0x3C000000 /* Bit 26-29 */

+#define DBGLOG_MODULEID_NUM_MAX          16 /* Upper limit is width of mask */

+

+/*

+ * Please ensure that the definition of any new module intrduced is captured

+ * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The 

+ * structure is required for the parser to correctly pick up the values for

+ * different modules.

+ */

+#define DBGLOG_MODULEID_START

+#define DBGLOG_MODULEID_INF                   0

+#define DBGLOG_MODULEID_WMI                   1

+#define DBGLOG_MODULEID_MISC                  2

+#define DBGLOG_MODULEID_PM                    3

+#define DBGLOG_MODULEID_TXRX_MGMTBUF          4

+#define DBGLOG_MODULEID_TXRX_TXBUF            5

+#define DBGLOG_MODULEID_TXRX_RXBUF            6

+#define DBGLOG_MODULEID_WOW                   7

+#define DBGLOG_MODULEID_WHAL                  8

+#define DBGLOG_MODULEID_DC                    9

+#define DBGLOG_MODULEID_CO                    10

+#define DBGLOG_MODULEID_RO                    11

+#define DBGLOG_MODULEID_CM                    12

+#define DBGLOG_MODULEID_MGMT                  13

+#define DBGLOG_MODULEID_TMR                   14

+#define DBGLOG_MODULEID_BTCOEX                15

+#define DBGLOG_MODULEID_END

+

+#define DBGLOG_NUM_ARGS_OFFSET             30

+#define DBGLOG_NUM_ARGS_MASK               0xC0000000 /* Bit 30-31 */

+#define DBGLOG_NUM_ARGS_MAX                2 /* Upper limit is width of mask */

+

+#define DBGLOG_MODULE_LOG_ENABLE_OFFSET    0

+#define DBGLOG_MODULE_LOG_ENABLE_MASK      0x0000FFFF

+

+#define DBGLOG_REPORTING_ENABLED_OFFSET    16

+#define DBGLOG_REPORTING_ENABLED_MASK      0x00010000

+

+#define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17

+#define DBGLOG_TIMESTAMP_RESOLUTION_MASK   0x000E0000

+

+#define DBGLOG_REPORT_SIZE_OFFSET          20

+#define DBGLOG_REPORT_SIZE_MASK            0x3FF00000

+

+#define DBGLOG_LOG_BUFFER_SIZE             1500

+#define DBGLOG_DBGID_DEFINITION_LEN_MAX    90

+

+PREPACK struct dbglog_buf_s {

+    struct dbglog_buf_s *next;

+    A_UINT8             *buffer;

+    A_UINT32             bufsize;

+    A_UINT32             length;

+    A_UINT32             count;

+    A_UINT32             free;

+} POSTPACK;

+

+PREPACK struct dbglog_hdr_s {

+    struct dbglog_buf_s *dbuf;

+    A_UINT32             dropped;

+} POSTPACK;

+

+PREPACK struct dbglog_config_s {

+    A_UINT32                    cfgvalid; /* Mask with valid config bits */

+    union {

+        /* TODO: Take care of endianness */

+        struct {

+            A_UINT32            mmask:16; /* Mask of modules with logging on */

+            A_UINT32            rep:1; /* Reporting enabled or not */

+            A_UINT32            tsr:3; /* Time stamp resolution. Def: 1 ms */

+            A_UINT32            size:10; /* Report size in number of messages */

+            A_UINT32            reserved:2;

+        } dbglog_config;

+

+        A_UINT32                value;

+    } u;

+} POSTPACK;

+

+#define cfgmmask                   u.dbglog_config.mmask

+#define cfgrep                     u.dbglog_config.rep

+#define cfgtsr                     u.dbglog_config.tsr

+#define cfgsize                    u.dbglog_config.size

+#define cfgvalue                   u.value

+

+#ifdef __cplusplus

+}

+#endif

+

+#ifndef ATH_TARGET

+//#include "athendpack.h"

+#endif

+

+#endif /* _DBGLOG_H_ */

diff --git a/ath6kl-wmiconfig/include/dbglog_id.h b/ath6kl-wmiconfig/include/dbglog_id.h
new file mode 100755
index 0000000..8ef7b5f
--- /dev/null
+++ b/ath6kl-wmiconfig/include/dbglog_id.h
@@ -0,0 +1,576 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef _DBGLOG_ID_H_

+#define _DBGLOG_ID_H_

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/* 

+ * The nomenclature for the debug identifiers is MODULE_DESCRIPTION.

+ * Please ensure that the definition of any new debugid introduced is captured

+ * between the <MODULE>_DBGID_DEFINITION_START and 

+ * <MODULE>_DBGID_DEFINITION_END defines. The structure is required for the 

+ * parser to correctly pick up the values for different debug identifiers.

+ */

+

+/* INF debug identifier definitions */

+#define INF_DBGID_DEFINITION_START

+#define INF_ASSERTION_FAILED                          1

+#define INF_TARGET_ID                                 2

+#define INF_DBGID_DEFINITION_END

+

+/* WMI debug identifier definitions */

+#define WMI_DBGID_DEFINITION_START

+#define WMI_CMD_RX_XTND_PKT_TOO_SHORT                 1

+#define WMI_EXTENDED_CMD_NOT_HANDLED                  2

+#define WMI_CMD_RX_PKT_TOO_SHORT                      3

+#define WMI_CALLING_WMI_EXTENSION_FN                  4

+#define WMI_CMD_NOT_HANDLED                           5

+#define WMI_IN_SYNC                                   6

+#define WMI_TARGET_WMI_SYNC_CMD                       7

+#define WMI_SET_SNR_THRESHOLD_PARAMS                  8

+#define WMI_SET_RSSI_THRESHOLD_PARAMS                 9

+#define WMI_SET_LQ_TRESHOLD_PARAMS                   10

+#define WMI_TARGET_CREATE_PSTREAM_CMD                11

+#define WMI_WI_DTM_INUSE                             12

+#define WMI_TARGET_DELETE_PSTREAM_CMD                13

+#define WMI_TARGET_IMPLICIT_DELETE_PSTREAM_CMD       14

+#define WMI_TARGET_GET_BIT_RATE_CMD                  15

+#define WMI_GET_RATE_MASK_CMD_FIX_RATE_MASK_IS       16

+#define WMI_TARGET_GET_AVAILABLE_CHANNELS_CMD        17

+#define WMI_TARGET_GET_TX_PWR_CMD                    18

+#define WMI_FREE_EVBUF_WMIBUF                        19

+#define WMI_FREE_EVBUF_DATABUF                       20

+#define WMI_FREE_EVBUF_BADFLAG                       21

+#define WMI_HTC_RX_ERROR_DATA_PACKET                 22

+#define WMI_HTC_RX_SYNC_PAUSING_FOR_MBOX             23

+#define WMI_INCORRECT_WMI_DATA_HDR_DROPPING_PKT      24

+#define WMI_SENDING_READY_EVENT                      25

+#define WMI_SETPOWER_MDOE_TO_MAXPERF                 26

+#define WMI_SETPOWER_MDOE_TO_REC                     27

+#define WMI_BSSINFO_EVENT_FROM                       28

+#define WMI_TARGET_GET_STATS_CMD                     29

+#define WMI_SENDING_SCAN_COMPLETE_EVENT              30

+#define WMI_SENDING_RSSI_INDB_THRESHOLD_EVENT        31

+#define WMI_SENDING_RSSI_INDBM_THRESHOLD_EVENT       32

+#define WMI_SENDING_LINK_QUALITY_THRESHOLD_EVENT     33

+#define WMI_SENDING_ERROR_REPORT_EVENT               34

+#define WMI_SENDING_CAC_EVENT                        35

+#define WMI_TARGET_GET_ROAM_TABLE_CMD                36

+#define WMI_TARGET_GET_ROAM_DATA_CMD                 37

+#define WMI_SENDING_GPIO_INTR_EVENT                  38

+#define WMI_SENDING_GPIO_ACK_EVENT                   39

+#define WMI_SENDING_GPIO_DATA_EVENT                  40

+#define WMI_CMD_RX                                   41

+#define WMI_CMD_RX_XTND                              42

+#define WMI_EVENT_SEND                               43

+#define WMI_EVENT_SEND_XTND                          44

+#define WMI_CMD_PARAMS_DUMP_START                    45

+#define WMI_CMD_PARAMS_DUMP_END                      46

+#define WMI_CMD_PARAMS                               47

+#define WMI_DBGID_DEFINITION_END

+

+/* MISC debug identifier definitions */

+#define MISC_DBGID_DEFINITION_START

+#define MISC_WLAN_SCHEDULER_EVENT_REGISTER_ERROR     1

+#define TLPM_INIT                                    2

+#define TLPM_FILTER_POWER_STATE                      3

+#define TLPM_NOTIFY_NOT_IDLE                         4

+#define TLPM_TIMEOUT_IDLE_HANDLER                    5

+#define TLPM_TIMEOUT_WAKEUP_HANDLER                  6

+#define TLPM_WAKEUP_SIGNAL_HANDLER                   7

+#define TLPM_UNEXPECTED_GPIO_INTR_ERROR              8

+#define TLPM_BREAK_ON_NOT_RECEIVED_ERROR             9

+#define TLPM_BREAK_OFF_NOT_RECIVED_ERROR             10

+#define TLPM_ACK_GPIO_INTR                           11

+#define TLPM_ON                                      12

+#define TLPM_OFF                                     13

+#define TLPM_WAKEUP_FROM_HOST                        14

+#define TLPM_WAKEUP_FROM_BT                          15 

+#define TLPM_TX_BREAK_RECIVED                        16

+#define TLPM_IDLE_TIMER_NOT_RUNNING                  17

+#define	WAC_ENABLE                                   18

+#define WAC_SCAN_DONE                                19

+#define WAC_REPORT_BSS                               20

+#define WAC_START_WPS                                21

+#define WAC_SCAN_REPLY                               22

+#define WAC_UPDATE_BSS                               23

+#define WAC_PIN_STATUS                               24

+#define WAC_PIN_STATUS_REJECT                        25

+#define WAC_RSSI_BELOW_THRESHOLD                     26

+#define WAC_CTRL_REQ_CMD                             27

+#define WAC_CTRL_REQ_REPLY                           28

+#define DV_SET_ANTENNA                               29

+#define MISC_DBGID_DEFINITION_END

+    

+/* TXRX debug identifier definitions */

+#define TXRX_TXBUF_DBGID_DEFINITION_START

+#define TXRX_TXBUF_ALLOCATE_BUF                      1

+#define TXRX_TXBUF_QUEUE_BUF_TO_MBOX                 2

+#define TXRX_TXBUF_QUEUE_BUF_TO_TXQ                  3

+#define TXRX_TXBUF_TXQ_DEPTH                         4   

+#define TXRX_TXBUF_IBSS_QUEUE_TO_SFQ                 5

+#define TXRX_TXBUF_IBSS_QUEUE_TO_TXQ_FRM_SFQ         6

+#define TXRX_TXBUF_INITIALIZE_TIMER                  7

+#define TXRX_TXBUF_ARM_TIMER                         8

+#define TXRX_TXBUF_DISARM_TIMER                      9

+#define TXRX_TXBUF_UNINITIALIZE_TIMER                10

+#define TXRX_TXBUF_DBGID_DEFINITION_END

+ 

+#define TXRX_RXBUF_DBGID_DEFINITION_START    

+#define TXRX_RXBUF_ALLOCATE_BUF                      1

+#define TXRX_RXBUF_QUEUE_TO_HOST                     2

+#define TXRX_RXBUF_QUEUE_TO_WLAN                     3

+#define TXRX_RXBUF_ZERO_LEN_BUF                      4

+#define TXRX_RXBUF_QUEUE_TO_HOST_LASTBUF_IN_RXCHAIN  5

+#define TXRX_RXBUF_LASTBUF_IN_RXCHAIN_ZEROBUF        6

+#define TXRX_RXBUF_QUEUE_EMPTY_QUEUE_TO_WLAN         7

+#define TXRX_RXBUF_SEND_TO_RECV_MGMT                 8

+#define TXRX_RXBUF_SEND_TO_IEEE_LAYER                9

+#define TXRX_RXBUF_REQUEUE_ERROR                     10

+#define TXRX_RXBUF_DBGID_DEFINITION_END

+

+#define TXRX_MGMTBUF_DBGID_DEFINITION_START 

+#define TXRX_MGMTBUF_ALLOCATE_BUF                    1

+#define TXRX_MGMTBUF_ALLOCATE_SM_BUF                 2    

+#define TXRX_MGMTBUF_ALLOCATE_RMBUF                  3

+#define TXRX_MGMTBUF_GET_BUF                         4

+#define TXRX_MGMTBUF_GET_SM_BUF                      5

+#define TXRX_MGMTBUF_QUEUE_BUF_TO_TXQ                6

+#define TXRX_MGMTBUF_REAPED_BUF                      7

+#define TXRX_MGMTBUF_REAPED_SM_BUF                   8

+#define TXRX_MGMTBUF_WAIT_FOR_TXQ_DRAIN              9

+#define TXRX_MGMTBUF_WAIT_FOR_TXQ_SFQ_DRAIN          10

+#define TXRX_MGMTBUF_ENQUEUE_INTO_DATA_SFQ           11

+#define TXRX_MGMTBUF_DEQUEUE_FROM_DATA_SFQ           12

+#define TXRX_MGMTBUF_PAUSE_DATA_TXQ                  13

+#define TXRX_MGMTBUF_RESUME_DATA_TXQ                 14

+#define TXRX_MGMTBUF_WAIT_FORTXQ_DRAIN_TIMEOUT       15

+#define TXRX_MGMTBUF_DRAINQ                          16

+#define TXRX_MGMTBUF_INDICATE_Q_DRAINED              17

+#define TXRX_MGMTBUF_ENQUEUE_INTO_HW_SFQ             18

+#define TXRX_MGMTBUF_DEQUEUE_FROM_HW_SFQ             19

+#define TXRX_MGMTBUF_PAUSE_HW_TXQ                    20

+#define TXRX_MGMTBUF_RESUME_HW_TXQ                   21

+#define TXRX_MGMTBUF_TEAR_DOWN_BA                    22

+#define TXRX_MGMTBUF_PROCESS_ADDBA_REQ               23

+#define TXRX_MGMTBUF_PROCESS_DELBA                   24

+#define TXRX_MGMTBUF_PERFORM_BA                      25

+#define TXRX_MGMTBUF_WLAN_RESET_ON_ERROR             26 

+#define TXRX_MGMTBUF_DBGID_DEFINITION_END

+

+/* PM (Power Module) debug identifier definitions */

+#define PM_DBGID_DEFINITION_START

+#define PM_INIT                                      1

+#define PM_ENABLE                                    2

+#define PM_SET_STATE                                 3

+#define PM_SET_POWERMODE                             4

+#define PM_CONN_NOTIFY                               5

+#define PM_REF_COUNT_NEGATIVE                        6

+#define PM_INFRA_STA_APSD_ENABLE                     7

+#define PM_INFRA_STA_UPDATE_APSD_STATE               8

+#define PM_CHAN_OP_REQ                               9

+#define PM_SET_MY_BEACON_POLICY                      10

+#define PM_SET_ALL_BEACON_POLICY                     11

+#define PM_INFRA_STA_SET_PM_PARAMS1                  12

+#define PM_INFRA_STA_SET_PM_PARAMS2                  13

+#define PM_ADHOC_SET_PM_CAPS_FAIL                    14

+#define PM_ADHOC_UNKNOWN_IBSS_ATTRIB_ID              15

+#define PM_ADHOC_SET_PM_PARAMS                       16

+#define PM_ADHOC_STATE1                              18

+#define PM_ADHOC_STATE2                              19

+#define PM_ADHOC_CONN_MAP                            20 

+#define PM_FAKE_SLEEP                                21

+#define PM_AP_STATE1                                 22

+#define PM_AP_SET_PM_PARAMS                          23

+#define PM_P2P_STATE1                                24

+#define PM_DBGID_DEFINITION_END

+

+/* Wake on Wireless debug identifier definitions */

+#define WOW_DBGID_DEFINITION_START

+#define WOW_INIT                                        1

+#define WOW_GET_CONFIG_DSET                             2   

+#define WOW_NO_CONFIG_DSET                              3

+#define WOW_INVALID_CONFIG_DSET                         4

+#define WOW_USE_DEFAULT_CONFIG                          5

+#define WOW_SETUP_GPIO                                  6

+#define WOW_INIT_DONE                                   7

+#define WOW_SET_GPIO_PIN                                8

+#define WOW_CLEAR_GPIO_PIN                              9

+#define WOW_SET_WOW_MODE_CMD                            10

+#define WOW_SET_HOST_MODE_CMD                           11  

+#define WOW_ADD_WOW_PATTERN_CMD                         12    

+#define WOW_NEW_WOW_PATTERN_AT_INDEX                    13    

+#define WOW_DEL_WOW_PATTERN_CMD                         14    

+#define WOW_LIST_CONTAINS_PATTERNS                      15    

+#define WOW_GET_WOW_LIST_CMD                            16 

+#define WOW_INVALID_FILTER_ID                           17

+#define WOW_INVALID_FILTER_LISTID                       18

+#define WOW_NO_VALID_FILTER_AT_ID                       19

+#define WOW_NO_VALID_LIST_AT_ID                         20

+#define WOW_NUM_PATTERNS_EXCEEDED                       21

+#define WOW_NUM_LISTS_EXCEEDED                          22

+#define WOW_GET_WOW_STATS                               23

+#define WOW_CLEAR_WOW_STATS                             24

+#define WOW_WAKEUP_HOST                                 25

+#define WOW_EVENT_WAKEUP_HOST                           26

+#define WOW_EVENT_DISCARD                               27

+#define WOW_PATTERN_MATCH                               28

+#define WOW_PATTERN_NOT_MATCH                           29

+#define WOW_PATTERN_NOT_MATCH_OFFSET                    30

+#define WOW_DISABLED_HOST_ASLEEP                        31

+#define WOW_ENABLED_HOST_ASLEEP_NO_PATTERNS             32

+#define WOW_ENABLED_HOST_ASLEEP_NO_MATCH_FOUND          33

+#define WOW_DBGID_DEFINITION_END

+

+/* WHAL debug identifier definitions */

+#define WHAL_DBGID_DEFINITION_START

+#define WHAL_ERROR_ANI_CONTROL                      1

+#define WHAL_ERROR_CHIP_TEST1                       2

+#define WHAL_ERROR_CHIP_TEST2                       3

+#define WHAL_ERROR_EEPROM_CHECKSUM                  4

+#define WHAL_ERROR_EEPROM_MACADDR                   5

+#define WHAL_ERROR_INTERRUPT_HIU                    6

+#define WHAL_ERROR_KEYCACHE_RESET                   7

+#define WHAL_ERROR_KEYCACHE_SET                     8 

+#define WHAL_ERROR_KEYCACHE_TYPE                    9

+#define WHAL_ERROR_KEYCACHE_TKIPENTRY              10

+#define WHAL_ERROR_KEYCACHE_WEPLENGTH              11

+#define WHAL_ERROR_PHY_INVALID_CHANNEL             12

+#define WHAL_ERROR_POWER_AWAKE                     13

+#define WHAL_ERROR_POWER_SET                       14

+#define WHAL_ERROR_RECV_STOPDMA                    15

+#define WHAL_ERROR_RECV_STOPPCU                    16

+#define WHAL_ERROR_RESET_CHANNF1                   17

+#define WHAL_ERROR_RESET_CHANNF2                   18

+#define WHAL_ERROR_RESET_PM                        19

+#define WHAL_ERROR_RESET_OFFSETCAL                 20

+#define WHAL_ERROR_RESET_RFGRANT                   21

+#define WHAL_ERROR_RESET_RXFRAME                   22

+#define WHAL_ERROR_RESET_STOPDMA                   23

+#define WHAL_ERROR_RESET_RECOVER                   24

+#define WHAL_ERROR_XMIT_COMPUTE                    25

+#define WHAL_ERROR_XMIT_NOQUEUE                    26

+#define WHAL_ERROR_XMIT_ACTIVEQUEUE                27

+#define WHAL_ERROR_XMIT_BADTYPE                    28

+#define WHAL_ERROR_XMIT_STOPDMA                    29

+#define WHAL_ERROR_INTERRUPT_BB_PANIC              30 

+#define WHAL_ERROR_RESET_TXIQCAL                   31 

+#define WHAL_ERROR_PAPRD_MAXGAIN_ABOVE_WINDOW      32 

+#define WHAL_DBGID_DEFINITION_END

+

+/* DC debug identifier definitions */

+#define DC_DBGID_DEFINITION_START

+#define DC_SCAN_CHAN_START                          1

+#define DC_SCAN_CHAN_FINISH                         2

+#define DC_BEACON_RECEIVE7                          3

+#define DC_SSID_PROBE_CB                            4

+#define DC_SEND_NEXT_SSID_PROBE                     5

+#define DC_START_SEARCH                             6

+#define DC_CANCEL_SEARCH_CB                         7

+#define DC_STOP_SEARCH                              8

+#define DC_END_SEARCH                               9

+#define DC_MIN_CHDWELL_TIMEOUT                     10

+#define DC_START_SEARCH_CANCELED                   11

+#define DC_SET_POWER_MODE                          12

+#define DC_INIT                                    13

+#define DC_SEARCH_OPPORTUNITY                      14

+#define DC_RECEIVED_ANY_BEACON                     15

+#define DC_RECEIVED_MY_BEACON                      16

+#define DC_PROFILE_IS_ADHOC_BUT_BSS_IS_INFRA       17

+#define DC_PS_ENABLED_BUT_ATHEROS_IE_ABSENT        18

+#define DC_BSS_ADHOC_CHANNEL_NOT_ALLOWED           19

+#define DC_SET_BEACON_UPDATE                       20

+#define DC_BEACON_UPDATE_COMPLETE                  21

+#define DC_END_SEARCH_BEACON_UPDATE_COMP_CB        22

+#define DC_BSSINFO_EVENT_DROPPED                   23

+#define DC_IEEEPS_ENABLED_BUT_ATIM_ABSENT          24 

+#define DC_DBGID_DEFINITION_END

+

+/* CO debug identifier definitions */

+#define CO_DBGID_DEFINITION_START

+#define CO_INIT                                     1

+#define CO_ACQUIRE_LOCK                             2

+#define CO_START_OP1                                3

+#define CO_START_OP2                                4

+#define CO_DRAIN_TX_COMPLETE_CB                     5

+#define CO_CHANGE_CHANNEL_CB                        6

+#define CO_RETURN_TO_HOME_CHANNEL                   7

+#define CO_FINISH_OP_TIMEOUT                        8

+#define CO_OP_END                                   9

+#define CO_CANCEL_OP                               10

+#define CO_CHANGE_CHANNEL                          11

+#define CO_RELEASE_LOCK                            12

+#define CO_CHANGE_STATE                            13

+#define CO_DBGID_DEFINITION_END

+

+/* RO debug identifier definitions */

+#define RO_DBGID_DEFINITION_START

+#define RO_REFRESH_ROAM_TABLE                       1

+#define RO_UPDATE_ROAM_CANDIDATE                    2

+#define RO_UPDATE_ROAM_CANDIDATE_CB                 3

+#define RO_UPDATE_ROAM_CANDIDATE_FINISH             4

+#define RO_REFRESH_ROAM_TABLE_DONE                  5

+#define RO_PERIODIC_SEARCH_CB                       6

+#define RO_PERIODIC_SEARCH_TIMEOUT                  7

+#define RO_INIT                                     8

+#define RO_BMISS_STATE1                             9

+#define RO_BMISS_STATE2                            10

+#define RO_SET_PERIODIC_SEARCH_ENABLE              11

+#define RO_SET_PERIODIC_SEARCH_DISABLE             12

+#define RO_ENABLE_SQ_THRESHOLD                     13

+#define RO_DISABLE_SQ_THRESHOLD                    14

+#define RO_ADD_BSS_TO_ROAM_TABLE                   15

+#define RO_SET_PERIODIC_SEARCH_MODE                16

+#define RO_CONFIGURE_SQ_THRESHOLD1                 17

+#define RO_CONFIGURE_SQ_THRESHOLD2                 18

+#define RO_CONFIGURE_SQ_PARAMS                     19

+#define RO_LOW_SIGNAL_QUALITY_EVENT                20

+#define RO_HIGH_SIGNAL_QUALITY_EVENT               21

+#define RO_REMOVE_BSS_FROM_ROAM_TABLE              22

+#define RO_UPDATE_CONNECTION_STATE_METRIC          23

+#define RO_LOWRSSI_SCAN_PARAMS                     24

+#define RO_LOWRSSI_SCAN_START                      25

+#define RO_LOWRSSI_SCAN_END                        26

+#define RO_LOWRSSI_SCAN_CANCEL                     27

+#define RO_LOWRSSI_ROAM_CANCEL                     28

+#define RO_REFRESH_ROAM_CANDIDATE                  29

+#define RO_DBGID_DEFINITION_END

+

+/* CM debug identifier definitions */

+#define CM_DBGID_DEFINITION_START

+#define CM_INITIATE_HANDOFF                         1

+#define CM_INITIATE_HANDOFF_CB                      2

+#define CM_CONNECT_EVENT                            3

+#define CM_DISCONNECT_EVENT                         4

+#define CM_INIT                                     5

+#define CM_HANDOFF_SOURCE                           6

+#define CM_SET_HANDOFF_TRIGGERS                     7

+#define CM_CONNECT_REQUEST                          8

+#define CM_CONNECT_REQUEST_CB                       9

+#define CM_CONTINUE_SCAN_CB                         10 

+#define CM_DBGID_DEFINITION_END

+

+

+/* mgmt debug identifier definitions */

+#define MGMT_DBGID_DEFINITION_START

+#define KEYMGMT_CONNECTION_INIT                     1

+#define KEYMGMT_CONNECTION_COMPLETE                 2

+#define KEYMGMT_CONNECTION_CLOSE                    3

+#define KEYMGMT_ADD_KEY                             4

+#define MLME_NEW_STATE                              5

+#define MLME_CONN_INIT                              6

+#define MLME_CONN_COMPLETE                          7

+#define MLME_CONN_CLOSE                             8 

+#define MLME_WLAN_OPMODE                            9 

+#define MLME_WLAN_SLOTTIME                          10 

+#define MGMT_DBGID_DEFINITION_END

+

+/* TMR debug identifier definitions */

+#define TMR_DBGID_DEFINITION_START

+#define TMR_HANG_DETECTED                           1

+#define TMR_WDT_TRIGGERED                           2

+#define TMR_WDT_RESET                               3

+#define TMR_HANDLER_ENTRY                           4

+#define TMR_HANDLER_EXIT                            5

+#define TMR_SAVED_START                             6

+#define TMR_SAVED_END                               7

+#define TMR_DBGID_DEFINITION_END

+

+/* BTCOEX debug identifier definitions */

+#define BTCOEX_DBGID_DEFINITION_START

+#define BTCOEX_STATUS_CMD                           1

+#define BTCOEX_PARAMS_CMD                           2

+#define BTCOEX_ANT_CONFIG                           3

+#define BTCOEX_COLOCATED_BT_DEVICE                  4

+#define BTCOEX_CLOSE_RANGE_SCO_ON                   5

+#define BTCOEX_CLOSE_RANGE_SCO_OFF                  6

+#define BTCOEX_CLOSE_RANGE_A2DP_ON                  7

+#define BTCOEX_CLOSE_RANGE_A2DP_OFF                 8

+#define BTCOEX_A2DP_PROTECT_ON                      9

+#define BTCOEX_A2DP_PROTECT_OFF                     10

+#define BTCOEX_SCO_PROTECT_ON                       11

+#define BTCOEX_SCO_PROTECT_OFF                      12

+#define BTCOEX_CLOSE_RANGE_DETECTOR_START           13

+#define BTCOEX_CLOSE_RANGE_DETECTOR_STOP            14

+#define BTCOEX_CLOSE_RANGE_TOGGLE                   15

+#define BTCOEX_CLOSE_RANGE_TOGGLE_RSSI_LRCNT        16

+#define BTCOEX_CLOSE_RANGE_RSSI_THRESH              17

+#define BTCOEX_CLOSE_RANGE_LOW_RATE_THRESH          18

+#define BTCOEX_PTA_PRI_INTR_HANDLER  		        19

+#define BTCOEX_PSPOLL_QUEUED						20

+#define BTCOEX_PSPOLL_COMPLETE						21

+#define BTCOEX_DBG_PM_AWAKE							22

+#define BTCOEX_DBG_PM_SLEEP							23

+#define BTCOEX_DBG_SCO_COEX_ON						24

+#define BTCOEX_SCO_DATARECEIVE						25

+#define BTCOEX_INTR_INIT							26

+#define BTCOEX_PTA_PRI_DIFF							27

+#define BTCOEX_TIM_NOTIFICATION						28

+#define BTCOEX_SCO_WAKEUP_ON_DATA					29

+#define BTCOEX_SCO_SLEEP							30

+#define BTCOEX_SET_WEIGHTS							31

+#define BTCOEX_SCO_DATARECEIVE_LATENCY_VAL			32

+#define BTCOEX_SCO_MEASURE_TIME_DIFF				33

+#define BTCOEX_SET_EOL_VAL							34

+#define BTCOEX_OPT_DETECT_HANDLER					35

+#define BTCOEX_SCO_TOGGLE_STATE						36

+#define BTCOEX_SCO_STOMP							37

+#define BTCOEX_NULL_COMP_CALLBACK					38

+#define BTCOEX_RX_INCOMING							39

+#define BTCOEX_RX_INCOMING_CTL						40

+#define BTCOEX_RX_INCOMING_MGMT						41

+#define BTCOEX_RX_INCOMING_DATA						42

+#define BTCOEX_RTS_RECEPTION						43

+#define BTCOEX_FRAME_PRI_LOW_RATE_THRES				44

+#define BTCOEX_PM_FAKE_SLEEP						45

+#define BTCOEX_ACL_COEX_STATUS						46

+#define BTCOEX_ACL_COEX_DETECTION					47

+#define BTCOEX_A2DP_COEX_STATUS						48

+#define BTCOEX_SCO_STATUS							49

+#define BTCOEX_WAKEUP_ON_DATA						50

+#define BTCOEX_DATARECEIVE							51

+#define BTCOEX_GET_MAX_AGGR_SIZE					53

+#define BTCOEX_MAX_AGGR_AVAIL_TIME					54

+#define BTCOEX_DBG_WBTIMER_INTR						55

+#define BTCOEX_DBG_SCO_SYNC                         57

+#define BTCOEX_UPLINK_QUEUED_RATE  					59

+#define BTCOEX_DBG_UPLINK_ENABLE_EOL				60

+#define BTCOEX_UPLINK_FRAME_DURATION				61

+#define BTCOEX_UPLINK_SET_EOL						62

+#define BTCOEX_DBG_EOL_EXPIRED						63

+#define BTCOEX_DBG_DATA_COMPLETE					64

+#define BTCOEX_UPLINK_QUEUED_TIMESTAMP				65

+#define BTCOEX_DBG_DATA_COMPLETE_TIME				66

+#define BTCOEX_DBG_A2DP_ROLE_IS_SLAVE               67

+#define BTCOEX_DBG_A2DP_ROLE_IS_MASTER              68

+#define BTCOEX_DBG_UPLINK_SEQ_NUM					69

+#define BTCOEX_UPLINK_AGGR_SEQ						70

+#define BTCOEX_DBG_TX_COMP_SEQ_NO					71

+#define BTCOEX_DBG_MAX_AGGR_PAUSE_STATE				72

+#define BTCOEX_DBG_ACL_TRAFFIC                      73

+#define BTCOEX_CURR_AGGR_PROP						74

+#define BTCOEX_DBG_SCO_GET_PER_TIME_DIFF 			75

+#define BTCOEX_PSPOLL_PROCESS						76

+#define BTCOEX_RETURN_FROM_MAC						77

+#define BTCOEX_FREED_REQUEUED_CNT					78

+#define BTCOEX_DBG_TOGGLE_LOW_RATES					79

+#define BTCOEX_MAC_GOES_TO_SLEEP    				80

+#define BTCOEX_DBG_A2DP_NO_SYNC                     81

+#define BTCOEX_RETURN_FROM_MAC_HOLD_Q_INFO			82

+#define BTCOEX_RETURN_FROM_MAC_AC					83

+#define BTCOEX_DBG_DTIM_RECV                        84

+#define BTCOEX_IS_PRE_UPDATE						86

+#define BTCOEX_ENQUEUED_BIT_MAP						87

+#define BTCOEX_TX_COMPLETE_FIRST_DESC_STATS			88

+#define BTCOEX_UPLINK_DESC							89

+#define BTCOEX_SCO_GET_PER_FIRST_FRM_TIMESTAMP		90

+#define BTCOEX_DBG_RECV_ACK							94

+#define BTCOEX_DBG_ADDBA_INDICATION                 95

+#define BTCOEX_TX_COMPLETE_EOL_FAILED				96

+#define BTCOEX_DBG_A2DP_USAGE_COMPLETE  			97

+#define BTCOEX_DBG_A2DP_STOMP_FOR_BCN_HANDLER		98

+#define BTCOEX_DBG_A2DP_SYNC_INTR                   99

+#define BTCOEX_DBG_A2DP_STOMP_FOR_BCN_RECEPTION	   100

+#define BTCOEX_FORM_AGGR_CURR_AGGR				   101

+#define BTCOEX_DBG_TOGGLE_A2DP_BURST_CNT           102

+#define BTCOEX_DBG_BT_TRAFFIC   				   103

+#define BTCOEX_DBG_STOMP_BT_TRAFFIC 			   104

+#define BTCOEX_RECV_NULL                           105

+#define BTCOEX_DBG_A2DP_MASTER_BT_END			   106

+#define BTCOEX_DBG_A2DP_BT_START				   107

+#define BTCOEX_DBG_A2DP_SLAVE_BT_END			   108

+#define BTCOEX_DBG_A2DP_STOMP_BT				   109

+#define BTCOEX_DBG_GO_TO_SLEEP					   110

+#define BTCOEX_DBG_A2DP_PKT						   111

+#define BTCOEX_DBG_A2DP_PSPOLL_DATA_RECV		   112

+#define BTCOEX_DBG_A2DP_NULL					   113

+#define BTCOEX_DBG_UPLINK_DATA					   114

+#define BTCOEX_DBG_A2DP_STOMP_LOW_PRIO_NULL		   115

+#define BTCOEX_DBG_ADD_BA_RESP_TIMEOUT			   116

+#define BTCOEX_DBG_TXQ_STATE					   117

+#define BTCOEX_DBG_ALLOW_SCAN					   118

+#define BTCOEX_DBG_SCAN_REQUEST					   119

+#define BTCOEX_A2DP_SLEEP						   127

+#define BTCOEX_DBG_DATA_ACTIV_TIMEOUT			   128

+#define BTCOEX_DBG_SWITCH_TO_PSPOLL_ON_MODE		   129

+#define BTCOEX_DBG_SWITCH_TO_PSPOLL_OFF_MODE 	   130

+#define BTCOEX_DATARECEIVE_AGGR					   131

+#define BTCOEX_DBG_DATA_RECV_SLEEPING_PENDING	   132

+#define BTCOEX_DBG_DATARESP_TIMEOUT				   133

+#define BTCOEX_BDG_BMISS						   134

+#define BTCOEX_DBG_DATA_RECV_WAKEUP_TIM			   135

+#define BTCOEX_DBG_SECOND_BMISS					   136

+#define BTCOEX_DBG_SET_WLAN_STATE				   138

+#define BTCOEX_BDG_FIRST_BMISS					   139

+#define BTCOEX_DBG_A2DP_CHAN_OP					   140

+#define BTCOEX_DBG_A2DP_INTR					   141

+#define BTCOEX_DBG_BT_INQUIRY					   142

+#define BTCOEX_DBG_BT_INQUIRY_DATA_FETCH		   143

+#define BTCOEX_DBG_POST_INQUIRY_FINISH			   144

+#define BTCOEX_DBG_SCO_OPT_MODE_TIMER_HANDLER	   145

+#define BTCOEX_DBG_NULL_FRAME_SLEEP				   146

+#define BTCOEX_DBG_NULL_FRAME_AWAKE				   147

+#define BTCOEX_DBG_SET_AGGR_SIZE				   152

+#define BTCOEX_DBG_TEAR_BA_TIMEOUT				   153

+#define BTCOEX_DBG_MGMT_FRAME_SEQ_NO			   154

+#define BTCOEX_DBG_SCO_STOMP_HIGH_PRI			   155

+#define BTCOEX_DBG_COLOCATED_BT_DEV				   156

+#define BTCOEX_DBG_FE_ANT_TYPE				       157

+#define BTCOEX_DBG_BT_INQUIRY_CMD				   158

+#define BTCOEX_DBG_SCO_CONFIG					   159

+#define BTCOEX_DBG_SCO_PSPOLL_CONFIG			   160

+#define BTCOEX_DBG_SCO_OPTMODE_CONFIG		       161

+#define BTCOEX_DBG_A2DP_CONFIG				       162

+#define BTCOEX_DBG_A2DP_PSPOLL_CONFIG		       163

+#define BTCOEX_DBG_A2DP_OPTMODE_CONFIG		       164

+#define BTCOEX_DBG_ACLCOEX_CONFIG			       165

+#define BTCOEX_DBG_ACLCOEX_PSPOLL_CONFIG		   166

+#define BTCOEX_DBG_ACLCOEX_OPTMODE_CONFIG	       167

+#define BTCOEX_DBG_DEBUG_CMD					   168

+#define BTCOEX_DBG_SET_BT_OPERATING_STATUS		   169

+#define BTCOEX_DBG_GET_CONFIG					   170

+#define BTCOEX_DBG_GET_STATS					   171

+#define BTCOEX_DBG_BT_OPERATING_STATUS			   172

+#define BTCOEX_DBG_PERFORM_RECONNECT               173

+#define BTCOEX_DBG_ACL_WLAN_MED                    175

+#define BTCOEX_DBG_ACL_BT_MED                      176

+#define BTCOEX_DBG_WLAN_CONNECT                    177

+#define BTCOEX_DBG_A2DP_DUAL_START                 178

+#define BTCOEX_DBG_PMAWAKE_NOTIFY                  179

+#define BTCOEX_DBG_BEACON_SCAN_ENABLE              180

+#define BTCOEX_DBG_BEACON_SCAN_DISABLE             181

+#define BTCOEX_DBG_RX_NOTIFY                       182

+#define BTCOEX_SCO_GET_PER_SECOND_FRM_TIMESTAMP    183

+#define BTCOEX_DBG_TXQ_DETAILS                     184

+#define BTCOEX_DBG_SCO_STOMP_LOW_PRI               185

+#define BTCOEX_DBG_A2DP_FORCE_SCAN                 186

+#define BTCOEX_DBG_DTIM_STOMP_COMP                 187

+#define BTCOEX_ACL_PRESENCE_TIMER                  188

+#define BTCOEX_DBG_QUEUE_SELF_CTS                  189

+#define BTCOEX_DBG_SELF_CTS_COMP                   190

+#define BTCOEX_DBG_APMODE_WAIT_FOR_CTS_COMP_FAILED 191

+#define BTCOEX_DBG_APMODE_A2DP_MED_TO_BT           192

+#define BTCOEX_DBG_APMODE_SET_BTSTATE              193

+#define BTCOEX_DBG_APMODE_A2DP_STATUS              194

+#define BTCOEX_DBG_APMODE_SCO_CTS_HANDLER          195

+#define BTCOEX_DBG_APMODE_SCO_STATUS               196

+#define BTCOEX_DBG_APMODE_TXQ_DRAINED              197

+#define BTCOEX_DBG_APMODE_SCO_ARM_TIMER            198

+#define BTCOEX_DBG_APMODE_SWITCH_MED_TO_WLAN       199

+#define BTCOEX_APMODE_BCN_TX_HANDLER               200

+#define BTCOEX_APMODE_BCN_TX                       201

+#define BTCOEX_APMODE_SCO_RTS_HANDLER              202

+#define BTCOEX_DBGID_DEFINITION_END

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* _DBGLOG_ID_H_ */

diff --git a/ath6kl-wmiconfig/include/ieee80211.h b/ath6kl-wmiconfig/include/ieee80211.h
new file mode 100755
index 0000000..4824ee0
--- /dev/null
+++ b/ath6kl-wmiconfig/include/ieee80211.h
@@ -0,0 +1,384 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+#ifndef _NET80211_IEEE80211_H_

+#define _NET80211_IEEE80211_H_

+

+//#include "athstartpack.h"

+

+/*

+ * 802.11 protocol definitions.

+ */

+#define IEEE80211_WEP_KEYLEN        5   /* 40bit */

+#define IEEE80211_WEP_IVLEN         3   /* 24bit */

+#define IEEE80211_WEP_KIDLEN        1   /* 1 octet */

+#define IEEE80211_WEP_CRCLEN        4   /* CRC-32 */

+#define IEEE80211_WEP_NKID          4   /* number of key ids */

+

+/*

+ * 802.11i defines an extended IV for use with non-WEP ciphers.

+ * When the EXTIV bit is set in the key id byte an additional

+ * 4 bytes immediately follow the IV for TKIP.  For CCMP the

+ * EXTIV bit is likewise set but the 8 bytes represent the

+ * CCMP header rather than IV+extended-IV.

+ */

+#define IEEE80211_WEP_EXTIV         0x20

+#define IEEE80211_WEP_EXTIVLEN      4   /* extended IV length */

+#define IEEE80211_WEP_MICLEN        8   /* trailing MIC */

+

+#define IEEE80211_CRC_LEN           4

+

+#ifdef WAPI_ENABLE

+#define IEEE80211_WAPI_EXTIVLEN      10   /* extended IV length */

+#endif /* WAPI ENABLE */

+

+

+#define IEEE80211_ADDR_LEN  6       /* size of 802.11 address */

+/* is 802.11 address multicast/broadcast? */

+#define IEEE80211_IS_MULTICAST(_a)  (*(_a) & 0x01)

+#define IEEE80211_IS_BROADCAST(_a)  (*(_a) == 0xFF)

+#define WEP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN)

+#define WEP_TRAILER IEEE80211_WEP_CRCLEN

+#define CCMP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + \

+                    IEEE80211_WEP_EXTIVLEN)

+#define CCMP_TRAILER IEEE80211_WEP_MICLEN

+#define TKIP_HEADER (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + \

+                    IEEE80211_WEP_EXTIVLEN)

+#define TKIP_TRAILER IEEE80211_WEP_CRCLEN

+#define TKIP_MICLEN  IEEE80211_WEP_MICLEN

+

+

+#define IEEE80211_ADDR_EQ(addr1, addr2)     \

+    (A_MEMCMP(addr1, addr2, IEEE80211_ADDR_LEN) == 0)

+

+#define IEEE80211_ADDR_COPY(dst,src)    A_MEMCPY(dst,src,IEEE80211_ADDR_LEN)

+

+#define IEEE80211_KEYBUF_SIZE 16

+#define IEEE80211_MICBUF_SIZE (8+8)  /* space for both tx and rx */

+

+/*

+ * NB: these values are ordered carefully; there are lots of

+ * of implications in any reordering.  In particular beware

+ * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.

+ */

+#define IEEE80211_CIPHER_WEP            0

+#define IEEE80211_CIPHER_TKIP           1

+#define IEEE80211_CIPHER_AES_OCB        2

+#define IEEE80211_CIPHER_AES_CCM        3

+#define IEEE80211_CIPHER_CKIP           5

+#define IEEE80211_CIPHER_CCKM_KRK       6

+#define IEEE80211_CIPHER_NONE           7       /* pseudo value */

+

+#define IEEE80211_CIPHER_MAX            (IEEE80211_CIPHER_NONE+1)

+

+#define IEEE80211_IS_VALID_WEP_CIPHER_LEN(len) \

+        (((len) == 5) || ((len) == 13) || ((len) == 16))

+

+

+

+/*

+ * generic definitions for IEEE 802.11 frames

+ */

+PREPACK struct ieee80211_frame {

+    A_UINT8    i_fc[2];

+    A_UINT8    i_dur[2];

+    A_UINT8    i_addr1[IEEE80211_ADDR_LEN];

+    A_UINT8    i_addr2[IEEE80211_ADDR_LEN];

+    A_UINT8    i_addr3[IEEE80211_ADDR_LEN];

+    A_UINT8    i_seq[2];

+    /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */

+    /* see below */

+} POSTPACK;

+

+PREPACK struct ieee80211_qosframe {

+    A_UINT8 i_fc[2];

+    A_UINT8 i_dur[2];

+    A_UINT8 i_addr1[IEEE80211_ADDR_LEN];

+    A_UINT8 i_addr2[IEEE80211_ADDR_LEN];

+    A_UINT8 i_addr3[IEEE80211_ADDR_LEN];

+    A_UINT8 i_seq[2];

+    A_UINT8 i_qos[2];

+} POSTPACK;

+

+#define IEEE80211_FC0_VERSION_MASK          0x03

+#define IEEE80211_FC0_VERSION_SHIFT         0

+#define IEEE80211_FC0_VERSION_0             0x00

+#define IEEE80211_FC0_TYPE_MASK             0x0c

+#define IEEE80211_FC0_TYPE_SHIFT            2

+#define IEEE80211_FC0_TYPE_MGT              0x00

+#define IEEE80211_FC0_TYPE_CTL              0x04

+#define IEEE80211_FC0_TYPE_DATA             0x08

+

+#define IEEE80211_FC0_SUBTYPE_MASK          0xf0

+#define IEEE80211_FC0_SUBTYPE_SHIFT         4

+/* for TYPE_MGT */

+#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ     0x00

+#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP    0x10

+#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ   0x20

+#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP  0x30

+#define IEEE80211_FC0_SUBTYPE_PROBE_REQ     0x40

+#define IEEE80211_FC0_SUBTYPE_PROBE_RESP    0x50

+#define IEEE80211_FC0_SUBTYPE_BEACON        0x80

+#define IEEE80211_FC0_SUBTYPE_ATIM          0x90

+#define IEEE80211_FC0_SUBTYPE_DISASSOC      0xa0

+#define IEEE80211_FC0_SUBTYPE_AUTH          0xb0

+#define IEEE80211_FC0_SUBTYPE_DEAUTH        0xc0

+/* for TYPE_CTL */

+#define IEEE80211_FC0_SUBTYPE_PS_POLL       0xa0

+#define IEEE80211_FC0_SUBTYPE_RTS           0xb0

+#define IEEE80211_FC0_SUBTYPE_CTS           0xc0

+#define IEEE80211_FC0_SUBTYPE_ACK           0xd0

+#define IEEE80211_FC0_SUBTYPE_CF_END        0xe0

+#define IEEE80211_FC0_SUBTYPE_CF_END_ACK    0xf0

+/* for TYPE_DATA (bit combination) */

+#define IEEE80211_FC0_SUBTYPE_DATA          0x00

+#define IEEE80211_FC0_SUBTYPE_CF_ACK        0x10

+#define IEEE80211_FC0_SUBTYPE_CF_POLL       0x20

+#define IEEE80211_FC0_SUBTYPE_CF_ACPL       0x30

+#define IEEE80211_FC0_SUBTYPE_NODATA        0x40

+#define IEEE80211_FC0_SUBTYPE_CFACK         0x50

+#define IEEE80211_FC0_SUBTYPE_CFPOLL        0x60

+#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70

+#define IEEE80211_FC0_SUBTYPE_QOS           0x80

+#define IEEE80211_FC0_SUBTYPE_QOS_NULL      0xc0

+

+#define IEEE80211_FC1_DIR_MASK              0x03

+#define IEEE80211_FC1_DIR_NODS              0x00    /* STA->STA */

+#define IEEE80211_FC1_DIR_TODS              0x01    /* STA->AP  */

+#define IEEE80211_FC1_DIR_FROMDS            0x02    /* AP ->STA */

+#define IEEE80211_FC1_DIR_DSTODS            0x03    /* AP ->AP  */

+

+#define IEEE80211_FC1_MORE_FRAG             0x04

+#define IEEE80211_FC1_RETRY                 0x08

+#define IEEE80211_FC1_PWR_MGT               0x10

+#define IEEE80211_FC1_MORE_DATA             0x20

+#define IEEE80211_FC1_WEP                   0x40

+#define IEEE80211_FC1_ORDER                 0x80

+

+#define IEEE80211_SEQ_FRAG_MASK             0x000f

+#define IEEE80211_SEQ_FRAG_SHIFT            0

+#define IEEE80211_SEQ_SEQ_MASK              0xfff0

+#define IEEE80211_SEQ_SEQ_SHIFT             4

+

+#define IEEE80211_NWID_LEN                  32

+

+/*

+ * 802.11 rate set.

+ */

+#define IEEE80211_RATE_SIZE     8       /* 802.11 standard */

+#define IEEE80211_RATE_MAXSIZE  15      /* max rates we'll handle */

+

+#define WMM_NUM_AC                  4   /* 4 AC categories */

+

+#define WMM_PARAM_ACI_M         0x60    /* Mask for ACI field */

+#define WMM_PARAM_ACI_S         5   /* Shift for ACI field */

+#define WMM_PARAM_ACM_M         0x10    /* Mask for ACM bit */

+#define WMM_PARAM_ACM_S         4       /* Shift for ACM bit */

+#define WMM_PARAM_AIFSN_M       0x0f    /* Mask for aifsn field */

+#define WMM_PARAM_LOGCWMIN_M    0x0f    /* Mask for CwMin field (in log) */

+#define WMM_PARAM_LOGCWMAX_M    0xf0    /* Mask for CwMax field (in log) */

+#define WMM_PARAM_LOGCWMAX_S    4   /* Shift for CwMax field */

+

+#define WMM_AC_TO_TID(_ac) (       \

+    ((_ac) == WMM_AC_VO) ? 6 : \

+    ((_ac) == WMM_AC_VI) ? 5 : \

+    ((_ac) == WMM_AC_BK) ? 1 : \

+    0)

+

+#define TID_TO_WMM_AC(_tid) (      \

+    ((_tid) < 1) ? WMM_AC_BE : \

+    ((_tid) < 3) ? WMM_AC_BK : \

+    ((_tid) < 6) ? WMM_AC_VI : \

+    WMM_AC_VO)

+/*

+ * Management information element payloads.

+ */

+

+enum {

+    IEEE80211_ELEMID_SSID       = 0,

+    IEEE80211_ELEMID_RATES      = 1,

+    IEEE80211_ELEMID_FHPARMS    = 2,

+    IEEE80211_ELEMID_DSPARMS    = 3,

+    IEEE80211_ELEMID_CFPARMS    = 4,

+    IEEE80211_ELEMID_TIM        = 5,

+    IEEE80211_ELEMID_IBSSPARMS  = 6,

+    IEEE80211_ELEMID_COUNTRY    = 7,

+    IEEE80211_ELEMID_CHALLENGE  = 16,

+    /* 17-31 reserved for challenge text extension */

+    IEEE80211_ELEMID_PWRCNSTR   = 32,

+    IEEE80211_ELEMID_PWRCAP     = 33,

+    IEEE80211_ELEMID_TPCREQ     = 34,

+    IEEE80211_ELEMID_TPCREP     = 35,

+    IEEE80211_ELEMID_SUPPCHAN   = 36,

+    IEEE80211_ELEMID_CHANSWITCH = 37,

+    IEEE80211_ELEMID_MEASREQ    = 38,

+    IEEE80211_ELEMID_MEASREP    = 39,

+    IEEE80211_ELEMID_QUIET      = 40,

+    IEEE80211_ELEMID_IBSSDFS    = 41,

+    IEEE80211_ELEMID_ERP        = 42,

+    IEEE80211_ELEMID_HTCAP_ANA  = 45,   /* Address ANA, and non-ANA story, for interop. CL#171733 */

+    IEEE80211_ELEMID_RSN        = 48,

+    IEEE80211_ELEMID_XRATES     = 50,

+    IEEE80211_ELEMID_HTINFO_ANA = 61,

+#ifdef WAPI_ENABLE

+    IEEE80211_ELEMID_WAPI       = 68,

+#endif

+    IEEE80211_ELEMID_TPC        = 150,

+    IEEE80211_ELEMID_CCKM       = 156,

+    IEEE80211_ELEMID_VENDOR     = 221,  /* vendor private */

+};

+

+#define ATH_OUI             0x7f0300        /* Atheros OUI */

+#define ATH_OUI_TYPE        0x01

+#define ATH_OUI_SUBTYPE     0x01

+#define ATH_OUI_VERSION     0x00

+

+#define WPA_OUI             0xf25000

+#define WPA_OUI_TYPE        0x01

+#define WPA_VERSION         1          /* current supported version */

+

+#define WPA_CSE_NULL        0x00

+#define WPA_CSE_WEP40       0x01

+#define WPA_CSE_TKIP        0x02

+#define WPA_CSE_CCMP        0x04

+#define WPA_CSE_WEP104      0x05

+

+#define WPA_ASE_NONE        0x00

+#define WPA_ASE_8021X_UNSPEC    0x01

+#define WPA_ASE_8021X_PSK   0x02

+

+#define RSN_OUI         0xac0f00

+#define RSN_VERSION     1       /* current supported version */

+

+#define RSN_CSE_NULL        0x00

+#define RSN_CSE_WEP40       0x01

+#define RSN_CSE_TKIP        0x02

+#define RSN_CSE_WRAP        0x03

+#define RSN_CSE_CCMP        0x04

+#define RSN_CSE_WEP104      0x05

+

+#define RSN_ASE_NONE            0x00

+#define RSN_ASE_8021X_UNSPEC    0x01

+#define RSN_ASE_8021X_PSK       0x02

+

+#define RSN_CAP_PREAUTH         0x01

+

+#define WMM_OUI                 0xf25000

+#define WMM_OUI_TYPE            0x02

+#define WMM_INFO_OUI_SUBTYPE    0x00

+#define WMM_PARAM_OUI_SUBTYPE   0x01

+#define WMM_VERSION             1

+

+/* WMM stream classes */

+#define WMM_NUM_AC  4

+#define WMM_AC_BE   0       /* best effort */

+#define WMM_AC_BK   1       /* background */

+#define WMM_AC_VI   2       /* video */

+#define WMM_AC_VO   3       /* voice */

+

+/* TSPEC related */

+#define ACTION_CATEGORY_CODE_TSPEC                 17

+#define ACTION_CODE_TSPEC_ADDTS                    0

+#define ACTION_CODE_TSPEC_ADDTS_RESP               1

+#define ACTION_CODE_TSPEC_DELTS                    2

+

+typedef enum {

+    TSPEC_STATUS_CODE_ADMISSION_ACCEPTED = 0,

+    TSPEC_STATUS_CODE_ADDTS_INVALID_PARAMS = 0x1,

+    TSPEC_STATUS_CODE_ADDTS_REQUEST_REFUSED = 0x3,

+    TSPEC_STATUS_CODE_UNSPECIFIED_QOS_RELATED_FAILURE = 0xC8,

+    TSPEC_STATUS_CODE_REQUESTED_REFUSED_POLICY_CONFIGURATION = 0xC9,

+    TSPEC_STATUS_CODE_INSUFFCIENT_BANDWIDTH = 0xCA,

+    TSPEC_STATUS_CODE_INVALID_PARAMS = 0xCB,

+    TSPEC_STATUS_CODE_DELTS_SENT    = 0x30,

+    TSPEC_STATUS_CODE_DELTS_RECV    = 0x31,

+} TSPEC_STATUS_CODE;

+

+#define TSPEC_TSID_MASK             0xF

+#define TSPEC_TSID_S                1

+

+/*

+ * WMM/802.11e Tspec Element

+ */

+typedef PREPACK struct wmm_tspec_ie_t {

+    A_UINT8     elementId;

+    A_UINT8     len;

+    A_UINT8     oui[3];

+    A_UINT8     ouiType;

+    A_UINT8     ouiSubType;

+    A_UINT8     version;

+    A_UINT16    tsInfo_info;

+    A_UINT8     tsInfo_reserved;

+    A_UINT16    nominalMSDU;

+    A_UINT16    maxMSDU;

+    A_UINT32    minServiceInt;

+    A_UINT32    maxServiceInt;

+    A_UINT32    inactivityInt;

+    A_UINT32    suspensionInt;

+    A_UINT32    serviceStartTime;

+    A_UINT32    minDataRate;

+    A_UINT32    meanDataRate;

+    A_UINT32    peakDataRate;

+    A_UINT32    maxBurstSize;

+    A_UINT32    delayBound;

+    A_UINT32    minPhyRate;

+    A_UINT16    sba;

+    A_UINT16    mediumTime;

+} POSTPACK WMM_TSPEC_IE;

+

+

+/*

+ * BEACON management packets

+ *

+ *  octet timestamp[8]

+ *  octet beacon interval[2]

+ *  octet capability information[2]

+ *  information element

+ *      octet elemid

+ *      octet length

+ *      octet information[length]

+ */

+

+#define IEEE80211_BEACON_INTERVAL(beacon) \

+    ((beacon)[8] | ((beacon)[9] << 8))

+#define IEEE80211_BEACON_CAPABILITY(beacon) \

+    ((beacon)[10] | ((beacon)[11] << 8))

+

+#define IEEE80211_CAPINFO_ESS               0x0001

+#define IEEE80211_CAPINFO_IBSS              0x0002

+#define IEEE80211_CAPINFO_CF_POLLABLE       0x0004

+#define IEEE80211_CAPINFO_CF_POLLREQ        0x0008

+#define IEEE80211_CAPINFO_PRIVACY           0x0010

+#define IEEE80211_CAPINFO_SHORT_PREAMBLE    0x0020

+#define IEEE80211_CAPINFO_PBCC              0x0040

+#define IEEE80211_CAPINFO_CHNL_AGILITY      0x0080

+/* bits 8-9 are reserved */

+#define IEEE80211_CAPINFO_SHORT_SLOTTIME    0x0400

+#define IEEE80211_CAPINFO_APSD              0x0800

+/* bit 12 is reserved */

+#define IEEE80211_CAPINFO_DSSSOFDM          0x2000

+/* bits 14-15 are reserved */

+

+/*

+ * Authentication Modes

+ */

+

+enum ieee80211_authmode {

+    IEEE80211_AUTH_NONE     = 0,

+    IEEE80211_AUTH_OPEN     = 1,

+    IEEE80211_AUTH_SHARED   = 2,

+    IEEE80211_AUTH_8021X    = 3,

+    IEEE80211_AUTH_AUTO     = 4,   /* auto-select/accept */

+    /* NB: these are used only for ioctls */

+    IEEE80211_AUTH_WPA      = 5,  /* WPA/RSN  w/ 802.1x */

+    IEEE80211_AUTH_WPA_PSK  = 6,  /* WPA/RSN  w/ PSK */

+    IEEE80211_AUTH_WPA_CCKM = 7,  /* WPA/RSN IE  w/ CCKM */

+};

+

+#define IEEE80211_PS_MAX_QUEUE    50 /*Maximum no of buffers that can be queues for PS*/

+

+//#include "athendpack.h"

+

+#endif /* _NET80211_IEEE80211_H_ */

diff --git a/ath6kl-wmiconfig/include/ieee80211_ioctl.h b/ath6kl-wmiconfig/include/ieee80211_ioctl.h
new file mode 100755
index 0000000..c0ff150
--- /dev/null
+++ b/ath6kl-wmiconfig/include/ieee80211_ioctl.h
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef _IEEE80211_IOCTL_H_

+#define _IEEE80211_IOCTL_H_

+

+#include <linux/version.h>

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+/*

+ * Extracted from the MADWIFI net80211/ieee80211_ioctl.h

+ */

+

+/*

+ * WPA/RSN get/set key request.  Specify the key/cipher

+ * type and whether the key is to be used for sending and/or

+ * receiving.  The key index should be set only when working

+ * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').

+ * Otherwise a unicast/pairwise key is specified by the bssid

+ * (on a station) or mac address (on an ap).  They key length

+ * must include any MIC key data; otherwise it should be no

+ more than IEEE80211_KEYBUF_SIZE.

+ */

+struct ieee80211req_key {

+    u_int8_t    ik_type;    /* key/cipher type */

+    u_int8_t    ik_pad;

+    u_int16_t   ik_keyix;   /* key index */

+    u_int8_t    ik_keylen;  /* key length in bytes */

+    u_int8_t    ik_flags;

+#define IEEE80211_KEY_XMIT  0x01

+#define IEEE80211_KEY_RECV  0x02

+#define IEEE80211_KEY_DEFAULT   0x80    /* default xmit key */

+    u_int8_t    ik_macaddr[IEEE80211_ADDR_LEN];

+    u_int64_t   ik_keyrsc;  /* key receive sequence counter */

+    u_int64_t   ik_keytsc;  /* key transmit sequence counter */

+    u_int8_t    ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];

+};

+/*

+ * Delete a key either by index or address.  Set the index

+ * to IEEE80211_KEYIX_NONE when deleting a unicast key.

+ */

+struct ieee80211req_del_key {

+    u_int8_t    idk_keyix;  /* key index */

+    u_int8_t    idk_macaddr[IEEE80211_ADDR_LEN];

+};

+/*

+ * MLME state manipulation request.  IEEE80211_MLME_ASSOC

+ * only makes sense when operating as a station.  The other

+ * requests can be used when operating as a station or an

+ * ap (to effect a station).

+ */

+struct ieee80211req_mlme {

+    u_int8_t    im_op;      /* operation to perform */

+#define IEEE80211_MLME_ASSOC        1   /* associate station */

+#define IEEE80211_MLME_DISASSOC     2   /* disassociate station */

+#define IEEE80211_MLME_DEAUTH       3   /* deauthenticate station */

+#define IEEE80211_MLME_AUTHORIZE    4   /* authorize station */

+#define IEEE80211_MLME_UNAUTHORIZE  5   /* unauthorize station */

+    u_int16_t   im_reason;  /* 802.11 reason code */

+    u_int8_t    im_macaddr[IEEE80211_ADDR_LEN];

+};

+

+struct ieee80211req_addpmkid {

+    u_int8_t    pi_bssid[IEEE80211_ADDR_LEN];

+    u_int8_t    pi_enable;

+    u_int8_t    pi_pmkid[16];

+};

+

+#define AUTH_ALG_OPEN_SYSTEM    0x01

+#define AUTH_ALG_SHARED_KEY 0x02

+#define AUTH_ALG_LEAP       0x04

+

+struct ieee80211req_authalg {

+   u_int8_t auth_alg;

+};  

+

+/* 

+ * Request to add an IE to a Management Frame

+ */

+enum{

+    IEEE80211_APPIE_FRAME_BEACON     = 0,

+    IEEE80211_APPIE_FRAME_PROBE_REQ  = 1,

+    IEEE80211_APPIE_FRAME_PROBE_RESP = 2,

+    IEEE80211_APPIE_FRAME_ASSOC_REQ  = 3,

+    IEEE80211_APPIE_FRAME_ASSOC_RESP = 4,

+    IEEE80211_APPIE_NUM_OF_FRAME     = 5

+};

+

+/*

+ * The Maximum length of the IE that can be added to a Management frame

+ */

+#define IEEE80211_APPIE_FRAME_MAX_LEN  200

+

+struct ieee80211req_getset_appiebuf {

+    u_int32_t app_frmtype; /* management frame type for which buffer is added */

+    u_int32_t app_buflen;  /*application supplied buffer length */

+    u_int8_t  app_buf[];

+};

+

+/* 

+ * The following definitions are used by an application to set filter

+ * for receiving management frames 

+ */

+enum {

+     IEEE80211_FILTER_TYPE_BEACON      =   0x1,

+     IEEE80211_FILTER_TYPE_PROBE_REQ   =   0x2,

+     IEEE80211_FILTER_TYPE_PROBE_RESP  =   0x4,

+     IEEE80211_FILTER_TYPE_ASSOC_REQ   =   0x8,

+     IEEE80211_FILTER_TYPE_ASSOC_RESP  =   0x10,

+     IEEE80211_FILTER_TYPE_AUTH        =   0x20,

+     IEEE80211_FILTER_TYPE_DEAUTH      =   0x40,

+     IEEE80211_FILTER_TYPE_DISASSOC    =   0x80,

+     IEEE80211_FILTER_TYPE_ALL         =   0xFF  /* used to check the valid filter bits */

+};

+

+struct ieee80211req_set_filter {

+      u_int32_t app_filterype; /* management frame filter type */

+};

+

+enum {

+    IEEE80211_PARAM_AUTHMODE = 3,   /* Authentication Mode */

+    IEEE80211_PARAM_MCASTCIPHER = 5,

+    IEEE80211_PARAM_MCASTKEYLEN = 6,    /* multicast key length */

+    IEEE80211_PARAM_UCASTCIPHER = 8,

+    IEEE80211_PARAM_UCASTKEYLEN = 9,    /* unicast key length */

+    IEEE80211_PARAM_WPA     = 10,   /* WPA mode (0,1,2) */

+    IEEE80211_PARAM_ROAMING     = 12,   /* roaming mode */

+    IEEE80211_PARAM_PRIVACY     = 13,   /* privacy invoked */

+    IEEE80211_PARAM_COUNTERMEASURES = 14,   /* WPA/TKIP countermeasures */

+    IEEE80211_PARAM_DROPUNENCRYPTED = 15,   /* discard unencrypted frames */

+    IEEE80211_PARAM_WAPI = 16,   /* WAPI policy from wapid */        

+};

+

+/*

+ * Values for IEEE80211_PARAM_WPA

+ */

+#define WPA_MODE_WPA1   1

+#define WPA_MODE_WPA2   2

+#define WPA_MODE_AUTO   3

+#define WPA_MODE_NONE   4

+

+struct ieee80211req_wpaie {

+    u_int8_t    wpa_macaddr[IEEE80211_ADDR_LEN];

+    u_int8_t    wpa_ie[IEEE80211_MAX_IE];

+    u_int8_t    rsn_ie[IEEE80211_MAX_IE];

+};

+

+#ifndef IW_ENCODE_ALG_PMK

+#define IW_ENCODE_ALG_PMK       4

+#endif

+#ifndef IW_ENCODE_ALG_KRK

+#define IW_ENCODE_ALG_KRK       6

+#endif

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* _IEEE80211_IOCTL_H_ */

diff --git a/ath6kl-wmiconfig/include/osapi_linux.h b/ath6kl-wmiconfig/include/osapi_linux.h
new file mode 100755
index 0000000..feb84d0
--- /dev/null
+++ b/ath6kl-wmiconfig/include/osapi_linux.h
@@ -0,0 +1,377 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+//------------------------------------------------------------------------------

+// This file contains the definitions of the basic atheros data types.

+// It is used to map the data types in atheros files to a platform specific

+// type.

+//

+// Author(s): ="Atheros"

+//------------------------------------------------------------------------------

+

+#ifndef _OSAPI_LINUX_H_

+#define _OSAPI_LINUX_H_

+

+#ifdef __KERNEL__

+

+#include <linux/version.h>

+#include <linux/types.h>

+#include <linux/kernel.h>

+#include <linux/string.h>

+#include <linux/skbuff.h>

+#include <linux/netdevice.h>

+#include <linux/device.h>

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)

+#include <linux/ethtool.h>

+#endif

+/*************************************/

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)

+#include <linux/jiffies.h>

+#endif

+#include <linux/timer.h>

+#include <linux/delay.h>

+#include <linux/wait.h>

+#ifdef KERNEL_2_4

+#include <asm/arch/irq.h>

+#include <asm/irq.h>

+#endif

+

+#include <linux/cache.h>

+

+#ifdef __GNUC__

+#define __ATTRIB_PACK           __attribute__ ((packed))

+#define __ATTRIB_PRINTF         __attribute__ ((format (printf, 1, 2)))

+#define __ATTRIB_NORETURN       __attribute__ ((noreturn))

+#ifndef INLINE

+#define INLINE                  __inline__

+#endif

+#else /* Not GCC */

+#define __ATTRIB_PACK

+#define __ATTRIB_PRINTF

+#define __ATTRIB_NORETURN

+#ifndef INLINE

+#define INLINE                  __inline

+#endif

+#endif /* End __GNUC__ */

+

+#define PREPACK

+#define POSTPACK                __ATTRIB_PACK

+

+/*

+ * Endianes macros

+ */

+#define A_BE2CPU8(x)       ntohb(x)

+#define A_BE2CPU16(x)      ntohs(x)

+#define A_BE2CPU32(x)      ntohl(x)

+

+#define A_LE2CPU8(x)       (x)

+#define A_LE2CPU16(x)      (x)

+#define A_LE2CPU32(x)      (x)

+

+#define A_CPU2BE8(x)       htonb(x)

+#define A_CPU2BE16(x)      htons(x)

+#define A_CPU2BE32(x)      htonl(x)

+

+#define A_MEMCPY(dst, src, len)         memcpy((A_UINT8 *)(dst), (src), (len))

+#define A_MEMZERO(addr, len)            memset(addr, 0, len)

+#define A_MEMCMP(addr1, addr2, len)     memcmp((addr1), (addr2), (len))

+

+#ifdef AR6K_ALLOC_DEBUG

+#define a_meminfo_add(p, s)  __a_meminfo_add(p, s, __func__, __LINE)

+void __a_meminfo_add(void *ptr, size_t msize, const char *func, int lineno);

+void  a_meminfo_del(void *ptr);

+void* a_mem_alloc(size_t msize, int type, const char *func, int lineno);

+void a_mem_free(void *ptr);

+void a_meminfo_report(int clear);

+A_BOOL a_meminfo_find(void *ptr);

+#define A_MALLOC(size)                  a_mem_alloc((size), GFP_KERNEL, __func__, __LINE__)

+#define A_MALLOC_NOWAIT(size)           a_mem_alloc((size), GFP_ATOMIC, __func__, __LINE__)

+#define A_FREE(addr)                    a_mem_free(addr)

+#define A_NETIF_RX(skb)                 do { a_meminfo_del(skb);  netif_rx(skb); } while (0)

+#define A_NETIF_RX_NI(skb)              do { a_meminfo_del(skb);  netif_rx_ni(skb); } while (0)

+#else

+#define a_meminfo_report(_c)

+#define A_MALLOC(size)                  kmalloc((size), GFP_KERNEL)

+#define A_MALLOC_NOWAIT(size)           kmalloc((size), GFP_ATOMIC)

+#define A_FREE(addr)                    kfree(addr)

+#define A_NETIF_RX(skb)                 netif_rx(skb)

+#define A_NETIF_RX_NI(skb)              netif_rx_ni(skb)

+#endif

+

+#if defined(ANDROID_ENV) && defined(CONFIG_ANDROID_LOGGER)

+extern unsigned int enablelogcat;

+extern int android_logger_lv(void* module, int mask);

+enum logidx { LOG_MAIN_IDX = 0 };

+extern int logger_write(const enum logidx idx, 

+                const unsigned char prio,

+                const char __kernel * const tag,

+                const char __kernel * const fmt,

+                ...);

+#define A_ANDROID_PRINTF(mask, module, tags, args...) do {  \

+    if (enablelogcat) \

+        logger_write(LOG_MAIN_IDX, android_logger_lv(module, mask), tags, args); \

+    else \

+        printk(KERN_ALERT args); \

+} while (0)

+#ifdef DEBUG

+#define A_LOGGER_MODULE_NAME(x) #x

+#define A_LOGGER(mask, mod, args...) \

+    A_ANDROID_PRINTF(mask, &GET_ATH_MODULE_DEBUG_VAR_NAME(mod), "ar6k_" A_LOGGER_MODULE_NAME(mod), args);

+#endif 

+#define A_PRINTF(args...) A_ANDROID_PRINTF(ATH_DEBUG_INFO, NULL, "ar6k_driver", args)

+#else

+#define A_LOGGER(mask, mod, args...)    printk(KERN_ALERT args)

+#define A_PRINTF(args...)               printk(KERN_ALERT args)

+#endif /* ANDROID */

+#define A_PRINTF_LOG(args...)           printk(args)

+#define A_SPRINTF(buf, args...)			sprintf (buf, args)

+

+/* Mutual Exclusion */

+typedef spinlock_t                      A_MUTEX_T;

+#define A_MUTEX_INIT(mutex)             spin_lock_init(mutex)

+#define A_MUTEX_LOCK(mutex)             spin_lock_bh(mutex)

+#define A_MUTEX_UNLOCK(mutex)           spin_unlock_bh(mutex)

+#define A_IS_MUTEX_VALID(mutex)         TRUE  /* okay to return true, since A_MUTEX_DELETE does nothing */

+#define A_MUTEX_DELETE(mutex)           /* spin locks are not kernel resources so nothing to free.. */

+

+/* Get current time in ms adding a constant offset (in ms) */

+#define A_GET_MS(offset)    \

+	(((jiffies / HZ) * 1000) + (offset))

+

+/*

+ * Timer Functions

+ */

+#define A_MDELAY(msecs)                 mdelay(msecs)

+typedef struct timer_list               A_TIMER;

+

+#define A_INIT_TIMER(pTimer, pFunction, pArg) do {              \

+    init_timer(pTimer);                                         \

+    (pTimer)->function = (pFunction);                           \

+    (pTimer)->data   = (unsigned long)(pArg);                   \

+} while (0)

+

+/*

+ * Start a Timer that elapses after 'periodMSec' milli-seconds

+ * Support is provided for a one-shot timer. The 'repeatFlag' is

+ * ignored.

+ */

+#define A_TIMEOUT_MS(pTimer, periodMSec, repeatFlag) do {                   \

+    if (repeatFlag) {                                                       \

+        printk("\n" __FILE__ ":%d: Timer Repeat requested\n",__LINE__);     \

+        panic("Timer Repeat");                                              \

+    }                                                                       \

+    mod_timer((pTimer), jiffies + HZ * (periodMSec) / 1000);                \

+} while (0)

+

+/*

+ * Cancel the Timer. 

+ */

+#define A_UNTIMEOUT(pTimer) do {                                \

+    del_timer((pTimer));                                        \

+} while (0)

+

+#define A_DELETE_TIMER(pTimer) do {                             \

+} while (0)

+

+define A_WAKE_UP(head)                 wake_up(head)

+

+#ifdef DEBUG

+extern unsigned int panic_on_assert;

+#define A_ASSERT(expr)  \

+    if (!(expr)) {   \

+        printk(KERN_ALERT"Debug Assert Caught, File %s, Line: %d, Test:%s \n",__FILE__, __LINE__,#expr); \

+        if (panic_on_assert) panic(#expr);                                                               \

+    }

+#else

+#define A_ASSERT(expr)

+#endif /* DEBUG */

+

+#ifdef ANDROID_ENV

+struct firmware;

+int android_request_firmware(const struct firmware **firmware_p, const char *filename,

+                     struct device *device);

+void android_release_firmware(const struct firmware *firmware);

+#define A_REQUEST_FIRMWARE(_ppf, _pfile, _dev) android_request_firmware(_ppf, _pfile, _dev)

+#define A_RELEASE_FIRMWARE(_pf) android_release_firmware(_pf)

+#else

+#define A_REQUEST_FIRMWARE(_ppf, _pfile, _dev) request_firmware(_ppf, _pfile, _dev)

+#define A_RELEASE_FIRMWARE(_pf) release_firmware(_pf)

+#endif 

+

+/*

+ * Initialization of the network buffer subsystem

+ */

+#define A_NETBUF_INIT()

+

+/*

+ * Network buffer queue support

+ */

+typedef struct sk_buff_head A_NETBUF_QUEUE_T;

+

+#define A_NETBUF_QUEUE_INIT(q)  \

+    a_netbuf_queue_init(q)

+

+#define A_NETBUF_ENQUEUE(q, pkt) \

+    a_netbuf_enqueue((q), (pkt))

+#define A_NETBUF_PREQUEUE(q, pkt) \

+    a_netbuf_prequeue((q), (pkt))

+#define A_NETBUF_DEQUEUE(q) \

+    (a_netbuf_dequeue(q))

+#define A_NETBUF_QUEUE_SIZE(q)  \

+    a_netbuf_queue_size(q)

+#define A_NETBUF_QUEUE_EMPTY(q) \

+    a_netbuf_queue_empty(q)

+

+/*

+ * Network buffer support

+ */

+#ifdef AR6K_ALLOC_DEBUG

+#define A_NETBUF_ALLOC(size) \

+    a_netbuf_alloc(size, __func__, __LINE__)

+#define A_NETBUF_ALLOC_RAW(size) \

+    a_netbuf_alloc_raw(size, __func__, __LINE__)

+#define A_NETBUF_CHECK(bufPtr) \

+    a_netbuf_check(bufPtr, __func__, __LINE__)

+#else

+#define A_NETBUF_ALLOC(size) \

+    a_netbuf_alloc(size)

+#define A_NETBUF_ALLOC_RAW(size) \

+    a_netbuf_alloc_raw(size)

+#endif /* AR6K_ALLOC_DEBUG */

+#define A_NETBUF_FREE(bufPtr) \

+    a_netbuf_free(bufPtr)

+#define A_NETBUF_DATA(bufPtr) \

+    a_netbuf_to_data(bufPtr)

+#define A_NETBUF_LEN(bufPtr) \

+    a_netbuf_to_len(bufPtr)

+#define A_NETBUF_PUSH(bufPtr, len) \

+    a_netbuf_push(bufPtr, len)

+#define A_NETBUF_PUT(bufPtr, len) \

+    a_netbuf_put(bufPtr, len)

+#define A_NETBUF_TRIM(bufPtr,len) \

+    a_netbuf_trim(bufPtr, len)

+#define A_NETBUF_PULL(bufPtr, len) \

+    a_netbuf_pull(bufPtr, len)

+#define A_NETBUF_HEADROOM(bufPtr)\

+    a_netbuf_headroom(bufPtr)

+#define A_NETBUF_SETLEN(bufPtr,len) \

+    a_netbuf_setlen(bufPtr, len)

+

+/* Add data to end of a buffer  */

+#define A_NETBUF_PUT_DATA(bufPtr, srcPtr,  len) \

+    a_netbuf_put_data(bufPtr, srcPtr, len) 

+

+/* Add data to start of the  buffer */

+#define A_NETBUF_PUSH_DATA(bufPtr, srcPtr,  len) \

+    a_netbuf_push_data(bufPtr, srcPtr, len) 

+

+/* Remove data at start of the buffer */

+#define A_NETBUF_PULL_DATA(bufPtr, dstPtr, len) \

+    a_netbuf_pull_data(bufPtr, dstPtr, len) 

+

+/* Remove data from the end of the buffer */

+#define A_NETBUF_TRIM_DATA(bufPtr, dstPtr, len) \

+    a_netbuf_trim_data(bufPtr, dstPtr, len) 

+

+/* View data as "size" contiguous bytes of type "t" */

+#define A_NETBUF_VIEW_DATA(bufPtr, t, size) \

+    (t )( ((struct skbuf *)(bufPtr))->data)

+

+/* return the beginning of the headroom for the buffer */

+#define A_NETBUF_HEAD(bufPtr) \

+        ((((struct sk_buff *)(bufPtr))->head))

+    

+/*

+ * OS specific network buffer access routines

+ */

+#ifdef AR6K_ALLOC_DEBUG

+void *a_netbuf_alloc(int size, const char *func, int lineno);

+void *a_netbuf_alloc_raw(int size, const char *func, int lineno);

+void a_netbuf_check(void *bufPtr, const char *func, int lineno); 

+#else

+void *a_netbuf_alloc(int size);

+void *a_netbuf_alloc_raw(int size);

+#endif

+void a_netbuf_free(void *bufPtr);

+void *a_netbuf_to_data(void *bufPtr);

+A_UINT32 a_netbuf_to_len(void *bufPtr);

+A_STATUS a_netbuf_push(void *bufPtr, A_INT32 len);

+A_STATUS a_netbuf_push_data(void *bufPtr, char *srcPtr, A_INT32 len);

+A_STATUS a_netbuf_put(void *bufPtr, A_INT32 len);

+A_STATUS a_netbuf_put_data(void *bufPtr, char *srcPtr, A_INT32 len);

+A_STATUS a_netbuf_pull(void *bufPtr, A_INT32 len);

+A_STATUS a_netbuf_pull_data(void *bufPtr, char *dstPtr, A_INT32 len);

+A_STATUS a_netbuf_trim(void *bufPtr, A_INT32 len);

+A_STATUS a_netbuf_trim_data(void *bufPtr, char *dstPtr, A_INT32 len);

+A_STATUS a_netbuf_setlen(void *bufPtr, A_INT32 len);

+A_INT32 a_netbuf_headroom(void *bufPtr);

+void a_netbuf_enqueue(A_NETBUF_QUEUE_T *q, void *pkt);

+void a_netbuf_prequeue(A_NETBUF_QUEUE_T *q, void *pkt);

+void *a_netbuf_dequeue(A_NETBUF_QUEUE_T *q);

+int a_netbuf_queue_size(A_NETBUF_QUEUE_T *q);

+int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q);

+int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q);

+void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q);

+

+/*

+ * Kernel v.s User space functions

+ */

+A_UINT32 a_copy_to_user(void *to, const void *from, A_UINT32 n);

+A_UINT32 a_copy_from_user(void *to, const void *from, A_UINT32 n);

+

+/* In linux, WLAN Rx and Tx run in different contexts, so no need to check

+ * for any commands/data queued for WLAN */

+#define A_CHECK_DRV_TX()   

+             

+#define A_GET_CACHE_LINE_BYTES()    L1_CACHE_BYTES

+

+#define A_CACHE_LINE_PAD            128

+

+static inline void *A_ALIGN_TO_CACHE_LINE(void *ptr) {   

+    return (void *)L1_CACHE_ALIGN((unsigned long)ptr);

+}

+   

+#else /* __KERNEL__ */

+

+#ifdef __GNUC__

+#define __ATTRIB_PACK           __attribute__ ((packed))

+#define __ATTRIB_PRINTF         __attribute__ ((format (printf, 1, 2)))

+#define __ATTRIB_NORETURN       __attribute__ ((noreturn))

+#ifndef INLINE

+#define INLINE                  __inline__

+#endif

+#else /* Not GCC */

+#define __ATTRIB_PACK

+#define __ATTRIB_PRINTF

+#define __ATTRIB_NORETURN

+#ifndef INLINE

+#define INLINE                  __inline

+#endif

+#endif /* End __GNUC__ */

+

+#define PREPACK

+#define POSTPACK                __ATTRIB_PACK

+

+#define A_MEMCPY(dst, src, len)         memcpy((dst), (src), (len))

+#define A_MEMZERO(addr, len)            memset((addr), 0, (len))

+#define A_MEMCMP(addr1, addr2, len)     memcmp((addr1), (addr2), (len))

+#define A_MALLOC(size)                  malloc(size)

+#define A_FREE(addr)                    free(addr)

+

+#ifdef ANDROID

+#ifndef err

+#include <errno.h>

+#define err(_s, args...) do { \

+    fprintf(stderr, "%s: line %d ", __FILE__, __LINE__); \

+    fprintf(stderr, args); fprintf(stderr, ": %d\n", errno); \

+    exit(_s); } while (0)

+#endif

+#else

+#include <err.h>

+#endif

+

+#endif /* __KERNEL__ */

+

+#endif /* _OSAPI_LINUX_H_ */

diff --git a/ath6kl-wmiconfig/include/pkt_log.h b/ath6kl-wmiconfig/include/pkt_log.h
new file mode 100755
index 0000000..a542a91
--- /dev/null
+++ b/ath6kl-wmiconfig/include/pkt_log.h
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef __PKT_LOG_H__

+#define __PKT_LOG_H__

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+

+/* Pkt log info */

+typedef PREPACK struct pkt_log_t {

+    struct info_t {

+        A_UINT16    st;

+        A_UINT16    end;

+        A_UINT16    cur;

+    }info[4096];

+    A_UINT16    last_idx;

+}POSTPACK PACKET_LOG;

+

+

+#ifdef __cplusplus

+}

+#endif

+#endif  /* __PKT_LOG_H__ */

diff --git a/ath6kl-wmiconfig/include/testcmd.h b/ath6kl-wmiconfig/include/testcmd.h
new file mode 100755
index 0000000..20f58c9
--- /dev/null
+++ b/ath6kl-wmiconfig/include/testcmd.h
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+

+#ifndef  TESTCMD_H_

+#define  TESTCMD_H_

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+#ifdef AR6002_REV2

+#define TCMD_MAX_RATES 12

+#else

+#define TCMD_MAX_RATES 28

+#endif

+

+#define WMI_CMD_ID_SIZE   4

+#define WMI_CMDS_SIZE_MAX 2048

+#define TC_CMDS_GAP       16

+// should add up to the same size as buf[WMI_CMDS_SIZE_MAX]

+//#define TC_CMDS_SIZE_MAX  (WMI_CMDS_SIZE_MAX - sizeof(TC_CMDS_HDR) - WMI_CMD_ID_SIZE - TC_CMDS_GAP)  

+#define TC_CMDS_SIZE_MAX  256

+

+typedef enum {

+    ZEROES_PATTERN = 0,

+    ONES_PATTERN,

+    REPEATING_10,

+    PN7_PATTERN,

+    PN9_PATTERN,

+    PN15_PATTERN

+}TX_DATA_PATTERN;

+

+/* Continous tx

+   mode : TCMD_CONT_TX_OFF - Disabling continous tx

+          TCMD_CONT_TX_SINE - Enable continuous unmodulated tx

+          TCMD_CONT_TX_FRAME- Enable continuous modulated tx

+   freq : Channel freq in Mhz. (e.g 2412 for channel 1 in 11 g)

+dataRate: 0 - 1 Mbps

+          1 - 2 Mbps

+          2 - 5.5 Mbps

+          3 - 11 Mbps

+          4 - 6 Mbps

+          5 - 9 Mbps

+          6 - 12 Mbps

+          7 - 18 Mbps

+          8 - 24 Mbps

+          9 - 36 Mbps

+         10 - 28 Mbps

+         11 - 54 Mbps

+  txPwr: twice the Tx power in dBm, actual dBm values of [5 -11] for unmod Tx,

+      [5-14] for mod Tx

+antenna:  1 - one antenna

+          2 - two antenna

+Note : Enable/disable continuous tx test cmd works only when target is awake.

+*/

+

+typedef enum {

+    TCMD_CONT_TX_OFF = 0,

+    TCMD_CONT_TX_SINE,

+    TCMD_CONT_TX_FRAME,

+    TCMD_CONT_TX_TX99,

+    TCMD_CONT_TX_TX100

+} TCMD_CONT_TX_MODE;

+

+typedef enum {

+    TCMD_WLAN_MODE_NOHT = 0,

+    TCMD_WLAN_MODE_HT20 = 1,

+    TCMD_WLAN_MODE_HT40PLUS = 2,

+    TCMD_WLAN_MODE_HT40MINUS = 3,

+    TCMD_WLAN_MODE_CCK = 4,

+

+    TCMD_WLAN_MODE_MAX,

+    TCMD_WLAN_MODE_INVALID = TCMD_WLAN_MODE_MAX,

+

+} TCMD_WLAN_MODE;

+

+typedef enum {

+    TPC_TX_PWR = 0,

+    TPC_FORCED_GAIN,

+    TPC_TGT_PWR

+} TPC_TYPE;

+

+typedef PREPACK struct {

+    A_UINT32                testCmdId;

+    A_UINT32                mode;

+    A_UINT32                freq;

+    A_UINT32                dataRate;

+    A_INT32                 txPwr;

+    A_UINT32                antenna;

+    A_UINT32                enANI;

+    A_UINT32                scramblerOff;

+    A_UINT32                aifsn;

+    A_UINT16                pktSz;

+    A_UINT16                txPattern;

+    A_UINT32                shortGuard;

+    A_UINT32                numPackets;

+    A_UINT32                wlanMode;

+    A_UINT32                tpcm;

+} POSTPACK TCMD_CONT_TX;

+

+#define TCMD_TXPATTERN_ZERONE                 0x1

+#define TCMD_TXPATTERN_ZERONE_DIS_SCRAMBLE    0x2

+

+/* Continuous Rx

+ act: TCMD_CONT_RX_PROMIS - promiscuous mode (accept all incoming frames)

+      TCMD_CONT_RX_FILTER - filter mode (accept only frames with dest

+                                             address equal specified

+                                             mac address (set via act =3)

+      TCMD_CONT_RX_REPORT  off mode  (disable cont rx mode and get the

+                                          report from the last cont

+                                          Rx test)

+

+     TCMD_CONT_RX_SETMAC - set MacAddr mode (sets the MAC address for the

+                                                 target. This Overrides

+                                                 the default MAC address.)

+

+*/

+typedef enum {

+    TCMD_CONT_RX_PROMIS =0,

+    TCMD_CONT_RX_FILTER,

+    TCMD_CONT_RX_REPORT,

+    TCMD_CONT_RX_SETMAC,

+    TCMD_CONT_RX_SET_ANT_SWITCH_TABLE,

+ 

+    TC_CMD_RESP,

+} TCMD_CONT_RX_ACT;

+

+typedef PREPACK struct {

+    A_UINT32        testCmdId;

+    A_UINT32        act;

+    A_UINT32        enANI;

+    PREPACK union {

+        struct PREPACK TCMD_CONT_RX_PARA {

+            A_UINT32    freq;

+            A_UINT32    antenna;

+            A_UINT32    wlanMode;

+        } POSTPACK para;

+        struct PREPACK TCMD_CONT_RX_REPORT {

+            A_UINT32    totalPkt;

+            A_INT32     rssiInDBm;

+            A_UINT32    crcErrPkt;

+            A_UINT32    secErrPkt;

+            A_UINT16    rateCnt[TCMD_MAX_RATES];

+            A_UINT16    rateCntShortGuard[TCMD_MAX_RATES];

+        } POSTPACK report;

+        struct PREPACK TCMD_CONT_RX_MAC {

+            A_UCHAR     addr[ATH_MAC_LEN];			

+            A_UCHAR     btaddr[ATH_MAC_LEN];     

+            A_UINT16    regDmn[2];			

+            A_UINT32    otpWriteFlag;    			

+        } POSTPACK mac;

+        struct PREPACK TCMD_CONT_RX_ANT_SWITCH_TABLE {

+            A_UINT32                antswitch1;

+            A_UINT32                antswitch2;

+        }POSTPACK antswitchtable;

+    } POSTPACK u;

+} POSTPACK TCMD_CONT_RX;

+

+/* Force sleep/wake  test cmd

+ mode: TCMD_PM_WAKEUP - Wakeup the target

+       TCMD_PM_SLEEP - Force the target to sleep.

+ */

+typedef enum {

+    TCMD_PM_WAKEUP = 1, /* be consistent with target */

+    TCMD_PM_SLEEP,

+    TCMD_PM_DEEPSLEEP

+} TCMD_PM_MODE;

+

+typedef PREPACK struct {

+    A_UINT32  testCmdId;

+    A_UINT32  mode;

+} POSTPACK TCMD_PM;

+

+typedef enum {

+    TC_CMDS_VERSION_RESERVED=0,

+    TC_CMDS_VERSION_MDK,

+    TC_CMDS_VERSION_TS,

+    TC_CMDS_VERSION_LAST,

+} TC_CMDS_VERSION;

+

+typedef enum {

+    TC_CMDS_TS =0,

+    TC_CMDS_CAL,

+    TC_CMDS_TPCCAL = TC_CMDS_CAL,

+    TC_CMDS_TPCCAL_WITH_OTPWRITE,

+    TC_CMDS_OTPDUMP,

+    TC_CMDS_OTPSTREAMWRITE,    

+    TC_CMDS_EFUSEDUMP,    

+    TC_CMDS_EFUSEWRITE,    

+    TC_CMDS_READTHERMAL,

+} TC_CMDS_ACT;

+

+typedef PREPACK struct {

+    A_UINT32   testCmdId;

+    A_UINT32   act;

+    PREPACK union {

+        A_UINT32  enANI;    // to be identical to CONT_RX struct

+        struct PREPACK {

+            A_UINT16   length;

+            A_UINT8    version;

+            A_UINT8    bufLen;

+        } POSTPACK parm;

+    } POSTPACK u;

+} POSTPACK TC_CMDS_HDR;

+

+typedef PREPACK struct {

+    TC_CMDS_HDR  hdr;

+    A_UINT8      buf[TC_CMDS_SIZE_MAX];

+} POSTPACK TC_CMDS;

+

+typedef PREPACK struct {

+    A_UINT32    testCmdId;

+    A_UINT32    regAddr;

+    A_UINT32    val;

+    A_UINT16    flag;

+} POSTPACK TCMD_SET_REG;

+

+typedef enum {

+    TCMD_CONT_TX_ID,

+    TCMD_CONT_RX_ID,

+    TCMD_PM_ID,

+    TC_CMDS_ID,

+    TCMD_SET_REG_ID,

+	

+	/*For synergy purpose we added the following tcmd id but these

+	tcmd's will not go to the firmware instead we will write values 

+	to the NV area */

+	

+	TCMD_NIC_MAC = 100, 

+	TCMD_CAL_FILE_INDEX = 101,

+} TCMD_ID;

+

+typedef PREPACK struct 

+{

+    A_UINT32  testCmdId;

+    A_UINT8   mac_address[ATH_MAC_LEN];

+} POSTPACK TCMD_NIC_MAC_S;

+

+typedef PREPACK struct 

+{

+       A_UINT32  testCmdId;

+       A_UINT32   cal_file_index;

+} POSTPACK TCMD_CAL_FILE_INDEX_S;

+

+typedef PREPACK union {

+          TCMD_CONT_TX         contTx;

+          TCMD_CONT_RX         contRx;

+          TCMD_PM              pm;

+          // New test cmds from ART/MDK ...

+          TC_CMDS              tcCmds;          

+          TCMD_SET_REG setReg;

+} POSTPACK TEST_CMD;

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif /* TESTCMD_H_ */

+

+

diff --git a/ath6kl-wmiconfig/include/wmi.h b/ath6kl-wmiconfig/include/wmi.h
new file mode 100755
index 0000000..8655a85
--- /dev/null
+++ b/ath6kl-wmiconfig/include/wmi.h
@@ -0,0 +1,4838 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+
+/*
+ * This file contains the definitions of the WMI protocol specified in the
+ * Wireless Module Interface (WMI).  It includes definitions of all the
+ * commands and events. Commands are messages from the host to the WM.
+ * Events and Replies are messages from the WM to the host.
+ *
+ * Ownership of correctness in regards to commands
+ * belongs to the host driver and the WMI is not required to validate
+ * parameters for value, proper range, or any other checking.
+ *
+ */
+
+#ifndef _WMI_H_
+#define _WMI_H_
+
+#ifndef ATH_TARGET
+//#include "athstartpack.h"
+#endif
+
+//#include "wmix.h"
+//#include "wlan_defs.h"
+//#include "dfs_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HTC_PROTOCOL_VERSION    0x0002
+#define HTC_PROTOCOL_REVISION   0x0000
+
+#define WMI_PROTOCOL_VERSION    0x0002
+#define WMI_PROTOCOL_REVISION   0x0000
+
+#define ATH_MAC_LEN             6               /* length of mac in bytes */
+#define WMI_CMD_MAX_LEN         100
+#define WMI_CONTROL_MSG_MAX_LEN     256
+#define WMI_OPT_CONTROL_MSG_MAX_LEN 1536
+#define IS_ETHERTYPE(_typeOrLen)        ((_typeOrLen) >= 0x0600)
+#define RFC1042OUI      {0x00, 0x00, 0x00}
+
+#define IP_ETHERTYPE 0x0800
+
+#define WMI_IMPLICIT_PSTREAM 0xFF
+#define WMI_MAX_THINSTREAM 15
+
+#ifdef AR6002_REV2
+#define IBSS_MAX_NUM_STA          4
+#else
+#define IBSS_MAX_NUM_STA          8
+#endif
+
+#define WMI_MODE_MAX              8
+#define WMI_MAX_RATE_MASK         2
+#define WMI_NETWORK_TYPE(networkType) ((networkType) & 0x000F)
+#define WMI_CONNECTED_PHYMODE(networkType) (((networkType) & 0x0F00) >> 8)
+
+/* Max rates we'll handle */
+#define WMI_RATE_MAXSIZE       15
+/*
+ * These constants are used with A_WLAN_BAND_SET.
+ */
+#define A_BAND_24GHZ           0
+#define A_BAND_5GHZ            1
+#define A_NUM_BANDS            2
+
+PREPACK struct host_app_area_s {
+    A_UINT32 wmi_protocol_ver;
+} POSTPACK;
+
+/*
+ * Data Path
+ */
+typedef PREPACK struct {
+    A_UINT8     dstMac[ATH_MAC_LEN];
+    A_UINT8     srcMac[ATH_MAC_LEN];
+    A_UINT16    typeOrLen;
+} POSTPACK ATH_MAC_HDR;
+
+typedef PREPACK struct {
+    A_UINT8     dsap;
+    A_UINT8     ssap;
+    A_UINT8     cntl;
+    A_UINT8     orgCode[3];
+    A_UINT16    etherType;
+} POSTPACK ATH_LLC_SNAP_HDR;
+
+typedef enum {
+    DATA_MSGTYPE = 0x0,
+    CNTL_MSGTYPE,
+    SYNC_MSGTYPE,
+    OPT_MSGTYPE,
+} WMI_MSG_TYPE;
+
+
+/*
+ * Macros for operating on WMI_DATA_HDR (info) field
+ */
+
+#define WMI_DATA_HDR_MSG_TYPE_MASK  0x03
+#define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
+#define WMI_DATA_HDR_UP_MASK        0x07
+#define WMI_DATA_HDR_UP_SHIFT       2
+/* In AP mode, the same bit (b5) is used to indicate Power save state in
+ * the Rx dir and More data bit state in the tx direction.
+ */
+#define WMI_DATA_HDR_PS_MASK        0x1
+#define WMI_DATA_HDR_PS_SHIFT       5
+
+#define WMI_DATA_HDR_MORE_MASK      0x1
+#define WMI_DATA_HDR_MORE_SHIFT     5
+
+typedef enum {
+    WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
+    WMI_DATA_HDR_DATA_TYPE_802_11,
+    WMI_DATA_HDR_DATA_TYPE_ACL,
+} WMI_DATA_HDR_DATA_TYPE;
+
+/* Bitmap of data header flags */
+typedef enum {
+    WMI_DATA_HDR_FLAGS_MORE = 0x1,
+    WMI_DATA_HDR_FLAGS_EOSP = 0x2,
+} WMI_DATA_HDR_FLAGS;
+
+#define WMI_DATA_HDR_DATA_TYPE_MASK     0x3
+#define WMI_DATA_HDR_DATA_TYPE_SHIFT    6
+
+#define WMI_DATA_HDR_GET_RSSI(h) ((h)->rssi)
+
+#define WMI_DATA_HDR_SET_MORE_BIT(h) ((h)->info |= (WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT))
+#define WMI_DATA_HDR_HAS_MORE_BIT(h) ((h)->info & (WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT))
+
+#define WMI_DATA_HDR_IS_MSG_TYPE(h, t)  (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t))
+#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))
+#define WMI_DATA_HDR_GET_UP(h)    (((h)->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK)
+#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))
+
+#define WMI_DATA_HDR_GET_DATA_TYPE(h)   (((h)->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) & WMI_DATA_HDR_DATA_TYPE_MASK)
+#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))
+
+#define WMI_DATA_HDR_GET_DOT11(h)   (WMI_DATA_HDR_GET_DATA_TYPE((h)) == WMI_DATA_HDR_DATA_TYPE_802_11)
+#define WMI_DATA_HDR_SET_DOT11(h, p) WMI_DATA_HDR_SET_DATA_TYPE((h), (p))
+
+/* Macros for operating on WMI_DATA_HDR (info2) field */
+#define WMI_DATA_HDR_SEQNO_MASK     0xFFF
+#define WMI_DATA_HDR_SEQNO_SHIFT    0
+
+#define WMI_DATA_HDR_AMSDU_MASK     0x1
+#define WMI_DATA_HDR_AMSDU_SHIFT    12
+
+#define WMI_DATA_HDR_META_MASK      0x7
+#define WMI_DATA_HDR_META_SHIFT     13
+
+#define GET_SEQ_NO(_v)                  ((_v) & WMI_DATA_HDR_SEQNO_MASK)
+#define GET_ISMSDU(_v)                  ((_v) & WMI_DATA_HDR_AMSDU_MASK)
+
+#define WMI_DATA_HDR_GET_SEQNO(h)        GET_SEQ_NO((h)->info2 >> WMI_DATA_HDR_SEQNO_SHIFT)
+#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))
+
+#define WMI_DATA_HDR_IS_AMSDU(h)        GET_ISMSDU((h)->info2 >> WMI_DATA_HDR_AMSDU_SHIFT)
+#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))
+
+#define WMI_DATA_HDR_GET_META(h)        (((h)->info2 >> WMI_DATA_HDR_META_SHIFT) & WMI_DATA_HDR_META_MASK)
+#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))
+
+/* Macros for operating on WMI_DATA_HDR (info3) field */
+#define WMI_DATA_HDR_DEVID_MASK      0xF
+#define WMI_DATA_HDR_DEVID_SHIFT     0
+#define GET_DEVID(_v)                ((_v) & WMI_DATA_HDR_DEVID_MASK)
+
+#define WMI_DATA_HDR_GET_DEVID(h)        (((h)->info3 >> WMI_DATA_HDR_DEVID_SHIFT) & WMI_DATA_HDR_DEVID_MASK)
+#define WMI_DATA_HDR_SET_DEVID(h, _v)   ((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_DEVID_MASK << WMI_DATA_HDR_DEVID_SHIFT)) | (GET_DEVID(_v) << WMI_DATA_HDR_DEVID_SHIFT))
+
+#define WMI_DATA_HDR_RXFILT_SHIFT   4
+#define WMI_DATA_HDR_RXFILT_MASK    (0x1 << WMI_DATA_HDR_RXFILT_SHIFT)
+
+#define WMI_DATA_HDR_IS_RXFILTERED(h)  ((h)->info3 & WMI_DATA_HDR_RXFILT_MASK)
+#define SET_WMI_DATA_HDR_RXFILTERED(h)  (h)->info3 |= WMI_DATA_HDR_RXFILT_MASK 
+
+#define WMI_DATA_HDR_TRIGGER_MASK      0x1
+#define WMI_DATA_HDR_TRIGGER_SHIFT     4
+#define WMI_DATA_HDR_SET_TRIGGER(h, _v)   ((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_TRIGGER_MASK << WMI_DATA_HDR_TRIGGER_SHIFT)) | ((_v) << WMI_DATA_HDR_TRIGGER_SHIFT))
+#define WMI_DATA_HDR_IS_TRIGGER(h)       ((((h)->info3 >> WMI_DATA_HDR_TRIGGER_SHIFT) & WMI_DATA_HDR_TRIGGER_MASK) == WMI_DATA_HDR_TRIGGER_MASK)
+
+#define WMI_DATA_HDR_EOSP_MASK      WMI_DATA_HDR_TRIGGER_MASK
+#define WMI_DATA_HDR_EOSP_SHIFT     WMI_DATA_HDR_TRIGGER_SHIFT
+
+#define WMI_DATA_HDR_SET_EOSP_BIT(h) ((h)->info3 |= (WMI_DATA_HDR_EOSP_MASK << WMI_DATA_HDR_EOSP_SHIFT))
+#define WMI_DATA_HDR_HAS_EOSP_BIT(h) ((h)->info3 & (WMI_DATA_HDR_EOSP_MASK << WMI_DATA_HDR_EOSP_SHIFT))
+
+
+#define WMI_DATA_HDR_CCX_LINKTEST_MASK      0x1
+#define WMI_DATA_HDR_CCX_LINKTEST_SHIFT     5
+#define WMI_DATA_HDR_SET_CCX_LINKTEST_BIT(h) ((h)->info3 |= (WMI_DATA_HDR_CCX_LINKTEST_MASK << WMI_DATA_HDR_CCX_LINKTEST_SHIFT))
+#define WMI_DATA_HDR_HAS_CCX_LINKTEST_BIT(h) ((h)->info3 & (WMI_DATA_HDR_CCX_LINKTEST_MASK << WMI_DATA_HDR_CCX_LINKTEST_SHIFT))
+
+#define WMI_DATA_HDR_PAD_BEFORE_DATA_MASK               0xFF
+#define WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT              0x8
+#define GET_PAD_BEFORE_DATA_START(_v)                   ((_v) & WMI_DATA_HDR_PAD_BEFORE_DATA_MASK)
+
+#define WMI_DATA_HDR_GET_PAD_BEFORE_DATA_START(h)       (((h)->info3 >> WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT) & WMI_DATA_HDR_PAD_BEFORE_DATA_MASK)
+#define WMI_DATA_HDR_SET_PAD_BEFORE_DATA_START(h, _v)   ((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_PAD_BEFORE_DATA_MASK << WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT)) | (GET_PAD_BEFORE_DATA_START(_v) << WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT))
+
+typedef PREPACK struct {
+    A_INT8      rssi;
+    A_UINT8     info;               /* usage of 'info' field(8-bit):
+                                     *  b1:b0       - WMI_MSG_TYPE
+                                     *  b4:b3:b2    - UP(tid)
+                                     *  b5          - Used in AP mode. More-data in tx dir, PS in rx.
+                                     *  b7:b6       -  Dot3 header(0),
+                                     *                 Dot11 Header(1),
+                                     *                 ACL data(2)
+                                     */
+
+    A_UINT16    info2;              /* usage of 'info2' field(16-bit):
+                                     * b11:b0       - seq_no
+                                     * b12          - A-MSDU?
+                                     * b15:b13      - META_DATA_VERSION 0 - 7
+                                     */
+    A_UINT16    info3;              /* b3:b2:b1:b0  - device id
+                                     * b4           - Used in AP mode. uAPSD trigger in rx, EOSP in tx
+                                     * b7:b5        - unused?
+                                     * b15:b8       - pad before data start(irrespective of meta version)
+                                     */
+} POSTPACK WMI_DATA_HDR;
+
+/*
+ *  TX META VERSION DEFINITIONS
+ */
+#define WMI_MAX_TX_META_SZ  (12)
+#define WMI_MAX_TX_META_VERSION (7)
+#define WMI_META_VERSION_1 (0x01)
+#define WMI_META_VERSION_2 (0X02)
+#define WMI_META_VERSION_3 (0x03)
+#define WMI_META_VERSION_4 (0x04)
+
+#define WMI_ACL_TO_DOT11_HEADROOM   36
+
+#if 0 /* removed to prevent compile errors for WM.. */
+typedef PREPACK struct {
+/* intentionally empty. Default version is no meta data. */
+} POSTPACK WMI_TX_META_V0;
+#endif
+
+typedef PREPACK struct {
+    A_UINT8     pktID;           /* The packet ID to identify the tx request */
+    A_UINT8     ratePolicyID;    /* The rate policy to be used for the tx of this frame */
+} POSTPACK WMI_TX_META_V1;
+
+
+#define WMI_CSUM_DIR_TX (0x1)
+#define TX_CSUM_CALC_FILL (0x1)
+typedef PREPACK struct {
+    A_UINT8    csumStart;       /*Offset from start of the Payload(SNAP header) for csum calculation to begin */
+    A_UINT8    csumDest;        /*Offset from start of Payload(SNAP header) where final csum goes*/
+    A_UINT8     csumFlags;    /*Flag for check sum engine to be offloaded to device*/
+} POSTPACK WMI_TX_META_V2;
+
+/* WMI_META_TX_FLAG... are used as TX qualifiers for frames containing WMI_TX_RATE_SCHEDULE in the
+ * meta data.  0 or more of these flags should be assigned to the flags member of the schedule. */
+#define WMI_META_TX_FLAG_ACK            0x01 // frame needs ACK response from receiver
+#define WMI_META_TX_FLAG_SET_RETRY_BIT  0x02 // device will set retry bit in MAC header for retried frames.
+#define WMI_META_TX_FLAG_SET_DURATION   0x04 // device will fill duration field in MAC header
+/* NOTE: If WMI_META_TX_FLAG_USE_PREFIX == 0 device will NOT use prefix frame.
+ *       If WMI_META_TX_FLAG_USE_PREFIX == 1 && WMI_META_TX_FLAG_PREFIX_RTS == 0 device will use CTS prefix.
+ *       If WMI_META_TX_FLAG_USE_PREFIX == 1 && WMI_META_TX_FLAG_PREFIX_RTS == 1 device will use RTS prefix.
+ */
+#define WMI_META_TX_FLAG_USE_PREFIX     0x08 // device will send either RTS or CTS frame prior to subject frame.
+#define WMI_META_TX_FLAG_PREFIX_RTS     0x10 // device will send RTS and wait for CTS prior to sending subject frame.
+#define WMI_META_TX_LOAD_TSF            0x20 // device will fill the TSF field during transmit procedure. <Beacons/probe responses>
+
+/* WMI_TX_RATE_SCHEDULE - Acts as a host-provided rate schedule to replace what would be normally determined
+ * by firmware.  This allows the host to specify what rates and attempts should be used to transmit the
+ * frame. */
+typedef PREPACK struct {
+#define WMI_TX_MAX_RATE_SERIES (4)
+    A_UINT8 rateSeries[WMI_TX_MAX_RATE_SERIES]; //rate index for each series. first invalid rate terminates series.
+    A_UINT8 trySeries[WMI_TX_MAX_RATE_SERIES]; //number of tries for each series.
+    A_UINT8 flags; // combination of WMI_META_TX_FLAG...
+    A_UINT8 accessCategory; // should be WMM_AC_BE for managment frames and multicast frames.
+    //A_UINT8 keyIndex;
+    //
+}POSTPACK WMI_TX_RATE_SCHEDULE;
+
+#ifdef TIME_BASED_DISCARD
+typedef PREPACK struct {
+    A_UINT32 txdiscardTime;
+    A_UINT8 discardDispostion;
+} POSTPACK WMI_TX_META_V4;
+#endif
+
+typedef PREPACK struct {
+    WMI_TX_RATE_SCHEDULE rateSched;
+    A_UINT8     pktID;           /* The packet ID to identify the tx request */
+} POSTPACK WMI_TX_META_V3;
+
+/*
+ *  RX META VERSION DEFINITIONS
+ */
+/* if RX meta data is present at all then the meta data field
+ *  will consume WMI_MAX_RX_META_SZ bytes of space between the
+ *  WMI_DATA_HDR and the payload. How much of the available
+ *  Meta data is actually used depends on which meta data
+ *  version is active. */
+#define WMI_MAX_RX_META_SZ  (12)
+#define WMI_MAX_RX_META_VERSION (7)
+
+#define WMI_RX_STATUS_OK            0 /* success */
+#define WMI_RX_STATUS_DECRYPT_ERR   1 /* decrypt error */
+#define WMI_RX_STATUS_MIC_ERR       2 /* tkip MIC error */
+#define WMI_RX_STATUS_ERR           3 /* undefined error */
+
+#define WMI_RX_FLAGS_AGGR           0x0001 /* part of AGGR */
+#define WMI_RX_FlAGS_STBC           0x0002 /* used STBC */
+#define WMI_RX_FLAGS_SGI            0x0004 /* used SGI */
+#define WMI_RX_FLAGS_HT             0x0008 /* is HT packet */
+/* the flags field is also used to store the CRYPTO_TYPE of the frame
+ * that value is shifted by WMI_RX_FLAGS_CRYPTO_SHIFT */
+#define WMI_RX_FLAGS_CRYPTO_SHIFT   4
+#define WMI_RX_FLAGS_CRYPTO_MASK    0x1f
+#define WMI_RX_META_GET_CRYPTO(flags) (((flags) >> WMI_RX_FLAGS_CRYPTO_SHIFT) & WMI_RX_FLAGS_CRYPTO_MASK)
+
+#if 0 /* removed to prevent compile errors for WM.. */
+typedef PREPACK struct {
+/* intentionally empty. Default version is no meta data. */
+} POSTPACK WMI_RX_META_VERSION_0;
+#endif
+
+typedef PREPACK struct {
+    A_UINT8     status; /* one of WMI_RX_STATUS_... */
+    A_UINT8     rix;    /* rate index mapped to rate at which this packet was received. */
+    A_UINT8     rssi;   /* rssi of packet */
+    A_UINT8     channel;/* rf channel during packet reception */
+    A_UINT16    flags;  /* a combination of WMI_RX_FLAGS_... */
+} POSTPACK WMI_RX_META_V1;
+
+#define RX_CSUM_VALID_FLAG (0x1)
+typedef PREPACK struct {
+    A_UINT16    csum;
+    A_UINT8     csumFlags;/* bit 0 set -partial csum valid
+                             bit 1 set -test mode */
+} POSTPACK WMI_RX_META_V2;
+
+#ifdef TIME_BASED_DISCARD
+typedef PREPACK struct {
+	A_UINT8  	discardDispostion;
+	A_UINT32	txdiscardTime;
+} POSTPACK WMI_RX_META_V4;
+#endif
+
+
+#define WMI_GET_DEVICE_ID(info1) ((info1) & 0xF)
+/* Macros for operating on WMI_CMD_HDR (info1) field */
+#define WMI_CMD_HDR_DEVID_MASK      0xF
+#define WMI_CMD_HDR_DEVID_SHIFT     0
+#define GET_CMD_DEVID(_v)           ((_v) & WMI_CMD_HDR_DEVID_MASK)
+
+#define WMI_CMD_HDR_GET_DEVID(h)        (((h)->info1 >> WMI_CMD_HDR_DEVID_SHIFT) & WMI_CMD_HDR_DEVID_MASK)
+#define WMI_CMD_HDR_SET_DEVID(h, _v)   ((h)->info1 = ((h)->info1 & ~(WMI_CMD_HDR_DEVID_MASK << WMI_CMD_HDR_DEVID_SHIFT)) | (GET_CMD_DEVID(_v) << WMI_CMD_HDR_DEVID_SHIFT))
+
+/*
+ * Control Path
+ */
+typedef PREPACK struct {
+    A_UINT16    commandId;
+/*
+ * info1 - 16 bits
+ * b03:b00 - id
+ * b15:b04 - unused
+ */
+    A_UINT16    info1;
+
+    A_UINT16    reserved;      /* For alignment */
+} POSTPACK WMI_CMD_HDR;        /* used for commands and events */
+
+/*
+ * List of Commnands
+ */
+typedef enum {
+    WMI_CONNECT_CMDID           = 0x0001,
+    WMI_RECONNECT_CMDID,
+    WMI_DISCONNECT_CMDID,
+    WMI_SYNCHRONIZE_CMDID,
+    WMI_CREATE_PSTREAM_CMDID,
+    WMI_DELETE_PSTREAM_CMDID,
+    /* WMI_START_SCAN_CMDID is to be deprecated; WMI_BEGIN_SCAN is to
+     * be used instead. The new command supports P2P mgmt operations
+     * using station interface.
+     */
+    WMI_START_SCAN_CMDID,
+    WMI_SET_SCAN_PARAMS_CMDID,
+    WMI_SET_BSS_FILTER_CMDID,
+    WMI_SET_PROBED_SSID_CMDID,               /* 10 */
+    WMI_SET_LISTEN_INT_CMDID,
+    WMI_SET_BMISS_TIME_CMDID,
+    WMI_SET_DISC_TIMEOUT_CMDID,
+    WMI_GET_CHANNEL_LIST_CMDID,
+    WMI_SET_BEACON_INT_CMDID,
+    WMI_GET_STATISTICS_CMDID,
+    WMI_SET_CHANNEL_PARAMS_CMDID,
+    WMI_SET_POWER_MODE_CMDID,
+    WMI_SET_IBSS_PM_CAPS_CMDID,
+    WMI_SET_POWER_PARAMS_CMDID,              /* 20 */
+    WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
+    WMI_ADD_CIPHER_KEY_CMDID,
+    WMI_DELETE_CIPHER_KEY_CMDID,
+    WMI_ADD_KRK_CMDID,
+    WMI_DELETE_KRK_CMDID,
+    WMI_SET_PMKID_CMDID,
+    WMI_SET_TX_PWR_CMDID,
+    WMI_GET_TX_PWR_CMDID,
+    WMI_SET_ASSOC_INFO_CMDID,
+    WMI_ADD_BAD_AP_CMDID,                    /* 30 */
+    WMI_DELETE_BAD_AP_CMDID,
+    WMI_SET_TKIP_COUNTERMEASURES_CMDID,
+    WMI_RSSI_THRESHOLD_PARAMS_CMDID,
+    WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
+    WMI_SET_ACCESS_PARAMS_CMDID,
+    WMI_SET_RETRY_LIMITS_CMDID,
+    WMI_SET_OPT_MODE_CMDID,
+    WMI_OPT_TX_FRAME_CMDID,
+    WMI_SET_VOICE_PKT_SIZE_CMDID,
+    WMI_SET_MAX_SP_LEN_CMDID,                /* 40 */
+    WMI_SET_ROAM_CTRL_CMDID,
+    WMI_GET_ROAM_TBL_CMDID,
+    WMI_GET_ROAM_DATA_CMDID,
+    WMI_ENABLE_RM_CMDID,
+    WMI_SET_MAX_OFFHOME_DURATION_CMDID,
+    WMI_EXTENSION_CMDID,                        /* Non-wireless extensions */
+    WMI_SNR_THRESHOLD_PARAMS_CMDID,
+    WMI_LQ_THRESHOLD_PARAMS_CMDID,
+    WMI_SET_LPREAMBLE_CMDID,
+    WMI_SET_RTS_CMDID,                       /* 50 */
+    WMI_CLR_RSSI_SNR_CMDID,
+    WMI_SET_FIXRATES_CMDID,
+    WMI_GET_FIXRATES_CMDID,
+    WMI_SET_AUTH_MODE_CMDID,
+    WMI_SET_REASSOC_MODE_CMDID,
+    WMI_SET_WMM_CMDID,
+    WMI_SET_WMM_TXOP_CMDID,
+    WMI_TEST_CMDID,
+    /* COEX AR6002 only*/
+    WMI_SET_BT_STATUS_CMDID,
+    WMI_SET_BT_PARAMS_CMDID,                /* 60 */
+
+    WMI_SET_KEEPALIVE_CMDID,
+    WMI_GET_KEEPALIVE_CMDID,
+    WMI_SET_APPIE_CMDID,
+    WMI_GET_APPIE_CMDID,
+    WMI_SET_WSC_STATUS_CMDID,
+
+    /* Wake on Wireless */
+    WMI_SET_HOST_SLEEP_MODE_CMDID,
+    WMI_SET_WOW_MODE_CMDID,
+    WMI_GET_WOW_LIST_CMDID,
+    WMI_ADD_WOW_PATTERN_CMDID,
+    WMI_DEL_WOW_PATTERN_CMDID,               /* 70 */
+
+    WMI_SET_FRAMERATES_CMDID,
+    WMI_SET_AP_PS_CMDID,
+    WMI_SET_QOS_SUPP_CMDID,
+    /* WMI_THIN_RESERVED_... mark the start and end
+     * values for WMI_THIN_RESERVED command IDs. These
+     * command IDs can be found in wmi_thin.h */
+    WMI_THIN_RESERVED_START = 0x8000,
+    WMI_THIN_RESERVED_END = 0x8fff,
+    /*
+     * Developer commands starts at 0xF000
+     */
+    WMI_SET_BITRATE_CMDID = 0xF000,
+    WMI_GET_BITRATE_CMDID,
+    WMI_SET_WHALPARAM_CMDID,
+
+
+    /*Should add the new command to the tail for compatible with
+     * etna.
+     */
+    WMI_SET_MAC_ADDRESS_CMDID,
+    WMI_SET_AKMP_PARAMS_CMDID,
+    WMI_SET_PMKID_LIST_CMDID,
+    WMI_GET_PMKID_LIST_CMDID,
+    WMI_ABORT_SCAN_CMDID,
+    WMI_SET_TARGET_EVENT_REPORT_CMDID,
+
+    // Unused
+    WMI_UNUSED1,
+    WMI_UNUSED2,
+
+    /*
+     * AP mode commands
+     */
+    WMI_AP_HIDDEN_SSID_CMDID,   /* F00B */
+    WMI_AP_SET_NUM_STA_CMDID,
+    WMI_AP_ACL_POLICY_CMDID,
+    WMI_AP_ACL_MAC_LIST_CMDID,
+    WMI_AP_CONFIG_COMMIT_CMDID,
+    WMI_AP_SET_MLME_CMDID,    /* F010 */
+    WMI_AP_SET_PVB_CMDID,
+    WMI_AP_CONN_INACT_CMDID,
+    WMI_AP_PROT_SCAN_TIME_CMDID,
+    WMI_AP_SET_COUNTRY_CMDID,
+    WMI_AP_SET_DTIM_CMDID,
+    WMI_AP_MODE_STAT_CMDID,
+
+    WMI_SET_IP_CMDID,    /* F017 */
+    WMI_SET_PARAMS_CMDID,
+    WMI_SET_MCAST_FILTER_CMDID,
+    WMI_DEL_MCAST_FILTER_CMDID,
+
+    WMI_ALLOW_AGGR_CMDID,    /* F01B */
+    WMI_ADDBA_REQ_CMDID,
+    WMI_DELBA_REQ_CMDID,
+    WMI_SET_HT_CAP_CMDID,
+    WMI_SET_HT_OP_CMDID,
+    WMI_SET_TX_SELECT_RATES_CMDID,
+    WMI_SET_TX_SGI_PARAM_CMDID,
+    WMI_SET_RATE_POLICY_CMDID,
+
+    WMI_HCI_CMD_CMDID,    /* F023 */
+    WMI_RX_FRAME_FORMAT_CMDID,
+    WMI_SET_THIN_MODE_CMDID,
+    WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID,
+
+    WMI_AP_SET_11BG_RATESET_CMDID,     /* F027 */
+    WMI_SET_PMK_CMDID,
+    WMI_MCAST_FILTER_CMDID,
+    /* COEX CMDID AR6003*/
+    WMI_SET_BTCOEX_FE_ANT_CMDID, /* F02A */
+    WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
+    WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
+    WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
+    WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
+    WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
+    WMI_SET_BTCOEX_DEBUG_CMDID,
+    WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
+    WMI_GET_BTCOEX_STATS_CMDID,
+    WMI_GET_BTCOEX_CONFIG_CMDID,
+#if !defined(AR6002_REV61) || !defined(ATH_TARGET) /* WAR for EV 89272 */
+    WMI_DFS_RESERVED,                 /* F034 */
+#endif
+    WMI_SET_DFS_MINRSSITHRESH_CMDID,
+    WMI_SET_DFS_MAXPULSEDUR_CMDID,
+    WMI_DFS_RADAR_DETECTED_CMDID,
+
+    /* P2P CMDS */
+    WMI_P2P_SET_CONFIG_CMDID,    /* F037 */
+    WMI_WPS_SET_CONFIG_CMDID,
+    WMI_SET_REQ_DEV_ATTR_CMDID,
+    WMI_P2P_FIND_CMDID,
+    WMI_P2P_STOP_FIND_CMDID,
+    WMI_P2P_GO_NEG_START_CMDID,
+    WMI_P2P_LISTEN_CMDID,
+
+
+    WMI_CONFIG_TX_MAC_RULES_CMDID,    /* F044 */
+    WMI_SET_PROMISCUOUS_MODE_CMDID,
+    WMI_RX_FRAME_FILTER_CMDID,
+    WMI_SET_CHANNEL_CMDID,
+
+    /* WAC commands */
+    WMI_ENABLE_WAC_CMDID,
+    WMI_WAC_SCAN_REPLY_CMDID,
+    WMI_WAC_CTRL_REQ_CMDID,
+
+    WMI_SET_DIV_PARAMS_CMDID,
+    WMI_GET_PMK_CMDID,
+    WMI_SET_PASSPHRASE_CMDID,
+    WMI_SEND_ASSOC_RES_CMDID,
+    WMI_SET_ASSOC_REQ_RELAY_CMDID,
+
+    /* ACS command, consists of sub-commands */
+    WMI_ACS_CTRL_CMDID,
+    WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
+    WMI_SET_TBD_TIME_CMDID, /*added for wmiconfig command for TBD */
+
+    /* Pktlog cmds */
+    WMI_PKTLOG_ENABLE_CMDID,
+    WMI_PKTLOG_DISABLE_CMDID,
+
+    /* More P2P Cmds */
+    WMI_P2P_GO_NEG_REQ_RSP_CMDID,
+    WMI_P2P_GRP_INIT_CMDID,
+    WMI_P2P_GRP_FORMATION_DONE_CMDID,
+    WMI_P2P_INVITE_CMDID,
+    WMI_P2P_INVITE_REQ_RSP_CMDID,
+    WMI_P2P_PROV_DISC_REQ_CMDID,
+    WMI_P2P_SET_CMDID,
+
+    WMI_GET_RFKILL_MODE_CMDID,
+    WMI_SET_RFKILL_MODE_CMDID,
+    WMI_AP_SET_APSD_CMDID,
+    WMI_AP_APSD_BUFFERED_TRAFFIC_CMDID,
+
+    WMI_P2P_SDPD_TX_CMDID, /* F05C */
+    WMI_P2P_STOP_SDPD_CMDID,
+    WMI_P2P_CANCEL_CMDID,
+    /* Ultra low power store / recall commands */
+    WMI_STORERECALL_CONFIGURE_CMDID,
+    WMI_STORERECALL_RECALL_CMDID,
+    WMI_STORERECALL_HOST_READY_CMDID,
+    WMI_FORCE_TARGET_ASSERT_CMDID,
+    
+    WMI_SET_PROBED_SSID_EX_CMDID,
+    WMI_SET_NETWORK_LIST_OFFLOAD_CMDID,
+    WMI_SET_ARP_NS_OFFLOAD_CMDID,
+    WMI_ADD_WOW_EXT_PATTERN_CMDID,
+    WMI_GTK_OFFLOAD_OP_CMDID,
+  
+    WMI_REMAIN_ON_CHNL_CMDID,
+    WMI_CANCEL_REMAIN_ON_CHNL_CMDID,
+    /* WMI_SEND_ACTION_CMDID is to be deprecated; WMI_SEND_MGMT_CMDID 
+     * is to be used instead. The new command supports P2P mgmt
+     * operations using station interface
+     */
+    WMI_SEND_ACTION_CMDID,
+    WMI_PROBE_REQ_REPORT_CMDID,
+    WMI_DISABLE_11B_RATES_CMDID,
+    WMI_SEND_PROBE_RESPONSE_CMDID,
+    WMI_GET_P2P_INFO_CMDID,
+    WMI_AP_JOIN_BSS_CMDID,
+
+    WMI_SMPS_ENABLE_CMDID,
+    WMI_SMPS_CONFIG_CMDID,
+    WMI_SET_RATECTRL_PARM_CMDID,
+    /*  LPL specific commands*/
+    WMI_LPL_FORCE_ENABLE_CMDID,
+    WMI_LPL_SET_POLICY_CMDID,
+    WMI_LPL_GET_POLICY_CMDID,
+    WMI_LPL_GET_HWSTATE_CMDID,
+    WMI_LPL_SET_PARAMS_CMDID,
+    WMI_LPL_GET_PARAMS_CMDID,
+
+    WMI_SET_BUNDLE_PARAM_CMDID, 
+
+    /*GreenTx specific commands*/
+    
+    WMI_GREENTX_PARAMS_CMDID,
+
+    WMI_RTT_MEASREQ_CMDID,
+    WMI_RTT_CAPREQ_CMDID,
+    WMI_RTT_STATUSREQ_CMDID,
+
+    /* WPS Commands */
+    WMI_WPS_START_CMDID,
+    WMI_GET_WPS_STATUS_CMDID,
+
+    /* More P2P commands */
+    WMI_SET_NOA_CMDID,
+    WMI_GET_NOA_CMDID,
+    WMI_SET_OPPPS_CMDID,
+    WMI_GET_OPPPS_CMDID,
+    WMI_ADD_PORT_CMDID,
+    WMI_DEL_PORT_CMDID,
+
+    /* 802.11w cmd */
+    WMI_SET_RSN_CAP_CMDID,
+    WMI_GET_RSN_CAP_CMDID,
+    WMI_SET_IGTK_CMDID,
+
+    WMI_RX_FILTER_COALESCE_FILTER_OP_CMDID,
+    WMI_RX_FILTER_SET_FRAME_TEST_LIST_CMDID,
+
+    /* Commands added to support P2P mgmt operations on top of station
+     * interface. WMI_SEND_ACTION_CMDID and WMI_START_SCAN_CMDID to be
+     * deprecated.
+     */
+    WMI_SEND_MGMT_CMDID,
+    WMI_BEGIN_SCAN_CMDID,
+    /* End of commands added to support P2P mgmt operations on station
+     * interface
+     */
+     WMI_SET_BLACK_LIST,
+     WMI_SET_MCASTRATE_CMDID,
+
+     WMI_STA_BMISS_ENHANCE_CMDID,
+
+     WMI_SET_REGDOMAIN_CMDID,
+
+     WMI_SET_RSSI_FILTER_CMDID,
+     WMI_SET_KEEPALIVE_CMDID_EXT,
+
+    WMI_VOICE_DETECTION_ENABLE_CMDID,
+
+    WMI_SET_TXE_NOTIFY_CMDID,
+
+    WMI_SET_RECOVERY_TEST_PARAMETER_CMDID,
+
+    WMI_ENABLE_SCHED_SCAN,
+
+WMI_DISABLE_BCAST_IN_PM_CMDID = 0xf200,
+
+} WMI_COMMAND_ID;
+
+/*
+ * Frame Types
+ */
+typedef enum {
+    WMI_FRAME_BEACON        =   0,
+    WMI_FRAME_PROBE_REQ,
+    WMI_FRAME_PROBE_RESP,
+    WMI_FRAME_ASSOC_REQ,
+    WMI_FRAME_ASSOC_RESP,
+    WMI_NUM_MGMT_FRAME
+} WMI_MGMT_FRAME_TYPE;
+
+/*
+ * Connect Command
+ */
+typedef enum {
+    INFRA_NETWORK       = 0x01,
+    ADHOC_NETWORK       = 0x02,
+    ADHOC_CREATOR       = 0x04,
+    AP_NETWORK          = 0x10,
+    NETWORK_CONNECTED_USING_WPS = 0x20,
+} NETWORK_TYPE;
+
+typedef enum {
+    SUBTYPE_NONE,
+    SUBTYPE_BT,
+    SUBTYPE_P2PDEV,
+    SUBTYPE_P2PCLIENT,
+    SUBTYPE_P2PGO,
+} NETWORK_SUBTYPE;
+
+typedef enum {
+    OPEN_AUTH           = 0x01,
+    SHARED_AUTH         = 0x02,
+    LEAP_AUTH           = 0x04,  /* different from IEEE_AUTH_MODE definitions */
+} DOT11_AUTH_MODE;
+
+typedef enum {
+    WMI_NONE_AUTH           = 0x01,
+    WMI_WPA_AUTH            = 0x02,
+    WMI_WPA2_AUTH           = 0x04,
+    WMI_WPA_PSK_AUTH        = 0x08,
+    WMI_WPA2_PSK_AUTH       = 0x10,
+    WMI_WPA_AUTH_CCKM       = 0x20,
+    WMI_WPA2_AUTH_CCKM      = 0x40,
+} AUTH_MODE;
+
+typedef enum {
+    NONE_CRYPT          = 0x01,
+    WEP_CRYPT           = 0x02,
+    TKIP_CRYPT          = 0x04,
+    AES_CRYPT           = 0x08,
+#ifdef WAPI_ENABLE
+    WAPI_CRYPT          = 0x10,
+#endif /*WAPI_ENABLE*/
+} CRYPTO_TYPE;
+
+#define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
+#define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
+
+#ifdef WAPI_ENABLE
+#undef WMI_MAX_CRYPTO_TYPE
+#define WMI_MAX_CRYPTO_TYPE (WAPI_CRYPT + 1)
+#endif /* WAPI_ENABLE */
+
+#ifdef WAPI_ENABLE
+#define IW_ENCODE_ALG_SM4       0x20
+/*
+ * Defined this to be some very high bit because it is less likely to be
+ * clobbered by future changes to the kernel's wireless.h file
+*/
+#define IW_AUTH_CIPHER_SMS4     0x40000000
+#endif
+
+#define WMI_MIN_KEY_INDEX   0
+#define WMI_MAX_KEY_INDEX   3
+
+#ifdef IEEE80211W
+#undef WMI_MAX_KEY_INDEX
+#define WMI_MAX_KEY_INDEX   5
+#endif
+
+#ifdef WAPI_ENABLE
+#undef WMI_MAX_KEY_INDEX
+#define WMI_MAX_KEY_INDEX   7 /* wapi grpKey 0-3, prwKey 4-7 */
+#endif /* WAPI_ENABLE */
+
+#define WMI_MAX_KEY_LEN     32
+
+#define WMI_MAX_SSID_LEN    32
+
+typedef enum {
+    CONNECT_ASSOC_POLICY_USER           = 0x0001,
+    CONNECT_SEND_REASSOC                = 0x0002,
+    CONNECT_IGNORE_WPAx_GROUP_CIPHER    = 0x0004,
+    CONNECT_PROFILE_MATCH_DONE          = 0x0008,
+    CONNECT_IGNORE_AAC_BEACON           = 0x0010,
+    CONNECT_CSA_FOLLOW_BSS              = 0x0020,
+    CONNECT_DO_WPA_OFFLOAD              = 0x0040,
+    CONNECT_DO_NOT_DEAUTH               = 0x0080,
+    CONNECT_WPS_FLAG                    = 0x0100,
+    /* AP configuration flags */
+    AP_NO_DISASSOC_UPON_DEAUTH          = 0x10000,
+    AP_HOSTPAL_SUPPORT                  = 0x20000
+} WMI_CONNECT_CTRL_FLAGS_BITS;
+
+#define DEFAULT_CONNECT_CTRL_FLAGS    (CONNECT_CSA_FOLLOW_BSS)
+
+typedef PREPACK struct {
+    A_UINT8     networkType;
+    A_UINT8     dot11AuthMode;
+    A_UINT8     authMode;
+    A_UINT8     pairwiseCryptoType;
+    A_UINT8     pairwiseCryptoLen;
+    A_UINT8     groupCryptoType;
+    A_UINT8     groupCryptoLen;
+    A_UINT8     ssidLength;
+    A_UCHAR     ssid[WMI_MAX_SSID_LEN];
+    A_UINT16    channel;
+    A_UINT8     bssid[ATH_MAC_LEN];
+    A_UINT32    ctrl_flags;
+    A_UINT8     networkSubtype;
+} POSTPACK WMI_CONNECT_CMD;
+
+
+typedef PREPACK struct {
+    A_UINT32 divIdleTime;
+    A_UINT8   antRssiThresh;
+    A_UINT8   divEnable;
+    A_UINT16 active_treshold_rate;
+} POSTPACK WMI_DIV_PARAMS_CMD;
+
+/*
+ * WMI_RECONNECT_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT16    channel;                    /* hint */
+    A_UINT8     bssid[ATH_MAC_LEN];         /* mandatory if set */
+} POSTPACK WMI_RECONNECT_CMD;
+
+/*
+ * WMI_SET_PMK_CMDID
+ */
+#define WMI_PMK_LEN     32
+typedef PREPACK struct {
+    A_UINT8 pmk[WMI_PMK_LEN];
+    A_UINT8 pmk_len;
+} POSTPACK WMI_SET_PMK_CMD, WMI_GET_PMK_REPLY;
+
+/*
+ * WMI_SET_PASSPHRASE_CMDID
+ */
+#define WMI_PASSPHRASE_LEN    64
+typedef PREPACK struct {
+    A_UCHAR ssid[WMI_MAX_SSID_LEN];
+    A_UINT8 passphrase[WMI_PASSPHRASE_LEN];
+    A_UINT8 ssid_len;
+    A_UINT8 passphrase_len;
+} POSTPACK WMI_SET_PASSPHRASE_CMD;
+
+/*
+ * WMI_SET_EXCESS_TX_RETRY_THRES_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT32 threshold;
+} POSTPACK WMI_SET_EXCESS_TX_RETRY_THRES_CMD;
+
+/*
+ * WMI_SET_MCASTRATE_CMD
+ */
+typedef PREPACK struct {
+    A_UINT16 bitrate; /* in units of 100 Kbps */
+    		      /* Valid values are 10, 20, 55, 110, 60, 90, 120, 180,
+		       * 240, 360, 480, 540 */
+} POSTPACK WMI_SET_MCASTRATE_CMD;
+
+
+/*
+ * WMI_ADD_CIPHER_KEY_CMDID
+ */
+typedef enum {
+    PAIRWISE_USAGE      = 0x00,
+    GROUP_USAGE         = 0x01,
+    TX_USAGE            = 0x02,     /* default Tx Key - Static WEP only */
+} KEY_USAGE;
+
+/*
+ * Bit Flag
+ * Bit 0 - Initialise TSC - default is Initialize
+ */
+#define KEY_OP_INIT_TSC       0x01
+#define KEY_OP_INIT_RSC       0x02
+#ifdef WAPI_ENABLE
+#define KEY_OP_INIT_WAPIPN    0x10
+#endif /* WAPI_ENABLE */
+
+#define KEY_OP_INIT_VAL     0x03     /* Default Initialise the TSC & RSC */
+#define KEY_OP_VALID_MASK   0x03
+
+typedef PREPACK struct {
+    A_UINT8     keyIndex;
+    A_UINT8     keyType;
+    A_UINT8     keyUsage;           /* KEY_USAGE */
+    A_UINT8     keyLength;
+    A_UINT8     keyRSC[8];          /* key replay sequence counter */
+    A_UINT8     key[WMI_MAX_KEY_LEN];
+    A_UINT8     key_op_ctrl;       /* Additional Key Control information */
+    A_UINT8    key_macaddr[ATH_MAC_LEN];
+} POSTPACK WMI_ADD_CIPHER_KEY_CMD;
+
+/*
+ * WMI_DELETE_CIPHER_KEY_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     keyIndex;
+} POSTPACK WMI_DELETE_CIPHER_KEY_CMD;
+
+
+/*
+ *for Linux, it need KRK, length is 16
+ *for Win7, it need CCKM ie, length is 26
+ */
+#define WMI_KRK_LEN     16
+#define WMI_CCKM_IE_LEN 26
+/*
+ * WMI_ADD_KRK_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     krk[WMI_CCKM_IE_LEN];
+} POSTPACK WMI_ADD_KRK_CMD;
+
+/*
+ * WMI_SET_TKIP_COUNTERMEASURES_CMDID
+ */
+typedef enum {
+    WMI_TKIP_CM_DISABLE = 0x0,
+    WMI_TKIP_CM_ENABLE  = 0x1,
+} WMI_TKIP_CM_CONTROL;
+
+typedef PREPACK struct {
+    A_UINT8  cm_en;                     /* WMI_TKIP_CM_CONTROL */
+} POSTPACK WMI_SET_TKIP_COUNTERMEASURES_CMD;
+
+/*
+ * WMI_SET_PMKID_CMDID
+ */
+
+#define WMI_PMKID_LEN 16
+
+typedef enum {
+   PMKID_DISABLE = 0,
+   PMKID_ENABLE  = 1,
+} PMKID_ENABLE_FLG;
+
+typedef PREPACK struct {
+    A_UINT8     bssid[ATH_MAC_LEN];
+    A_UINT8     enable;                 /* PMKID_ENABLE_FLG */
+    A_UINT8     pmkid[WMI_PMKID_LEN];
+} POSTPACK WMI_SET_PMKID_CMD;
+
+/*
+ * WMI_START_SCAN_CMD
+ */
+typedef enum {
+    WMI_LONG_SCAN  = 0,
+    WMI_SHORT_SCAN = 1,
+} WMI_SCAN_TYPE;
+
+typedef PREPACK struct {
+    A_UINT8 nrates;
+    A_UINT8 rates[WMI_RATE_MAXSIZE];
+} POSTPACK WMI_SUPPORTED_RATES;
+
+typedef PREPACK struct {
+    A_BOOL   forceFgScan;
+    A_BOOL   isLegacy;        /* For Legacy Cisco AP compatibility */
+    A_UINT32 homeDwellTime;   /* Maximum duration in the home channel(milliseconds) */
+    A_UINT32 forceScanInterval;    /* Time interval between scans (milliseconds)*/
+    A_BOOL  no_cck;             /* Flag to force no CCK rates to be used for 
+                                   probe request frames */
+    A_UINT8  scanType;           /* WMI_SCAN_TYPE */
+    WMI_SUPPORTED_RATES supp_rates[A_NUM_BANDS]; /* Supported rates to 
+                                                    advertise in probe request 
+                                                    frames */
+    A_UINT8  numChannels;            /* how many channels follow */
+    A_UINT16 channelList[1];         /* channels in Mhz */
+} POSTPACK WMI_BEGIN_SCAN_CMD;
+
+/* WMI_START_SCAN_CMD is to be deprecated; WMI_BEGIN_SCAN_CMD is 
+ * to be used instead. The new command supports P2P mgmt operations using
+ * station interface
+ */
+typedef PREPACK struct {
+    A_BOOL   forceFgScan;
+    A_BOOL   isLegacy;        /* For Legacy Cisco AP compatibility */
+    A_UINT32 homeDwellTime;   /* Maximum duration in the home channel(milliseconds) */
+    A_UINT32 forceScanInterval;    /* Time interval between scans (milliseconds)*/
+    A_UINT8  scanType;           /* WMI_SCAN_TYPE */
+    A_UINT8  numChannels;            /* how many channels follow */
+    A_UINT16 channelList[1];         /* channels in Mhz */
+} POSTPACK WMI_START_SCAN_CMD;
+
+
+/*
+ * WMI_SET_SCAN_PARAMS_CMDID
+ */
+#define WMI_SHORTSCANRATIO_DEFAULT      3
+/*
+ *  Warning: ScanCtrlFlag value of 0xFF is used to disable all flags in WMI_SCAN_PARAMS_CMD
+ *  Do not add any more flags to WMI_SCAN_CTRL_FLAG_BITS
+ */
+typedef enum {
+    CONNECT_SCAN_CTRL_FLAGS = 0x01,    /* set if can scan in the Connect cmd */
+    SCAN_CONNECTED_CTRL_FLAGS = 0x02,  /* set if scan for the SSID it is */
+                                       /* already connected to */
+    ACTIVE_SCAN_CTRL_FLAGS = 0x04,     /* set if enable active scan */
+    ROAM_SCAN_CTRL_FLAGS = 0x08,       /* set if enable roam scan when bmiss and lowrssi */
+    REPORT_BSSINFO_CTRL_FLAGS = 0x10,   /* set if follows customer BSSINFO reporting rule */
+    ENABLE_AUTO_CTRL_FLAGS = 0x20,      /* if disabled, target doesn't
+                                          scan after a disconnect event  */
+    ENABLE_SCAN_ABORT_EVENT = 0x40      /* Scan complete event with canceled status will be generated when a scan is prempted before it gets completed */
+} WMI_SCAN_CTRL_FLAGS_BITS;
+
+#define CAN_SCAN_IN_CONNECT(flags)      (flags & CONNECT_SCAN_CTRL_FLAGS)
+#define CAN_SCAN_CONNECTED(flags)       (flags & SCAN_CONNECTED_CTRL_FLAGS)
+#define ENABLE_ACTIVE_SCAN(flags)       (flags & ACTIVE_SCAN_CTRL_FLAGS)
+#define ENABLE_ROAM_SCAN(flags)         (flags & ROAM_SCAN_CTRL_FLAGS)
+#define CONFIG_REPORT_BSSINFO(flags)     (flags & REPORT_BSSINFO_CTRL_FLAGS)
+#define IS_AUTO_SCAN_ENABLED(flags)      (flags & ENABLE_AUTO_CTRL_FLAGS)
+#define SCAN_ABORT_EVENT_ENABLED(flags) (flags & ENABLE_SCAN_ABORT_EVENT)
+
+#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)
+
+
+typedef PREPACK struct {
+    A_UINT16    fg_start_period;        /* seconds */
+    A_UINT16    fg_end_period;          /* seconds */
+    A_UINT16    bg_period;              /* seconds */
+    A_UINT16    maxact_chdwell_time;    /* msec */
+    A_UINT16    pas_chdwell_time;       /* msec */
+    A_UINT8     shortScanRatio;         /* how many shorts scan for one long */
+    A_UINT8     scanCtrlFlags;
+    A_UINT16    minact_chdwell_time;    /* msec */
+    A_UINT16    maxact_scan_per_ssid;   /* max active scans per ssid */
+    A_UINT32    max_dfsch_act_time;  /* msecs */
+} POSTPACK WMI_SCAN_PARAMS_CMD;
+
+typedef PREPACK struct {
+    A_UINT16   chan_index;
+    A_INT8    bang_radar;
+} POSTPACK WMI_RADAR_DETECTED_CMD;
+
+/*
+ * WMI_SET_BSS_FILTER_CMDID
+ */
+typedef enum {
+    NONE_BSS_FILTER = 0x0,              /* no beacons forwarded */
+    ALL_BSS_FILTER,                     /* all beacons forwarded */
+    PROFILE_FILTER,                     /* only beacons matching profile */
+    ALL_BUT_PROFILE_FILTER,             /* all but beacons matching profile */
+    CURRENT_BSS_FILTER,                 /* only beacons matching current BSS */
+    ALL_BUT_BSS_FILTER,                 /* all but beacons matching BSS */
+    PROBED_SSID_FILTER,                 /* beacons matching probed ssid */
+    LAST_BSS_FILTER,                    /* marker only */
+} WMI_BSS_FILTER;
+
+typedef PREPACK struct {
+    A_UINT8    bssFilter;                      /* see WMI_BSS_FILTER */
+    A_UINT8    reserved1;                      /* For alignment */
+    A_UINT16   reserved2;                      /* For alignment */
+    A_UINT32   ieMask;
+} POSTPACK WMI_BSS_FILTER_CMD;
+
+/*
+ * WMI_SET_PROBED_SSID_CMDID
+ */
+#define MAX_PROBED_SSID_INDEX   15
+
+typedef enum {
+    DISABLE_SSID_FLAG  = 0,                  /* disables entry */
+    SPECIFIC_SSID_FLAG = 0x01,               /* probes specified ssid */
+    ANY_SSID_FLAG      = 0x02,               /* probes for any ssid */
+    PASSIVE_LISTEN_SSID_FLAG = 0x04,               /* Just Listen on the Channel without Probing for any SSIDs But we wanted to use the Probed SSID List*/ 							   /* for Profile Matching */
+} WMI_SSID_FLAG;
+
+typedef PREPACK struct {
+    A_UINT8     entryIndex;                     /* 0 to MAX_PROBED_SSID_INDEX */
+    A_UINT8     flag;                           /* WMI_SSID_FLG */
+    A_UINT8     ssidLength;
+    A_UINT8     ssid[32];
+    A_UINT8     authentication;
+    A_UINT8     encryption;
+    A_UINT8     channelHint;
+    A_BOOL      bmatchcompleteprofile;         /* If this Flag is True, we do a complete profile match of SSID, AUTH, Encryption */
+} POSTPACK WMI_PROBED_SSID_CMD;
+
+/*
+ * WMI_SET_LISTEN_INT_CMDID
+ * The Listen interval is between 15 and 3000 TUs
+ */
+#define MIN_LISTEN_INTERVAL 15
+#define MAX_LISTEN_INTERVAL 5000
+#define MIN_LISTEN_BEACONS 1
+#define MAX_LISTEN_BEACONS 50
+
+typedef PREPACK struct {
+    A_UINT16     listenInterval;
+    A_UINT16     numBeacons;
+} POSTPACK WMI_LISTEN_INT_CMD;
+
+/*
+ * WMI_SET_BEACON_INT_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT16     beaconInterval;
+} POSTPACK WMI_BEACON_INT_CMD;
+
+/*
+ * WMI_SET_BMISS_TIME_CMDID
+ * valid values are between 1000 and 5000 TUs
+ */
+
+#define MIN_BMISS_TIME     1000
+#define MAX_BMISS_TIME     5000
+#define MIN_BMISS_BEACONS  1
+#define MAX_BMISS_BEACONS  50
+
+typedef PREPACK struct {
+    A_UINT16     bmissTime;
+    A_UINT16     numBeacons;
+} POSTPACK WMI_BMISS_TIME_CMD;
+
+/*
+ * WMI_SET_POWER_MODE_CMDID
+ */
+typedef enum {
+    REC_POWER = 0x01,
+    MAX_PERF_POWER,
+} WMI_POWER_MODE;
+
+typedef PREPACK struct {
+    A_UINT8     powerMode;      /* WMI_POWER_MODE */
+} POSTPACK WMI_POWER_MODE_CMD;
+
+typedef PREPACK struct {
+    A_INT8 status;      /* WMI_SET_PARAMS_REPLY */
+} POSTPACK WMI_SET_PARAMS_REPLY;
+
+typedef PREPACK struct {
+    A_UINT32 opcode;
+    A_UINT32 length;
+    A_CHAR buffer[1];      /* WMI_SET_PARAMS */
+} POSTPACK WMI_SET_PARAMS_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 multicast_mac[ATH_MAC_LEN];      /* WMI_SET_MCAST_FILTER */
+} POSTPACK WMI_SET_MCAST_FILTER_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 enable;      /* WMI_MCAST_FILTER */
+} POSTPACK WMI_MCAST_FILTER_CMD;
+
+/*
+ * WMI_SET_POWER_PARAMS_CMDID
+ */
+typedef enum {
+    IGNORE_DTIM = 0x01,
+    NORMAL_DTIM = 0x02,
+    STICK_DTIM  = 0x03,
+    AUTO_DTIM   = 0x04,
+} WMI_DTIM_POLICY;
+
+/* Policy to determnine whether TX should wakeup WLAN if sleeping */
+typedef enum {
+    TX_WAKEUP_UPON_SLEEP = 1,
+    TX_DONT_WAKEUP_UPON_SLEEP = 2
+} WMI_TX_WAKEUP_POLICY_UPON_SLEEP;
+
+/*
+ * Policy to determnine whether power save failure event should be sent to
+ * host during scanning
+ */
+typedef enum {
+    SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
+    IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN = 2,
+} POWER_SAVE_FAIL_EVENT_POLICY;
+
+typedef PREPACK struct {
+    A_UINT16    idle_period;             /* msec */
+    A_UINT16    pspoll_number;
+    A_UINT16    dtim_policy;
+    A_UINT16    tx_wakeup_policy;
+    A_UINT16    num_tx_to_wakeup;
+    A_UINT16    ps_fail_event_policy;
+} POSTPACK WMI_POWER_PARAMS_CMD;
+
+/* Adhoc power save types */
+typedef enum {
+    ADHOC_PS_DISABLE=1,
+    ADHOC_PS_ATH=2,
+    ADHOC_PS_IEEE=3,
+    ADHOC_PS_OTHER=4,
+} WMI_ADHOC_PS_TYPE;
+
+typedef PREPACK struct {
+    A_UINT8    power_saving;
+    A_UINT8    ttl; /* number of beacon periods */
+    A_UINT16   atim_windows;          /* msec */
+    A_UINT16   timeout_value;         /* msec */
+} POSTPACK WMI_IBSS_PM_CAPS_CMD;
+
+/* AP power save types */
+typedef enum {
+    AP_PS_DISABLE=1,
+    AP_PS_ATH=2,
+} WMI_AP_PS_TYPE;
+
+typedef PREPACK struct {
+    A_UINT32   idle_time;   /* in msec */
+    A_UINT32   ps_period;   /* in usec */
+    A_UINT8    sleep_period; /* in ps periods */
+    A_UINT8    psType;
+} POSTPACK WMI_AP_PS_CMD;
+
+/*
+ * WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID
+ */
+typedef enum {
+    IGNORE_TIM_ALL_QUEUES_APSD = 0,
+    PROCESS_TIM_ALL_QUEUES_APSD = 1,
+    IGNORE_TIM_SIMULATED_APSD = 2,
+    PROCESS_TIM_SIMULATED_APSD = 3,
+} APSD_TIM_POLICY;
+
+typedef PREPACK struct {
+    A_UINT16    psPollTimeout;          /* msec */
+    A_UINT16    triggerTimeout;         /* msec */
+    A_UINT32    apsdTimPolicy;      /* TIM behavior with  ques APSD enabled. Default is IGNORE_TIM_ALL_QUEUES_APSD */
+    A_UINT32    simulatedAPSDTimPolicy;      /* TIM behavior with  simulated APSD enabled. Default is PROCESS_TIM_SIMULATED_APSD */
+} POSTPACK WMI_POWERSAVE_TIMERS_POLICY_CMD;
+
+/*
+ * WMI_SET_VOICE_PKT_SIZE_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT16    voicePktSize;
+} POSTPACK WMI_SET_VOICE_PKT_SIZE_CMD;
+
+/*
+ * WMI_SET_MAX_SP_LEN_CMDID
+ */
+typedef enum {
+    DELIVER_ALL_PKT = 0x0,
+    DELIVER_2_PKT = 0x1,
+    DELIVER_4_PKT = 0x2,
+    DELIVER_6_PKT = 0x3,
+} APSD_SP_LEN_TYPE;
+
+typedef PREPACK struct {
+    A_UINT8    maxSPLen;
+} POSTPACK WMI_SET_MAX_SP_LEN_CMD;
+
+/*
+ * WMI_SET_DISC_TIMEOUT_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     disconnectTimeout;          /* seconds */
+} POSTPACK WMI_DISC_TIMEOUT_CMD;
+
+typedef enum {
+    UPLINK_TRAFFIC = 0,
+    DNLINK_TRAFFIC = 1,
+    BIDIR_TRAFFIC = 2,
+} DIR_TYPE;
+
+typedef enum {
+    DISABLE_FOR_THIS_AC = 0,
+    ENABLE_FOR_THIS_AC  = 1,
+    ENABLE_FOR_ALL_AC   = 2,
+} VOICEPS_CAP_TYPE;
+
+typedef enum {
+    TRAFFIC_TYPE_APERIODIC = 0,
+    TRAFFIC_TYPE_PERIODIC = 1,
+}TRAFFIC_TYPE;
+
+/*
+ * WMI_SYNCHRONIZE_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8 dataSyncMap;
+} POSTPACK WMI_SYNC_CMD;
+
+/*
+ * WMI_CREATE_PSTREAM_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT32        minServiceInt;           /* in milli-sec */
+    A_UINT32        maxServiceInt;           /* in milli-sec */
+    A_UINT32        inactivityInt;           /* in milli-sec */
+    A_UINT32        suspensionInt;           /* in milli-sec */
+    A_UINT32        serviceStartTime;
+    A_UINT32        minDataRate;             /* in bps */
+    A_UINT32        meanDataRate;            /* in bps */
+    A_UINT32        peakDataRate;            /* in bps */
+    A_UINT32        maxBurstSize;
+    A_UINT32        delayBound;
+    A_UINT32        minPhyRate;              /* in bps */
+    A_UINT32        sba;
+    A_UINT32        mediumTime;
+    A_UINT16        nominalMSDU;             /* in octects */
+    A_UINT16        maxMSDU;                 /* in octects */
+    A_UINT8         trafficClass;
+    A_UINT8         trafficDirection;        /* DIR_TYPE */
+    A_UINT8         rxQueueNum;
+    A_UINT8         trafficType;             /* TRAFFIC_TYPE */
+    A_UINT8         voicePSCapability;       /* VOICEPS_CAP_TYPE */
+    A_UINT8         tsid;
+    A_UINT8         userPriority;            /* 802.1D user priority */
+    A_UINT8         nominalPHY;              /* nominal phy rate */
+} POSTPACK WMI_CREATE_PSTREAM_CMD;
+
+/*
+ * WMI_DELETE_PSTREAM_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     txQueueNumber;
+    A_UINT8     rxQueueNumber;
+    A_UINT8     trafficDirection;
+    A_UINT8     trafficClass;
+    A_UINT8     tsid;
+} POSTPACK WMI_DELETE_PSTREAM_CMD;
+
+/*
+ * WMI_SET_CHANNEL_PARAMS_CMDID
+ */
+typedef enum {
+    WMI_11A_MODE  = 0x1,
+    WMI_11G_MODE  = 0x2,
+    WMI_11AG_MODE = 0x3,
+    WMI_11B_MODE  = 0x4,
+    WMI_11GONLY_MODE = 0x5,
+} WMI_PHY_MODE;
+
+#define WMI_MAX_CHANNELS        32
+
+typedef PREPACK struct {
+    A_UINT8     reserved1;
+    A_UINT8     scanParam;              /* set if enable scan */
+    A_UINT8     phyMode;                /* see WMI_PHY_MODE */
+    A_UINT8     numChannels;            /* how many channels follow */
+    A_UINT16    channelList[1];         /* channels in Mhz */
+} POSTPACK WMI_CHANNEL_PARAMS_CMD;
+
+
+/*
+ *  WMI_RSSI_THRESHOLD_PARAMS_CMDID
+ *  Setting the polltime to 0 would disable polling.
+ *  Threshold values are in the ascending order, and should agree to:
+ *  (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
+ *      < highThreshold_upperVal)
+ */
+
+typedef PREPACK struct WMI_RSSI_THRESHOLD_PARAMS{
+    A_UINT32    pollTime;               /* Polling time as a factor of LI */
+    A_INT16     thresholdAbove1_Val;          /* lowest of upper */
+    A_INT16     thresholdAbove2_Val;
+    A_INT16     thresholdAbove3_Val;
+    A_INT16     thresholdAbove4_Val;
+    A_INT16     thresholdAbove5_Val;
+    A_INT16     thresholdAbove6_Val;          /* highest of upper */
+    A_INT16     thresholdBelow1_Val;         /* lowest of bellow */
+    A_INT16     thresholdBelow2_Val;
+    A_INT16     thresholdBelow3_Val;
+    A_INT16     thresholdBelow4_Val;
+    A_INT16     thresholdBelow5_Val;
+    A_INT16     thresholdBelow6_Val;         /* highest of bellow */
+    A_UINT8     weight;                  /* "alpha" */
+    A_UINT8     reserved[3];
+} POSTPACK  WMI_RSSI_THRESHOLD_PARAMS_CMD;
+
+/*
+ *  WMI_SNR_THRESHOLD_PARAMS_CMDID
+ *  Setting the polltime to 0 would disable polling.
+ */
+
+typedef PREPACK struct WMI_SNR_THRESHOLD_PARAMS{
+    A_UINT32    pollTime;               /* Polling time as a factor of LI */
+    A_UINT8     weight;                  /* "alpha" */
+    A_UINT8     thresholdAbove1_Val;      /* lowest of uppper*/
+    A_UINT8     thresholdAbove2_Val;
+    A_UINT8     thresholdAbove3_Val;
+    A_UINT8     thresholdAbove4_Val;      /* highest of upper */
+    A_UINT8     thresholdBelow1_Val;     /* lowest of bellow */
+    A_UINT8     thresholdBelow2_Val;
+    A_UINT8     thresholdBelow3_Val;
+    A_UINT8     thresholdBelow4_Val;     /* highest of bellow */
+    A_UINT8     reserved[3];
+} POSTPACK WMI_SNR_THRESHOLD_PARAMS_CMD;
+
+/*
+ *  WMI_LQ_THRESHOLD_PARAMS_CMDID
+ */
+typedef PREPACK struct WMI_LQ_THRESHOLD_PARAMS {
+    A_UINT8     enable;
+    A_UINT8     thresholdAbove1_Val;
+    A_UINT8     thresholdAbove2_Val;
+    A_UINT8     thresholdAbove3_Val;
+    A_UINT8     thresholdAbove4_Val;
+    A_UINT8     thresholdBelow1_Val;
+    A_UINT8     thresholdBelow2_Val;
+    A_UINT8     thresholdBelow3_Val;
+    A_UINT8     thresholdBelow4_Val;
+    A_UINT8     reserved[3];
+} POSTPACK  WMI_LQ_THRESHOLD_PARAMS_CMD;
+
+typedef enum {
+    WMI_LPREAMBLE_DISABLED = 0,
+    WMI_LPREAMBLE_ENABLED
+} WMI_LPREAMBLE_STATUS;
+
+typedef enum {
+    WMI_IGNORE_BARKER_IN_ERP = 0,
+    WMI_DONOT_IGNORE_BARKER_IN_ERP
+} WMI_PREAMBLE_POLICY;
+
+typedef PREPACK struct {
+    A_UINT8     status;
+    A_UINT8     preamblePolicy;
+}POSTPACK WMI_SET_LPREAMBLE_CMD;
+
+typedef PREPACK struct {
+    A_UINT16    threshold;
+}POSTPACK WMI_SET_RTS_CMD;
+
+/*
+ *  WMI_TARGET_ERROR_REPORT_BITMASK_CMDID
+ *  Sets the error reporting event bitmask in target. Target clears it
+ *  upon an error. Subsequent errors are counted, but not reported
+ *  via event, unless the bitmask is set again.
+ */
+typedef PREPACK struct {
+    A_UINT32    bitmask;
+} POSTPACK  WMI_TARGET_ERROR_REPORT_BITMASK;
+
+/*
+ * WMI_SET_TX_PWR_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     dbM;                  /* in dbM units */
+} POSTPACK WMI_SET_TX_PWR_CMD, WMI_TX_PWR_REPLY;
+
+/*
+ * WMI_SET_ASSOC_INFO_CMDID
+ *
+ * A maximum of 2 private IEs can be sent in the [Re]Assoc request.
+ * A 3rd one, the CCX version IE can also be set from the host.
+ */
+
+/*
+ * Bit 7: 1 CCX cckm ie upload to host, 0 default, don't upload
+ * Bit 6: 1 ccx radio measurement upload to host, 0 default, don't upload
+ * Bit 3~5: reserved
+ * Bit 0~2: ccx version
+ */
+
+#define WMI_CCX_VERSION_MASK            0x7
+#define WMI_CCX_CCKMIE_UPLOAD_MASK      (0x1 << 7)
+#define WMI_CCX_RM_UPLOAD_MASK   (0x1 << 6)
+
+#define WMI_MAX_ASSOC_INFO_TYPE    2
+#define WMI_CCX_VER_IE             2 /* ieType to set CCX Version IE */
+
+#define WMI_MAX_ASSOC_INFO_LEN     240
+
+typedef PREPACK struct {
+    A_UINT8     ieType;
+    A_UINT8     bufferSize;
+    A_UINT8     assocInfo[1];       /* up to WMI_MAX_ASSOC_INFO_LEN */
+} POSTPACK WMI_SET_ASSOC_INFO_CMD;
+
+
+/*
+ * WMI_GET_TX_PWR_CMDID does not take any parameters
+ */
+
+/*
+ * WMI_ADD_BAD_AP_CMDID
+ */
+#define WMI_MAX_BAD_AP_INDEX      1
+
+typedef PREPACK struct {
+    A_UINT8     badApIndex;         /* 0 to WMI_MAX_BAD_AP_INDEX */
+    A_UINT8     bssid[ATH_MAC_LEN];
+} POSTPACK WMI_ADD_BAD_AP_CMD;
+
+/*
+ * WMI_DELETE_BAD_AP_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     badApIndex;         /* 0 to WMI_MAX_BAD_AP_INDEX */
+} POSTPACK WMI_DELETE_BAD_AP_CMD;
+
+/*
+ * WMI_SET_ACCESS_PARAMS_CMDID
+ */
+#define WMI_DEFAULT_TXOP_ACPARAM    0       /* implies one MSDU */
+#define WMI_DEFAULT_ECWMIN_ACPARAM  4       /* corresponds to CWmin of 15 */
+#define WMI_DEFAULT_ECWMAX_ACPARAM  10      /* corresponds to CWmax of 1023 */
+#define WMI_MAX_CW_ACPARAM          15      /* maximum eCWmin or eCWmax */
+#define WMI_DEFAULT_AIFSN_ACPARAM   2
+#define WMI_MAX_AIFSN_ACPARAM       15
+typedef PREPACK struct {
+    A_UINT16 txop;                      /* in units of 32 usec */
+    A_UINT8  eCWmin;
+    A_UINT8  eCWmax;
+    A_UINT8  aifsn;
+    A_UINT8  ac;
+} POSTPACK WMI_SET_ACCESS_PARAMS_CMD;
+
+
+/*
+ * WMI_SET_RETRY_LIMITS_CMDID
+ *
+ * This command is used to customize the number of retries the
+ * wlan device will perform on a given frame.
+ */
+#define WMI_MIN_RETRIES 2
+#define WMI_MAX_RETRIES 13
+typedef enum {
+    MGMT_FRAMETYPE    = 0,
+    CONTROL_FRAMETYPE = 1,
+    DATA_FRAMETYPE    = 2
+} WMI_FRAMETYPE;
+
+typedef PREPACK struct {
+    A_UINT8 frameType;                      /* WMI_FRAMETYPE */
+    A_UINT8 trafficClass;                   /* applies only to DATA_FRAMETYPE */
+    A_UINT8 maxRetries;
+    A_UINT8 enableNotify;
+} POSTPACK WMI_SET_RETRY_LIMITS_CMD;
+
+/*
+ * WMI_SET_ROAM_CTRL_CMDID
+ *
+ * This command is used to influence the Roaming behaviour
+ * Set the host biases of the BSSs before setting the roam mode as bias
+ * based.
+ */
+
+/*
+ * Different types of Roam Control
+ */
+
+typedef enum {
+        WMI_FORCE_ROAM          = 1,      /* Roam to the specified BSSID */
+        WMI_SET_ROAM_MODE       = 2,      /* default ,progd bias, no roam */
+        WMI_SET_HOST_BIAS       = 3,     /* Set the Host Bias */
+        WMI_SET_LOWRSSI_SCAN_PARAMS = 4, /* Set lowrssi Scan parameters */
+} WMI_ROAM_CTRL_TYPE;
+
+#define WMI_MIN_ROAM_CTRL_TYPE WMI_FORCE_ROAM
+#define WMI_MAX_ROAM_CTRL_TYPE WMI_SET_LOWRSSI_SCAN_PARAMS
+
+/*
+ * ROAM MODES
+ */
+
+typedef enum {
+        WMI_DEFAULT_ROAM_MODE   = 1,  /* RSSI based ROAM */
+        WMI_HOST_BIAS_ROAM_MODE = 2, /* HOST BIAS based ROAM */
+        WMI_LOCK_BSS_MODE  = 3  /* Lock to the Current BSS - no Roam */
+} WMI_ROAM_MODE;
+
+/*
+ * BSS HOST BIAS INFO
+ */
+
+typedef PREPACK struct {
+        A_UINT8 bssid[ATH_MAC_LEN];
+        A_INT8  bias;
+} POSTPACK WMI_BSS_BIAS;
+
+typedef PREPACK struct {
+        A_UINT8 numBss;
+        WMI_BSS_BIAS bssBias[1];
+} POSTPACK WMI_BSS_BIAS_INFO;
+
+typedef PREPACK struct WMI_LOWRSSI_SCAN_PARAMS {
+        A_UINT16 lowrssi_scan_period;
+        A_INT16  lowrssi_scan_threshold;
+        A_INT16  lowrssi_roam_threshold;
+        A_UINT8  roam_rssi_floor;
+        A_UINT8  reserved[1];              /* For alignment */
+} POSTPACK WMI_LOWRSSI_SCAN_PARAMS;
+
+typedef PREPACK struct {
+    PREPACK union {
+        A_UINT8 bssid[ATH_MAC_LEN]; /* WMI_FORCE_ROAM */
+        A_UINT8 roamMode;           /* WMI_SET_ROAM_MODE  */
+        WMI_BSS_BIAS_INFO bssBiasInfo; /* WMI_SET_HOST_BIAS */
+        WMI_LOWRSSI_SCAN_PARAMS lrScanParams;
+    } POSTPACK info;
+    A_UINT8   roamCtrlType ;
+} POSTPACK WMI_SET_ROAM_CTRL_CMD;
+
+/*
+ * WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID
+ */
+typedef enum {
+    BT_WLAN_CONN_PRECDENCE_WLAN=0,  /* Default */
+    BT_WLAN_CONN_PRECDENCE_PAL,
+} BT_WLAN_CONN_PRECEDENCE;
+
+typedef PREPACK struct {
+    A_UINT8 precedence;
+} POSTPACK WMI_SET_BT_WLAN_CONN_PRECEDENCE;
+
+/*
+ * WMI_ENABLE_RM_CMDID
+ */
+typedef PREPACK struct {
+        A_BOOL enable_radio_measurements;
+} POSTPACK WMI_ENABLE_RM_CMD;
+
+/*
+ * WMI_SET_MAX_OFFHOME_DURATION_CMDID
+ */
+typedef PREPACK struct {
+        A_UINT8 max_offhome_duration;
+} POSTPACK WMI_SET_MAX_OFFHOME_DURATION_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 frequency;
+    A_UINT8  threshold;
+} POSTPACK WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD;
+
+typedef enum {
+    WMI_PKTLOG_CMD_DISABLE,
+    WMI_PKTLOG_CMD_SETSIZE,
+} WMI_PKTLOG_CMD;
+
+#define PKTLOG_MAX_BYTES 4096
+
+typedef PREPACK struct {
+    A_UINT32 nbytes;
+    A_UINT8 buffer[PKTLOG_MAX_BYTES];
+} POSTPACK WMI_GET_PKTLOG_CMD;
+
+/* LPL commands */
+typedef PREPACK struct  {
+    A_UINT8 lplPolicy; /*0 - force off, 1 force on, 2 dynamic*/
+    A_UINT8 noBlockerDetect; /*don't do blocker detection if lpl policy is set
+                               to dynamic*/
+    A_UINT8 noRfbDetect; /*don't do rate fall back  detection if lpl policy is set
+                               to dynamic*/
+    A_UINT8 rsvd;
+} POSTPACK  WMI_LPL_FORCE_ENABLE_CMD;
+
+/*command structure for all policy related commands*/
+typedef PREPACK struct  {  
+    A_UINT64    index;
+    A_BOOL      value;
+} POSTPACK  WMI_LPL_POLICY_CMD;
+
+typedef PREPACK struct {
+    A_UINT32    rfbPeriod;
+    A_UINT32    rfbObsDuration;
+    A_UINT32    blockerBeaconRssi;
+    A_UINT8     chanOff;
+    A_UINT32    rfbDiffThold;
+    A_UINT32    bRssiThold;
+    A_UINT32    maxBlockerRssi;
+} POSTPACK WMI_LPL_PARAMS_CMD;
+
+typedef enum {
+    WMI_PKTLOG_OPTION_LOG_TCP_HEADERS = 0x1,
+    WMI_PKTLOG_OPTION_TRIGGER_THRUPUT = 0x2,
+    WMI_PKTLOG_OPTION_TRIGGER_SACK    = 0x4,
+    WMI_PKTLOG_OPTION_TRIGGER_PER     = 0x8
+} WMI_PKTLOG_OPTION;
+
+typedef enum {
+    WMI_PKTLOG_EVENT_RX  = 0x1,
+    WMI_PKTLOG_EVENT_TX  = 0x2,
+    WMI_PKTLOG_EVENT_RCF = 0x4, /* Rate Control Find */
+    WMI_PKTLOG_EVENT_RCU = 0x8, /* Rate Control Update */
+} WMI_PKTLOG_EVENT;
+
+typedef PREPACK struct {
+    WMI_PKTLOG_EVENT evlist;
+    WMI_PKTLOG_OPTION option;
+    A_UINT32 trigger_thresh;
+    A_UINT32 trigger_interval;
+    A_UINT32 trigger_tail_count;
+    A_UINT32 buffer_size;
+} POSTPACK WMI_ENABLE_PKTLOG_CMD;
+
+typedef enum {
+    WMI_SMPS_OPTION_MODE          = 0x1,
+    WMI_SMPS_OPTION_AUTO          = 0x2,
+    WMI_SMPS_OPTION_DATATHRESH    = 0x4,
+    WMI_SMPS_OPTION_RSSITHRESH    = 0x8,
+} WMI_SMPS_OPTION;
+
+typedef enum {
+    WMI_SMPS_MODE_STATIC    = 0x1,
+    WMI_SMPS_MODE_DYNAMIC   = 0x2,
+} WMI_SMPS_MODE;
+
+typedef PREPACK struct {
+    A_UINT8 flags;      /* To indicate which options have changed */
+    A_UINT8 rssiThresh;
+    A_UINT8 dataThresh;
+    A_UINT8 mode;       /* static/dynamic */
+    A_UINT8 automatic;
+} POSTPACK WMI_CONFIG_SMPS_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 enable;      /* Enable/disable */
+} POSTPACK WMI_ENABLE_SMPS_CMD;
+
+
+typedef enum {
+    WMI_CCX_RM_STATUS_UNKNOWN = 0,
+    WMI_CCX_RM_REPORT_SENT,
+    WMI_CCX_RM_REFUSE_REPORT_SENT,
+    WMI_CCX_RM_STATUS_MAX
+} WMI_CCX_RM_STATUS_TYPE;
+
+/*---------------------- BTCOEX RELATED -------------------------------------*/
+/*----------------------COMMON to AR6002 and AR6003 -------------------------*/
+typedef enum {
+    BT_STREAM_UNDEF = 0,
+    BT_STREAM_SCO,             /* SCO stream */
+    BT_STREAM_A2DP,            /* A2DP stream */
+    BT_STREAM_SCAN,            /* BT Discovery or Page */
+    BT_STREAM_ESCO,
+    BT_STREAM_MAX
+} BT_STREAM_TYPE;
+
+typedef enum {
+    BT_PARAM_SCO_PSPOLL_LATENCY_ONE_FOURTH =1,
+    BT_PARAM_SCO_PSPOLL_LATENCY_HALF,
+    BT_PARAM_SCO_PSPOLL_LATENCY_THREE_FOURTH,
+} BT_PARAMS_SCO_PSPOLL_LATENCY;
+
+typedef enum {
+    BT_PARAMS_SCO_STOMP_SCO_NEVER =1,
+    BT_PARAMS_SCO_STOMP_SCO_ALWAYS,
+    BT_PARAMS_SCO_STOMP_SCO_IN_LOWRSSI,
+} BT_PARAMS_SCO_STOMP_RULES;
+
+typedef enum {
+    BT_STATUS_UNDEF = 0,
+    BT_STATUS_ON,
+    BT_STATUS_OFF,
+    BT_STATUS_MAX
+} BT_STREAM_STATUS;
+
+typedef PREPACK struct {
+    A_UINT8 streamType;
+    A_UINT8 status;
+} POSTPACK WMI_SET_BT_STATUS_CMD;
+
+typedef enum {
+    BT_ANT_TYPE_UNDEF=0,
+    BT_ANT_TYPE_DUAL,
+    BT_ANT_TYPE_SPLITTER,
+    BT_ANT_TYPE_SWITCH,
+    BT_ANT_TYPE_HIGH_ISO_DUAL
+} BT_ANT_FRONTEND_CONFIG;
+
+typedef enum {
+    BT_COLOCATED_DEV_BTS4020=0,
+    BT_COLCATED_DEV_CSR ,
+    BT_COLOCATED_DEV_VALKYRIE
+} BT_COLOCATED_DEV_TYPE;
+
+/*********************** Applicable to AR6002 ONLY ******************************/
+
+typedef enum {
+    BT_PARAM_SCO = 1,         /* SCO stream parameters */
+    BT_PARAM_A2DP ,
+    BT_PARAM_ANTENNA_CONFIG,
+    BT_PARAM_COLOCATED_BT_DEVICE,
+    BT_PARAM_ACLCOEX,
+    BT_PARAM_11A_SEPARATE_ANT,
+    BT_PARAM_MAX
+} BT_PARAM_TYPE;
+
+
+#define BT_SCO_ALLOW_CLOSE_RANGE_OPT    (1 << 0)
+#define BT_SCO_FORCE_AWAKE_OPT          (1 << 1)
+#define BT_SCO_SET_RSSI_OVERRIDE(flags)        ((flags) |= (1 << 2))
+#define BT_SCO_GET_RSSI_OVERRIDE(flags)        (((flags) >> 2) & 0x1)
+#define BT_SCO_SET_RTS_OVERRIDE(flags)   ((flags) |= (1 << 3))
+#define BT_SCO_GET_RTS_OVERRIDE(flags)   (((flags) >> 3) & 0x1)
+#define BT_SCO_GET_MIN_LOW_RATE_CNT(flags)     (((flags) >> 8) & 0xFF)
+#define BT_SCO_GET_MAX_LOW_RATE_CNT(flags)     (((flags) >> 16) & 0xFF)
+#define BT_SCO_SET_MIN_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 8)
+#define BT_SCO_SET_MAX_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 16)
+
+typedef PREPACK struct {
+    A_UINT32 numScoCyclesForceTrigger;  /* Number SCO cycles after which
+                                           force a pspoll. default = 10 */
+    A_UINT32 dataResponseTimeout;       /* Timeout Waiting for Downlink pkt
+                                           in response for ps-poll,
+                                           default = 10 msecs */
+    A_UINT32  stompScoRules;
+    A_UINT32 scoOptFlags;               /* SCO Options Flags :
+                                            bits:     meaning:
+                                             0        Allow Close Range Optimization
+                                             1        Force awake during close range
+                                             2        If set use host supplied RSSI for OPT
+                                             3        If set use host supplied RTS COUNT for OPT
+                                             4..7     Unused
+                                             8..15    Low Data Rate Min Cnt
+                                             16..23   Low Data Rate Max Cnt
+                                        */
+
+    A_UINT8 stompDutyCyleVal;           /* Sco cycles to limit ps-poll queuing
+                                           if stomped */
+    A_UINT8 stompDutyCyleMaxVal;        /*firm ware increases stomp duty cycle
+                                          gradually uptill this value on need basis*/
+    A_UINT8 psPollLatencyFraction;      /* Fraction of idle
+                                           period, within which
+                                           additional ps-polls
+                                           can be queued */
+    A_UINT8 noSCOSlots;                 /* Number of SCO Tx/Rx slots.
+                                           HVx, EV3, 2EV3 = 2 */
+    A_UINT8 noIdleSlots;                /* Number of Bluetooth idle slots between
+                                           consecutive SCO Tx/Rx slots
+                                           HVx, EV3 = 4
+                                           2EV3 = 10 */
+    A_UINT8 scoOptOffRssi;/*RSSI value below which we go to ps poll*/
+    A_UINT8 scoOptOnRssi; /*RSSI value above which we reenter opt mode*/
+    A_UINT8 scoOptRtsCount;
+} POSTPACK BT_PARAMS_SCO;
+
+#define BT_A2DP_ALLOW_CLOSE_RANGE_OPT  (1 << 0)
+#define BT_A2DP_FORCE_AWAKE_OPT        (1 << 1)
+#define BT_A2DP_SET_RSSI_OVERRIDE(flags)        ((flags) |= (1 << 2))
+#define BT_A2DP_GET_RSSI_OVERRIDE(flags)        (((flags) >> 2) & 0x1)
+#define BT_A2DP_SET_RTS_OVERRIDE(flags)   ((flags) |= (1 << 3))
+#define BT_A2DP_GET_RTS_OVERRIDE(flags)   (((flags) >> 3) & 0x1)
+#define BT_A2DP_GET_MIN_LOW_RATE_CNT(flags)     (((flags) >> 8) & 0xFF)
+#define BT_A2DP_GET_MAX_LOW_RATE_CNT(flags)     (((flags) >> 16) & 0xFF)
+#define BT_A2DP_SET_MIN_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 8)
+#define BT_A2DP_SET_MAX_LOW_RATE_CNT(flags,val) (flags) |= (((val) & 0xFF) << 16)
+
+typedef PREPACK struct {
+    A_UINT32 a2dpWlanUsageLimit; /* MAX time firmware uses the medium for
+                                    wlan, after it identifies the idle time
+                                    default (30 msecs) */
+    A_UINT32 a2dpBurstCntMin;   /* Minimum number of bluetooth data frames
+                                   to replenish Wlan Usage  limit (default 3) */
+    A_UINT32 a2dpDataRespTimeout;
+    A_UINT32 a2dpOptFlags;      /* A2DP Option flags:
+                                       bits:    meaning:
+                                        0       Allow Close Range Optimization
+                                        1       Force awake during close range
+                                        2        If set use host supplied RSSI for OPT
+                                        3        If set use host supplied RTS COUNT for OPT
+                                        4..7    Unused
+                                        8..15   Low Data Rate Min Cnt
+                                        16..23  Low Data Rate Max Cnt
+                                 */
+    A_UINT8 isCoLocatedBtRoleMaster;
+    A_UINT8 a2dpOptOffRssi;/*RSSI value below which we go to ps poll*/
+    A_UINT8 a2dpOptOnRssi; /*RSSI value above which we reenter opt mode*/
+    A_UINT8 a2dpOptRtsCount;
+}POSTPACK BT_PARAMS_A2DP;
+
+/* During BT ftp/ BT OPP or any another data based acl profile on bluetooth
+   (non a2dp).*/
+typedef PREPACK struct {
+    A_UINT32 aclWlanMediumUsageTime;  /* Wlan usage time during Acl (non-a2dp)
+                                       coexistence (default 30 msecs) */
+    A_UINT32 aclBtMediumUsageTime;   /* Bt usage time during acl coexistence
+                                       (default 30 msecs)*/
+    A_UINT32 aclDataRespTimeout;
+    A_UINT32 aclDetectTimeout;      /* ACL coexistence enabled if we get
+                                       10 Pkts in X msec(default 100 msecs) */
+    A_UINT32 aclmaxPktCnt;          /* No of ACL pkts to receive before
+                                         enabling ACL coex */
+
+}POSTPACK BT_PARAMS_ACLCOEX;
+
+typedef PREPACK struct {
+    PREPACK union {
+        BT_PARAMS_SCO scoParams;
+        BT_PARAMS_A2DP a2dpParams;
+        BT_PARAMS_ACLCOEX  aclCoexParams;
+        A_UINT8 antType;         /* 0 -Disabled (default)
+                                     1 - BT_ANT_TYPE_DUAL
+                                     2 - BT_ANT_TYPE_SPLITTER
+                                     3 - BT_ANT_TYPE_SWITCH */
+        A_UINT8 coLocatedBtDev;  /* 0 - BT_COLOCATED_DEV_BTS4020 (default)
+                                     1 - BT_COLCATED_DEV_CSR
+                                     2 - BT_COLOCATED_DEV_VALKYRIe
+                                   */
+    } POSTPACK info;
+    A_UINT8 paramType ;
+} POSTPACK WMI_SET_BT_PARAMS_CMD;
+
+/************************ END AR6002 BTCOEX *******************************/
+/*-----------------------AR6003 BTCOEX -----------------------------------*/
+
+/*  ---------------WMI_SET_BTCOEX_FE_ANT_CMDID --------------------------*/
+/* Indicates front end antenna configuration. This command needs to be issued
+ * right after initialization and after WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID.
+ * AR6003 enables coexistence and antenna switching based on the configuration.
+ */
+typedef enum {
+    WMI_BTCOEX_NOT_ENABLED = 0,
+    WMI_BTCOEX_FE_ANT_SINGLE =1,
+    WMI_BTCOEX_FE_ANT_DUAL=2,
+    WMI_BTCOEX_FE_ANT_DUAL_HIGH_ISO=3,
+    WMI_BTCOEX_FE_ANT_DUAL_SH_BT_LOW_ISO = 4,
+    WMI_BTCOEX_FE_ANT_DUAL_SH_BT_HIGH_ISO = 5,
+    WMI_BTCOEX_FE_ANT_TYPE_MAX
+}WMI_BTCOEX_FE_ANT_TYPE;
+
+typedef PREPACK struct {
+    A_UINT8 btcoexFeAntType; /* 1 - WMI_BTCOEX_FE_ANT_SINGLE for single antenna front end
+                                2 - WMI_BTCOEX_FE_ANT_DUAL for dual antenna front end
+                                    (for isolations less 35dB, for higher isolation there
+                                    is not need to pass this command).
+                                    (not implemented)
+                              */
+}POSTPACK WMI_SET_BTCOEX_FE_ANT_CMD;
+
+/* -------------WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID ----------------*/
+/* Indicate the bluetooth chip to the firmware. Firmware can have different algorithm based
+ * bluetooth chip type.Based on bluetooth device, different coexistence protocol would be used.
+ */
+typedef PREPACK struct {
+    A_UINT8 btcoexCoLocatedBTdev; /*1 - Qcom BT (3 -wire PTA)
+                                    2 - CSR BT  (3 wire PTA)
+                                    3 - Atheros 3001 BT (3 wire PTA)
+                                    4 - STE bluetooth (4-wire ePTA)
+                                    5 - Atheros 3002 BT (4-wire MCI)
+                                    defaults= 3 (Atheros 3001 BT )
+                                    */
+}POSTPACK WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD;
+
+/* -------------WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID ------------*/
+/* Configuration parameters during bluetooth inquiry and page. Page configuration
+ * is applicable only on interfaces which can distinguish page (applicable only for ePTA -
+ * STE bluetooth).
+ * Bluetooth inquiry start and end is indicated via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID.
+ * During this the station will be  power-save mode.
+ */
+typedef PREPACK struct {
+    A_UINT32 btInquiryDataFetchFrequency;/* The frequency of querying the AP for data
+                                            (via pspoll) is configured by this parameter.
+                                            "default = 10 ms" */
+
+    A_UINT32 protectBmissDurPostBtInquiry;/* The firmware will continue to be in inquiry state
+                                             for configured duration, after inquiry completion
+                                             . This is to ensure other bluetooth transactions
+                                             (RDP, SDP profiles, link key exchange ...etc)
+                                             goes through smoothly without wifi stomping.
+                                             default = 10 secs*/
+
+    A_UINT32 maxpageStomp;                 /*Applicable only for STE-BT interface. Currently not
+                                             used */
+    A_UINT32 btInquiryPageFlag;           /* Not used */
+}POSTPACK WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD;
+
+/*---------------------WMI_SET_BTCOEX_SCO_CONFIG_CMDID ---------------*/
+/* Configure  SCO parameters. These parameters would be used whenever firmware is indicated
+ * of (e)SCO profile on bluetooth ( via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID).
+ * Configration of BTCOEX_SCO_CONFIG data structure are common configuration and applies
+ * ps-poll mode and opt mode.
+ * Ps-poll Mode - Station is in power-save and retrieves downlink data between sco gaps.
+ * Opt Mode - station is in awake state and access point can send data to station any time.
+ * BTCOEX_PSPOLLMODE_SCO_CONFIG - Configuration applied only during ps-poll mode.
+ * BTCOEX_OPTMODE_SCO_CONFIG - Configuration applied only during opt mode.
+ */
+#define WMI_SCO_CONFIG_FLAG_ALLOW_OPTIMIZATION   (1 << 0)
+#define WMI_SCO_CONFIG_FLAG_IS_EDR_CAPABLE       (1 << 1)
+#define WMI_SCO_CONFIG_FLAG_IS_BT_MASTER         (1 << 2)
+#define WMI_SCO_CONFIG_FLAG_FW_DETECT_OF_PER     (1 << 3)
+typedef PREPACK struct {
+    A_UINT32 scoSlots;                  /* Number of SCO Tx/Rx slots.
+                                           HVx, EV3, 2EV3 = 2 */
+    A_UINT32 scoIdleSlots;              /* Number of Bluetooth idle slots between
+                                           consecutive SCO Tx/Rx slots
+                                           HVx, EV3 = 4
+                                           2EV3 = 10
+                                         */
+    A_UINT32 scoFlags;                 /* SCO Options Flags :
+                                          bits:    meaning:
+                                          0   Allow Close Range Optimization
+                                          1   Is EDR capable or Not
+                                          2   IS Co-located Bt role Master
+                                          3   Firmware determines the periodicity of SCO.
+                                         */
+
+    A_UINT32 linkId;                      /* applicable to STE-BT - not used */
+}POSTPACK BTCOEX_SCO_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32  scoCyclesForceTrigger;    /* Number SCO cycles after which
+                                            force a pspoll. default = 10 */
+    A_UINT32 scoDataResponseTimeout;     /* Timeout Waiting for Downlink pkt
+                                            in response for ps-poll,
+                                            default = 20 msecs */
+
+    A_UINT32 scoStompDutyCyleVal;        /* not implemented */
+
+    A_UINT32 scoStompDutyCyleMaxVal;     /*Not implemented */
+
+    A_UINT32 scoPsPollLatencyFraction;   /* Fraction of idle
+                                            period, within which
+                                            additional ps-polls can be queued
+                                            1 - 1/4 of idle duration
+                                            2 - 1/2 of idle duration
+                                            3 - 3/4 of idle duration
+                                            default =2 (1/2)
+                                           */
+}POSTPACK BTCOEX_PSPOLLMODE_SCO_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32 scoStompCntIn100ms;/*max number of SCO stomp in 100ms allowed in
+                                   opt mode. If exceeds the configured value,
+                                   switch to ps-poll mode
+                                  default = 3 */
+
+    A_UINT32 scoContStompMax;   /* max number of continous stomp allowed in opt mode.
+                                   if excedded switch to pspoll mode
+                                    default = 3 */
+
+    A_UINT32 scoMinlowRateMbps; /* Low rate threshold */
+
+    A_UINT32 scoLowRateCnt;     /* number of low rate pkts (< scoMinlowRateMbps) allowed in 100 ms.
+                                   If exceeded switch/stay to ps-poll mode, lower stay in opt mode.
+                                   default = 36
+                                 */
+
+    A_UINT32 scoHighPktRatio;   /*(Total Rx pkts in 100 ms + 1)/
+                                  ((Total tx pkts in 100 ms - No of high rate pkts in 100 ms) + 1) in 100 ms,
+                                  if exceeded switch/stay in opt mode and if lower switch/stay in  pspoll mode.
+                                  default = 5 (80% of high rates)
+                                 */
+
+    A_UINT32 scoMaxAggrSize;    /* Max number of Rx subframes allowed in this mode. (Firmware re-negogiates
+                                   max number of aggregates if it was negogiated to higher value
+                                   default = 1
+                                   Recommended value Basic rate headsets = 1, EDR (2-EV3)  =4.
+                                 */
+}POSTPACK BTCOEX_OPTMODE_SCO_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32 scanInterval;
+    A_UINT32 maxScanStompCnt;
+}POSTPACK BTCOEX_WLANSCAN_SCO_CONFIG;
+
+typedef PREPACK struct {
+    BTCOEX_SCO_CONFIG scoConfig;
+    BTCOEX_PSPOLLMODE_SCO_CONFIG scoPspollConfig;
+    BTCOEX_OPTMODE_SCO_CONFIG scoOptModeConfig;
+    BTCOEX_WLANSCAN_SCO_CONFIG scoWlanScanConfig;
+}POSTPACK WMI_SET_BTCOEX_SCO_CONFIG_CMD;
+
+/* ------------------WMI_SET_BTCOEX_A2DP_CONFIG_CMDID -------------------*/
+/* Configure A2DP profile parameters. These parameters would be used whenver firmware is indicated
+ * of A2DP profile on bluetooth ( via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID).
+ * Configuration of BTCOEX_A2DP_CONFIG data structure are common configuration and applies to
+ * ps-poll mode and opt mode.
+ * Ps-poll Mode - Station is in power-save and retrieves downlink data between a2dp data bursts.
+ * Opt Mode - station is in power save during a2dp bursts and awake in the gaps.
+ * BTCOEX_PSPOLLMODE_A2DP_CONFIG - Configuration applied only during ps-poll mode.
+ * BTCOEX_OPTMODE_A2DP_CONFIG - Configuration applied only during opt mode.
+ */
+
+#define WMI_A2DP_CONFIG_FLAG_ALLOW_OPTIMIZATION    (1 << 0)
+#define WMI_A2DP_CONFIG_FLAG_IS_EDR_CAPABLE        (1 << 1)
+#define WMI_A2DP_CONFIG_FLAG_IS_BT_ROLE_MASTER     (1 << 2)
+#define WMI_A2DP_CONFIG_FLAG_IS_A2DP_HIGH_PRI      (1 << 3)
+#define WMI_A2DP_CONFIG_FLAG_FIND_BT_ROLE          (1 << 4)
+
+typedef PREPACK struct {
+    A_UINT32 a2dpFlags;      /* A2DP Option flags:
+                                bits:    meaning:
+                                0       Allow Close Range Optimization
+                                1       IS EDR capable
+                                2       IS Co-located Bt role Master
+                                3       a2dp traffic is high priority
+                                4       Fw detect the role of bluetooth.
+                             */
+    A_UINT32 linkId;         /* Applicable only to STE-BT - not used */
+
+}POSTPACK BTCOEX_A2DP_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32 a2dpWlanMaxDur; /* MAX time firmware uses the medium for
+                                wlan, after it identifies the idle time
+                                default (30 msecs) */
+
+    A_UINT32 a2dpMinBurstCnt;   /* Minimum number of bluetooth data frames
+                                to replenish Wlan Usage  limit (default 3) */
+
+    A_UINT32 a2dpDataRespTimeout; /* Max duration firmware waits for downlink
+                                     by stomping on  bluetooth
+                                     after ps-poll is acknowledged.
+                                     default = 20 ms
+                                   */
+}POSTPACK BTCOEX_PSPOLLMODE_A2DP_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32 a2dpMinlowRateMbps;  /* Low rate threshold */
+
+    A_UINT32 a2dpLowRateCnt;    /* number of low rate pkts (< a2dpMinlowRateMbps) allowed in 100 ms.
+                                   If exceeded switch/stay to ps-poll mode, lower stay in opt mode.
+                                   default = 36
+                                 */
+
+    A_UINT32 a2dpHighPktRatio;   /*(Total Rx pkts in 100 ms + 1)/
+                                  ((Total tx pkts in 100 ms - No of high rate pkts in 100 ms) + 1) in 100 ms,
+                                  if exceeded switch/stay in opt mode and if lower switch/stay in  pspoll mode.
+                                  default = 5 (80% of high rates)
+                                 */
+
+    A_UINT32 a2dpMaxAggrSize;    /* Max number of Rx subframes allowed in this mode. (Firmware re-negogiates
+                                   max number of aggregates if it was negogiated to higher value
+                                   default = 1
+                                  Recommended value Basic rate headsets = 1, EDR (2-EV3)  =8.
+                                 */
+    A_UINT32 a2dpPktStompCnt;    /*number of a2dp pkts that can be stomped per burst.
+                                   default = 6*/
+
+}POSTPACK BTCOEX_OPTMODE_A2DP_CONFIG;
+
+typedef PREPACK struct {
+    BTCOEX_A2DP_CONFIG a2dpConfig;
+    BTCOEX_PSPOLLMODE_A2DP_CONFIG a2dppspollConfig;
+    BTCOEX_OPTMODE_A2DP_CONFIG a2dpOptConfig;
+}POSTPACK WMI_SET_BTCOEX_A2DP_CONFIG_CMD;
+
+/*------------ WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID---------------------*/
+/* Configure non-A2dp ACL profile parameters.The starts of ACL profile can either be
+ * indicated via WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID orenabled via firmware detection
+ *  which is configured via "aclCoexFlags".
+ * Configration of BTCOEX_ACLCOEX_CONFIG data structure are common configuration and applies
+ * ps-poll mode and opt mode.
+ * Ps-poll Mode - Station is in power-save and retrieves downlink data during wlan medium.
+ * Opt Mode - station is in power save during bluetooth medium time and awake during wlan duration.
+ *             (Not implemented yet)
+ *
+ * BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG - Configuration applied only during ps-poll mode.
+ * BTCOEX_OPTMODE_ACLCOEX_CONFIG - Configuration applied only during opt mode.
+ */
+
+#define WMI_ACLCOEX_FLAGS_ALLOW_OPTIMIZATION   (1 << 0)
+#define WMI_ACLCOEX_FLAGS_DISABLE_FW_DETECTION (1 << 1)
+
+typedef PREPACK struct {
+    A_UINT32 aclWlanMediumDur;      /* Wlan usage time during Acl (non-a2dp)
+                                        coexistence (default 30 msecs)
+                                    */
+
+    A_UINT32 aclBtMediumDur;       /* Bt usage time during acl coexistence
+                                         (default 30 msecs)
+                                   */
+
+    A_UINT32 aclDetectTimeout;     /* BT activity observation time limit.
+                                      In this time duration, number of bt pkts are counted.
+                                      If the Cnt reaches "aclPktCntLowerLimit" value
+                                      for "aclIterToEnableCoex" iteration continuously,
+                                      firmware gets into ACL coexistence mode.
+                                      Similarly, if bt traffic count during ACL coexistence
+                                      has not reached "aclPktCntLowerLimit" continuously
+                                      for "aclIterToEnableCoex", then ACL coexistence is
+                                      disabled.
+                                      -default 100 msecs
+                                    */
+
+     A_UINT32 aclPktCntLowerLimit;   /* Acl Pkt Cnt to be received in duration of
+                                        "aclDetectTimeout" for
+                                        "aclIterForEnDis" times to enabling ACL coex.
+                                        Similar logic is used to disable acl coexistence.
+                                        (If "aclPktCntLowerLimit"  cnt of acl pkts
+                                         are not seen by the for "aclIterForEnDis"
+                                         then acl coexistence is disabled).
+                                        default = 10
+                                   */
+
+     A_UINT32 aclIterForEnDis;      /* number of Iteration of "aclPktCntLowerLimit" for Enabling and
+                                       Disabling Acl Coexistence.
+                                       default = 3
+                                     */
+
+     A_UINT32 aclPktCntUpperLimit; /* This is upperBound limit, if there is more than
+                                      "aclPktCntUpperLimit" seen in "aclDetectTimeout",
+                                      ACL coexistence is enabled right away.
+                                      - default 15*/
+
+    A_UINT32 aclCoexFlags;          /* A2DP Option flags:
+                                      bits:    meaning:
+                                      0       Allow Close Range Optimization
+                                      1       disable Firmware detection
+                                      (Currently supported configuration is aclCoexFlags =0)
+                                    */
+
+    A_UINT32 linkId;                /* Applicable only for STE-BT - not used */
+
+}POSTPACK BTCOEX_ACLCOEX_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32 aclDataRespTimeout;   /* Max duration firmware waits for downlink
+                                      by stomping on  bluetooth
+                                      after ps-poll is acknowledged.
+                                     default = 20 ms */
+
+}POSTPACK BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG;
+
+
+/* Not implemented yet*/
+typedef PREPACK struct {
+    A_UINT32 aclCoexMinlowRateMbps;
+    A_UINT32 aclCoexLowRateCnt;
+    A_UINT32 aclCoexHighPktRatio;
+    A_UINT32 aclCoexMaxAggrSize;
+    A_UINT32 aclPktStompCnt;
+}POSTPACK BTCOEX_OPTMODE_ACLCOEX_CONFIG;
+
+typedef PREPACK struct {
+    BTCOEX_ACLCOEX_CONFIG aclCoexConfig;
+    BTCOEX_PSPOLLMODE_ACLCOEX_CONFIG aclCoexPspollConfig;
+    BTCOEX_OPTMODE_ACLCOEX_CONFIG aclCoexOptConfig;
+}POSTPACK WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD;
+
+/* -----------WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID ------------------*/
+typedef enum {
+    WMI_BTCOEX_BT_PROFILE_SCO =1,
+    WMI_BTCOEX_BT_PROFILE_A2DP,
+    WMI_BTCOEX_BT_PROFILE_INQUIRY_PAGE,
+    WMI_BTCOEX_BT_PROFILE_ACLCOEX,
+}WMI_BTCOEX_BT_PROFILE;
+
+typedef PREPACK struct {
+    A_UINT32 btProfileType;
+    A_UINT32 btOperatingStatus;
+    A_UINT32 btLinkId;
+}WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD;
+
+/*--------------------- WMI_SET_BTCOEX_DEBUG_CMDID ---------------------*/
+/* Used for firmware development and debugging */
+typedef PREPACK struct {
+    A_UINT32 btcoexDbgParam1;
+    A_UINT32 btcoexDbgParam2;
+    A_UINT32 btcoexDbgParam3;
+    A_UINT32 btcoexDbgParam4;
+    A_UINT32 btcoexDbgParam5;
+}WMI_SET_BTCOEX_DEBUG_CMD;
+
+/*---------------------WMI_GET_BTCOEX_CONFIG_CMDID --------------------- */
+/* Command to firmware to get configuration parameters of the bt profile
+ * reported via WMI_BTCOEX_CONFIG_EVENTID */
+typedef PREPACK struct {
+    A_UINT32 btProfileType; /* 1 - SCO
+                               2 - A2DP
+                               3 - INQUIRY_PAGE
+                               4 - ACLCOEX
+                            */
+    A_UINT32 linkId;    /* not used */
+}WMI_GET_BTCOEX_CONFIG_CMD;
+
+/*------------------WMI_REPORT_BTCOEX_CONFIG_EVENTID------------------- */
+/* Event from firmware to host, sent in response to WMI_GET_BTCOEX_CONFIG_CMDID
+ * */
+typedef PREPACK struct {
+    A_UINT32 btProfileType;
+    A_UINT32 linkId; /* not used */
+    PREPACK union {
+        WMI_SET_BTCOEX_SCO_CONFIG_CMD scoConfigCmd;
+        WMI_SET_BTCOEX_A2DP_CONFIG_CMD a2dpConfigCmd;
+        WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD aclcoexConfig;
+        WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD btinquiryPageConfigCmd;
+    } POSTPACK info;
+} POSTPACK WMI_BTCOEX_CONFIG_EVENT;
+
+/*------------- WMI_REPORT_BTCOEX_BTCOEX_STATS_EVENTID--------------------*/
+/* Used for firmware development and debugging*/
+typedef PREPACK struct {
+    A_UINT32 highRatePktCnt;
+    A_UINT32 firstBmissCnt;
+    A_UINT32 psPollFailureCnt;
+    A_UINT32 nullFrameFailureCnt;
+    A_UINT32 optModeTransitionCnt;
+}BTCOEX_GENERAL_STATS;
+
+typedef PREPACK struct {
+    A_UINT32    scoStompCntAvg;
+    A_UINT32    scoStompIn100ms;
+    A_UINT32    scoMaxContStomp;
+    A_UINT32    scoAvgNoRetries;
+    A_UINT32    scoMaxNoRetriesIn100ms;
+}BTCOEX_SCO_STATS;
+
+typedef PREPACK struct {
+    A_UINT32    a2dpBurstCnt;
+    A_UINT32    a2dpMaxBurstCnt;
+    A_UINT32    a2dpAvgIdletimeIn100ms;
+    A_UINT32    a2dpAvgStompCnt;
+}BTCOEX_A2DP_STATS;
+
+typedef PREPACK struct {
+    A_UINT32    aclPktCntInBtTime;
+    A_UINT32    aclStompCntInWlanTime;
+    A_UINT32    aclPktCntIn100ms;
+}BTCOEX_ACLCOEX_STATS;
+
+typedef PREPACK struct {
+    BTCOEX_GENERAL_STATS coexStats;
+    BTCOEX_SCO_STATS scoStats;
+    BTCOEX_A2DP_STATS a2dpStats;
+    BTCOEX_ACLCOEX_STATS aclCoexStats;
+}WMI_BTCOEX_STATS_EVENT;
+
+
+/*--------------------------END OF BTCOEX -------------------------------------*/
+
+/* WAC commands
+ */
+
+
+typedef PREPACK struct {
+    A_UINT32    period;
+    A_UINT32    threshold;
+    A_INT32     rssi;
+    A_BOOL      enable;
+    A_CHAR      wps_pin[8];
+}WMI_WAC_ENABLE_CMD;
+
+typedef enum {
+    WAC_MORE_SCAN = -1,
+    WAC_SEND_PROBE_IDX = 0,
+}WAC_SUBCMD;
+
+typedef PREPACK struct {
+    WAC_SUBCMD  cmdid;
+}WMI_WAC_SCAN_REPLY_CMD;
+
+typedef PREPACK struct {
+    A_UINT8     req;
+    A_UINT8     cmd;
+    A_UINT8     frame;
+    A_UINT8     ie[64];
+    A_INT32     status;
+}WMI_WAC_CTRL_REQ_CMD;
+
+/* END OF WAC */
+
+typedef PREPACK struct {
+    A_UINT32 sleepState;
+}WMI_REPORT_SLEEP_STATE_EVENT;
+
+typedef enum {
+    WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP =0,
+    WMI_REPORT_SLEEP_STATUS_IS_AWAKE
+} WMI_REPORT_SLEEP_STATUS;
+typedef enum {
+    DISCONN_EVT_IN_RECONN = 0,  /* default */
+    NO_DISCONN_EVT_IN_RECONN
+} TARGET_EVENT_REPORT_CONFIG;
+
+typedef PREPACK struct {
+    A_UINT32 evtConfig;
+} POSTPACK WMI_SET_TARGET_EVENT_REPORT_CMD;
+
+
+typedef PREPACK struct {
+    A_UINT16    cmd_buf_sz;     /* HCI cmd buffer size */
+    A_UINT8     buf[1];         /* Absolute HCI cmd */
+} POSTPACK WMI_HCI_CMD;
+
+/*
+ * Command Replies
+ */
+
+/*
+ * WMI_GET_CHANNEL_LIST_CMDID reply
+ */
+typedef PREPACK struct {
+    A_UINT8     reserved1;
+    A_UINT8     numChannels;            /* number of channels in reply */
+    A_UINT16    channelList[1];         /* channel in Mhz */
+} POSTPACK WMI_CHANNEL_LIST_REPLY;
+
+typedef enum {
+    A_SUCCEEDED = A_OK,
+    A_FAILED_DELETE_STREAM_DOESNOT_EXIST=250,
+    A_SUCCEEDED_MODIFY_STREAM=251,
+    A_FAILED_INVALID_STREAM = 252,
+    A_FAILED_MAX_THINSTREAMS = 253,
+    A_FAILED_CREATE_REMOVE_PSTREAM_FIRST = 254,
+} PSTREAM_REPLY_STATUS;
+
+typedef PREPACK struct {
+    A_UINT8     status;                 /* PSTREAM_REPLY_STATUS */
+    A_UINT8     txQueueNumber;
+    A_UINT8     rxQueueNumber;
+    A_UINT8     trafficClass;
+    A_UINT8     trafficDirection;       /* DIR_TYPE */
+} POSTPACK WMI_CRE_PRIORITY_STREAM_REPLY;
+
+typedef PREPACK struct {
+    A_UINT8     status;                 /* PSTREAM_REPLY_STATUS */
+    A_UINT8     txQueueNumber;
+    A_UINT8     rxQueueNumber;
+    A_UINT8     trafficDirection;       /* DIR_TYPE */
+    A_UINT8     trafficClass;
+} POSTPACK WMI_DEL_PRIORITY_STREAM_REPLY;
+
+#ifdef TIME_BASED_DISCARD
+/*
+ * WMI_SET_TBD_TIME_CMDID
+ */
+typedef PREPACK struct{
+	A_UINT32 discardDispostion:1;
+  	A_UINT32 txdiscardTime:31;
+} POSTPACK WMI_SET_TBD_TIME;
+extern WMI_SET_TBD_TIME *txDiscard ;
+#endif
+/*
+ * List of Events (target to host)
+ */
+typedef enum {
+    WMI_READY_EVENTID           = 0x1001,
+    WMI_CONNECT_EVENTID,
+    WMI_DISCONNECT_EVENTID,
+    WMI_BSSINFO_EVENTID,
+    WMI_CMDERROR_EVENTID,
+    WMI_REGDOMAIN_EVENTID,
+    WMI_PSTREAM_TIMEOUT_EVENTID,
+    WMI_NEIGHBOR_REPORT_EVENTID,
+    WMI_TKIP_MICERR_EVENTID,
+    WMI_SCAN_COMPLETE_EVENTID,           /* 0x100a */
+    WMI_REPORT_STATISTICS_EVENTID,
+    WMI_RSSI_THRESHOLD_EVENTID,
+    WMI_ERROR_REPORT_EVENTID,
+    WMI_OPT_RX_FRAME_EVENTID,
+    WMI_REPORT_ROAM_TBL_EVENTID,
+    WMI_EXTENSION_EVENTID,
+    WMI_CAC_EVENTID,
+    WMI_SNR_THRESHOLD_EVENTID,
+    WMI_LQ_THRESHOLD_EVENTID,
+    WMI_TX_RETRY_ERR_EVENTID,            /* 0x1014 */
+    WMI_REPORT_ROAM_DATA_EVENTID,
+    WMI_TEST_EVENTID,
+    WMI_APLIST_EVENTID,
+    WMI_GET_WOW_LIST_EVENTID,
+    WMI_GET_PMKID_LIST_EVENTID,
+    WMI_CHANNEL_CHANGE_EVENTID,
+    WMI_PEER_NODE_EVENTID,
+    WMI_PSPOLL_EVENTID,
+    WMI_DTIMEXPIRY_EVENTID,
+    WMI_WLAN_VERSION_EVENTID,
+    WMI_SET_PARAMS_REPLY_EVENTID,
+    WMI_ADDBA_REQ_EVENTID,              /*0x1020 */
+    WMI_ADDBA_RESP_EVENTID,
+    WMI_DELBA_REQ_EVENTID,
+    WMI_TX_COMPLETE_EVENTID,
+    WMI_HCI_EVENT_EVENTID,
+    WMI_ACL_DATA_EVENTID,
+    WMI_REPORT_SLEEP_STATE_EVENTID,
+    WMI_WAPI_REKEY_EVENTID,
+    WMI_REPORT_BTCOEX_STATS_EVENTID,
+    WMI_REPORT_BTCOEX_CONFIG_EVENTID,
+    WMI_GET_PMK_EVENTID,
+
+    /* DFS Events */
+    WMI_DFS_HOST_ATTACH_EVENTID,    /* 102B */
+    WMI_DFS_HOST_INIT_EVENTID,
+    WMI_DFS_RESET_DELAYLINES_EVENTID,
+    WMI_DFS_RESET_RADARQ_EVENTID,
+    WMI_DFS_RESET_AR_EVENTID,
+    WMI_DFS_RESET_ARQ_EVENTID,
+    WMI_DFS_SET_DUR_MULTIPLIER_EVENTID,
+    WMI_DFS_SET_BANGRADAR_EVENTID,
+    WMI_DFS_SET_DEBUGLEVEL_EVENTID,
+    WMI_DFS_PHYERR_EVENTID,
+    /* CCX Evants */
+    WMI_CCX_RM_STATUS_EVENTID,    /* 1035 */
+
+    /* P2P Events */
+    WMI_P2P_GO_NEG_RESULT_EVENTID,    /* 1036 */
+
+    WMI_WAC_SCAN_DONE_EVENTID,
+    WMI_WAC_REPORT_BSS_EVENTID,
+    WMI_WAC_START_WPS_EVENTID,
+    WMI_WAC_CTRL_REQ_REPLY_EVENTID,
+    WMI_REPORT_WMM_PARAMS_EVENTID,
+    WMI_WAC_REJECT_WPS_EVENTID,
+
+    /* More P2P Events */
+    WMI_P2P_GO_NEG_REQ_EVENTID,
+    WMI_P2P_INVITE_REQ_EVENTID,
+    WMI_P2P_INVITE_RCVD_RESULT_EVENTID,
+    WMI_P2P_INVITE_SENT_RESULT_EVENTID,
+    WMI_P2P_PROV_DISC_RESP_EVENTID,
+    WMI_P2P_PROV_DISC_REQ_EVENTID,
+
+    /*RFKILL Events*/
+    WMI_RFKILL_STATE_CHANGE_EVENTID,
+    WMI_RFKILL_GET_MODE_CMD_EVENTID,
+
+    WMI_P2P_START_SDPD_EVENTID,
+    WMI_P2P_SDPD_RX_EVENTID,
+
+    /* Special event used to notify host that AR6003
+     * has processed sleep command (needed to prevent
+     * a late incoming credit report from crashing
+     * the system)
+     */
+    WMI_SET_HOST_SLEEP_MODE_CMD_PROCESSED_EVENTID,
+
+    WMI_THIN_RESERVED_START_EVENTID = 0x8000,
+    /* Events in this range are reserved for thinmode
+     * See wmi_thin.h for actual definitions */
+    WMI_THIN_RESERVED_END_EVENTID = 0x8fff,
+
+    WMI_SET_CHANNEL_EVENTID,
+    WMI_ASSOC_REQ_EVENTID,
+
+    /* generic ACS event */
+    WMI_ACS_EVENTID,
+    WMI_STORERECALL_STORE_EVENTID,
+    WMI_WOW_EXT_WAKE_EVENTID,
+    WMI_GTK_OFFLOAD_STATUS_EVENTID,
+    WMI_NETWORK_LIST_OFFLOAD_EVENTID,
+    WMI_REMAIN_ON_CHNL_EVENTID,
+    WMI_CANCEL_REMAIN_ON_CHNL_EVENTID,
+    WMI_TX_STATUS_EVENTID,
+    WMI_RX_PROBE_REQ_EVENTID,
+    WMI_P2P_CAPABILITIES_EVENTID,
+    WMI_RX_ACTION_EVENTID,
+    WMI_P2P_INFO_EVENTID,
+    /*WMI Location API Commands*/
+#ifdef WLAN_LOCATION_SUPPORT   
+    WMI_RTT_MEASRESP_EVENTID,
+    WMI_RTT_CAPRESP_EVENTID,
+    WMI_RTT_STATUSRESP_EVENTID,
+#endif
+    /* WPS Events */ 
+    WMI_WPS_GET_STATUS_EVENTID,
+    WMI_WPS_PROFILE_EVENTID,  
+
+    /* more P2P events */
+    WMI_NOA_INFO_EVENTID,
+    WMI_OPPPS_INFO_EVENTID,
+    WMI_PORT_STATUS_EVENTID,
+
+    /* 802.11w */
+    WMI_GET_RSN_CAP_EVENTID,
+} WMI_EVENT_ID;
+
+typedef enum {
+    WMI_11A_CAPABILITY   = 1,
+    WMI_11G_CAPABILITY   = 2,
+    WMI_11AG_CAPABILITY  = 3,
+    WMI_11NA_CAPABILITY  = 4,
+    WMI_11NG_CAPABILITY  = 5,
+    WMI_11NAG_CAPABILITY = 6,
+    // END CAPABILITY
+    WMI_11N_CAPABILITY_OFFSET = (WMI_11NA_CAPABILITY - WMI_11A_CAPABILITY),
+} WMI_PHY_CAPABILITY;
+
+typedef PREPACK struct {
+    A_UINT8     macaddr[ATH_MAC_LEN];
+    A_UINT8     phyCapability;              /* WMI_PHY_CAPABILITY */
+} POSTPACK WMI_READY_EVENT_1;
+
+typedef PREPACK struct {
+    A_UINT32    sw_version;
+    A_UINT32    abi_version;
+    A_UINT8     macaddr[ATH_MAC_LEN];
+    A_UINT8     phyCapability;              /* WMI_PHY_CAPABILITY */
+} POSTPACK WMI_READY_EVENT_2;
+
+#if defined(ATH_TARGET)
+#ifdef AR6002_REV2
+#define WMI_READY_EVENT WMI_READY_EVENT_1  /* AR6002_REV2 target code */
+#else
+#define WMI_READY_EVENT WMI_READY_EVENT_2  /* AR6001, AR6002_REV4, AR6002_REV6 */
+#endif
+#else
+#define WMI_READY_EVENT WMI_READY_EVENT_2 /* host code */
+#endif
+
+
+/*
+ * Connect Event
+ *
+ * In STA mode networkType comes along with connected phy mode
+ * To get networkType, WMI_NETWORK_TYPE (networkType)
+ * To get connected phymode, WMI_CONNECTED_PHYMODE(networkType)
+ * will give the phymode value.
+ */
+typedef PREPACK struct {
+    PREPACK union {
+        struct {
+            A_UINT16    channel;
+            A_UINT8     bssid[ATH_MAC_LEN];
+            A_UINT16    listenInterval;
+            A_UINT16    beaconInterval;
+#if defined(EXTENDED_TX_COMPLETE)
+            A_UINT16    networkType;
+            A_UINT8     aid;
+            A_UINT8     unused;
+#else
+            A_UINT32    networkType;
+#endif /* EXTENDED_TX_COMPLETE */
+        } infra_ibss_bss;
+        struct {
+            A_UINT8     phymode;
+            A_UINT8     aid;
+            A_UINT8     mac_addr[ATH_MAC_LEN];
+            A_UINT8     auth;
+            A_UINT8     keymgmt;
+            A_UINT16    cipher;
+            A_UINT8     apsd_info;
+            A_UINT8     unused[3];
+        } ap_sta;
+        struct {
+            A_UINT16    channel;
+            A_UINT8     bssid[ATH_MAC_LEN];
+            A_UINT8     unused[8];
+        } ap_bss;
+    } POSTPACK u;
+    A_UINT8     beaconIeLen;
+    A_UINT8     assocReqLen;
+    A_UINT8     assocRespLen;
+    A_UINT8     assocInfo[1];
+} POSTPACK WMI_CONNECT_EVENT;
+
+
+typedef struct {
+    A_UINT8   status;
+    A_UINT8   rspType;
+} WMI_ASSOCREQ_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8   host_accept;
+    A_UINT8   host_reasonCode;
+    A_UINT8   target_status;
+    A_UINT8   sta_mac_addr[ATH_MAC_LEN];
+    A_UINT8   rspType;
+} POSTPACK WMI_SEND_ASSOCRES_CMD;
+
+typedef struct {
+    A_UINT8   enable;
+} WMI_SET_ASSOCREQ_RELAY;
+
+/*
+ * Disconnect Event
+ */
+typedef enum {
+    NO_NETWORK_AVAIL   = 0x01,
+    LOST_LINK          = 0x02,     /* bmiss */
+    DISCONNECT_CMD     = 0x03,
+    BSS_DISCONNECTED   = 0x04,
+    AUTH_FAILED        = 0x05,
+    ASSOC_FAILED       = 0x06,
+    NO_RESOURCES_AVAIL = 0x07,
+    CSERV_DISCONNECT   = 0x08,
+    INVALID_PROFILE    = 0x0a,
+    DOT11H_CHANNEL_SWITCH = 0x0b,
+    PROFILE_MISMATCH   = 0x0c,
+    CONNECTION_EVICTED = 0x0d,
+    IBSS_MERGE         = 0x0e,
+    EXCESS_TX_RETRY    = 0x0f,     /* TX frames failed after excessive retries */
+    SEC_HS_TO_RECV_M1  = 0x10,     /* Security 4-way handshake timed out waiting for M1 */
+    SEC_HS_TO_RECV_M3  = 0x11,     /* Security 4-way handshake timed out waiting for M3 */
+    TKIP_COUNTERMEASURES = 0x12,
+    MLME_TIMEOUT       = 0x13,
+    CCX_TARGET_ROAMING_INDICATION = 0xfd,  /* hack for CCX AP-Assisted roaming*/
+    CCKM_ROAMING_INDICATION = 0xfe,  /* hack for CCKM fast roaming */
+} WMI_DISCONNECT_REASON;
+
+typedef PREPACK struct {
+    A_UINT16    protocolReasonStatus;  /* reason code, see 802.11 spec. */
+    A_UINT8     bssid[ATH_MAC_LEN];    /* set if known */
+    A_UINT8     disconnectReason ;      /* see WMI_DISCONNECT_REASON */
+    A_UINT8     assocRespLen;
+    A_UINT8     assocInfo[1];
+} POSTPACK WMI_DISCONNECT_EVENT;
+
+/*
+ * BSS Info Event.
+ * Mechanism used to inform host of the presence and characteristic of
+ * wireless networks present.  Consists of bss info header followed by
+ * the beacon or probe-response frame body.  The 802.11 header is not included.
+ */
+typedef enum {
+    BEACON_FTYPE = 0x1,
+    PROBERESP_FTYPE,
+    ACTION_MGMT_FTYPE,
+    PROBEREQ_FTYPE,
+} WMI_BI_FTYPE;
+
+enum {
+    BSS_ELEMID_CHANSWITCH = 0x01,
+    BSS_ELEMID_ATHEROS = 0x02,
+};
+
+typedef PREPACK struct {
+    A_UINT16    channel;
+    A_UINT8     frameType;          /* see WMI_BI_FTYPE */
+    A_UINT8     snr;
+    A_INT16     rssi;
+    A_UINT8     bssid[ATH_MAC_LEN];
+    A_UINT32    ieMask;
+} POSTPACK WMI_BSS_INFO_HDR;
+
+/*
+ * BSS INFO HDR version 2.0
+ * With 6 bytes HTC header and 6 bytes of WMI header
+ * WMI_BSS_INFO_HDR cannot be accomodated in the removed 802.11 management
+ * header space.
+ * - Reduce the ieMask to 2 bytes as only two bit flags are used
+ * - Remove rssi and compute it on the host. rssi = snr - 95
+ */
+typedef PREPACK struct {
+    A_UINT16    channel;
+    A_UINT8     frameType;          /* see WMI_BI_FTYPE */
+    A_UINT8     snr;
+    A_UINT8     bssid[ATH_MAC_LEN];
+    A_UINT16    ieMask;
+} POSTPACK WMI_BSS_INFO_HDR2;
+
+typedef PREPACK struct {
+    A_UINT8    bssid[ATH_MAC_LEN];
+    A_UINT8    pin[8];
+} POSTPACK WMI_WPS_PIN_INFO;
+
+typedef PREPACK struct {
+    PREPACK union {
+        A_UINT8 ie[17];
+        A_INT32 wac_status;
+    } POSTPACK info;
+} POSTPACK WMI_GET_WAC_INFO;
+
+#define IEEE80211_NWID_LEN                  32
+typedef PREPACK struct {
+    A_UINT8 bssid[ATH_MAC_LEN];
+    A_UINT8 ssid[IEEE80211_NWID_LEN];
+    A_UINT8 ssid_len;
+    A_UINT8 channel;
+    A_UINT8 snr;
+    A_UINT8 id;
+    A_UINT8 device_type;
+    A_UINT8 antenna_type;
+    A_INT8  threshold_offset1;  /* offset for AP Tx power */
+    A_INT8  threshold_offset2;  /* offset for antenna gain */
+} POSTPACK WMI_WAC_BSS_INFO_REPORT;
+
+/*
+ * Command Error Event
+ */
+typedef enum {
+    INVALID_PARAM  = 0x01,
+    ILLEGAL_STATE  = 0x02,
+    INTERNAL_ERROR = 0x03,
+    DFS_CHANNEL    = 0x05,
+} WMI_ERROR_CODE;
+
+typedef PREPACK struct {
+    A_UINT16    commandId;
+    A_UINT8     errorCode;
+} POSTPACK WMI_CMD_ERROR_EVENT;
+
+/*
+ * New Regulatory Domain Event
+ */
+typedef PREPACK struct {
+    A_UINT32    regDomain;
+} POSTPACK WMI_REG_DOMAIN_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8     txQueueNumber;
+    A_UINT8     rxQueueNumber;
+    A_UINT8     trafficDirection;
+    A_UINT8     trafficClass;
+} POSTPACK WMI_PSTREAM_TIMEOUT_EVENT;
+
+/*
+ * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
+ * the host of BSS's it has found that matches the current profile.
+ * It can be used by the host to cache PMKs and/to initiate pre-authentication
+ * if the BSS supports it.  The first bssid is always the current associated
+ * BSS.
+ * The bssid and bssFlags information repeats according to the number
+ * or APs reported.
+ */
+typedef enum {
+    WMI_DEFAULT_BSS_FLAGS   = 0x00,
+    WMI_PREAUTH_CAPABLE_BSS = 0x01,
+    WMI_PMKID_VALID_BSS     = 0x02,
+} WMI_BSS_FLAGS;
+
+typedef PREPACK struct {
+    A_UINT8     bssid[ATH_MAC_LEN];
+    A_UINT8     bssFlags;            /* see WMI_BSS_FLAGS */
+} POSTPACK WMI_NEIGHBOR_INFO;
+
+typedef PREPACK struct {
+    A_INT8      numberOfAps;
+    WMI_NEIGHBOR_INFO neighbor[1];
+} POSTPACK WMI_NEIGHBOR_REPORT_EVENT;
+
+/*
+ * TKIP MIC Error Event
+ */
+typedef PREPACK struct {
+    A_UINT8 keyid;
+    A_UINT8 ismcast;
+} POSTPACK WMI_TKIP_MICERR_EVENT;
+
+/*
+ * WMI_SCAN_COMPLETE_EVENTID - no parameters (old), staus parameter (new)
+ */
+typedef PREPACK struct {
+    A_INT32 status;
+} POSTPACK WMI_SCAN_COMPLETE_EVENT;
+
+typedef PREPACK struct {
+    A_INT32 rm_type;
+    A_INT32 status;
+} POSTPACK WMI_CCX_RM_STATUS_EVENT;
+
+#define MAX_OPT_DATA_LEN 1400
+
+/*
+ * WMI_SET_ADHOC_BSSID_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     bssid[ATH_MAC_LEN];
+} POSTPACK WMI_SET_ADHOC_BSSID_CMD;
+
+/*
+ * Special frame receive Event.
+ * Mechanism used to inform host of the receiption of the special frames.
+ * Consists of special frame info header followed by special frame body.
+ * The 802.11 header is not included.
+ */
+typedef PREPACK struct {
+    A_UINT16    channel;
+    A_UINT8     frameType;          /* see WMI_OPT_FTYPE */
+    A_INT8      snr;
+    A_UINT8     srcAddr[ATH_MAC_LEN];
+    A_UINT8     bssid[ATH_MAC_LEN];
+} POSTPACK WMI_OPT_RX_INFO_HDR;
+
+/*
+ * Reporting statistics.
+ */
+typedef PREPACK struct {
+    A_UINT32   tx_packets;
+    A_UINT32   tx_bytes;
+    A_UINT32   tx_unicast_pkts;
+    A_UINT32   tx_unicast_bytes;
+    A_UINT32   tx_multicast_pkts;
+    A_UINT32   tx_multicast_bytes;
+    A_UINT32   tx_broadcast_pkts;
+    A_UINT32   tx_broadcast_bytes;
+    A_UINT32   tx_rts_success_cnt;
+    A_UINT32   tx_packet_per_ac[4];
+    A_UINT32   tx_errors_per_ac[4];
+
+    A_UINT32   tx_errors;
+    A_UINT32   tx_failed_cnt;
+    A_UINT32   tx_retry_cnt;
+    A_UINT32   tx_mult_retry_cnt;
+    A_UINT32   tx_rts_fail_cnt;
+    A_INT32    tx_unicast_rate;
+}POSTPACK tx_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32   rx_packets;
+    A_UINT32   rx_bytes;
+    A_UINT32   rx_unicast_pkts;
+    A_UINT32   rx_unicast_bytes;
+    A_UINT32   rx_multicast_pkts;
+    A_UINT32   rx_multicast_bytes;
+    A_UINT32   rx_broadcast_pkts;
+    A_UINT32   rx_broadcast_bytes;
+    A_UINT32   rx_fragment_pkt;
+
+    A_UINT32   rx_errors;
+    A_UINT32   rx_crcerr;
+    A_UINT32   rx_key_cache_miss;
+    A_UINT32   rx_decrypt_err;
+    A_UINT32   rx_duplicate_frames;
+    A_INT32    rx_unicast_rate;
+}POSTPACK rx_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32   tkip_local_mic_failure;
+    A_UINT32   tkip_counter_measures_invoked;
+    A_UINT32   tkip_replays;
+    A_UINT32   tkip_format_errors;
+    A_UINT32   ccmp_format_errors;
+    A_UINT32   ccmp_replays;
+}POSTPACK tkip_ccmp_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32   power_save_failure_cnt;
+    A_UINT16   stop_tx_failure_cnt;
+    A_UINT16   atim_tx_failure_cnt;
+    A_UINT16   atim_rx_failure_cnt;
+    A_UINT16   bcn_rx_failure_cnt;
+}POSTPACK pm_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32    cs_bmiss_cnt;
+    A_UINT32    cs_lowRssi_cnt;
+    A_UINT16    cs_connect_cnt;
+    A_UINT16    cs_disconnect_cnt;
+    A_INT16     cs_aveBeacon_rssi;
+    A_UINT16    cs_roam_count;
+    A_INT16     cs_rssi;
+    A_UINT8     cs_snr;
+    A_UINT8     cs_aveBeacon_snr;
+    A_UINT8     cs_lastRoam_msec;
+} POSTPACK cserv_stats_t;
+
+typedef PREPACK struct {
+    tx_stats_t          tx_stats;
+    rx_stats_t          rx_stats;
+    tkip_ccmp_stats_t   tkipCcmpStats;
+}POSTPACK wlan_net_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32    arp_received;
+    A_UINT32    arp_matched;
+    A_UINT32    arp_replied;
+} POSTPACK arp_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32    wow_num_pkts_dropped;
+    A_UINT16    wow_num_events_discarded;
+    A_UINT8     wow_num_host_pkt_wakeups;
+    A_UINT8     wow_num_host_event_wakeups;
+} POSTPACK wlan_wow_stats_t;
+
+typedef PREPACK struct {
+    A_UINT32            lqVal;
+    A_INT32             noise_floor_calibation;
+    pm_stats_t          pmStats;
+    wlan_net_stats_t    txrxStats;
+    wlan_wow_stats_t    wowStats;
+    arp_stats_t         arpStats;
+    cserv_stats_t       cservStats;
+} POSTPACK WMI_TARGET_STATS;
+
+/*
+ * WMI_RSSI_THRESHOLD_EVENTID.
+ * Indicate the RSSI events to host. Events are indicated when we breach a
+ * thresold value.
+ */
+typedef enum{
+    WMI_RSSI_THRESHOLD1_ABOVE = 0,
+    WMI_RSSI_THRESHOLD2_ABOVE,
+    WMI_RSSI_THRESHOLD3_ABOVE,
+    WMI_RSSI_THRESHOLD4_ABOVE,
+    WMI_RSSI_THRESHOLD5_ABOVE,
+    WMI_RSSI_THRESHOLD6_ABOVE,
+    WMI_RSSI_THRESHOLD1_BELOW,
+    WMI_RSSI_THRESHOLD2_BELOW,
+    WMI_RSSI_THRESHOLD3_BELOW,
+    WMI_RSSI_THRESHOLD4_BELOW,
+    WMI_RSSI_THRESHOLD5_BELOW,
+    WMI_RSSI_THRESHOLD6_BELOW
+}WMI_RSSI_THRESHOLD_VAL;
+
+typedef PREPACK struct {
+    A_INT16 rssi;
+    A_UINT8 range;
+}POSTPACK WMI_RSSI_THRESHOLD_EVENT;
+
+/*
+ *  WMI_ERROR_REPORT_EVENTID
+ */
+typedef enum{
+    WMI_TARGET_PM_ERR_FAIL      = 0x00000001,
+    WMI_TARGET_KEY_NOT_FOUND    = 0x00000002,
+    WMI_TARGET_DECRYPTION_ERR   = 0x00000004,
+    WMI_TARGET_BMISS            = 0x00000008,
+    WMI_PSDISABLE_NODE_JOIN     = 0x00000010,
+    WMI_TARGET_COM_ERR          = 0x00000020,
+    WMI_TARGET_FATAL_ERR        = 0x00000040,
+    WMI_TARGET_BCN_FOUND        = 0x00000080
+} WMI_TARGET_ERROR_VAL;
+
+typedef PREPACK struct {
+    A_UINT32 errorVal;
+}POSTPACK  WMI_TARGET_ERROR_REPORT_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8 retrys;
+}POSTPACK  WMI_TX_RETRY_ERR_EVENT;
+
+typedef enum{
+    WMI_SNR_THRESHOLD1_ABOVE = 1,
+    WMI_SNR_THRESHOLD1_BELOW,
+    WMI_SNR_THRESHOLD2_ABOVE,
+    WMI_SNR_THRESHOLD2_BELOW,
+    WMI_SNR_THRESHOLD3_ABOVE,
+    WMI_SNR_THRESHOLD3_BELOW,
+    WMI_SNR_THRESHOLD4_ABOVE,
+    WMI_SNR_THRESHOLD4_BELOW
+} WMI_SNR_THRESHOLD_VAL;
+
+typedef PREPACK struct {
+    A_UINT8 range;  /* WMI_SNR_THRESHOLD_VAL */
+    A_UINT8 snr;
+}POSTPACK  WMI_SNR_THRESHOLD_EVENT;
+
+typedef enum{
+    WMI_LQ_THRESHOLD1_ABOVE = 1,
+    WMI_LQ_THRESHOLD1_BELOW,
+    WMI_LQ_THRESHOLD2_ABOVE,
+    WMI_LQ_THRESHOLD2_BELOW,
+    WMI_LQ_THRESHOLD3_ABOVE,
+    WMI_LQ_THRESHOLD3_BELOW,
+    WMI_LQ_THRESHOLD4_ABOVE,
+    WMI_LQ_THRESHOLD4_BELOW
+} WMI_LQ_THRESHOLD_VAL;
+
+typedef PREPACK struct {
+    A_INT32 lq;
+    A_UINT8 range;  /* WMI_LQ_THRESHOLD_VAL */
+}POSTPACK  WMI_LQ_THRESHOLD_EVENT;
+/*
+ * WMI_REPORT_ROAM_TBL_EVENTID
+ */
+#define MAX_ROAM_TBL_CAND   5
+
+typedef PREPACK struct {
+    A_INT32 roam_util;
+    A_UINT8 bssid[ATH_MAC_LEN];
+    A_INT8  rssi;
+    A_INT8  rssidt;
+    A_INT8  last_rssi;
+    A_INT8  util;
+    A_INT8  bias;
+    A_UINT8 reserved; /* For alignment */
+} POSTPACK WMI_BSS_ROAM_INFO;
+
+
+typedef PREPACK struct {
+    A_UINT16  roamMode;
+    A_UINT16  numEntries;
+    WMI_BSS_ROAM_INFO bssRoamInfo[1];
+} POSTPACK WMI_TARGET_ROAM_TBL;
+
+/*
+ * WMI_HCI_EVENT_EVENTID
+ */
+typedef PREPACK struct {
+    A_UINT16    evt_buf_sz;     /* HCI event buffer size */
+    A_UINT8     buf[1];         /* HCI  event */
+} POSTPACK WMI_HCI_EVENT;
+
+/*
+ *  WMI_CAC_EVENTID
+ */
+typedef enum {
+    CAC_INDICATION_ADMISSION = 0x00,
+    CAC_INDICATION_ADMISSION_RESP = 0x01,
+    CAC_INDICATION_DELETE = 0x02,
+    CAC_INDICATION_NO_RESP = 0x03,
+}CAC_INDICATION;
+
+#define WMM_TSPEC_IE_LEN   63
+
+typedef PREPACK struct {
+    A_UINT8 ac;
+    A_UINT8 cac_indication;
+    A_UINT8 statusCode;
+    A_UINT8 tspecSuggestion[WMM_TSPEC_IE_LEN];
+}POSTPACK  WMI_CAC_EVENT;
+
+/*
+ * WMI_APLIST_EVENTID
+ */
+
+typedef enum {
+    APLIST_VER1 = 1,
+} APLIST_VER;
+
+typedef PREPACK struct {
+    A_UINT8     bssid[ATH_MAC_LEN];
+    A_UINT16    channel;
+} POSTPACK  WMI_AP_INFO_V1;
+
+typedef PREPACK union {
+    WMI_AP_INFO_V1  apInfoV1;
+} POSTPACK WMI_AP_INFO;
+
+typedef PREPACK struct {
+    A_UINT8     apListVer;
+    A_UINT8     numAP;
+    WMI_AP_INFO apList[1];
+} POSTPACK WMI_APLIST_EVENT;
+
+/*
+ * developer commands
+ */
+
+/*
+ * WMI_SET_BITRATE_CMDID
+ *
+ * Get bit rate cmd uses same definition as set bit rate cmd
+ *
+ */
+typedef enum {
+    RATE_AUTO   = -1,
+     AR6003_RATE_1Mb       = 0,
+     AR6003_RATE_2Mb       = 1,
+     AR6003_RATE_5_5Mb     = 2,
+     AR6003_RATE_11Mb      = 3,
+     AR6003_RATE_6Mb       = 4,
+     AR6003_RATE_9Mb       = 5,
+     AR6003_RATE_12Mb      = 6,
+     AR6003_RATE_18Mb      = 7,
+     AR6003_RATE_24Mb      = 8,
+     AR6003_RATE_36Mb      = 9,
+     AR6003_RATE_48Mb      = 10,
+     AR6003_RATE_54Mb      = 11,
+     AR6003_RATE_MCS_0_20  = 12,
+     AR6003_RATE_MCS_1_20  = 13,
+     AR6003_RATE_MCS_2_20  = 14,
+     AR6003_RATE_MCS_3_20  = 15,
+     AR6003_RATE_MCS_4_20  = 16,
+     AR6003_RATE_MCS_5_20  = 17,
+     AR6003_RATE_MCS_6_20  = 18,
+     AR6003_RATE_MCS_7_20  = 19,
+     AR6003_RATE_MCS_0_40  = 20,
+     AR6003_RATE_MCS_1_40  = 21,
+     AR6003_RATE_MCS_2_40  = 22,
+     AR6003_RATE_MCS_3_40  = 23,
+     AR6003_RATE_MCS_4_40  = 24,
+     AR6003_RATE_MCS_5_40  = 25,
+     AR6003_RATE_MCS_6_40  = 26,
+     AR6003_RATE_MCS_7_40  = 27,
+     AR6003_RATE_MAX,
+
+     AR6004_RATE_1Mb       = 0,
+     AR6004_RATE_2Mb       = 1,
+     AR6004_RATE_5_5Mb     = 2,
+     AR6004_RATE_11Mb      = 3,
+     AR6004_RATE_6Mb       = 4,
+     AR6004_RATE_9Mb       = 5,
+     AR6004_RATE_12Mb      = 6,
+     AR6004_RATE_18Mb      = 7,
+     AR6004_RATE_24Mb      = 8,
+     AR6004_RATE_36Mb      = 9,
+     AR6004_RATE_48Mb      = 10,
+     AR6004_RATE_54Mb      = 11,
+     AR6004_RATE_MCS_0_20  = 12,
+     AR6004_RATE_MCS_1_20  = 13,
+     AR6004_RATE_MCS_2_20  = 14,
+     AR6004_RATE_MCS_3_20  = 15,
+     AR6004_RATE_MCS_4_20  = 16,
+     AR6004_RATE_MCS_5_20  = 17,
+     AR6004_RATE_MCS_6_20  = 18,
+     AR6004_RATE_MCS_7_20  = 19,
+     AR6004_RATE_MCS_8_20  = 20,
+     AR6004_RATE_MCS_9_20  = 21,
+     AR6004_RATE_MCS_10_20 = 22,
+     AR6004_RATE_MCS_11_20 = 23,
+     AR6004_RATE_MCS_12_20 = 24,
+     AR6004_RATE_MCS_13_20 = 25,
+     AR6004_RATE_MCS_14_20 = 26,
+     AR6004_RATE_MCS_15_20 = 27,
+     AR6004_RATE_MCS_0_40  = 28,
+     AR6004_RATE_MCS_1_40  = 29,
+     AR6004_RATE_MCS_2_40  = 30,
+     AR6004_RATE_MCS_3_40  = 31,
+     AR6004_RATE_MCS_4_40  = 32,
+     AR6004_RATE_MCS_5_40  = 33,
+     AR6004_RATE_MCS_6_40  = 34,
+     AR6004_RATE_MCS_7_40  = 35,
+     AR6004_RATE_MCS_8_40  = 36,
+     AR6004_RATE_MCS_9_40  = 37,
+     AR6004_RATE_MCS_10_40 = 38,
+     AR6004_RATE_MCS_11_40 = 39,
+     AR6004_RATE_MCS_12_40 = 40,
+     AR6004_RATE_MCS_13_40 = 41,
+     AR6004_RATE_MCS_14_40 = 42,
+     AR6004_RATE_MCS_15_40 = 43,
+     AR6004_RATE_MAX,
+} WMI_BIT_RATE;
+
+typedef PREPACK struct {
+    A_INT8      rateIndex;          /* see WMI_BIT_RATE */
+    A_INT8      mgmtRateIndex;
+    A_INT8      ctlRateIndex;
+} POSTPACK WMI_BIT_RATE_CMD;
+
+
+typedef PREPACK struct {
+    A_INT8      rateIndex;          /* see WMI_BIT_RATE */
+} POSTPACK  WMI_BIT_RATE_REPLY;
+
+
+/*
+ * WMI_SET_FIXRATES_CMDID
+ *
+ * Get fix rates cmd uses same definition as set fix rates cmd
+ * Fix rate mask is now 64 bit, which is split across two words.
+ * Refer WMI_BIT_RATE for bit position for each rate.
+ */
+#define FIX_RATE_1Mb            ((A_UINT32)0x1)
+#define FIX_RATE_2Mb            ((A_UINT32)0x2)
+#define FIX_RATE_5_5Mb          ((A_UINT32)0x4)
+#define FIX_RATE_11Mb           ((A_UINT32)0x8)
+#define FIX_RATE_6Mb            ((A_UINT32)0x10)
+#define FIX_RATE_9Mb            ((A_UINT32)0x20)
+#define FIX_RATE_12Mb           ((A_UINT32)0x40)
+#define FIX_RATE_18Mb           ((A_UINT32)0x80)
+#define FIX_RATE_24Mb           ((A_UINT32)0x100)
+#define FIX_RATE_36Mb           ((A_UINT32)0x200)
+#define FIX_RATE_48Mb           ((A_UINT32)0x400)
+#define FIX_RATE_54Mb           ((A_UINT32)0x800)
+
+typedef PREPACK struct {
+    A_UINT32      fixRateMask[WMI_MAX_RATE_MASK];          /* see WMI_BIT_RATE */
+} POSTPACK WMI_FIX_RATES_CMD, WMI_FIX_RATES_REPLY;
+
+typedef PREPACK struct {
+    A_UINT8      bEnableMask;
+    A_UINT8      frameType;              /* type and subtype */
+    A_UINT8      reserved[2];            /* for alignment    */
+    A_UINT32     frameRateMask[WMI_MAX_RATE_MASK];          /* see WMI_BIT_RATE */
+} POSTPACK WMI_FRAME_RATES_CMD, WMI_FRAME_RATES_REPLY;
+
+/*
+ * WMI_SET_RECONNECT_AUTH_MODE_CMDID
+ *
+ * Set authentication mode
+ */
+typedef enum {
+    RECONN_DO_AUTH = 0x00,
+    RECONN_NOT_AUTH = 0x01
+} WMI_AUTH_MODE;
+
+typedef PREPACK struct {
+    A_UINT8 mode;
+} POSTPACK WMI_SET_AUTH_MODE_CMD;
+
+/*
+ * WMI_SET_REASSOC_MODE_CMDID
+ *
+ * Set authentication mode
+ */
+typedef enum {
+    REASSOC_DO_DISASSOC = 0x00,
+    REASSOC_DONOT_DISASSOC = 0x01
+} WMI_REASSOC_MODE;
+
+typedef PREPACK struct {
+    A_UINT8 mode;
+}POSTPACK WMI_SET_REASSOC_MODE_CMD;
+
+typedef enum {
+    ROAM_DATA_TIME = 1,            /* Get The Roam Time Data */
+} ROAM_DATA_TYPE;
+
+typedef PREPACK struct {
+    A_UINT32        disassoc_time;
+    A_UINT32        no_txrx_time;
+    A_UINT32        assoc_time;
+    A_UINT32        allow_txrx_time;
+    A_UINT8         disassoc_bssid[ATH_MAC_LEN];
+    A_INT8          disassoc_bss_rssi;
+    A_UINT8         assoc_bssid[ATH_MAC_LEN];
+    A_INT8          assoc_bss_rssi;
+} POSTPACK WMI_TARGET_ROAM_TIME;
+
+typedef PREPACK struct {
+    PREPACK union {
+        WMI_TARGET_ROAM_TIME roamTime;
+    } POSTPACK u;
+    A_UINT8 roamDataType ;
+} POSTPACK WMI_TARGET_ROAM_DATA;
+
+typedef enum {
+    WMI_WMM_DISABLED = 0,
+    WMI_WMM_ENABLED
+} WMI_WMM_STATUS;
+
+typedef PREPACK struct {
+    A_UINT8    status;
+}POSTPACK WMI_SET_WMM_CMD;
+
+typedef PREPACK struct {
+    A_UINT8    status;
+}POSTPACK WMI_SET_QOS_SUPP_CMD;
+
+typedef enum {
+    WMI_TXOP_DISABLED = 0,
+    WMI_TXOP_ENABLED
+} WMI_TXOP_CFG;
+
+typedef PREPACK struct {
+    A_UINT8    txopEnable;
+}POSTPACK WMI_SET_WMM_TXOP_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 keepaliveInterval;
+} POSTPACK WMI_SET_KEEPALIVE_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 keepaliveInterval;
+    A_UINT8 keepaliveMode;
+    A_UINT8 reserved[2];
+    A_UINT32 keepalive_arp_srcip;
+    A_UINT32 keepalive_arp_tgtip;
+    A_UINT8 peer_mac_address[6];
+} POSTPACK WMI_SET_KEEPALIVE_CMD_EXT;
+
+
+typedef PREPACK struct {
+    A_BOOL configured;
+    A_UINT8 keepaliveInterval;
+} POSTPACK WMI_GET_KEEPALIVE_CMD;
+
+/*
+ * Add Application specified IE to a management frame
+ */
+#define WMI_MAX_IE_LEN  255
+
+typedef PREPACK struct {
+    A_UINT8 mgmtFrmType;  /* one of WMI_MGMT_FRAME_TYPE */
+    A_UINT8 ieLen;    /* Length  of the IE that should be added to the MGMT frame */
+    A_UINT8 ieInfo[1];
+} POSTPACK WMI_SET_APPIE_CMD;
+
+/*
+ * Notify the WSC registration status to the target
+ */
+#define WSC_REG_ACTIVE     1
+#define WSC_REG_INACTIVE   0
+/* Generic Hal Interface for setting hal paramters. */
+/* Add new Set HAL Param cmdIds here for newer params */
+typedef enum {
+   WHAL_SETCABTO_CMDID = 1,
+}WHAL_CMDID;
+
+typedef PREPACK struct {
+    A_UINT8 cabTimeOut;
+} POSTPACK WHAL_SETCABTO_PARAM;
+
+typedef PREPACK struct {
+    A_UINT8  whalCmdId;
+    A_UINT8 data[1];
+} POSTPACK WHAL_PARAMCMD;
+
+
+#define WOW_MAX_FILTER_LISTS 1 /*4*/
+#define WOW_MAX_FILTERS_PER_LIST 4
+#define WOW_PATTERN_SIZE 64
+#define WOW_MASK_SIZE 64
+
+#define MAC_MAX_FILTERS_PER_LIST 7
+
+typedef PREPACK struct {
+    A_UINT8 wow_valid_filter;
+    A_UINT8 wow_filter_id;
+    A_UINT8 wow_filter_size;
+    A_UINT8 wow_filter_offset;
+    A_UINT8 wow_filter_mask[WOW_MASK_SIZE];
+    A_UINT8 wow_filter_pattern[WOW_PATTERN_SIZE];
+} POSTPACK WOW_FILTER;
+
+
+typedef PREPACK struct {
+    A_UINT8 wow_valid_list;
+    A_UINT8 wow_list_id;
+    A_UINT8 wow_num_filters;
+    A_UINT8 wow_total_list_size;
+    WOW_FILTER list[WOW_MAX_FILTERS_PER_LIST];
+} POSTPACK WOW_FILTER_LIST;
+
+typedef PREPACK struct {
+    A_UINT8 valid_filter;
+    A_UINT8 mac_addr[ATH_MAC_LEN];
+} POSTPACK MAC_FILTER;
+
+
+typedef PREPACK struct {
+    A_UINT8 total_list_size;
+    A_UINT8 enable;
+    MAC_FILTER list[MAC_MAX_FILTERS_PER_LIST];
+} POSTPACK MAC_FILTER_LIST;
+
+#define MAX_IP_ADDRS  2
+typedef PREPACK struct {
+    A_UINT32 ips[MAX_IP_ADDRS];  /* IP in Network Byte Order */
+} POSTPACK WMI_SET_IP_CMD;
+
+typedef PREPACK struct {
+    A_BOOL awake;
+    A_BOOL asleep;
+} POSTPACK WMI_SET_HOST_SLEEP_MODE_CMD;
+
+typedef A_UINT32 WMI_WOW_FILTER;
+
+    /* bit positions for filter options */
+#define  WOW_FILTER_UNUSED          0
+#define  WOW_FILTER_SSID            1   /* wake up on probed SSID (legacy definition) */
+    /* the following filter options are available if the WOW extensions are installed in the target
+     * otherwise the feature setting has no effect  */
+
+#define WOW_FILTER_OPTION_MASK(option)  (1 << (option))
+#define WOW_FILTER_OPTION_MAGIC_PACKET  WOW_FILTER_OPTION_MASK(2)
+#define WOW_FILTER_OPTION_EAP_REQ       WOW_FILTER_OPTION_MASK(3)
+#define WOW_FILTER_OPTION_PATTERNS      WOW_FILTER_OPTION_MASK(4)
+#define WOW_FILTER_OPTION_OFFLOAD_ARP   WOW_FILTER_OPTION_MASK(5)
+#define WOW_FILTER_OPTION_OFFLOAD_NS    WOW_FILTER_OPTION_MASK(6)
+#define WOW_FILTER_OPTION_OFFLOAD_GTK   WOW_FILTER_OPTION_MASK(7)
+#define WOW_FILTER_OPTION_8021X_4WAYHS  WOW_FILTER_OPTION_MASK(8)
+#define WOW_FILTER_OPTION_NLO_DISCVRY   WOW_FILTER_OPTION_MASK(9)
+#define WOW_FILTER_OPTION_NWK_DISASSOC  WOW_FILTER_OPTION_MASK(10)
+#define WOW_FILTER_OPTION_GTK_ERROR     WOW_FILTER_OPTION_MASK(11)
+
+#define WOW_FILTER_OPTION_TEST_MODE     WOW_FILTER_OPTION_MASK(15)
+
+
+typedef PREPACK struct {
+    A_BOOL enable_wow;
+    WMI_WOW_FILTER filter;
+    A_UINT16 hostReqDelay;
+} POSTPACK WMI_SET_WOW_MODE_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 filter_list_id;
+} POSTPACK WMI_GET_WOW_LIST_CMD;
+
+/*
+ * WMI_GET_WOW_LIST_CMD reply
+ */
+typedef PREPACK struct {
+    A_UINT8     num_filters;     /* number of patterns in reply */
+    A_UINT8     this_filter_num; /*  this is filter # x of total num_filters */
+    A_UINT8     wow_mode;
+    A_UINT8     host_mode;
+    WOW_FILTER  wow_filters[1];
+} POSTPACK WMI_GET_WOW_LIST_REPLY;
+
+typedef PREPACK struct {
+    A_UINT8 filter_list_id;
+    A_UINT8 filter_size;
+    A_UINT8 filter_offset;
+    A_UINT8 filter[1];
+} POSTPACK WMI_ADD_WOW_PATTERN_CMD;
+
+typedef PREPACK struct {
+    A_UINT16 filter_list_id;
+    A_UINT16 filter_id;
+} POSTPACK WMI_DEL_WOW_PATTERN_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 macaddr[ATH_MAC_LEN];
+} POSTPACK WMI_SET_MAC_ADDRESS_CMD;
+
+/* WMI_SET_TXE_NOTIFY_CMDID */
+typedef PREPACK struct {
+        A_UINT32 rate;
+        A_UINT32 pkts;
+        A_UINT32 intvl;
+} POSTPACK WMI_SET_TXE_NOTIFY_CMD;
+
+
+/*
+ * WMI_SET_AKMP_PARAMS_CMD
+ */
+
+#define WMI_AKMP_MULTI_PMKID_EN   0x000001
+
+typedef PREPACK struct {
+    A_UINT32    akmpInfo;
+} POSTPACK WMI_SET_AKMP_PARAMS_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 pmkid[WMI_PMKID_LEN];
+} POSTPACK WMI_PMKID;
+
+/*
+ * WMI_SET_PMKID_LIST_CMD
+ */
+#define WMI_MAX_PMKID_CACHE   8
+
+typedef PREPACK struct {
+    A_UINT32    numPMKID;
+    WMI_PMKID   pmkidList[WMI_MAX_PMKID_CACHE];
+} POSTPACK WMI_SET_PMKID_LIST_CMD;
+
+/*
+ * WMI_GET_PMKID_LIST_CMD  Reply
+ * Following the Number of PMKIDs is the list of PMKIDs
+ */
+typedef PREPACK struct {
+    A_UINT32    numPMKID;
+    A_UINT8     bssidList[ATH_MAC_LEN][1];
+    WMI_PMKID   pmkidList[1];
+} POSTPACK WMI_PMKID_LIST_REPLY;
+
+typedef PREPACK struct {
+    A_UINT16 oldChannel;
+    A_UINT32 newChannel;
+} POSTPACK WMI_CHANNEL_CHANGE_EVENT;
+
+typedef PREPACK struct {
+    A_UINT32 version;
+} POSTPACK WMI_WLAN_VERSION_EVENT;
+
+
+/* WMI_ADDBA_REQ_EVENTID */
+typedef PREPACK struct {
+    A_UINT8     tid;
+    A_UINT8     win_sz;
+    A_UINT16    st_seq_no;
+    A_UINT8     status;         /* f/w response for ADDBA Req; OK(0) or failure(!=0) */
+} POSTPACK WMI_ADDBA_REQ_EVENT;
+
+/* WMI_ADDBA_RESP_EVENTID */
+typedef PREPACK struct {
+    A_UINT8     tid;
+    A_UINT8     status;         /* OK(0), failure (!=0) */
+    A_UINT16    amsdu_sz;       /* Three values: Not supported(0), 3839, 8k */
+} POSTPACK WMI_ADDBA_RESP_EVENT;
+
+/* WMI_DELBA_EVENTID
+ * f/w received a DELBA for peer and processed it.
+ * Host is notified of this
+ */
+typedef PREPACK struct {
+    A_UINT8     tid;
+    A_UINT8     is_peer_initiator;
+    A_UINT16    reason_code;
+} POSTPACK WMI_DELBA_EVENT;
+
+
+#ifdef WAPI_ENABLE
+#define WAPI_REKEY_UCAST    1
+#define WAPI_REKEY_MCAST    2
+typedef PREPACK struct {
+    A_UINT8     type;
+    A_UINT8     macAddr[ATH_MAC_LEN];
+} POSTPACK WMI_WAPIREKEY_EVENT;
+#endif
+
+
+/* WMI_ALLOW_AGGR_CMDID
+ * Configures tid's to allow ADDBA negotiations
+ * on each tid, in each direction
+ */
+typedef PREPACK struct {
+    A_UINT16    tx_allow_aggr;  /* 16-bit mask to allow uplink ADDBA negotiation - bit position indicates tid*/
+    A_UINT16    rx_allow_aggr;  /* 16-bit mask to allow donwlink ADDBA negotiation - bit position indicates tid*/
+} POSTPACK WMI_ALLOW_AGGR_CMD;
+
+/* WMI_ADDBA_REQ_CMDID
+ * f/w starts performing ADDBA negotiations with peer
+ * on the given tid
+ */
+typedef PREPACK struct {
+    A_UINT8     tid;
+} POSTPACK WMI_ADDBA_REQ_CMD;
+
+/* WMI_DELBA_REQ_CMDID
+ * f/w would teardown BA with peer.
+ * is_send_initiator indicates if it's or tx or rx side
+ */
+typedef PREPACK struct {
+    A_UINT8     tid;
+    A_UINT8     is_sender_initiator;
+
+} POSTPACK WMI_DELBA_REQ_CMD;
+
+#define PEER_NODE_JOIN_EVENT 0x00
+#define PEER_NODE_LEAVE_EVENT 0x01
+#define PEER_FIRST_NODE_JOIN_EVENT 0x10
+#define PEER_LAST_NODE_LEAVE_EVENT 0x11
+typedef PREPACK struct {
+    A_UINT8 eventCode;
+    A_UINT8 peerMacAddr[ATH_MAC_LEN];
+} POSTPACK WMI_PEER_NODE_EVENT;
+
+#define IEEE80211_FRAME_TYPE_MGT          0x00
+#define IEEE80211_FRAME_TYPE_CTL          0x04
+
+typedef PREPACK struct {
+    A_UINT32    rules; /* combination of WMI_WRT_... values */
+} POSTPACK WMI_CONFIG_TX_MAC_RULES_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 enable;     /* 1 == device operates in promiscuous mode , 0 == normal mode <default> */
+} POSTPACK WMI_SET_PROMISCUOUS_MODE_CMD;
+
+
+/*RFKILL Related Data Structures*/
+typedef enum {
+    RADIO_STATE_OFF     = 0x1,
+    RADIO_STATE_ON      = 0x2,
+    RADIO_STATE_INVALID = 0xFF
+}RFKILL_RADIO_STATE;
+
+typedef PREPACK struct {
+    A_UINT8  GPIOPinNumber;
+    A_UINT8  IntrType;
+    A_UINT8  RadioState;
+} POSTPACK WMI_RFKILL_MODE_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 FastScanInterval;
+    A_UINT32 FastScanDuration;
+    A_UINT32 SlowScanInterval;
+    A_UINT8  ScanType; //ActiveUseSSID=0, ActiveUseWildCard=1, PassiveScan=2
+    A_UINT8  bStartNetworkListOffload; //TRUE - Use the Probed SSID
+}POSTPACK WMI_NETWORK_LIST_OFFLOAD_CMD;
+
+typedef PREPACK struct {
+   A_UINT8   bProfileMatch;
+   A_UINT8   Index;
+   A_UINT32  nFastScansRemaining;
+}POSTPACK WMI_NETWORK_LIST_OFFLOAD_INFO;
+
+typedef PREPACK struct _WMI_IPV6_ADDR {
+    A_UINT8    address[16];    /* IPV6 in Network Byte Order */
+} POSTPACK WMI_IPV6_ADDR;
+
+#define WMI_MAX_NS_OFFLOADS           2
+#define WMI_MAX_ARP_OFFLOADS          2
+
+#define WMI_ARPOFF_FLAGS_VALID              (1 << 0)    /* the tuple entry is valid */
+#define WMI_ARPOFF_FLAGS_MAC_VALID          (1 << 1)    /* the target mac address is valid */
+#define WMI_ARPOFF_FLAGS_REMOTE_IP_VALID    (1 << 2)    /* remote IP field is valid */
+
+typedef PREPACK struct {
+    A_UINT8           flags;                   /* flags */
+    A_UINT8           target_ipaddr[4];        /* IPV4 addresses of the local node*/
+    A_UINT8           remote_ipaddr[4];        /* source address of the remote node requesting the ARP (qualifier) */
+    A_UINT8           target_mac[ATH_MAC_LEN]; /* mac address for this tuple, if not valid, the local MAC is used */
+} POSTPACK WMI_ARP_OFFLOAD_TUPLE;
+
+#define WMI_NSOFF_FLAGS_VALID           (1 << 0)    /* the tuple entry is valid */
+#define WMI_NSOFF_FLAGS_MAC_VALID       (1 << 1)    /* the target mac address is valid */
+#define WMI_NSOFF_FLAGS_REMOTE_IP_VALID (1 << 2)    /* remote IP field is valid */
+
+#define WMI_NSOFF_MAX_TARGET_IPS    2
+
+typedef PREPACK struct {
+    A_UINT8           flags;                     /* flags */
+    WMI_IPV6_ADDR     target_ipaddr[WMI_NSOFF_MAX_TARGET_IPS]; /* IPV6 target addresses of the local node  */
+    WMI_IPV6_ADDR     solicitation_ipaddr;       /* multi-cast source IP addresses for receiving solicitations */
+    WMI_IPV6_ADDR     remote_ipaddr;             /* address of remote node requesting the solicitation (qualifier) */
+    A_UINT8           target_mac[ATH_MAC_LEN];   /* mac address for this tuple, if not valid, the local MAC is used */
+} POSTPACK WMI_NS_OFFLOAD_TUPLE;
+
+typedef PREPACK struct {
+    A_UINT32                flags;
+    WMI_NS_OFFLOAD_TUPLE    ns_tuples[WMI_MAX_NS_OFFLOADS];
+    WMI_ARP_OFFLOAD_TUPLE   arp_tuples[WMI_MAX_ARP_OFFLOADS];
+} POSTPACK WMI_SET_ARP_NS_OFFLOAD_CMD;
+
+typedef PREPACK struct {
+    A_UINT8  filter_list_id;
+    A_UINT8  filter_id;
+    A_UINT16 filter_size;
+    A_UINT8  filter_offset;
+    A_UINT8  filter[1];
+} POSTPACK WMI_ADD_WOW_EXT_PATTERN_CMD;
+
+    /* WOW extension for larger filter patterns, note these settings are only
+     * valid if the WOW extension is installed in the target
+     * When using the WOW extensions, the use of WMI_GET_WOW_LIST_REPLY will return an empty
+     * WOW_FILTER structure.  In WOW extended mode, the host is expected to track what filters
+     * are installed in the target. */
+#define WOW_EXT_DEF_FILTER_LISTS        1
+#define WOW_EXT_DEF_FILTERS_PER_LIST    16
+#define WOW_EXT_DEF_PATTERN_SIZE        136     /* typical pattern size (128 byte DIX + SNAPLLC) */
+#define WOW_EXT_FILTER_ID_CLEAR_ALL     0xFFFF  /* use this ID in WMI_DEL_WOW_PATTERN, to clear all patterns */
+
+#define WOW_EXT_MAX_PATTERN_LEN_SIZE    2040  /* absolute max limit on pattern */
+
+    /* compute mask size based on pattern size */
+#define WOW_EXT_COMPUTE_MASK_SIZE(msize,psize) \
+{                                              \
+    *(msize) = ((A_UINT32)psize)/8;            \
+    if (((A_UINT32)psize) % 8) {(*(msize))++;} \
+}
+
+    /* variable length event providing wake event information. Wake events can be
+     * the result of wake-packets, network events or other miscellaneous wake causes.
+     *
+     * NOTE: a WMI data header flag is not sufficient to use as WMI also forwards
+     * A-MSDU aggregates. The wake event indicates which frame caused the wake which could
+     * be embedded in an A-MSDU frame */
+typedef enum {
+    WOW_EXT_WAKE_TYPE_UNDEF = 0,
+    WOW_EXT_WAKE_TYPE_MAGIC  = 1,    /* magic, value = N/A, wake_data = copy of wake packet */
+    WOW_EXT_WAKE_TYPE_PATTERN = 2,   /* bitmap pattern, value = filter index, wake_data = copy of wake packet */
+    WOW_EXT_WAKE_TYPE_EAPREQ = 3,    /* eap request value = N/A, wake_data = copy of wake packet */
+    WOW_EXT_WAKE_TYPE_4WAYHS,        /* 802.1X 4-wake handshake request caused wakeup, wake_data - copy of packet */
+    WOW_EXT_WAKE_TYPE_NETWORK_NLO,            /* network list offload match */
+    WOW_EXT_WAKE_TYPE_NETWORK_DISASSOC,       /* network association loss */
+    WOW_EXT_WAKE_TYPE_NETWORK_GTK_OFFL_ERROR, /* if GTK refresh is enabled, a failure generates a wake event */
+    WOW_EXT_WAKE_TYPE_MAX
+} WOW_EXT_WAKE_TYPE;
+
+typedef PREPACK struct {
+    A_UINT16    flags;                /* flags, currently reserved */
+    A_UINT8     type;                 /* type of packet that caused the wake event */
+    A_UINT8     value;                /* optional value depending on type (see above) */
+    A_UINT16    packet_length;        /* if type is a wake packet, then this is the original length */
+    A_UINT16    wake_data_length;     /* copy length of wake packet data to follow */
+    A_UINT8     wake_data[1];         /* start of wake data*/
+} POSTPACK WMI_WOW_EXT_WAKE_EVENT;
+
+#define WMI_WOW_EXT_WAKE_MAX_DATA_LENGTH  128
+
+#define GTK_OFFLOAD_REPLAY_COUNTER_BYTES  8
+
+#define WMI_GTK_OFFLOAD_STATUS_FLAGS_RUNNING (1 << 0)  /* GTK offload is running*/
+
+
+#define GTK_OFFLOAD_KEK_BYTES       16
+#define GTK_OFFLOAD_KCK_BYTES       16
+#define GTK_REPLAY_COUNTER_BYTES    8
+
+typedef PREPACK struct {
+    A_UINT32    flags;          /* status flags */
+    A_UINT32    refresh_cnt;    /* number of successful GTK refresh exchanges since last SET operation */
+    A_UINT8     replay_counter[GTK_REPLAY_COUNTER_BYTES]; /* current replay counter */
+} POSTPACK  WMI_GTK_OFFLOAD_STATUS_EVENT;
+
+#define WMI_GTK_OFFLOAD_OPCODE_SET     1  /* set offload parameters, KEK,KCK and replay counter values are valid */
+#define WMI_GTK_OFFLOAD_OPCODE_CLEAR   2  /* clear offload parameters */
+#define WMI_GTK_OFFLOAD_OPCODE_STATUS  3  /* get status, generates WMI_GTK_OFFLOAD_STATUS_EVENT  */
+
+ /* structure to issue GTK offload opcode to set/clear or fetch status
+  * NOTE: offload is enabled when WOW options are enabled, see WOW_FILTER_OPTION_OFFLOAD_GTK */
+typedef PREPACK struct {
+    A_UINT32    flags;                          /* control flags */
+    A_UINT8     opcode;                         /* opcode */
+    A_UINT8     KEK[GTK_OFFLOAD_KEK_BYTES];     /* key encryption key */
+    A_UINT8     KCK[GTK_OFFLOAD_KCK_BYTES];     /* key confirmation key */
+    A_UINT8     replay_counter[GTK_REPLAY_COUNTER_BYTES];  /* replay counter for re-key */
+} POSTPACK  WMI_GTK_OFFLOAD_OP;
+
+
+#define WMI_RX_FILTER_DEFAULT_MAX_TESTS_PER_FILTER  5   
+#define WMI_RX_FILTER_DEFAULT_MAX_FILTERS           10
+
+   /* note the max pattern length was selected to balance size and usefulness.  Header
+     * filtering is sized to support IPV6 addresses (16 octets using 2 entries) 
+     * and MAC addresses (6 octets) */
+#define RX_FILTER_FRAME_TEST_MAX_PATTERN_LEN    8 
+
+typedef enum {
+    WMI_RX_FILTER_PACKET_TYPE_NOT_SPEC = 0,    /* not specified */
+    WMI_RX_FILTER_PACKET_TYPE_UNICAST = 1,
+    WMI_RX_FILTER_PACKET_TYPE_MULTICAST = 2,
+    WMI_RX_FILTER_PACKET_TYPE_BROADCAST = 3,
+    WMI_RX_FILTER_PACKET_TYPE_MAX      
+} WMI_RX_FILTER_PACKET_TYPE;
+
+#define RX_FILTER_FRAME_TEST_FLAGS_EQUALITY     (1 << 0) /* equality test, otherwise !=  */
+#define RX_FILTER_FRAME_TEST_FLAGS_MASK         (1 << 1) /* mask test */
+#define RX_FILTER_FRAME_TEST_FLAGS_TYPE_CHECK   (1 << 2) /* this entry is a packet type check place holder */
+
+/* testing a frame requires an offset, equality flag, an ANDing mask array and a check bytes array.
+ * This provides the flexibity to test a frame for a desired result using the following combinations:
+ * 
+ *    frame[offset] AND mask[] == check[]
+ *    frame[offset] AND mask[] != check[]
+ *    frame[offset] == check[] 
+ *    frame[offset] != check[] 
+ * 
+ */
+typedef PREPACK struct {
+    A_UINT8     flags;     /* frame test flags */
+    union {
+        A_UINT8  offset;   /* relative offset from this layer's header */
+        A_UINT8  type;     /* if flags indicate a type-check, this value is WMI_RX_FILTER_PACKET_TYPE */
+    } option;              /* additional test options depending on flags setting */
+    A_UINT8     length;    /* number of bytes to test */
+    A_UINT8     rsvd0;     /* reserved for target use */
+    A_UINT8     mask[RX_FILTER_FRAME_TEST_MAX_PATTERN_LEN];   /* AND mask to apply to each frame byte */
+    A_UINT8     check[RX_FILTER_FRAME_TEST_MAX_PATTERN_LEN];  /* check bytes */     
+} POSTPACK WMI_RX_FILTER_FRAME_TEST;
+
+typedef PREPACK struct {
+    A_UINT8                  index;             /* index for this entry */
+    A_UINT8                  reserved[3];       /* padding and future use */
+    WMI_RX_FILTER_FRAME_TEST frame_test;        /* frame test information for this entry */
+} POSTPACK WMI_RX_FILTER_SET_FRAME_TEST;
+
+    /* structure for WMI_RX_FILTER_SET_FRAME_TEST_LIST_CMDID */
+typedef PREPACK struct {
+    A_UINT8                       num_entries;            /* number of entries to follow */
+    A_UINT8                       reserved[3];            /* padding and future use */
+    WMI_RX_FILTER_SET_FRAME_TEST  frame_test_entries[1];  /* start of frame test entries */
+} POSTPACK WMI_RX_FILTER_SET_FRAME_TEST_LIST;
+
+typedef enum {
+    WMI_RX_FILTER_FRAME_HDR_TEST_MAC = 0,      /* testing MAC fields */
+    WMI_RX_FILTER_FRAME_HDR_TEST_SNAP = 1,     /* testing SNAP fields */
+    WMI_RX_FILTER_FRAME_HDR_TEST_ARP = 2,      /* testing ARP fields */
+    WMI_RX_FILTER_FRAME_HDR_TEST_GEN_ETHPROTO, /* testing a generic pattern in ether payload */
+    WMI_RX_FILTER_FRAME_HDR_TEST_IPV4,         /* testing IPV4 fields */
+    WMI_RX_FILTER_FRAME_HDR_TEST_IPV6,         /* testing IPV6 fields */
+    WMI_RX_FILTER_FRAME_HDR_TEST_GEN_IPPROTO,  /* testing a generic pattern in IP payload */
+    WMI_RX_FILTER_FRAME_HDR_TEST_UDP,          /* testing UDP fields */
+    WMI_RX_FILTER_FRAME_HDR_TEST_MAX        
+} WMI_RX_FILTER_FRAME_HDR_TEST_TYPE;
+
+#define MAKE_RX_FILTER_FRAME_HDR_MASK(b) (1 << (b))
+
+#define WMI_RX_FILT_FRAME_HDR_TEST_MAC  \
+        MAKE_RX_FILTER_FRAME_HDR_MASK(WMI_RX_FILTER_FRAME_HDR_TEST_MAC)
+#define WMI_RX_FILT_FRAME_HDR_TEST_SNAP  \
+        MAKE_RX_FILTER_FRAME_HDR_MASK(WMI_RX_FILTER_FRAME_HDR_TEST_SNAP)
+#define WMI_RX_FILT_FRAME_HDR_TEST_ARP  \
+        MAKE_RX_FILTER_FRAME_HDR_MASK(WMI_RX_FILTER_FRAME_HDR_TEST_ARP)
+#define WMI_RX_FILT_FRAME_HDR_TEST_IPV4 \
+        MAKE_RX_FILTER_FRAME_HDR_MASK(WMI_RX_FILTER_FRAME_HDR_TEST_IPV4)
+#define WMI_RX_FILT_FRAME_HDR_TEST_IPV6 \
+        MAKE_RX_FILTER_FRAME_HDR_MASK(WMI_RX_FILTER_FRAME_HDR_TEST_IPV6)
+#define WMI_RX_FILT_FRAME_HDR_TEST_UDP  \
+        MAKE_RX_FILTER_FRAME_HDR_MASK(WMI_RX_FILTER_FRAME_HDR_TEST_UDP)
+
+typedef PREPACK struct  {
+    A_UINT8  type;               /* header test type  (see WMI_RX_FILTER_FRAME_HDR_TEST_TYPE) */
+    A_UINT8  frame_test_index;   /* corresponding frame test */     
+    A_UINT8  reserved[2];        /* padding and future use */           
+} POSTPACK WMI_RX_FILTER_SET_HDR_TEST;
+
+typedef enum {
+    WMI_RX_COALESCE_FILTER_OP_UNDEF = 0,
+    WMI_RX_COALESCE_FILTER_OP_SET = 1,
+    WMI_RX_COALESCE_FILTER_OP_CLEAR = 2,  
+    WMI_RX_COALESCE_FILTER_OP_MAX,
+} WMI_RX_COALESCE_FILTER_OPCODE;
+
+typedef PREPACK struct  {
+    A_UINT8            op_code;              /* op code */
+    A_UINT8            index;                /* filter index  */
+    A_UINT8            reserved[2];          /* padding and future use */
+    union {
+            /* parameters for SET opcode */
+        struct {
+            A_UINT32   coalesc_delay_ms;     /* coalesc delay in milliseconds */      
+            A_UINT8    total_hdr_tests;      /* number of hdr test elements to follow */
+            A_UINT8    reserved[3];          /* padding and future use */
+        } set_filter_params;
+    } params;
+    union {
+            /* data for SET opcode */
+        WMI_RX_FILTER_SET_HDR_TEST  header_tests[1];      /* one or more entries */ 
+    } data;
+} POSTPACK WMI_RX_FILTER_COALESCE_FILTER_OP;
+
+     
+/*
+ * Transmit complete event data structure(s)
+ */
+
+
+typedef PREPACK struct {
+#define TX_COMPLETE_STATUS_SUCCESS 0
+#define TX_COMPLETE_STATUS_RETRIES 1
+#define TX_COMPLETE_STATUS_NOLINK  2
+#define TX_COMPLETE_STATUS_TIMEOUT 3
+#define TX_COMPLETE_STATUS_OTHER   4
+
+    A_UINT8 status; /* one of TX_COMPLETE_STATUS_... */
+    A_UINT8 pktID; /* packet ID to identify parent packet */
+    A_UINT8 rateIdx; /* rate index on successful transmission */
+    A_UINT8 ackFailures; /* number of ACK failures in tx attempt */
+#if 0 /* optional params currently ommitted. */
+    A_UINT32 queueDelay; // usec delay measured Tx Start time - host delivery time
+    A_UINT32 mediaDelay; // usec delay measured ACK rx time - host delivery time
+#endif
+} POSTPACK TX_COMPLETE_MSG_V1; /* version 1 of tx complete msg */
+
+#if defined(EXTENDED_TX_COMPLETE)
+typedef PREPACK struct {
+#define TX_COMPLETE_TYPE_UCAST 0
+#define TX_COMPLETE_TYPE_MGMT  1
+#define TX_COMPLETE_TYPE_MCAST 2
+#define TX_COMPLETE_TYPE_PAL   3
+    A_UINT8 status      : 4, /* one of TX_COMPLETE_STATUS_... */
+            dev_id      : 4;
+    A_UINT8 peer_id;
+    A_UINT8 tid         : 4,
+            pkt_type    : 4; /* 0:unicast data, 1:mgmt&ctrl, 2:multicast data, 3:pal */
+    A_UINT8 packet_id;
+} POSTPACK TX_COMPLETE_MSG_V2; /* version 1 of tx complete msg */
+#endif /* EXTENDED_TX_COMPLETE */
+
+typedef PREPACK struct {
+    A_UINT8 numMessages; /* number of tx comp msgs following this struct */
+    A_UINT8 msgLen; /* length in bytes for each individual msg following this struct */
+    A_UINT8 msgType; /* version of tx complete msg data following this struct */
+    A_UINT8 reserved; /* individual messages follow this header */
+} POSTPACK WMI_TX_COMPLETE_EVENT;
+
+#define WMI_TXCOMPLETE_VERSION_1 (0x01)
+#if defined(EXTENDED_TX_COMPLETE)
+#define WMI_TXCOMPLETE_VERSION_2 (0x02)
+#endif /* EXTENDED_TX_COMPLETE */
+
+
+/*
+ * ------- AP Mode definitions --------------
+ */
+
+/*
+ * !!! Warning !!!
+ * -Changing the following values needs compilation of both driver and firmware
+ */
+#ifdef AR6002_REV2
+#define AP_MAX_NUM_STA          4
+#else
+#define AP_MAX_NUM_STA          10
+#endif
+
+/*Maximum no. of virtual interface supported*/
+#ifdef AR6002_REV64
+#define NUM_DEV     4
+#define NUM_CONN    (AP_MAX_NUM_STA + NUM_DEV - 1) /* As P2P device port won't enter CONN state, so we omit 1 CONN buffer */
+#else
+#define NUM_DEV     3
+#define NUM_CONN    (AP_MAX_NUM_STA + NUM_DEV)
+#endif
+
+#define AP_ACL_SIZE             10
+#define IEEE80211_MAX_IE        256
+#define MCAST_AID               0xFF /* Spl. AID used to set DTIM flag in the beacons */
+#define DEF_AP_COUNTRY_CODE     "US "
+#define DEF_AP_WMODE_G          WMI_11G_MODE
+#define DEF_AP_WMODE_AG         WMI_11AG_MODE
+#define DEF_AP_DTIM             5
+#define DEF_BEACON_INTERVAL     100
+
+/* ACS scan policy */
+#define AP_ACS_NORMAL               0 /* 1, 6, 11 */
+#define AP_ACS_DISABLE_CH11         1 /* 1, 6 */
+#define AP_ACS_INCLUDE_CH13         2 /* 1, 5, 9, 13 */
+
+/* AP mode disconnect reasons */
+#define AP_DISCONNECT_STA_LEFT      101
+#define AP_DISCONNECT_FROM_HOST     102
+#define AP_DISCONNECT_COMM_TIMEOUT  103
+#define AP_DISCONNECT_MAX_STA       104
+#define AP_DISCONNECT_ACL           105
+#define AP_DISCONNECT_STA_ROAM      106
+#define AP_DISCONNECT_DFS_CHANNEL   107 
+/*
+ * Used with WMI_AP_HIDDEN_SSID_CMDID
+ */
+#define HIDDEN_SSID_FALSE   0
+#define HIDDEN_SSID_TRUE    1
+typedef PREPACK struct {
+    A_UINT8     hidden_ssid;
+} POSTPACK WMI_AP_HIDDEN_SSID_CMD;
+
+/*
+ * Used with WMI_AP_ACL_POLICY_CMDID
+ */
+#define AP_ACL_DISABLE          0x00
+#define AP_ACL_ALLOW_MAC        0x01
+#define AP_ACL_DENY_MAC         0x02
+#define AP_ACL_BLWL_MAC         0x03
+#define AP_ACL_RETAIN_LIST_MASK 0x80
+typedef PREPACK struct {
+    A_UINT8     policy;
+} POSTPACK WMI_AP_ACL_POLICY_CMD;
+
+/*
+ * Used with WMI_AP_ACL_MAC_LIST_CMDID
+ */
+#define ADD_MAC_ADDR    1
+#define DEL_MAC_ADDR    2
+
+#define ADD_WHITE_MAC_ADDR  0x01
+#define ADD_BLACK_MAC_ADDR  0x02
+#define RESET_WHITE_LIST	0x03
+#define RESET_BLACK_LIST	0x04
+#define RESET_BWLIST		0x10
+
+typedef PREPACK struct {
+    A_UINT8     action;
+    A_UINT8     index;
+    A_UINT8     mac[ATH_MAC_LEN];
+    A_UINT8     wildcard;
+} POSTPACK WMI_AP_ACL_MAC_CMD;
+
+typedef PREPACK struct {
+    A_UINT16    index;
+    A_UINT8     acl_mac[AP_ACL_SIZE][ATH_MAC_LEN];
+    A_UINT8     wildcard[AP_ACL_SIZE];
+    A_UINT8     policy;
+} POSTPACK WMI_AP_ACL;
+
+/*
+ * Used with WMI_AP_SET_NUM_STA_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8     num_sta;
+} POSTPACK WMI_AP_NUM_STA_CMD;
+
+/*
+ * Used with WMI_AP_SET_MLME_CMDID
+ */
+typedef PREPACK struct {
+    A_UINT8    mac[ATH_MAC_LEN];
+    A_UINT16   reason;              /* 802.11 reason code */
+    A_UINT8    cmd;                 /* operation to perform */
+/* MLME Commands */
+#define WMI_AP_MLME_ASSOC       1   /* associate station */
+#define WMI_AP_DISASSOC         2   /* disassociate station */
+#define WMI_AP_DEAUTH           3   /* deauthenticate station */
+#define WMI_AP_MLME_AUTHORIZE   4   /* authorize station */
+#define WMI_AP_MLME_UNAUTHORIZE 5   /* unauthorize station */
+} POSTPACK WMI_AP_SET_MLME_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 period;
+    A_UINT8 num_null_func;
+} POSTPACK WMI_AP_CONN_INACT_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 period_min;
+    A_UINT32 dwell_ms;
+} POSTPACK WMI_AP_PROT_SCAN_TIME_CMD;
+
+typedef struct {
+    A_BOOL flag;
+    A_UINT16 rsvd;
+    A_UINT16 aid;
+} WMI_AP_SET_PVB_CMD;
+
+#define WMI_DISABLE_REGULATORY_CODE "FF"
+
+typedef PREPACK struct {
+    A_UCHAR countryCode[3];
+} POSTPACK WMI_AP_SET_COUNTRY_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 dtim;
+} POSTPACK WMI_AP_SET_DTIM_CMD;
+
+typedef PREPACK struct {
+    A_UINT8  band; /* specifies which band to apply these values */
+    A_UINT8  enable; /* allows 11n to be disabled on a per band basis */
+    A_UINT8  chan_width_40M_supported;
+    A_UINT8  short_GI_20MHz;
+    A_UINT8  short_GI_40MHz;
+    A_UINT8  intolerance_40MHz;
+    A_UINT8  max_ampdu_len_exp;
+} POSTPACK WMI_SET_HT_CAP_CMD;
+
+typedef PREPACK struct {
+    A_UINT8   sta_chan_width;
+} POSTPACK WMI_SET_HT_OP_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 rateMasks[WMI_MODE_MAX*WMI_MAX_RATE_MASK];
+} POSTPACK WMI_SET_TX_SELECT_RATES_CMD;
+
+typedef PREPACK struct {
+    A_UINT32    sgiMask[WMI_MAX_RATE_MASK];
+    A_UINT8     sgiPERThreshold;
+} POSTPACK WMI_SET_TX_SGI_PARAM_CMD;
+/* Enable for MCS 7/MCS 15 */
+#define DEFAULT_SGI_MASK_L32 0x08080000
+#define DEFAULT_SGI_MASK_U32 0x00000808
+#define DEFAULT_SGI_PER 10
+
+typedef PREPACK struct {
+    A_UINT32 rateField[WMI_MAX_RATE_MASK]; /* 1 bit per rate corresponding to index */
+#define WMI_RATE_POLICY_ID_MAX 5
+    A_UINT8 id; /* valid values == 1->WMI_RATE_POLICY_ID_MAX */
+    A_UINT8 shortTrys;
+    A_UINT8 longTrys;
+    A_UINT8 reserved; /* padding */
+} POSTPACK WMI_SET_RATE_POLICY_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 metaVersion; /* version of meta data for rx packets <0 = default> (0-7 = valid) */
+    A_UINT8 dot11Hdr; /* 1 == leave .11 header intact , 0 == replace .11 header with .3 <default> */
+    A_UINT8 defragOnHost; /* 1 == defragmentation is performed by host, 0 == performed by target <default> */
+    A_UINT8 reserved[1]; /* alignment */
+} POSTPACK WMI_RX_FRAME_FORMAT_CMD;
+
+
+typedef PREPACK struct {
+    A_UINT8 enable;     /* 1 == device operates in thin mode , 0 == normal mode <default> */
+    A_UINT8 reserved[3];
+} POSTPACK WMI_SET_THIN_MODE_CMD;
+
+
+typedef PREPACK struct {
+    A_UINT16    channel; /* frequency in Mhz */
+    //A_UINT8 mode; // HT20 or HT40
+    //A_UINT8 secondary; // if mode == HT40 secondary channel above | below
+} POSTPACK WMI_SET_CHANNEL_CMD;
+
+
+typedef enum {
+    WMI_SET_CHANNEL_RES_SUCCESS = 0, // device has joined the network
+    WMI_SET_CHANNEL_RES_FAIL, // device failed for unspecified reason
+}WMI_SET_CHANNEL_RESULT;
+
+typedef PREPACK struct {
+    A_UINT8 result; /* the result of the join cmd. one of WMI_THIN_JOIN_RESULT */
+    A_UINT8 reserved[3]; /* alignment */
+} POSTPACK WMI_SET_CHANNEL_EVENT;
+
+typedef enum {
+    WMI_FILTERMASK_MGMT=0,
+    WMI_FILTERMASK_CTRL,
+    WMI_FILTERMASK_DATA,
+    WMI_FILTERMASK_MAX
+}WMI_FILTERMASK_INDEX;
+
+typedef PREPACK struct {
+    A_UINT16 filtermask[WMI_FILTERMASK_MAX];
+    A_UINT16 reserved; /* alignment */
+} POSTPACK WMI_RX_FRAME_FILTER_CMD;
+
+/* AP mode events */
+/* WMI_PS_POLL_EVENT */
+typedef PREPACK struct {
+    A_UINT16 aid;
+} POSTPACK WMI_PSPOLL_EVENT;
+
+typedef PREPACK struct {
+    A_UINT32 tx_bytes;
+    A_UINT32 tx_pkts;
+    A_UINT32 tx_error;
+    A_UINT32 tx_discard;
+    A_UINT32 rx_bytes;
+    A_UINT32 rx_pkts;
+    A_UINT32 rx_error;
+    A_UINT32 rx_discard;
+    A_UINT32 aid;
+} POSTPACK WMI_PER_STA_STAT;
+
+#define AP_GET_STATS    0
+#define AP_CLEAR_STATS  1
+
+typedef PREPACK struct {
+    A_UINT32            action;
+    WMI_PER_STA_STAT    sta[AP_MAX_NUM_STA];
+} POSTPACK WMI_AP_MODE_STAT;
+
+#define AP_11BG_RATESET1        1
+#define AP_11BG_RATESET2        2
+#define DEF_AP_11BG_RATESET     AP_11BG_RATESET1
+typedef PREPACK struct {
+    A_UINT8 rateset;
+} POSTPACK WMI_AP_SET_11BG_RATESET_CMD;
+/*
+ * End of AP mode definitions
+ */
+
+struct _wmm_params {
+    A_UINT8     acm;           /* ACM parameter */
+    A_UINT8     aifsn;         /* AIFSN parameters */
+    A_UINT8     logcwmin;      /* cwmin in exponential form */
+    A_UINT8     logcwmax;      /* cwmax in exponential form */
+    A_UINT16    txopLimit;     /* txopLimit */
+};
+
+/* WMI_REPORT_WMM_PARAMS_EVENT */
+typedef PREPACK struct {
+    struct _wmm_params wmm_params[4];
+} POSTPACK WMI_REPORT_WMM_PARAMS_EVENT;
+
+/* P2P module definitions */
+
+/* P2P module commands */
+typedef PREPACK struct {
+    A_UINT8 go_intent;
+    A_UINT8 country[3];
+    A_UINT8 reg_class;
+    A_UINT8 listen_channel;
+    A_UINT8 op_reg_class;
+    A_UINT8 op_channel;
+} POSTPACK WMI_P2P_SET_CONFIG_CMD;
+
+typedef PREPACK struct {
+    A_UINT16 categ;
+    A_UINT16 sub_categ;
+} POSTPACK device_type_tuple;
+
+typedef PREPACK struct {
+    device_type_tuple pri_dev_type;
+    //A_UINT8 pri_device_type[8];
+#define MAX_P2P_SEC_DEVICE_TYPES 5
+    device_type_tuple sec_dev_type[MAX_P2P_SEC_DEVICE_TYPES];
+#define WPS_UUID_LEN 16
+    A_UINT8 uuid[WPS_UUID_LEN];
+#define WPS_MAX_DEVNAME_LEN 32
+    A_UINT8 device_name[WPS_MAX_DEVNAME_LEN];
+    A_UINT8 dev_name_len;
+} POSTPACK WMI_WPS_SET_CONFIG_CMD;
+
+typedef PREPACK struct {
+    device_type_tuple pri_dev_type;
+    device_type_tuple sec_dev_type[MAX_P2P_SEC_DEVICE_TYPES];
+    A_UINT8  device_addr[ATH_MAC_LEN];
+} POSTPACK WMI_SET_REQ_DEV_ATTR_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 ssidLength;
+    A_UINT8 ssid[WMI_MAX_SSID_LEN];
+} POSTPACK P2P_SSID;
+
+typedef enum wmi_p2p_discovery_type {
+    WMI_P2P_FIND_START_WITH_FULL,
+    WMI_P2P_FIND_ONLY_SOCIAL,
+    WMI_P2P_FIND_PROGRESSIVE
+} WMI_P2P_DISC_TYPE;
+
+typedef PREPACK struct {
+    A_UINT32 timeout;
+    WMI_P2P_DISC_TYPE type;
+} POSTPACK WMI_P2P_FIND_CMD;
+
+typedef PREPACK struct {
+    A_UINT16 listen_freq;
+    A_UINT16 force_freq;
+    A_UINT16 go_oper_freq;
+    A_UINT8  dialog_token;
+    A_UINT8  peer_addr[ATH_MAC_LEN];
+    A_UINT8  own_interface_addr[ATH_MAC_LEN];
+    A_UINT8  member_in_go_dev[ATH_MAC_LEN];
+    A_UINT8  go_dev_dialog_token;
+    P2P_SSID peer_go_ssid;
+    A_UINT8  wps_method;
+    A_UINT8 dev_capab;
+    A_INT8  go_intent;
+    A_UINT8 persistent_grp;
+} POSTPACK WMI_P2P_GO_NEG_START_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 persistent_group;
+    A_UINT8 group_formation;
+} POSTPACK WMI_P2P_GRP_INIT_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 peer_addr[ATH_MAC_LEN];
+    A_UINT8 grp_formation_status;
+} POSTPACK WMI_P2P_GRP_FORMATION_DONE_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 timeout;
+}POSTPACK WMI_P2P_LISTEN_CMD;
+
+typedef PREPACK struct {
+    A_UINT16 listen_freq;
+    A_UINT16 force_freq;
+    A_UINT8 status;
+    A_INT8 go_intent;
+    A_UINT8 wps_buf[512];
+    A_UINT16 wps_buflen;
+    A_UINT8 p2p_buf[512];
+    A_UINT16 p2p_buflen;
+    A_UINT8 dialog_token;
+    A_UINT8 wps_method;
+    A_UINT8 persistent_grp;
+}POSTPACK WMI_P2P_GO_NEG_REQ_RSP_CMD;
+
+typedef enum {
+    WMI_P2P_INVITE_ROLE_GO,
+    WMI_P2P_INVITE_ROLE_ACTIVE_GO,
+    WMI_P2P_INVITE_ROLE_CLIENT,
+} WMI_P2P_INVITE_ROLE;
+
+typedef PREPACK struct {
+    WMI_P2P_INVITE_ROLE role;
+    A_UINT16 listen_freq;
+    A_UINT16 force_freq;
+    A_UINT8 dialog_token;
+    A_UINT8 peer_addr[ATH_MAC_LEN];
+    A_UINT8 bssid[ATH_MAC_LEN];
+    A_UINT8 go_dev_addr[ATH_MAC_LEN];
+    P2P_SSID ssid;
+    A_UINT8 is_persistent;
+    A_UINT8 wps_method;
+}POSTPACK WMI_P2P_INVITE_CMD;
+
+typedef PREPACK struct {
+    A_UINT16 force_freq;
+    A_UINT8 status;
+    A_UINT8 dialog_token;
+    A_UINT8 p2p_buf[512];
+    A_UINT16 p2p_buflen;
+    A_UINT8 is_go;
+    A_UINT8 group_bssid[ATH_MAC_LEN];
+}POSTPACK WMI_P2P_INVITE_REQ_RSP_CMD;
+
+typedef PREPACK struct {
+    A_UINT16 wps_method;
+    A_UINT16 listen_freq;
+    A_UINT8 dialog_token;
+    A_UINT8 peer[ATH_MAC_LEN];
+    A_UINT8 go_dev_addr[ATH_MAC_LEN];
+    P2P_SSID go_oper_ssid;
+}POSTPACK WMI_P2P_PROV_DISC_REQ_CMD;
+
+typedef enum {
+    WMI_P2P_CONFID_LISTEN_CHANNEL=1,
+    WMI_P2P_CONFID_CROSS_CONNECT=2,
+    WMI_P2P_CONFID_SSID_POSTFIX=3,
+    WMI_P2P_CONFID_INTRA_BSS=4,
+
+} WMI_P2P_CONF_ID;
+
+typedef PREPACK struct {
+    A_UINT8 reg_class;
+    A_UINT8 listen_channel;
+}POSTPACK WMI_P2P_LISTEN_CHANNEL;
+
+typedef PREPACK struct {
+    A_UINT8 flag;
+}POSTPACK WMI_P2P_SET_CROSS_CONNECT;
+
+typedef PREPACK struct {
+    A_UINT8 ssid_postfix[WMI_MAX_SSID_LEN-9];
+    A_UINT8 ssid_postfix_len;
+}POSTPACK WMI_P2P_SET_SSID_POSTFIX;
+
+typedef PREPACK struct {
+    A_UINT8 flag;
+}POSTPACK WMI_P2P_SET_INTRA_BSS;
+
+typedef PREPACK struct {
+    A_UINT8 config_id;    /* set to one of WMI_P2P_CONF_ID */
+    PREPACK union {
+        WMI_P2P_LISTEN_CHANNEL listen_ch;
+        WMI_P2P_SET_CROSS_CONNECT cross_conn;
+        WMI_P2P_SET_SSID_POSTFIX ssid_postfix;
+        WMI_P2P_SET_INTRA_BSS intra_bss;
+    }POSTPACK val;
+}POSTPACK WMI_P2P_SET_CMD;
+
+#define RATECTRL_MODE_DEFAULT 0
+#define RATECTRL_MODE_PERONLY 1
+
+typedef PREPACK struct {
+    A_UINT32 mode;
+}POSTPACK WMI_SET_RATECTRL_PARM_CMD;
+
+#define WMI_P2P_MAX_TLV_LEN 1024
+typedef enum {
+    WMI_P2P_SD_TYPE_GAS_INITIAL_REQ     = 0x1,
+    WMI_P2P_SD_TYPE_GAS_INITIAL_RESP    = 0x2,
+    WMI_P2P_SD_TYPE_GAS_COMEBACK_REQ    = 0x3,
+    WMI_P2P_SD_TYPE_GAS_COMEBACK_RESP   = 0x4,
+    WMI_P2P_PD_TYPE_RESP                = 0x5,
+    WMI_P2P_SD_TYPE_STATUS_IND          = 0x6,
+} WMI_P2P_SDPD_TYPE;
+
+typedef enum {
+    WMI_P2P_SDPD_TRANSACTION_PENDING = 0x1,
+    WMI_P2P_SDPD_TRANSACTION_COMP = 0x2,
+} WMI_P2P_SDPD_TRANSACTION_STATUS;
+
+typedef PREPACK struct {
+    A_UINT8 type;
+    A_UINT8 dialog_token;
+    A_UINT8 frag_id;
+    A_UINT8 reserved1;          /* alignment */
+    A_UINT8 peer_addr[ATH_MAC_LEN];
+    A_UINT16 freq;
+    A_UINT16 status_code;
+    A_UINT16 comeback_delay;
+    A_UINT16 tlv_length;
+    A_UINT16 update_indic;
+    A_UINT16 total_length;
+    A_UINT16 reserved2;         /* future */
+    A_UINT8  tlv[WMI_P2P_MAX_TLV_LEN];
+} POSTPACK WMI_P2P_SDPD_TX_CMD;
+
+/* P2P module events */
+
+typedef PREPACK struct {
+    A_UINT8 sa[ATH_MAC_LEN];
+    A_UINT8 wps_buf[512];
+    A_UINT16 wps_buflen;
+    A_UINT8 p2p_buf[512];
+    A_UINT16 p2p_buflen;
+    A_UINT8 dialog_token;
+}POSTPACK WMI_P2P_GO_NEG_REQ_EVENT;
+
+typedef PREPACK struct {
+    A_UINT16 freq;
+    A_INT8 status;
+    A_UINT8 role_go;
+    A_UINT8 ssid[WMI_MAX_SSID_LEN];
+    A_UINT8 ssid_len;
+#define WMI_MAX_PASSPHRASE_LEN 9
+    A_CHAR pass_phrase[WMI_MAX_PASSPHRASE_LEN];
+    A_UINT8 peer_device_addr[ATH_MAC_LEN];
+    A_UINT8 peer_interface_addr[ATH_MAC_LEN];
+    A_UINT8 wps_method;
+    A_UINT8 persistent_grp;
+} POSTPACK WMI_P2P_GO_NEG_RESULT_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8 p2p_buf[512];
+    A_UINT16 p2p_buflen;
+    A_UINT8 sa[ATH_MAC_LEN];
+    A_UINT8 bssid[ATH_MAC_LEN];
+    A_UINT8 go_dev_addr[ATH_MAC_LEN];
+    P2P_SSID ssid;
+    A_UINT8 is_persistent;
+    A_UINT8 dialog_token;
+} POSTPACK WMI_P2P_INVITE_REQ_EVENT;
+
+typedef PREPACK struct {
+    A_UINT16 oper_freq;
+    A_UINT8 sa[ATH_MAC_LEN];
+    A_UINT8 bssid[ATH_MAC_LEN];
+    A_UINT8 is_bssid_valid;
+    A_UINT8 go_dev_addr[ATH_MAC_LEN];
+    P2P_SSID ssid;
+    A_UINT8 status;
+} POSTPACK WMI_P2P_INVITE_RCVD_RESULT_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8 status;
+    A_UINT8 bssid[ATH_MAC_LEN];
+    A_UINT8 is_bssid_valid;
+} POSTPACK WMI_P2P_INVITE_SENT_RESULT_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8 sa[ATH_MAC_LEN];
+    A_UINT16 wps_config_method;
+    A_UINT8 dev_addr[ATH_MAC_LEN];
+#define WPS_DEV_TYPE_LEN 8
+    A_UINT8 pri_dev_type[WPS_DEV_TYPE_LEN];
+    A_UINT8 device_name[WPS_MAX_DEVNAME_LEN];
+    A_UINT8 dev_name_len;
+    A_UINT16 dev_config_methods;
+    A_UINT8 device_capab;
+    A_UINT8 group_capab;
+} POSTPACK WMI_P2P_PROV_DISC_REQ_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8 peer[ATH_MAC_LEN];
+    A_UINT16 config_methods;
+} POSTPACK WMI_P2P_PROV_DISC_RESP_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8 type;
+    A_UINT8 transaction_status;
+    A_UINT8 dialog_token;
+    A_UINT8 frag_id;
+    A_UINT8 peer_addr[ATH_MAC_LEN];
+    A_UINT16 freq;
+    A_UINT16 status_code;
+    A_UINT16 comeback_delay;
+    A_UINT16 tlv_length;
+    A_UINT16 update_indic;
+//  Variable length TLV will be placed after the event
+} POSTPACK WMI_P2P_SDPD_RX_EVENT;
+
+typedef PREPACK struct {
+    A_UINT8    event_id;    /* event identifier  */
+    A_UINT8    length;      /* number of bytes of data that follows */
+    A_UINT8    data[1];     /* start of event data */
+} POSTPACK WMI_ACS_EVENT_MSG;
+
+#define WMI_ACS_EVENT_HDR_LEN  (sizeof(WMI_ACS_EVENT_MSG) - sizeof(A_UINT8))
+
+typedef PREPACK struct {
+    A_UINT8    ctrl_id;     /* control identifier */
+    A_UINT8    length;      /* number of bytes of data to follow */
+    A_UINT8    data[1];     /* start of control data */
+} POSTPACK WMI_ACS_CTRL_MSG;
+
+#define WMI_ACS_CTRL_HDR_LEN  (sizeof(WMI_ACS_CTRL_MSG) - sizeof(A_UINT8))
+
+/* STORE / RECALL Commands AND Events DEFINITION START */
+typedef PREPACK struct {
+    A_UINT8 enable;
+#define STRRCL_RECIPIENT_HOST 1
+#define STRRCL_RECIPIENT_POWERSAFE_MEM 2
+    A_UINT8 recipient;
+} POSTPACK WMI_STORERECALL_CONFIGURE_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 length; /* number of bytes of data to follow */
+    A_UINT8  data[1]; /* start of data */
+} POSTPACK WMI_STORERECALL_RECALL_CMD;
+
+typedef PREPACK struct {
+    A_UINT32 sleep_msec;
+    A_UINT8 store_after_tx_empty;
+    A_UINT8 store_after_fresh_beacon_rx;
+} POSTPACK WMI_STORERECALL_HOST_READY_CMD;
+
+typedef PREPACK struct {
+    A_UINT32    msec_sleep; /* time between power off/on */
+    A_UINT32    length; /* length of following data */
+    A_UINT8     data[1]; /* start of data */
+} POSTPACK WMI_STORERECALL_STORE_EVENT;
+
+/* STORE / RECALL Commands AND Events DEFINITION END */
+/* WPS Commands AND Events DEFINITION START */
+
+typedef PREPACK struct {
+    A_UINT8 ssid[WMI_MAX_SSID_LEN];
+    A_UINT8 macaddress[ATH_MAC_LEN];
+    A_UINT16 channel;
+    A_UINT8 ssid_len;	
+} POSTPACK WPS_SCAN_LIST_ENTRY;
+
+#define WPS_PIN_LEN (8)
+
+typedef PREPACK struct {
+    A_UINT8 pin[WPS_PIN_LEN+1];
+}POSTPACK WPS_PIN;
+
+typedef enum {
+    WPS_PIN_MODE = 0x1,
+    WPS_PBC_MODE = 0x2
+} WPS_MODE;
+
+typedef enum {
+    WPS_REGISTRAR_ROLE = 0x1,
+    WPS_ENROLLEE_ROLE  = 0x2
+} WPS_OPER_MODE;
+
+typedef enum {
+    WPS_DO_CONNECT_AFTER_CRED_RECVD = 0x1
+} WPS_START_CTRL_FLAG;
+
+typedef PREPACK struct {
+    WPS_SCAN_LIST_ENTRY ssid_info;
+    A_UINT8 config_mode; /* WPS_MODE */
+    WPS_PIN wps_pin;
+    A_UINT8 timeout;     /* in Seconds */
+    A_UINT8 role;        /* WPS_OPER_MOD */	
+    A_UINT8 ctl_flag;    /* WPS_START_CTRL_FLAG */
+} POSTPACK WMI_WPS_START_CMD;
+
+typedef enum {
+    WPS_STATUS_SUCCESS = 0x0,
+    WPS_STATUS_FAILURE = 0x1,
+    WPS_STATUS_IDLE = 0x2,       
+    WPS_STATUS_IN_PROGRESS  = 0x3,
+} WPS_STATUS;
+
+typedef PREPACK struct {
+    A_UINT8  wps_status;  /* WPS_STATUS */
+    A_UINT8  wps_state;
+} POSTPACK WMI_WPS_GET_STATUS_EVENT;
+
+typedef enum {
+    WPS_ERROR_INVALID_START_INFO  = 0x1,
+    WPS_ERROR_MULTIPLE_PBC_SESSIONS,
+    WPS_ERROR_WALKTIMER_TIMEOUT,
+    WPS_ERROR_M2D_RCVD,
+    WPS_ERROR_PWD_AUTH_FAIL
+} WPS_ERROR_CODE;
+
+typedef enum {
+    WPS_AUTH_TYPE_OPEN    = 0x0001,
+    WPS_AUTH_TYPE_WPAPSK  = 0x0002,
+    WPS_AUTH_TYPE_SHARED  = 0x0004,
+    WPS_AUTH_TYPE_WPA     = 0x0008,
+    WPS_AUTH_TYPE_WPA2    = 0x0010,
+    WPS_AUTH_TYPE_WPA2PSK = 0x0020
+} WPS_AUTH_TYPE;
+
+typedef enum {
+    WPS_ENCR_TYPE_NONE = 0x0001,
+    WPS_ENCR_TYPE_WEP  = 0x0002,
+    WPS_ENCR_TYPE_TKIP = 0x0004,
+    WPS_ENCR_TYPE_AES  = 0x0008,
+} WPS_ENCR_TYPE;
+
+typedef PREPACK struct {
+    A_UINT16 ap_channel; 
+    A_UINT8  ssid[WMI_MAX_SSID_LEN];
+    A_UINT8  ssid_len;
+    A_UINT16 auth_type; /* WPS_AUTH_TYPE */ 
+    A_UINT16 encr_type; /* WPS_ENCR_TYPE */
+    A_UINT8  key_idx;
+    A_UINT8  key[64];
+    A_UINT8  key_len;
+    A_UINT8  mac_addr[ATH_MAC_LEN];
+} POSTPACK WPS_CREDENTIAL;
+
+typedef PREPACK struct {
+    A_UINT8 status;      /* WPS_STATUS */
+    A_UINT8 error_code;  /* WPS_ERROR_CODE */
+    WPS_CREDENTIAL  credential;
+} POSTPACK WMI_WPS_PROFILE_EVENT;
+
+/* WPS Commands AND Events DEFINITION END */
+
+typedef enum {
+    WMI_AP_APSD_DISABLED = 0,
+    WMI_AP_APSD_ENABLED
+} WMI_AP_APSD_STATUS;
+
+typedef PREPACK struct {
+    A_UINT8    enable;
+} POSTPACK WMI_AP_SET_APSD_CMD;
+
+typedef enum {
+    WMI_AP_APSD_NO_DELIVERY_FRAMES_FOR_THIS_TRIGGER =  0x1,
+} WMI_AP_APSD_BUFFERED_TRAFFIC_FLAGS;
+
+typedef PREPACK struct {
+    A_UINT16   aid;
+    A_UINT16   bitmap;
+    A_UINT32   flags;
+} POSTPACK WMI_AP_APSD_BUFFERED_TRAFFIC_CMD;
+    
+typedef PREPACK struct {
+    A_UINT32 freq;
+    A_UINT32 duration;
+} POSTPACK WMI_REMAIN_ON_CHNL_CMD_STRUCT;
+
+/* WMI_SEND_ACTION_CMD_STRUCT is to be deprecated; WMI_SEND_MGMT_CMD_STRUCT is 
+ * to be used instead. The new command supports P2P mgmt operations using
+ * station interface
+ */
+typedef PREPACK struct {
+    A_UINT32 ID;
+    A_UINT32 freq;
+    A_UINT32 wait;
+    A_UINT16 len;
+    A_UINT8  data[1];
+} POSTPACK  WMI_SEND_ACTION_CMD_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 ID;
+    A_UINT32 freq;
+    A_UINT32 wait;
+    A_BOOL no_cck;
+    A_UINT16 len;
+    A_UINT8  data[1];
+} POSTPACK  WMI_SEND_MGMT_CMD_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 ID;
+    A_UINT8 ACKStatus;
+} POSTPACK  WMI_TX_STATUS_EVENT_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8 enable;
+} POSTPACK  WMI_PROBE_REQ_REPORT_CMD_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8 disable;
+} POSTPACK  WMI_DISABLE_11B_RATES_CMD_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8 RoleID;
+    A_UINT8 mgmtFrmType;
+    A_UINT8 ieLen;
+    A_UINT8 ieInfo[1];
+} POSTPACK  WMI_SET_APPIE_EXTENDED_CMD_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 freq;
+    A_UINT32 duration;
+} POSTPACK  WMI_REMAIN_ON_CHNL_EVENT_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 freq;
+    A_UINT32 duration;
+    A_UINT8  status;
+} POSTPACK  WMI_CANCEL_REMAIN_ON_CHNL_EVENT_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 freq;
+    A_UINT16 len;
+    A_UINT8 data[1];
+} POSTPACK  WMI_RX_ACTION_EVENT_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT16 len;
+    A_UINT8 data[1];
+} POSTPACK  WMI_P2P_CAPABILITIES_EVENT_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 freq;
+    A_UINT16 len;
+    A_UINT8 data[1];
+} POSTPACK  WMI_P2P_RX_PROBE_REQ_EVENT_STRUCT;
+
+#define P2P_FLAG_CAPABILITIES_REQ   (0x00000001)
+#define P2P_FLAG_MACADDR_REQ        (0x00000002)
+#define P2P_FLAG_P2P_MODEL_REQ      (0x00000004)
+
+typedef PREPACK struct {
+    A_UINT32 InfoReqFlags;
+} POSTPACK  WMI_GET_P2P_INFO_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 InfoReqFlags;
+    A_UINT16 len;
+    A_UINT8  data[1];
+} POSTPACK  WMI_P2P_INFO_EVENT_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8  GOPowerSave;
+} POSTPACK  WMI_P2P_CAPABILITIES_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8  MACAddr[6];
+} POSTPACK  WMI_P2P_MACADDR_STRUCT;
+
+#define P2P_HOST_MODEL          1
+#define P2P_FW_MODEL            0
+
+typedef PREPACK struct {
+    A_UINT8  P2PModel;
+} POSTPACK  WMI_P2P_MODEL_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 freq;
+    A_UINT8  DestinationAddr[6];
+    A_UINT16 len;
+    A_UINT8  data[1];
+} POSTPACK  WMI_P2P_PROBE_RESPONSE_CMD_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT32 duration;
+    A_UINT32 interval;
+    A_UINT32 start_or_offset;
+    A_UINT8 count_or_type;
+} POSTPACK P2P_NOA_DESCRIPTOR;
+
+typedef PREPACK struct {
+    A_UINT8 enable;
+    A_UINT8 count;
+    A_UINT8 noas[1];
+} POSTPACK WMI_NOA_INFO_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8 enable;
+    A_UINT8 ctwin;
+} POSTPACK WMI_OPPPS_INFO_STRUCT;
+
+typedef PREPACK struct {
+    A_UINT8 port_id;
+    A_UINT8 port_opmode;
+    A_UINT8 port_subopmode;
+} POSTPACK WMI_ADD_PORT_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 port_id;
+} POSTPACK WMI_DEL_PORT_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 status;
+    A_UINT8 port_id;
+    A_UINT8 mac_addr[6];
+} POSTPACK WMI_PORT_STATUS_INFO;
+
+typedef PREPACK struct {
+    A_UINT16   rsn_cap;
+} POSTPACK WMI_RSN_CAP_CMD;
+
+typedef PREPACK struct {
+    A_UINT8     keyIndex;
+    A_UINT8     keyLength;
+    A_UINT8     keyRSC[6];/* key replay sequence counter */
+    A_UINT8     key[WMI_MAX_KEY_LEN];
+} POSTPACK WMI_SET_IGTK_CMD;
+
+typedef PREPACK struct {
+    A_UINT8 min_rx_bundle_frame;
+    A_UINT8 min_rx_bundle_timeout;
+} POSTPACK WMI_SET_BUNDLE_PARAM_CMD;
+
+typedef PREPACK struct {
+    A_BOOL  enable;
+    A_UINT8 nextProbeCount;
+    A_UINT8 maxBackOff;
+    A_UINT8 forceBackOff;
+} POSTPACK WMI_GREENTX_PARAMS_CMD;
+
+/* voice detection enable/disable command structure */
+typedef PREPACK struct {
+    A_UINT8    enable;
+} POSTPACK WMI_VOICE_DETECTION_ENABLE_CMD;
+
+typedef enum {
+    RECOVERY_SIM_ASSERT     = 0x01,
+    RECOVERY_SIM_NO_DETECT  = 0x02,
+    RECOVERY_SIM_CTR_EP_FULL= 0x03,
+    RECOVERY_SIM_EMPTY_POINT= 0x04,
+    RECOVERY_SIM_STACK_OV   = 0x05,
+} RECOVERY_SIM_TYPE;
+
+typedef PREPACK struct {
+    A_UINT8 type;     /*0:unused 1: ASSERT, 2: not respond detect command,3:  simulate ep-full(),4:empty point,5 stack overflow...*/
+    A_UINT8 reserved; /*unused now*/
+    A_UINT16 delay_time_ms;   /*0xffff means the simulate will delay for random time (0 ~0xffff ms)*/
+}POSTPACK WMI_SET_RECOVERY_TEST_PARAMETER_CMD;
+
+typedef PREPACK struct {
+A_UINT8 disable;  /*0: enable broadcast,  1: disable broadcast */
+} POSTPACK WMI_DISABLE_BCAST_IN_PM_CMD;
+
+typedef PREPACK struct {
+    A_INT8 rssi_value;
+} POSTPACK WMI_SET_RSSI_FILTER_CMD;
+
+
+#ifndef ATH_TARGET
+//#include "athendpack.h"
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WMI_H_ */
diff --git a/ath6kl-wmiconfig/include/wmiconfig.h b/ath6kl-wmiconfig/include/wmiconfig.h
new file mode 100755
index 0000000..d9ac071
--- /dev/null
+++ b/ath6kl-wmiconfig/include/wmiconfig.h
@@ -0,0 +1,555 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*
+ * This file contains the definitions for wmiconfig utility
+ */
+
+#ifndef _WMI_CONFIG_H_
+#define _WMI_CONFIG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+enum ath6kl_tm_attr {
+	__ATH6KL_TM_ATTR_INVALID	= 0,
+	ATH6KL_TM_ATTR_CMD		= 1,
+	ATH6KL_TM_ATTR_DATA		= 2,
+
+	/* keep last */
+	__ATH6KL_TM_ATTR_AFTER_LAST,
+	ATH6KL_TM_ATTR_MAX		= __ATH6KL_TM_ATTR_AFTER_LAST - 1,
+};
+
+enum ath6kl_tm_cmd {
+	ATH6KL_TM_CMD_TCMD		= 0,
+	ATH6KL_TM_CMD_RX_REPORT  = 1,	/* not used anymore */
+	ATH6KL_TM_CMD_WMI_CMD    = 0xF000,
+};
+
+
+enum {
+    WMI_GET_VERSION=501,     /* something that doesn't collide with ascii */
+    WMI_SET_POWER_MODE,
+    WMI_SET_IBSS_PM_CAPS,
+    WMI_SET_PM_PARAMS,
+    WMI_SET_SCAN_PARAMS,
+    WMI_SET_LISTEN_INTERVAL,
+    WMI_SET_BMISS_TIME,
+    WMI_SET_BSS_FILTER,
+    WMI_SET_RSSI_THRESHOLDS,
+    WMI_SET_CHANNEL,
+    WMI_SET_SSID,
+    WMI_SET_BADAP,
+    WMI_DELETE_BADAP,
+    WMI_CREATE_QOS,
+    WMI_DELETE_QOS,
+    WMI_GET_QOS_QUEUE,
+    WMI_GET_TARGET_STATS,
+    WMI_SET_TARGET_ERROR_REPORTING_BITMASK,
+    WMI_SET_AC_PARAMS,
+    WMI_SET_ASSOC_IE,
+    WMI_SET_DISC_TIMEOUT,
+    WMI_SET_ADHOC_BSSID,
+    WMI_SET_OPT_MODE,
+    WMI_OPT_SEND_FRAME,
+    WMI_SET_BEACON_INT,
+    WMI_SET_VOICE_PKT_SIZE,
+    WMI_SET_MAX_SP,
+    WMI_GET_ROAM_TBL,
+    WMI_SET_ROAM_CTRL,
+    WMI_SET_POWERSAVE_TIMERS,
+    WMI_SET_POWERSAVE_TIMERS_PSPOLLTIMEOUT,
+    WMI_SET_POWERSAVE_TIMERS_TRIGGERTIMEOUT,
+    WMI_GET_POWER_MODE,
+    WMI_SET_WLAN_STATE,
+    WMI_GET_WLAN_STATE,
+    WMI_GET_ROAM_DATA,
+    WMI_SET_BT_STATUS,
+    WMI_SET_BT_PARAMS,
+    WMI_SET_BTCOEX_FE_ANT,
+    WMI_SET_BTCOEX_COLOCATED_BT_DEV,
+    WMI_SET_BTCOEX_SCO_CONFIG,
+    WMI_SET_BTCOEX_A2DP_CONFIG,
+    WMI_SET_BTCOEX_ACLCOEX_CONFIG,
+    WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG,
+    WMI_SET_BTCOEX_DEBUG,
+    WMI_SET_BTCOEX_BT_OPERATING_STATUS,
+    WMI_GET_BTCOEX_CONFIG,
+    WMI_GET_BTCOEX_STATS,
+    WMI_SET_RETRYLIMITS,
+    WMI_START_SCAN,
+    WMI_SET_FIX_RATES,
+    WMI_GET_FIX_RATES,
+    WMI_SET_SNR_THRESHOLDS,
+    WMI_CLR_RSSISNR,
+    WMI_SET_LQ_THRESHOLDS,
+    WMI_SET_AUTH_MODE,
+    WMI_SET_REASSOC_MODE,
+    WMI_SET_LPREAMBLE,
+    WMI_SET_RTS,
+    WMI_SET_WMM,
+#ifdef USER_KEYS
+    USER_SETKEYS,
+#endif
+    WMI_APSD_TIM_POLICY,
+    WMI_SET_ERROR_DETECTION,
+    WMI_GET_HB_CHALLENGE_RESP,
+    WMI_SET_TXOP,
+    DIAG_ADDR,
+    DIAG_DATA,
+    DIAG_READ,
+    DIAG_WRITE,
+    WMI_GET_RD,
+    WMI_SET_KEEPALIVE,
+    WMI_GET_KEEPALIVE,
+    WMI_SET_APPIE,
+    WMI_SET_MGMT_FRM_RX_FILTER,
+    WMI_DBGLOG_CFG_MODULE,
+    WMI_DBGLOG_GET_DEBUG_LOGS,
+    WMI_SET_HOST_SLEEP_MODE,
+    WMI_SET_WOW_MODE,
+    WMI_GET_WOW_LIST,
+    WMI_ADD_WOW_PATTERN,
+    WMI_DEL_WOW_PATTERN,
+    DIAG_DUMP_CHIP_MEM,
+    WMI_SET_CONNECT_CTRL_FLAGS,
+    DUMP_HTC_CREDITS,
+    USER_SETKEYS_INITRSC,
+    WMI_SCAN_DFSCH_ACT_TIME,
+    WMI_SIMULATED_APSD_TIM_POLICY,
+    WMI_SET_AKMP_INFO,
+    WMI_AKMP_MULTI_PMKID,
+    WMI_NUM_PMKID,
+    WMI_PMKID_ENTRY,
+    WMI_SET_PMKID_LIST,
+    WMI_GET_PMKID_LIST,
+    WMI_SET_IEMASK,
+    WMI_SCAN_CHANNEL_LIST,
+    WMI_SET_BSS_PMKID_INFO,
+    WMI_BSS_PMKID_ENTRY,
+    WMI_BSSID,
+    WMI_ABORT_SCAN,
+    WMI_TARGET_EVENT_REPORT,
+    WMI_AP_GET_STA_LIST,    /* AP mode */
+    WMI_AP_HIDDEN_SSID,     /* AP mode */
+    WMI_AP_SET_NUM_STA,     /* AP mode */
+    WMI_AP_ACL_POLICY,      /* AP mode */
+    WMI_AP_ACL_MAC_LIST1,   /* AP mode */
+    WMI_AP_ACL_MAC_LIST2,   /* AP mode */
+    WMI_AP_GET_ACL_LIST,    /* AP mode */
+    WMI_AP_COMMIT_CONFIG,   /* AP mode */
+    WMI_AP_INACT_TIME,      /* AP mode */
+    WMI_AP_PROT_TIME,       /* AP mode */    
+    WMI_AP_SET_MLME,        /* AP mode */
+    WMI_AP_SET_COUNTRY,     /* AP mode */
+    WMI_AP_GET_COUNTRY_LIST,/* AP mode */
+    WMI_AP_DISABLE_REGULATORY, /* AP mode */
+    WMI_AP_SET_DTIM,        /* AP mode */    
+    WMI_AP_INTRA_BSS,       /* AP mode */    
+    WMI_AP_INTER_BSS,       /* AP mode */    
+    WMI_GET_IP,
+    WMI_SET_MCAST_FILTER,
+    WMI_DEL_MCAST_FILTER,
+    WMI_MCAST_FILTER,
+    WMI_DUMP_RCV_AGGR_STATS,
+    WMI_SETUP_AGGR,
+    WMI_CFG_ALLOW_AGGR,
+    WMI_CFG_DELE_AGGR,
+    WMI_SET_HT_CAP,
+    WMI_SET_HT_OP,
+    WMI_AP_GET_STAT,        /* AP mode */
+    WMI_AP_CLR_STAT,        /* AP mode */
+    WMI_SET_TX_SELECT_RATES,
+    WMI_SCAN_MAXACT_PER_SSID,
+    WMI_AP_GET_HIDDEN_SSID, /* AP mode */
+    WMI_AP_GET_COUNTRY,     /* AP mode */
+    WMI_AP_GET_WMODE,       /* AP mode */
+    WMI_AP_GET_DTIM,        /* AP mode */
+    WMI_AP_GET_BINTVL,      /* AP mode */    
+    WMI_GET_RTS,
+    DIAG_FETCH_TARGET_REGS,
+#ifdef ATH_INCLUDE_PAL
+    WMI_SEND_PAL_CMD,
+    WMI_SEND_PAL_DATA,
+#endif
+    WMI_SET_WLAN_CONN_PRECDNCE,
+    WMI_SET_AP_RATESET,     /* AP mode */
+    WMI_SET_TX_WAKEUP_POLICY,
+    WMI_SET_TX_NUM_FRAMES_TO_WAKEUP,
+    WMI_SET_AP_PS,
+    WMI_SET_AP_PS_PSTYPE,
+    WMI_SET_AP_PS_IDLE_TIME,
+    WMI_SET_AP_PS_PS_PERIOD,
+    WMI_SET_AP_PS_SLEEP_PERIOD,
+    WMI_SEND_CONNECT_CMD,
+    WMI_SEND_CONNECT_CMD1,
+    WMI_SEND_CONNECT_CMD2,
+    WMI_SET_WOW_FILTER,
+    WMI_SET_WOW_HOST_REQ_DELAY,
+    WMI_SET_QOS_SUPP,
+    WMI_SET_AC_VAL,
+    WMI_AP_SET_DFS, /* AP mode */
+    BT_HW_POWER_STATE,
+    SET_BT_HW_POWER_STATE,
+    GET_BT_HW_POWER_STATE,
+    DIAG_DUMP_CHIP_MEM_VENUS,
+    WMI_SET_TX_SGI_PARAM,
+    WMI_SGI_MASK,
+    WMI_PER_SGI,
+    WMI_WAC_ENABLE,
+    WMI_SET_WPA_OFFLOAD_STATE,
+    WMI_AP_ACS_DISABLE_HI_CHANNELS,
+    WMI_SET_DIVERSITY_PARAM,
+    WMI_SET_EXCESS_TX_RETRY_THRES,
+    WMI_FORCE_ASSERT,    
+    WMI_AP_SET_GNUM_STA,
+    WMI_AP_GET_GNUM_STA,
+    WMI_AP_GET_NUM_STA,
+    WMI_SUSPEND_DRIVER,
+    WMI_RESUME_DRIVER,    
+    WMI_SCAN_PROBED_SSID,
+    WMI_AP_SET_APSD,
+    WMI_GET_HT_CAP,
+    WMI_SET_MCASTRATE,
+    WMI_VOICE_DETECTION_ENABLE, /* enable/disable voice detection */
+    WMI_SET_TXE_NOTIFY,
+    WMI_SET_RECOVERY_SIMULATE, /*set recovery simulate*/
+WMI_DISABLE_BCAST_IN_PM,  /* enable/disable broadcast in power save */
+    WMI_AP_BLWL,                /*set SAP blacklist/whitelist*/
+    WMI_AP_BLWL_POLICY,          /*set SAP blacklist/whitelist policy*/
+    WMI_AP_BLWL_MAC_LIST,         /*set SAP blacklist/whitelist mac*/
+    WMI_SET_RSSI_FILTER,
+};
+
+/*
+***************************************************************************
+**  How to form a regcode from CountryCode, Regulatory domain or WWR code:
+**
+**  WWR code is nothing but a special case of Regulatory domain.
+**
+**      code is of type U_INT32
+**
+**      Bit-31  Bit-30      Bit11-0
+**        0       0          xxxx    -> Bit11-0 is a Regulatory Domain
+**        0       1          xxxx    -> Bit11-0 is a WWR code
+**        1       X          xxxx    -> Bit11-0 is a Country code
+**  
+***************************************************************************
+*/
+#define REGCODE_IS_CC_BITSET(x)     ((x) & 0x80000000)
+#define REGCODE_GET_CODE(x)         ((x) & 0xFFF)
+#define REGCODE_IS_WWR_BITSET(x)    ((x) & 0x40000000)
+#ifdef ATH_INCLUDE_PAL
+#define MAX_BUFFER_SIZE             1512    
+#endif
+
+typedef struct {
+    A_UINT32        numPMKIDUser;          /* PMKIDs user wants to enter */
+    WMI_SET_PMKID_LIST_CMD  *pmkidInfo;
+} pmkidUserInfo_t;
+
+#define KEYTYPE_PSK     1
+#define KEYTYPE_PHRASE  2
+
+typedef struct {
+    char ssid[WMI_MAX_SSID_LEN];
+    A_UINT8 ssid_len;
+    A_UINT8 wpa;
+    A_UINT8 ucipher;
+    A_UINT8 mcipher;
+    char    psk[64];
+    A_UINT8 psk_type;
+    A_UINT8 pmk[WMI_PMK_LEN];
+    A_UINT8 auth;
+    A_UINT8 wep_key[4][26];
+    A_UINT8 def_wep_key;
+} profile_t;
+
+/*
+ * Numbering from ISO 3166
+ */
+enum CountryCode {
+    CTRY_ALBANIA              = 8,       /* Albania */
+    CTRY_ALGERIA              = 12,      /* Algeria */
+    CTRY_ARGENTINA            = 32,      /* Argentina */
+    CTRY_ARMENIA              = 51,      /* Armenia */
+    CTRY_ARUBA                = 533,     /* Aruba */
+    CTRY_AUSTRALIA            = 36,      /* Australia (for STA) */
+    CTRY_AUSTRALIA_AP         = 5000,    /* Australia (for AP) */
+    CTRY_AUSTRIA              = 40,      /* Austria */
+    CTRY_AZERBAIJAN           = 31,      /* Azerbaijan */
+    CTRY_BAHRAIN              = 48,      /* Bahrain */
+    CTRY_BANGLADESH           = 50,      /* Bangladesh */
+    CTRY_BARBADOS             = 52,      /* Barbados */
+    CTRY_BELARUS              = 112,     /* Belarus */
+    CTRY_BELGIUM              = 56,      /* Belgium */
+    CTRY_BELIZE               = 84,      /* Belize */
+    CTRY_BOLIVIA              = 68,      /* Bolivia */
+    CTRY_BOSNIA_HERZEGOWANIA  = 70,      /* Bosnia & Herzegowania */
+    CTRY_BRAZIL               = 76,      /* Brazil */
+    CTRY_BRUNEI_DARUSSALAM    = 96,      /* Brunei Darussalam */
+    CTRY_BULGARIA             = 100,     /* Bulgaria */
+    CTRY_CAMBODIA             = 116,     /* Cambodia */
+    CTRY_CANADA               = 124,     /* Canada (for STA) */
+    CTRY_CANADA_AP            = 5001,    /* Canada (for AP) */
+    CTRY_CHILE                = 152,     /* Chile */
+    CTRY_CHINA                = 156,     /* People's Republic of China */
+    CTRY_COLOMBIA             = 170,     /* Colombia */
+    CTRY_COSTA_RICA           = 188,     /* Costa Rica */
+    CTRY_CROATIA              = 191,     /* Croatia */
+    CTRY_CYPRUS               = 196,
+    CTRY_CZECH                = 203,     /* Czech Republic */
+    CTRY_DENMARK              = 208,     /* Denmark */
+    CTRY_DOMINICAN_REPUBLIC   = 214,     /* Dominican Republic */
+    CTRY_ECUADOR              = 218,     /* Ecuador */
+    CTRY_EGYPT                = 818,     /* Egypt */
+    CTRY_EL_SALVADOR          = 222,     /* El Salvador */
+    CTRY_ESTONIA              = 233,     /* Estonia */
+    CTRY_FAEROE_ISLANDS       = 234,     /* Faeroe Islands */
+    CTRY_FINLAND              = 246,     /* Finland */
+    CTRY_FRANCE               = 250,     /* France */
+    CTRY_FRANCE2              = 255,     /* France2 */
+    CTRY_GEORGIA              = 268,     /* Georgia */
+    CTRY_GERMANY              = 276,     /* Germany */
+    CTRY_GREECE               = 300,     /* Greece */
+    CTRY_GREENLAND            = 304,     /* Greenland */
+    CTRY_GRENADA              = 308,     /* Grenada */
+    CTRY_GUAM                 = 316,     /* Guam */
+    CTRY_GUATEMALA            = 320,     /* Guatemala */
+    CTRY_HAITI                = 332,     /* Haiti */
+    CTRY_HONDURAS             = 340,     /* Honduras */
+    CTRY_HONG_KONG            = 344,     /* Hong Kong S.A.R., P.R.C. */
+    CTRY_HUNGARY              = 348,     /* Hungary */
+    CTRY_ICELAND              = 352,     /* Iceland */
+    CTRY_INDIA                = 356,     /* India */
+    CTRY_INDONESIA            = 360,     /* Indonesia */
+    CTRY_IRAN                 = 364,     /* Iran */
+    CTRY_IRAQ                 = 368,     /* Iraq */
+    CTRY_IRELAND              = 372,     /* Ireland */
+    CTRY_ISRAEL               = 376,     /* Israel */
+    CTRY_ITALY                = 380,     /* Italy */
+    CTRY_JAMAICA              = 388,     /* Jamaica */
+    CTRY_JAPAN                = 392,     /* Japan */
+    CTRY_JAPAN1               = 393,     /* Japan (JP1) */
+    CTRY_JAPAN2               = 394,     /* Japan (JP0) */
+    CTRY_JAPAN3               = 395,     /* Japan (JP1-1) */
+    CTRY_JAPAN4               = 396,     /* Japan (JE1) */
+    CTRY_JAPAN5               = 397,     /* Japan (JE2) */
+    CTRY_JAPAN6               = 399,     /* Japan (JP6) */
+    CTRY_JORDAN               = 400,     /* Jordan */
+    CTRY_KAZAKHSTAN           = 398,     /* Kazakhstan */
+    CTRY_KENYA                = 404,     /* Kenya */
+    CTRY_KOREA_NORTH          = 408,     /* North Korea */
+    CTRY_KOREA_ROC            = 410,     /* South Korea (for STA) */
+    CTRY_KOREA_ROC2           = 411,     /* South Korea */
+    CTRY_KOREA_ROC3           = 412,     /* South Korea (for AP) */
+    CTRY_KUWAIT               = 414,     /* Kuwait */
+    CTRY_LATVIA               = 428,     /* Latvia */
+    CTRY_LEBANON              = 422,     /* Lebanon */
+    CTRY_LIBYA                = 434,     /* Libya */
+    CTRY_LIECHTENSTEIN        = 438,     /* Liechtenstein */
+    CTRY_LITHUANIA            = 440,     /* Lithuania */
+    CTRY_LUXEMBOURG           = 442,     /* Luxembourg */
+    CTRY_MACAU                = 446,     /* Macau */
+    CTRY_MACEDONIA            = 807,     /* the Former Yugoslav Republic of Macedonia */
+    CTRY_MALAYSIA             = 458,     /* Malaysia */
+    CTRY_MALTA                = 470,     /* Malta */
+    CTRY_MEXICO               = 484,     /* Mexico */
+    CTRY_MONACO               = 492,     /* Principality of Monaco */
+    CTRY_MOROCCO              = 504,     /* Morocco */
+    CTRY_NEPAL                = 524,     /* Nepal */   
+    CTRY_NETHERLANDS          = 528,     /* Netherlands */
+    CTRY_NETHERLAND_ANTILLES  = 530,     /* Netherlands-Antilles */
+    CTRY_NEW_ZEALAND          = 554,     /* New Zealand */
+    CTRY_NICARAGUA            = 558,     /* Nicaragua */
+    CTRY_NORWAY               = 578,     /* Norway */
+    CTRY_OMAN                 = 512,     /* Oman */
+    CTRY_PAKISTAN             = 586,     /* Islamic Republic of Pakistan */
+    CTRY_PANAMA               = 591,     /* Panama */
+    CTRY_PARAGUAY             = 600,     /* Paraguay */
+    CTRY_PERU                 = 604,     /* Peru */
+    CTRY_PHILIPPINES          = 608,     /* Republic of the Philippines */
+    CTRY_POLAND               = 616,     /* Poland */
+    CTRY_PORTUGAL             = 620,     /* Portugal */
+    CTRY_PUERTO_RICO          = 630,     /* Puerto Rico */
+    CTRY_QATAR                = 634,     /* Qatar */
+    CTRY_ROMANIA              = 642,     /* Romania */
+    CTRY_RUSSIA               = 643,     /* Russia */
+    CTRY_RWANDA               = 646,     /* Rwanda */
+    CTRY_SAUDI_ARABIA         = 682,     /* Saudi Arabia */
+    CTRY_MONTENEGRO           = 891,     /* Montenegro */
+    CTRY_SINGAPORE            = 702,     /* Singapore */
+    CTRY_SLOVAKIA             = 703,     /* Slovak Republic */
+    CTRY_SLOVENIA             = 705,     /* Slovenia */
+    CTRY_SOUTH_AFRICA         = 710,     /* South Africa */
+    CTRY_SPAIN                = 724,     /* Spain */
+    CTRY_SRILANKA             = 144,     /* Sri Lanka */
+    CTRY_SWEDEN               = 752,     /* Sweden */
+    CTRY_SWITZERLAND          = 756,     /* Switzerland */
+    CTRY_SYRIA                = 760,     /* Syria */
+    CTRY_TAIWAN               = 158,     /* Taiwan */
+    CTRY_THAILAND             = 764,     /* Thailand */
+    CTRY_TRINIDAD_Y_TOBAGO    = 780,     /* Trinidad y Tobago */
+    CTRY_TUNISIA              = 788,     /* Tunisia */
+    CTRY_TURKEY               = 792,     /* Turkey */
+    CTRY_UAE                  = 784,     /* U.A.E. */
+    CTRY_UKRAINE              = 804,     /* Ukraine */
+    CTRY_UNITED_KINGDOM       = 826,     /* United Kingdom */
+    CTRY_UNITED_STATES        = 840,     /* United States (for STA) */
+    CTRY_UNITED_STATES_AP     = 841,     /* United States (for AP) */
+    CTRY_UNITED_STATES_PS     = 842,     /* United States - public safety */
+    CTRY_URUGUAY              = 858,     /* Uruguay */
+    CTRY_UZBEKISTAN           = 860,     /* Uzbekistan */
+    CTRY_VENEZUELA            = 862,     /* Venezuela */
+    CTRY_VIET_NAM             = 704,     /* Viet Nam */
+    CTRY_YEMEN                = 887,     /* Yemen */
+    CTRY_ZIMBABWE             = 716      /* Zimbabwe */
+};
+
+#define CTRY_DEBUG      0
+#define CTRY_DEFAULT    0x1ff
+#define REGCODE_COUNTRY_BIT 0x80000000
+
+typedef struct {
+    A_UINT16    countryCode;       
+    A_CHAR      isoName[3];
+} COUNTRY_CODE_MAP;
+#if 0
+static COUNTRY_CODE_MAP allCountries[] = {
+    {CTRY_DEBUG,        "DB"}, 
+    {CTRY_DEFAULT,      "NA"},
+    {CTRY_ALBANIA,      "AL"},
+    {CTRY_ALGERIA,      "DZ"},
+    {CTRY_ARGENTINA,    "AR"},
+    {CTRY_ARMENIA,      "AM"},
+    {CTRY_ARUBA,        "AW"},
+    {CTRY_AUSTRALIA,    "AU"},
+    {CTRY_AUSTRALIA_AP, "AU"},
+    {CTRY_AUSTRIA,      "AT"},
+    {CTRY_AZERBAIJAN,   "AZ"},
+    {CTRY_BAHRAIN,      "BH"},
+    {CTRY_BANGLADESH,   "BD"},
+    {CTRY_BARBADOS,     "BB"},
+    {CTRY_BELARUS,      "BY"},
+    {CTRY_BELGIUM,      "BE"},
+    {CTRY_BELIZE,       "BZ"},
+    {CTRY_BOLIVIA,      "BO"},
+    {CTRY_BOSNIA_HERZEGOWANIA,   "BA"},
+    {CTRY_BRAZIL,       "BR"},
+    {CTRY_BRUNEI_DARUSSALAM, "BN"},
+    {CTRY_BULGARIA,       "BG"},
+    {CTRY_CAMBODIA,       "KH"},
+    {CTRY_CANADA,         "CA"},
+    {CTRY_CANADA_AP,      "CA"},
+    {CTRY_CHILE,          "CL"},
+    {CTRY_CHINA,          "CN"},
+    {CTRY_COLOMBIA,       "CO"},
+    {CTRY_COSTA_RICA,     "CR"},
+    {CTRY_CROATIA,        "HR"},
+    {CTRY_CYPRUS,         "CY"},
+    {CTRY_CZECH,          "CZ"},
+    {CTRY_DENMARK,        "DK"},
+    {CTRY_DOMINICAN_REPUBLIC, "DO"},
+    {CTRY_ECUADOR,        "EC"},
+    {CTRY_EGYPT,          "EG"},
+    {CTRY_EL_SALVADOR,    "SV"},
+    {CTRY_ESTONIA,        "EE"},
+    {CTRY_FINLAND,        "FI"},
+    {CTRY_FRANCE,         "FR"},
+    {CTRY_FRANCE2,        "F2"},
+    {CTRY_GEORGIA,        "GE"},
+    {CTRY_GERMANY,        "DE"},
+    {CTRY_GREECE,         "GR"},
+    {CTRY_GREENLAND,      "GL"},
+    {CTRY_GRENADA,        "GD"},
+    {CTRY_GUAM,           "GU"},
+    {CTRY_GUATEMALA,      "GT"},
+    {CTRY_HAITI,          "HT"},
+    {CTRY_HONDURAS,       "HN"},
+    {CTRY_HONG_KONG,      "HK"},
+    {CTRY_HUNGARY,        "HU"},
+    {CTRY_ICELAND,        "IS"},
+    {CTRY_INDIA,          "IN"},
+    {CTRY_INDONESIA,      "ID"},
+    {CTRY_IRAN,           "IR"},
+    {CTRY_IRELAND,        "IE"},
+    {CTRY_ISRAEL,         "IL"},
+    {CTRY_ITALY,          "IT"},
+    {CTRY_JAMAICA,        "JM"},
+    {CTRY_JAPAN,          "JP"},
+    {CTRY_JORDAN,         "JO"},
+    {CTRY_KAZAKHSTAN,     "KZ"},
+    {CTRY_KENYA,          "KE"},
+    {CTRY_KOREA_NORTH,    "KP"},
+    {CTRY_KOREA_ROC,      "KR"},
+    {CTRY_KOREA_ROC2,     "K2"},
+    {CTRY_KOREA_ROC3,     "K3"},
+    {CTRY_KUWAIT,         "KW"},
+    {CTRY_LATVIA,         "LV"},
+    {CTRY_LEBANON,        "LB"},
+    {CTRY_LIECHTENSTEIN,  "LI"},
+    {CTRY_LITHUANIA,     "LT"},
+    {CTRY_LUXEMBOURG,    "LU"},
+    {CTRY_MACAU,         "MO"},
+    {CTRY_MACEDONIA,     "MK"},
+    {CTRY_MALAYSIA,      "MY"},
+    {CTRY_MALTA,         "MT"},
+    {CTRY_MEXICO,        "MX"},
+    {CTRY_MONACO,        "MC"},
+    {CTRY_MOROCCO,       "MA"},
+    {CTRY_NEPAL,         "NP"},
+    {CTRY_NEW_ZEALAND,   "NZ"},
+    {CTRY_NETHERLANDS,   "NL"},
+    {CTRY_NETHERLAND_ANTILLES,    "AN"},
+    {CTRY_NORWAY,         "NO"},
+    {CTRY_OMAN,           "OM"},
+    {CTRY_PAKISTAN,       "PK"},
+    {CTRY_PANAMA,         "PA"},
+    {CTRY_PERU,           "PE"},
+    {CTRY_PHILIPPINES,    "PH"},
+    {CTRY_POLAND,         "PL"},
+    {CTRY_PORTUGAL,       "PT"},
+    {CTRY_PUERTO_RICO,    "PR"},
+    {CTRY_QATAR,          "QA"},
+    {CTRY_ROMANIA,        "RO"},
+    {CTRY_RUSSIA,         "RU"},
+    {CTRY_RWANDA,         "RW"},
+    {CTRY_SAUDI_ARABIA,   "SA"},
+    {CTRY_MONTENEGRO,     "CS"},
+    {CTRY_SINGAPORE,      "SG"},
+    {CTRY_SLOVAKIA,       "SK"},
+    {CTRY_SLOVENIA,       "SI"},
+    {CTRY_SOUTH_AFRICA,   "ZA"},
+    {CTRY_SPAIN,          "ES"},
+    {CTRY_SRILANKA,       "LK"},
+    {CTRY_SWEDEN,         "SE"},
+    {CTRY_SWITZERLAND,    "CH"},
+    {CTRY_SYRIA,          "SY"},
+    {CTRY_TAIWAN,         "TW"},
+    {CTRY_THAILAND,       "TH"},
+    {CTRY_TRINIDAD_Y_TOBAGO, "TT"},
+    {CTRY_TUNISIA,        "TN"},
+    {CTRY_TURKEY,         "TR"},
+    {CTRY_UKRAINE,        "UA"},
+    {CTRY_UAE,            "AE"},
+    {CTRY_UNITED_KINGDOM, "GB"},
+    {CTRY_UNITED_STATES,    "US"},
+    {CTRY_UNITED_STATES_AP, "US"},
+    {CTRY_UNITED_STATES_PS, "PS"},
+    {CTRY_URUGUAY,        "UY"},
+    {CTRY_UZBEKISTAN,     "UZ"},    
+    {CTRY_VENEZUELA,      "VE"},
+    {CTRY_VIET_NAM,       "VN"},
+    {CTRY_YEMEN,          "YE"},
+    {CTRY_ZIMBABWE,       "ZW"}
+};
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WMI_CONFIG_H_ */
diff --git a/ath6kl-wmiconfig/wmiconfig b/ath6kl-wmiconfig/wmiconfig
new file mode 100755
index 0000000..958ded7
--- /dev/null
+++ b/ath6kl-wmiconfig/wmiconfig
Binary files differ
diff --git a/ath6kl-wmiconfig/wmiconfig.c b/ath6kl-wmiconfig/wmiconfig.c
new file mode 100755
index 0000000..5e5c2c3
--- /dev/null
+++ b/ath6kl-wmiconfig/wmiconfig.c
@@ -0,0 +1,3530 @@
+/*
+* Copyright (c) 2012 Qualcomm Atheros, Inc..
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
+#define SUPPORT_11N
+#include "libtcmd.h"
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdbool.h>
+#include <a_config.h>
+#include <a_osapi.h>
+#include <athdefs.h>
+#include <a_types.h>
+#include <wmi.h>
+
+#include "athdrv_linux.h"
+#include "ieee80211.h"
+#include "ieee80211_ioctl.h"
+#include "wmiconfig.h"
+#include "pkt_log.h"
+#include "wmi.h"
+#include "dbglog.h"
+#include "testcmd.h"
+
+#define TO_LOWER(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c)+ 0x20) : (c))
+
+#define ISDIGIT(c)  ( (((c) >= '0') && ((c) <= '9')) ? (1) : (0) )
+
+//static int send_connect_cmd();
+
+//static int send_scan_probedssid_cmd();
+
+static int _from_hex(char c);
+//static A_INT8 getPhyMode(char *pArg);
+
+static A_UINT16 wmic_ieee2freq(int chan);
+static A_STATUS wmic_ether_aton(const char *orig, A_UINT8 *eth);
+void            printTargetStats(TARGET_STATS *pStats);
+static A_STATUS
+wmic_get_ip(const char *ipstr, A_UINT32 *ip);
+A_STATUS
+wmic_validate_setkeepalive(WMI_SET_KEEPALIVE_CMD_EXT *cmd, char **argv);
+A_STATUS
+wmic_validate_roam_ctrl(WMI_SET_ROAM_CTRL_CMD *pRoamCtrl, A_UINT8 numArgs,
+                        char **argv);
+A_STATUS
+wmic_validate_appie(struct ieee80211req_getset_appiebuf *appIEInfo, char **argv);
+void rx_cb(void *buf, int len);
+A_STATUS
+wmic_validate_mgmtfilter(A_UINT32 *pMgmtFilter, char **argv);
+void convert_hexstring_bytearray(char *hexStr, A_UINT8 *byteArray,
+                                    A_UINT8 numBytes);
+//static int is_mac_null(A_UINT8 *mac);
+void print_wild_mac(unsigned char *mac, char wildcard);
+A_STATUS wmic_ether_aton_wild(const char *orig, A_UINT8 *eth, A_UINT8 *wild);
+void printBtcoexConfig(WMI_BTCOEX_CONFIG_EVENT * pConfig);
+void printBtcoexStats(WMI_BTCOEX_STATS_EVENT * pStats);
+#ifdef ATH_INCLUDE_PAL
+void *phy_attach(char *if_name);
+int pal_send_hci_cmd(void *dev, char *buf, short sz);
+int pal_send_acl_data_pkt(void *dev, char *buf, short sz);
+void cmdParser(A_UINT8 *cmd,A_UINT16 len);
+void palData(A_UINT8 *data,A_UINT32 len);
+extern int eventLogLevel; //To enable/disable Debug messages. defined in pal parser library
+
+const char palcommands[]=
+"--sendpalcmd <filename> <on/off> ; on - enable debug; off - disable debug \n\
+--sendpaldata <filename> <on/off>; on - enable debug; off - disable debug \n";
+#endif
+const char *progname;
+const char commands[] =
+"commands:\n\
+--version\n\
+--power <mode> where <mode> is rec or maxperf\n\
+--getpower is used to get the power mode(rec or maxperf)\n\
+--pmparams --it=<msec> --np=<number of PS POLL> --dp=<DTIM policy: ignore/normal/stick> --twp=<Tx wakeup policy: wakeup/sleep> --nt=<number of tx to wakeup>\n\
+--psparams --psPollTimer=<psPollTimeout> --triggerTimer=<triggerTimeout> --apsdTimPolicy=<ignore/adhere> --simulatedAPSDTimPolicy=<ignore/adhere>\n\
+--forceAssert \n\
+--ibsspmcaps --ps=<disable/atheros/ieee> --aw=<ATIM Windows in millisecond> --to=<TIMEOUT in millisecond> --ttl=<Time to live in number of beacon periods>\n\
+--appsparams --pstype=<disable/atheros> --psit=<millisecond> --psperiod=<in microsecond> --sleepperiod=<in psperiods>\n\
+--scan --fgstart=<sec> --fgend=<sec> --bg=<sec> --minact=<msec> maxact=<msec> --pas=<msec> --sr=<short scan ratio> --maxact2pas=<msec> --scanctrlflags <connScan> <scanConnected> <activeScan> <roamScan> <reportBSSINFO> <EnableAutoScan> --maxactscan_ssid=<Max no of active scan per probed ssid>\n\
+  where: \n\\n\
+  <connScan>           is 0 to not scan when Connect and Reconnect command, \n\
+                          1 to scan when Connect and Reconnect command, \n\
+  <scanConnected>      is 0 to skip the ssid it is already connected to, \n\
+                          1 to scan the ssid it is already connected to, \n\
+  <activeScan>         is 0 to disable active scan, \n\
+                          1 to enable active scan, \n\
+  <roamScan>           is 0 to disable roam scan when beacom miss and low rssi.(It's only valible when connScan is 0.\n\
+                          1 to enable roam scan.\n\
+  <reportBSSINFO>      is 0 to disable specified BSSINFO reporting rule.\n\
+                          1 to enable specified BSSINFO reporting rule.\n\
+ <EnableAutoScan>      is 0 to disable autonomous scan. No scan after a disconnect event\n\
+                          1 Enable autonomous scan.\n\
+--listen=<#of TUs, can  range from 15 to 5000>\n\
+--listenbeacons=<#of beacons, can  range from 1 to 50>\n\
+--setbmisstime <#of TUs, can range from 1000 to 5000>\n\
+--setbmissbeacons <#of beacons, can range from 5 to 50>\n\
+--filter=<filter> --ieMask 0x<mask> where <filter> is none, all, profile, not_profile, bss, not_bss, or ssid and <mask> is a combination of the following\n\
+{\n\
+    BSS_ELEMID_CHANSWITCH = 0x01 \n\
+    BSS_ELEMID_ATHEROS = 0x02\n\
+}\n\
+--wmode <mode> <list> sc <scan> where \n\
+        <mode> is a, g, b,ag, gonly (use mode alone in AP mode) \n\
+        <list> is a list of channels (frequencies in mhz or ieee channel numbers)\n\
+        <scan> is 0 to disable scan after setting channel list.\n\
+                  1 to enable scan after setting channel list.\n\
+--getwmode \n\
+--ssid <index> <ssid> \n\
+        where <ssid> is the wireless network string,'any' mean empty ssid, 'off' means disable \n\
+              <index> is 0 ~ 15 \n\
+--badAP=<macaddr> [--num=<index>] where macaddr is macaddr of AP to be avoided in xx:xx:xx:xx:xx:xx format, and num is index from 0-1.\n\
+--clrAP [--num=<index>] is used to clear a badAP entry.  num is index from 0-1\n\
+--createqos <user priority> <direction> <traffic class> <trafficType> <voice PS capability> \n\
+    <min service interval> <max service interval> <inactivity interval> <suspension interval> \n\
+    <service start time> <tsid> <nominal MSDU> <max MSDU> <min data rate> <mean data rate> \n\
+    <peak data rate> <max burst size> <delay bound> <min phy rate> <sba> <medium time>where:\n\
+        <user priority>         802.1D user priority range : 0-7        \n\
+        <direction>             is 0 for Tx(uplink) traffic,            \n\
+                                   1 for Rx(downlink) traffic,          \n\
+                                   2 for bi-directional traffic;        \n\
+        <traffic class>         is 0 for BE,                            \n\
+                                   1 for BK,                            \n\
+                                   2 for VI,                            \n\
+                                   3 for VO;                            \n\
+        <trafficType>           1-periodic, 0-aperiodic                 \n\
+        <voice PS capability>   specifies whether the voice power save mechanism \n\
+                                (APSD if AP supports it or legacy/simulated APSD \n\
+                                    [using PS-Poll] ) should be used             \n\
+                                = 0 to disable voice power save for this traffic class,\n\
+                                = 1 to enable APSD voice power save for this traffic class,\n\
+                                = 2 to enable voice power save for ALL traffic classes,\n\
+        <min service interval>  in milliseconds                     \n\
+        <max service interval>  in milliseconds                     \n\
+        <inactivity interval>   in milliseconds;=0 means infinite inactivity interval\n\
+        <suspension interval>   in milliseconds \n\
+        <service start time>    service start time \n\
+        <tsid>                  TSID range: 0-15                    \n\
+        <nominal MSDU>          nominal MAC SDU size                \n\
+        <max MSDU>              maximum MAC SDU size                \n\
+        <min data rate>         min data rate in bps                \n\
+        <mean data rate>        mean data rate in bps               \n\
+        <peak data rate>        peak data rate in bps               \n\
+        <max burst size>        max burst size in bps               \n\
+        <delay bound>           delay bound                         \n\
+        <min phy rate>          min phy rate in bps                 \n\
+        <sba>                   surplus bandwidth allowance         \n\
+        <medium time>           medium time in TU of 32-us periods per sec    \n\
+--deleteqos <trafficClass> <tsid> where:\n\
+  <traffic class>         is 0 for BE,                            \n\
+                             1 for BK,                            \n\
+                             2 for VI,                            \n\
+                             3 for VO;                            \n\
+  <tsid> is the TspecID, use --qosqueue option to get the active tsids\n\
+--qosqueue <traffic class>, where:\n\
+  <traffic class>         is 0 for BE,                            \n\
+                             1 for BK,                            \n\
+                             2 for VI,                            \n\
+                             3 for VO;                            \n\
+--getTargetStats --clearStats\n\
+   tx_unicast_rate, rx_unicast_rate values will be 0Kbps when no tx/rx \n\
+   unicast data frame is received.\n\
+--setErrorReportingBitmask\n\
+--acparams --acval <0-3> --txop <limit> --cwmin <0-15> --cwmax <0-15> --aifsn<0-15>\n\
+--disc=<timeout> to set the disconnect timeout in seconds\n\
+--mode <mode> set the optional mode, where mode is special or off \n\
+--sendframe <frmType> <dstaddr> <bssid> <optIEDatalen> <optIEData> where:\n\
+  <frmType>   is 1 for probe request frame,\n\
+                 2 for probe response frame,\n\
+                 3 for CPPP start,\n\
+                 4 for CPPP stop, \n\
+  <dstaddr>   is the destination mac address, in xx:xx:xx:xx:xx:xx format, \n\
+  <bssid>     is the bssid, in xx:xx:xx:xx:xx:xx format, \n\
+  <optIEDatalen> optional IE data length,\n\
+  <optIEData> is the pointer to optional IE data arrary \n\
+--adhocbssid <macaddr> where macaddr is the BSSID for IBSS to be created in xx:xx:xx:xx:xx:xx format\n\
+--beaconintvl   <beacon_interval in milliseonds> \n\
+--getbeaconintvl \n\
+--setretrylimits  <frameType> <trafficClass> <maxRetries> <enableNotify>\n\
+  <frameType>      is 0 for management frame, \n\
+                      1 for control frame,\n\
+                      2,for data frame;\n\
+  <trafficClass>   is 0 for BE, 1 for BK, 2 for VI, 3 for VO, only applies to data frame type\n\
+  <maxRetries>     is # in [2 - 13];      \n\
+  <enableNotify>   is \"on\" to enable the notification of max retries exceed \n\
+                      \"off\" to disable the notification of max retries excedd \n\
+--rssiThreshold <weight> <pollTimer> <above_threshold_tag_1> <above_threshold_val_1> ... \n\
+                <above_threshold_tag_6> <above_threshold_val_6> \n\
+                <below_threshold_tag_1> <below_threshold_val_1> ... \n\
+                <below_threshold_tag_6> <below_threshold_val_6> \n\
+  <weight>        share with snrThreshold\n\
+  <threshold_x>   will be converted to negatvie value automatically, \n\
+                   i.e. input 90, actually -90 will be set into HW\n\
+  <pollTimer>     is timer to poll rssi value(factor of LI), set to 0 will disable all thresholds\n\
+                 \n\
+--snrThreshold <weight> <upper_threshold_1> ... <upper_threshold_4> \n\
+               <lower_threshold_1> ... <lower_threshold_4> <pollTimer>\n\
+  <weight>        share with rssiThreshold\n\
+  <threshold_x>  is positive value, in ascending order\n\
+  <pollTimer>     is timer to poll snr value(factor of LI), set to 0 will disable all thresholds\n\
+                 \n\
+--cleanRssiSnr \n\
+--lqThreshold <enable> <upper_threshold_1>  ... <upper_threshold_4>\n\
+              <lower_threshold_1> ... <lower_threshold_4>\n\
+   <enable>       is 0 for disable,\n\
+                     1 for enable lqThreshold\n\
+   <threshold_x>  is in ascending order            \n\
+--setlongpreamble <enable>\n\
+    <enable>      is 0 for diable,\n\
+                     1 for enable.\n\
+--setRTS  <pkt length threshold>\n\
+--getRTS \n\
+--startscan   --homeDwellTime=<msec> --forceScanInt<ms> --forceScanFlags <scan type> <forcefgscan> <isLegacyCisco> --scanlist <list> where:\n\
+  <homeDwellTime>     Maximum duration in the home channel(milliseconds),\n\
+  <forceScanInt>      Time interval between scans (milliseconds),\n\
+    <scan type>     is 0 for long scan,\n\
+                     1 for short scan,\n\
+  <forcefgscan>   is 0 for disable force fgscan,\n\
+                     1 for enable force fgscan,\n\
+  <isLegacyCisco> is 0 for disable legacy Cisco AP compatible,\n\
+                     1 for enable legacy Cisco AP compatible,\n\
+  <list> is a list of channels (frequencies in mhz or ieee channel numbers)\n\
+--setfixrates <rate index> where: \n\
+  <rate index> is {0 1M},{1 2M},{2 5.5M},{3 11M},{4 6M},{5 9M},{6 12M},{7 18M},{8 24M},{9 36M},{10 48M},{11 54M},\n\
+  if want to config more rare index, can use blank to space out, such as: --setfixrates 0 1 2 \n\
+--getfixrates : Get the fix rate index from target\n\
+--setauthmode <mode> where:\n\
+  <mode>        is 0 to do authentication when reconnect, \n\
+                   1 to not do authentication when reconnect.(not clean key). \n\
+--setreassocmode <mode> where:\n\
+  <mode>        is 0 do send disassoc when reassociation, \n\
+                   1 do not send disassoc when reassociation. \n\
+--setVoicePktSize  is maximum size of voice packet \n\
+--setMaxSPLength   is the maximum service period in packets, as applicable in APSD \n\
+                   0 - deliver all packets \n\
+                   1 - deliver up to 2 packets \n\
+                   2 - deliver up to 4 packets \n\
+                   3 - deliver up to 6 packets \n\
+--setAssocIe <IE String>\n\
+--roam <roamctrl> <info>\n\
+       where <roamctrl> is   1  force a roam to specified bssid\n\
+                             2  set the roam mode \n\
+                             3  set the host bias of the specified BSSID\n\
+                             4 set the lowrssi scan parameters \n\
+      where <info> is BSSID<aa:bb:cc:dd:ee:ff> for roamctrl of 1\n\
+                      DEFAULT ,BSSBIAS or LOCK for roamctrl of 2\n\
+                      BSSID<aa:bb:cc:dd:ee:ff> <bias> for  roamctrl of 3\n\
+                             where <bias> is  a value between -256 and 255\n\
+                      <scan period> <scan threshold> <roam threshold> \n\
+                      <roam rssi floor> for roamctrl of 4\n\
+--getroamtable\n\
+--getroamdata\n\
+--wlan <enable/disable/query>\n\
+--bt <on/off/query>\n\
+--setBTstatus <streamType> <status>\n\
+      where <streamType> is    1 - Bluetooth SCO stream\n\
+                               2 - Bluetooth A2DP stream\n\
+                               3 - Bluetooth Inquiry/low priority stream\n\
+                               4 - Bluetooth E-SCO stream\n\
+      \n\
+      where <status> is        1 - stream started\n\
+                               2 - stream stopped\n\
+                               3 - stream resumed\n\
+                               4 - stream suspended\n\
+--setBTparams <paramType> <params>\n\
+      where <paramType> is     1 - Bluetooth SCO stream parameters\n\
+                               2 - Bluetooth A2DP stream parameters \n\
+                               3 - Front end antenna configuration \n\
+                               4 - Co-located Bluetooth configuration\n\
+                               5 - Bluetooth ACL coex (non-a2dp) parameters\n\
+                               6 - 11a is using a separate antenna\n\
+      \n\
+      where <params> for Bluetooth SCO are:\n\
+              <numScoCyclesForceTrigger> - number of Sco cyles, to force a trigger\n\
+               <dataResponseTimeout> - timeout for receiving downlink packet per PS-poll\n\
+               <stompScoRules> - Applicable for dual/splitter front end\n\
+                           1, Never stomp BT to receive downlink pkt\n\
+                           2, Always stomp BT to receive downlink pkt\n\
+                           3, Stomp BT only during low rssi conditions\n\
+               <stompDutyCyleVal> If Sco is stomped while waiting for downlink pkt, number sco cyles to not queue ps-poll-(Applicable only for switch FE)\n\
+              <psPollLatencyFraction> Fraction of idle SCO idle time.\n\
+                           1, if more than 3/4 idle duration is left, retrieve downlink pkt\n\
+                           2, if more than 1/2 idle duration is left, retrieve downlink pkt\n\
+                           3, if more 1/4 idle duration is left, retrieve dwnlink pkt\n\
+               <SCO slots> - number of Tx+Rx SCO slots : 2 for single-slot SCO, 6 for 3-slot SCO\n\
+          <Idle SCO slots> - number of idle slots between two SCO Tx+Rx instances\n\
+      \n\
+      where <params> for A2DP configuration are\n\
+      <a2dpWlanUsageLimit> Max duration wlan can use the medium ,whenever firmware detects medium for wlan (in msecs) \n\
+     <a2dpBurstCntMin> Mininum number of bluetooth data frames to replenish wlan usage time\n\
+     <a2dpDataRespTimeout> Time to wait for downlink data, after queuing pspoll\n\
+      where <params> for front end antenna configuration are\n\
+      1 - Dual antenna configuration (BT and wlan have seperate antenna) \n\
+      2 - Single antenna splitter configuration \n\
+      3 - Single antenna switch  configuration \n\
+      \n\
+      where <params> for co-located Bluetooth configuration are\n\
+      0 - Qualcomm BTS402x (default)\n\
+      1 - CSR Bluetooth\n\
+      2 - Atheros Bluetooth\n\
+      \n\
+      where <params> for Bluetooth ACL coex(bt ftp or bt OPP or other data based ACL profile (non a2dp)  parameter are \n\
+      <aclWlanMediumUsageTime> Usage time for Wlan.(default 30 msecs)\n\
+      <aclBtMediumUsageTime> Usage time for bluetooth (default 30 msecs)\n\
+      <aclDataRespTimeout> - timeout for receiving downlink packet per PS-poll\n\
+--setbtcoexfeant <antType> \n\
+       <antType> - Front end antenna type\n\
+       1 - Single antenna\n\
+       2 - Dual antenna\n\
+       3 - Dual antenna high isolation\n\
+       4 - bypass mode\n\
+       5 - combine mode\n\
+--setbtcoexcolocatedbt <btdevType >\n\
+        <btdevType> Co-located bluetooth device\n\
+        1 - Qualcomm BTS402X \n\
+        2 - CSR BC06 bluetooth \n\
+        3 - Atheros 3001 bluetooth\n\
+        4 - ST-ericssion CG2900 \n\
+        5 - Atheros 3002/MCI \n\
+--setbtcoexscoconfig <noscoSlots> <noidleslots> <scoflags> <linkid> <scoCyclesForceTrigger> <scoDataResponseTimeout> <scoStompDutyCyleVal> <scoStompDutyCyleMaxVal> <scoPsPollLatencyFraction> <scoStompCntIn100ms> <scoContStompMax> <scoMinlowRateMbps> <scoLowRateCnt> <scoHighPktRatio> <scoMaxAggrSize>\n\
+--setbtcoexa2dpconfig <a2dpFlags> <linkid> <a2dpWlanMaxDur> <a2dpMinBurstCnt> <a2dpDataRespTimeout> <a2dpMinlowRateMbps> <a2dpLowRateCnt> <a2dpHighPktRatio> <a2dpMaxAggrSize> <a2dpPktStompCnt>\n\
+--setbtcoexaclcoexconfig <aclWlanMediumDur> <aclBtMediumDur> <aclDetectTimeout> <aclPktCntLowerLimit> <aclIterForEnDis> <aclPktCntUpperLimit> <aclCoexFlags> <linkId> <aclDataRespTimeout> <aclCoexMinlowRateMbps> <aclCoexLowRateCnt> <aclCoexHighPktRatio> <aclCoexMaxAggrSize> <aclPktStompCnt>  \n\
+--setbtcoexbtinquirypageconfig <btInquiryDataFetchFrequency> <protectBmissDurPostBtInquiry> <btInquiryPageFlag>\n\
+--setbtcoexbtoperatingstatus <btprofiletype> <btoperatingstatus> <btlinkid>\n\
+        <btprofiletype> - Bluetooth profile\n\
+        1 - Bluetooth SCO profile \n\
+        2 - Bluetooth A2DP profile \n\
+        3 - Bluetooth Inquiry Page profile \n\
+        4 - Bluetooth ACL (non-a2dp) profile \n\
+        \n\
+        <btoperatingstatus>  profile operating status \n\
+        1 - start \n\
+        2 - stop \n\
+        \n\
+        <btlinkid> bluetooth link id -Applicable only for STE Bluetooth\n\
+        \n\
+--setbtcoexdebug <params1> <params2> <params3> <params4> <params5> \n\
+--getbtcoexconfig <btprofile> <linkid>\n\
+        <btprofile> - bluetooth profile \n\
+        1 - Bluetooth SCO profile \n\
+        2 - Bluetooth A2DP profile \n\
+        3 - Bluetooth Inquiry Page profile \n\
+        4 - Bluetooth ACL (non-a2dp) profile \n\
+        \n\
+    <btlinkid> bluetooth link id -Applicable only for STE Bluetooth\n\
+    \n\
+\n\
+--getbtcoexstats\n\
+--detecterror --frequency=<sec> --threshold=<count> where:\n\
+  <frequency>   is the periodicity of the challenge messages in seconds, \n\
+  <threshold>   is the number of challenge misses after which the error detection module in the driver will report an error, \n\
+--getheartbeat --cookie=<cookie>\n\
+  <cookie>  is used to identify the response corresponding to a challenge sent\n\
+--usersetkeys --initrsc=<on/off>\n\
+  initrsc=on(off> initialises(doesnot initialise) the RSC in the firmware\n\
+--getRD\n\
+--setcountry <countryCode> (Use --countrycodes for list of codes)\n\
+--countrycodes (Lists all the valid country codes)\n\
+--getcountry \n\
+--disableregulatory\n\
+--txopbursting <burstEnable>\n\
+        where <burstEnable> is  0 disallow TxOp bursting\n\
+                                1 allow TxOp bursting\n\
+--diagread\n\
+--diagwrite\n\
+--setkeepalive <keepalive interval> <keepalive mode> <peer mac address> <arp src ip> <arp tgt ip>\n\
+  <keepalive interval> is the time within which if there is no transmission/reception activity, the station sends a null packet to AP.\n\
+  <keepalive mode> 1: NULL data frame (default)\n\
+		   2: ARP response \n\
+		   3: both \n\
+  valid if <keepalive mode> is 2 or 3:\n\
+  <peer mac address>: target mac address for arp response\n\
+  <arp src ip>: host ip\n\
+  <arp tgt ip>: arp response target ip\n\
+--getkeepalive\n\
+--setappie <frame> <IE>\n\
+         where frame is one of beacon, probe, respon, assoc\n\
+               IE is a hex string starting with dd\n\
+               if IE is 0 then no IE is sent in the management frame\n\
+--setmgmtfilter <op> <frametype>\n\
+                op is one of set, clear\n\
+                frametype is one of beacon proberesp\n\
+--setdbglogconfig --mmask=<mask> --rep=<0/1> --tsr=<tsr codes> --size=<num>\n\
+         where <mask> is a 16 bit wide mask to selectively enable logging for different modules. Example: 0xFFFD enables logging for all modules except WMI. The mask is derived from the module ids defined in etna/include/dbglog.h header file.\n\
+               <rep> is whether the target should generate log events to the host whenever the log buffer is full.\n\
+               <tsr> resolution of the debug timestamp (less than 16)\n\
+                     0: 31.25 us\n\
+                     1: 62.50 us\n\
+                     2: 125.0 us\n\
+                     3: 250.0 us\n\
+                     4: 500.0 us\n\
+                     5: 1.0 ms and so on.\n\
+               <size> size of the report in number of debug logs.\n\
+--getdbglogs\n\
+--sethostmode <mode>\n\
+  where <mode> is awake\n\
+                  asleep\n\
+--setwowmode <mode> --wowfilter <filter> --hostreqdelay <hostreqdelay> \n\
+  where <mode> is enable \n\
+                  disable\n\
+  where <filter> is ssid -to enable ssid filtering when asleep\n\
+                    none \n\
+--getwowlist <listid> \n\
+--addwowpattern <list-id> <pattern-size> <pattern-offset> <pattern> <pattern-mask \n\
+--delwowpattern <list-id> <pattern-id>\n\
+--dumpchipmem \n\
+--dumpchipmem_venus \n\
+--setconnectctrl <ctrl flags bitmask> \n\
+  where <flags> could take the following values:\n\
+      0x0001(CONNECT_ASSOC_POLICY_USER): Assoc frames are sent using the policy specified by the flag below.\n\
+      0x0002(CONNECT_SEND_REASSOC): Send Reassoc frame while connecting otherwise send assoc frames.\n\
+      0x0004(CONNECT_IGNORE_WPAx_GROUP_CIPHER): Ignore WPAx group cipher for WPA/WPA2.\n\
+      0x0008(CONNECT_PROFILE_MATCH_DONE): Ignore any profile check.\n\
+      0x0010(CONNECT_IGNORE_AAC_BEACON): Ignore the admission control beacon.\n\
+      0x0020(CONNECT_CSA_FOLLOW_BSS):Set to Follow BSS to the new channel and connect \n\
+                                 and reset to disconnect from BSS and change channel \n\
+--dumpcreditstates \n\
+      Triggers the HTC layer to dump credit state information to the debugger \n\
+--setakmp --multipmkid=<on/off>\n\
+  multipmkid=on(off> enables(doesnot enable) Multi PMKID Caching in firmware\n\
+--setpmkidlist --numpmkid=<n> --pmkid=<pmkid_1> ... --pmkid=<pmkid_n>\n\
+   where n is the number of pmkids (max 8)\n\
+   and pmkid_i is the ith pmkid (16 bytes in hex format)\n\
+--setbsspmkid --bssid=<aabbccddeeff> --bsspmkid=<pmkid>\n\
+   bssid is 6 bytes in hex format\n\
+   bsspmkid is 16 bytes in hex format\n\
+--getpmkidlist \n\
+--abortscan \n\
+--settgtevt <event value>\n\
+      where <event value> is  0 send WMI_DISCONNECT_EVENT with disconnectReason = BSS_DISCONNECTED\n\
+                                after re-connection with AP\n\
+                              1 NOT send WMI_DISCONNECT_EVENT with disconnectReason = BSS_DISCONNECTED\n\
+                                after re-connection with AP\n\
+--getsta \n\
+--hiddenssid <value> \n\
+    where value 1-Enable, 0-Disable. \n\
+--gethiddenssid \n\
+--numsta <num> \n\
+--gnumsta <num> \n\
+--getnumsta \n\
+--getgnumsta \n\
+--conninact <period> \n\
+    where period is time in min (default 5min). \n\
+    0 will disable STA inactivity check. \n\
+--protectionscan <period> <dwell> \n\
+    where period is in min (default 5min). 0 will disable. \n\
+    dwell is in ms. (default 200ms). \n\
+--addacl <mac> \n\
+    where mac is of the format xx:xx:xx:xx:xx:xx \n\
+--delacl <index> \n\
+    use --getacl to get index \n\
+--getacl \n\
+--aclpolicy <policy> <retain list> \n\
+    where <policy> \n\
+        0 - Disable ACL \n\
+        1 - Allow MAC \n\
+        2 - Deny MAC \n\
+          <retain list> \n\
+        0 - Clear the current ACL list \n\
+        1 - Retain the current ACL list \n\
+--removesta <action> <reason> <mac> \n\
+    where <action>  \n\
+            2 - Disassoc    \n\
+            3 - Deauth      \n\
+          <reason> protocol reason code, use 1 when in doubt \n\
+          <mac> mac addr of a connected STA            \n\
+--dtim <period> \n\
+--getdtim \n\
+--intrabss <ctrl> \n\
+    where <ctrl> 0 - Disable, 1 - Enable (default) \n\
+--interbss <ctrl> \n\
+    where <ctrl> 0 - Disable, 1 - Enable (default) \n\
+--apgetstats \n\
+--apclearstats \n\
+--acsdisablehichannels <0/1> \n\
+    where 0 - ACS will choose 1, 6 or 11 \n\
+          1 - ACS will choose 1, 6 or 11 \n\
+--commit \n\
+--ip arg, arg may be \n\
+   none  - resets ip \n\
+   x.x.x.x - ip addr is dotted form\n\
+--set_ht_cap <band> <enable> <supported channel width set> <short GI 20MHz> <short GI 40MHz> <40MHz intolerant> <max AMPDU len exponent> \n\
+    where <band> : 'g' for 2.4 GHZ or 'a' for 5GHZ \n\
+    <enable> : 0 to disable 11n in band, 1 to enable 11n in band \n\
+    <supported channel width set> : 0 if only 20MHz operation supported \n\
+                                          1 if 20MHz and 40MHz operation supported \n\
+    <short GI 20MHz> : 0 if not supported, 1 if supported \n\
+    <short GI 40MHz> : 0 if not supported, 1 if supported \n\
+    <40MHz intolerant> : 1 if prohibit a receing AP from operating as a 20/40 MHz BSS \n\
+                         0 otherwise \n\
+    <max AMPDU len exponent> : valid values from 0 to 3 \n\
+--dump_recv_aggr_stats \n\
+--setup_aggr <tid> <aid> \n\
+        where <aid> = aid of a connected STA. Ignored in STA mode \n\
+--allow_aggr <tx_tid_mask>  <rx_tid_mask> \n\
+--dele_aggr <tid>  <direction> <aid> \n\
+        where <direction> =1 uplink; \n\
+                          =0 dnlink  \n\
+              <aid> = aid of a connected STA. Ignored in STA mode \n\
+--set_ht_op <STA channel width> : 0 if only allow 20MHz channel width\n\
+                                  1 if allow any channel width in the supported channel width set \n\
+--wlan_conn_prec <prec_val> \n\
+        where 0: WLAN connection will have precedence;\n\
+              1: PAL connection will have precedence;\n\
+--settxselrates <11A ratemask> <11G ratemask> <11B ratemask> <11GOnly ratemask> <11A_HT20 ratemask> <11G_HT20 ratemask> \
+<11A_HT40 ratemask> <11G_HT40 ratemask> where all rate masks are hex integers. \n\
+--aprateset <val> \n\
+        where 1: RateSet#1 - 1,2,5.5,11 basic rates (default)\n\
+              2: RateSet#2 - 1,2,5.5,11,6,12,24 basic rates\n\
+--connect <ssid> \n\
+--connect <ssid> --wpa <ver> <ucipher> <mcipher> <psk> \n\
+--connect <ssid> --wep <mode> <def_keyix> <key1> <key2*> <key3*> <key4*> \n\
+        where   <ssid>     : SSID of network \n\
+                <ver>      : 1 - WPA, 2 - RSN   \n\
+                <ucipher>  : TKIP or CCMP for unicast \n\
+                <mcipher>  : TKIP or CCMP for multicast \n\
+                <psk>      : passphrase for WPA    \n\
+                <mode>     : open or shared    \n\
+                <def_keyix>: Default TX wep key index  [1-4] \n\
+                <key>      : wep key   \n\
+                *          : optional parameters  \n\
+--set_tx_sgi --masksgi <mask> --persgi <value> \n\
+         where <mask> is a 32 bit hexadecimal value (eg: 0x0808000 or 08080000) to select desired MCS and ht20/ht40 SGI implementation (refer spec for bit location of each MCS)\n\
+             For disabling SGI enter 0x00000000 or 0.\n\
+             If mask is not entered, the default mask is 0x08080000 which enables MCS 7 to use SGI for both ht20 and ht40, when set_tx_sgi command is issued \n\
+         where  <value> is the acceptable loss percentage for Packet Error Rate (PER) for SGI (default : 10)\n\
+--set_dfs <enable> \n\
+        where  <enable> : 1 to allow DFS \n\
+                        : 0 to disable DFS \n\
+--setdivparam <idleTime> <RSSIThresh> <Enable> <Threshold Rate> \n\
+        where <idleTime> : time in ms where the idle timer would start checking the other antenna (default: 10000) \n\
+                  <RSSIThresh> : in db, where the firmware will check the other antenna if the RSSI drops below this delta (default: 10) \n\
+                  <Enable> : 1 to enable diversity \n\
+                  <Threshold Rate> : in Mbps, where the firmware will block the idleTimer if the throughput is above this rate (default 48) \n\
+--scanprobedssid <ssid> where <ssid> is the wireless network string to scan. Broadcast probe will not be sent .  Set ssid to 'off' or 'any' to send broadcast probe requests \n\
+--ap_apsd <value> \n\
+    where value 1-Enable, 0-Disable \n\
+--get_ht_cap <band> \n\
+    where <band> : 'g' for 2.4 GHZ or 'a' for 5GHZ \n\
+--set_mcast_rate <value> \n\
+    where value is rate in units of 100 Kbps \n\
+    Valid values are 10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540 \n\
+--enablevoicedetection <enable> \n\
+        where  <enable> : 1 to enable voice detection \n\
+                        : 0 to disable voice detection \n\
+--txe-notify <rate> <pkts> <intvl> \n\
+	send a TXE_NOTIFY_EVENT when <rate>% of <pkts> in given <intvl> fail to be transmitted to current AP.\n\
+--setrecoverysim <type> <delay_time_ms> \n\
+        where  <type>   : 1 assert \n\
+                        : 2 not respond detect command \n\
+                        : 3 simulate ep-full (disable wmi control ep), use 'echo 60>keepalive' trigger\n\
+                        : 4 null access \n\
+                        : 5: stack overflow\n\
+        <delay_time_ms> : 0~65534 ,delay time ms\n\
+                        : 65535 ,delay random time( 0~65535) ms\n\
+--disablebcast <enable> \n\
+--blwl <control> <index> <mac> \n\
+        where  <control>: 0 disable blwl \n\
+                        : 1 enable blwl \n\
+                        : 2 add white mac \n\
+                        : 3 add black mac \n\
+                        : 4 reset whitelist \n\
+                        : 5 reset blacklist \n\
+         <index>        : valid when control=2 3 4 5, mac address index [0,9] \n\
+         <mac>          : valid when control=2 3 4 5, mac address xx:xx:xx:xx:xx:xx  \n\
+--setrssifilter <snr_value> \n\
+	where <snr_value> : 0~127 the rssi value, (DBM: value-95dbm) \n\
+";
+
+A_UINT32 mercuryAdd[5][2] = {
+            {0x20000, 0x200fc},
+            {0x28000, 0x28800},
+            {0x20800, 0x20a40},
+            {0x21000, 0x212f0},
+            {0x500000, 0x500000+184*1024},
+        };
+
+typedef struct chip_internal_t{
+    A_UINT32 addr_st;
+    A_UINT32 addr_end;
+    A_UINT8 *info;
+}CHIP_INTERNAL;
+
+CHIP_INTERNAL venus_internal[8] = {
+            {0x20000, 0x200fc, (A_UINT8 *)"General DMA and recv related registers"},
+            {0x28000, 0x28900, (A_UINT8 *)"MAC PCU register & keycache"},
+            {0x20800, 0x20a40, (A_UINT8 *)"QCU"},
+            {0x21000, 0x212f0, (A_UINT8 *)"DCU"},
+            {0x4000,  0x42e4,  (A_UINT8 *)"RTC"},
+            {0x540000, 0x540000+256*1024, (A_UINT8 *)"RAM"},
+            {0x29800, 0x2B210, (A_UINT8 *)"BB"},
+            {0x1C000, 0x1C748, (A_UINT8 *)"Analog"},
+        };
+
+
+
+static void
+usage(void)
+{
+    fprintf(stderr, "usage:\n%s [-i device] commands\n", progname);
+    fprintf(stderr, "%s\n", commands);
+#ifdef ATH_INCLUDE_PAL
+    fprintf(stderr, "%s\n", palcommands);
+#endif
+    fprintf(stderr, "The options can be given in any order\n");
+    exit(-1);
+}
+
+/* List of Country codes */
+char    *my_ctr[] = {
+    "DB", "NA", "AL", "DZ", "AR", "AM", "AU", "AT", "AZ", "BH", "BY", "BE", "BZ", "BO", "BR", "BN",
+    "BG", "CA", "CL", "CN", "CO", "CR", "HR", "CY", "CZ", "DK", "DO", "EC", "EG", "SV", "EE", "FI",
+    "FR", "GE", "DE", "GR", "GT", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IE", "IL", "IT", "JP",
+    "JO", "KZ", "KP", "KR", "K2", "KW", "LV", "LB", "LI", "LT", "LU",
+    "MO", "MK", "MY", "MX", "MC", "MA", "NL", "NZ", "NO", "OM", "PK", "PA", "PE", "PH", "PL", "PT",
+    "PR", "QA", "RO", "RU", "SA", "SG", "SK", "SI", "ZA", "ES", "SE", "CH", "SY", "TW", "TH", "TT",
+    "TN", "TR", "UA", "AE", "GB", "US", "UY", "UZ", "VE", "VN", "YE", "ZW"
+    };
+
+const char *targ_reg_name[] = {
+"zero", "pc", "lbeg", "lend", "lcount", "sar", "litbaddr", "ps",
+"brtarg", "epc1", "epc2", "epc3", "epc4", "windowbase", "windowstart", "zero",
+"zero", "zero", "zero", "zero", "zero", "zero", "zero", "zero",
+"zero", "zero", "zero", "zero", "zero", "zero", "zero", "zero",
+"ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",
+"ar8", "ar9", "ar10", "ar11", "ar12", "ar13", "ar14", "ar15",
+"ar16", "ar17", "ar18", "ar19", "ar20", "ar21", "ar22", "ar23",
+"ar24", "ar25", "ar26", "ar27", "ar28", "ar29", "ar30", "ar31",
+};
+
+#ifdef ATH_INCLUDE_PAL
+
+A_INT32
+get_input_choice(char *fname,A_UINT8 *pdu, A_UINT16 *sz)
+{
+    int fhdl;
+    A_INT32 ret = -1;
+    fhdl = open(fname, O_RDONLY);
+    if(fhdl != -1)
+    {
+        *sz  = read(fhdl, pdu,MAX_BUFFER_SIZE);
+        close(fhdl);
+        ret = 0;
+    }
+    return ret;
+}
+
+
+#endif
+int
+main (int argc, char **argv)
+{
+    int c, error;
+    char ifname[IFNAMSIZ];
+    unsigned int cmd = 0;
+    progname = argv[0];
+    char *buf = malloc(sizeof(PACKET_LOG));
+    int clearstat = 0;
+    
+
+WMI_DISABLE_BCAST_IN_PM_CMD *disableBcastCmd = (WMI_DISABLE_BCAST_IN_PM_CMD *) (buf+4);
+    WMI_LISTEN_INT_CMD *listenCmd         = (WMI_LISTEN_INT_CMD*)buf;
+    WMI_BMISS_TIME_CMD *bmissCmd         = (WMI_BMISS_TIME_CMD*)buf;
+
+    WMI_POWER_MODE_CMD *pwrCmd         = (WMI_POWER_MODE_CMD *)buf;
+    WMI_SET_MCAST_FILTER_CMD *sMcastFilterCmd       = (WMI_SET_MCAST_FILTER_CMD *)(buf + 4);
+    WMI_MCAST_FILTER_CMD *mcastFilterCmd       = (WMI_MCAST_FILTER_CMD *)(buf + 4);
+    WMI_IBSS_PM_CAPS_CMD *adhocPmCmd   = (WMI_IBSS_PM_CAPS_CMD *)buf;
+    WMI_AP_PS_CMD *apPsCmd             = (WMI_AP_PS_CMD *)(buf + 4);
+    WMI_SCAN_PARAMS_CMD *sParamCmd     = (WMI_SCAN_PARAMS_CMD *)(buf + 4);
+    WMI_BSS_FILTER_CMD *filterCmd      = (WMI_BSS_FILTER_CMD *)buf;
+    WMI_CHANNEL_PARAMS_CMD *chParamCmd = (WMI_CHANNEL_PARAMS_CMD *)buf;
+    WMI_POWER_PARAMS_CMD *pmParamCmd   = (WMI_POWER_PARAMS_CMD *)buf;
+    WMI_ADD_BAD_AP_CMD *badApCmd       = (WMI_ADD_BAD_AP_CMD *)buf;
+    WMI_CREATE_PSTREAM_CMD *crePStreamCmd = (WMI_CREATE_PSTREAM_CMD *)buf;
+    WMI_DELETE_PSTREAM_CMD *delPStreamCmd = (WMI_DELETE_PSTREAM_CMD *)buf;
+    USER_RSSI_PARAMS *rssiThresholdParam = (USER_RSSI_PARAMS *)(buf + 4);
+    WMI_SNR_THRESHOLD_PARAMS_CMD *snrThresholdParam = (WMI_SNR_THRESHOLD_PARAMS_CMD *)buf;
+    WMI_LQ_THRESHOLD_PARAMS_CMD *lqThresholdParam = (WMI_LQ_THRESHOLD_PARAMS_CMD *)(buf + 4);
+    WMI_TARGET_ERROR_REPORT_BITMASK *pBitMask =
+                                    (WMI_TARGET_ERROR_REPORT_BITMASK *)buf;
+    WMI_SET_ASSOC_INFO_CMD *ieInfo = (WMI_SET_ASSOC_INFO_CMD *)buf;
+    WMI_SET_ACCESS_PARAMS_CMD *acParamsCmd = (WMI_SET_ACCESS_PARAMS_CMD *)buf;
+    WMI_DISC_TIMEOUT_CMD *discCmd = (WMI_DISC_TIMEOUT_CMD *)(buf + 4);
+    WMI_SET_ADHOC_BSSID_CMD *adhocBssidCmd = (WMI_SET_ADHOC_BSSID_CMD *)(buf + 4);
+    WMI_BEACON_INT_CMD *bconIntvl     = (WMI_BEACON_INT_CMD *)(buf + 4);
+    WMI_SET_RETRY_LIMITS_CMD *setRetryCmd  = (WMI_SET_RETRY_LIMITS_CMD *)(buf + 4);
+    WMI_START_SCAN_CMD *startScanCmd  = (WMI_START_SCAN_CMD *)(buf + 4);
+    WMI_SET_LPREAMBLE_CMD *setLpreambleCmd = (WMI_SET_LPREAMBLE_CMD *)(buf + 4);
+    WMI_SET_RTS_CMD *setRtsCmd = (WMI_SET_RTS_CMD *)(buf + 4);
+    struct ar6000_queuereq *getQosQueueCmd = (struct ar6000_queuereq *)buf;
+    WMI_SET_VOICE_PKT_SIZE_CMD *pSizeThresh = (WMI_SET_VOICE_PKT_SIZE_CMD *)(buf + sizeof(int));
+    WMI_SET_MAX_SP_LEN_CMD *pMaxSP          = (WMI_SET_MAX_SP_LEN_CMD *)(buf + sizeof(int));
+    WMI_SET_ROAM_CTRL_CMD *pRoamCtrl        = (WMI_SET_ROAM_CTRL_CMD *)(buf +
+                                                sizeof(int));
+    WMI_POWERSAVE_TIMERS_POLICY_CMD *pPowerSave    = (WMI_POWERSAVE_TIMERS_POLICY_CMD *)(buf + sizeof(int));
+    WMI_SET_BT_STATUS_CMD *pBtStatCmd = (WMI_SET_BT_STATUS_CMD *) (buf + sizeof(int));
+    WMI_SET_BT_PARAMS_CMD *pBtParmCmd = (WMI_SET_BT_PARAMS_CMD *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_FE_ANT_CMD *pBtcoexFeAntCmd = (WMI_SET_BTCOEX_FE_ANT_CMD *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD *pBtcoexCoLocatedBtCmd = (WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMD *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_SCO_CONFIG_CMD *pBtcoexScoConfigCmd = (WMI_SET_BTCOEX_SCO_CONFIG_CMD *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD *pBtcoexbtinquiryPageConfigCmd = (WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMD *) (buf + sizeof(int));
+    AR6000_BTCOEX_CONFIG *pBtcoexConfig = (AR6000_BTCOEX_CONFIG *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_A2DP_CONFIG_CMD *pBtcoexA2dpConfigCmd = (WMI_SET_BTCOEX_A2DP_CONFIG_CMD *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD *pBtcoexAclCoexConfigCmd = (WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMD *) (buf + sizeof(int));
+    WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD *pBtcoexBtOperatingStatusCmd = (WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMD *) (buf + sizeof(int));
+    WMI_SET_WMM_CMD *setWmmCmd = (WMI_SET_WMM_CMD *)(buf + 4);
+    WMI_SET_QOS_SUPP_CMD *qosSupp = (WMI_SET_QOS_SUPP_CMD *)(buf +4);
+    WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD *hbparam = (WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD *)(buf + 4);
+    A_UINT32 *cookie = (A_UINT32 *)(buf + 4);
+    A_UINT32 *diagaddr = (A_UINT32 *)(buf + 4);
+    A_UINT32 *diagdata = (A_UINT32 *)(buf + 8);
+    WMI_SET_WMM_TXOP_CMD *pTxOp = (WMI_SET_WMM_TXOP_CMD *)(buf + sizeof(int));
+    WMI_AP_SET_COUNTRY_CMD *pCountry = (WMI_AP_SET_COUNTRY_CMD *)(buf + sizeof(int));
+    WMI_SET_KEEPALIVE_CMD_EXT *setKeepAlive = (WMI_SET_KEEPALIVE_CMD_EXT *)(buf + 4);
+    struct ieee80211req_getset_appiebuf     *appIEInfo     = (struct ieee80211req_getset_appiebuf *)(buf + 4);
+    A_UINT32              *pMgmtFilter  = (A_UINT32 *)(buf + 4);
+    DBGLOG_MODULE_CONFIG *dbglogCfg = (DBGLOG_MODULE_CONFIG *)(buf + 4);
+
+    WMI_SET_HOST_SLEEP_MODE_CMD *hostSleepModeCmd = (WMI_SET_HOST_SLEEP_MODE_CMD*)(buf + sizeof(int));
+    WMI_SET_WOW_MODE_CMD *wowModeCmd = (WMI_SET_WOW_MODE_CMD*)(buf + sizeof(int));
+    WMI_ADD_WOW_PATTERN_CMD *addWowCmd = (WMI_ADD_WOW_PATTERN_CMD*)(buf + sizeof(int));
+    WMI_DEL_WOW_PATTERN_CMD *delWowCmd = (WMI_DEL_WOW_PATTERN_CMD*)(buf + sizeof(int));
+    WMI_GET_WOW_LIST_CMD *getWowListCmd = (WMI_GET_WOW_LIST_CMD*)(buf + sizeof(int));
+    AR6000_USER_SETKEYS_INFO *user_setkeys_info =
+                                (AR6000_USER_SETKEYS_INFO *)(buf + sizeof(int));
+    WMI_SET_AKMP_PARAMS_CMD *akmpCtrlCmd =
+                                (WMI_SET_AKMP_PARAMS_CMD *)(buf + sizeof(int));
+    WMI_SET_TARGET_EVENT_REPORT_CMD *evtCfgCmd = (WMI_SET_TARGET_EVENT_REPORT_CMD *) (buf + sizeof(int));
+    WMI_ENABLE_SMPS_CMD *setDfsCmd = (WMI_ENABLE_SMPS_CMD*)(buf + 4);
+    pmkidUserInfo_t         pmkidUserInfo;
+    A_UINT8                 bssid[ATH_MAC_LEN];
+    struct ieee80211req_addpmkid *pi_cmd = (struct ieee80211req_addpmkid *)buf;
+
+    int i, index = 0, channel, chindex;//, cnt;
+    A_INT16 threshold[26];  /* user can set rssi tags */
+    A_UINT16 *clist;
+    A_UCHAR *ssid;
+    char *ethIf;
+
+    WMI_AP_HIDDEN_SSID_CMD *pHidden = (WMI_AP_HIDDEN_SSID_CMD *)(buf + 4);
+    WMI_AP_ACL_MAC_CMD *pACL = (WMI_AP_ACL_MAC_CMD *)(buf + 4);
+    WMI_AP_NUM_STA_CMD *pNumSta = (WMI_AP_NUM_STA_CMD *)(buf + 4);
+    WMI_AP_CONN_INACT_CMD *pInact = (WMI_AP_CONN_INACT_CMD *)(buf + 4);
+    WMI_AP_PROT_SCAN_TIME_CMD *pProt = (WMI_AP_PROT_SCAN_TIME_CMD *)(buf + 4);
+    struct ieee80211req_mlme *pMlme = (struct ieee80211req_mlme *)buf;
+    WMI_AP_SET_DTIM_CMD *pDtim = (WMI_AP_SET_DTIM_CMD *)(buf + 4);
+    WMI_AP_ACL_POLICY_CMD *pACLpolicy = (WMI_AP_ACL_POLICY_CMD *)(buf + 4);
+    A_UINT8 *intra = (A_UINT8 *)(buf + 4);
+    WMI_ADDBA_REQ_CMD *pAddbaReq = (WMI_ADDBA_REQ_CMD *)(buf + 4);
+    WMI_ALLOW_AGGR_CMD *pAllowAggr = (WMI_ALLOW_AGGR_CMD *)(buf + 4);
+    WMI_DELBA_REQ_CMD *pDeleteAggr = (WMI_DELBA_REQ_CMD *)(buf + 4);
+    WMI_SET_BT_WLAN_CONN_PRECEDENCE *prec = (WMI_SET_BT_WLAN_CONN_PRECEDENCE *) (buf + 4);
+    WMI_AP_SET_11BG_RATESET_CMD *pAPrs = (WMI_AP_SET_11BG_RATESET_CMD *) (buf + 4);
+    WMI_SET_TX_SGI_PARAM_CMD *set_txsgiparam = (WMI_SET_TX_SGI_PARAM_CMD *) (buf + 4);
+    WMI_DIV_PARAMS_CMD *pDiversity = (WMI_DIV_PARAMS_CMD *)(buf + 4);
+    WMI_AP_SET_APSD_CMD *pApApsd = (WMI_AP_SET_APSD_CMD *)(buf + 4);
+    WMI_SET_MCASTRATE_CMD *pMcast = (WMI_SET_MCASTRATE_CMD *)(buf + 4);
+    WMI_VOICE_DETECTION_ENABLE_CMD *pVoiceDetectionEnable = (WMI_VOICE_DETECTION_ENABLE_CMD *)(buf + 4);
+    WMI_SET_TXE_NOTIFY_CMD *pTXe = (WMI_SET_TXE_NOTIFY_CMD *)(buf + 4);
+    WMI_SET_RECOVERY_TEST_PARAMETER_CMD *pSetRecoveryParam = (WMI_SET_RECOVERY_TEST_PARAMETER_CMD*)(buf + 4);
+    WMI_SET_RSSI_FILTER_CMD *pSetRssiFilter = (WMI_SET_RSSI_FILTER_CMD*)(buf + 4);
+    WMI_PROBED_SSID_CMD *pSsidCmd = (WMI_PROBED_SSID_CMD*)(buf + 4);
+    profile_t   cp;
+    A_UINT8 *pWpaOffloadState = (A_UINT8 *) (buf + 4);
+    A_UINT32 *pExcessTxRetryThres = (A_UINT32 *)(buf + 4);
+
+    if (argc == 1) {
+        usage();
+    }
+
+    memset(buf, 0, sizeof(buf));
+    memset(ifname, '\0', IFNAMSIZ);
+    if ((ethIf = getenv("NETIF")) == NULL) {
+        ethIf = "eth1";
+    }
+    while (1) {
+        int option_index = 0;
+        static struct option long_options[] = {
+            {"it", 1, NULL, 'a'},
+            {"bg", 1, NULL, 'b'},
+            {"np", 1, NULL, 'c'},
+            {"dp", 1, NULL, 'd'},
+            {"fgend", 1, NULL, 'e'},
+            {"filter", 1, NULL, 'f'},
+            {"fgstart", 1, NULL, 'g'},
+            {"maxact", 1, NULL, 'h'},
+            {"interface", 1, NULL, 'i'},
+            {"createqos", 1, NULL, 'j'},
+            {"deleteqos", 1, NULL, 'k'},
+            {"listen", 1, NULL, 'l'},
+            {"listenbeacons", 1, NULL, 'N'},
+            {"pmparams", 0, NULL, 'm'},
+            {"num", 1, NULL, 'n'},
+            {"qosqueue", 1, NULL, 'o'},
+            {"power", 1, NULL, 'p'},
+            {"pas", 1, NULL, 'q'},
+            {"scan", 0, NULL, 's'},
+            {"sr", 1, NULL, 'r'},
+            {"ssid", 1, NULL, 't'},
+            {"rssiThreshold", 1, NULL, 'u'},
+            {"snrThreshold", 1, NULL, WMI_SET_SNR_THRESHOLDS},
+            {"cleanRssiSnr", 0, NULL, WMI_CLR_RSSISNR},
+            {"lqThreshold", 1, NULL, WMI_SET_LQ_THRESHOLDS},
+            {"version", 0, NULL, 'v'},  //WMI_GET_VERSION
+            {"wmode", 1, NULL, 'w'},
+            {"badAP", 1, NULL, 'x'},
+            {"clrAP", 0, NULL, 'y'},
+            {"minact", 1, NULL, 'z'},
+            {"getTargetStats", 0, NULL, WMI_GET_TARGET_STATS},
+            {"setErrorReportingBitmask", 1, NULL,
+                        WMI_SET_TARGET_ERROR_REPORTING_BITMASK},
+            {"acparams", 0, NULL, WMI_SET_AC_PARAMS},
+            {"acval", 1, NULL, WMI_SET_AC_VAL},
+            {"txop", 1, NULL, 'A'},
+            {"cwmin", 1, NULL, 'B'},
+            {"cwmax", 1, NULL, 'C'},
+            {"aifsn", 1, NULL, 'D'},
+            {"ps", 1, NULL, 'E'},
+            {"aw", 1, NULL, 'F'},
+            {"adhocbssid", 1, NULL, 'G'},
+            {"mode", 1, NULL, 'H'},
+            {"sendframe", 1, NULL, 'I'},
+            {"wlan", 1, NULL, 'J'},
+            {"to", 1, NULL, 'K'},
+            {"ttl", 1, NULL, 'L'},
+            {"scanctrlflags", 1, NULL, 'O'},
+            {"homeDwellTime", 1, NULL, 'P'},
+            {"forceScanInt", 1, NULL, 'Q'},
+            {"forceScanFlags",1, NULL, 'R'},
+            {"threshold", 1, NULL, 'S'},
+            {"frequency", 1, NULL, 'T'},
+            {"cookie", 1, NULL, 'U'},
+            {"mmask", 1, NULL, 'V'},
+            {"rep", 1, NULL, 'W'},
+            {"tsr", 1, NULL, 'X'},
+            {"size", 1, NULL, 'Y'},
+            {"bssid",1, NULL, WMI_BSSID},
+            {"initrsc", 1, NULL, USER_SETKEYS_INITRSC},
+            {"multipmkid", 1, NULL, WMI_AKMP_MULTI_PMKID},
+            {"numpmkid", 1, NULL, WMI_NUM_PMKID},
+            {"pmkid", 1, NULL, WMI_PMKID_ENTRY},
+            {"clearStats", 0, NULL, 'Z'},
+            {"maxact2pas", 1, NULL, WMI_SCAN_DFSCH_ACT_TIME},
+            {"maxactscan_ssid", 1, NULL, WMI_SCAN_MAXACT_PER_SSID},
+            {"ibsspmcaps", 0, NULL, WMI_SET_IBSS_PM_CAPS},
+            {"appsparams", 0, NULL, WMI_SET_AP_PS},
+            {"setAssocIe", 1, NULL, WMI_SET_ASSOC_IE},
+            {"setbmisstime", 1, NULL, WMI_SET_BMISS_TIME},
+            {"setbmissbeacons", 1, NULL, 'M'},
+            {"disc", 1, NULL, WMI_SET_DISC_TIMEOUT},
+            {"beaconintvl", 1, NULL, WMI_SET_BEACON_INT},
+            {"setVoicePktSize", 1, NULL, WMI_SET_VOICE_PKT_SIZE},
+            {"setMaxSPLength", 1, NULL, WMI_SET_MAX_SP},
+            {"getroamtable", 0, NULL, WMI_GET_ROAM_TBL},
+            {"roam", 1, NULL, WMI_SET_ROAM_CTRL},
+            {"psparams", 0, NULL, WMI_SET_POWERSAVE_TIMERS},
+            {"psPollTimer", 1, NULL, WMI_SET_POWERSAVE_TIMERS_PSPOLLTIMEOUT},
+            {"triggerTimer", 1, NULL, WMI_SET_POWERSAVE_TIMERS_TRIGGERTIMEOUT},
+            {"getpower", 0, NULL, WMI_GET_POWER_MODE},
+            {"getroamdata", 0, NULL, WMI_GET_ROAM_DATA},
+            {"setBTstatus", 1, NULL, WMI_SET_BT_STATUS},
+            {"setBTparams", 1, NULL, WMI_SET_BT_PARAMS},
+            {"setbtcoexfeant", 1, NULL, WMI_SET_BTCOEX_FE_ANT},
+            {"setbtcoexcolocatedbt", 1, NULL, WMI_SET_BTCOEX_COLOCATED_BT_DEV},
+            {"setbtcoexscoconfig", 1, NULL, WMI_SET_BTCOEX_SCO_CONFIG},
+            {"setbtcoexa2dpconfig", 1, NULL, WMI_SET_BTCOEX_A2DP_CONFIG},
+            {"setbtcoexaclcoexconfig", 1, NULL, WMI_SET_BTCOEX_ACLCOEX_CONFIG},
+            {"setbtcoexbtinquirypageconfig", 1, NULL, WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG},
+            {"setbtcoexbtoperatingstatus", 1, NULL, WMI_SET_BTCOEX_BT_OPERATING_STATUS},
+            {"getbtcoexconfig",1,NULL, WMI_GET_BTCOEX_CONFIG},
+            {"getbtcoexstats", 0, NULL, WMI_GET_BTCOEX_STATS},
+            {"setretrylimits", 1, NULL, WMI_SET_RETRYLIMITS},
+            {"startscan", 0, NULL, WMI_START_SCAN},
+            {"setfixrates", 1, NULL, WMI_SET_FIX_RATES},
+            {"getfixrates", 0, NULL, WMI_GET_FIX_RATES},
+            {"setauthmode", 1, NULL, WMI_SET_AUTH_MODE},
+            {"setreassocmode", 1, NULL, WMI_SET_REASSOC_MODE},
+            {"setlongpreamble", 1, NULL, WMI_SET_LPREAMBLE},
+            {"setRTS", 1, NULL, WMI_SET_RTS},
+            {"setwmm", 1, NULL, WMI_SET_WMM},
+            {"setqos", 1, NULL, WMI_SET_QOS_SUPP},
+            {"apsdTimPolicy", 1, NULL, WMI_APSD_TIM_POLICY},
+            {"simulatedAPSDTimPolicy", 1, NULL, WMI_SIMULATED_APSD_TIM_POLICY},
+            {"detecterror", 0, NULL, WMI_SET_ERROR_DETECTION},
+            {"getheartbeat", 0, NULL, WMI_GET_HB_CHALLENGE_RESP},
+#ifdef USER_KEYS
+            {"usersetkeys", 0, NULL, USER_SETKEYS},
+#endif
+            {"getRD", 0, NULL, WMI_GET_RD},
+            {"setcountry", 1, NULL, WMI_AP_SET_COUNTRY},
+            {"countrycodes", 0, NULL, WMI_AP_GET_COUNTRY_LIST},
+            {"disableregulatory", 0, NULL, WMI_AP_DISABLE_REGULATORY},
+            {"txopbursting", 1, NULL, WMI_SET_TXOP},
+            {"diagaddr", 1, NULL, DIAG_ADDR},
+            {"diagdata", 1, NULL, DIAG_DATA},
+            {"diagread", 0, NULL, DIAG_READ},
+            {"diagwrite", 0, NULL, DIAG_WRITE},
+            {"setkeepalive", 1, NULL, WMI_SET_KEEPALIVE},
+            {"getkeepalive", 0, NULL, WMI_GET_KEEPALIVE},
+            {"setappie", 1, NULL, WMI_SET_APPIE},
+            {"setmgmtfilter", 1, NULL, WMI_SET_MGMT_FRM_RX_FILTER},
+            {"setdbglogconfig", 0, NULL, WMI_DBGLOG_CFG_MODULE},
+            {"getdbglogs", 0, NULL, WMI_DBGLOG_GET_DEBUG_LOGS},
+            {"sethostmode", 1, NULL, WMI_SET_HOST_SLEEP_MODE},
+            {"setwowmode", 1, NULL, WMI_SET_WOW_MODE},
+            {"wowfilter",1,NULL,WMI_SET_WOW_FILTER},
+            {"hostreqdelay",1,NULL,WMI_SET_WOW_HOST_REQ_DELAY},
+            {"getwowlist", 1, NULL, WMI_GET_WOW_LIST},
+            {"addwowpattern", 1, NULL, WMI_ADD_WOW_PATTERN},
+            {"delwowpattern", 1, NULL, WMI_DEL_WOW_PATTERN},
+            {"dumpchipmem", 0, NULL, DIAG_DUMP_CHIP_MEM},
+            {"dumpchipmem_venus", 0, NULL, DIAG_DUMP_CHIP_MEM_VENUS},
+            {"setconnectctrl", 1, NULL, WMI_SET_CONNECT_CTRL_FLAGS},
+            {"dumpcreditstates",0, NULL, DUMP_HTC_CREDITS},
+            {"setakmp", 0, NULL, WMI_SET_AKMP_INFO},
+            {"setpmkidlist", 0, NULL, WMI_SET_PMKID_LIST},
+            {"getpmkidlist", 0, NULL, WMI_GET_PMKID_LIST},
+            {"ieMask", 1, NULL, WMI_SET_IEMASK},
+            {"scanlist", 1, NULL, WMI_SCAN_CHANNEL_LIST},
+            {"setbsspmkid", 0, NULL, WMI_SET_BSS_PMKID_INFO},
+            {"bsspmkid", 1, NULL, WMI_BSS_PMKID_ENTRY},
+            {"abortscan", 0, NULL, WMI_ABORT_SCAN},
+            {"settgtevt", 1, NULL, WMI_TARGET_EVENT_REPORT},
+            {"getsta", 0, NULL, WMI_AP_GET_STA_LIST},       /* AP mode */
+            {"hiddenssid", 0, NULL, WMI_AP_HIDDEN_SSID},    /* AP mode */
+            {"numsta", 0, NULL, WMI_AP_SET_NUM_STA},        /* AP mode */
+            {"aclpolicy", 0, NULL, WMI_AP_ACL_POLICY},      /* AP mode */
+            {"addacl", 0, NULL, WMI_AP_ACL_MAC_LIST1},      /* AP mode */
+            {"delacl", 0, NULL, WMI_AP_ACL_MAC_LIST2},      /* AP mode */
+            {"getacl", 0, NULL, WMI_AP_GET_ACL_LIST},       /* AP mode */
+            {"commit", 0, NULL, WMI_AP_COMMIT_CONFIG},      /* AP mode */
+            {"conninact", 0, NULL, WMI_AP_INACT_TIME},      /* AP mode */
+            {"protectionscan", 0, NULL, WMI_AP_PROT_TIME},  /* AP mode */
+            {"removesta", 0, NULL, WMI_AP_SET_MLME},        /* AP mode */
+            {"dtim", 0, NULL, WMI_AP_SET_DTIM},             /* AP mode */
+            {"intrabss", 0, NULL, WMI_AP_INTRA_BSS},        /* AP mode */
+            {"interbss", 0, NULL, WMI_AP_INTER_BSS},        /* AP mode */            
+            {"ip", 1, NULL, WMI_GET_IP},
+            {"setMcastFilter", 1, NULL, WMI_SET_MCAST_FILTER},
+            {"delMcastFilter", 1, NULL, WMI_DEL_MCAST_FILTER},
+            {"mcastFilter", 1, NULL, WMI_MCAST_FILTER},
+            {"dump_recv_aggr_stats",0, NULL, WMI_DUMP_RCV_AGGR_STATS},
+            {"setup_aggr", 2, NULL, WMI_SETUP_AGGR},
+            {"allow_aggr", 2, NULL, WMI_CFG_ALLOW_AGGR},
+            {"dele_aggr", 2, NULL, WMI_CFG_DELE_AGGR},
+            {"set_ht_cap",1, NULL, WMI_SET_HT_CAP},
+            {"set_ht_op",1, NULL, WMI_SET_HT_OP},
+            {"apgetstats", 0, NULL, WMI_AP_GET_STAT},       /* AP mode */
+            {"apclearstats", 0, NULL, WMI_AP_CLR_STAT},     /* AP mode */
+            {"settxselrates", 1, NULL, WMI_SET_TX_SELECT_RATES},
+            {"gethiddenssid", 0, NULL, WMI_AP_GET_HIDDEN_SSID},   /* AP mode */
+            {"getcountry", 0, NULL, WMI_AP_GET_COUNTRY},    /* AP mode */
+            {"getwmode", 0, NULL, WMI_AP_GET_WMODE},
+            {"getdtim", 0, NULL, WMI_AP_GET_DTIM},          /* AP mode */
+            {"getbeaconintvl", 0, NULL, WMI_AP_GET_BINTVL}, /* AP mode */
+            {"getRTS", 0, NULL, WMI_GET_RTS},
+            {"targregs", 0, NULL, DIAG_FETCH_TARGET_REGS},
+#ifdef ATH_INCLUDE_PAL
+            {"sendpalcmd", 2, NULL, WMI_SEND_PAL_CMD},
+            {"sendpaldata", 2, NULL, WMI_SEND_PAL_DATA},
+            {"wlan_conn_prec", 1, NULL, WMI_SET_WLAN_CONN_PRECDNCE},
+#endif
+            {"aprateset", 0, NULL, WMI_SET_AP_RATESET},
+            {"twp", 1, NULL, WMI_SET_TX_WAKEUP_POLICY},
+            {"nt", 1, NULL, WMI_SET_TX_NUM_FRAMES_TO_WAKEUP},
+            {"pstype", 1, NULL, WMI_SET_AP_PS_PSTYPE},
+            {"psit", 1, NULL, WMI_SET_AP_PS_IDLE_TIME},
+            {"psperiod", 1, NULL, WMI_SET_AP_PS_PS_PERIOD},
+            {"sleepperiod", 1, NULL, WMI_SET_AP_PS_SLEEP_PERIOD},
+            {"connect", 1, NULL, WMI_SEND_CONNECT_CMD},
+            {"wpa", 1, NULL, WMI_SEND_CONNECT_CMD1},
+            {"wep", 1, NULL, WMI_SEND_CONNECT_CMD2},
+            {"set_dfs", 1, NULL, WMI_AP_SET_DFS},
+            {"bt",1,NULL,BT_HW_POWER_STATE},
+            {"set_tx_sgi", 0, NULL, WMI_SET_TX_SGI_PARAM},
+            {"masksgi", 1, NULL, WMI_SGI_MASK},
+            {"persgi", 1, NULL, WMI_PER_SGI},
+            {"wac", 1, NULL, WMI_WAC_ENABLE},
+            {"setwpaoffload", 1, NULL, WMI_SET_WPA_OFFLOAD_STATE},
+            {"acsdisablehichannels", 0, NULL, WMI_AP_ACS_DISABLE_HI_CHANNELS},
+            {"setdivparam", 1, NULL, WMI_SET_DIVERSITY_PARAM},
+            {"setexcesstxretrythres", 1, NULL, WMI_SET_EXCESS_TX_RETRY_THRES},
+            {"forceAssert", 0, NULL, WMI_FORCE_ASSERT},            
+            {"gnumsta", 0, NULL, WMI_AP_SET_GNUM_STA},        /* AP mode */
+            {"getgnumsta", 0, NULL, WMI_AP_GET_GNUM_STA},     /* AP mode */
+            {"getnumsta", 0, NULL, WMI_AP_GET_NUM_STA},       /* AP mode */            
+            {"suspend", 0, NULL, WMI_SUSPEND_DRIVER},                
+            {"resume", 0, NULL, WMI_RESUME_DRIVER},                 
+            {"scanprobedssid", 1, NULL, WMI_SCAN_PROBED_SSID},  
+            {"ap_apsd", 0, NULL, WMI_AP_SET_APSD},    /* AP mode */
+            {"get_ht_cap", 0, NULL, WMI_GET_HT_CAP},
+            {"set_mcast_rate", 1, NULL, WMI_SET_MCASTRATE},
+            {"enablevoicedetection", 1, NULL, WMI_VOICE_DETECTION_ENABLE}, /* enable/disable voice detection command */            
+	    {"txe-notify", 1, NULL, WMI_SET_TXE_NOTIFY},
+            {"setrecoverysim", 0, NULL, WMI_SET_RECOVERY_SIMULATE}, /* set recovery simulation */   
+{"disablebcast", 1, NULL, WMI_DISABLE_BCAST_IN_PM},  /* disable broadcast in power save */
+            {"blwl", 0, NULL, WMI_AP_BLWL},                 /* AP mode */
+            {"setrssifilter", 0, NULL, WMI_SET_RSSI_FILTER},
+            {0, 0, 0, 0}
+        };
+
+        c = getopt_long(argc, argv, "rsvda:b:c:e:h:f:g:h:i:l:p:q:r:w:n:t:u:x:y:z:A:B:C:D:E:F:G:H:I:J:K:L:M:N:O:P:Q:R:S:T:U:V:W:X:Y:Z:", long_options, &option_index);
+        if (c == -1)
+        break;
+        switch (c) {
+        case 'a':
+            pmParamCmd->idle_period = atoi(optarg);
+            break;
+        case 'b':
+            if (!strcasecmp(optarg,"default")) {
+                sParamCmd->bg_period = 0;
+            } else {
+                sParamCmd->bg_period = atoi(optarg);
+                /* Setting the background scan to 0 or 65535 has the same effect
+                 - it disables background scanning */
+                if(!sParamCmd->bg_period)
+                    sParamCmd->bg_period = 65535;
+            }
+            break;
+        case 'c':
+            pmParamCmd->pspoll_number = atoi(optarg);
+            break;
+        case 'd':
+            if (!strcmp(optarg, "ignore")) {
+                pmParamCmd->dtim_policy = IGNORE_DTIM;
+            } else if (!strcmp(optarg, "normal")) {
+                pmParamCmd->dtim_policy = NORMAL_DTIM;
+            } else if (!strcmp(optarg, "stick")) {
+                pmParamCmd->dtim_policy = STICK_DTIM;
+            } else {
+                cmd = 0;
+            }
+            break;
+        case 'f':
+            cmd = WMI_SET_BSS_FILTER;
+            if (!strcmp(optarg, "none")) {
+                filterCmd->bssFilter = NONE_BSS_FILTER;
+            } else if (!strcmp(optarg, "all")) {
+                filterCmd->bssFilter = ALL_BSS_FILTER;
+            } else if (!strcmp(optarg, "profile")) {
+                filterCmd->bssFilter = PROFILE_FILTER;
+            } else if (!strcmp(optarg, "not_profile")) {
+                filterCmd->bssFilter = ALL_BUT_PROFILE_FILTER;
+            } else if (!strcmp(optarg, "bss")) {
+                filterCmd->bssFilter = CURRENT_BSS_FILTER;
+            } else if (!strcmp(optarg, "not_bss")) {
+                filterCmd->bssFilter = ALL_BUT_BSS_FILTER;
+            } else if (!strcmp(optarg, "ssid")) {
+                filterCmd->bssFilter = PROBED_SSID_FILTER;
+            } else {
+                cmd = 0;
+            }
+            break;
+        case 'e':
+            sParamCmd->fg_end_period = atoi(optarg);
+            break;
+        case 'g':
+            sParamCmd->fg_start_period = atoi(optarg);
+            break;
+        case 'h':
+            sParamCmd->maxact_chdwell_time = atoi(optarg);
+            break;
+        case 'q':
+            sParamCmd->pas_chdwell_time = atoi(optarg);
+            break;
+        case 'j':
+            cmd = WMI_CREATE_QOS;
+            crePStreamCmd->userPriority = atoi(optarg);
+            break;
+        case 'k':
+            cmd = WMI_DELETE_QOS;
+            delPStreamCmd->trafficClass = atoi(optarg);
+            break;
+        case 'l':
+            cmd = WMI_SET_LISTEN_INTERVAL;
+            listenCmd->listenInterval = atoi(optarg);
+            if ((listenCmd->listenInterval < MIN_LISTEN_INTERVAL) ||
+                (listenCmd->listenInterval > MAX_LISTEN_INTERVAL))
+            {
+                printf("Listen Interval out of range\n");
+                cmd = 0;
+            }
+            break;
+        case 'N':
+            cmd =  WMI_SET_LISTEN_INTERVAL;
+            listenCmd->numBeacons = atoi(optarg);
+            if ((listenCmd->numBeacons < MIN_LISTEN_BEACONS) ||
+                (listenCmd->numBeacons > MAX_LISTEN_BEACONS))
+            {
+                printf("Listen beacons out of range\n");
+                cmd = 0;
+            }
+            break;
+        case 'm':
+            cmd = WMI_SET_PM_PARAMS;
+            break;
+        case 'n':
+            index = atoi(optarg);
+            break;
+        case 'v':
+            cmd = WMI_GET_VERSION;
+            break;
+        case 'o':
+            cmd = WMI_GET_QOS_QUEUE;
+            getQosQueueCmd->trafficClass = atoi(optarg);
+            break;
+        case 'p':
+            cmd = WMI_SET_POWER_MODE;
+            if (!strcmp(optarg, "rec")) {
+                pwrCmd->powerMode = REC_POWER;
+            } else if (!strcmp(optarg, "maxperf")) {
+                pwrCmd->powerMode = MAX_PERF_POWER;
+            } else {
+                cmd = 0;
+            }
+            break;
+        case WMI_FORCE_ASSERT:
+            cmd = WMI_FORCE_ASSERT;
+            break;
+        case WMI_SET_MCAST_FILTER:
+            cmd = WMI_SET_MCAST_FILTER;
+            sMcastFilterCmd->multicast_mac[0] = (unsigned int) atoi(argv[2]);
+            sMcastFilterCmd->multicast_mac[1] = (unsigned int) atoi(argv[3]);
+            sMcastFilterCmd->multicast_mac[2] = (unsigned int) atoi(argv[4]);
+            sMcastFilterCmd->multicast_mac[3] = (unsigned int) atoi(argv[5]);
+            sMcastFilterCmd->multicast_mac[4] = (unsigned int) atoi(argv[6]);
+            sMcastFilterCmd->multicast_mac[5] = (unsigned int) atoi(argv[7]);
+
+            printf("sMcastFilterCmd->multicast_mac[0]  %d\n",sMcastFilterCmd->multicast_mac[0] );
+            printf("sMcastFilterCmd->multicast_mac[1]  %d\n",sMcastFilterCmd->multicast_mac[1] );
+            printf("sMcastFilterCmd->multicast_mac[2]  %d\n",sMcastFilterCmd->multicast_mac[2] );
+            printf("sMcastFilterCmd->multicast_mac[3]  %d\n",sMcastFilterCmd->multicast_mac[3] );
+            printf("sMcastFilterCmd->multicast_mac[4]  %d\n",sMcastFilterCmd->multicast_mac[4] );
+            printf("sMcastFilterCmd->multicast_mac[5]  %d\n",sMcastFilterCmd->multicast_mac[5] );
+            break;
+        case WMI_DEL_MCAST_FILTER:
+            cmd = WMI_DEL_MCAST_FILTER;
+            sMcastFilterCmd->multicast_mac[0] = (unsigned int) atoi(argv[2]);
+            sMcastFilterCmd->multicast_mac[1] = (unsigned int) atoi(argv[3]);
+            sMcastFilterCmd->multicast_mac[2] = (unsigned int) atoi(argv[4]);
+            sMcastFilterCmd->multicast_mac[3] = (unsigned int) atoi(argv[5]);
+            sMcastFilterCmd->multicast_mac[4] = (unsigned int) atoi(argv[6]);
+            sMcastFilterCmd->multicast_mac[5] = (unsigned int) atoi(argv[7]);
+
+            printf("sMcastFilterCmd->multicast_mac[0]  %d\n",sMcastFilterCmd->multicast_mac[0] );
+            printf("sMcastFilterCmd->multicast_mac[1]  %d\n",sMcastFilterCmd->multicast_mac[1] );
+            printf("sMcastFilterCmd->multicast_mac[2]  %d\n",sMcastFilterCmd->multicast_mac[2] );
+            printf("sMcastFilterCmd->multicast_mac[3]  %d\n",sMcastFilterCmd->multicast_mac[3] );
+            printf("sMcastFilterCmd->multicast_mac[4]  %d\n",sMcastFilterCmd->multicast_mac[4] );
+            printf("sMcastFilterCmd->multicast_mac[5]  %d\n",sMcastFilterCmd->multicast_mac[5] );
+            break;
+        case WMI_MCAST_FILTER:
+            cmd = WMI_MCAST_FILTER;
+
+            mcastFilterCmd->enable = (unsigned int) atoi(argv[2]);
+            printf("Multicast Filter State: %s\n", mcastFilterCmd->enable ? "enable" : "disable");
+            break;
+        case 'r':
+            sParamCmd->shortScanRatio = atoi(optarg);
+            break;
+        case 's':
+            cmd = WMI_SET_SCAN_PARAMS;
+            sParamCmd->scanCtrlFlags = DEFAULT_SCAN_CTRL_FLAGS;
+            sParamCmd->shortScanRatio = WMI_SHORTSCANRATIO_DEFAULT;
+            sParamCmd->max_dfsch_act_time = 0 ;
+            break;
+        case WMI_SCAN_DFSCH_ACT_TIME:
+            sParamCmd->max_dfsch_act_time = atoi(optarg);
+            break;
+        case WMI_SCAN_MAXACT_PER_SSID:
+            sParamCmd->maxact_scan_per_ssid = atoi(optarg);
+            break;
+        case 't':
+            cmd = WMI_SET_SSID;
+            index = optind-1;
+            pSsidCmd->entryIndex =(A_UINT8)atoi(argv[index++]);
+            ssid = (A_UCHAR *)argv[index++];
+            break;
+        case 'u':
+            cmd = WMI_SET_RSSI_THRESHOLDS;
+            memset(threshold, 0, sizeof(threshold));
+            for (index = optind; index <= argc; index++)
+                threshold[index-optind] = atoi(argv[index-1]);
+
+            rssiThresholdParam->weight                  = threshold[0];
+            rssiThresholdParam->pollTime                = threshold[1];
+            rssiThresholdParam->tholds[0].tag           = threshold[2];
+            rssiThresholdParam->tholds[0].rssi          = 0 - threshold[3];
+            rssiThresholdParam->tholds[1].tag           = threshold[4];
+            rssiThresholdParam->tholds[1].rssi          = 0 - threshold[5];
+            rssiThresholdParam->tholds[2].tag           = threshold[6];
+            rssiThresholdParam->tholds[2].rssi          = 0 - threshold[7];
+            rssiThresholdParam->tholds[3].tag           = threshold[8];
+            rssiThresholdParam->tholds[3].rssi          = 0 - threshold[9];
+            rssiThresholdParam->tholds[4].tag           = threshold[10];
+            rssiThresholdParam->tholds[4].rssi          = 0 - threshold[11];
+            rssiThresholdParam->tholds[5].tag           = threshold[12];
+            rssiThresholdParam->tholds[5].rssi          = 0 - threshold[13];
+            rssiThresholdParam->tholds[6].tag           = threshold[14];
+            rssiThresholdParam->tholds[6].rssi          = 0 - threshold[15];
+            rssiThresholdParam->tholds[7].tag           = threshold[16];
+            rssiThresholdParam->tholds[7].rssi          = 0 - threshold[17];
+            rssiThresholdParam->tholds[8].tag           = threshold[18];
+            rssiThresholdParam->tholds[8].rssi          = 0 - threshold[19];
+            rssiThresholdParam->tholds[9].tag           = threshold[20];
+            rssiThresholdParam->tholds[9].rssi          = 0 - threshold[21];
+            rssiThresholdParam->tholds[10].tag           = threshold[22];
+            rssiThresholdParam->tholds[10].rssi          = 0 - threshold[23];
+            rssiThresholdParam->tholds[11].tag           = threshold[24];
+            rssiThresholdParam->tholds[11].rssi          = 0 - threshold[25];
+
+            break;
+        case WMI_SET_SNR_THRESHOLDS:
+            cmd = WMI_SET_SNR_THRESHOLDS;
+            memset(threshold, 0, sizeof(threshold));
+            for (index = optind; index <= argc; index++)
+                threshold[index-optind] = atoi(argv[index-1]);
+
+            snrThresholdParam->weight                  = threshold[0];
+            snrThresholdParam->thresholdAbove1_Val     = threshold[1];
+            snrThresholdParam->thresholdAbove2_Val     = threshold[2];
+            snrThresholdParam->thresholdAbove3_Val     = threshold[3];
+            snrThresholdParam->thresholdAbove4_Val     = threshold[4];
+            snrThresholdParam->thresholdBelow1_Val    = threshold[5];
+            snrThresholdParam->thresholdBelow2_Val    = threshold[6];
+            snrThresholdParam->thresholdBelow3_Val    = threshold[7];
+            snrThresholdParam->thresholdBelow4_Val    = threshold[8];
+            snrThresholdParam->pollTime                = threshold[9];
+            break;
+        case WMI_CLR_RSSISNR:
+            cmd = WMI_CLR_RSSISNR;
+            break;
+        case WMI_SET_LQ_THRESHOLDS:
+            cmd = WMI_SET_LQ_THRESHOLDS;
+            memset(threshold, 0, sizeof(threshold));
+            for (index = optind; index <= argc; index++)
+                threshold[index-optind] = atoi(argv[index-1]);
+
+            lqThresholdParam->enable                       = threshold[0];
+            lqThresholdParam->thresholdAbove1_Val          = threshold[1];
+            lqThresholdParam->thresholdAbove2_Val          = threshold[2];
+            lqThresholdParam->thresholdAbove3_Val          = threshold[3];
+            lqThresholdParam->thresholdAbove4_Val          = threshold[4];
+            lqThresholdParam->thresholdBelow1_Val          = threshold[5];
+            lqThresholdParam->thresholdBelow2_Val          = threshold[6];
+            lqThresholdParam->thresholdBelow3_Val          = threshold[7];
+            lqThresholdParam->thresholdBelow4_Val          = threshold[8];
+
+            break;
+        case 'i':
+            memset(ifname, '\0', 8);
+		strncpy(ifname, optarg, sizeof(ifname));
+            break;
+        case 'w':
+            cmd = WMI_SET_CHANNEL;
+            chParamCmd->numChannels = 0;
+            chParamCmd->scanParam = 0;
+            break;
+        case 'x':
+            if (wmic_ether_aton(optarg, badApCmd->bssid) != A_OK) {
+                printf("bad mac address\n");
+                break;
+            }
+            cmd = WMI_SET_BADAP;
+            break;
+        case 'y':
+            /*
+             * we are clearing a bad AP. We pass a null mac address
+             */
+            cmd = WMI_DELETE_BADAP;
+            break;
+        case 'z':
+            sParamCmd->minact_chdwell_time = atoi(optarg);
+            break;
+        case WMI_GET_TARGET_STATS:
+            cmd = WMI_GET_TARGET_STATS;
+            break;
+        case WMI_SET_TARGET_ERROR_REPORTING_BITMASK:
+            cmd = WMI_SET_TARGET_ERROR_REPORTING_BITMASK;
+            pBitMask->bitmask = atoi(optarg);
+            printf("Setting the bitmask = 0x%x\n", pBitMask->bitmask);
+            break;
+        case WMI_SET_ASSOC_IE:
+            cmd = WMI_SET_ASSOC_INFO_CMDID;
+            ieInfo->ieType = 1;
+            if (strlen(optarg) > WMI_MAX_ASSOC_INFO_LEN) {
+                printf("IE Size cannot be greater than %d\n",
+                        WMI_MAX_ASSOC_INFO_LEN);
+                cmd = 0;
+            } else {
+                ieInfo->bufferSize = strlen(optarg) + 2;
+                memcpy(&ieInfo->assocInfo[2], optarg,
+                       ieInfo->bufferSize - 2);
+               ieInfo->assocInfo[0] = 0xdd;
+               ieInfo->assocInfo[1] = ieInfo->bufferSize - 2;
+            }
+            break;
+        case WMI_SET_BMISS_TIME:
+            cmd = WMI_SET_BMISS_TIME;
+            bmissCmd->bmissTime = atoi(optarg);
+            if ((bmissCmd->bmissTime < MIN_BMISS_TIME) ||
+                (bmissCmd->bmissTime > MAX_BMISS_TIME))
+            {
+                printf("BMISS time out of range\n");
+                cmd = 0;
+            } 
+            break;
+        case 'M':
+            cmd = WMI_SET_BMISS_TIME;
+            bmissCmd->numBeacons =  atoi(optarg);
+            if ((bmissCmd->numBeacons < MIN_BMISS_BEACONS) ||
+                (bmissCmd->numBeacons > MAX_BMISS_BEACONS))
+            {
+                printf("BMISS beacons out of range\n");
+                cmd = 0;
+            }
+            break;
+
+        case WMI_SET_AC_PARAMS:
+            cmd = WMI_SET_AC_PARAMS;
+            break;
+        case WMI_SET_AC_VAL:
+            acParamsCmd->ac = atoi(optarg);
+            break;
+        case 'A':
+            acParamsCmd->txop = atoi(optarg);
+            break;
+        case 'B':
+            acParamsCmd->eCWmin = atoi(optarg);
+            break;
+        case 'C':
+            acParamsCmd->eCWmax = atoi(optarg);
+            break;
+        case 'D':
+            acParamsCmd->aifsn = atoi(optarg);
+            break;
+        case 'E':
+            if (!strcmp(optarg, "disable")) {
+                adhocPmCmd->power_saving = ADHOC_PS_DISABLE;
+            } else if (!strcmp(optarg, "atheros")) {
+                adhocPmCmd->power_saving = ADHOC_PS_ATH;
+            } else if (!strcmp(optarg, "ieee")) {
+                adhocPmCmd->power_saving = ADHOC_PS_IEEE;
+            } else {
+                cmd = 0;
+            }
+
+            break;
+        case 'F':
+            adhocPmCmd->atim_windows = atoi(optarg);
+            break;
+        case 'G':
+            if (wmic_ether_aton(optarg, adhocBssidCmd->bssid) != A_OK) {
+                printf("bad mac address\n");
+                break;
+            }
+            printf("adhoc bssid address, %x\n", adhocBssidCmd->bssid[0]);
+            cmd = WMI_SET_ADHOC_BSSID;
+            break;
+
+       case 'J':
+            cmd = WMI_SET_WLAN_STATE;
+            if (!strcmp(optarg, "enable")) {
+                ((int *)buf)[1] = WLAN_ENABLED;
+            } else if (!strcmp(optarg, "disable")) {
+                ((int *)buf)[1] = WLAN_DISABLED;
+            } else if (!strcmp(optarg, "query")) {
+                cmd = WMI_GET_WLAN_STATE;
+            } else {
+                usage();
+            }
+            break;
+        case 'K':
+            adhocPmCmd->timeout_value = atoi(optarg);
+            break;
+       case 'O':
+            index = optind;
+            index--;
+            if((index + 6) > argc) {  /*6 is the number of  flags
+                                       scanctrlflags takes  */
+                printf("Incorrect number of scanctrlflags\n");
+                cmd = 0;
+                break;
+           }
+            sParamCmd->scanCtrlFlags = 0;
+            if (atoi(argv[index]) == 1)
+                sParamCmd->scanCtrlFlags |= CONNECT_SCAN_CTRL_FLAGS;
+            index++;
+            if (atoi(argv[index]) == 1)
+                sParamCmd->scanCtrlFlags |= SCAN_CONNECTED_CTRL_FLAGS;
+            index++;
+            if (atoi(argv[index]) == 1)
+                sParamCmd->scanCtrlFlags |= ACTIVE_SCAN_CTRL_FLAGS;
+            index++;
+            if (atoi(argv[index]) == 1)
+                sParamCmd->scanCtrlFlags |= ROAM_SCAN_CTRL_FLAGS;
+            index++;
+            if (atoi(argv[index]) == 1)
+                sParamCmd->scanCtrlFlags |= REPORT_BSSINFO_CTRL_FLAGS;
+            index++;
+            if(atoi(argv[index]) == 1)
+               sParamCmd->scanCtrlFlags |= ENABLE_AUTO_CTRL_FLAGS;
+            index++;
+            if (argc - index) {
+                if(atoi(argv[index]) == 1)
+                   sParamCmd->scanCtrlFlags |= ENABLE_SCAN_ABORT_EVENT;
+                index++;
+            }
+            if(!sParamCmd->scanCtrlFlags) {
+               sParamCmd->scanCtrlFlags = 255; /* all flags have being disabled by the user */
+            }
+            break;
+       case 'L':
+            adhocPmCmd->ttl = atoi(optarg);
+            break;
+       case  'P':
+            startScanCmd->homeDwellTime =atoi(optarg);
+            break;
+       case 'Q':
+            startScanCmd->forceScanInterval =atoi(optarg);
+            break;
+       case 'R':
+            index = optind;
+            index--;
+            if((index + 3) > argc) {
+                printf("Incorrect number of forceScanCtrlFlags\n");
+                cmd = 0;
+                break;
+            }
+            startScanCmd->scanType = atoi(argv[index]);
+            index++;
+            startScanCmd->forceFgScan = atoi(argv[index]);
+            index++;
+            startScanCmd->isLegacy = atoi(argv[index]);
+            index++;
+            break;
+       case WMI_SCAN_CHANNEL_LIST:
+            chindex = 0;
+            index = optind - 1;
+            clist = startScanCmd->channelList;
+
+            while (argv[index] != NULL) {
+                channel = atoi(argv[index]);
+                if (channel < 255) {
+                    /*
+                     * assume channel is a ieee channel #
+                     */
+                clist[chindex] = wmic_ieee2freq(channel);
+                } else {
+                    clist[chindex] = channel;
+                }
+                chindex++;
+                index++;
+            }
+            startScanCmd->numChannels = chindex;
+            break;
+       case WMI_SET_IBSS_PM_CAPS:
+            cmd = WMI_SET_IBSS_PM_CAPS;
+            break;
+       case WMI_SET_AP_PS:
+            cmd = WMI_SET_AP_PS;
+            break;
+        case WMI_SET_DISC_TIMEOUT:
+            cmd = WMI_SET_DISC_TIMEOUT;
+            discCmd->disconnectTimeout = atoi(optarg);
+            break;
+        case WMI_SET_BEACON_INT:
+            cmd = WMI_SET_BEACON_INT;
+            bconIntvl->beaconInterval = atoi(optarg);
+            break;
+        case WMI_SET_VOICE_PKT_SIZE:
+            cmd = WMI_SET_VOICE_PKT_SIZE;
+            pSizeThresh->voicePktSize = atoi(optarg);
+            break;
+        case WMI_SET_MAX_SP:
+            cmd = WMI_SET_MAX_SP;
+            pMaxSP->maxSPLen = atoi(optarg);
+            break;
+        case WMI_GET_ROAM_TBL:
+            cmd = WMI_GET_ROAM_TBL;
+            break;
+        case WMI_SET_ROAM_CTRL:
+            pRoamCtrl->roamCtrlType = atoi(optarg);
+            if (A_OK != wmic_validate_roam_ctrl(pRoamCtrl, argc-optind, argv)) {
+                break;
+            }
+            cmd = WMI_SET_ROAM_CTRL;
+            break;
+        case WMI_SET_POWERSAVE_TIMERS:
+            cmd = WMI_SET_POWERSAVE_TIMERS;
+            break;
+        case WMI_SET_POWERSAVE_TIMERS_PSPOLLTIMEOUT:
+            pPowerSave->psPollTimeout = atoi(optarg);
+            break;
+        case WMI_SET_POWERSAVE_TIMERS_TRIGGERTIMEOUT:
+            pPowerSave->triggerTimeout = atoi(optarg);
+            break;
+        case WMI_GET_POWER_MODE:
+            cmd = WMI_GET_POWER_MODE;
+            break;
+        case WMI_GET_ROAM_DATA:
+            cmd = WMI_GET_ROAM_DATA;
+            break;
+        case WMI_SET_BT_STATUS:
+            cmd = WMI_SET_BT_STATUS;
+            pBtStatCmd->streamType = atoi(optarg);
+            pBtStatCmd->status = atoi(argv[optind]);
+            if (pBtStatCmd->streamType >= BT_STREAM_MAX ||
+                pBtStatCmd->status >= BT_STATUS_MAX)
+            {
+                fprintf(stderr, "Invalid parameters.\n");
+                exit(0);
+            }
+            break;
+        case WMI_SET_BT_PARAMS:
+            cmd = WMI_SET_BT_PARAMS;
+            pBtParmCmd->paramType = atoi(optarg);
+            if (pBtParmCmd->paramType >= BT_PARAM_MAX)
+            {
+                fprintf(stderr, "Invalid parameters.\n");
+                exit(0);
+            }
+            if (BT_PARAM_SCO == pBtParmCmd->paramType) {
+                pBtParmCmd->info.scoParams.numScoCyclesForceTrigger =
+                                    strtoul(argv[optind], NULL, 0);
+                pBtParmCmd->info.scoParams.dataResponseTimeout =
+                    strtoul(argv[optind+1], NULL, 0);
+                pBtParmCmd->info.scoParams.stompScoRules =
+                    strtoul(argv[optind+2], NULL, 0);
+                pBtParmCmd->info.scoParams.scoOptFlags =
+                    strtoul(argv[optind+3], NULL, 0);
+                pBtParmCmd->info.scoParams.stompDutyCyleVal =
+                    strtoul(argv[optind+4], NULL, 0);
+                pBtParmCmd->info.scoParams.stompDutyCyleMaxVal =
+                    strtoul(argv[optind+5], NULL, 0);
+                pBtParmCmd->info.scoParams. psPollLatencyFraction =
+                    strtoul(argv[optind+6], NULL, 0);
+                pBtParmCmd->info.scoParams.noSCOSlots =
+                    strtoul(argv[optind+7], NULL, 0);
+                pBtParmCmd->info.scoParams.noIdleSlots =
+                    strtoul(argv[optind+8], NULL, 0);
+                pBtParmCmd->info.scoParams.scoOptOffRssi =
+                    strtoul(argv[optind+9], NULL, 0);
+                pBtParmCmd->info.scoParams.scoOptOnRssi =
+                    strtoul(argv[optind+10], NULL, 0);
+                pBtParmCmd->info.scoParams.scoOptRtsCount =
+                    strtoul(argv[optind+11], NULL, 0);
+            }else if (BT_PARAM_A2DP == pBtParmCmd->paramType) {
+                pBtParmCmd->info.a2dpParams.a2dpWlanUsageLimit =
+                    strtoul(argv[optind], NULL, 0);
+                pBtParmCmd->info.a2dpParams.a2dpBurstCntMin =
+                    strtoul(argv[optind+1 ], NULL, 0);
+                pBtParmCmd->info.a2dpParams.a2dpDataRespTimeout =
+                    strtoul(argv[optind+2 ], NULL, 0);
+                pBtParmCmd->info.a2dpParams.a2dpOptFlags =
+                    strtoul(argv[optind+3 ], NULL, 0);
+                pBtParmCmd->info.a2dpParams.isCoLocatedBtRoleMaster =
+                    strtoul(argv[optind+4 ], NULL, 0);
+                pBtParmCmd->info.a2dpParams.a2dpOptOffRssi =
+                    strtoul(argv[optind+5], NULL, 0);
+                pBtParmCmd->info.a2dpParams.a2dpOptOnRssi =
+                    strtoul(argv[optind+6], NULL, 0);
+                pBtParmCmd->info.a2dpParams.a2dpOptRtsCount =
+                    strtoul(argv[optind+7 ], NULL, 0);
+
+            }else if (BT_PARAM_ANTENNA_CONFIG == pBtParmCmd->paramType) {
+                pBtParmCmd->info.antType = strtoul(argv[optind], NULL, 0);
+            } else if (BT_PARAM_COLOCATED_BT_DEVICE == pBtParmCmd->paramType) {
+                pBtParmCmd->info.coLocatedBtDev =
+                                         strtoul(argv[optind], NULL, 0);
+            }else if(BT_PARAM_ACLCOEX == pBtParmCmd->paramType) {
+                pBtParmCmd->info.aclCoexParams.aclWlanMediumUsageTime =
+                                            strtoul(argv[optind], NULL, 0);
+                pBtParmCmd->info.aclCoexParams.aclBtMediumUsageTime =
+                                            strtoul(argv[optind+1], NULL, 0);
+                pBtParmCmd->info.aclCoexParams.aclDataRespTimeout =
+                                            strtoul(argv[optind+2], NULL, 0);
+                pBtParmCmd->info.aclCoexParams.aclDetectTimeout =
+                                            strtoul(argv[optind+3], NULL, 0);
+                pBtParmCmd->info.aclCoexParams.aclmaxPktCnt =
+                                            strtoul(argv[optind + 4], NULL, 0);
+            } else if (BT_PARAM_11A_SEPARATE_ANT == pBtParmCmd->paramType) {
+                printf("BT_PARAM_11A_SEPARATE_ANT \n");
+            }
+            else
+            {
+                fprintf(stderr, "Invalid parameters.\n");
+                exit(0);
+            }
+            break;
+        case WMI_SET_BTCOEX_FE_ANT:
+            cmd = WMI_SET_BTCOEX_FE_ANT;
+            pBtcoexFeAntCmd->btcoexFeAntType = atoi(optarg);
+            if (pBtcoexFeAntCmd->btcoexFeAntType >= WMI_BTCOEX_FE_ANT_TYPE_MAX) {
+                printf("Invalid configuration [1-Single Antenna,  2- dual antenna low isolation, 3 - dual antenna high isolation\n");
+                printf("4 - bypass mode, 5 - combine mode]\n");
+                exit(-1);
+            }
+            break;
+    case WMI_SET_BTCOEX_COLOCATED_BT_DEV:
+        cmd = WMI_SET_BTCOEX_COLOCATED_BT_DEV;
+        pBtcoexCoLocatedBtCmd->btcoexCoLocatedBTdev = atoi(optarg);
+            if (pBtcoexCoLocatedBtCmd->btcoexCoLocatedBTdev > 4) {
+                printf("Invalid configuration %d\n",
+                        pBtcoexCoLocatedBtCmd->btcoexCoLocatedBTdev);
+                exit(-1);
+            }
+        printf("btcoex colocated antType = %d\n",
+                   pBtcoexCoLocatedBtCmd->btcoexCoLocatedBTdev);
+        break;
+    case WMI_SET_BTCOEX_SCO_CONFIG:
+        cmd = WMI_SET_BTCOEX_SCO_CONFIG;
+        index = optind - 1;
+        if((index + 17) > argc) {
+            printf("Incorrect number of sco Config\n");
+            exit(-1);
+        }
+        pBtcoexScoConfigCmd->scoConfig.scoSlots =  atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoConfig.scoIdleSlots = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoConfig.scoFlags = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoConfig.linkId = atoi(argv[index++]);
+
+        pBtcoexScoConfigCmd->scoPspollConfig.scoCyclesForceTrigger = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoPspollConfig.scoDataResponseTimeout = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoPspollConfig.scoStompDutyCyleVal = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoPspollConfig.scoStompDutyCyleMaxVal = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoPspollConfig.scoPsPollLatencyFraction = atoi(argv[index++]);
+
+
+        pBtcoexScoConfigCmd->scoOptModeConfig.scoStompCntIn100ms = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoOptModeConfig.scoContStompMax = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoOptModeConfig.scoMinlowRateMbps = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoOptModeConfig.scoLowRateCnt = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoOptModeConfig.scoHighPktRatio = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoOptModeConfig.scoMaxAggrSize = atoi(argv[index++]);
+
+        pBtcoexScoConfigCmd->scoWlanScanConfig.scanInterval = atoi(argv[index++]);
+        pBtcoexScoConfigCmd->scoWlanScanConfig.maxScanStompCnt = atoi(argv[index++]);
+        break;
+    case WMI_SET_BTCOEX_A2DP_CONFIG:
+        cmd = WMI_SET_BTCOEX_A2DP_CONFIG;
+        index = optind - 1;
+        if((index + 10) > argc ) {
+            printf("Incorrect number of A2DP Config\n");
+            exit(-1);
+        }
+        pBtcoexA2dpConfigCmd->a2dpConfig.a2dpFlags =  atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dpConfig.linkId = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dppspollConfig.a2dpWlanMaxDur = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dppspollConfig.a2dpMinBurstCnt = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dppspollConfig.a2dpDataRespTimeout = atoi(argv[index++]);
+
+        pBtcoexA2dpConfigCmd->a2dpOptConfig.a2dpMinlowRateMbps = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dpOptConfig.a2dpLowRateCnt = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dpOptConfig.a2dpHighPktRatio = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dpOptConfig.a2dpMaxAggrSize = atoi(argv[index++]);
+        pBtcoexA2dpConfigCmd->a2dpOptConfig.a2dpPktStompCnt = atoi(argv[index++]);
+
+        printf("a2dp Config, flags=%x\n", pBtcoexA2dpConfigCmd->a2dpConfig.a2dpFlags);
+        break;
+    case WMI_SET_BTCOEX_ACLCOEX_CONFIG:
+        cmd = WMI_SET_BTCOEX_ACLCOEX_CONFIG;
+        index = optind - 1;
+        if((index + 14) > argc ) {
+            printf("Incorrect number of ACL COEX Config\n");
+            exit(-1);
+        }
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclWlanMediumDur     =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclBtMediumDur       =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclDetectTimeout     =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclPktCntLowerLimit  =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclIterForEnDis      =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclPktCntUpperLimit  =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.aclCoexFlags         =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexConfig.linkId               =  atoi(argv[index++]);
+
+        pBtcoexAclCoexConfigCmd->aclCoexPspollConfig.aclDataRespTimeout =  atoi(argv[index++]);
+
+        pBtcoexAclCoexConfigCmd->aclCoexOptConfig.aclCoexMinlowRateMbps  =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexOptConfig.aclCoexLowRateCnt  =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexOptConfig.aclCoexHighPktRatio  =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexOptConfig.aclCoexMaxAggrSize  =  atoi(argv[index++]);
+        pBtcoexAclCoexConfigCmd->aclCoexOptConfig.aclPktStompCnt  =  atoi(argv[index++]);
+        break;
+
+    case WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG:
+        cmd = WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG;
+        index = optind - 1;
+        if((index + 3) > argc) {
+            printf("Incorrect number of inquiry_page Config\n");
+            exit(-1);
+        }
+        pBtcoexbtinquiryPageConfigCmd->btInquiryDataFetchFrequency = atoi(argv[index++]);
+        pBtcoexbtinquiryPageConfigCmd->protectBmissDurPostBtInquiry = atoi(argv[index++]);
+        pBtcoexbtinquiryPageConfigCmd->btInquiryPageFlag = atoi(argv[index++]);
+        break;
+
+    case WMI_SET_BTCOEX_BT_OPERATING_STATUS:
+        cmd = WMI_SET_BTCOEX_BT_OPERATING_STATUS;
+        index = optind - 1;
+        if((index + 3) > argc) {
+            printf("Incorrect number of operating status cmdn");
+            exit(-1);
+        }
+
+        pBtcoexBtOperatingStatusCmd->btProfileType =atoi(argv[index++]);
+        pBtcoexBtOperatingStatusCmd->btOperatingStatus =atoi(argv[index++]);
+        pBtcoexBtOperatingStatusCmd->btLinkId =atoi(argv[index++]);
+        break;
+
+    case WMI_GET_BTCOEX_CONFIG:
+        cmd = WMI_GET_BTCOEX_CONFIG;
+        index = optind - 1;
+        if((index + 2) > argc) {
+            printf("Incorrect number of get Config\n");
+            exit(-1);
+        }
+        pBtcoexConfig->configCmd.btProfileType = atoi(argv[index++]);
+        pBtcoexConfig->configCmd.linkId = atoi(argv[index++]);
+        break;
+    case WMI_GET_BTCOEX_STATS:
+        cmd = WMI_GET_BTCOEX_STATS;
+        break;
+        case WMI_SET_RETRYLIMITS:
+            index = optind - 1;
+            setRetryCmd->frameType = atoi(argv[index++]);
+            if (setRetryCmd->frameType > 2) {
+                printf("Invalid frame type! [0 - 2]\n");
+                exit(-1);
+            }
+            setRetryCmd->trafficClass = atoi(argv[index++]);
+            if (setRetryCmd->trafficClass > 3) {
+                printf("Invalid traffic class! [0 - 3]\n");
+                exit(-1);
+            }
+            setRetryCmd->maxRetries = atoi(argv[index++]);
+            if (setRetryCmd->maxRetries > WMI_MAX_RETRIES) {
+                printf("Invalid max retries! [0 - 13] \n");
+                exit(-1);
+            }
+            if (!strcmp(argv[index], "on")) {
+                setRetryCmd->enableNotify = 1;
+            } else if (!strcmp(argv[index], "off")) {
+                setRetryCmd->enableNotify = 0;
+            } else {
+                usage();
+            }
+            cmd = WMI_SET_RETRYLIMITS;
+            break;
+        case WMI_START_SCAN:
+            cmd = WMI_START_SCAN;
+            startScanCmd->scanType= 0;
+            startScanCmd->forceFgScan= false;
+            startScanCmd->isLegacy= false;
+            startScanCmd->homeDwellTime = 0;
+            startScanCmd->forceScanInterval = 0;
+            startScanCmd->numChannels = 0;
+            break;
+        case WMI_SET_FIX_RATES:
+            cmd = WMI_SET_FIX_RATES;
+            break;
+        case WMI_GET_FIX_RATES:
+            cmd = WMI_GET_FIX_RATES;
+            break;
+        case WMI_SET_AUTH_MODE:
+            cmd = WMI_SET_AUTH_MODE;
+            break;
+        case WMI_SET_REASSOC_MODE:
+            cmd = WMI_SET_REASSOC_MODE;
+            break;
+        case WMI_SET_LPREAMBLE:
+            cmd = WMI_SET_LPREAMBLE;
+            setLpreambleCmd->status = atoi(optarg);
+            break;
+        case WMI_SET_RTS:
+            cmd = WMI_SET_RTS;
+            setRtsCmd->threshold = atoi(optarg);
+            break;
+        case WMI_SET_WMM:
+            cmd = WMI_SET_WMM;
+            setWmmCmd->status = atoi(optarg);
+            break;
+        case WMI_SET_QOS_SUPP:
+            cmd = WMI_SET_QOS_SUPP;
+            qosSupp->status = atoi(optarg);
+            break;
+        case WMI_APSD_TIM_POLICY:
+            if (!strcmp(optarg, "ignore")) {
+                pPowerSave->apsdTimPolicy = IGNORE_TIM_ALL_QUEUES_APSD;
+            } else {
+                pPowerSave->apsdTimPolicy = PROCESS_TIM_ALL_QUEUES_APSD;
+            }
+            break;
+        case WMI_SIMULATED_APSD_TIM_POLICY:
+            if (!strcmp(optarg, "ignore")) {
+                pPowerSave->simulatedAPSDTimPolicy = IGNORE_TIM_SIMULATED_APSD;
+            } else {
+                pPowerSave->simulatedAPSDTimPolicy = PROCESS_TIM_SIMULATED_APSD;
+            }
+            break;
+        case WMI_SET_ERROR_DETECTION:
+            cmd = WMI_SET_ERROR_DETECTION;
+            break;
+        case 'S':
+            hbparam->threshold = atoi(optarg);
+            break;
+        case 'T':
+            hbparam->frequency = atoi(optarg);
+            break;
+        case WMI_GET_HB_CHALLENGE_RESP:
+            cmd = WMI_GET_HB_CHALLENGE_RESP;
+            break;
+        case 'U':
+            *cookie = strtoul(optarg, (char **)NULL, 0);
+            break;
+        case USER_SETKEYS:
+            if (argc == 5) {
+                user_setkeys_info->keyOpCtrl = 0;
+                cmd = USER_SETKEYS;
+            } else {
+              printf("Invalid arg %s:Usage --usersetkeys --initrsc=<on/off>",
+                     optarg);
+            }
+            break;
+        case WMI_GET_RD:
+            cmd = WMI_GET_RD;
+            break;
+        case WMI_SET_TXOP:
+            cmd = WMI_SET_TXOP;
+            pTxOp->txopEnable = atoi(optarg);
+            break;
+        case DIAG_ADDR:
+            *diagaddr = strtoul(optarg, (char **)NULL, 0);
+            printf("addr: 0x%x\n", *diagaddr);
+            break;
+        case DIAG_DATA:
+            *diagdata = strtoul(optarg, (char **)NULL, 0);
+            printf("data: 0x%x\n", *diagdata);
+            break;
+        case DIAG_READ:
+            cmd = DIAG_READ;
+            break;
+        case DIAG_WRITE:
+            cmd = DIAG_WRITE;
+            break;
+        case WMI_SET_KEEPALIVE:
+             cmd = WMI_SET_KEEPALIVE;
+	     if (wmic_validate_setkeepalive(setKeepAlive, argv) != A_OK) {
+		     printf("setkeepalive: invalid args\n");
+		     cmd = 0;
+		     break;
+	     }
+             break;
+        case WMI_GET_KEEPALIVE:
+             cmd = WMI_GET_KEEPALIVE;
+             break;
+        case WMI_SET_APPIE:
+             cmd = WMI_SET_APPIE;
+
+            if (argc - optind != 1) {
+                printf("Usage is --setappie <beacon/probe/respon/assoc> <IE>\n");
+                cmd = 0;
+                break;
+            }
+
+            if (A_OK != wmic_validate_appie(appIEInfo, argv)) {
+                cmd = 0;
+                break;
+            }
+            break;
+        case WMI_SET_MGMT_FRM_RX_FILTER:
+             cmd = WMI_SET_MGMT_FRM_RX_FILTER;
+            if (argc - optind != 1) {
+                printf("Usage is --setmgmtfilter <set/clear> <frmtype> \n");
+                cmd = 0;
+                break;
+            }
+
+            if (A_OK != wmic_validate_mgmtfilter(pMgmtFilter, argv)) {
+                cmd = 0;
+                break;
+            }
+            break;
+        case 'V':
+            dbglogCfg->mmask = strtoul(optarg, (char **)NULL, 0);
+            dbglogCfg->valid |= DBGLOG_MODULE_LOG_ENABLE_MASK;
+            break;
+        case 'W':
+            dbglogCfg->rep = strtoul(optarg, (char **)NULL, 0);
+            dbglogCfg->valid |= DBGLOG_REPORTING_ENABLED_MASK;
+            break;
+        case 'X':
+            dbglogCfg->tsr = strtoul(optarg, (char **)NULL, 0);
+            dbglogCfg->valid |= DBGLOG_TIMESTAMP_RESOLUTION_MASK;
+            break;
+        case 'Y':
+            dbglogCfg->size = strtoul(optarg, (char **)NULL, 0);
+            dbglogCfg->valid |= DBGLOG_REPORT_SIZE_MASK;
+            break;
+        case 'Z':
+            clearstat = 1;
+            break;
+        case WMI_BSSID:
+             convert_hexstring_bytearray(optarg, bssid, sizeof(bssid));
+            break;
+        case USER_SETKEYS_INITRSC:
+            if (strcmp(optarg, "on") == 0) {
+                user_setkeys_info->keyOpCtrl &=
+                                    ~AR6000_USER_SETKEYS_RSC_UNCHANGED;
+            } else if (strcmp(optarg, "off") == 0) {
+                user_setkeys_info->keyOpCtrl |=
+                                    AR6000_USER_SETKEYS_RSC_UNCHANGED;
+            } else {
+              printf("Invalid arg %s:Usage --usersetkeys --initrsc=<on/off>",
+                     optarg);
+            }
+            break;
+        case WMI_DBGLOG_CFG_MODULE:
+            dbglogCfg->valid = 0;
+            cmd = WMI_DBGLOG_CFG_MODULE;
+            break;
+        case WMI_DBGLOG_GET_DEBUG_LOGS:
+            cmd = WMI_DBGLOG_GET_DEBUG_LOGS;
+            break;
+        case WMI_SET_HOST_SLEEP_MODE:
+            cmd = WMI_SET_HOST_SLEEP_MODE;
+            if (!strcmp(optarg, "asleep")) {
+                hostSleepModeCmd->asleep = TRUE;
+                hostSleepModeCmd->awake = FALSE;
+            } else if (!strcmp(optarg, "awake")) {