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,
171 void APAuthStateMachineInit(
172 IN PRTMP_ADAPTER pAd,
173 IN STATE_MACHINE *Sm,
174 OUT STATE_MACHINE_FUNC Trans[]);
176 VOID APMlmeDeauthReqAction(
177 IN PRTMP_ADAPTER pAd,
178 IN MLME_QUEUE_ELEM *Elem);
180 VOID APCls2errAction(
181 IN PRTMP_ADAPTER pAd,
183 IN PHEADER_802_11 pHeader);
187 VOID APAuthRspStateMachineInit(
188 IN PRTMP_ADAPTER pAd,
189 IN PSTATE_MACHINE Sm,
190 IN STATE_MACHINE_FUNC Trans[]);
192 VOID APPeerAuthAtAuthRspIdleAction(
193 IN PRTMP_ADAPTER pAd,
194 IN MLME_QUEUE_ELEM *Elem);
196 VOID APPeerDeauthReqAction(
197 IN PRTMP_ADAPTER pAd,
198 IN MLME_QUEUE_ELEM *Elem);
200 VOID APPeerAuthSimpleRspGenAndSend(
201 IN PRTMP_ADAPTER pAd,
202 IN PHEADER_802_11 pHdr80211,
205 IN USHORT StatusCode);
209 BOOLEAN BeaconTransmitRequired(
210 IN PRTMP_ADAPTER pAd,
213 VOID APMakeBssBeacon(
214 IN PRTMP_ADAPTER pAd,
217 VOID APUpdateBeaconFrame(
218 IN PRTMP_ADAPTER pAd,
221 VOID APMakeAllBssBeacon(
222 IN PRTMP_ADAPTER pAd);
224 VOID APUpdateAllBeaconFrame(
225 IN PRTMP_ADAPTER pAd);
230 VOID APSyncStateMachineInit(
231 IN PRTMP_ADAPTER pAd,
232 IN STATE_MACHINE *Sm,
233 OUT STATE_MACHINE_FUNC Trans[]);
236 IN PVOID SystemSpecific1,
237 IN PVOID FunctionContext,
238 IN PVOID SystemSpecific2,
239 IN PVOID SystemSpecific3);
241 VOID APInvalidStateWhenScan(
242 IN PRTMP_ADAPTER pAd,
243 IN MLME_QUEUE_ELEM *Elem);
245 VOID APScanTimeoutAction(
246 IN PRTMP_ADAPTER pAd,
247 IN MLME_QUEUE_ELEM *Elem);
249 VOID APPeerProbeReqAction(
250 IN PRTMP_ADAPTER pAd,
251 IN MLME_QUEUE_ELEM *Elem);
253 VOID APPeerBeaconAction(
254 IN PRTMP_ADAPTER pAd,
255 IN MLME_QUEUE_ELEM *Elem);
257 VOID APMlmeScanReqAction(
258 IN PRTMP_ADAPTER pAd,
259 IN MLME_QUEUE_ELEM *Elem);
261 VOID APPeerBeaconAtScanAction(
262 IN PRTMP_ADAPTER pAd,
263 IN MLME_QUEUE_ELEM *Elem);
265 VOID APScanCnclAction(
266 IN PRTMP_ADAPTER pAd,
267 IN MLME_QUEUE_ELEM *Elem);
270 IN PRTMP_ADAPTER pAd);
279 OUT PUCHAR pMaxSupportRate);
282 BOOLEAN ApScanRunning(
283 IN PRTMP_ADAPTER pAd);
286 VOID APOverlappingBSSScan(
287 IN RTMP_ADAPTER *pAd);
288 #endif // DOT11N_DRAFT3 //
292 VOID APWpaStateMachineInit(
293 IN PRTMP_ADAPTER pAd,
294 IN STATE_MACHINE *Sm,
295 OUT STATE_MACHINE_FUNC Trans[]);
299 VOID APMlmePeriodicExec(
300 IN PRTMP_ADAPTER pAd);
302 VOID APMlmeSelectTxRateTable(
303 IN PRTMP_ADAPTER pAd,
304 IN PMAC_TABLE_ENTRY pEntry,
306 IN PUCHAR pTableSize,
307 IN PUCHAR pInitTxRateIdx);
309 VOID APMlmeSetTxRate(
310 IN PRTMP_ADAPTER pAd,
311 IN PMAC_TABLE_ENTRY pEntry,
312 IN PRTMP_TX_RATE_SWITCH pTxRate);
314 VOID APMlmeDynamicTxRateSwitching(
315 IN PRTMP_ADAPTER pAd);
317 VOID APQuickResponeForRateUpExec(
318 IN PVOID SystemSpecific1,
319 IN PVOID FunctionContext,
320 IN PVOID SystemSpecific2,
321 IN PVOID SystemSpecific3);
323 BOOLEAN APMsgTypeSubst(
324 IN PRTMP_ADAPTER pAd,
325 IN PFRAME_802_11 pFrame,
329 VOID APQuickResponeForRateUpExec(
330 IN PVOID SystemSpecific1,
331 IN PVOID FunctionContext,
332 IN PVOID SystemSpecific2,
333 IN PVOID SystemSpecific3);
336 VOID RTMPSetPiggyBack(
337 IN PRTMP_ADAPTER pAd,
338 IN BOOLEAN bPiggyBack);
340 VOID APAsicEvaluateRxAnt(
341 IN PRTMP_ADAPTER pAd);
343 VOID APAsicRxAntEvalTimeout(
344 IN PRTMP_ADAPTER pAd);
348 VOID APSwitchChannel(
349 IN PRTMP_ADAPTER pAd,
352 NDIS_STATUS APInitialize(
353 IN PRTMP_ADAPTER pAd);
356 IN PRTMP_ADAPTER pAd);
359 IN PRTMP_ADAPTER pAd);
362 IN PRTMP_ADAPTER pAd);
364 VOID APCleanupPsQueue(
365 IN PRTMP_ADAPTER pAd,
366 IN PQUEUE_HEADER pQueue);
369 IN PRTMP_ADAPTER pAd);
371 MAC_TABLE_ENTRY *MacTableInsertEntry(
372 IN PRTMP_ADAPTER pAd,
375 IN BOOLEAN CleanAll);
377 BOOLEAN MacTableDeleteEntry(
378 IN PRTMP_ADAPTER pAd,
382 MAC_TABLE_ENTRY *MacTableLookup(
383 IN PRTMP_ADAPTER pAd,
386 VOID MacTableMaintenance(
387 IN PRTMP_ADAPTER pAd);
389 UINT32 MacTableAssocStaNumGet(
390 IN PRTMP_ADAPTER pAd);
392 MAC_TABLE_ENTRY *APSsPsInquiry(
393 IN PRTMP_ADAPTER pAd,
400 BOOLEAN APPsIndicate(
401 IN PRTMP_ADAPTER pAd,
407 IN PRTMP_ADAPTER pAd,
411 #ifdef DOT11_N_SUPPORT
412 VOID APUpdateOperationMode(
413 IN PRTMP_ADAPTER pAd);
414 #endif // DOT11_N_SUPPORT //
416 VOID APUpdateCapabilityAndErpIe(
417 IN PRTMP_ADAPTER pAd);
419 BOOLEAN ApCheckAccessControlList(
420 IN PRTMP_ADAPTER pAd,
424 VOID ApUpdateAccessControlList(
425 IN PRTMP_ADAPTER pAd,
428 VOID ApEnqueueNullFrame(
429 IN PRTMP_ADAPTER pAd,
439 IN PRTMP_ADAPTER pAd,
445 VOID ApEnqueueAckFrame(
446 IN PRTMP_ADAPTER pAd,
451 UCHAR APAutoSelectChannel(
452 IN PRTMP_ADAPTER pAd,
458 BOOLEAN PeerAssocReqCmmSanity(
459 IN PRTMP_ADAPTER pAd,
464 OUT USHORT *pCapabilityInfo,
465 OUT USHORT *pListenInterval,
469 OUT UCHAR *pRatesLen,
473 OUT BOOLEAN *pbWmmCapable,
474 OUT ULONG *pRalinkIe,
476 OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo,
477 #endif // DOT11N_DRAFT3 //
478 OUT UCHAR *pHtCapabilityLen,
479 OUT HT_CAPABILITY_IE *pHtCapability);
481 BOOLEAN PeerDisassocReqSanity(
482 IN PRTMP_ADAPTER pAd,
488 BOOLEAN PeerDeauthReqSanity(
489 IN PRTMP_ADAPTER pAd,
495 BOOLEAN APPeerAuthSanity(
496 IN PRTMP_ADAPTER pAd,
506 BOOLEAN APPeerProbeReqSanity(
507 IN PRTMP_ADAPTER pAd,
514 BOOLEAN APPeerBeaconAndProbeRspSanity(
515 IN PRTMP_ADAPTER pAd,
523 OUT USHORT *BeaconPeriod,
525 OUT LARGE_INTEGER *Timestamp,
526 OUT USHORT *CapabilityInfo,
529 OUT BOOLEAN *ExtendedRateIeExist,
535 NDIS_STATUS APQueryInformation(
536 IN NDIS_HANDLE MiniportAdapterContext,
538 IN PVOID pInformationBuffer,
539 IN ULONG InformationBufferLength,
540 OUT PULONG pBytesWritten,
541 OUT PULONG pBytesNeeded);
543 NDIS_STATUS APSetInformation(
544 IN NDIS_HANDLE MiniportAdapterContext,
546 IN PVOID pInformationBuffer,
547 IN ULONG InformationBufferLength,
548 OUT PULONG pBytesRead,
549 OUT PULONG pBytesNeeded);
553 // ================== end of AP RTMP.h ========================