summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ath6kl/include/common/wmi_thin.h
blob: 35391edd20acdbd87bff9d8b41255054dc2d321f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
//------------------------------------------------------------------------------
// <copyright file="wmi_thin.h" company="Atheros">
//    Copyright (c) 2004-2010 Atheros Corporation.  All rights reserved.
// 
//
// 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.
//
//
//------------------------------------------------------------------------------
//==============================================================================
// Author(s): ="Atheros"
//==============================================================================

/*
 * 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 WMI commands
 * belongs to the host driver and the WM is not required to validate
 * parameters for value, proper range, or any other checking.
 *
 */

#ifndef _WMI_THIN_H_
#define _WMI_THIN_H_

#ifdef __cplusplus
extern "C" {
#endif


typedef enum {
    WMI_THIN_CONFIG_CMDID =  0x8000, // WMI_THIN_RESERVED_START 
    WMI_THIN_SET_MIB_CMDID,
    WMI_THIN_GET_MIB_CMDID,
    WMI_THIN_JOIN_CMDID,
    /* add new CMDID's here */
    WMI_THIN_RESERVED_END_CMDID = 0x8fff // WMI_THIN_RESERVED_END
} WMI_THIN_COMMAND_ID;

typedef enum{
    TEMPLATE_FRM_FIRST = 0,
    TEMPLATE_FRM_PROBE_REQ =TEMPLATE_FRM_FIRST,
    TEMPLATE_FRM_BEACON,
    TEMPLATE_FRM_PROBE_RESP,
    TEMPLATE_FRM_NULL,
    TEMPLATE_FRM_QOS_NULL,
    TEMPLATE_FRM_PSPOLL,
    TEMPLATE_FRM_MAX
}WMI_TEMPLATE_FRM_TYPE;

/* TEMPLATE_FRM_LEN... represent the maximum allowable
 * data lengths (bytes) for each frame type */
#define TEMPLATE_FRM_LEN_PROBE_REQ  (256) /* Symbian dictates a minimum of 256 for these 3 frame types */
#define TEMPLATE_FRM_LEN_BEACON     (256)
#define TEMPLATE_FRM_LEN_PROBE_RESP (256)
#define TEMPLATE_FRM_LEN_NULL       (32)
#define TEMPLATE_FRM_LEN_QOS_NULL   (32)
#define TEMPLATE_FRM_LEN_PSPOLL     (32)
#define TEMPLATE_FRM_LEN_SUM (TEMPLATE_FRM_LEN_PROBE_REQ + TEMPLATE_FRM_LEN_BEACON + TEMPLATE_FRM_LEN_PROBE_RESP + \
            TEMPLATE_FRM_LEN_NULL + TEMPLATE_FRM_LEN_QOS_NULL + TEMPLATE_FRM_LEN_PSPOLL)


/* MAC Header Build Rules */
/*  These values allow the host to configure the 
 *  target code that is responsible for constructing
 *  the MAC header.  In cases where the MAC header
 *  is provided by the host framework, the target
 *  has a diminished responsibility over what fields
 *  it must write. This will vary from framework to framework.
 *  Symbian requires different behavior from MAC80211 which
 *  requires different behavior from MS Native Wifi. */
#define WMI_WRT_VER_TYPE    0x00000001
#define WMI_WRT_DURATION    0x00000002
#define WMI_WRT_DIRECTION   0x00000004
#define WMI_WRT_POWER       0x00000008
#define WMI_WRT_WEP         0x00000010
#define WMI_WRT_MORE        0x00000020
#define WMI_WRT_BSSID       0x00000040
#define WMI_WRT_QOS         0x00000080
#define WMI_WRT_SEQNO       0x00000100
#define WMI_GUARD_TX        0x00000200 /* prevents TX ops that are not allowed for a current state */
#define WMI_WRT_DEFAULT_CONFIG  (WMI_WRT_VER_TYPE | WMI_WRT_DURATION | WMI_WRT_DIRECTION | \
                                 WMI_WRT_POWER | WMI_WRT_MORE | WMI_WRT_WEP | WMI_WRT_BSSID | \
                                 WMI_WRT_QOS | WMI_WRT_SEQNO | WMI_GUARD_TX)

/* WMI_THIN_CONFIG_TXCOMPLETE -- Used to configure the params and content for 
 *  TX Complete messages the will come from the Target.  these messages are 
 *  disabled by default but can be enabled using this structure and the 
 *  WMI_THIN_CONFIG_CMDID. */
typedef PREPACK struct {
    A_UINT8     version; /* the versioned type of messages to use or 0 to disable */
    A_UINT8     countThreshold; /* msg count threshold triggering a tx complete message */
    A_UINT16    timeThreshold; /* timeout interval in MSEC triggering a tx complete message */       
} POSTPACK WMI_THIN_CONFIG_TXCOMPLETE;

/* WMI_THIN_CONFIG_DECRYPT_ERR -- Used to configure behavior for received frames 
 *  that have decryption errors.  The default behavior is to discard the frame
 *  without notification. Alternately, the MAC Header is forwarded to the host 
 *  with the failed status. */
typedef PREPACK struct {
    A_UINT8     enable; /* 1 == send decrypt errors to the host, 0 == don't */
    A_UINT8     reserved[3]; /* align padding */
} POSTPACK WMI_THIN_CONFIG_DECRYPT_ERR;

/* WMI_THIN_CONFIG_TX_MAC_RULES -- Used to configure behavior for transmitted
 *  frames that require partial MAC header construction. These rules 
 *  are used by the target to indicate which fields need to be written. */
typedef PREPACK struct {
    A_UINT32    rules; /* combination of WMI_WRT_... values */     
} POSTPACK WMI_THIN_CONFIG_TX_MAC_RULES;

/* WMI_THIN_CONFIG_RX_FILTER_RULES -- Used to configure behavior for received
 *  frames as to which frames should get forwarded to the host and which
 *  should get processed internally. */
typedef PREPACK struct {
    A_UINT32    rules; /* combination of WMI_FILT_... values */     
} POSTPACK WMI_THIN_CONFIG_RX_FILTER_RULES;

/* WMI_THIN_CONFIG_CMD -- Used to contain some combination of the above
 *  WMI_THIN_CONFIG_... structures. The actual combination is indicated 
 *  by the value of cfgField. Each bit in this field corresponds to 
 *  one of the above structures. */
typedef PREPACK struct {
#define WMI_THIN_CFG_TXCOMP         0x00000001
#define WMI_THIN_CFG_DECRYPT        0x00000002
#define WMI_THIN_CFG_MAC_RULES      0x00000004
#define WMI_THIN_CFG_FILTER_RULES   0x00000008
    A_UINT32    cfgField;   /* combination of WMI_THIN_CFG_... describes contents of config command */
    A_UINT16    length;     /* length in bytes of appended sub-commands */        
    A_UINT8     reserved[2];   /* align padding */
} POSTPACK WMI_THIN_CONFIG_CMD;

/* MIB Access Identifiers tailored for Symbian. */
enum {
    MIB_ID_STA_MAC = 1,             // [READONLY]
    MIB_ID_RX_LIFE_TIME,            // [NOT IMPLEMENTED]
    MIB_ID_SLOT_TIME,               // [READ/WRITE]
    MIB_ID_RTS_THRESHOLD,           // [READ/WRITE]
    MIB_ID_CTS_TO_SELF,             // [READ/WRITE]
    MIB_ID_TEMPLATE_FRAME,          // [WRITE ONLY]
    MIB_ID_RXFRAME_FILTER,          // [READ/WRITE]
    MIB_ID_BEACON_FILTER_TABLE,     // [WRITE ONLY]
    MIB_ID_BEACON_FILTER,           // [READ/WRITE]
    MIB_ID_BEACON_LOST_COUNT,       // [WRITE ONLY]
    MIB_ID_RSSI_THRESHOLD,          // [WRITE ONLY]
    MIB_ID_HT_CAP,                  // [NOT IMPLEMENTED]
    MIB_ID_HT_OP,                   // [NOT IMPLEMENTED]
    MIB_ID_HT_2ND_BEACON,           // [NOT IMPLEMENTED]
    MIB_ID_HT_BLOCK_ACK,            // [NOT IMPLEMENTED]
    MIB_ID_PREAMBLE,                // [READ/WRITE]
    /*MIB_ID_GROUP_ADDR_TABLE,*/
    /*MIB_ID_WEP_DEFAULT_KEY_ID */
    /*MIB_ID_TX_POWER */
    /*MIB_ID_ARP_IP_TABLE */
    /*MIB_ID_SLEEP_MODE */
    /*MIB_ID_WAKE_INTERVAL*/
    /*MIB_ID_STAT_TABLE*/
    /*MIB_ID_IBSS_PWR_SAVE*/
    /*MIB_ID_COUNTERS_TABLE*/
    /*MIB_ID_ETHERTYPE_FILTER*/
    /*MIB_ID_BC_UDP_FILTER*/
       
};

typedef PREPACK struct {
    A_UINT8 addr[ATH_MAC_LEN];
} POSTPACK WMI_THIN_MIB_STA_MAC;

typedef PREPACK struct {
    A_UINT32 time; // units == msec
} POSTPACK WMI_THIN_MIB_RX_LIFE_TIME;

typedef PREPACK struct {
    A_UINT8 enable; //1 = on, 0 = off
} POSTPACK WMI_THIN_MIB_CTS_TO_SELF;

typedef PREPACK struct {
    A_UINT32 time; // units == usec
} POSTPACK WMI_THIN_MIB_SLOT_TIME;

typedef PREPACK struct {
    A_UINT16 length; //units == bytes
} POSTPACK WMI_THIN_MIB_RTS_THRESHOLD;

typedef PREPACK struct {
    A_UINT8 type; // type of frame
    A_UINT8 rate; // tx rate to be used (one of WMI_BIT_RATE)
    A_UINT16 length; // num bytes following this structure as the template data
} POSTPACK WMI_THIN_MIB_TEMPLATE_FRAME;

typedef PREPACK struct {
#define FRAME_FILTER_PROMISCUOUS 0x00000001
#define FRAME_FILTER_BSSID       0x00000002
    A_UINT32 filterMask; 
} POSTPACK WMI_THIN_MIB_RXFRAME_FILTER;


#define IE_FILTER_TREATMENT_CHANGE 1
#define IE_FILTER_TREATMENT_APPEAR 2

typedef PREPACK struct {
    A_UINT8 ie;
    A_UINT8 treatment;
} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE;

typedef PREPACK struct {
    A_UINT8 ie;
    A_UINT8 treatment;
    A_UINT8 oui[3];
    A_UINT8 type;
    A_UINT16 version;
} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE_OUI;

typedef PREPACK struct {
    A_UINT16 numElements;
    A_UINT8 entrySize; // sizeof(WMI_THIN_MIB_BEACON_FILTER_TABLE) on host cpu may be 2 may be 4
    A_UINT8 reserved;
} POSTPACK WMI_THIN_MIB_BEACON_FILTER_TABLE_HEADER; 

typedef PREPACK struct {
    A_UINT32 count; /* num beacons between deliveries */
    A_UINT8 enable;
    A_UINT8 reserved[3];
} POSTPACK WMI_THIN_MIB_BEACON_FILTER;

typedef PREPACK struct {
    A_UINT32 count; /* num consec lost beacons after which send event */
} POSTPACK WMI_THIN_MIB_BEACON_LOST_COUNT;

typedef PREPACK struct {
    A_UINT8 rssi; /* the low threshold which can trigger an event warning */
    A_UINT8 tolerance; /* the range above and below the threshold to prevent event flooding to the host. */
    A_UINT8 count; /* the sample count of consecutive frames necessary to trigger an event. */
    A_UINT8 reserved[1]; /* padding */
} POSTPACK WMI_THIN_MIB_RSSI_THRESHOLD;


typedef PREPACK struct {
    A_UINT32 cap;
    A_UINT32 rxRateField;
    A_UINT32 beamForming;
    A_UINT8 addr[ATH_MAC_LEN];
    A_UINT8 enable;        
    A_UINT8 stbc;
    A_UINT8 maxAMPDU;    
    A_UINT8 msduSpacing;
    A_UINT8 mcsFeedback;   
    A_UINT8 antennaSelCap;    
} POSTPACK WMI_THIN_MIB_HT_CAP;

typedef PREPACK struct {
    A_UINT32 infoField;
    A_UINT32 basicRateField;
    A_UINT8 protection;
    A_UINT8 secondChanneloffset;
    A_UINT8 channelWidth;
    A_UINT8 reserved;
} POSTPACK WMI_THIN_MIB_HT_OP;

typedef PREPACK struct {
#define SECOND_BEACON_PRIMARY   1
#define SECOND_BEACON_EITHER    2
#define SECOND_BEACON_SECONDARY 3
    A_UINT8 cfg;
    A_UINT8 reserved[3]; /* padding */
} POSTPACK WMI_THIN_MIB_HT_2ND_BEACON;

typedef PREPACK struct {
    A_UINT8 txTIDField;
    A_UINT8 rxTIDField;
    A_UINT8 reserved[2]; /* padding */
} POSTPACK WMI_THIN_MIB_HT_BLOCK_ACK;

typedef PREPACK struct {
    A_UINT8 enableLong; // 1 == long preamble, 0 == short preamble
    A_UINT8 reserved[3];
} POSTPACK WMI_THIN_MIB_PREAMBLE;

typedef PREPACK struct {    
    A_UINT16    length;     /* the length in bytes of the appended MIB data */
    A_UINT8     mibID;      /* the ID of the MIB element being set */
    A_UINT8     reserved; /* align padding */
} POSTPACK WMI_THIN_SET_MIB_CMD;

typedef PREPACK struct {    
    A_UINT8     mibID;      /* the ID of the MIB element being set */
    A_UINT8     reserved[3]; /* align padding */
} POSTPACK WMI_THIN_GET_MIB_CMD;

typedef PREPACK struct {
    A_UINT32    basicRateMask; /* bit mask of basic rates */
    A_UINT32    beaconIntval; /* TUs */
    A_UINT16    atimWindow; /* TUs */
    A_UINT16    channel; /* frequency in Mhz */
    A_UINT8     networkType; /* INFRA_NETWORK | ADHOC_NETWORK */
    A_UINT8     ssidLength; /* 0 - 32 */
    A_UINT8     probe;      /* != 0 : issue probe req at start */
    A_UINT8     reserved;   /* alignment */    
    A_UCHAR     ssid[WMI_MAX_SSID_LEN];    
    A_UINT8     bssid[ATH_MAC_LEN];
} POSTPACK WMI_THIN_JOIN_CMD;

typedef PREPACK struct {
    A_UINT16 dtim; /* dtim interval in num beacons */
    A_UINT16 aid; /* 80211 AID from Assoc resp */   
} POSTPACK WMI_THIN_POST_ASSOC_CMD;

typedef enum {
    WMI_THIN_EVENTID_RESERVED_START           = 0x8000,
    WMI_THIN_GET_MIB_EVENTID,
    WMI_THIN_JOIN_EVENTID,
    
    /* Add new THIN EVENTID's here */
    WMI_THIN_EVENTID_RESERVED_END           = 0x8fff    
} WMI_THIN_EVENT_ID;

/* Possible values for WMI_THIN_JOIN_EVENT.result */
typedef enum {
    WMI_THIN_JOIN_RES_SUCCESS = 0, // device has joined the network
    WMI_THIN_JOIN_RES_FAIL, // device failed for unspecified reason
    WMI_THIN_JOIN_RES_TIMEOUT, // device failed due to no beacon rx in time limit
    WMI_THIN_JOIN_RES_BAD_PARAM, // device failed due to bad cmd param.
}WMI_THIN_JOIN_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_THIN_JOIN_EVENT;

#ifdef __cplusplus
}
#endif

#endif /* _WMI_THIN_H_ */
OpenPOWER on IntegriCloud