Staging: add rt2870 wireless driver
[linux-2.6/mini2440.git] / drivers / staging / rt2870 / ap.h
blob0dc557516790a4348fb507fc4142e48d173b91e3
1 /*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
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. *
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 *************************************************************************
27 Module Name:
28 ap.h
30 Abstract:
31 Miniport generic portion header file
33 Revision History:
34 Who When What
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
40 #ifndef __AP_H__
41 #define __AP_H__
45 // ========================= AP RTMP.h ================================
49 // =============================================================
50 // Function Prototypes
51 // =============================================================
53 // ap_data.c
55 BOOLEAN APBridgeToWirelessSta(
56 IN PRTMP_ADAPTER pAd,
57 IN PUCHAR pHeader,
58 IN UINT HdrLen,
59 IN PUCHAR pData,
60 IN UINT DataLen,
61 IN ULONG fromwdsidx);
63 BOOLEAN APHandleRxDoneInterrupt(
64 IN PRTMP_ADAPTER pAd);
66 VOID APSendPackets(
67 IN NDIS_HANDLE MiniportAdapterContext,
68 IN PPNDIS_PACKET ppPacketArray,
69 IN UINT NumberOfPackets);
71 NDIS_STATUS APSendPacket(
72 IN PRTMP_ADAPTER pAd,
73 IN PNDIS_PACKET pPacket);
76 NDIS_STATUS APHardTransmit(
77 IN PRTMP_ADAPTER pAd,
78 IN TX_BLK *pTxBlk,
79 IN UCHAR QueIdx);
81 VOID APRxEAPOLFrameIndicate(
82 IN PRTMP_ADAPTER pAd,
83 IN MAC_TABLE_ENTRY *pEntry,
84 IN RX_BLK *pRxBlk,
85 IN UCHAR FromWhichBSSID);
87 NDIS_STATUS APCheckRxError(
88 IN PRTMP_ADAPTER pAd,
89 IN PRT28XX_RXD_STRUC pRxD,
90 IN UCHAR Wcid);
92 BOOLEAN APCheckClass2Class3Error(
93 IN PRTMP_ADAPTER pAd,
94 IN ULONG Wcid,
95 IN PHEADER_802_11 pHeader);
97 VOID APHandleRxPsPoll(
98 IN PRTMP_ADAPTER pAd,
99 IN PUCHAR pAddr,
100 IN USHORT Aid,
101 IN BOOLEAN isActive);
103 VOID RTMPDescriptorEndianChange(
104 IN PUCHAR pData,
105 IN ULONG DescriptorType);
107 VOID RTMPFrameEndianChange(
108 IN PRTMP_ADAPTER pAd,
109 IN PUCHAR pData,
110 IN ULONG Dir,
111 IN BOOLEAN FromRxDoneInt);
113 // ap_assoc.c
115 VOID APAssocStateMachineInit(
116 IN PRTMP_ADAPTER pAd,
117 IN STATE_MACHINE *S,
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,
134 IN INT apidx,
135 IN USHORT Reason);
137 VOID APMlmeKickOutSta(
138 IN PRTMP_ADAPTER pAd,
139 IN PUCHAR pStaAddr,
140 IN UCHAR Wcid,
141 IN USHORT Reason);
143 VOID APMlmeDisassocReqAction(
144 IN PRTMP_ADAPTER pAd,
145 IN MLME_QUEUE_ELEM *Elem);
147 VOID APCls3errAction(
148 IN PRTMP_ADAPTER pAd,
149 IN ULONG Wcid,
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,
158 IN UCHAR *RSN,
159 IN UCHAR *pRSNLen,
160 IN BOOLEAN bWmmCapable,
161 IN ULONG RalinkIe,
162 #ifdef DOT11N_DRAFT3
163 IN EXT_CAP_INFO_ELEMENT ExtCapInfo,
164 #endif // DOT11N_DRAFT3 //
165 IN HT_CAPABILITY_IE *pHtCapability,
166 IN UCHAR HtCapabilityLen,
167 OUT USHORT *pAid);
170 VOID RTMPAddClientSec(
171 IN PRTMP_ADAPTER pAd,
172 IN UCHAR BssIdx,
173 IN UCHAR KeyIdx,
174 IN UCHAR CipherAlg,
175 IN PUCHAR pKey,
176 IN PUCHAR pTxMic,
177 IN PUCHAR pRxMic,
178 IN MAC_TABLE_ENTRY *pEntry);
181 // ap_auth.c
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,
194 IN ULONG Wcid,
195 IN PHEADER_802_11 pHeader);
197 // ap_authrsp.c
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,
215 IN USHORT Alg,
216 IN USHORT Seq,
217 IN USHORT StatusCode);
219 // ap_connect.c
221 BOOLEAN BeaconTransmitRequired(
222 IN PRTMP_ADAPTER pAd,
223 IN INT apidx);
225 VOID APMakeBssBeacon(
226 IN PRTMP_ADAPTER pAd,
227 IN INT apidx);
229 VOID APUpdateBeaconFrame(
230 IN PRTMP_ADAPTER pAd,
231 IN INT apidx);
233 VOID APMakeAllBssBeacon(
234 IN PRTMP_ADAPTER pAd);
236 VOID APUpdateAllBeaconFrame(
237 IN PRTMP_ADAPTER pAd);
240 // ap_sync.c
242 VOID APSyncStateMachineInit(
243 IN PRTMP_ADAPTER pAd,
244 IN STATE_MACHINE *Sm,
245 OUT STATE_MACHINE_FUNC Trans[]);
247 VOID APScanTimeout(
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);
281 VOID ApSiteSurvey(
282 IN PRTMP_ADAPTER pAd);
284 VOID SupportRate(
285 IN PUCHAR SupRate,
286 IN UCHAR SupRateLen,
287 IN PUCHAR ExtRate,
288 IN UCHAR ExtRateLen,
289 OUT PUCHAR *Rates,
290 OUT PUCHAR RatesLen,
291 OUT PUCHAR pMaxSupportRate);
294 BOOLEAN ApScanRunning(
295 IN PRTMP_ADAPTER pAd);
297 #ifdef DOT11N_DRAFT3
298 VOID APOverlappingBSSScan(
299 IN RTMP_ADAPTER *pAd);
300 #endif // DOT11N_DRAFT3 //
302 // ap_wpa.c
304 VOID APWpaStateMachineInit(
305 IN PRTMP_ADAPTER pAd,
306 IN STATE_MACHINE *Sm,
307 OUT STATE_MACHINE_FUNC Trans[]);
309 // ap_mlme.c
311 VOID APMlmePeriodicExec(
312 IN PRTMP_ADAPTER pAd);
314 VOID APMlmeSelectTxRateTable(
315 IN PRTMP_ADAPTER pAd,
316 IN PMAC_TABLE_ENTRY pEntry,
317 IN PUCHAR *ppTable,
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,
338 OUT INT *Machine,
339 OUT INT *MsgType);
341 VOID APQuickResponeForRateUpExec(
342 IN PVOID SystemSpecific1,
343 IN PVOID FunctionContext,
344 IN PVOID SystemSpecific2,
345 IN PVOID SystemSpecific3);
347 #ifdef RT2870
348 VOID BeaconUpdateExec(
349 IN PVOID SystemSpecific1,
350 IN PVOID FunctionContext,
351 IN PVOID SystemSpecific2,
352 IN PVOID SystemSpecific3);
353 #endif // RT2870 //
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);
365 // ap.c
367 VOID APSwitchChannel(
368 IN PRTMP_ADAPTER pAd,
369 IN INT Channel);
371 NDIS_STATUS APInitialize(
372 IN PRTMP_ADAPTER pAd);
374 VOID APShutdown(
375 IN PRTMP_ADAPTER pAd);
377 VOID APStartUp(
378 IN PRTMP_ADAPTER pAd);
380 VOID APStop(
381 IN PRTMP_ADAPTER pAd);
383 VOID APCleanupPsQueue(
384 IN PRTMP_ADAPTER pAd,
385 IN PQUEUE_HEADER pQueue);
387 VOID MacTableReset(
388 IN PRTMP_ADAPTER pAd);
390 MAC_TABLE_ENTRY *MacTableInsertEntry(
391 IN PRTMP_ADAPTER pAd,
392 IN PUCHAR pAddr,
393 IN UCHAR apidx,
394 IN BOOLEAN CleanAll);
396 BOOLEAN MacTableDeleteEntry(
397 IN PRTMP_ADAPTER pAd,
398 IN USHORT wcid,
399 IN PUCHAR pAddr);
401 MAC_TABLE_ENTRY *MacTableLookup(
402 IN PRTMP_ADAPTER pAd,
403 IN PUCHAR pAddr);
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,
413 IN PUCHAR pAddr,
414 OUT SST *Sst,
415 OUT USHORT *Aid,
416 OUT UCHAR *PsMode,
417 OUT UCHAR *Rate);
419 BOOLEAN APPsIndicate(
420 IN PRTMP_ADAPTER pAd,
421 IN PUCHAR pAddr,
422 IN ULONG Wcid,
423 IN UCHAR Psm);
425 VOID ApLogEvent(
426 IN PRTMP_ADAPTER pAd,
427 IN PUCHAR pAddr,
428 IN USHORT Event);
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,
440 IN PUCHAR pAddr,
441 IN UCHAR Apidx);
443 VOID ApUpdateAccessControlList(
444 IN PRTMP_ADAPTER pAd,
445 IN UCHAR Apidx);
447 VOID ApEnqueueNullFrame(
448 IN PRTMP_ADAPTER pAd,
449 IN PUCHAR pAddr,
450 IN UCHAR TxRate,
451 IN UCHAR PID,
452 IN UCHAR apidx,
453 IN BOOLEAN bQosNull,
454 IN BOOLEAN bEOSP,
455 IN UCHAR OldUP);
457 VOID ApSendFrame(
458 IN PRTMP_ADAPTER pAd,
459 IN PVOID pBuffer,
460 IN ULONG Length,
461 IN UCHAR TxRate,
462 IN UCHAR PID);
464 VOID ApEnqueueAckFrame(
465 IN PRTMP_ADAPTER pAd,
466 IN PUCHAR pAddr,
467 IN UCHAR TxRate,
468 IN UCHAR apidx);
470 UCHAR APAutoSelectChannel(
471 IN PRTMP_ADAPTER pAd,
472 IN BOOLEAN Optimal);
474 // ap_sanity.c
477 BOOLEAN PeerAssocReqCmmSanity(
478 IN PRTMP_ADAPTER pAd,
479 IN BOOLEAN isRessoc,
480 IN VOID *Msg,
481 IN ULONG MsgLen,
482 OUT PUCHAR pAddr2,
483 OUT USHORT *pCapabilityInfo,
484 OUT USHORT *pListenInterval,
485 OUT PUCHAR pApAddr,
486 OUT UCHAR *pSsidLen,
487 OUT char *Ssid,
488 OUT UCHAR *pRatesLen,
489 OUT UCHAR Rates[],
490 OUT UCHAR *RSN,
491 OUT UCHAR *pRSNLen,
492 OUT BOOLEAN *pbWmmCapable,
493 #ifdef WSC_AP_SUPPORT
494 OUT BOOLEAN *pWscCapable,
495 #endif // WSC_AP_SUPPORT //
496 OUT ULONG *pRalinkIe,
497 #ifdef DOT11N_DRAFT3
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,
505 IN VOID *Msg,
506 IN ULONG MsgLen,
507 OUT PUCHAR pAddr2,
508 OUT USHORT *Reason);
510 BOOLEAN PeerDeauthReqSanity(
511 IN PRTMP_ADAPTER pAd,
512 IN VOID *Msg,
513 IN ULONG MsgLen,
514 OUT PUCHAR pAddr2,
515 OUT USHORT *Reason);
517 BOOLEAN APPeerAuthSanity(
518 IN PRTMP_ADAPTER pAd,
519 IN VOID *Msg,
520 IN ULONG MsgLen,
521 OUT PUCHAR pAddr1,
522 OUT PUCHAR pAddr2,
523 OUT USHORT *Alg,
524 OUT USHORT *Seq,
525 OUT USHORT *Status,
526 CHAR *ChlgText);
528 BOOLEAN APPeerProbeReqSanity(
529 IN PRTMP_ADAPTER pAd,
530 IN VOID *Msg,
531 IN ULONG MsgLen,
532 OUT PUCHAR pAddr2,
533 OUT CHAR Ssid[],
534 OUT UCHAR *SsidLen);
536 BOOLEAN APPeerBeaconAndProbeRspSanity(
537 IN PRTMP_ADAPTER pAd,
538 IN VOID *Msg,
539 IN ULONG MsgLen,
540 OUT PUCHAR pAddr2,
541 OUT PUCHAR pBssid,
542 OUT CHAR Ssid[],
543 OUT UCHAR *SsidLen,
544 OUT UCHAR *BssType,
545 OUT USHORT *BeaconPeriod,
546 OUT UCHAR *Channel,
547 OUT LARGE_INTEGER *Timestamp,
548 OUT USHORT *CapabilityInfo,
549 OUT UCHAR Rate[],
550 OUT UCHAR *RateLen,
551 OUT BOOLEAN *ExtendedRateIeExist,
552 OUT UCHAR *Erp);
554 // ap_info.c
558 // ================== end of AP RTMP.h ========================
561 #endif // __AP_H__