1
//------------------------------------------------------------------------------
2
// <copyright file="wmi_thin.h" company="Atheros">
3
// Copyright (c) 2004-2010 Atheros Corporation. All rights reserved.
6
// Permission to use, copy, modify, and/or distribute this software for any
7
// purpose with or without fee is hereby granted, provided that the above
8
// copyright notice and this permission notice appear in all copies.
10
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
//------------------------------------------------------------------------------
20
//==============================================================================
21
// Author(s): ="Atheros"
22
//==============================================================================
25
* This file contains the definitions of the WMI protocol specified in the
26
* Wireless Module Interface (WMI). It includes definitions of all the
27
* commands and events. Commands are messages from the host to the WM.
28
* Events and Replies are messages from the WM to the host.
30
* Ownership of correctness in regards to WMI commands
31
* belongs to the host driver and the WM is not required to validate
32
* parameters for value, proper range, or any other checking.
45
WMI_THIN_CONFIG_CMDID = 0x8000, // WMI_THIN_RESERVED_START
46
WMI_THIN_SET_MIB_CMDID,
47
WMI_THIN_GET_MIB_CMDID,
49
/* add new CMDID's here */
50
WMI_THIN_RESERVED_END_CMDID = 0x8fff // WMI_THIN_RESERVED_END
51
} WMI_THIN_COMMAND_ID;
54
TEMPLATE_FRM_FIRST = 0,
55
TEMPLATE_FRM_PROBE_REQ =TEMPLATE_FRM_FIRST,
57
TEMPLATE_FRM_PROBE_RESP,
59
TEMPLATE_FRM_QOS_NULL,
62
}WMI_TEMPLATE_FRM_TYPE;
64
/* TEMPLATE_FRM_LEN... represent the maximum allowable
65
* data lengths (bytes) for each frame type */
66
#define TEMPLATE_FRM_LEN_PROBE_REQ (256) /* Symbian dictates a minimum of 256 for these 3 frame types */
67
#define TEMPLATE_FRM_LEN_BEACON (256)
68
#define TEMPLATE_FRM_LEN_PROBE_RESP (256)
69
#define TEMPLATE_FRM_LEN_NULL (32)
70
#define TEMPLATE_FRM_LEN_QOS_NULL (32)
71
#define TEMPLATE_FRM_LEN_PSPOLL (32)
72
#define TEMPLATE_FRM_LEN_SUM (TEMPLATE_FRM_LEN_PROBE_REQ + TEMPLATE_FRM_LEN_BEACON + TEMPLATE_FRM_LEN_PROBE_RESP + \
73
TEMPLATE_FRM_LEN_NULL + TEMPLATE_FRM_LEN_QOS_NULL + TEMPLATE_FRM_LEN_PSPOLL)
76
/* MAC Header Build Rules */
77
/* These values allow the host to configure the
78
* target code that is responsible for constructing
79
* the MAC header. In cases where the MAC header
80
* is provided by the host framework, the target
81
* has a diminished responsibility over what fields
82
* it must write. This will vary from framework to framework.
83
* Symbian requires different behavior from MAC80211 which
84
* requires different behavior from MS Native Wifi. */
85
#define WMI_WRT_VER_TYPE 0x00000001
86
#define WMI_WRT_DURATION 0x00000002
87
#define WMI_WRT_DIRECTION 0x00000004
88
#define WMI_WRT_POWER 0x00000008
89
#define WMI_WRT_WEP 0x00000010
90
#define WMI_WRT_MORE 0x00000020
91
#define WMI_WRT_BSSID 0x00000040
92
#define WMI_WRT_QOS 0x00000080
93
#define WMI_WRT_SEQNO 0x00000100
94
#define WMI_GUARD_TX 0x00000200 /* prevents TX ops that are not allowed for a current state */
95
#define WMI_WRT_DEFAULT_CONFIG (WMI_WRT_VER_TYPE | WMI_WRT_DURATION | WMI_WRT_DIRECTION | \
96
WMI_WRT_POWER | WMI_WRT_MORE | WMI_WRT_WEP | WMI_WRT_BSSID | \
97
WMI_WRT_QOS | WMI_WRT_SEQNO | WMI_GUARD_TX)
99
/* WMI_THIN_CONFIG_TXCOMPLETE -- Used to configure the params and content for
100
* TX Complete messages the will come from the Target. these messages are
101
* disabled by default but can be enabled using this structure and the
102
* WMI_THIN_CONFIG_CMDID. */
103
typedef PREPACK struct {
104
u8 version; /* the versioned type of messages to use or 0 to disable */
105
u8 countThreshold; /* msg count threshold triggering a tx complete message */
106
u16 timeThreshold; /* timeout interval in MSEC triggering a tx complete message */
107
} POSTPACK WMI_THIN_CONFIG_TXCOMPLETE;
109
/* WMI_THIN_CONFIG_DECRYPT_ERR -- Used to configure behavior for received frames
110
* that have decryption errors. The default behavior is to discard the frame
111
* without notification. Alternately, the MAC Header is forwarded to the host
112
* with the failed status. */
113
typedef PREPACK struct {
114
u8 enable; /* 1 == send decrypt errors to the host, 0 == don't */
115
u8 reserved[3]; /* align padding */
116
} POSTPACK WMI_THIN_CONFIG_DECRYPT_ERR;
118
/* WMI_THIN_CONFIG_TX_MAC_RULES -- Used to configure behavior for transmitted
119
* frames that require partial MAC header construction. These rules
120
* are used by the target to indicate which fields need to be written. */
121
typedef PREPACK struct {
122
u32 rules; /* combination of WMI_WRT_... values */
123
} POSTPACK WMI_THIN_CONFIG_TX_MAC_RULES;
125
/* WMI_THIN_CONFIG_RX_FILTER_RULES -- Used to configure behavior for received
126
* frames as to which frames should get forwarded to the host and which
127
* should get processed internally. */
128
typedef PREPACK struct {
129
u32 rules; /* combination of WMI_FILT_... values */
130
} POSTPACK WMI_THIN_CONFIG_RX_FILTER_RULES;
132
/* WMI_THIN_CONFIG_CMD -- Used to contain some combination of the above
133
* WMI_THIN_CONFIG_... structures. The actual combination is indicated
134
* by the value of cfgField. Each bit in this field corresponds to
135
* one of the above structures. */
136
typedef PREPACK struct {
137
#define WMI_THIN_CFG_TXCOMP 0x00000001
138
#define WMI_THIN_CFG_DECRYPT 0x00000002
139
#define WMI_THIN_CFG_MAC_RULES 0x00000004
140
#define WMI_THIN_CFG_FILTER_RULES 0x00000008
141
u32 cfgField; /* combination of WMI_THIN_CFG_... describes contents of config command */
142
u16 length; /* length in bytes of appended sub-commands */
143
u8 reserved[2]; /* align padding */
144
} POSTPACK WMI_THIN_CONFIG_CMD;
146
/* MIB Access Identifiers tailored for Symbian. */
148
MIB_ID_STA_MAC = 1, // [READONLY]
149
MIB_ID_RX_LIFE_TIME, // [NOT IMPLEMENTED]
150
MIB_ID_SLOT_TIME, // [READ/WRITE]
151
MIB_ID_RTS_THRESHOLD, // [READ/WRITE]
152
MIB_ID_CTS_TO_SELF, // [READ/WRITE]
153
MIB_ID_TEMPLATE_FRAME, // [WRITE ONLY]
154
MIB_ID_RXFRAME_FILTER, // [READ/WRITE]
155
MIB_ID_BEACON_FILTER_TABLE, // [WRITE ONLY]
156
MIB_ID_BEACON_FILTER, // [READ/WRITE]
157
MIB_ID_BEACON_LOST_COUNT, // [WRITE ONLY]
158
MIB_ID_RSSI_THRESHOLD, // [WRITE ONLY]
159
MIB_ID_HT_CAP, // [NOT IMPLEMENTED]
160
MIB_ID_HT_OP, // [NOT IMPLEMENTED]
161
MIB_ID_HT_2ND_BEACON, // [NOT IMPLEMENTED]
162
MIB_ID_HT_BLOCK_ACK, // [NOT IMPLEMENTED]
163
MIB_ID_PREAMBLE, // [READ/WRITE]
164
/*MIB_ID_GROUP_ADDR_TABLE,*/
165
/*MIB_ID_WEP_DEFAULT_KEY_ID */
167
/*MIB_ID_ARP_IP_TABLE */
168
/*MIB_ID_SLEEP_MODE */
169
/*MIB_ID_WAKE_INTERVAL*/
170
/*MIB_ID_STAT_TABLE*/
171
/*MIB_ID_IBSS_PWR_SAVE*/
172
/*MIB_ID_COUNTERS_TABLE*/
173
/*MIB_ID_ETHERTYPE_FILTER*/
174
/*MIB_ID_BC_UDP_FILTER*/
178
typedef PREPACK struct {
179
u8 addr[ATH_MAC_LEN];
180
} POSTPACK WMI_THIN_MIB_STA_MAC;
182
typedef PREPACK struct {
183
u32 time; // units == msec
184
} POSTPACK WMI_THIN_MIB_RX_LIFE_TIME;
186
typedef PREPACK struct {
187
u8 enable; //1 = on, 0 = off
188
} POSTPACK WMI_THIN_MIB_CTS_TO_SELF;
190
typedef PREPACK struct {
191
u32 time; // units == usec
192
} POSTPACK WMI_THIN_MIB_SLOT_TIME;
194
typedef PREPACK struct {
195
u16 length; //units == bytes
196
} POSTPACK WMI_THIN_MIB_RTS_THRESHOLD;
198
typedef PREPACK struct {
199
u8 type; // type of frame
200
u8 rate; // tx rate to be used (one of WMI_BIT_RATE)
201
u16 length; // num bytes following this structure as the template data
202
} POSTPACK WMI_THIN_MIB_TEMPLATE_FRAME;
204
typedef PREPACK struct {
205
#define FRAME_FILTER_PROMISCUOUS 0x00000001
206
#define FRAME_FILTER_BSSID 0x00000002
208
} POSTPACK WMI_THIN_MIB_RXFRAME_FILTER;
211
#define IE_FILTER_TREATMENT_CHANGE 1
212
#define IE_FILTER_TREATMENT_APPEAR 2
214
typedef PREPACK struct {
217
} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE;
219
typedef PREPACK struct {
225
} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE_OUI;
227
typedef PREPACK struct {
229
u8 entrySize; // sizeof(WMI_THIN_MIB_BEACON_FILTER_TABLE) on host cpu may be 2 may be 4
231
} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE_HEADER;
233
typedef PREPACK struct {
234
u32 count; /* num beacons between deliveries */
237
} POSTPACK WMI_THIN_MIB_BEACON_FILTER;
239
typedef PREPACK struct {
240
u32 count; /* num consec lost beacons after which send event */
241
} POSTPACK WMI_THIN_MIB_BEACON_LOST_COUNT;
243
typedef PREPACK struct {
244
u8 rssi; /* the low threshold which can trigger an event warning */
245
u8 tolerance; /* the range above and below the threshold to prevent event flooding to the host. */
246
u8 count; /* the sample count of consecutive frames necessary to trigger an event. */
247
u8 reserved[1]; /* padding */
248
} POSTPACK WMI_THIN_MIB_RSSI_THRESHOLD;
251
typedef PREPACK struct {
255
u8 addr[ATH_MAC_LEN];
262
} POSTPACK WMI_THIN_MIB_HT_CAP;
264
typedef PREPACK struct {
268
u8 secondChanneloffset;
271
} POSTPACK WMI_THIN_MIB_HT_OP;
273
typedef PREPACK struct {
274
#define SECOND_BEACON_PRIMARY 1
275
#define SECOND_BEACON_EITHER 2
276
#define SECOND_BEACON_SECONDARY 3
278
u8 reserved[3]; /* padding */
279
} POSTPACK WMI_THIN_MIB_HT_2ND_BEACON;
281
typedef PREPACK struct {
284
u8 reserved[2]; /* padding */
285
} POSTPACK WMI_THIN_MIB_HT_BLOCK_ACK;
287
typedef PREPACK struct {
288
u8 enableLong; // 1 == long preamble, 0 == short preamble
290
} POSTPACK WMI_THIN_MIB_PREAMBLE;
292
typedef PREPACK struct {
293
u16 length; /* the length in bytes of the appended MIB data */
294
u8 mibID; /* the ID of the MIB element being set */
295
u8 reserved; /* align padding */
296
} POSTPACK WMI_THIN_SET_MIB_CMD;
298
typedef PREPACK struct {
299
u8 mibID; /* the ID of the MIB element being set */
300
u8 reserved[3]; /* align padding */
301
} POSTPACK WMI_THIN_GET_MIB_CMD;
303
typedef PREPACK struct {
304
u32 basicRateMask; /* bit mask of basic rates */
305
u32 beaconIntval; /* TUs */
306
u16 atimWindow; /* TUs */
307
u16 channel; /* frequency in Mhz */
308
u8 networkType; /* INFRA_NETWORK | ADHOC_NETWORK */
309
u8 ssidLength; /* 0 - 32 */
310
u8 probe; /* != 0 : issue probe req at start */
311
u8 reserved; /* alignment */
312
u8 ssid[WMI_MAX_SSID_LEN];
313
u8 bssid[ATH_MAC_LEN];
314
} POSTPACK WMI_THIN_JOIN_CMD;
316
typedef PREPACK struct {
317
u16 dtim; /* dtim interval in num beacons */
318
u16 aid; /* 80211 AID from Assoc resp */
319
} POSTPACK WMI_THIN_POST_ASSOC_CMD;
322
WMI_THIN_EVENTID_RESERVED_START = 0x8000,
323
WMI_THIN_GET_MIB_EVENTID,
324
WMI_THIN_JOIN_EVENTID,
326
/* Add new THIN EVENTID's here */
327
WMI_THIN_EVENTID_RESERVED_END = 0x8fff
330
/* Possible values for WMI_THIN_JOIN_EVENT.result */
332
WMI_THIN_JOIN_RES_SUCCESS = 0, // device has joined the network
333
WMI_THIN_JOIN_RES_FAIL, // device failed for unspecified reason
334
WMI_THIN_JOIN_RES_TIMEOUT, // device failed due to no beacon rx in time limit
335
WMI_THIN_JOIN_RES_BAD_PARAM, // device failed due to bad cmd param.
336
}WMI_THIN_JOIN_RESULT;
338
typedef PREPACK struct {
339
u8 result; /* the result of the join cmd. one of WMI_THIN_JOIN_RESULT */
340
u8 reserved[3]; /* alignment */
341
} POSTPACK WMI_THIN_JOIN_EVENT;
347
#endif /* _WMI_THIN_H_ */