2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted (subject to the limitations in the
7 * disclaimer below) provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
17 * * Neither the name of Qualcomm Atheros nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
22 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 * This file contains the definitions of the WMI protocol specified in the
38 * Wireless Module Interface (WMI). It includes definitions of all the
39 * commands and events. Commands are messages from the host to the WM.
40 * Events and Replies are messages from the WM to the host.
42 * Ownership of correctness in regards to WMI commands
43 * belongs to the host driver and the WM is not required to validate
44 * parameters for value, proper range, or any other checking.
46 * $Id: //depot/sw/branches/fusion_usb/target_firmware/wlan/include/wmi.h#6 $
58 #define HTC_PROTOCOL_VERSION 0x0002
59 #define HTC_PROTOCOL_REVISION 0x0000
61 #define WMI_PROTOCOL_VERSION 0x0002
62 #define WMI_PROTOCOL_REVISION 0x0000
64 #define ATH_MAC_LEN 6 /* length of mac in bytes */
65 #define WMI_CMD_MAX_LEN 100
66 #define WMI_CONTROL_MSG_MAX_LEN 256
67 #define WMI_OPT_CONTROL_MSG_MAX_LEN 1536
68 #define IS_ETHERTYPE(_typeOrLen) ((_typeOrLen) >= 0x0600)
69 #define RFC1042OUI {0x00, 0x00, 0x00}
71 #define IP_ETHERTYPE 0x0800
73 #define WMI_IMPLICIT_PSTREAM 0xFF
74 #define WMI_MAX_THINSTREAM 15
76 struct host_app_area_s {
77 a_uint32_t wmi_protocol_ver;
83 typedef PREPACK struct {
84 a_uint8_t dstMac[ATH_MAC_LEN];
85 a_uint8_t srcMac[ATH_MAC_LEN];
87 } POSTPACK ATH_MAC_HDR;
89 typedef PREPACK struct {
95 } POSTPACK ATH_LLC_SNAP_HDR;
105 typedef PREPACK struct {
107 a_uint8_t info; /* WMI_MSG_TYPE in lower 2 bits - b1b0 */
108 /* UP in next 3 bits - b4b3b2 */
109 #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
110 #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
111 #define WMI_DATA_HDR_UP_MASK 0x07
112 #define WMI_DATA_HDR_UP_SHIFT 2
113 #define WMI_DATA_HDR_IS_MSG_TYPE(h, t) (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t))
114 } POSTPACK WMI_DATA_HDR;
117 #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))
118 #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))
123 typedef PREPACK struct {
124 a_uint16_t commandId;
126 } POSTPACK WMI_CMD_HDR; /* used for commands and events */
132 WMI_ECHO_CMDID = 0x0001,
133 WMI_ACCESS_MEMORY_CMDID,
135 /* Commands to Target */
137 WMI_DISABLE_INTR_CMDID,
138 WMI_ENABLE_INTR_CMDID,
141 WMI_STOP_TX_DMA_CMDID,
142 WMI_ABORT_TX_DMA_CMDID,
144 WMI_DRAIN_TXQ_ALL_CMDID,
145 WMI_START_RECV_CMDID,
147 WMI_FLUSH_RECV_CMDID,
149 WMI_NODE_CREATE_CMDID,
150 WMI_NODE_REMOVE_CMDID,
151 WMI_VAP_REMOVE_CMDID,
152 WMI_VAP_CREATE_CMDID,
155 WMI_RC_STATE_CHANGE_CMDID,
156 WMI_RC_RATE_UPDATE_CMDID,
157 WMI_TARGET_IC_UPDATE_CMDID,
158 WMI_TX_AGGR_ENABLE_CMDID,
159 WMI_TGT_DETACH_CMDID,
160 WMI_NODE_UPDATE_CMDID,
164 WMI_BITRATE_MASK_CMDID,
171 WMI_FRAME_BEACON = 0,
173 WMI_FRAME_PROBE_RESP,
175 WMI_FRAME_ASSOC_RESP,
177 } WMI_MGMT_FRAME_TYPE;
183 INFRA_NETWORK = 0x01,
184 ADHOC_NETWORK = 0x02,
185 ADHOC_CREATOR = 0x04,
192 LEAP_AUTH = 0x04, /* different from IEEE_AUTH_MODE definitions */
200 WPA2_PSK_AUTH = 0x05,
201 WPA_AUTH_CCKM = 0x06,
202 WPA2_AUTH_CCKM = 0x07,
212 #define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
213 #define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
215 #define WMI_MIN_KEY_INDEX 0
216 #define WMI_MAX_KEY_INDEX 3
218 #define WMI_MAX_KEY_LEN 32
220 #define WMI_MAX_SSID_LEN 32
223 CONNECT_ASSOC_POLICY_USER = 0x0001,
224 CONNECT_SEND_REASSOC = 0x0002,
225 CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
226 CONNECT_PROFILE_MATCH_DONE = 0x0008,
227 CONNECT_IGNORE_AAC_BEACON = 0x0010,
228 CONNECT_CSA_FOLLOW_BSS = 0x0020,
229 } WMI_CONNECT_CTRL_FLAGS_BITS;
231 #define DEFAULT_CONNECT_CTRL_FLAGS (CONNECT_CSA_FOLLOW_BSS)
236 #define WMI_ECHOCMD_MSG_MAX_LEN 53//64 - HTC_HDR_LENGTH + sizeof(WMI_CMD_HDR) - 1
238 typedef PREPACK struct {
240 a_uint8_t msgData[1];
241 } POSTPACK WMI_ECHO_CMD;
244 * WMI_ACCESS_MEMORY_CMDID
246 #define WMI_ACCESS_MEMORY_MAX_TUPLES 8
248 typedef PREPACK struct {
255 typedef PREPACK struct {
256 a_uint16_t tupleNumL;
257 a_uint16_t tupleNumH;
259 } POSTPACK WMI_ACCESS_MEMORY_CMD;
262 * List of Events (target to host)
265 WMI_TGT_RDY_EVENTID = 0x1001,
274 typedef PREPACK struct {
276 a_uint8_t beaconPendingCount;
277 } POSTPACK WMI_SWBA_EVENT;
279 typedef PREPACK struct {
283 } POSTPACK __WMI_TXSTATUS_EVENT;
285 #define HTC_MAX_TX_STATUS 12
287 typedef PREPACK struct {
289 __WMI_TXSTATUS_EVENT txstatus[HTC_MAX_TX_STATUS];
290 } POSTPACK WMI_TXSTATUS_EVENT;
293 //#include "athendpack.h"