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
,
162 IN HT_CAPABILITY_IE
*pHtCapability
,
163 IN UCHAR HtCapabilityLen
,
168 void APAuthStateMachineInit(
169 IN PRTMP_ADAPTER pAd
,
170 IN STATE_MACHINE
*Sm
,
171 OUT STATE_MACHINE_FUNC Trans
[]);
173 VOID
APMlmeDeauthReqAction(
174 IN PRTMP_ADAPTER pAd
,
175 IN MLME_QUEUE_ELEM
*Elem
);
177 VOID
APCls2errAction(
178 IN PRTMP_ADAPTER pAd
,
180 IN PHEADER_802_11 pHeader
);
184 VOID
APAuthRspStateMachineInit(
185 IN PRTMP_ADAPTER pAd
,
186 IN PSTATE_MACHINE Sm
,
187 IN STATE_MACHINE_FUNC Trans
[]);
189 VOID
APPeerAuthAtAuthRspIdleAction(
190 IN PRTMP_ADAPTER pAd
,
191 IN MLME_QUEUE_ELEM
*Elem
);
193 VOID
APPeerDeauthReqAction(
194 IN PRTMP_ADAPTER pAd
,
195 IN MLME_QUEUE_ELEM
*Elem
);
197 VOID
APPeerAuthSimpleRspGenAndSend(
198 IN PRTMP_ADAPTER pAd
,
199 IN PHEADER_802_11 pHdr80211
,
202 IN USHORT StatusCode
);
206 BOOLEAN
BeaconTransmitRequired(
207 IN PRTMP_ADAPTER pAd
,
210 VOID
APMakeBssBeacon(
211 IN PRTMP_ADAPTER pAd
,
214 VOID
APUpdateBeaconFrame(
215 IN PRTMP_ADAPTER pAd
,
218 VOID
APMakeAllBssBeacon(
219 IN PRTMP_ADAPTER pAd
);
221 VOID
APUpdateAllBeaconFrame(
222 IN PRTMP_ADAPTER pAd
);
227 VOID
APSyncStateMachineInit(
228 IN PRTMP_ADAPTER pAd
,
229 IN STATE_MACHINE
*Sm
,
230 OUT STATE_MACHINE_FUNC Trans
[]);
233 IN PVOID SystemSpecific1
,
234 IN PVOID FunctionContext
,
235 IN PVOID SystemSpecific2
,
236 IN PVOID SystemSpecific3
);
238 VOID
APInvalidStateWhenScan(
239 IN PRTMP_ADAPTER pAd
,
240 IN MLME_QUEUE_ELEM
*Elem
);
242 VOID
APScanTimeoutAction(
243 IN PRTMP_ADAPTER pAd
,
244 IN MLME_QUEUE_ELEM
*Elem
);
246 VOID
APPeerProbeReqAction(
247 IN PRTMP_ADAPTER pAd
,
248 IN MLME_QUEUE_ELEM
*Elem
);
250 VOID
APPeerBeaconAction(
251 IN PRTMP_ADAPTER pAd
,
252 IN MLME_QUEUE_ELEM
*Elem
);
254 VOID
APMlmeScanReqAction(
255 IN PRTMP_ADAPTER pAd
,
256 IN MLME_QUEUE_ELEM
*Elem
);
258 VOID
APPeerBeaconAtScanAction(
259 IN PRTMP_ADAPTER pAd
,
260 IN MLME_QUEUE_ELEM
*Elem
);
262 VOID
APScanCnclAction(
263 IN PRTMP_ADAPTER pAd
,
264 IN MLME_QUEUE_ELEM
*Elem
);
267 IN PRTMP_ADAPTER pAd
);
276 OUT PUCHAR pMaxSupportRate
);
279 BOOLEAN
ApScanRunning(
280 IN PRTMP_ADAPTER pAd
);
284 VOID
APWpaStateMachineInit(
285 IN PRTMP_ADAPTER pAd
,
286 IN STATE_MACHINE
*Sm
,
287 OUT STATE_MACHINE_FUNC Trans
[]);
291 VOID
APMlmePeriodicExec(
292 IN PRTMP_ADAPTER pAd
);
294 VOID
APMlmeSelectTxRateTable(
295 IN PRTMP_ADAPTER pAd
,
296 IN PMAC_TABLE_ENTRY pEntry
,
298 IN PUCHAR pTableSize
,
299 IN PUCHAR pInitTxRateIdx
);
301 VOID
APMlmeSetTxRate(
302 IN PRTMP_ADAPTER pAd
,
303 IN PMAC_TABLE_ENTRY pEntry
,
304 IN PRTMP_TX_RATE_SWITCH pTxRate
);
306 VOID
APMlmeDynamicTxRateSwitching(
307 IN PRTMP_ADAPTER pAd
);
309 VOID
APQuickResponeForRateUpExec(
310 IN PVOID SystemSpecific1
,
311 IN PVOID FunctionContext
,
312 IN PVOID SystemSpecific2
,
313 IN PVOID SystemSpecific3
);
315 BOOLEAN
APMsgTypeSubst(
316 IN PRTMP_ADAPTER pAd
,
317 IN PFRAME_802_11 pFrame
,
321 VOID
APQuickResponeForRateUpExec(
322 IN PVOID SystemSpecific1
,
323 IN PVOID FunctionContext
,
324 IN PVOID SystemSpecific2
,
325 IN PVOID SystemSpecific3
);
328 VOID
BeaconUpdateExec(
329 IN PVOID SystemSpecific1
,
330 IN PVOID FunctionContext
,
331 IN PVOID SystemSpecific2
,
332 IN PVOID SystemSpecific3
);
335 VOID
RTMPSetPiggyBack(
336 IN PRTMP_ADAPTER pAd
,
337 IN BOOLEAN bPiggyBack
);
339 VOID
APAsicEvaluateRxAnt(
340 IN PRTMP_ADAPTER pAd
);
342 VOID
APAsicRxAntEvalTimeout(
343 IN PRTMP_ADAPTER pAd
);
347 VOID
APSwitchChannel(
348 IN PRTMP_ADAPTER pAd
,
351 NDIS_STATUS
APInitialize(
352 IN PRTMP_ADAPTER pAd
);
355 IN PRTMP_ADAPTER pAd
);
358 IN PRTMP_ADAPTER pAd
);
361 IN PRTMP_ADAPTER pAd
);
363 VOID
APCleanupPsQueue(
364 IN PRTMP_ADAPTER pAd
,
365 IN PQUEUE_HEADER pQueue
);
368 IN PRTMP_ADAPTER pAd
);
370 MAC_TABLE_ENTRY
*MacTableInsertEntry(
371 IN PRTMP_ADAPTER pAd
,
374 IN BOOLEAN CleanAll
);
376 BOOLEAN
MacTableDeleteEntry(
377 IN PRTMP_ADAPTER pAd
,
381 MAC_TABLE_ENTRY
*MacTableLookup(
382 IN PRTMP_ADAPTER pAd
,
385 VOID
MacTableMaintenance(
386 IN PRTMP_ADAPTER pAd
);
388 UINT32
MacTableAssocStaNumGet(
389 IN PRTMP_ADAPTER pAd
);
391 MAC_TABLE_ENTRY
*APSsPsInquiry(
392 IN PRTMP_ADAPTER pAd
,
399 BOOLEAN
APPsIndicate(
400 IN PRTMP_ADAPTER pAd
,
406 IN PRTMP_ADAPTER pAd
,
410 VOID
APUpdateOperationMode(
411 IN PRTMP_ADAPTER pAd
);
413 VOID
APUpdateCapabilityAndErpIe(
414 IN PRTMP_ADAPTER pAd
);
416 BOOLEAN
ApCheckAccessControlList(
417 IN PRTMP_ADAPTER pAd
,
421 VOID
ApUpdateAccessControlList(
422 IN PRTMP_ADAPTER pAd
,
425 VOID
ApEnqueueNullFrame(
426 IN PRTMP_ADAPTER pAd
,
436 IN PRTMP_ADAPTER pAd
,
442 VOID
ApEnqueueAckFrame(
443 IN PRTMP_ADAPTER pAd
,
448 UCHAR
APAutoSelectChannel(
449 IN PRTMP_ADAPTER pAd
,
455 BOOLEAN
PeerAssocReqCmmSanity(
456 IN PRTMP_ADAPTER pAd
,
461 OUT USHORT
*pCapabilityInfo
,
462 OUT USHORT
*pListenInterval
,
466 OUT UCHAR
*pRatesLen
,
470 OUT BOOLEAN
*pbWmmCapable
,
471 OUT ULONG
*pRalinkIe
,
472 OUT UCHAR
*pHtCapabilityLen
,
473 OUT HT_CAPABILITY_IE
*pHtCapability
);
475 BOOLEAN
PeerDisassocReqSanity(
476 IN PRTMP_ADAPTER pAd
,
482 BOOLEAN
PeerDeauthReqSanity(
483 IN PRTMP_ADAPTER pAd
,
489 BOOLEAN
APPeerAuthSanity(
490 IN PRTMP_ADAPTER pAd
,
500 BOOLEAN
APPeerProbeReqSanity(
501 IN PRTMP_ADAPTER pAd
,
508 BOOLEAN
APPeerBeaconAndProbeRspSanity(
509 IN PRTMP_ADAPTER pAd
,
517 OUT USHORT
*BeaconPeriod
,
519 OUT LARGE_INTEGER
*Timestamp
,
520 OUT USHORT
*CapabilityInfo
,
523 OUT BOOLEAN
*ExtendedRateIeExist
,
527 // ================== end of AP RTMP.h ========================