]>
Commit | Line | Data |
---|---|---|
91980990 GKH |
1 | /* |
2 | ************************************************************************* | |
3 | * Ralink Tech Inc. | |
4 | * 5F., No.36, Taiyuan St., Jhubei City, | |
5 | * Hsinchu County 302, | |
6 | * Taiwan, R.O.C. | |
7 | * | |
8 | * (c) Copyright 2002-2007, Ralink Technology, Inc. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify * | |
11 | * it under the terms of the GNU General Public License as published by * | |
12 | * the Free Software Foundation; either version 2 of the License, or * | |
13 | * (at your option) any later version. * | |
14 | * * | |
15 | * This program is distributed in the hope that it will be useful, * | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
18 | * GNU General Public License for more details. * | |
19 | * * | |
20 | * You should have received a copy of the GNU General Public License * | |
21 | * along with this program; if not, write to the * | |
22 | * Free Software Foundation, Inc., * | |
23 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | |
24 | * * | |
25 | ************************************************************************* | |
26 | ||
27 | Module Name: | |
28 | rtmp_def.h | |
29 | ||
30 | Abstract: | |
31 | Miniport related definition header | |
32 | ||
33 | Revision History: | |
34 | Who When What | |
35 | -------- ---------- ---------------------------------------------- | |
36 | Paul Lin 08-01-2002 created | |
37 | John Chang 08-05-2003 add definition for 11g & other drafts | |
38 | */ | |
39 | #ifndef __RTMP_DEF_H__ | |
40 | #define __RTMP_DEF_H__ | |
41 | ||
42 | #include "oid.h" | |
43 | ||
44 | // | |
45 | // Debug information verbosity: lower values indicate higher urgency | |
46 | // | |
47 | #define RT_DEBUG_OFF 0 | |
48 | #define RT_DEBUG_ERROR 1 | |
49 | #define RT_DEBUG_WARN 2 | |
50 | #define RT_DEBUG_TRACE 3 | |
51 | #define RT_DEBUG_INFO 4 | |
52 | #define RT_DEBUG_LOUD 5 | |
53 | ||
54 | #define NIC_TAG ((ULONG)'0682') | |
55 | #define NIC_DBG_STRING ("**RT28xx**") | |
56 | ||
57 | #ifdef SNMP_SUPPORT | |
58 | // for snmp | |
59 | // to get manufacturer OUI, kathy, 2008_0220 | |
60 | #define ManufacturerOUI_LEN 3 | |
61 | #define ManufacturerNAME ("Ralink Technology Company.") | |
62 | #define ResourceTypeIdName ("Ralink_ID") | |
63 | #endif | |
64 | ||
65 | ||
66 | #define RALINK_2883_VERSION ((UINT32)0x28830300) | |
67 | #define RALINK_2880E_VERSION ((UINT32)0x28720200) | |
68 | #define RALINK_3070_VERSION ((UINT32)0x30700200) | |
69 | ||
70 | // | |
71 | // NDIS version in use by the NIC driver. | |
72 | // The high byte is the major version. The low byte is the minor version. | |
73 | // | |
74 | #ifdef NDIS51_MINIPORT | |
75 | #define NIC_DRIVER_VERSION 0x0501 | |
76 | #else | |
77 | #define NIC_DRIVER_VERSION 0x0500 | |
78 | #endif | |
79 | ||
80 | // | |
81 | // NDIS media type, current is ethernet, change if native wireless supported | |
82 | // | |
83 | #define NIC_MEDIA_TYPE NdisMedium802_3 | |
84 | #define NIC_PCI_HDR_LENGTH 0xe2 | |
85 | #define NIC_MAX_PACKET_SIZE 2304 | |
86 | #define NIC_HEADER_SIZE 14 | |
87 | #define MAX_MAP_REGISTERS_NEEDED 32 | |
88 | #define MIN_MAP_REGISTERS_NEEDED 2 //Todo: should consider fragment issue. | |
89 | ||
90 | // | |
91 | // interface type, we use PCI | |
92 | // | |
93 | #define NIC_INTERFACE_TYPE NdisInterfacePci | |
94 | #define NIC_INTERRUPT_MODE NdisInterruptLevelSensitive | |
95 | ||
96 | // | |
97 | // buffer size passed in NdisMQueryAdapterResources | |
98 | // We should only need three adapter resources (IO, interrupt and memory), | |
99 | // Some devices get extra resources, so have room for 10 resources | |
100 | // UF_SIZE (sizeof(NDIS_RESOURCE_LIST) + (10*sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR))) | |
101 | ||
102 | ||
103 | #define NIC_RESOURCE_B// | |
104 | // IO space length | |
105 | // | |
106 | #define NIC_MAP_IOSPACE_LENGTH sizeof(CSR_STRUC) | |
107 | ||
108 | #define MAX_RX_PKT_LEN 1520 | |
109 | ||
110 | // | |
111 | // Entry number for each DMA descriptor ring | |
112 | // | |
113 | ||
114 | #ifdef RT2860 | |
115 | #define TX_RING_SIZE 64 //64 | |
116 | #define MGMT_RING_SIZE 128 | |
117 | #define RX_RING_SIZE 128 //64 | |
118 | #define MAX_TX_PROCESS TX_RING_SIZE //8 | |
119 | #define MAX_DMA_DONE_PROCESS TX_RING_SIZE | |
120 | #define MAX_TX_DONE_PROCESS TX_RING_SIZE //8 | |
121 | #define LOCAL_TXBUF_SIZE 2 | |
122 | #endif // RT2860 // | |
123 | ||
124 | ||
125 | #ifdef MULTIPLE_CARD_SUPPORT | |
126 | // MC: Multple Cards | |
127 | #define MAX_NUM_OF_MULTIPLE_CARD 32 | |
128 | #endif // MULTIPLE_CARD_SUPPORT // | |
129 | ||
130 | #define MAX_RX_PROCESS 128 //64 //32 | |
131 | #define NUM_OF_LOCAL_TXBUF 2 | |
132 | #define TXD_SIZE 16 | |
133 | #define TXWI_SIZE 16 | |
134 | #define RXD_SIZE 16 | |
135 | #define RXWI_SIZE 16 | |
136 | // TXINFO_SIZE + TXWI_SIZE + 802.11 Header Size + AMSDU sub frame header | |
137 | #define TX_DMA_1ST_BUFFER_SIZE 96 // only the 1st physical buffer is pre-allocated | |
138 | #define MGMT_DMA_BUFFER_SIZE 1536 //2048 | |
139 | #define RX_BUFFER_AGGRESIZE 3840 //3904 //3968 //4096 //2048 //4096 | |
140 | #define RX_BUFFER_NORMSIZE 3840 //3904 //3968 //4096 //2048 //4096 | |
141 | #define TX_BUFFER_NORMSIZE RX_BUFFER_NORMSIZE | |
142 | #define MAX_FRAME_SIZE 2346 // Maximum 802.11 frame size | |
143 | #define MAX_AGGREGATION_SIZE 3840 //3904 //3968 //4096 | |
144 | #define MAX_NUM_OF_TUPLE_CACHE 2 | |
145 | #define MAX_MCAST_LIST_SIZE 32 | |
146 | #define MAX_LEN_OF_VENDOR_DESC 64 | |
147 | //#define MAX_SIZE_OF_MCAST_PSQ (NUM_OF_LOCAL_TXBUF >> 2) // AP won't spend more than 1/4 of total buffers on M/BCAST PSQ | |
148 | #define MAX_SIZE_OF_MCAST_PSQ 32 | |
149 | ||
150 | #define MAX_RX_PROCESS_CNT (RX_RING_SIZE) | |
151 | ||
152 | ||
153 | #define MAX_PACKETS_IN_QUEUE (512) //(512) // to pass WMM A5-WPAPSK | |
154 | #define MAX_PACKETS_IN_MCAST_PS_QUEUE 32 | |
155 | #define MAX_PACKETS_IN_PS_QUEUE 128 //32 | |
156 | #define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */ | |
157 | ||
158 | ||
159 | ||
160 | // RxFilter | |
161 | #define STANORMAL 0x17f97 | |
162 | #define APNORMAL 0x15f97 | |
163 | // | |
164 | // RTMP_ADAPTER flags | |
165 | // | |
166 | #define fRTMP_ADAPTER_MAP_REGISTER 0x00000001 | |
167 | #define fRTMP_ADAPTER_INTERRUPT_IN_USE 0x00000002 | |
168 | #define fRTMP_ADAPTER_HARDWARE_ERROR 0x00000004 | |
169 | #define fRTMP_ADAPTER_SCATTER_GATHER 0x00000008 | |
170 | #define fRTMP_ADAPTER_SEND_PACKET_ERROR 0x00000010 | |
171 | #define fRTMP_ADAPTER_MLME_RESET_IN_PROGRESS 0x00000020 | |
172 | #define fRTMP_ADAPTER_HALT_IN_PROGRESS 0x00000040 | |
173 | #define fRTMP_ADAPTER_RESET_IN_PROGRESS 0x00000080 | |
174 | #define fRTMP_ADAPTER_NIC_NOT_EXIST 0x00000100 | |
175 | #define fRTMP_ADAPTER_TX_RING_ALLOCATED 0x00000200 | |
176 | #define fRTMP_ADAPTER_REMOVE_IN_PROGRESS 0x00000400 | |
177 | #define fRTMP_ADAPTER_MIMORATE_INUSED 0x00000800 | |
178 | #define fRTMP_ADAPTER_RX_RING_ALLOCATED 0x00001000 | |
179 | #define fRTMP_ADAPTER_INTERRUPT_ACTIVE 0x00002000 | |
180 | #define fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS 0x00004000 | |
181 | #define fRTMP_ADAPTER_REASSOC_IN_PROGRESS 0x00008000 | |
182 | #define fRTMP_ADAPTER_MEDIA_STATE_PENDING 0x00010000 | |
183 | #define fRTMP_ADAPTER_RADIO_OFF 0x00020000 | |
184 | #define fRTMP_ADAPTER_BULKOUT_RESET 0x00040000 | |
185 | #define fRTMP_ADAPTER_BULKIN_RESET 0x00080000 | |
186 | #define fRTMP_ADAPTER_RDG_ACTIVE 0x00100000 | |
187 | #define fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE 0x00200000 | |
188 | #define fRTMP_ADAPTER_SCAN_2040 0x04000000 | |
189 | #define fRTMP_ADAPTER_RADIO_MEASUREMENT 0x08000000 | |
190 | ||
191 | #define fRTMP_ADAPTER_START_UP 0x10000000 //Devive already initialized and enabled Tx/Rx. | |
192 | #define fRTMP_ADAPTER_MEDIA_STATE_CHANGE 0x20000000 | |
193 | #define fRTMP_ADAPTER_IDLE_RADIO_OFF 0x40000000 | |
194 | ||
195 | // | |
196 | // STA operation status flags | |
197 | // | |
198 | #define fOP_STATUS_INFRA_ON 0x00000001 | |
199 | #define fOP_STATUS_ADHOC_ON 0x00000002 | |
200 | #define fOP_STATUS_BG_PROTECTION_INUSED 0x00000004 | |
201 | #define fOP_STATUS_SHORT_SLOT_INUSED 0x00000008 | |
202 | #define fOP_STATUS_SHORT_PREAMBLE_INUSED 0x00000010 | |
203 | #define fOP_STATUS_RECEIVE_DTIM 0x00000020 | |
204 | #define fOP_STATUS_MEDIA_STATE_CONNECTED 0x00000080 | |
205 | #define fOP_STATUS_WMM_INUSED 0x00000100 | |
206 | #define fOP_STATUS_AGGREGATION_INUSED 0x00000200 | |
207 | #define fOP_STATUS_DOZE 0x00000400 // debug purpose | |
208 | #define fOP_STATUS_PIGGYBACK_INUSED 0x00000800 // piggy-back, and aggregation | |
209 | #define fOP_STATUS_APSD_INUSED 0x00001000 | |
210 | #define fOP_STATUS_TX_AMSDU_INUSED 0x00002000 | |
211 | #define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000 | |
212 | #define fOP_STATUS_WAKEUP_NOW 0x00008000 | |
213 | #define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000 | |
214 | ||
215 | #ifdef DOT11N_DRAFT3 | |
216 | #define fOP_STATUS_SCAN_2040 0x00040000 | |
217 | #endif // DOT11N_DRAFT3 // | |
218 | ||
219 | #define CCKSETPROTECT 0x1 | |
220 | #define OFDMSETPROTECT 0x2 | |
221 | #define MM20SETPROTECT 0x4 | |
222 | #define MM40SETPROTECT 0x8 | |
223 | #define GF20SETPROTECT 0x10 | |
224 | #define GR40SETPROTECT 0x20 | |
225 | #define ALLN_SETPROTECT (GR40SETPROTECT | GF20SETPROTECT | MM40SETPROTECT | MM20SETPROTECT) | |
226 | ||
227 | // | |
228 | // AP's client table operation status flags | |
229 | // | |
230 | #define fCLIENT_STATUS_WMM_CAPABLE 0x00000001 // CLIENT can parse QOS DATA frame | |
231 | #define fCLIENT_STATUS_AGGREGATION_CAPABLE 0x00000002 // CLIENT can receive Ralink's proprietary TX aggregation frame | |
232 | #define fCLIENT_STATUS_PIGGYBACK_CAPABLE 0x00000004 // CLIENT support piggy-back | |
233 | #define fCLIENT_STATUS_AMSDU_INUSED 0x00000008 | |
234 | #define fCLIENT_STATUS_SGI20_CAPABLE 0x00000010 | |
235 | #define fCLIENT_STATUS_SGI40_CAPABLE 0x00000020 | |
236 | #define fCLIENT_STATUS_TxSTBC_CAPABLE 0x00000040 | |
237 | #define fCLIENT_STATUS_RxSTBC_CAPABLE 0x00000080 | |
238 | #define fCLIENT_STATUS_HTC_CAPABLE 0x00000100 | |
239 | #define fCLIENT_STATUS_RDG_CAPABLE 0x00000200 | |
240 | #define fCLIENT_STATUS_MCSFEEDBACK_CAPABLE 0x00000400 | |
241 | #define fCLIENT_STATUS_APSD_CAPABLE 0x00000800 /* UAPSD STATION */ | |
242 | ||
243 | #ifdef DOT11N_DRAFT3 | |
244 | #define fCLIENT_STATUS_BSSCOEXIST_CAPABLE 0x00001000 | |
245 | #endif // DOT11N_DRAFT3 // | |
246 | ||
247 | #define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000 | |
248 | // | |
249 | // STA configuration flags | |
250 | // | |
251 | ||
252 | // 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case | |
253 | #define HT_NO_PROTECT 0 | |
254 | #define HT_LEGACY_PROTECT 1 | |
255 | #define HT_40_PROTECT 2 | |
256 | #define HT_2040_PROTECT 3 | |
257 | #define HT_RTSCTS_6M 7 | |
258 | //following is our own definition in order to turn on our ASIC protection register in INFRASTRUCTURE. | |
259 | #define HT_ATHEROS 8 // rt2860c has problem with atheros chip. we need to turn on RTS/CTS . | |
260 | #define HT_FORCERTSCTS 9 // Force turn on RTS/CTS first. then go to evaluate if this force RTS is necessary. | |
261 | ||
262 | // | |
263 | // RX Packet Filter control flags. Apply on pAd->PacketFilter | |
264 | // | |
265 | #define fRX_FILTER_ACCEPT_DIRECT NDIS_PACKET_TYPE_DIRECTED | |
266 | #define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST | |
267 | #define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST | |
268 | #define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST | |
269 | ||
270 | // | |
271 | // Error code section | |
272 | // | |
273 | // NDIS_ERROR_CODE_ADAPTER_NOT_FOUND | |
274 | #define ERRLOG_READ_PCI_SLOT_FAILED 0x00000101L | |
275 | #define ERRLOG_WRITE_PCI_SLOT_FAILED 0x00000102L | |
276 | #define ERRLOG_VENDOR_DEVICE_NOMATCH 0x00000103L | |
277 | ||
278 | // NDIS_ERROR_CODE_ADAPTER_DISABLED | |
279 | #define ERRLOG_BUS_MASTER_DISABLED 0x00000201L | |
280 | ||
281 | // NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION | |
282 | #define ERRLOG_INVALID_SPEED_DUPLEX 0x00000301L | |
283 | #define ERRLOG_SET_SECONDARY_FAILED 0x00000302L | |
284 | ||
285 | // NDIS_ERROR_CODE_OUT_OF_RESOURCES | |
286 | #define ERRLOG_OUT_OF_MEMORY 0x00000401L | |
287 | #define ERRLOG_OUT_OF_SHARED_MEMORY 0x00000402L | |
288 | #define ERRLOG_OUT_OF_MAP_REGISTERS 0x00000403L | |
289 | #define ERRLOG_OUT_OF_BUFFER_POOL 0x00000404L | |
290 | #define ERRLOG_OUT_OF_NDIS_BUFFER 0x00000405L | |
291 | #define ERRLOG_OUT_OF_PACKET_POOL 0x00000406L | |
292 | #define ERRLOG_OUT_OF_NDIS_PACKET 0x00000407L | |
293 | #define ERRLOG_OUT_OF_LOOKASIDE_MEMORY 0x00000408L | |
294 | ||
295 | // NDIS_ERROR_CODE_HARDWARE_FAILURE | |
296 | #define ERRLOG_SELFTEST_FAILED 0x00000501L | |
297 | #define ERRLOG_INITIALIZE_ADAPTER 0x00000502L | |
298 | #define ERRLOG_REMOVE_MINIPORT 0x00000503L | |
299 | ||
300 | // NDIS_ERROR_CODE_RESOURCE_CONFLICT | |
301 | #define ERRLOG_MAP_IO_SPACE 0x00000601L | |
302 | #define ERRLOG_QUERY_ADAPTER_RESOURCES 0x00000602L | |
303 | #define ERRLOG_NO_IO_RESOURCE 0x00000603L | |
304 | #define ERRLOG_NO_INTERRUPT_RESOURCE 0x00000604L | |
305 | #define ERRLOG_NO_MEMORY_RESOURCE 0x00000605L | |
306 | ||
307 | ||
308 | // WDS definition | |
309 | #define MAX_WDS_ENTRY 4 | |
310 | #define WDS_PAIRWISE_KEY_OFFSET 60 // WDS links uses pairwise key#60 ~ 63 in ASIC pairwise key table | |
311 | ||
312 | #define WDS_DISABLE_MODE 0 | |
313 | #define WDS_RESTRICT_MODE 1 | |
314 | #define WDS_BRIDGE_MODE 2 | |
315 | #define WDS_REPEATER_MODE 3 | |
316 | #define WDS_LAZY_MODE 4 | |
317 | ||
318 | ||
319 | #define MAX_MESH_NUM 0 | |
320 | ||
321 | #define MAX_APCLI_NUM 0 | |
322 | #ifdef APCLI_SUPPORT | |
323 | #undef MAX_APCLI_NUM | |
324 | #define MAX_APCLI_NUM 1 | |
325 | #endif // APCLI_SUPPORT // | |
326 | ||
327 | #define MAX_MBSSID_NUM 1 | |
328 | #ifdef MBSS_SUPPORT | |
329 | #undef MAX_MBSSID_NUM | |
330 | #define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM) | |
331 | #endif // MBSS_SUPPORT // | |
332 | ||
333 | /* sanity check for apidx */ | |
334 | #define MBSS_MR_APIDX_SANITY_CHECK(apidx) \ | |
335 | { if (apidx > MAX_MBSSID_NUM) { \ | |
d599edca | 336 | printk("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx); \ |
91980990 GKH |
337 | apidx = MAIN_MBSSID; } } |
338 | ||
339 | #define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE ) | |
340 | ||
341 | #define MAIN_MBSSID 0 | |
342 | #define FIRST_MBSSID 1 | |
343 | ||
344 | ||
345 | #define MAX_BEACON_SIZE 512 | |
346 | // If the MAX_MBSSID_NUM is larger than 6, | |
347 | // it shall reserve some WCID space(wcid 222~253) for beacon frames. | |
348 | // - these wcid 238~253 are reserved for beacon#6(ra6). | |
349 | // - these wcid 222~237 are reserved for beacon#7(ra7). | |
350 | #if defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 8) | |
351 | #define HW_RESERVED_WCID 222 | |
352 | #elif defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 7) | |
353 | #define HW_RESERVED_WCID 238 | |
354 | #else | |
355 | #define HW_RESERVED_WCID 255 | |
356 | #endif | |
357 | ||
358 | // Then dedicate wcid of DFS and Carrier-Sense. | |
359 | #define DFS_CTS_WCID (HW_RESERVED_WCID - 1) | |
360 | #define CS_CTS_WCID (HW_RESERVED_WCID - 2) | |
361 | #define LAST_SPECIFIC_WCID (HW_RESERVED_WCID - 2) | |
362 | ||
363 | // If MAX_MBSSID_NUM is 8, the maximum available wcid for the associated STA is 211. | |
364 | // If MAX_MBSSID_NUM is 7, the maximum available wcid for the associated STA is 228. | |
365 | #define MAX_AVAILABLE_CLIENT_WCID (LAST_SPECIFIC_WCID - MAX_MBSSID_NUM - 1) | |
366 | ||
367 | // TX need WCID to find Cipher Key | |
368 | // these wcid 212 ~ 219 are reserved for bc/mc packets if MAX_MBSSID_NUM is 8. | |
369 | #define GET_GroupKey_WCID(__wcid, __bssidx) \ | |
370 | { \ | |
371 | __wcid = LAST_SPECIFIC_WCID - (MAX_MBSSID_NUM) + __bssidx; \ | |
372 | } | |
373 | ||
374 | #define IsGroupKeyWCID(__wcid) (((__wcid) < LAST_SPECIFIC_WCID) && ((__wcid) >= (LAST_SPECIFIC_WCID - (MAX_MBSSID_NUM)))) | |
375 | ||
376 | ||
377 | // definition to support multiple BSSID | |
378 | #define BSS0 0 | |
379 | #define BSS1 1 | |
380 | #define BSS2 2 | |
381 | #define BSS3 3 | |
382 | #define BSS4 4 | |
383 | #define BSS5 5 | |
384 | #define BSS6 6 | |
385 | #define BSS7 7 | |
386 | ||
387 | ||
388 | //============================================================ | |
389 | // Length definitions | |
390 | #define PEER_KEY_NO 2 | |
391 | #define MAC_ADDR_LEN 6 | |
392 | #define TIMESTAMP_LEN 8 | |
393 | #define MAX_LEN_OF_SUPPORTED_RATES MAX_LENGTH_OF_SUPPORT_RATES // 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 | |
394 | #define MAX_LEN_OF_KEY 32 // 32 octets == 256 bits, Redefine for WPA | |
395 | #define MAX_NUM_OF_CHANNELS MAX_NUM_OF_CHS // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL termination | |
396 | #define MAX_NUM_OF_11JCHANNELS 20 // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL termination | |
397 | #define MAX_LEN_OF_SSID 32 | |
398 | #define CIPHER_TEXT_LEN 128 | |
399 | #define HASH_TABLE_SIZE 256 | |
400 | #define MAX_VIE_LEN 1024 // New for WPA cipher suite variable IE sizes. | |
401 | #define MAX_SUPPORT_MCS 32 | |
402 | ||
403 | //============================================================ | |
404 | // ASIC WCID Table definition. | |
405 | //============================================================ | |
406 | #define BSSID_WCID 1 // in infra mode, always put bssid with this WCID | |
407 | #define MCAST_WCID 0x0 | |
408 | #define BSS0Mcast_WCID 0x0 | |
409 | #define BSS1Mcast_WCID 0xf8 | |
410 | #define BSS2Mcast_WCID 0xf9 | |
411 | #define BSS3Mcast_WCID 0xfa | |
412 | #define BSS4Mcast_WCID 0xfb | |
413 | #define BSS5Mcast_WCID 0xfc | |
414 | #define BSS6Mcast_WCID 0xfd | |
415 | #define BSS7Mcast_WCID 0xfe | |
416 | #define RESERVED_WCID 0xff | |
417 | ||
418 | #define MAX_NUM_OF_ACL_LIST MAX_NUMBER_OF_ACL | |
419 | ||
420 | #define MAX_LEN_OF_MAC_TABLE MAX_NUMBER_OF_MAC // if MAX_MBSSID_NUM is 8, this value can't be larger than 211 | |
421 | ||
422 | #if MAX_LEN_OF_MAC_TABLE>MAX_AVAILABLE_CLIENT_WCID | |
423 | #error MAX_LEN_OF_MAC_TABLE can not be larger than MAX_AVAILABLE_CLIENT_WCID!!!! | |
424 | #endif | |
425 | ||
426 | #define MAX_NUM_OF_WDS_LINK_PERBSSID 3 | |
427 | #define MAX_NUM_OF_WDS_LINK (MAX_NUM_OF_WDS_LINK_PERBSSID*MAX_MBSSID_NUM) | |
428 | #define MAX_NUM_OF_EVENT MAX_NUMBER_OF_EVENT | |
429 | #define WDS_LINK_START_WCID (MAX_LEN_OF_MAC_TABLE-1) | |
430 | ||
431 | #define NUM_OF_TID 8 | |
432 | #define MAX_AID_BA 4 | |
433 | #define MAX_LEN_OF_BA_REC_TABLE ((NUM_OF_TID * MAX_LEN_OF_MAC_TABLE)/2)// (NUM_OF_TID*MAX_AID_BA + 32) //Block ACK recipient | |
434 | #define MAX_LEN_OF_BA_ORI_TABLE ((NUM_OF_TID * MAX_LEN_OF_MAC_TABLE)/2)// (NUM_OF_TID*MAX_AID_BA + 32) // Block ACK originator | |
435 | #define MAX_LEN_OF_BSS_TABLE 64 | |
436 | #define MAX_REORDERING_MPDU_NUM 512 | |
437 | ||
438 | // key related definitions | |
439 | #define SHARE_KEY_NUM 4 | |
440 | #define MAX_LEN_OF_SHARE_KEY 16 // byte count | |
441 | #define MAX_LEN_OF_PEER_KEY 16 // byte count | |
442 | #define PAIRWISE_KEY_NUM 64 // in MAC ASIC pairwise key table | |
443 | #define GROUP_KEY_NUM 4 | |
444 | #define PMK_LEN 32 | |
445 | #define WDS_PAIRWISE_KEY_OFFSET 60 // WDS links uses pairwise key#60 ~ 63 in ASIC pairwise key table | |
446 | #define PMKID_NO 4 // Number of PMKID saved supported | |
447 | #define MAX_LEN_OF_MLME_BUFFER 2048 | |
448 | ||
449 | // power status related definitions | |
450 | #define PWR_ACTIVE 0 | |
451 | #define PWR_SAVE 1 | |
452 | #define PWR_MMPS 2 //MIMO power save | |
453 | ||
454 | // Auth and Assoc mode related definitions | |
455 | #define AUTH_MODE_OPEN 0x00 | |
456 | #define AUTH_MODE_KEY 0x01 | |
457 | ||
458 | // BSS Type definitions | |
459 | #define BSS_ADHOC 0 // = Ndis802_11IBSS | |
460 | #define BSS_INFRA 1 // = Ndis802_11Infrastructure | |
461 | #define BSS_ANY 2 // = Ndis802_11AutoUnknown | |
462 | #define BSS_MONITOR 3 // = Ndis802_11Monitor | |
463 | ||
464 | ||
465 | // Reason code definitions | |
466 | #define REASON_RESERVED 0 | |
467 | #define REASON_UNSPECIFY 1 | |
468 | #define REASON_NO_LONGER_VALID 2 | |
469 | #define REASON_DEAUTH_STA_LEAVING 3 | |
470 | #define REASON_DISASSOC_INACTIVE 4 | |
471 | #define REASON_DISASSPC_AP_UNABLE 5 | |
472 | #define REASON_CLS2ERR 6 | |
473 | #define REASON_CLS3ERR 7 | |
474 | #define REASON_DISASSOC_STA_LEAVING 8 | |
475 | #define REASON_STA_REQ_ASSOC_NOT_AUTH 9 | |
476 | #define REASON_INVALID_IE 13 | |
477 | #define REASON_MIC_FAILURE 14 | |
478 | #define REASON_4_WAY_TIMEOUT 15 | |
479 | #define REASON_GROUP_KEY_HS_TIMEOUT 16 | |
480 | #define REASON_IE_DIFFERENT 17 | |
481 | #define REASON_MCIPHER_NOT_VALID 18 | |
482 | #define REASON_UCIPHER_NOT_VALID 19 | |
483 | #define REASON_AKMP_NOT_VALID 20 | |
484 | #define REASON_UNSUPPORT_RSNE_VER 21 | |
485 | #define REASON_INVALID_RSNE_CAP 22 | |
486 | #define REASON_8021X_AUTH_FAIL 23 | |
487 | #define REASON_CIPHER_SUITE_REJECTED 24 | |
488 | #define REASON_DECLINED 37 | |
489 | ||
490 | #define REASON_QOS_UNSPECIFY 32 | |
491 | #define REASON_QOS_LACK_BANDWIDTH 33 | |
492 | #define REASON_POOR_CHANNEL_CONDITION 34 | |
493 | #define REASON_QOS_OUTSIDE_TXOP_LIMITION 35 | |
494 | #define REASON_QOS_QSTA_LEAVING_QBSS 36 | |
495 | #define REASON_QOS_UNWANTED_MECHANISM 37 | |
496 | #define REASON_QOS_MECH_SETUP_REQUIRED 38 | |
497 | #define REASON_QOS_REQUEST_TIMEOUT 39 | |
498 | #define REASON_QOS_CIPHER_NOT_SUPPORT 45 | |
499 | ||
500 | // Status code definitions | |
501 | #define MLME_SUCCESS 0 | |
502 | #define MLME_UNSPECIFY_FAIL 1 | |
503 | #define MLME_CANNOT_SUPPORT_CAP 10 | |
504 | #define MLME_REASSOC_DENY_ASSOC_EXIST 11 | |
505 | #define MLME_ASSOC_DENY_OUT_SCOPE 12 | |
506 | #define MLME_ALG_NOT_SUPPORT 13 | |
507 | #define MLME_SEQ_NR_OUT_OF_SEQUENCE 14 | |
508 | #define MLME_REJ_CHALLENGE_FAILURE 15 | |
509 | #define MLME_REJ_TIMEOUT 16 | |
510 | #define MLME_ASSOC_REJ_UNABLE_HANDLE_STA 17 | |
511 | #define MLME_ASSOC_REJ_DATA_RATE 18 | |
512 | ||
513 | #define MLME_ASSOC_REJ_NO_EXT_RATE 22 | |
514 | #define MLME_ASSOC_REJ_NO_EXT_RATE_PBCC 23 | |
515 | #define MLME_ASSOC_REJ_NO_CCK_OFDM 24 | |
516 | ||
517 | #define MLME_QOS_UNSPECIFY 32 | |
518 | #define MLME_REQUEST_DECLINED 37 | |
519 | #define MLME_REQUEST_WITH_INVALID_PARAM 38 | |
520 | #define MLME_DLS_NOT_ALLOW_IN_QBSS 48 | |
521 | #define MLME_DEST_STA_NOT_IN_QBSS 49 | |
522 | #define MLME_DEST_STA_IS_NOT_A_QSTA 50 | |
523 | ||
524 | #define MLME_INVALID_FORMAT 0x51 | |
525 | #define MLME_FAIL_NO_RESOURCE 0x52 | |
526 | #define MLME_STATE_MACHINE_REJECT 0x53 | |
527 | #define MLME_MAC_TABLE_FAIL 0x54 | |
528 | ||
529 | // IE code | |
530 | #define IE_SSID 0 | |
531 | #define IE_SUPP_RATES 1 | |
532 | #define IE_FH_PARM 2 | |
533 | #define IE_DS_PARM 3 | |
534 | #define IE_CF_PARM 4 | |
535 | #define IE_TIM 5 | |
536 | #define IE_IBSS_PARM 6 | |
537 | #define IE_COUNTRY 7 // 802.11d | |
538 | #define IE_802_11D_REQUEST 10 // 802.11d | |
539 | #define IE_QBSS_LOAD 11 // 802.11e d9 | |
540 | #define IE_EDCA_PARAMETER 12 // 802.11e d9 | |
541 | #define IE_TSPEC 13 // 802.11e d9 | |
542 | #define IE_TCLAS 14 // 802.11e d9 | |
543 | #define IE_SCHEDULE 15 // 802.11e d9 | |
544 | #define IE_CHALLENGE_TEXT 16 | |
545 | #define IE_POWER_CONSTRAINT 32 // 802.11h d3.3 | |
546 | #define IE_POWER_CAPABILITY 33 // 802.11h d3.3 | |
547 | #define IE_TPC_REQUEST 34 // 802.11h d3.3 | |
548 | #define IE_TPC_REPORT 35 // 802.11h d3.3 | |
549 | #define IE_SUPP_CHANNELS 36 // 802.11h d3.3 | |
550 | #define IE_CHANNEL_SWITCH_ANNOUNCEMENT 37 // 802.11h d3.3 | |
551 | #define IE_MEASUREMENT_REQUEST 38 // 802.11h d3.3 | |
552 | #define IE_MEASUREMENT_REPORT 39 // 802.11h d3.3 | |
553 | #define IE_QUIET 40 // 802.11h d3.3 | |
554 | #define IE_IBSS_DFS 41 // 802.11h d3.3 | |
555 | #define IE_ERP 42 // 802.11g | |
556 | #define IE_TS_DELAY 43 // 802.11e d9 | |
557 | #define IE_TCLAS_PROCESSING 44 // 802.11e d9 | |
558 | #define IE_QOS_CAPABILITY 46 // 802.11e d6 | |
559 | #define IE_HT_CAP 45 // 802.11n d1. HT CAPABILITY. ELEMENT ID TBD | |
560 | #define IE_AP_CHANNEL_REPORT 51 // 802.11k d6 | |
561 | #define IE_HT_CAP2 52 // 802.11n d1. HT CAPABILITY. ELEMENT ID TBD | |
562 | #define IE_RSN 48 // 802.11i d3.0 | |
563 | #define IE_WPA2 48 // WPA2 | |
564 | #define IE_EXT_SUPP_RATES 50 // 802.11g | |
565 | #define IE_SUPP_REG_CLASS 59 // 802.11y. Supported regulatory classes. | |
566 | #define IE_EXT_CHANNEL_SWITCH_ANNOUNCEMENT 60 // 802.11n | |
567 | #define IE_ADD_HT 61 // 802.11n d1. ADDITIONAL HT CAPABILITY. ELEMENT ID TBD | |
568 | #define IE_ADD_HT2 53 // 802.11n d1. ADDITIONAL HT CAPABILITY. ELEMENT ID TBD | |
569 | ||
570 | ||
571 | // For 802.11n D3.03 | |
572 | //#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset elemet | |
573 | #define IE_SECONDARY_CH_OFFSET 62 // 802.11n D3.03 Secondary Channel Offset element | |
574 | #define IE_2040_BSS_COEXIST 72 // 802.11n D3.0.3 | |
575 | #define IE_2040_BSS_INTOLERANT_REPORT 73 // 802.11n D3.03 | |
576 | #define IE_OVERLAPBSS_SCAN_PARM 74 // 802.11n D3.03 | |
577 | #define IE_EXT_CAPABILITY 127 // 802.11n D3.03 | |
578 | ||
579 | ||
580 | #define IE_WPA 221 // WPA | |
581 | #define IE_VENDOR_SPECIFIC 221 // Wifi WMM (WME) | |
582 | ||
583 | #define OUI_BROADCOM_HT 51 // | |
584 | #define OUI_BROADCOM_HTADD 52 // | |
585 | #define OUI_PREN_HT_CAP 51 // | |
586 | #define OUI_PREN_ADD_HT 52 // | |
587 | ||
588 | // CCX information | |
589 | #define IE_AIRONET_CKIP 133 // CCX1.0 ID 85H for CKIP | |
590 | #define IE_AP_TX_POWER 150 // CCX 2.0 for AP transmit power | |
591 | #define IE_MEASUREMENT_CAPABILITY 221 // CCX 2.0 | |
592 | #define IE_CCX_V2 221 | |
593 | #define IE_AIRONET_IPADDRESS 149 // CCX ID 95H for IP Address | |
594 | #define IE_AIRONET_CCKMREASSOC 156 // CCX ID 9CH for CCKM Reassociation Request element | |
595 | #define CKIP_NEGOTIATION_LENGTH 30 | |
596 | #define AIRONET_IPADDRESS_LENGTH 10 | |
597 | #define AIRONET_CCKMREASSOC_LENGTH 24 | |
598 | ||
599 | // ======================================================== | |
600 | // MLME state machine definition | |
601 | // ======================================================== | |
602 | ||
603 | // STA MLME state mahcines | |
604 | #define ASSOC_STATE_MACHINE 1 | |
605 | #define AUTH_STATE_MACHINE 2 | |
606 | #define AUTH_RSP_STATE_MACHINE 3 | |
607 | #define SYNC_STATE_MACHINE 4 | |
608 | #define MLME_CNTL_STATE_MACHINE 5 | |
609 | #define WPA_PSK_STATE_MACHINE 6 | |
610 | #define LEAP_STATE_MACHINE 7 | |
611 | #define AIRONET_STATE_MACHINE 8 | |
612 | #define ACTION_STATE_MACHINE 9 | |
613 | ||
614 | // AP MLME state machines | |
615 | #define AP_ASSOC_STATE_MACHINE 11 | |
616 | #define AP_AUTH_STATE_MACHINE 12 | |
617 | #define AP_AUTH_RSP_STATE_MACHINE 13 | |
618 | #define AP_SYNC_STATE_MACHINE 14 | |
619 | #define AP_CNTL_STATE_MACHINE 15 | |
620 | #define AP_WPA_STATE_MACHINE 16 | |
621 | ||
622 | #ifdef QOS_DLS_SUPPORT | |
623 | #define DLS_STATE_MACHINE 26 | |
624 | #endif // QOS_DLS_SUPPORT // | |
625 | ||
626 | // | |
627 | // STA's CONTROL/CONNECT state machine: states, events, total function # | |
628 | // | |
629 | #define CNTL_IDLE 0 | |
630 | #define CNTL_WAIT_DISASSOC 1 | |
631 | #define CNTL_WAIT_JOIN 2 | |
632 | #define CNTL_WAIT_REASSOC 3 | |
633 | #define CNTL_WAIT_START 4 | |
634 | #define CNTL_WAIT_AUTH 5 | |
635 | #define CNTL_WAIT_ASSOC 6 | |
636 | #define CNTL_WAIT_AUTH2 7 | |
637 | #define CNTL_WAIT_OID_LIST_SCAN 8 | |
638 | #define CNTL_WAIT_OID_DISASSOC 9 | |
639 | ||
640 | #define MT2_ASSOC_CONF 34 | |
641 | #define MT2_AUTH_CONF 35 | |
642 | #define MT2_DEAUTH_CONF 36 | |
643 | #define MT2_DISASSOC_CONF 37 | |
644 | #define MT2_REASSOC_CONF 38 | |
645 | #define MT2_PWR_MGMT_CONF 39 | |
646 | #define MT2_JOIN_CONF 40 | |
647 | #define MT2_SCAN_CONF 41 | |
648 | #define MT2_START_CONF 42 | |
649 | #define MT2_GET_CONF 43 | |
650 | #define MT2_SET_CONF 44 | |
651 | #define MT2_RESET_CONF 45 | |
652 | #define MT2_MLME_ROAMING_REQ 52 | |
653 | ||
654 | #define CNTL_FUNC_SIZE 1 | |
655 | ||
656 | // | |
657 | // STA's ASSOC state machine: states, events, total function # | |
658 | // | |
659 | #define ASSOC_IDLE 0 | |
660 | #define ASSOC_WAIT_RSP 1 | |
661 | #define REASSOC_WAIT_RSP 2 | |
662 | #define DISASSOC_WAIT_RSP 3 | |
663 | #define MAX_ASSOC_STATE 4 | |
664 | ||
665 | #define ASSOC_MACHINE_BASE 0 | |
666 | #define MT2_MLME_ASSOC_REQ 0 | |
667 | #define MT2_MLME_REASSOC_REQ 1 | |
668 | #define MT2_MLME_DISASSOC_REQ 2 | |
669 | #define MT2_PEER_DISASSOC_REQ 3 | |
670 | #define MT2_PEER_ASSOC_REQ 4 | |
671 | #define MT2_PEER_ASSOC_RSP 5 | |
672 | #define MT2_PEER_REASSOC_REQ 6 | |
673 | #define MT2_PEER_REASSOC_RSP 7 | |
674 | #define MT2_DISASSOC_TIMEOUT 8 | |
675 | #define MT2_ASSOC_TIMEOUT 9 | |
676 | #define MT2_REASSOC_TIMEOUT 10 | |
677 | #define MAX_ASSOC_MSG 11 | |
678 | ||
679 | #define ASSOC_FUNC_SIZE (MAX_ASSOC_STATE * MAX_ASSOC_MSG) | |
680 | ||
681 | // | |
682 | // ACT state machine: states, events, total function # | |
683 | // | |
684 | #define ACT_IDLE 0 | |
685 | #define MAX_ACT_STATE 1 | |
686 | ||
687 | #define ACT_MACHINE_BASE 0 | |
688 | ||
689 | //Those PEER_xx_CATE number is based on real Categary value in IEEE spec. Please don'es modify it by your self. | |
690 | //Category | |
691 | #define MT2_PEER_SPECTRUM_CATE 0 | |
692 | #define MT2_PEER_QOS_CATE 1 | |
693 | #define MT2_PEER_DLS_CATE 2 | |
694 | #define MT2_PEER_BA_CATE 3 | |
695 | #define MT2_PEER_PUBLIC_CATE 4 | |
696 | #define MT2_PEER_RM_CATE 5 | |
697 | #define MT2_PEER_HT_CATE 7 // 7.4.7 | |
698 | #define MAX_PEER_CATE_MSG 7 | |
699 | #define MT2_MLME_ADD_BA_CATE 8 | |
700 | #define MT2_MLME_ORI_DELBA_CATE 9 | |
701 | #define MT2_MLME_REC_DELBA_CATE 10 | |
702 | #define MT2_MLME_QOS_CATE 11 | |
703 | #define MT2_MLME_DLS_CATE 12 | |
704 | #define MT2_ACT_INVALID 13 | |
705 | #define MAX_ACT_MSG 14 | |
706 | ||
707 | //Category field | |
708 | #define CATEGORY_SPECTRUM 0 | |
709 | #define CATEGORY_QOS 1 | |
710 | #define CATEGORY_DLS 2 | |
711 | #define CATEGORY_BA 3 | |
712 | #define CATEGORY_PUBLIC 4 | |
713 | #define CATEGORY_RM 5 | |
714 | #define CATEGORY_HT 7 | |
715 | ||
716 | ||
717 | // DLS Action frame definition | |
718 | #define ACTION_DLS_REQUEST 0 | |
719 | #define ACTION_DLS_RESPONSE 1 | |
720 | #define ACTION_DLS_TEARDOWN 2 | |
721 | ||
722 | //Spectrum Action field value 802.11h 7.4.1 | |
723 | #define SPEC_MRQ 0 // Request | |
724 | #define SPEC_MRP 1 //Report | |
725 | #define SPEC_TPCRQ 2 | |
726 | #define SPEC_TPCRP 3 | |
727 | #define SPEC_CHANNEL_SWITCH 4 | |
728 | ||
729 | ||
730 | //BA Action field value | |
731 | #define ADDBA_REQ 0 | |
732 | #define ADDBA_RESP 1 | |
733 | #define DELBA 2 | |
734 | ||
735 | //Public's Action field value in Public Category. Some in 802.11y and some in 11n | |
736 | #define ACTION_BSS_2040_COEXIST 0 // 11n | |
737 | #define ACTION_DSE_ENABLEMENT 1 // 11y D9.0 | |
738 | #define ACTION_DSE_DEENABLEMENT 2 // 11y D9.0 | |
739 | #define ACTION_DSE_REG_LOCATION_ANNOUNCE 3 // 11y D9.0 | |
740 | #define ACTION_EXT_CH_SWITCH_ANNOUNCE 4 // 11y D9.0 | |
741 | #define ACTION_DSE_MEASUREMENT_REQ 5 // 11y D9.0 | |
742 | #define ACTION_DSE_MEASUREMENT_REPORT 6 // 11y D9.0 | |
743 | #define ACTION_MEASUREMENT_PILOT_ACTION 7 // 11y D9.0 | |
744 | #define ACTION_DSE_POWER_CONSTRAINT 8 // 11y D9.0 | |
745 | ||
746 | ||
747 | //HT Action field value | |
748 | #define NOTIFY_BW_ACTION 0 | |
749 | #define SMPS_ACTION 1 | |
750 | #define PSMP_ACTION 2 | |
751 | #define SETPCO_ACTION 3 | |
752 | #define MIMO_CHA_MEASURE_ACTION 4 | |
753 | #define MIMO_N_BEACONFORM 5 | |
754 | #define MIMO_BEACONFORM 6 | |
755 | #define ANTENNA_SELECT 7 | |
756 | #define HT_INFO_EXCHANGE 8 | |
757 | ||
758 | #define ACT_FUNC_SIZE (MAX_ACT_STATE * MAX_ACT_MSG) | |
759 | // | |
760 | // STA's AUTHENTICATION state machine: states, evvents, total function # | |
761 | // | |
762 | #define AUTH_REQ_IDLE 0 | |
763 | #define AUTH_WAIT_SEQ2 1 | |
764 | #define AUTH_WAIT_SEQ4 2 | |
765 | #define MAX_AUTH_STATE 3 | |
766 | ||
767 | #define AUTH_MACHINE_BASE 0 | |
768 | #define MT2_MLME_AUTH_REQ 0 | |
769 | #define MT2_PEER_AUTH_EVEN 1 | |
770 | #define MT2_AUTH_TIMEOUT 2 | |
771 | #define MAX_AUTH_MSG 3 | |
772 | ||
773 | #define AUTH_FUNC_SIZE (MAX_AUTH_STATE * MAX_AUTH_MSG) | |
774 | ||
775 | // | |
776 | // STA's AUTH_RSP state machine: states, events, total function # | |
777 | // | |
778 | #define AUTH_RSP_IDLE 0 | |
779 | #define AUTH_RSP_WAIT_CHAL 1 | |
780 | #define MAX_AUTH_RSP_STATE 2 | |
781 | ||
782 | #define AUTH_RSP_MACHINE_BASE 0 | |
783 | #define MT2_AUTH_CHALLENGE_TIMEOUT 0 | |
784 | #define MT2_PEER_AUTH_ODD 1 | |
785 | #define MT2_PEER_DEAUTH 2 | |
786 | #define MAX_AUTH_RSP_MSG 3 | |
787 | ||
788 | #define AUTH_RSP_FUNC_SIZE (MAX_AUTH_RSP_STATE * MAX_AUTH_RSP_MSG) | |
789 | ||
790 | // | |
791 | // STA's SYNC state machine: states, events, total function # | |
792 | // | |
793 | #define SYNC_IDLE 0 // merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state | |
794 | #define JOIN_WAIT_BEACON 1 | |
795 | #define SCAN_LISTEN 2 | |
796 | #define MAX_SYNC_STATE 3 | |
797 | ||
798 | #define SYNC_MACHINE_BASE 0 | |
799 | #define MT2_MLME_SCAN_REQ 0 | |
800 | #define MT2_MLME_JOIN_REQ 1 | |
801 | #define MT2_MLME_START_REQ 2 | |
802 | #define MT2_PEER_BEACON 3 | |
803 | #define MT2_PEER_PROBE_RSP 4 | |
804 | #define MT2_PEER_ATIM 5 | |
805 | #define MT2_SCAN_TIMEOUT 6 | |
806 | #define MT2_BEACON_TIMEOUT 7 | |
807 | #define MT2_ATIM_TIMEOUT 8 | |
808 | #define MT2_PEER_PROBE_REQ 9 | |
809 | #define MAX_SYNC_MSG 10 | |
810 | ||
811 | #define SYNC_FUNC_SIZE (MAX_SYNC_STATE * MAX_SYNC_MSG) | |
812 | ||
813 | //Messages for the DLS state machine | |
814 | #define DLS_IDLE 0 | |
815 | #define MAX_DLS_STATE 1 | |
816 | ||
817 | #define DLS_MACHINE_BASE 0 | |
818 | #define MT2_MLME_DLS_REQ 0 | |
819 | #define MT2_PEER_DLS_REQ 1 | |
820 | #define MT2_PEER_DLS_RSP 2 | |
821 | #define MT2_MLME_DLS_TEAR_DOWN 3 | |
822 | #define MT2_PEER_DLS_TEAR_DOWN 4 | |
823 | #define MAX_DLS_MSG 5 | |
824 | ||
825 | #define DLS_FUNC_SIZE (MAX_DLS_STATE * MAX_DLS_MSG) | |
826 | ||
827 | // | |
828 | // STA's WPA-PSK State machine: states, events, total function # | |
829 | // | |
830 | #define WPA_PSK_IDLE 0 | |
831 | #define MAX_WPA_PSK_STATE 1 | |
832 | ||
833 | #define WPA_MACHINE_BASE 0 | |
834 | #define MT2_EAPPacket 0 | |
835 | #define MT2_EAPOLStart 1 | |
836 | #define MT2_EAPOLLogoff 2 | |
837 | #define MT2_EAPOLKey 3 | |
838 | #define MT2_EAPOLASFAlert 4 | |
839 | #define MAX_WPA_PSK_MSG 5 | |
840 | ||
841 | #define WPA_PSK_FUNC_SIZE (MAX_WPA_PSK_STATE * MAX_WPA_PSK_MSG) | |
842 | ||
843 | // | |
844 | // STA's CISCO-AIRONET State machine: states, events, total function # | |
845 | // | |
846 | #define AIRONET_IDLE 0 | |
847 | #define AIRONET_SCANNING 1 | |
848 | #define MAX_AIRONET_STATE 2 | |
849 | ||
850 | #define AIRONET_MACHINE_BASE 0 | |
851 | #define MT2_AIRONET_MSG 0 | |
852 | #define MT2_AIRONET_SCAN_REQ 1 | |
853 | #define MT2_AIRONET_SCAN_DONE 2 | |
854 | #define MAX_AIRONET_MSG 3 | |
855 | ||
856 | #define AIRONET_FUNC_SIZE (MAX_AIRONET_STATE * MAX_AIRONET_MSG) | |
857 | ||
858 | // | |
859 | // AP's CONTROL/CONNECT state machine: states, events, total function # | |
860 | // | |
861 | #define AP_CNTL_FUNC_SIZE 1 | |
862 | ||
863 | // | |
864 | // AP's ASSOC state machine: states, events, total function # | |
865 | // | |
866 | #define AP_ASSOC_IDLE 0 | |
867 | #define AP_MAX_ASSOC_STATE 1 | |
868 | ||
869 | #define AP_ASSOC_MACHINE_BASE 0 | |
870 | #define APMT2_MLME_DISASSOC_REQ 0 | |
871 | #define APMT2_PEER_DISASSOC_REQ 1 | |
872 | #define APMT2_PEER_ASSOC_REQ 2 | |
873 | #define APMT2_PEER_REASSOC_REQ 3 | |
874 | #define APMT2_CLS3ERR 4 | |
875 | #define AP_MAX_ASSOC_MSG 5 | |
876 | ||
877 | #define AP_ASSOC_FUNC_SIZE (AP_MAX_ASSOC_STATE * AP_MAX_ASSOC_MSG) | |
878 | ||
879 | // | |
880 | // AP's AUTHENTICATION state machine: states, events, total function # | |
881 | // | |
882 | #define AP_AUTH_REQ_IDLE 0 | |
883 | #define AP_MAX_AUTH_STATE 1 | |
884 | ||
885 | #define AP_AUTH_MACHINE_BASE 0 | |
886 | #define APMT2_MLME_DEAUTH_REQ 0 | |
887 | #define APMT2_CLS2ERR 1 | |
888 | #define AP_MAX_AUTH_MSG 2 | |
889 | ||
890 | #define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG) | |
891 | ||
892 | // | |
893 | // AP's AUTH-RSP state machine: states, events, total function # | |
894 | // | |
895 | #define AP_AUTH_RSP_IDLE 0 | |
896 | #define AP_MAX_AUTH_RSP_STATE 1 | |
897 | ||
898 | #define AP_AUTH_RSP_MACHINE_BASE 0 | |
899 | #define APMT2_AUTH_CHALLENGE_TIMEOUT 0 | |
900 | #define APMT2_PEER_AUTH_ODD 1 | |
901 | #define APMT2_PEER_DEAUTH 2 | |
902 | #define AP_MAX_AUTH_RSP_MSG 3 | |
903 | ||
904 | #define AP_AUTH_RSP_FUNC_SIZE (AP_MAX_AUTH_RSP_STATE * AP_MAX_AUTH_RSP_MSG) | |
905 | ||
906 | // | |
907 | // AP's SYNC state machine: states, events, total function # | |
908 | // | |
909 | #define AP_SYNC_IDLE 0 | |
910 | #define AP_SCAN_LISTEN 1 | |
911 | #define AP_MAX_SYNC_STATE 2 | |
912 | ||
913 | #define AP_SYNC_MACHINE_BASE 0 | |
914 | #define APMT2_PEER_PROBE_REQ 0 | |
915 | #define APMT2_PEER_BEACON 1 | |
916 | #define APMT2_MLME_SCAN_REQ 2 | |
917 | #define APMT2_PEER_PROBE_RSP 3 | |
918 | #define APMT2_SCAN_TIMEOUT 4 | |
919 | #define APMT2_MLME_SCAN_CNCL 5 | |
920 | #define AP_MAX_SYNC_MSG 6 | |
921 | ||
922 | #define AP_SYNC_FUNC_SIZE (AP_MAX_SYNC_STATE * AP_MAX_SYNC_MSG) | |
923 | ||
924 | // | |
925 | // AP's WPA state machine: states, events, total function # | |
926 | // | |
927 | #define AP_WPA_PTK 0 | |
928 | #define AP_MAX_WPA_PTK_STATE 1 | |
929 | ||
930 | #define AP_WPA_MACHINE_BASE 0 | |
931 | #define APMT2_EAPPacket 0 | |
932 | #define APMT2_EAPOLStart 1 | |
933 | #define APMT2_EAPOLLogoff 2 | |
934 | #define APMT2_EAPOLKey 3 | |
935 | #define APMT2_EAPOLASFAlert 4 | |
936 | #define AP_MAX_WPA_MSG 5 | |
937 | ||
938 | #define AP_WPA_FUNC_SIZE (AP_MAX_WPA_PTK_STATE * AP_MAX_WPA_MSG) | |
939 | ||
940 | #ifdef APCLI_SUPPORT | |
941 | //ApCli authentication state machine | |
942 | #define APCLI_AUTH_REQ_IDLE 0 | |
943 | #define APCLI_AUTH_WAIT_SEQ2 1 | |
944 | #define APCLI_AUTH_WAIT_SEQ4 2 | |
945 | #define APCLI_MAX_AUTH_STATE 3 | |
946 | ||
947 | #define APCLI_AUTH_MACHINE_BASE 0 | |
948 | #define APCLI_MT2_MLME_AUTH_REQ 0 | |
949 | #define APCLI_MT2_MLME_DEAUTH_REQ 1 | |
950 | #define APCLI_MT2_PEER_AUTH_EVEN 2 | |
951 | #define APCLI_MT2_PEER_DEAUTH 3 | |
952 | #define APCLI_MT2_AUTH_TIMEOUT 4 | |
953 | #define APCLI_MAX_AUTH_MSG 5 | |
954 | ||
955 | #define APCLI_AUTH_FUNC_SIZE (APCLI_MAX_AUTH_STATE * APCLI_MAX_AUTH_MSG) | |
956 | ||
957 | //ApCli association state machine | |
958 | #define APCLI_ASSOC_IDLE 0 | |
959 | #define APCLI_ASSOC_WAIT_RSP 1 | |
960 | #define APCLI_MAX_ASSOC_STATE 2 | |
961 | ||
962 | #define APCLI_ASSOC_MACHINE_BASE 0 | |
963 | #define APCLI_MT2_MLME_ASSOC_REQ 0 | |
964 | #define APCLI_MT2_MLME_DISASSOC_REQ 1 | |
965 | #define APCLI_MT2_PEER_DISASSOC_REQ 2 | |
966 | #define APCLI_MT2_PEER_ASSOC_RSP 3 | |
967 | #define APCLI_MT2_ASSOC_TIMEOUT 4 | |
968 | #define APCLI_MAX_ASSOC_MSG 5 | |
969 | ||
970 | #define APCLI_ASSOC_FUNC_SIZE (APCLI_MAX_ASSOC_STATE * APCLI_MAX_ASSOC_MSG) | |
971 | ||
972 | //ApCli sync state machine | |
973 | #define APCLI_SYNC_IDLE 0 // merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state | |
974 | #define APCLI_JOIN_WAIT_PROBE_RSP 1 | |
975 | #define APCLI_MAX_SYNC_STATE 2 | |
976 | ||
977 | #define APCLI_SYNC_MACHINE_BASE 0 | |
978 | #define APCLI_MT2_MLME_PROBE_REQ 0 | |
979 | #define APCLI_MT2_PEER_PROBE_RSP 1 | |
980 | #define APCLI_MT2_PROBE_TIMEOUT 2 | |
981 | #define APCLI_MAX_SYNC_MSG 3 | |
982 | ||
983 | #define APCLI_SYNC_FUNC_SIZE (APCLI_MAX_SYNC_STATE * APCLI_MAX_SYNC_MSG) | |
984 | ||
985 | //ApCli ctrl state machine | |
986 | #define APCLI_CTRL_DISCONNECTED 0 // merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state | |
987 | #define APCLI_CTRL_PROBE 1 | |
988 | #define APCLI_CTRL_AUTH 2 | |
989 | #define APCLI_CTRL_AUTH_2 3 | |
990 | #define APCLI_CTRL_ASSOC 4 | |
991 | #define APCLI_CTRL_DEASSOC 5 | |
992 | #define APCLI_CTRL_CONNECTED 6 | |
993 | #define APCLI_MAX_CTRL_STATE 7 | |
994 | ||
995 | #define APCLI_CTRL_MACHINE_BASE 0 | |
996 | #define APCLI_CTRL_JOIN_REQ 0 | |
997 | #define APCLI_CTRL_PROBE_RSP 1 | |
998 | #define APCLI_CTRL_AUTH_RSP 2 | |
999 | #define APCLI_CTRL_DISCONNECT_REQ 3 | |
1000 | #define APCLI_CTRL_PEER_DISCONNECT_REQ 4 | |
1001 | #define APCLI_CTRL_ASSOC_RSP 5 | |
1002 | #define APCLI_CTRL_DEASSOC_RSP 6 | |
1003 | #define APCLI_CTRL_JOIN_REQ_TIMEOUT 7 | |
1004 | #define APCLI_CTRL_AUTH_REQ_TIMEOUT 8 | |
1005 | #define APCLI_CTRL_ASSOC_REQ_TIMEOUT 9 | |
1006 | #define APCLI_MAX_CTRL_MSG 10 | |
1007 | ||
1008 | #define APCLI_CTRL_FUNC_SIZE (APCLI_MAX_CTRL_STATE * APCLI_MAX_CTRL_MSG) | |
1009 | ||
1010 | #endif // APCLI_SUPPORT // | |
1011 | ||
1012 | ||
1013 | // ============================================================================= | |
1014 | ||
1015 | // value domain of 802.11 header FC.Tyte, which is b3..b2 of the 1st-byte of MAC header | |
1016 | #define BTYPE_MGMT 0 | |
1017 | #define BTYPE_CNTL 1 | |
1018 | #define BTYPE_DATA 2 | |
1019 | ||
1020 | // value domain of 802.11 MGMT frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header | |
1021 | #define SUBTYPE_ASSOC_REQ 0 | |
1022 | #define SUBTYPE_ASSOC_RSP 1 | |
1023 | #define SUBTYPE_REASSOC_REQ 2 | |
1024 | #define SUBTYPE_REASSOC_RSP 3 | |
1025 | #define SUBTYPE_PROBE_REQ 4 | |
1026 | #define SUBTYPE_PROBE_RSP 5 | |
1027 | #define SUBTYPE_BEACON 8 | |
1028 | #define SUBTYPE_ATIM 9 | |
1029 | #define SUBTYPE_DISASSOC 10 | |
1030 | #define SUBTYPE_AUTH 11 | |
1031 | #define SUBTYPE_DEAUTH 12 | |
1032 | #define SUBTYPE_ACTION 13 | |
1033 | #define SUBTYPE_ACTION_NO_ACK 14 | |
1034 | ||
1035 | // value domain of 802.11 CNTL frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header | |
1036 | #define SUBTYPE_WRAPPER 7 | |
1037 | #define SUBTYPE_BLOCK_ACK_REQ 8 | |
1038 | #define SUBTYPE_BLOCK_ACK 9 | |
1039 | #define SUBTYPE_PS_POLL 10 | |
1040 | #define SUBTYPE_RTS 11 | |
1041 | #define SUBTYPE_CTS 12 | |
1042 | #define SUBTYPE_ACK 13 | |
1043 | #define SUBTYPE_CFEND 14 | |
1044 | #define SUBTYPE_CFEND_CFACK 15 | |
1045 | ||
1046 | // value domain of 802.11 DATA frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header | |
1047 | #define SUBTYPE_DATA 0 | |
1048 | #define SUBTYPE_DATA_CFACK 1 | |
1049 | #define SUBTYPE_DATA_CFPOLL 2 | |
1050 | #define SUBTYPE_DATA_CFACK_CFPOLL 3 | |
1051 | #define SUBTYPE_NULL_FUNC 4 | |
1052 | #define SUBTYPE_CFACK 5 | |
1053 | #define SUBTYPE_CFPOLL 6 | |
1054 | #define SUBTYPE_CFACK_CFPOLL 7 | |
1055 | #define SUBTYPE_QDATA 8 | |
1056 | #define SUBTYPE_QDATA_CFACK 9 | |
1057 | #define SUBTYPE_QDATA_CFPOLL 10 | |
1058 | #define SUBTYPE_QDATA_CFACK_CFPOLL 11 | |
1059 | #define SUBTYPE_QOS_NULL 12 | |
1060 | #define SUBTYPE_QOS_CFACK 13 | |
1061 | #define SUBTYPE_QOS_CFPOLL 14 | |
1062 | #define SUBTYPE_QOS_CFACK_CFPOLL 15 | |
1063 | ||
1064 | // ACK policy of QOS Control field bit 6:5 | |
1065 | #define NORMAL_ACK 0x00 // b6:5 = 00 | |
1066 | #define NO_ACK 0x20 // b6:5 = 01 | |
1067 | #define NO_EXPLICIT_ACK 0x40 // b6:5 = 10 | |
1068 | #define BLOCK_ACK 0x60 // b6:5 = 11 | |
1069 | ||
1070 | // | |
1071 | // rtmp_data.c use these definition | |
1072 | // | |
1073 | #define LENGTH_802_11 24 | |
1074 | #define LENGTH_802_11_AND_H 30 | |
1075 | #define LENGTH_802_11_CRC_H 34 | |
1076 | #define LENGTH_802_11_CRC 28 | |
1077 | #define LENGTH_802_11_WITH_ADDR4 30 | |
1078 | #define LENGTH_802_3 14 | |
1079 | #define LENGTH_802_3_TYPE 2 | |
1080 | #define LENGTH_802_1_H 8 | |
1081 | #define LENGTH_EAPOL_H 4 | |
1082 | #define LENGTH_WMMQOS_H 2 | |
1083 | #define LENGTH_CRC 4 | |
1084 | #define MAX_SEQ_NUMBER 0x0fff | |
1085 | #define LENGTH_802_3_NO_TYPE 12 | |
1086 | #define LENGTH_802_1Q 4 /* VLAN related */ | |
1087 | ||
1088 | // STA_CSR4.field.TxResult | |
1089 | #define TX_RESULT_SUCCESS 0 | |
1090 | #define TX_RESULT_ZERO_LENGTH 1 | |
1091 | #define TX_RESULT_UNDER_RUN 2 | |
1092 | #define TX_RESULT_OHY_ERROR 4 | |
1093 | #define TX_RESULT_RETRY_FAIL 6 | |
1094 | ||
1095 | // All PHY rate summary in TXD | |
1096 | // Preamble MODE in TxD | |
1097 | #define MODE_CCK 0 | |
1098 | #define MODE_OFDM 1 | |
1099 | #ifdef DOT11_N_SUPPORT | |
1100 | #define MODE_HTMIX 2 | |
1101 | #define MODE_HTGREENFIELD 3 | |
1102 | #endif // DOT11_N_SUPPORT // | |
1103 | // MCS for CCK. BW.SGI.STBC are reserved | |
1104 | #define MCS_LONGP_RATE_1 0 // long preamble CCK 1Mbps | |
1105 | #define MCS_LONGP_RATE_2 1 // long preamble CCK 1Mbps | |
1106 | #define MCS_LONGP_RATE_5_5 2 | |
1107 | #define MCS_LONGP_RATE_11 3 | |
1108 | #define MCS_SHORTP_RATE_1 4 // long preamble CCK 1Mbps. short is forbidden in 1Mbps | |
1109 | #define MCS_SHORTP_RATE_2 5 // short preamble CCK 2Mbps | |
1110 | #define MCS_SHORTP_RATE_5_5 6 | |
1111 | #define MCS_SHORTP_RATE_11 7 | |
1112 | // To send duplicate legacy OFDM. set BW=BW_40. SGI.STBC are reserved | |
1113 | #define MCS_RATE_6 0 // legacy OFDM | |
1114 | #define MCS_RATE_9 1 // OFDM | |
1115 | #define MCS_RATE_12 2 // OFDM | |
1116 | #define MCS_RATE_18 3 // OFDM | |
1117 | #define MCS_RATE_24 4 // OFDM | |
1118 | #define MCS_RATE_36 5 // OFDM | |
1119 | #define MCS_RATE_48 6 // OFDM | |
1120 | #define MCS_RATE_54 7 // OFDM | |
1121 | // HT | |
1122 | #define MCS_0 0 // 1S | |
1123 | #define MCS_1 1 | |
1124 | #define MCS_2 2 | |
1125 | #define MCS_3 3 | |
1126 | #define MCS_4 4 | |
1127 | #define MCS_5 5 | |
1128 | #define MCS_6 6 | |
1129 | #define MCS_7 7 | |
1130 | #define MCS_8 8 // 2S | |
1131 | #define MCS_9 9 | |
1132 | #define MCS_10 10 | |
1133 | #define MCS_11 11 | |
1134 | #define MCS_12 12 | |
1135 | #define MCS_13 13 | |
1136 | #define MCS_14 14 | |
1137 | #define MCS_15 15 | |
1138 | #define MCS_16 16 // 3*3 | |
1139 | #define MCS_17 17 | |
1140 | #define MCS_18 18 | |
1141 | #define MCS_19 19 | |
1142 | #define MCS_20 20 | |
1143 | #define MCS_21 21 | |
1144 | #define MCS_22 22 | |
1145 | #define MCS_23 23 | |
1146 | #define MCS_32 32 | |
1147 | #define MCS_AUTO 33 | |
1148 | ||
1149 | #ifdef DOT11_N_SUPPORT | |
1150 | // OID_HTPHYMODE | |
1151 | // MODE | |
1152 | #define HTMODE_MM 0 | |
1153 | #define HTMODE_GF 1 | |
1154 | #endif // DOT11_N_SUPPORT // | |
1155 | ||
1156 | // Fixed Tx MODE - HT, CCK or OFDM | |
1157 | #define FIXED_TXMODE_HT 0 | |
1158 | #define FIXED_TXMODE_CCK 1 | |
1159 | #define FIXED_TXMODE_OFDM 2 | |
1160 | // BW | |
1161 | #define BW_20 BAND_WIDTH_20 | |
1162 | #define BW_40 BAND_WIDTH_40 | |
1163 | #define BW_BOTH BAND_WIDTH_BOTH | |
1164 | #define BW_10 BAND_WIDTH_10 // 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field. | |
1165 | ||
1166 | #ifdef DOT11_N_SUPPORT | |
1167 | // SHORTGI | |
1168 | #define GI_400 GAP_INTERVAL_400 // only support in HT mode | |
1169 | #define GI_BOTH GAP_INTERVAL_BOTH | |
1170 | #endif // DOT11_N_SUPPORT // | |
1171 | #define GI_800 GAP_INTERVAL_800 | |
1172 | // STBC | |
1173 | #define STBC_NONE 0 | |
1174 | #ifdef DOT11_N_SUPPORT | |
1175 | #define STBC_USE 1 // limited use in rt2860b phy | |
1176 | #define RXSTBC_ONE 1 // rx support of one spatial stream | |
1177 | #define RXSTBC_TWO 2 // rx support of 1 and 2 spatial stream | |
1178 | #define RXSTBC_THR 3 // rx support of 1~3 spatial stream | |
1179 | // MCS FEEDBACK | |
1180 | #define MCSFBK_NONE 0 // not support mcs feedback / | |
1181 | #define MCSFBK_RSV 1 // reserved | |
1182 | #define MCSFBK_UNSOLICIT 2 // only support unsolict mcs feedback | |
1183 | #define MCSFBK_MRQ 3 // response to both MRQ and unsolict mcs feedback | |
1184 | ||
1185 | // MIMO power safe | |
1186 | #define MMPS_STATIC 0 | |
1187 | #define MMPS_DYNAMIC 1 | |
1188 | #define MMPS_RSV 2 | |
1189 | #define MMPS_ENABLE 3 | |
1190 | ||
1191 | ||
1192 | // A-MSDU size | |
1193 | #define AMSDU_0 0 | |
1194 | #define AMSDU_1 1 | |
1195 | ||
1196 | #endif // DOT11_N_SUPPORT // | |
1197 | ||
1198 | // MCS use 7 bits | |
1199 | #define TXRATEMIMO 0x80 | |
1200 | #define TXRATEMCS 0x7F | |
1201 | #define TXRATEOFDM 0x7F | |
1202 | #define RATE_1 0 | |
1203 | #define RATE_2 1 | |
1204 | #define RATE_5_5 2 | |
1205 | #define RATE_11 3 | |
1206 | #define RATE_6 4 // OFDM | |
1207 | #define RATE_9 5 // OFDM | |
1208 | #define RATE_12 6 // OFDM | |
1209 | #define RATE_18 7 // OFDM | |
1210 | #define RATE_24 8 // OFDM | |
1211 | #define RATE_36 9 // OFDM | |
1212 | #define RATE_48 10 // OFDM | |
1213 | #define RATE_54 11 // OFDM | |
1214 | #define RATE_FIRST_OFDM_RATE RATE_6 | |
1215 | #define RATE_LAST_OFDM_RATE RATE_54 | |
1216 | #define RATE_6_5 12 // HT mix | |
1217 | #define RATE_13 13 // HT mix | |
1218 | #define RATE_19_5 14 // HT mix | |
1219 | #define RATE_26 15 // HT mix | |
1220 | #define RATE_39 16 // HT mix | |
1221 | #define RATE_52 17 // HT mix | |
1222 | #define RATE_58_5 18 // HT mix | |
1223 | #define RATE_65 19 // HT mix | |
1224 | #define RATE_78 20 // HT mix | |
1225 | #define RATE_104 21 // HT mix | |
1226 | #define RATE_117 22 // HT mix | |
1227 | #define RATE_130 23 // HT mix | |
1228 | //#define RATE_AUTO_SWITCH 255 // for StaCfg.FixedTxRate only | |
1229 | #define HTRATE_0 12 | |
1230 | #define RATE_FIRST_MM_RATE HTRATE_0 | |
1231 | #define RATE_FIRST_HT_RATE HTRATE_0 | |
1232 | #define RATE_LAST_HT_RATE HTRATE_0 | |
1233 | ||
1234 | // pTxWI->txop | |
1235 | #define IFS_HTTXOP 0 // The txop will be handles by ASIC. | |
1236 | #define IFS_PIFS 1 | |
1237 | #define IFS_SIFS 2 | |
1238 | #define IFS_BACKOFF 3 | |
1239 | ||
1240 | // pTxD->RetryMode | |
1241 | #define LONG_RETRY 1 | |
1242 | #define SHORT_RETRY 0 | |
1243 | ||
1244 | // Country Region definition | |
1245 | #define REGION_MINIMUM_BG_BAND 0 | |
1246 | #define REGION_0_BG_BAND 0 // 1-11 | |
1247 | #define REGION_1_BG_BAND 1 // 1-13 | |
1248 | #define REGION_2_BG_BAND 2 // 10-11 | |
1249 | #define REGION_3_BG_BAND 3 // 10-13 | |
1250 | #define REGION_4_BG_BAND 4 // 14 | |
1251 | #define REGION_5_BG_BAND 5 // 1-14 | |
1252 | #define REGION_6_BG_BAND 6 // 3-9 | |
1253 | #define REGION_7_BG_BAND 7 // 5-13 | |
1254 | #define REGION_31_BG_BAND 31 // 5-13 | |
1255 | #define REGION_MAXIMUM_BG_BAND 7 | |
1256 | ||
1257 | #define REGION_MINIMUM_A_BAND 0 | |
1258 | #define REGION_0_A_BAND 0 // 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 | |
1259 | #define REGION_1_A_BAND 1 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 | |
1260 | #define REGION_2_A_BAND 2 // 36, 40, 44, 48, 52, 56, 60, 64 | |
1261 | #define REGION_3_A_BAND 3 // 52, 56, 60, 64, 149, 153, 157, 161 | |
1262 | #define REGION_4_A_BAND 4 // 149, 153, 157, 161, 165 | |
1263 | #define REGION_5_A_BAND 5 // 149, 153, 157, 161 | |
1264 | #define REGION_6_A_BAND 6 // 36, 40, 44, 48 | |
1265 | #define REGION_7_A_BAND 7 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 | |
1266 | #define REGION_8_A_BAND 8 // 52, 56, 60, 64 | |
1267 | #define REGION_9_A_BAND 9 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165 | |
1268 | #define REGION_10_A_BAND 10 // 36, 40, 44, 48, 149, 153, 157, 161, 165 | |
1269 | #define REGION_11_A_BAND 11 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161 | |
1270 | #define REGION_MAXIMUM_A_BAND 11 | |
1271 | ||
1272 | // pTxD->CipherAlg | |
1273 | #define CIPHER_NONE 0 | |
1274 | #define CIPHER_WEP64 1 | |
1275 | #define CIPHER_WEP128 2 | |
1276 | #define CIPHER_TKIP 3 | |
1277 | #define CIPHER_AES 4 | |
1278 | #define CIPHER_CKIP64 5 | |
1279 | #define CIPHER_CKIP128 6 | |
1280 | #define CIPHER_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table | |
1281 | #define CIPHER_SMS4 8 | |
1282 | ||
1283 | // value domain of pAd->RfIcType | |
1284 | #define RFIC_2820 1 // 2.4G 2T3R | |
1285 | #define RFIC_2850 2 // 2.4G/5G 2T3R | |
1286 | #define RFIC_2720 3 // 2.4G 1T2R | |
1287 | #define RFIC_2750 4 // 2.4G/5G 1T2R | |
1288 | #define RFIC_3020 5 // 2.4G 1T1R | |
1289 | #define RFIC_2020 6 // 2.4G B/G | |
1290 | ||
1291 | // LED Status. | |
1292 | #define LED_LINK_DOWN 0 | |
1293 | #define LED_LINK_UP 1 | |
1294 | #define LED_RADIO_OFF 2 | |
1295 | #define LED_RADIO_ON 3 | |
1296 | #define LED_HALT 4 | |
1297 | #define LED_WPS 5 | |
1298 | #define LED_ON_SITE_SURVEY 6 | |
1299 | #define LED_POWER_UP 7 | |
1300 | ||
1301 | // value domain of pAd->LedCntl.LedMode and E2PROM | |
1302 | #define LED_MODE_DEFAULT 0 | |
1303 | #define LED_MODE_TWO_LED 1 | |
1304 | #define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8 | |
1305 | ||
1306 | // RC4 init value, used fro WEP & TKIP | |
1307 | #define PPPINITFCS32 0xffffffff /* Initial FCS value */ | |
1308 | ||
1309 | // value domain of pAd->StaCfg.PortSecured. 802.1X controlled port definition | |
1310 | #define WPA_802_1X_PORT_SECURED 1 | |
1311 | #define WPA_802_1X_PORT_NOT_SECURED 2 | |
1312 | ||
1313 | #define PAIRWISE_KEY 1 | |
1314 | #define GROUP_KEY 2 | |
1315 | ||
1316 | //definition of DRS | |
1317 | #define MAX_STEP_OF_TX_RATE_SWITCH 32 | |
1318 | ||
1319 | ||
1320 | // pre-allocated free NDIS PACKET/BUFFER poll for internal usage | |
1321 | #define MAX_NUM_OF_FREE_NDIS_PACKET 128 | |
1322 | ||
1323 | //Block ACK | |
1324 | #define MAX_TX_REORDERBUF 64 | |
1325 | #define MAX_RX_REORDERBUF 64 | |
1326 | #define DEFAULT_TX_TIMEOUT 30 | |
1327 | #define DEFAULT_RX_TIMEOUT 30 | |
1328 | ||
1329 | // definition of Recipient or Originator | |
1330 | #define I_RECIPIENT TRUE | |
1331 | #define I_ORIGINATOR FALSE | |
1332 | ||
1333 | #define DEFAULT_BBP_TX_POWER 0 | |
1334 | #define DEFAULT_RF_TX_POWER 5 | |
1335 | ||
1336 | #define MAX_INI_BUFFER_SIZE 4096 | |
1337 | #define MAX_PARAM_BUFFER_SIZE (2048) // enough for ACL (18*64) | |
1338 | //18 : the length of Mac address acceptable format "01:02:03:04:05:06;") | |
1339 | //64 : MAX_NUM_OF_ACL_LIST | |
1340 | // definition of pAd->OpMode | |
1341 | #define OPMODE_STA 0 | |
1342 | #define OPMODE_AP 1 | |
1343 | //#define OPMODE_L3_BRG 2 // as AP and STA at the same time | |
1344 | ||
1345 | #ifdef RT_BIG_ENDIAN | |
1346 | #define DIR_READ 0 | |
1347 | #define DIR_WRITE 1 | |
1348 | #define TYPE_TXD 0 | |
1349 | #define TYPE_RXD 1 | |
1350 | #define TYPE_TXINFO 0 | |
1351 | #define TYPE_RXINFO 1 | |
1352 | #define TYPE_TXWI 0 | |
1353 | #define TYPE_RXWI 1 | |
1354 | #endif | |
1355 | ||
1356 | // ========================= AP rtmp_def.h =========================== | |
1357 | // value domain for pAd->EventTab.Log[].Event | |
1358 | #define EVENT_RESET_ACCESS_POINT 0 // Log = "hh:mm:ss Restart Access Point" | |
1359 | #define EVENT_ASSOCIATED 1 // Log = "hh:mm:ss STA 00:01:02:03:04:05 associated" | |
1360 | #define EVENT_DISASSOCIATED 2 // Log = "hh:mm:ss STA 00:01:02:03:04:05 left this BSS" | |
1361 | #define EVENT_AGED_OUT 3 // Log = "hh:mm:ss STA 00:01:02:03:04:05 was aged-out and removed from this BSS" | |
1362 | #define EVENT_COUNTER_M 4 | |
1363 | #define EVENT_INVALID_PSK 5 | |
1364 | #define EVENT_MAX_EVENT_TYPE 6 | |
1365 | // ==== end of AP rtmp_def.h ============ | |
1366 | ||
1367 | // definition RSSI Number | |
1368 | #define RSSI_0 0 | |
1369 | #define RSSI_1 1 | |
1370 | #define RSSI_2 2 | |
1371 | ||
1372 | // definition of radar detection | |
1373 | #define RD_NORMAL_MODE 0 // Not found radar signal | |
1374 | #define RD_SWITCHING_MODE 1 // Found radar signal, and doing channel switch | |
1375 | #define RD_SILENCE_MODE 2 // After channel switch, need to be silence a while to ensure radar not found | |
1376 | ||
1377 | //Driver defined cid for mapping status and command. | |
1378 | #define SLEEPCID 0x11 | |
1379 | #define WAKECID 0x22 | |
1380 | #define QUERYPOWERCID 0x33 | |
1381 | #define OWNERMCU 0x1 | |
1382 | #define OWNERCPU 0x0 | |
1383 | ||
1384 | // MBSSID definition | |
1385 | #define ENTRY_NOT_FOUND 0xFF | |
1386 | ||
1387 | ||
1388 | /* After Linux 2.6.9, | |
1389 | * VLAN module use Private (from user) interface flags (netdevice->priv_flags). | |
1390 | * #define IFF_802_1Q_VLAN 0x1 -- 802.1Q VLAN device. in if.h | |
1391 | * ref to ip_sabotage_out() [ out->priv_flags & IFF_802_1Q_VLAN ] in br_netfilter.c | |
1392 | * | |
1393 | * For this reason, we MUST use EVEN value in priv_flags | |
1394 | */ | |
1395 | #define INT_MAIN 0x0100 | |
1396 | #define INT_MBSSID 0x0200 | |
1397 | #define INT_WDS 0x0300 | |
1398 | #define INT_APCLI 0x0400 | |
1399 | #define INT_MESH 0x0500 | |
1400 | ||
1401 | // Use bitmap to allow coexist of ATE_TXFRAME and ATE_RXFRAME(i.e.,to support LoopBack mode) | |
1402 | #ifdef RALINK_ATE | |
1403 | #define ATE_START 0x00 // Start ATE | |
1404 | #define ATE_STOP 0x80 // Stop ATE | |
1405 | #define ATE_TXCONT 0x05 // Continuous Transmit | |
1406 | #define ATE_TXCARR 0x09 // Transmit Carrier | |
1407 | #define ATE_TXCARRSUPP 0x11 // Transmit Carrier Suppression | |
1408 | #define ATE_TXFRAME 0x01 // Transmit Frames | |
1409 | #define ATE_RXFRAME 0x02 // Receive Frames | |
1410 | #ifdef RALINK_28xx_QA | |
1411 | #define ATE_TXSTOP 0xe2 // Stop Transmition(i.e., TXCONT, TXCARR, TXCARRSUPP, and TXFRAME) | |
1412 | #define ATE_RXSTOP 0xfd // Stop receiving Frames | |
1413 | #define BBP22_TXFRAME 0x00 // Transmit Frames | |
1414 | #define BBP22_TXCONT_OR_CARRSUPP 0x80 // Continuous Transmit or Carrier Suppression | |
1415 | #define BBP22_TXCARR 0xc1 // Transmit Carrier | |
1416 | #define BBP24_TXCONT 0x00 // Continuous Transmit | |
1417 | #define BBP24_CARRSUPP 0x01 // Carrier Suppression | |
1418 | #endif // RALINK_28xx_QA // | |
1419 | #endif // RALINK_ATE // | |
1420 | ||
1421 | // WEP Key TYPE | |
1422 | #define WEP_HEXADECIMAL_TYPE 0 | |
1423 | #define WEP_ASCII_TYPE 1 | |
1424 | ||
1425 | ||
1426 | ||
1427 | // WIRELESS EVENTS definition | |
1428 | /* Max number of char in custom event, refer to wireless_tools.28/wireless.20.h */ | |
1429 | #define IW_CUSTOM_MAX_LEN 255 /* In bytes */ | |
1430 | ||
1431 | // For system event - start | |
1432 | #define IW_SYS_EVENT_FLAG_START 0x0200 | |
1433 | #define IW_ASSOC_EVENT_FLAG 0x0200 | |
1434 | #define IW_DISASSOC_EVENT_FLAG 0x0201 | |
1435 | #define IW_DEAUTH_EVENT_FLAG 0x0202 | |
1436 | #define IW_AGEOUT_EVENT_FLAG 0x0203 | |
1437 | #define IW_COUNTER_MEASURES_EVENT_FLAG 0x0204 | |
1438 | #define IW_REPLAY_COUNTER_DIFF_EVENT_FLAG 0x0205 | |
1439 | #define IW_RSNIE_DIFF_EVENT_FLAG 0x0206 | |
1440 | #define IW_MIC_DIFF_EVENT_FLAG 0x0207 | |
1441 | #define IW_ICV_ERROR_EVENT_FLAG 0x0208 | |
1442 | #define IW_MIC_ERROR_EVENT_FLAG 0x0209 | |
1443 | #define IW_GROUP_HS_TIMEOUT_EVENT_FLAG 0x020A | |
1444 | #define IW_PAIRWISE_HS_TIMEOUT_EVENT_FLAG 0x020B | |
1445 | #define IW_RSNIE_SANITY_FAIL_EVENT_FLAG 0x020C | |
1446 | #define IW_SET_KEY_DONE_WPA1_EVENT_FLAG 0x020D | |
1447 | #define IW_SET_KEY_DONE_WPA2_EVENT_FLAG 0x020E | |
1448 | #define IW_STA_LINKUP_EVENT_FLAG 0x020F | |
1449 | #define IW_STA_LINKDOWN_EVENT_FLAG 0x0210 | |
1450 | #define IW_SCAN_COMPLETED_EVENT_FLAG 0x0211 | |
1451 | #define IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG 0x0212 | |
1452 | // if add new system event flag, please upadte the IW_SYS_EVENT_FLAG_END | |
1453 | #define IW_SYS_EVENT_FLAG_END 0x0212 | |
1454 | #define IW_SYS_EVENT_TYPE_NUM (IW_SYS_EVENT_FLAG_END - IW_SYS_EVENT_FLAG_START + 1) | |
1455 | // For system event - end | |
1456 | ||
1457 | // For spoof attack event - start | |
1458 | #define IW_SPOOF_EVENT_FLAG_START 0x0300 | |
1459 | #define IW_CONFLICT_SSID_EVENT_FLAG 0x0300 | |
1460 | #define IW_SPOOF_ASSOC_RESP_EVENT_FLAG 0x0301 | |
1461 | #define IW_SPOOF_REASSOC_RESP_EVENT_FLAG 0x0302 | |
1462 | #define IW_SPOOF_PROBE_RESP_EVENT_FLAG 0x0303 | |
1463 | #define IW_SPOOF_BEACON_EVENT_FLAG 0x0304 | |
1464 | #define IW_SPOOF_DISASSOC_EVENT_FLAG 0x0305 | |
1465 | #define IW_SPOOF_AUTH_EVENT_FLAG 0x0306 | |
1466 | #define IW_SPOOF_DEAUTH_EVENT_FLAG 0x0307 | |
1467 | #define IW_SPOOF_UNKNOWN_MGMT_EVENT_FLAG 0x0308 | |
1468 | #define IW_REPLAY_ATTACK_EVENT_FLAG 0x0309 | |
1469 | // if add new spoof attack event flag, please upadte the IW_SPOOF_EVENT_FLAG_END | |
1470 | #define IW_SPOOF_EVENT_FLAG_END 0x0309 | |
1471 | #define IW_SPOOF_EVENT_TYPE_NUM (IW_SPOOF_EVENT_FLAG_END - IW_SPOOF_EVENT_FLAG_START + 1) | |
1472 | // For spoof attack event - end | |
1473 | ||
1474 | // For flooding attack event - start | |
1475 | #define IW_FLOOD_EVENT_FLAG_START 0x0400 | |
1476 | #define IW_FLOOD_AUTH_EVENT_FLAG 0x0400 | |
1477 | #define IW_FLOOD_ASSOC_REQ_EVENT_FLAG 0x0401 | |
1478 | #define IW_FLOOD_REASSOC_REQ_EVENT_FLAG 0x0402 | |
1479 | #define IW_FLOOD_PROBE_REQ_EVENT_FLAG 0x0403 | |
1480 | #define IW_FLOOD_DISASSOC_EVENT_FLAG 0x0404 | |
1481 | #define IW_FLOOD_DEAUTH_EVENT_FLAG 0x0405 | |
1482 | #define IW_FLOOD_EAP_REQ_EVENT_FLAG 0x0406 | |
1483 | // if add new flooding attack event flag, please upadte the IW_FLOOD_EVENT_FLAG_END | |
1484 | #define IW_FLOOD_EVENT_FLAG_END 0x0406 | |
1485 | #define IW_FLOOD_EVENT_TYPE_NUM (IW_FLOOD_EVENT_FLAG_END - IW_FLOOD_EVENT_FLAG_START + 1) | |
1486 | // For flooding attack - end | |
1487 | ||
1488 | // End - WIRELESS EVENTS definition | |
1489 | ||
1490 | #ifdef CONFIG_STA_SUPPORT | |
1491 | // definition for DLS, kathy | |
1492 | #define MAX_NUM_OF_INIT_DLS_ENTRY 1 | |
1493 | #define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY | |
1494 | ||
1495 | //Block ACK , rt2860, kathy | |
1496 | #define MAX_TX_REORDERBUF 64 | |
1497 | #define MAX_RX_REORDERBUF 64 | |
1498 | #define DEFAULT_TX_TIMEOUT 30 | |
1499 | #define DEFAULT_RX_TIMEOUT 30 | |
1500 | #ifndef CONFIG_AP_SUPPORT | |
1501 | #define MAX_BARECI_SESSION 8 | |
1502 | #endif | |
1503 | ||
1504 | #ifndef IW_ESSID_MAX_SIZE | |
1505 | /* Maximum size of the ESSID and pAd->nickname strings */ | |
1506 | #define IW_ESSID_MAX_SIZE 32 | |
1507 | #endif | |
1508 | #endif // CONFIG_STA_SUPPORT // | |
1509 | ||
1510 | #ifdef MCAST_RATE_SPECIFIC | |
1511 | #define MCAST_DISABLE 0 | |
1512 | #define MCAST_CCK 1 | |
1513 | #define MCAST_OFDM 2 | |
1514 | #define MCAST_HTMIX 3 | |
1515 | #endif // MCAST_RATE_SPECIFIC // | |
1516 | ||
1517 | // For AsicRadioOff/AsicRadioOn function | |
1518 | #define DOT11POWERSAVE 0 | |
1519 | #define GUIRADIO_OFF 1 | |
1520 | #define RTMP_HALT 2 | |
1521 | #define GUI_IDLE_POWER_SAVE 3 | |
1522 | // -- | |
1523 | ||
1524 | ||
1525 | // definition for WpaSupport flag | |
1526 | #define WPA_SUPPLICANT_DISABLE 0 | |
1527 | #define WPA_SUPPLICANT_ENABLE 1 | |
1528 | #define WPA_SUPPLICANT_ENABLE_WITH_WEB_UI 2 | |
1529 | ||
1530 | // Endian byte swapping codes | |
1531 | #define SWAP16(x) \ | |
1532 | ((UINT16)( \ | |
1533 | (((UINT16)(x) & (UINT16) 0x00ffU) << 8) | \ | |
1534 | (((UINT16)(x) & (UINT16) 0xff00U) >> 8) )) | |
1535 | ||
1536 | #define SWAP32(x) \ | |
1537 | ((UINT32)( \ | |
1538 | (((UINT32)(x) & (UINT32) 0x000000ffUL) << 24) | \ | |
1539 | (((UINT32)(x) & (UINT32) 0x0000ff00UL) << 8) | \ | |
1540 | (((UINT32)(x) & (UINT32) 0x00ff0000UL) >> 8) | \ | |
1541 | (((UINT32)(x) & (UINT32) 0xff000000UL) >> 24) )) | |
1542 | ||
1543 | #define SWAP64(x) \ | |
1544 | ((UINT64)( \ | |
1545 | (UINT64)(((UINT64)(x) & (UINT64) 0x00000000000000ffULL) << 56) | \ | |
1546 | (UINT64)(((UINT64)(x) & (UINT64) 0x000000000000ff00ULL) << 40) | \ | |
1547 | (UINT64)(((UINT64)(x) & (UINT64) 0x0000000000ff0000ULL) << 24) | \ | |
1548 | (UINT64)(((UINT64)(x) & (UINT64) 0x00000000ff000000ULL) << 8) | \ | |
1549 | (UINT64)(((UINT64)(x) & (UINT64) 0x000000ff00000000ULL) >> 8) | \ | |
1550 | (UINT64)(((UINT64)(x) & (UINT64) 0x0000ff0000000000ULL) >> 24) | \ | |
1551 | (UINT64)(((UINT64)(x) & (UINT64) 0x00ff000000000000ULL) >> 40) | \ | |
1552 | (UINT64)(((UINT64)(x) & (UINT64) 0xff00000000000000ULL) >> 56) )) | |
1553 | ||
1554 | #ifdef RT_BIG_ENDIAN | |
1555 | ||
1556 | #define cpu2le64(x) SWAP64((x)) | |
1557 | #define le2cpu64(x) SWAP64((x)) | |
1558 | #define cpu2le32(x) SWAP32((x)) | |
1559 | #define le2cpu32(x) SWAP32((x)) | |
1560 | #define cpu2le16(x) SWAP16((x)) | |
1561 | #define le2cpu16(x) SWAP16((x)) | |
1562 | #define cpu2be64(x) ((UINT64)(x)) | |
1563 | #define be2cpu64(x) ((UINT64)(x)) | |
1564 | #define cpu2be32(x) ((UINT32)(x)) | |
1565 | #define be2cpu32(x) ((UINT32)(x)) | |
1566 | #define cpu2be16(x) ((UINT16)(x)) | |
1567 | #define be2cpu16(x) ((UINT16)(x)) | |
1568 | ||
1569 | #else // Little_Endian | |
1570 | ||
1571 | #define cpu2le64(x) ((UINT64)(x)) | |
1572 | #define le2cpu64(x) ((UINT64)(x)) | |
1573 | #define cpu2le32(x) ((UINT32)(x)) | |
1574 | #define le2cpu32(x) ((UINT32)(x)) | |
1575 | #define cpu2le16(x) ((UINT16)(x)) | |
1576 | #define le2cpu16(x) ((UINT16)(x)) | |
1577 | #define cpu2be64(x) SWAP64((x)) | |
1578 | #define be2cpu64(x) SWAP64((x)) | |
1579 | #define cpu2be32(x) SWAP32((x)) | |
1580 | #define be2cpu32(x) SWAP32((x)) | |
1581 | #define cpu2be16(x) SWAP16((x)) | |
1582 | #define be2cpu16(x) SWAP16((x)) | |
1583 | ||
1584 | #endif // RT_BIG_ENDIAN | |
1585 | ||
1586 | #endif // __RTMP_DEF_H__ | |
1587 | ||
1588 |