2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
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. *
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. *
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. *
25 *************************************************************************
31 Miniport generic portion header file
35 -------- ---------- ----------------------------------------------
36 John Chang 2003-08-28 Created
37 John Chang 2004-09-06 modified for RT2600
42 #include "rtmp_dot11.h"
44 #ifdef CONFIG_STA_SUPPORT
45 #endif // CONFIG_STA_SUPPORT //
48 // maximum supported capability information -
49 // ESS, IBSS, Privacy, Short Preamble, Spectrum mgmt, Short Slot
50 #define SUPPORTED_CAPABILITY_INFO 0x0533
52 #define END_OF_ARGS -1
53 #define LFSR_MASK 0x80000057
54 #define MLME_TASK_EXEC_INTV 100/*200*/ //
56 #define MLME_TASK_EXEC_MULTIPLE 10 /*5*/ // MLME_TASK_EXEC_MULTIPLE * MLME_TASK_EXEC_INTV = 1 sec
57 #define REORDER_EXEC_INTV 100 // 0.1 sec
58 //#define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps
60 // The definition of Radar detection duration region
66 #define MAX_RD_REGION 5
68 #define BEACON_LOST_TIME 4 * OS_HZ // 2048 msec = 2 sec
70 #define DLS_TIMEOUT 1200 // unit: msec
71 #define AUTH_TIMEOUT 300 // unit: msec
72 #define ASSOC_TIMEOUT 300 // unit: msec
73 #define JOIN_TIMEOUT 2000 // unit: msec
74 #define SHORT_CHANNEL_TIME 90 // unit: msec
75 #define MIN_CHANNEL_TIME 110 // unit: msec, for dual band scan
76 #define MAX_CHANNEL_TIME 140 // unit: msec, for single band scan
77 #define FAST_ACTIVE_SCAN_TIME 30 // Active scan waiting for probe response time
78 #define CW_MIN_IN_BITS 4 // actual CwMin = 2^CW_MIN_IN_BITS - 1
79 #define LINK_DOWN_TIMEOUT 20000 // unit: msec
80 #define AUTO_WAKEUP_TIMEOUT 70 //unit: msec
83 #ifdef CONFIG_STA_SUPPORT
84 #define CW_MAX_IN_BITS 10 // actual CwMax = 2^CW_MAX_IN_BITS - 1
85 #endif // CONFIG_STA_SUPPORT //
87 #ifdef CONFIG_APSTA_MIXED_SUPPORT
88 extern UINT32 CW_MAX_IN_BITS
;
89 #endif // CONFIG_APSTA_MIXED_SUPPORT //
91 // Note: RSSI_TO_DBM_OFFSET has been changed to variable for new RF (2004-0720).
92 // SHould not refer to this constant anymore
93 //#define RSSI_TO_DBM_OFFSET 120 // for RT2530 RSSI-115 = dBm
94 #define RSSI_FOR_MID_TX_POWER -55 // -55 db is considered mid-distance
95 #define RSSI_FOR_LOW_TX_POWER -45 // -45 db is considered very short distance and
96 // eligible to use a lower TX power
97 #define RSSI_FOR_LOWEST_TX_POWER -30
98 //#define MID_TX_POWER_DELTA 0 // 0 db from full TX power upon mid-distance to AP
99 #define LOW_TX_POWER_DELTA 6 // -3 db from full TX power upon very short distance. 1 grade is 0.5 db
100 #define LOWEST_TX_POWER_DELTA 16 // -8 db from full TX power upon shortest distance. 1 grade is 0.5 db
102 #define RSSI_TRIGGERED_UPON_BELOW_THRESHOLD 0
103 #define RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD 1
104 #define RSSI_THRESHOLD_FOR_ROAMING 25
107 // Channel Quality Indication
108 #define CQI_IS_GOOD(cqi) ((cqi) >= 50)
109 //#define CQI_IS_FAIR(cqi) (((cqi) >= 20) && ((cqi) < 50))
110 #define CQI_IS_POOR(cqi) (cqi < 50) //(((cqi) >= 5) && ((cqi) < 20))
111 #define CQI_IS_BAD(cqi) (cqi < 5)
112 #define CQI_IS_DEAD(cqi) (cqi == 0)
114 // weighting factor to calculate Channel quality, total should be 100%
115 #define RSSI_WEIGHTING 50
116 #define TX_WEIGHTING 30
117 #define RX_WEIGHTING 20
119 //#define PEER_KEY_NOT_USED 0
120 //#define PEER_KEY_64_BIT 64
121 //#define PEER_KEY_128_BIT 128
123 //#define PEER_KEY_64BIT_LEN 8
124 //#define PEER_KEY_128BIT_LEN 16
126 #define BSS_NOT_FOUND 0xFFFFFFFF
129 #ifdef CONFIG_STA_SUPPORT
130 #define MAX_LEN_OF_MLME_QUEUE 40 //10
131 #endif // CONFIG_STA_SUPPORT //
133 #define SCAN_PASSIVE 18 // scan with no probe request, only wait beacon and probe response
134 #define SCAN_ACTIVE 19 // scan with probe request, and wait beacon and probe response
135 #define SCAN_CISCO_PASSIVE 20 // Single channel passive scan
136 #define SCAN_CISCO_ACTIVE 21 // Single channel active scan
137 #define SCAN_CISCO_NOISE 22 // Single channel passive scan for noise histogram collection
138 #define SCAN_CISCO_CHANNEL_LOAD 23 // Single channel passive scan for channel load collection
139 #define FAST_SCAN_ACTIVE 24 // scan with probe request, and wait beacon and probe response
142 #define SCAN_2040_BSS_COEXIST 26
143 #endif // DOT11N_DRAFT3 //
145 //#define BSS_TABLE_EMPTY(x) ((x).BssNr == 0)
146 #define MAC_ADDR_IS_GROUP(Addr) (((Addr[0]) & 0x01))
147 #define MAC_ADDR_HASH(Addr) (Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5])
148 #define MAC_ADDR_HASH_INDEX(Addr) (MAC_ADDR_HASH(Addr) % HASH_TABLE_SIZE)
149 #define TID_MAC_HASH(Addr,TID) (TID^Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5])
150 #define TID_MAC_HASH_INDEX(Addr,TID) (TID_MAC_HASH(Addr,TID) % HASH_TABLE_SIZE)
153 // assoiation ON. one LED ON. another blinking when TX, OFF when idle
154 // no association, both LED off
155 #define ASIC_LED_ACT_ON(pAd) RTMP_IO_WRITE32(pAd, MAC_CSR14, 0x00031e46)
156 #define ASIC_LED_ACT_OFF(pAd) RTMP_IO_WRITE32(pAd, MAC_CSR14, 0x00001e46)
158 // bit definition of the 2-byte pBEACON->Capability field
159 #define CAP_IS_ESS_ON(x) (((x) & 0x0001) != 0)
160 #define CAP_IS_IBSS_ON(x) (((x) & 0x0002) != 0)
161 #define CAP_IS_CF_POLLABLE_ON(x) (((x) & 0x0004) != 0)
162 #define CAP_IS_CF_POLL_REQ_ON(x) (((x) & 0x0008) != 0)
163 #define CAP_IS_PRIVACY_ON(x) (((x) & 0x0010) != 0)
164 #define CAP_IS_SHORT_PREAMBLE_ON(x) (((x) & 0x0020) != 0)
165 #define CAP_IS_PBCC_ON(x) (((x) & 0x0040) != 0)
166 #define CAP_IS_AGILITY_ON(x) (((x) & 0x0080) != 0)
167 #define CAP_IS_SPECTRUM_MGMT(x) (((x) & 0x0100) != 0) // 802.11e d9
168 #define CAP_IS_QOS(x) (((x) & 0x0200) != 0) // 802.11e d9
169 #define CAP_IS_SHORT_SLOT(x) (((x) & 0x0400) != 0)
170 #define CAP_IS_APSD(x) (((x) & 0x0800) != 0) // 802.11e d9
171 #define CAP_IS_IMMED_BA(x) (((x) & 0x1000) != 0) // 802.11e d9
172 #define CAP_IS_DSSS_OFDM(x) (((x) & 0x2000) != 0)
173 #define CAP_IS_DELAY_BA(x) (((x) & 0x4000) != 0) // 802.11e d9
175 #define CAP_GENERATE(ess,ibss,priv,s_pre,s_slot,spectrum) (((ess) ? 0x0001 : 0x0000) | ((ibss) ? 0x0002 : 0x0000) | ((priv) ? 0x0010 : 0x0000) | ((s_pre) ? 0x0020 : 0x0000) | ((s_slot) ? 0x0400 : 0x0000) | ((spectrum) ? 0x0100 : 0x0000))
177 //#define STA_QOS_CAPABILITY 0 // 1-byte. see 802.11e d9.0 for bit definition
179 #define ERP_IS_NON_ERP_PRESENT(x) (((x) & 0x01) != 0) // 802.11g
180 #define ERP_IS_USE_PROTECTION(x) (((x) & 0x02) != 0) // 802.11g
181 #define ERP_IS_USE_BARKER_PREAMBLE(x) (((x) & 0x04) != 0) // 802.11g
183 #define DRS_TX_QUALITY_WORST_BOUND 8// 3 // just test by gary
184 #define DRS_PENALTY 8
187 //BA Policy subfiled value in ADDBA frame
191 // BA Initiator subfield in DELBA frame
196 #define ADDBA_RESULTCODE_SUCCESS 0
197 #define ADDBA_RESULTCODE_REFUSED 37
198 #define ADDBA_RESULTCODE_INVALID_PARAMETERS 38
201 #define DELBA_REASONCODE_QSTA_LEAVING 36
202 #define DELBA_REASONCODE_END_BA 37
203 #define DELBA_REASONCODE_UNKNOWN_BA 38
204 #define DELBA_REASONCODE_TIMEOUT 39
206 // reset all OneSecTx counters
207 #define RESET_ONE_SEC_TX_CNT(__pEntry) \
208 if (((__pEntry)) != NULL) \
210 (__pEntry)->OneSecTxRetryOkCount = 0; \
211 (__pEntry)->OneSecTxFailCount = 0; \
212 (__pEntry)->OneSecTxNoRetryOkCount = 0; \
216 // 802.11 frame formats
218 // HT Capability INFO field in HT Cap IE .
219 typedef struct PACKED
{
221 USHORT LSIGTxopProSup
:1;
222 USHORT Forty_Mhz_Intolerant
:1;
224 USHORT CCKmodein40
:1;
226 USHORT DelayedBA
:1; //rt2860c not support
229 USHORT ShortGIfor40
:1; //for40MHz
230 USHORT ShortGIfor20
:1;
231 USHORT GF
:1; //green field
232 USHORT MimoPs
:2;//momi power safe
233 USHORT ChannelWidth
:1;
237 USHORT ChannelWidth
:1;
238 USHORT MimoPs
:2;//momi power safe
239 USHORT GF
:1; //green field
240 USHORT ShortGIfor20
:1;
241 USHORT ShortGIfor40
:1; //for40MHz
244 USHORT DelayedBA
:1; //rt2860c not support
245 USHORT AMsduSize
:1; // only support as zero
246 USHORT CCKmodein40
:1;
248 USHORT Forty_Mhz_Intolerant
:1;
249 USHORT LSIGTxopProSup
:1;
250 #endif /* !RT_BIG_ENDIAN */
251 } HT_CAP_INFO
, *PHT_CAP_INFO
;
253 // HT Capability INFO field in HT Cap IE .
254 typedef struct PACKED
{
256 UCHAR rsv
:3;//momi power safe
258 UCHAR MaxRAmpduFactor
:2;
260 UCHAR MaxRAmpduFactor
:2;
262 UCHAR rsv
:3;//momi power safe
263 #endif /* !RT_BIG_ENDIAN */
264 } HT_CAP_PARM
, *PHT_CAP_PARM
;
266 // HT Capability INFO field in HT Cap IE .
267 typedef struct PACKED
{
269 UCHAR SupRate
[2]; // unit : 1Mbps
274 UCHAR TxRxNotEqual
:1;
275 UCHAR TxMCSSetDefined
:1;
277 UCHAR TxMCSSetDefined
:1;
278 UCHAR TxRxNotEqual
:1;
282 #endif // RT_BIG_ENDIAN //
284 } HT_MCS_SET
, *PHT_MCS_SET
;
286 // HT Capability INFO field in HT Cap IE .
287 typedef struct PACKED
{
290 USHORT RDGSupport
:1; //reverse Direction Grant support
291 USHORT PlusHTC
:1; //+HTC control field support
292 USHORT MCSFeedback
:2; //0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback, 1:rsv.
293 USHORT rsv
:5;//momi power safe
299 USHORT rsv
:5;//momi power safe
300 USHORT MCSFeedback
:2; //0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback, 1:rsv.
301 USHORT PlusHTC
:1; //+HTC control field support
302 USHORT RDGSupport
:1; //reverse Direction Grant support
304 #endif /* RT_BIG_ENDIAN */
305 } EXT_HT_CAP_INFO
, *PEXT_HT_CAP_INFO
;
307 // HT Beamforming field in HT Cap IE .
308 typedef struct PACKED _HT_BF_CAP
{
311 ULONG ChanEstimation
:2;
313 ULONG ComSteerBFAntSup
:2;
314 ULONG NoComSteerBFAntSup
:2;
320 ULONG ExpComSteerCapable
:1;
321 ULONG ExpNoComSteerCapable
:1;
322 ULONG ExpCSICapable
:1;
324 ULONG ImpTxBFCapable
:1;
325 ULONG TxNDPCapable
:1;
326 ULONG RxNDPCapable
:1;
327 ULONG TxSoundCapable
:1;
328 ULONG RxSoundCapable
:1;
329 ULONG TxBFRecCapable
:1;
331 ULONG TxBFRecCapable
:1;
332 ULONG RxSoundCapable
:1;
333 ULONG TxSoundCapable
:1;
334 ULONG RxNDPCapable
:1;
335 ULONG TxNDPCapable
:1;
336 ULONG ImpTxBFCapable
:1;
338 ULONG ExpCSICapable
:1;
339 ULONG ExpNoComSteerCapable
:1;
340 ULONG ExpComSteerCapable
:1;
346 ULONG NoComSteerBFAntSup
:2;
347 ULONG ComSteerBFAntSup
:2;
349 ULONG ChanEstimation
:2;
351 #endif // RT_BIG_ENDIAN //
352 } HT_BF_CAP
, *PHT_BF_CAP
;
354 // HT antenna selection field in HT Cap IE .
355 typedef struct PACKED _HT_AS_CAP
{
362 UCHAR AntIndFbkTxASEL
:1;
363 UCHAR ExpCSIFbkTxASEL
:1;
367 UCHAR ExpCSIFbkTxASEL
:1;
368 UCHAR AntIndFbkTxASEL
:1;
374 #endif // RT_BIG_ENDIAN //
375 } HT_AS_CAP
, *PHT_AS_CAP
;
377 // Draft 1.0 set IE length 26, but is extensible..
378 #define SIZE_HT_CAP_IE 26
379 // The structure for HT Capability IE.
380 typedef struct PACKED _HT_CAPABILITY_IE
{
381 HT_CAP_INFO HtCapInfo
;
382 HT_CAP_PARM HtCapParm
;
383 // HT_MCS_SET HtMCSSet;
385 EXT_HT_CAP_INFO ExtHtCapInfo
;
386 HT_BF_CAP TxBFCap
; // beamforming cap. rt2860c not support beamforming.
387 HT_AS_CAP ASCap
; //antenna selection.
388 } HT_CAPABILITY_IE
, *PHT_CAPABILITY_IE
;
391 // 802.11n draft3 related structure definitions.
393 #define dot11OBSSScanPassiveDwell 20 // in TU. min amount of time that the STA continously scans each channel when performing an active OBSS scan.
394 #define dot11OBSSScanActiveDwell 10 // in TU.min amount of time that the STA continously scans each channel when performing an passive OBSS scan.
395 #define dot11BSSWidthTriggerScanInterval 300 // in sec. max interval between scan operations to be performed to detect BSS channel width trigger events.
396 #define dot11OBSSScanPassiveTotalPerChannel 200 // in TU. min total amount of time that the STA scans each channel when performing a passive OBSS scan.
397 #define dot11OBSSScanActiveTotalPerChannel 20 //in TU. min total amount of time that the STA scans each channel when performing a active OBSS scan
398 #define dot11BSSWidthChannelTransactionDelayFactor 5 // min ratio between the delay time in performing a switch from 20MHz BSS to 20/40 BSS operation and the maximum
399 // interval between overlapping BSS scan operations.
400 #define dot11BSSScanActivityThreshold 25 // in %%, max total time that a STA may be active on the medium during a period of
401 // (dot11BSSWidthChannelTransactionDelayFactor * dot11BSSWidthTriggerScanInterval) seconds without
402 // being obligated to perform OBSS Scan operations. default is 25(== 0.25%)
404 typedef struct PACKED _OVERLAP_BSS_SCAN_IE
{
405 USHORT ScanPassiveDwell
;
406 USHORT ScanActiveDwell
;
407 USHORT TriggerScanInt
; // Trigger scan interval
408 USHORT PassiveTalPerChannel
; // passive total per channel
409 USHORT ActiveTalPerChannel
; // active total per channel
410 USHORT DelayFactor
; // BSS width channel transition delay factor
411 USHORT ScanActThre
; // Scan Activity threshold
412 }OVERLAP_BSS_SCAN_IE
, *POVERLAP_BSS_SCAN_IE
;
415 // 7.3.2.56. 20/40 Coexistence element used in Element ID = 72 = IE_2040_BSS_COEXIST
416 typedef union PACKED _BSS_2040_COEXIST_IE
{
420 UCHAR BSS20WidthReq
:1;
421 UCHAR Intolerant40
:1;
425 UCHAR Intolerant40
:1; // Inter-BSS. set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS.
426 UCHAR BSS20WidthReq
:1; // Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS.
428 #endif // RT_BIG_ENDIAN //
431 } BSS_2040_COEXIST_IE
, *PBSS_2040_COEXIST_IE
;
434 typedef struct _TRIGGER_EVENTA
{
437 UCHAR RegClass
; // Regulatory Class
439 ULONG CDCounter
; // Maintain a seperate count down counter for each Event A.
440 } TRIGGER_EVENTA
, *PTRIGGER_EVENTA
;
442 // 20/40 trigger event table
443 // If one Event A delete or created, or if Event B is detected or not detected, STA should send 2040BSSCoexistence to AP.
444 #define MAX_TRIGGER_EVENT 64
445 typedef struct _TRIGGER_EVENT_TAB
{
447 TRIGGER_EVENTA EventA
[MAX_TRIGGER_EVENT
];
448 ULONG EventBCountDown
; // Count down counter for Event B.
449 } TRIGGER_EVENT_TAB
, *PTRIGGER_EVENT_TAB
;
451 // 7.3.27 20/40 Bss Coexistence Mgmt capability used in extended capabilities information IE( ID = 127 = IE_EXT_CAPABILITY).
452 // This is the first octet and was defined in 802.11n D3.03 and 802.11yD9.0
453 typedef struct PACKED _EXT_CAP_INFO_ELEMENT
{
456 UCHAR ExtendChannelSwitch
:1;
458 UCHAR BssCoexistMgmtSupport
:1;
460 UCHAR BssCoexistMgmtSupport
:1;
462 UCHAR ExtendChannelSwitch
:1;
464 #endif // RT_BIG_ENDIAN //
465 }EXT_CAP_INFO_ELEMENT
, *PEXT_CAP_INFO_ELEMENT
;
469 typedef struct PACKED _BSS_2040_COEXIST_ELEMENT
{
470 UCHAR ElementID
; // ID = IE_2040_BSS_COEXIST = 72
472 BSS_2040_COEXIST_IE BssCoexistIe
;
473 }BSS_2040_COEXIST_ELEMENT
, *PBSS_2040_COEXIST_ELEMENT
;
477 typedef struct PACKED _BSS_2040_INTOLERANT_CH_REPORT
{
478 UCHAR ElementID
; // ID = IE_2040_BSS_INTOLERANT_REPORT = 73
480 UCHAR RegulatoryClass
;
482 }BSS_2040_INTOLERANT_CH_REPORT
, *PBSS_2040_INTOLERANT_CH_REPORT
;
485 // The structure for channel switch annoucement IE. This is in 802.11n D3.03
486 typedef struct PACKED _CHA_SWITCH_ANNOUNCE_IE
{
487 UCHAR SwitchMode
; //channel switch mode
489 UCHAR SwitchCount
; //
490 } CHA_SWITCH_ANNOUNCE_IE
, *PCHA_SWITCH_ANNOUNCE_IE
;
493 // The structure for channel switch annoucement IE. This is in 802.11n D3.03
494 typedef struct PACKED _SEC_CHA_OFFSET_IE
{
495 UCHAR SecondaryChannelOffset
; // 1: Secondary above, 3: Secondary below, 0: no Secondary
496 } SEC_CHA_OFFSET_IE
, *PSEC_CHA_OFFSET_IE
;
499 // This structure is extracted from struct RT_HT_CAPABILITY
501 BOOLEAN bHtEnable
; // If we should use ht rate.
502 BOOLEAN bPreNHt
; // If we should use ht rate.
503 //Substract from HT Capability IE
505 } RT_HT_PHY_INFO
, *PRT_HT_PHY_INFO
;
507 //This structure substracts ralink supports from all 802.11n-related features.
508 //Features not listed here but contained in 802.11n spec are not supported in rt2860.
512 USHORT AmsduSize
:1; // Max receiving A-MSDU size
513 USHORT AmsduEnable
:1; // Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n
514 USHORT RxSTBC
:2; // 2 bits
516 USHORT ShortGIfor40
:1; //for40MHz
517 USHORT ShortGIfor20
:1;
518 USHORT GF
:1; //green field
519 USHORT MimoPs
:2;//mimo power safe MMPS_
520 USHORT ChannelWidth
:1;
522 USHORT ChannelWidth
:1;
523 USHORT MimoPs
:2;//mimo power safe MMPS_
524 USHORT GF
:1; //green field
525 USHORT ShortGIfor20
:1;
526 USHORT ShortGIfor40
:1; //for40MHz
528 USHORT RxSTBC
:2; // 2 bits
529 USHORT AmsduEnable
:1; // Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n
530 USHORT AmsduSize
:1; // Max receiving A-MSDU size
534 //Substract from Addiont HT INFO IE
537 UCHAR ExtChanOffset
:2; // Please not the difference with following UCHAR NewExtChannelOffset; from 802.11n
539 UCHAR MaxRAmpduFactor
:2;
541 UCHAR MaxRAmpduFactor
:2;
543 UCHAR ExtChanOffset
:2; // Please not the difference with following UCHAR NewExtChannelOffset; from 802.11n
549 USHORT OBSS_NonHTExist
:1;
551 USHORT NonGfPresent
:1;
552 USHORT OperaionMode
:2;
554 USHORT OperaionMode
:2;
555 USHORT NonGfPresent
:1;
557 USHORT OBSS_NonHTExist
:1;
561 // New Extension Channel Offset IE
562 UCHAR NewExtChannelOffset
;
563 // Extension Capability IE = 127
564 UCHAR BSSCoexist2040
;
565 } RT_HT_CAPABILITY
, *PRT_HT_CAPABILITY
;
567 // field in Addtional HT Information IE .
568 typedef struct PACKED
{
570 UCHAR SerInterGranu
:3;
574 UCHAR ExtChanOffset
:2;
576 UCHAR ExtChanOffset
:2;
579 UCHAR S_PSMPSup
:1; //Indicate support for scheduled PSMP
580 UCHAR SerInterGranu
:3; //service interval granularity
582 } ADD_HTINFO
, *PADD_HTINFO
;
584 typedef struct PACKED
{
587 USHORT OBSS_NonHTExist
:1;
589 USHORT NonGfPresent
:1;
590 USHORT OperaionMode
:2;
592 USHORT OperaionMode
:2;
593 USHORT NonGfPresent
:1;
595 USHORT OBSS_NonHTExist
:1;
598 } ADD_HTINFO2
, *PADD_HTINFO2
;
601 // TODO: Need sync with spec about the definition of StbcMcs. In Draft 3.03, it's reserved.
602 typedef struct PACKED
{
607 USHORT LsigTxopProt
:1;
609 USHORT DualCTSProtect
:1;
615 USHORT DualCTSProtect
:1;
617 USHORT LsigTxopProt
:1; // L-SIG TXOP protection full support
621 #endif // RT_BIG_ENDIAN //
622 } ADD_HTINFO3
, *PADD_HTINFO3
;
624 #define SIZE_ADD_HT_INFO_IE 22
625 typedef struct PACKED
{
627 ADD_HTINFO AddHtInfo
;
628 ADD_HTINFO2 AddHtInfo2
;
629 ADD_HTINFO3 AddHtInfo3
;
630 UCHAR MCSSet
[16]; // Basic MCS set
631 } ADD_HT_INFO_IE
, *PADD_HT_INFO_IE
;
633 typedef struct PACKED
{
634 UCHAR NewExtChanOffset
;
635 } NEW_EXT_CHAN_IE
, *PNEW_EXT_CHAN_IE
;
637 typedef struct PACKED _FRAME_802_11
{
640 } FRAME_802_11
, *PFRAME_802_11
;
642 // QoSNull embedding of management action. When HT Control MA field set to 1.
643 typedef struct PACKED _MA_BODY
{
647 } MA_BODY
, *PMA_BODY
;
649 typedef struct PACKED _HEADER_802_3
{
650 UCHAR DAAddr1
[MAC_ADDR_LEN
];
651 UCHAR SAAddr2
[MAC_ADDR_LEN
];
653 } HEADER_802_3
, *PHEADER_802_3
;
654 ////Block ACK related format
655 // 2-byte BA Parameter field in DELBA frames to terminate an already set up bA
656 typedef struct PACKED
{
658 USHORT TID
:4; // value of TC os TS
659 USHORT Initiator
:1; // 1: originator 0:recipient
660 USHORT Rsv
:11; // always set to 0
662 USHORT Rsv
:11; // always set to 0
663 USHORT Initiator
:1; // 1: originator 0:recipient
664 USHORT TID
:4; // value of TC os TS
665 #endif /* !RT_BIG_ENDIAN */
666 } DELBA_PARM
, *PDELBA_PARM
;
668 // 2-byte BA Parameter Set field in ADDBA frames to signal parm for setting up a BA
669 typedef struct PACKED
{
671 USHORT BufSize
:10; // number of buffe of size 2304 octetsr
672 USHORT TID
:4; // value of TC os TS
673 USHORT BAPolicy
:1; // 1: immediately BA 0:delayed BA
674 USHORT AMSDUSupported
:1; // 0: not permitted 1: permitted
676 USHORT AMSDUSupported
:1; // 0: not permitted 1: permitted
677 USHORT BAPolicy
:1; // 1: immediately BA 0:delayed BA
678 USHORT TID
:4; // value of TC os TS
679 USHORT BufSize
:10; // number of buffe of size 2304 octetsr
680 #endif /* !RT_BIG_ENDIAN */
681 } BA_PARM
, *PBA_PARM
;
683 // 2-byte BA Starting Seq CONTROL field
684 typedef union PACKED
{
687 USHORT StartSeq
:12; // sequence number of the 1st MSDU for which this BAR is sent
688 USHORT FragNum
:4; // always set to 0
690 USHORT FragNum
:4; // always set to 0
691 USHORT StartSeq
:12; // sequence number of the 1st MSDU for which this BAR is sent
692 #endif /* RT_BIG_ENDIAN */
695 } BASEQ_CONTROL
, *PBASEQ_CONTROL
;
697 //BAControl and BARControl are the same
698 // 2-byte BA CONTROL field in BA frame
699 typedef struct PACKED
{
704 USHORT MTID
:1; //EWC V1.24
705 USHORT ACKPolicy
:1; // only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK 1:No ACK
707 USHORT ACKPolicy
:1; // only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK 1:No ACK
708 USHORT MTID
:1; //EWC V1.24
712 #endif /* !RT_BIG_ENDIAN */
713 } BA_CONTROL
, *PBA_CONTROL
;
715 // 2-byte BAR CONTROL field in BAR frame
716 typedef struct PACKED
{
721 USHORT MTID
:1; //if this bit1, use FRAME_MTBA_REQ, if 0, use FRAME_BA_REQ
724 USHORT ACKPolicy
:1; // 0:normal ack, 1:no ack.
725 USHORT MTID
:1; //if this bit1, use FRAME_MTBA_REQ, if 0, use FRAME_BA_REQ
729 #endif /* !RT_BIG_ENDIAN */
730 } BAR_CONTROL
, *PBAR_CONTROL
;
732 // BARControl in MTBAR frame
733 typedef struct PACKED
{
746 #endif /* !RT_BIG_ENDIAN */
747 } MTBAR_CONTROL
, *PMTBAR_CONTROL
;
749 typedef struct PACKED
{
756 #endif /* !RT_BIG_ENDIAN */
757 } PER_TID_INFO
, *PPER_TID_INFO
;
761 BASEQ_CONTROL BAStartingSeq
;
762 } EACH_TID
, *PEACH_TID
;
765 // BAREQ AND MTBAREQ have the same subtype BAR, 802.11n BAR use compressed bitmap.
766 typedef struct PACKED _FRAME_BA_REQ
{
769 UCHAR Addr1
[MAC_ADDR_LEN
];
770 UCHAR Addr2
[MAC_ADDR_LEN
];
771 BAR_CONTROL BARControl
;
772 BASEQ_CONTROL BAStartingSeq
;
773 } FRAME_BA_REQ
, *PFRAME_BA_REQ
;
775 typedef struct PACKED _FRAME_MTBA_REQ
{
778 UCHAR Addr1
[MAC_ADDR_LEN
];
779 UCHAR Addr2
[MAC_ADDR_LEN
];
780 MTBAR_CONTROL MTBARControl
;
781 PER_TID_INFO PerTIDInfo
;
782 BASEQ_CONTROL BAStartingSeq
;
783 } FRAME_MTBA_REQ
, *PFRAME_MTBA_REQ
;
785 // Compressed format is mandantory in HT STA
786 typedef struct PACKED _FRAME_MTBA
{
789 UCHAR Addr1
[MAC_ADDR_LEN
];
790 UCHAR Addr2
[MAC_ADDR_LEN
];
791 BA_CONTROL BAControl
;
792 BASEQ_CONTROL BAStartingSeq
;
794 } FRAME_MTBA
, *PFRAME_MTBA
;
796 typedef struct PACKED _FRAME_PSMP_ACTION
{
800 UCHAR Psmp
; // 7.3.1.25
801 } FRAME_PSMP_ACTION
, *PFRAME_PSMP_ACTION
;
803 typedef struct PACKED _FRAME_ACTION_HDR
{
807 } FRAME_ACTION_HDR
, *PFRAME_ACTION_HDR
;
810 //Action Frame Category:Spectrum, Action:Channel Switch. 7.3.2.20
811 typedef struct PACKED _CHAN_SWITCH_ANNOUNCE
{
812 UCHAR ElementID
; // ID = IE_CHANNEL_SWITCH_ANNOUNCEMENT = 37
814 CHA_SWITCH_ANNOUNCE_IE CSAnnounceIe
;
815 } CHAN_SWITCH_ANNOUNCE
, *PCHAN_SWITCH_ANNOUNCE
;
818 //802.11n : 7.3.2.20a
819 typedef struct PACKED _SECOND_CHAN_OFFSET
{
820 UCHAR ElementID
; // ID = IE_SECONDARY_CH_OFFSET = 62
822 SEC_CHA_OFFSET_IE SecChOffsetIe
;
823 } SECOND_CHAN_OFFSET
, *PSECOND_CHAN_OFFSET
;
826 typedef struct PACKED _FRAME_SPETRUM_CS
{
830 CHAN_SWITCH_ANNOUNCE CSAnnounce
;
831 SECOND_CHAN_OFFSET SecondChannel
;
832 } FRAME_SPETRUM_CS
, *PFRAME_SPETRUM_CS
;
835 typedef struct PACKED _FRAME_ADDBA_REQ
{
840 BA_PARM BaParm
; // 2 - 10
841 USHORT TimeOutValue
; // 0 - 0
842 BASEQ_CONTROL BaStartSeq
; // 0-0
843 } FRAME_ADDBA_REQ
, *PFRAME_ADDBA_REQ
;
845 typedef struct PACKED _FRAME_ADDBA_RSP
{
851 BA_PARM BaParm
; //0 - 2
853 } FRAME_ADDBA_RSP
, *PFRAME_ADDBA_RSP
;
855 typedef struct PACKED _FRAME_DELBA_REQ
{
859 DELBA_PARM DelbaParm
;
861 } FRAME_DELBA_REQ
, *PFRAME_DELBA_REQ
;
865 typedef struct PACKED _FRAME_BAR
{
868 UCHAR Addr1
[MAC_ADDR_LEN
];
869 UCHAR Addr2
[MAC_ADDR_LEN
];
870 BAR_CONTROL BarControl
;
871 BASEQ_CONTROL StartingSeq
;
872 } FRAME_BAR
, *PFRAME_BAR
;
875 typedef struct PACKED _FRAME_BA
{
878 UCHAR Addr1
[MAC_ADDR_LEN
];
879 UCHAR Addr2
[MAC_ADDR_LEN
];
880 BAR_CONTROL BarControl
;
881 BASEQ_CONTROL StartingSeq
;
883 } FRAME_BA
, *PFRAME_BA
;
886 // Radio Measuement Request Frame Format
887 typedef struct PACKED _FRAME_RM_REQ_ACTION
{
894 } FRAME_RM_REQ_ACTION
, *PFRAME_RM_REQ_ACTION
;
896 typedef struct PACKED
{
899 UCHAR ChannelSwitchMode
;
902 UCHAR ChannelSwitchCount
;
903 } HT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE
, *PHT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE
;
907 // _Limit must be the 2**n - 1
908 // _SEQ1 , _SEQ2 must be within 0 ~ _Limit
910 #define SEQ_STEPONE(_SEQ1, _SEQ2, _Limit) ((_SEQ1 == ((_SEQ2+1) & _Limit)))
911 #define SEQ_SMALLER(_SEQ1, _SEQ2, _Limit) (((_SEQ1-_SEQ2) & ((_Limit+1)>>1)))
912 #define SEQ_LARGER(_SEQ1, _SEQ2, _Limit) ((_SEQ1 != _SEQ2) && !(((_SEQ1-_SEQ2) & ((_Limit+1)>>1))))
913 #define SEQ_WITHIN_WIN(_SEQ1, _SEQ2, _WIN, _Limit) (SEQ_LARGER(_SEQ1, _SEQ2, _Limit) && \
914 SEQ_SMALLER(_SEQ1, ((_SEQ2+_WIN+1)&_Limit), _Limit))
917 // Contention-free parameter (without ID and Length)
919 typedef struct PACKED
{
920 BOOLEAN bValid
; // 1: variable contains valid value
923 USHORT CfpMaxDuration
;
924 USHORT CfpDurRemaining
;
925 } CF_PARM
, *PCF_PARM
;
927 typedef struct _CIPHER_SUITE
{
928 NDIS_802_11_ENCRYPTION_STATUS PairCipher
; // Unicast cipher 1, this one has more secured cipher suite
929 NDIS_802_11_ENCRYPTION_STATUS PairCipherAux
; // Unicast cipher 2 if AP announce two unicast cipher suite
930 NDIS_802_11_ENCRYPTION_STATUS GroupCipher
; // Group cipher
931 USHORT RsnCapability
; // RSN capability from beacon
932 BOOLEAN bMixMode
; // Indicate Pair & Group cipher might be different
933 } CIPHER_SUITE
, *PCIPHER_SUITE
;
935 // EDCA configuration from AP's BEACON/ProbeRsp
937 BOOLEAN bValid
; // 1: variable contains valid value
938 BOOLEAN bAdd
; // 1: variable contains valid value
940 BOOLEAN bQueueRequest
;
941 BOOLEAN bTxopRequest
;
942 BOOLEAN bAPSDCapable
;
943 // BOOLEAN bMoreDataAck;
944 UCHAR EdcaUpdateCount
;
945 UCHAR Aifsn
[4]; // 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO
948 USHORT Txop
[4]; // in unit of 32-us
949 BOOLEAN bACM
[4]; // 1: Admission Control of AC_BK is mandattory
950 } EDCA_PARM
, *PEDCA_PARM
;
952 // QBSS LOAD information from QAP's BEACON/ProbeRsp
954 BOOLEAN bValid
; // 1: variable contains valid value
956 UCHAR ChannelUtilization
;
957 USHORT RemainingAdmissionControl
; // in unit of 32-us
958 } QBSS_LOAD_PARM
, *PQBSS_LOAD_PARM
;
960 // QBSS Info field in QSTA's assoc req
961 typedef struct PACKED
{
978 #endif /* !RT_BIG_ENDIAN */
979 } QBSS_STA_INFO_PARM
, *PQBSS_STA_INFO_PARM
;
981 // QBSS Info field in QAP's Beacon/ProbeRsp
982 typedef struct PACKED
{
986 UCHAR ParamSetCount
:4;
988 UCHAR ParamSetCount
:4;
991 #endif /* !RT_BIG_ENDIAN */
992 } QBSS_AP_INFO_PARM
, *PQBSS_AP_INFO_PARM
;
994 // QOS Capability reported in QAP's BEACON/ProbeRsp
995 // QOS Capability sent out in QSTA's AssociateReq/ReAssociateReq
997 BOOLEAN bValid
; // 1: variable contains valid value
999 BOOLEAN bQueueRequest
;
1000 BOOLEAN bTxopRequest
;
1001 // BOOLEAN bMoreDataAck;
1002 UCHAR EdcaUpdateCount
;
1003 } QOS_CAPABILITY_PARM
, *PQOS_CAPABILITY_PARM
;
1005 #ifdef CONFIG_STA_SUPPORT
1008 UCHAR IE
[MAX_CUSTOM_LEN
];
1010 #endif // CONFIG_STA_SUPPORT //
1014 UCHAR Bssid
[MAC_ADDR_LEN
];
1016 UCHAR CentralChannel
; //Store the wide-band central channel for 40MHz. .used in 40MHz AP. Or this is the same as Channel.
1019 USHORT BeaconPeriod
;
1021 UCHAR SupRate
[MAX_LEN_OF_SUPPORTED_RATES
];
1023 UCHAR ExtRate
[MAX_LEN_OF_SUPPORTED_RATES
];
1025 HT_CAPABILITY_IE HtCapability
;
1026 UCHAR HtCapabilityLen
;
1027 ADD_HT_INFO_IE AddHtInfo
; // AP might use this additional ht info IE
1029 UCHAR NewExtChanOffset
;
1031 UCHAR Privacy
; // Indicate security function ON/OFF. Don't mess up with auth mode.
1035 USHORT CapabilityInfo
;
1039 USHORT CfpMaxDuration
;
1040 USHORT CfpDurRemaining
;
1042 CHAR Ssid
[MAX_LEN_OF_SSID
];
1044 ULONG LastBeaconRxTime
; // OS's timestamp
1049 CIPHER_SUITE WPA
; // AP announced WPA cipher suite
1050 CIPHER_SUITE WPA2
; // AP announced WPA2 cipher suite
1052 // New for microsoft WPA support
1053 NDIS_802_11_FIXED_IEs FixIEs
;
1054 NDIS_802_11_AUTHENTICATION_MODE AuthModeAux
; // Addition mode for WPA2 / WPA capable AP
1055 NDIS_802_11_AUTHENTICATION_MODE AuthMode
;
1056 NDIS_802_11_WEP_STATUS WepStatus
; // Unicast Encryption Algorithm extract from VAR_IE
1057 USHORT VarIELen
; // Length of next VIE include EID & Length
1058 UCHAR VarIEs
[MAX_VIE_LEN
];
1060 // CCX Ckip information
1064 UCHAR PTSF
[4]; // Parent TSF
1065 UCHAR TTSF
[8]; // Target TSF
1067 // 802.11e d9, and WMM
1069 QOS_CAPABILITY_PARM QosCapability
;
1070 QBSS_LOAD_PARM QbssLoad
;
1071 #ifdef CONFIG_STA_SUPPORT
1074 #ifdef EXT_BUILD_CHANNEL_LIST
1075 UCHAR CountryString
[3];
1076 BOOLEAN bHasCountryIE
;
1077 #endif // EXT_BUILD_CHANNEL_LIST //
1078 #endif // CONFIG_STA_SUPPORT //
1080 } BSS_ENTRY
, *PBSS_ENTRY
;
1085 BSS_ENTRY BssEntry
[MAX_LEN_OF_BSS_TABLE
];
1086 } BSS_TABLE
, *PBSS_TABLE
;
1089 typedef struct _MLME_QUEUE_ELEM
{
1093 UCHAR Msg
[MGMT_DMA_BUFFER_SIZE
];
1094 LARGE_INTEGER TimeStamp
;
1104 #endif // MLME_EX //
1105 } MLME_QUEUE_ELEM
, *PMLME_QUEUE_ELEM
;
1107 typedef struct _MLME_QUEUE
{
1111 NDIS_SPIN_LOCK Lock
;
1112 MLME_QUEUE_ELEM Entry
[MAX_LEN_OF_MLME_QUEUE
];
1113 } MLME_QUEUE
, *PMLME_QUEUE
;
1115 typedef VOID (*STATE_MACHINE_FUNC
)(VOID
*Adaptor
, MLME_QUEUE_ELEM
*Elem
);
1117 typedef struct _STATE_MACHINE
{
1122 STATE_MACHINE_FUNC
*TransFunc
;
1123 } STATE_MACHINE
, *PSTATE_MACHINE
;
1126 // MLME AUX data structure that hold temporarliy settings during a connection attempt.
1127 // Once this attemp succeeds, all settings will be copy to pAd->StaActive.
1128 // A connection attempt (user set OID, roaming, CCX fast roaming,..) consists of
1129 // several steps (JOIN, AUTH, ASSOC or REASSOC) and may fail at any step. We purposely
1130 // separate this under-trial settings away from pAd->StaActive so that once
1131 // this new attempt failed, driver can auto-recover back to the active settings.
1132 typedef struct _MLME_AUX
{
1134 UCHAR Ssid
[MAX_LEN_OF_SSID
];
1136 UCHAR Bssid
[MAC_ADDR_LEN
];
1137 UCHAR AutoReconnectSsid
[MAX_LEN_OF_SSID
];
1138 UCHAR AutoReconnectSsidLen
;
1142 UCHAR CentralChannel
;
1144 USHORT CapabilityInfo
;
1145 USHORT BeaconPeriod
;
1146 USHORT CfpMaxDuration
;
1150 // Copy supported rate from desired AP's beacon. We are trying to match
1151 // AP's supported and extended rate settings.
1152 UCHAR SupRate
[MAX_LEN_OF_SUPPORTED_RATES
];
1153 UCHAR ExtRate
[MAX_LEN_OF_SUPPORTED_RATES
];
1156 HT_CAPABILITY_IE HtCapability
;
1157 UCHAR HtCapabilityLen
;
1158 ADD_HT_INFO_IE AddHtInfo
; // AP might use this additional ht info IE
1159 UCHAR NewExtChannelOffset
;
1160 //RT_HT_CAPABILITY SupportedHtPhy;
1163 QOS_CAPABILITY_PARM APQosCapability
; // QOS capability of the current associated AP
1164 EDCA_PARM APEdcaParm
; // EDCA parameters of the current associated AP
1165 QBSS_LOAD_PARM APQbssLoad
; // QBSS load of the current associated AP
1167 // new to keep Ralink specific feature
1170 BSS_TABLE SsidBssTab
; // AP list for the same SSID
1171 BSS_TABLE RoamTab
; // AP list eligible for roaming
1175 BOOLEAN CurrReqIsFromNdis
;
1177 RALINK_TIMER_STRUCT BeaconTimer
, ScanTimer
;
1178 RALINK_TIMER_STRUCT AuthTimer
;
1179 RALINK_TIMER_STRUCT AssocTimer
, ReassocTimer
, DisassocTimer
;
1181 #ifdef CONFIG_STA_SUPPORT
1182 #endif // CONFIG_STA_SUPPORT //
1183 } MLME_AUX
, *PMLME_AUX
;
1185 typedef struct _MLME_ADDBA_REQ_STRUCT
{
1187 UCHAR pAddr
[MAC_ADDR_LEN
];
1189 USHORT TimeOutValue
;
1193 } MLME_ADDBA_REQ_STRUCT
, *PMLME_ADDBA_REQ_STRUCT
;
1196 typedef struct _MLME_DELBA_REQ_STRUCT
{
1198 UCHAR Addr
[MAC_ADDR_LEN
];
1201 } MLME_DELBA_REQ_STRUCT
, *PMLME_DELBA_REQ_STRUCT
;
1203 // assoc struct is equal to reassoc
1204 typedef struct _MLME_ASSOC_REQ_STRUCT
{
1205 UCHAR Addr
[MAC_ADDR_LEN
];
1206 USHORT CapabilityInfo
;
1209 } MLME_ASSOC_REQ_STRUCT
, *PMLME_ASSOC_REQ_STRUCT
, MLME_REASSOC_REQ_STRUCT
, *PMLME_REASSOC_REQ_STRUCT
;
1211 typedef struct _MLME_DISASSOC_REQ_STRUCT
{
1212 UCHAR Addr
[MAC_ADDR_LEN
];
1214 } MLME_DISASSOC_REQ_STRUCT
, *PMLME_DISASSOC_REQ_STRUCT
;
1216 typedef struct _MLME_AUTH_REQ_STRUCT
{
1217 UCHAR Addr
[MAC_ADDR_LEN
];
1220 } MLME_AUTH_REQ_STRUCT
, *PMLME_AUTH_REQ_STRUCT
;
1222 typedef struct _MLME_DEAUTH_REQ_STRUCT
{
1223 UCHAR Addr
[MAC_ADDR_LEN
];
1225 } MLME_DEAUTH_REQ_STRUCT
, *PMLME_DEAUTH_REQ_STRUCT
;
1229 } MLME_JOIN_REQ_STRUCT
;
1231 typedef struct _MLME_SCAN_REQ_STRUCT
{
1232 UCHAR Bssid
[MAC_ADDR_LEN
];
1236 CHAR Ssid
[MAX_LEN_OF_SSID
];
1237 } MLME_SCAN_REQ_STRUCT
, *PMLME_SCAN_REQ_STRUCT
;
1239 typedef struct _MLME_START_REQ_STRUCT
{
1240 CHAR Ssid
[MAX_LEN_OF_SSID
];
1242 } MLME_START_REQ_STRUCT
, *PMLME_START_REQ_STRUCT
;
1244 #ifdef CONFIG_STA_SUPPORT
1245 #ifdef QOS_DLS_SUPPORT
1246 // structure for DLS
1247 typedef struct _RT_802_11_DLS
{
1248 USHORT TimeOut
; // Use to time out while slience, unit: second , set by UI
1249 USHORT CountDownTimer
; // Use to time out while slience,unit: second , used by driver only
1250 NDIS_802_11_MAC_ADDRESS MacAddr
; // set by UI
1251 UCHAR Status
; // 0: none , 1: wait STAkey, 2: finish DLS setup , set by driver only
1252 BOOLEAN Valid
; // 1: valid , 0: invalid , set by UI, use to setup or tear down DLS link
1253 RALINK_TIMER_STRUCT Timer
; // Use to time out while handshake
1255 USHORT MacTabMatchWCID
; // ASIC
1258 } RT_802_11_DLS
, *PRT_802_11_DLS
;
1260 typedef struct _MLME_DLS_REQ_STRUCT
{
1261 PRT_802_11_DLS pDLS
;
1263 } MLME_DLS_REQ_STRUCT
, *PMLME_DLS_REQ_STRUCT
;
1264 #endif // QOS_DLS_SUPPORT //
1265 #endif // CONFIG_STA_SUPPORT //
1267 typedef struct PACKED
{
1271 } EID_STRUCT
,*PEID_STRUCT
, BEACON_EID_STRUCT
, *PBEACON_EID_STRUCT
;
1273 typedef struct PACKED _RTMP_TX_RATE_SWITCH
1276 #ifdef RT_BIG_ENDIAN
1294 } RRTMP_TX_RATE_SWITCH
, *PRTMP_TX_RATE_SWITCH
;
1296 // ========================== AP mlme.h ===============================
1297 #define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps
1298 #define DEFAULT_DTIM_PERIOD 1
1300 // weighting factor to calculate Channel quality, total should be 100%
1301 //#define RSSI_WEIGHTING 0
1302 //#define TX_WEIGHTING 40
1303 //#define RX_WEIGHTING 60
1305 #define MAC_TABLE_AGEOUT_TIME 300 // unit: sec
1306 #define MAC_TABLE_ASSOC_TIMEOUT 5 // unit: sec
1307 #define MAC_TABLE_FULL(Tab) ((Tab).size == MAX_LEN_OF_MAC_TABLE)
1309 // AP shall drop the sta if contine Tx fail count reach it.
1310 #define MAC_ENTRY_LIFE_CHECK_CNT 20 // packet cnt.
1312 // Value domain of pMacEntry->Sst
1314 SST_NOT_AUTH
, // 0: equivalent to IEEE 802.11/1999 state 1
1315 SST_AUTH
, // 1: equivalent to IEEE 802.11/1999 state 2
1316 SST_ASSOC
// 2: equivalent to IEEE 802.11/1999 state 3
1319 // value domain of pMacEntry->AuthState
1320 typedef enum _AuthState
{
1322 AS_AUTH_OPEN
, // STA has been authenticated using OPEN SYSTEM
1323 AS_AUTH_KEY
, // STA has been authenticated using SHARED KEY
1324 AS_AUTHENTICATING
// STA is waiting for AUTH seq#3 using SHARED KEY
1327 //for-wpa value domain of pMacEntry->WpaState 802.1i D3 p.114
1328 typedef enum _ApWpaState
{
1331 AS_DISCONNECTED
, // 2
1333 AS_AUTHENTICATION
, // 4
1334 AS_AUTHENTICATION2
, // 5
1338 AS_PTKINIT_NEGOTIATING
, // 9
1339 AS_PTKINITDONE
, // 10
1340 AS_UPDATEKEYS
, // 11
1341 AS_INTEGRITY_FAILURE
, // 12
1345 // for-wpa value domain of pMacEntry->WpaState 802.1i D3 p.114
1346 typedef enum _GTKState
{
1352 // for-wpa value domain of pMacEntry->WpaState 802.1i D3 p.114
1353 typedef enum _WpaGTKState
{
1357 // ====================== end of AP mlme.h ============================