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 Paul Lin 08-01-2002 created
37 James Tan 09-06-2002 modified (Revise NTCRegTable)
38 John Chang 12-22-2004 modified for RT2561/2661. merge with STA driver
45 // ========================= AP RTMP.h ================================
49 // =============================================================
50 // Function Prototypes
51 // =============================================================
55 BOOLEAN
APBridgeToWirelessSta(
63 BOOLEAN
APHandleRxDoneInterrupt(
64 IN PRTMP_ADAPTER pAd
);
67 IN NDIS_HANDLE MiniportAdapterContext
,
68 IN PPNDIS_PACKET ppPacketArray
,
69 IN UINT NumberOfPackets
);
71 NDIS_STATUS
APSendPacket(
73 IN PNDIS_PACKET pPacket
);
76 NDIS_STATUS
APHardTransmit(
81 VOID
APRxEAPOLFrameIndicate(
83 IN MAC_TABLE_ENTRY
*pEntry
,
85 IN UCHAR FromWhichBSSID
);
87 NDIS_STATUS
APCheckRxError(
89 IN PRT28XX_RXD_STRUC pRxD
,
92 BOOLEAN
APCheckClass2Class3Error(
95 IN PHEADER_802_11 pHeader
);
97 VOID
APHandleRxPsPoll(
101 IN BOOLEAN isActive
);
103 VOID
RTMPDescriptorEndianChange(
105 IN ULONG DescriptorType
);
107 VOID
RTMPFrameEndianChange(
108 IN PRTMP_ADAPTER pAd
,
111 IN BOOLEAN FromRxDoneInt
);
115 VOID
APAssocStateMachineInit(
116 IN PRTMP_ADAPTER pAd
,
118 OUT STATE_MACHINE_FUNC Trans
[]);
120 VOID
APPeerAssocReqAction(
121 IN PRTMP_ADAPTER pAd
,
122 IN MLME_QUEUE_ELEM
*Elem
);
124 VOID
APPeerReassocReqAction(
125 IN PRTMP_ADAPTER pAd
,
126 IN MLME_QUEUE_ELEM
*Elem
);
128 VOID
APPeerDisassocReqAction(
129 IN PRTMP_ADAPTER pAd
,
130 IN MLME_QUEUE_ELEM
*Elem
);
132 VOID
MbssKickOutStas(
133 IN PRTMP_ADAPTER pAd
,
137 VOID
APMlmeKickOutSta(
138 IN PRTMP_ADAPTER pAd
,
143 VOID
APMlmeDisassocReqAction(
144 IN PRTMP_ADAPTER pAd
,
145 IN MLME_QUEUE_ELEM
*Elem
);
147 VOID
APCls3errAction(
148 IN PRTMP_ADAPTER pAd
,
150 IN PHEADER_802_11 pHeader
);
153 USHORT
APBuildAssociation(
154 IN PRTMP_ADAPTER pAd
,
155 IN MAC_TABLE_ENTRY
*pEntry
,
156 IN USHORT CapabilityInfo
,
157 IN UCHAR MaxSupportedRateIn500Kbps
,
160 IN BOOLEAN bWmmCapable
,
163 IN EXT_CAP_INFO_ELEMENT ExtCapInfo
,
164 #endif // DOT11N_DRAFT3 //
165 IN HT_CAPABILITY_IE
*pHtCapability
,
166 IN UCHAR HtCapabilityLen
,
170 VOID RTMPAddClientSec(
171 IN PRTMP_ADAPTER pAd,
178 IN MAC_TABLE_ENTRY *pEntry);
183 void APAuthStateMachineInit(
184 IN PRTMP_ADAPTER pAd
,
185 IN STATE_MACHINE
*Sm
,
186 OUT STATE_MACHINE_FUNC Trans
[]);
188 VOID
APMlmeDeauthReqAction(
189 IN PRTMP_ADAPTER pAd
,
190 IN MLME_QUEUE_ELEM
*Elem
);
192 VOID
APCls2errAction(
193 IN PRTMP_ADAPTER pAd
,
195 IN PHEADER_802_11 pHeader
);
199 VOID
APAuthRspStateMachineInit(
200 IN PRTMP_ADAPTER pAd
,
201 IN PSTATE_MACHINE Sm
,
202 IN STATE_MACHINE_FUNC Trans
[]);
204 VOID
APPeerAuthAtAuthRspIdleAction(
205 IN PRTMP_ADAPTER pAd
,
206 IN MLME_QUEUE_ELEM
*Elem
);
208 VOID
APPeerDeauthReqAction(
209 IN PRTMP_ADAPTER pAd
,
210 IN MLME_QUEUE_ELEM
*Elem
);
212 VOID
APPeerAuthSimpleRspGenAndSend(
213 IN PRTMP_ADAPTER pAd
,
214 IN PHEADER_802_11 pHdr80211
,
217 IN USHORT StatusCode
);
221 BOOLEAN
BeaconTransmitRequired(
222 IN PRTMP_ADAPTER pAd
,
225 VOID
APMakeBssBeacon(
226 IN PRTMP_ADAPTER pAd
,
229 VOID
APUpdateBeaconFrame(
230 IN PRTMP_ADAPTER pAd
,
233 VOID
APMakeAllBssBeacon(
234 IN PRTMP_ADAPTER pAd
);
236 VOID
APUpdateAllBeaconFrame(
237 IN PRTMP_ADAPTER pAd
);
242 VOID
APSyncStateMachineInit(
243 IN PRTMP_ADAPTER pAd
,
244 IN STATE_MACHINE
*Sm
,
245 OUT STATE_MACHINE_FUNC Trans
[]);
248 IN PVOID SystemSpecific1
,
249 IN PVOID FunctionContext
,
250 IN PVOID SystemSpecific2
,
251 IN PVOID SystemSpecific3
);
253 VOID
APInvalidStateWhenScan(
254 IN PRTMP_ADAPTER pAd
,
255 IN MLME_QUEUE_ELEM
*Elem
);
257 VOID
APScanTimeoutAction(
258 IN PRTMP_ADAPTER pAd
,
259 IN MLME_QUEUE_ELEM
*Elem
);
261 VOID
APPeerProbeReqAction(
262 IN PRTMP_ADAPTER pAd
,
263 IN MLME_QUEUE_ELEM
*Elem
);
265 VOID
APPeerBeaconAction(
266 IN PRTMP_ADAPTER pAd
,
267 IN MLME_QUEUE_ELEM
*Elem
);
269 VOID
APMlmeScanReqAction(
270 IN PRTMP_ADAPTER pAd
,
271 IN MLME_QUEUE_ELEM
*Elem
);
273 VOID
APPeerBeaconAtScanAction(
274 IN PRTMP_ADAPTER pAd
,
275 IN MLME_QUEUE_ELEM
*Elem
);
277 VOID
APScanCnclAction(
278 IN PRTMP_ADAPTER pAd
,
279 IN MLME_QUEUE_ELEM
*Elem
);
282 IN PRTMP_ADAPTER pAd
);
291 OUT PUCHAR pMaxSupportRate
);
294 BOOLEAN
ApScanRunning(
295 IN PRTMP_ADAPTER pAd
);
298 VOID
APOverlappingBSSScan(
299 IN RTMP_ADAPTER
*pAd
);
300 #endif // DOT11N_DRAFT3 //
304 VOID
APWpaStateMachineInit(
305 IN PRTMP_ADAPTER pAd
,
306 IN STATE_MACHINE
*Sm
,
307 OUT STATE_MACHINE_FUNC Trans
[]);
311 VOID
APMlmePeriodicExec(
312 IN PRTMP_ADAPTER pAd
);
314 VOID
APMlmeSelectTxRateTable(
315 IN PRTMP_ADAPTER pAd
,
316 IN PMAC_TABLE_ENTRY pEntry
,
318 IN PUCHAR pTableSize
,
319 IN PUCHAR pInitTxRateIdx
);
321 VOID
APMlmeSetTxRate(
322 IN PRTMP_ADAPTER pAd
,
323 IN PMAC_TABLE_ENTRY pEntry
,
324 IN PRTMP_TX_RATE_SWITCH pTxRate
);
326 VOID
APMlmeDynamicTxRateSwitching(
327 IN PRTMP_ADAPTER pAd
);
329 VOID
APQuickResponeForRateUpExec(
330 IN PVOID SystemSpecific1
,
331 IN PVOID FunctionContext
,
332 IN PVOID SystemSpecific2
,
333 IN PVOID SystemSpecific3
);
335 BOOLEAN
APMsgTypeSubst(
336 IN PRTMP_ADAPTER pAd
,
337 IN PFRAME_802_11 pFrame
,
341 VOID
APQuickResponeForRateUpExec(
342 IN PVOID SystemSpecific1
,
343 IN PVOID FunctionContext
,
344 IN PVOID SystemSpecific2
,
345 IN PVOID SystemSpecific3
);
348 VOID
BeaconUpdateExec(
349 IN PVOID SystemSpecific1
,
350 IN PVOID FunctionContext
,
351 IN PVOID SystemSpecific2
,
352 IN PVOID SystemSpecific3
);
355 VOID
RTMPSetPiggyBack(
356 IN PRTMP_ADAPTER pAd
,
357 IN BOOLEAN bPiggyBack
);
359 VOID
APAsicEvaluateRxAnt(
360 IN PRTMP_ADAPTER pAd
);
362 VOID
APAsicRxAntEvalTimeout(
363 IN PRTMP_ADAPTER pAd
);
367 VOID
APSwitchChannel(
368 IN PRTMP_ADAPTER pAd
,
371 NDIS_STATUS
APInitialize(
372 IN PRTMP_ADAPTER pAd
);
375 IN PRTMP_ADAPTER pAd
);
378 IN PRTMP_ADAPTER pAd
);
381 IN PRTMP_ADAPTER pAd
);
383 VOID
APCleanupPsQueue(
384 IN PRTMP_ADAPTER pAd
,
385 IN PQUEUE_HEADER pQueue
);
388 IN PRTMP_ADAPTER pAd
);
390 MAC_TABLE_ENTRY
*MacTableInsertEntry(
391 IN PRTMP_ADAPTER pAd
,
394 IN BOOLEAN CleanAll
);
396 BOOLEAN
MacTableDeleteEntry(
397 IN PRTMP_ADAPTER pAd
,
401 MAC_TABLE_ENTRY
*MacTableLookup(
402 IN PRTMP_ADAPTER pAd
,
405 VOID
MacTableMaintenance(
406 IN PRTMP_ADAPTER pAd
);
408 UINT32
MacTableAssocStaNumGet(
409 IN PRTMP_ADAPTER pAd
);
411 MAC_TABLE_ENTRY
*APSsPsInquiry(
412 IN PRTMP_ADAPTER pAd
,
419 BOOLEAN
APPsIndicate(
420 IN PRTMP_ADAPTER pAd
,
426 IN PRTMP_ADAPTER pAd
,
430 #ifdef DOT11_N_SUPPORT
431 VOID
APUpdateOperationMode(
432 IN PRTMP_ADAPTER pAd
);
433 #endif // DOT11_N_SUPPORT //
435 VOID
APUpdateCapabilityAndErpIe(
436 IN PRTMP_ADAPTER pAd
);
438 BOOLEAN
ApCheckAccessControlList(
439 IN PRTMP_ADAPTER pAd
,
443 VOID
ApUpdateAccessControlList(
444 IN PRTMP_ADAPTER pAd
,
447 VOID
ApEnqueueNullFrame(
448 IN PRTMP_ADAPTER pAd
,
458 IN PRTMP_ADAPTER pAd
,
464 VOID
ApEnqueueAckFrame(
465 IN PRTMP_ADAPTER pAd
,
470 UCHAR
APAutoSelectChannel(
471 IN PRTMP_ADAPTER pAd
,
477 BOOLEAN
PeerAssocReqCmmSanity(
478 IN PRTMP_ADAPTER pAd
,
483 OUT USHORT
*pCapabilityInfo
,
484 OUT USHORT
*pListenInterval
,
488 OUT UCHAR
*pRatesLen
,
492 OUT BOOLEAN
*pbWmmCapable
,
493 #ifdef WSC_AP_SUPPORT
494 OUT BOOLEAN
*pWscCapable
,
495 #endif // WSC_AP_SUPPORT //
496 OUT ULONG
*pRalinkIe
,
498 OUT EXT_CAP_INFO_ELEMENT
*pExtCapInfo
,
499 #endif // DOT11N_DRAFT3 //
500 OUT UCHAR
*pHtCapabilityLen
,
501 OUT HT_CAPABILITY_IE
*pHtCapability
);
503 BOOLEAN
PeerDisassocReqSanity(
504 IN PRTMP_ADAPTER pAd
,
510 BOOLEAN
PeerDeauthReqSanity(
511 IN PRTMP_ADAPTER pAd
,
517 BOOLEAN
APPeerAuthSanity(
518 IN PRTMP_ADAPTER pAd
,
528 BOOLEAN
APPeerProbeReqSanity(
529 IN PRTMP_ADAPTER pAd
,
536 BOOLEAN
APPeerBeaconAndProbeRspSanity(
537 IN PRTMP_ADAPTER pAd
,
545 OUT USHORT
*BeaconPeriod
,
547 OUT LARGE_INTEGER
*Timestamp
,
548 OUT USHORT
*CapabilityInfo
,
551 OUT BOOLEAN
*ExtendedRateIeExist
,
558 // ================== end of AP RTMP.h ========================