2 * Copyright (c) 2004-2006 Atheros Communications Inc.
5 * This file contains the definitions of the WMI protocol specified in the
6 * Wireless Module Interface (WMI). It includes definitions of all the
7 * commands and events. Commands are messages from the host to the WM.
8 * Events and Replies are messages from the WM to the host.
10 * Ownership of correctness in regards to WMI commands
11 * belongs to the host driver and the WM is not required to validate
12 * parameters for value, proper range, or any other checking.
14 * $Id: //depot/sw/branches/fusion_usb/target_firmware/wlan/include/wmi.h#6 $
27 #define HTC_PROTOCOL_VERSION 0x0002
28 #define HTC_PROTOCOL_REVISION 0x0000
30 #define WMI_PROTOCOL_VERSION 0x0002
31 #define WMI_PROTOCOL_REVISION 0x0000
33 #define ATH_MAC_LEN 6 /* length of mac in bytes */
34 #define WMI_CMD_MAX_LEN 100
35 #define WMI_CONTROL_MSG_MAX_LEN 256
36 #define WMI_OPT_CONTROL_MSG_MAX_LEN 1536
37 #define IS_ETHERTYPE(_typeOrLen) ((_typeOrLen) >= 0x0600)
38 #define RFC1042OUI {0x00, 0x00, 0x00}
40 #define IP_ETHERTYPE 0x0800
42 #define WMI_IMPLICIT_PSTREAM 0xFF
43 #define WMI_MAX_THINSTREAM 15
45 struct host_app_area_s {
46 a_uint32_t wmi_protocol_ver;
52 typedef PREPACK struct {
53 a_uint8_t dstMac[ATH_MAC_LEN];
54 a_uint8_t srcMac[ATH_MAC_LEN];
56 } POSTPACK ATH_MAC_HDR;
58 typedef PREPACK struct {
64 } POSTPACK ATH_LLC_SNAP_HDR;
74 typedef PREPACK struct {
76 a_uint8_t info; /* WMI_MSG_TYPE in lower 2 bits - b1b0 */
77 /* UP in next 3 bits - b4b3b2 */
78 #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
79 #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
80 #define WMI_DATA_HDR_UP_MASK 0x07
81 #define WMI_DATA_HDR_UP_SHIFT 2
82 #define WMI_DATA_HDR_IS_MSG_TYPE(h, t) (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t))
83 } POSTPACK WMI_DATA_HDR;
86 #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))
87 #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))
92 typedef PREPACK struct {
95 } POSTPACK WMI_CMD_HDR; /* used for commands and events */
101 WMI_ECHO_CMDID = 0x0001,
102 WMI_ACCESS_MEMORY_CMDID,
104 /* Commands to Target */
106 WMI_DISABLE_INTR_CMDID,
107 WMI_ENABLE_INTR_CMDID,
110 WMI_STOP_TX_DMA_CMDID,
111 WMI_ABORT_TX_DMA_CMDID,
113 WMI_DRAIN_TXQ_ALL_CMDID,
114 WMI_START_RECV_CMDID,
116 WMI_FLUSH_RECV_CMDID,
118 WMI_NODE_CREATE_CMDID,
119 WMI_NODE_REMOVE_CMDID,
120 WMI_VAP_REMOVE_CMDID,
121 WMI_VAP_CREATE_CMDID,
124 WMI_RC_STATE_CHANGE_CMDID,
125 WMI_RC_RATE_UPDATE_CMDID,
126 WMI_TARGET_IC_UPDATE_CMDID,
127 WMI_TX_AGGR_ENABLE_CMDID,
128 WMI_TGT_DETACH_CMDID,
129 WMI_NODE_UPDATE_CMDID,
133 WMI_BITRATE_MASK_CMDID,
140 WMI_FRAME_BEACON = 0,
142 WMI_FRAME_PROBE_RESP,
144 WMI_FRAME_ASSOC_RESP,
146 } WMI_MGMT_FRAME_TYPE;
152 INFRA_NETWORK = 0x01,
153 ADHOC_NETWORK = 0x02,
154 ADHOC_CREATOR = 0x04,
161 LEAP_AUTH = 0x04, /* different from IEEE_AUTH_MODE definitions */
169 WPA2_PSK_AUTH = 0x05,
170 WPA_AUTH_CCKM = 0x06,
171 WPA2_AUTH_CCKM = 0x07,
181 #define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
182 #define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
184 #define WMI_MIN_KEY_INDEX 0
185 #define WMI_MAX_KEY_INDEX 3
187 #define WMI_MAX_KEY_LEN 32
189 #define WMI_MAX_SSID_LEN 32
192 CONNECT_ASSOC_POLICY_USER = 0x0001,
193 CONNECT_SEND_REASSOC = 0x0002,
194 CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
195 CONNECT_PROFILE_MATCH_DONE = 0x0008,
196 CONNECT_IGNORE_AAC_BEACON = 0x0010,
197 CONNECT_CSA_FOLLOW_BSS = 0x0020,
198 } WMI_CONNECT_CTRL_FLAGS_BITS;
200 #define DEFAULT_CONNECT_CTRL_FLAGS (CONNECT_CSA_FOLLOW_BSS)
205 #define WMI_ECHOCMD_MSG_MAX_LEN 53//64 - HTC_HDR_LENGTH + sizeof(WMI_CMD_HDR) - 1
207 typedef PREPACK struct {
209 a_uint8_t msgData[1];
210 } POSTPACK WMI_ECHO_CMD;
213 * WMI_ACCESS_MEMORY_CMDID
215 #define WMI_ACCESS_MEMORY_MAX_TUPLES 8
217 typedef PREPACK struct {
224 typedef PREPACK struct {
225 a_uint16_t tupleNumL;
226 a_uint16_t tupleNumH;
228 } POSTPACK WMI_ACCESS_MEMORY_CMD;
231 * List of Events (target to host)
234 WMI_TGT_RDY_EVENTID = 0x1001,
243 typedef PREPACK struct {
245 a_uint8_t beaconPendingCount;
246 } POSTPACK WMI_SWBA_EVENT;
248 typedef PREPACK struct {
252 } POSTPACK __WMI_TXSTATUS_EVENT;
254 #define HTC_MAX_TX_STATUS 12
256 typedef PREPACK struct {
258 __WMI_TXSTATUS_EVENT txstatus[HTC_MAX_TX_STATUS];
259 } POSTPACK WMI_TXSTATUS_EVENT;
262 //#include "athendpack.h"