First Support on Ginger and OMAP TI
[linux-ginger.git] / drivers / staging / rt3090 / ap.h
blobe89430381071a7335968d42a9d538ee1c582b049
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__
44 // =============================================================
45 // Function Prototypes
46 // =============================================================
48 // ap_data.c
50 BOOLEAN APBridgeToWirelessSta(
51 IN PRTMP_ADAPTER pAd,
52 IN PUCHAR pHeader,
53 IN UINT HdrLen,
54 IN PUCHAR pData,
55 IN UINT DataLen,
56 IN ULONG fromwdsidx);
59 VOID APSendPackets(
60 IN NDIS_HANDLE MiniportAdapterContext,
61 IN PPNDIS_PACKET ppPacketArray,
62 IN UINT NumberOfPackets);
64 NDIS_STATUS APSendPacket(
65 IN PRTMP_ADAPTER pAd,
66 IN PNDIS_PACKET pPacket);
69 NDIS_STATUS APHardTransmit(
70 IN PRTMP_ADAPTER pAd,
71 IN TX_BLK *pTxBlk,
72 IN UCHAR QueIdx);
74 VOID APRxEAPOLFrameIndicate(
75 IN PRTMP_ADAPTER pAd,
76 IN MAC_TABLE_ENTRY *pEntry,
77 IN RX_BLK *pRxBlk,
78 IN UCHAR FromWhichBSSID);
80 NDIS_STATUS APCheckRxError(
81 IN PRTMP_ADAPTER pAd,
82 IN PRT28XX_RXD_STRUC pRxD,
83 IN UCHAR Wcid);
85 BOOLEAN APCheckClass2Class3Error(
86 IN PRTMP_ADAPTER pAd,
87 IN ULONG Wcid,
88 IN PHEADER_802_11 pHeader);
90 VOID APHandleRxPsPoll(
91 IN PRTMP_ADAPTER pAd,
92 IN PUCHAR pAddr,
93 IN USHORT Aid,
94 IN BOOLEAN isActive);
96 VOID RTMPDescriptorEndianChange(
97 IN PUCHAR pData,
98 IN ULONG DescriptorType);
100 VOID RTMPFrameEndianChange(
101 IN PRTMP_ADAPTER pAd,
102 IN PUCHAR pData,
103 IN ULONG Dir,
104 IN BOOLEAN FromRxDoneInt);
106 // ap_assoc.c
108 VOID APAssocStateMachineInit(
109 IN PRTMP_ADAPTER pAd,
110 IN STATE_MACHINE *S,
111 OUT STATE_MACHINE_FUNC Trans[]);
113 VOID APPeerAssocReqAction(
114 IN PRTMP_ADAPTER pAd,
115 IN MLME_QUEUE_ELEM *Elem);
117 VOID APPeerReassocReqAction(
118 IN PRTMP_ADAPTER pAd,
119 IN MLME_QUEUE_ELEM *Elem);
121 VOID APPeerDisassocReqAction(
122 IN PRTMP_ADAPTER pAd,
123 IN MLME_QUEUE_ELEM *Elem);
125 VOID MbssKickOutStas(
126 IN PRTMP_ADAPTER pAd,
127 IN INT apidx,
128 IN USHORT Reason);
130 VOID APMlmeKickOutSta(
131 IN PRTMP_ADAPTER pAd,
132 IN PUCHAR pStaAddr,
133 IN UCHAR Wcid,
134 IN USHORT Reason);
136 VOID APMlmeDisassocReqAction(
137 IN PRTMP_ADAPTER pAd,
138 IN MLME_QUEUE_ELEM *Elem);
140 VOID APCls3errAction(
141 IN PRTMP_ADAPTER pAd,
142 IN ULONG Wcid,
143 IN PHEADER_802_11 pHeader);
146 USHORT APBuildAssociation(
147 IN PRTMP_ADAPTER pAd,
148 IN MAC_TABLE_ENTRY *pEntry,
149 IN USHORT CapabilityInfo,
150 IN UCHAR MaxSupportedRateIn500Kbps,
151 IN UCHAR *RSN,
152 IN UCHAR *pRSNLen,
153 IN BOOLEAN bWmmCapable,
154 IN ULONG RalinkIe,
155 #ifdef DOT11N_DRAFT3
156 IN EXT_CAP_INFO_ELEMENT ExtCapInfo,
157 #endif // DOT11N_DRAFT3 //
158 IN HT_CAPABILITY_IE *pHtCapability,
159 IN UCHAR HtCapabilityLen,
160 OUT USHORT *pAid);
163 VOID RTMPAddClientSec(
164 IN PRTMP_ADAPTER pAd,
165 IN UCHAR BssIdx,
166 IN UCHAR KeyIdx,
167 IN UCHAR CipherAlg,
168 IN PUCHAR pKey,
169 IN PUCHAR pTxMic,
170 IN PUCHAR pRxMic,
171 IN MAC_TABLE_ENTRY *pEntry);
174 // ap_auth.c
176 void APAuthStateMachineInit(
177 IN PRTMP_ADAPTER pAd,
178 IN STATE_MACHINE *Sm,
179 OUT STATE_MACHINE_FUNC Trans[]);
181 VOID APCls2errAction(
182 IN PRTMP_ADAPTER pAd,
183 IN ULONG Wcid,
184 IN PHEADER_802_11 pHeader);
186 // ap_connect.c
189 VOID APMakeBssBeacon(
190 IN PRTMP_ADAPTER pAd,
191 IN INT apidx);
193 VOID APUpdateBeaconFrame(
194 IN PRTMP_ADAPTER pAd,
195 IN INT apidx);
197 VOID APMakeAllBssBeacon(
198 IN PRTMP_ADAPTER pAd);
200 VOID APUpdateAllBeaconFrame(
201 IN PRTMP_ADAPTER pAd);
204 // ap_sync.c
206 VOID APSyncStateMachineInit(
207 IN PRTMP_ADAPTER pAd,
208 IN STATE_MACHINE *Sm,
209 OUT STATE_MACHINE_FUNC Trans[]);
211 VOID APScanTimeout(
212 IN PVOID SystemSpecific1,
213 IN PVOID FunctionContext,
214 IN PVOID SystemSpecific2,
215 IN PVOID SystemSpecific3);
217 VOID APInvalidStateWhenScan(
218 IN PRTMP_ADAPTER pAd,
219 IN MLME_QUEUE_ELEM *Elem);
221 VOID APScanTimeoutAction(
222 IN PRTMP_ADAPTER pAd,
223 IN MLME_QUEUE_ELEM *Elem);
225 VOID APPeerProbeReqAction(
226 IN PRTMP_ADAPTER pAd,
227 IN MLME_QUEUE_ELEM *Elem);
229 VOID APPeerBeaconAction(
230 IN PRTMP_ADAPTER pAd,
231 IN MLME_QUEUE_ELEM *Elem);
233 VOID APMlmeScanReqAction(
234 IN PRTMP_ADAPTER pAd,
235 IN MLME_QUEUE_ELEM *Elem);
237 VOID APPeerBeaconAtScanAction(
238 IN PRTMP_ADAPTER pAd,
239 IN MLME_QUEUE_ELEM *Elem);
241 VOID APScanCnclAction(
242 IN PRTMP_ADAPTER pAd,
243 IN MLME_QUEUE_ELEM *Elem);
245 VOID ApSiteSurvey(
246 IN PRTMP_ADAPTER pAd,
247 IN PNDIS_802_11_SSID pSsid,
248 IN UCHAR ScanType);
250 VOID SupportRate(
251 IN PUCHAR SupRate,
252 IN UCHAR SupRateLen,
253 IN PUCHAR ExtRate,
254 IN UCHAR ExtRateLen,
255 OUT PUCHAR *Rates,
256 OUT PUCHAR RatesLen,
257 OUT PUCHAR pMaxSupportRate);
260 BOOLEAN ApScanRunning(
261 IN PRTMP_ADAPTER pAd);
263 #ifdef DOT11N_DRAFT3
264 VOID APOverlappingBSSScan(
265 IN RTMP_ADAPTER *pAd);
266 #endif // DOT11N_DRAFT3 //
268 // ap_wpa.c
269 VOID WpaStateMachineInit(
270 IN PRTMP_ADAPTER pAd,
271 IN STATE_MACHINE *Sm,
272 OUT STATE_MACHINE_FUNC Trans[]);
274 // ap_mlme.c
275 VOID APMlmePeriodicExec(
276 IN PRTMP_ADAPTER pAd);
278 VOID APMlmeSelectTxRateTable(
279 IN PRTMP_ADAPTER pAd,
280 IN PMAC_TABLE_ENTRY pEntry,
281 IN PUCHAR *ppTable,
282 IN PUCHAR pTableSize,
283 IN PUCHAR pInitTxRateIdx);
285 VOID APMlmeSetTxRate(
286 IN PRTMP_ADAPTER pAd,
287 IN PMAC_TABLE_ENTRY pEntry,
288 IN PRTMP_TX_RATE_SWITCH pTxRate);
290 VOID APMlmeDynamicTxRateSwitching(
291 IN PRTMP_ADAPTER pAd);
293 VOID APQuickResponeForRateUpExec(
294 IN PVOID SystemSpecific1,
295 IN PVOID FunctionContext,
296 IN PVOID SystemSpecific2,
297 IN PVOID SystemSpecific3);
299 BOOLEAN APMsgTypeSubst(
300 IN PRTMP_ADAPTER pAd,
301 IN PFRAME_802_11 pFrame,
302 OUT INT *Machine,
303 OUT INT *MsgType);
305 VOID APQuickResponeForRateUpExec(
306 IN PVOID SystemSpecific1,
307 IN PVOID FunctionContext,
308 IN PVOID SystemSpecific2,
309 IN PVOID SystemSpecific3);
312 VOID RTMPSetPiggyBack(
313 IN PRTMP_ADAPTER pAd,
314 IN BOOLEAN bPiggyBack);
316 VOID APAsicEvaluateRxAnt(
317 IN PRTMP_ADAPTER pAd);
319 VOID APAsicRxAntEvalTimeout(
320 IN PRTMP_ADAPTER pAd);
322 // ap.c
324 VOID APSwitchChannel(
325 IN PRTMP_ADAPTER pAd,
326 IN INT Channel);
328 NDIS_STATUS APInitialize(
329 IN PRTMP_ADAPTER pAd);
331 VOID APShutdown(
332 IN PRTMP_ADAPTER pAd);
334 VOID APStartUp(
335 IN PRTMP_ADAPTER pAd);
337 VOID APStop(
338 IN PRTMP_ADAPTER pAd);
340 VOID APCleanupPsQueue(
341 IN PRTMP_ADAPTER pAd,
342 IN PQUEUE_HEADER pQueue);
344 VOID MacTableReset(
345 IN PRTMP_ADAPTER pAd);
347 MAC_TABLE_ENTRY *MacTableInsertEntry(
348 IN PRTMP_ADAPTER pAd,
349 IN PUCHAR pAddr,
350 IN UCHAR apidx,
351 IN BOOLEAN CleanAll);
353 BOOLEAN MacTableDeleteEntry(
354 IN PRTMP_ADAPTER pAd,
355 IN USHORT wcid,
356 IN PUCHAR pAddr);
358 MAC_TABLE_ENTRY *MacTableLookup(
359 IN PRTMP_ADAPTER pAd,
360 IN PUCHAR pAddr);
362 VOID MacTableMaintenance(
363 IN PRTMP_ADAPTER pAd);
365 UINT32 MacTableAssocStaNumGet(
366 IN PRTMP_ADAPTER pAd);
368 MAC_TABLE_ENTRY *APSsPsInquiry(
369 IN PRTMP_ADAPTER pAd,
370 IN PUCHAR pAddr,
371 OUT SST *Sst,
372 OUT USHORT *Aid,
373 OUT UCHAR *PsMode,
374 OUT UCHAR *Rate);
376 BOOLEAN APPsIndicate(
377 IN PRTMP_ADAPTER pAd,
378 IN PUCHAR pAddr,
379 IN ULONG Wcid,
380 IN UCHAR Psm);
382 VOID ApLogEvent(
383 IN PRTMP_ADAPTER pAd,
384 IN PUCHAR pAddr,
385 IN USHORT Event);
387 #ifdef DOT11_N_SUPPORT
388 VOID APUpdateOperationMode(
389 IN PRTMP_ADAPTER pAd);
390 #endif // DOT11_N_SUPPORT //
392 VOID APUpdateCapabilityAndErpIe(
393 IN PRTMP_ADAPTER pAd);
395 BOOLEAN ApCheckAccessControlList(
396 IN PRTMP_ADAPTER pAd,
397 IN PUCHAR pAddr,
398 IN UCHAR Apidx);
400 VOID ApUpdateAccessControlList(
401 IN PRTMP_ADAPTER pAd,
402 IN UCHAR Apidx);
404 VOID ApEnqueueNullFrame(
405 IN PRTMP_ADAPTER pAd,
406 IN PUCHAR pAddr,
407 IN UCHAR TxRate,
408 IN UCHAR PID,
409 IN UCHAR apidx,
410 IN BOOLEAN bQosNull,
411 IN BOOLEAN bEOSP,
412 IN UCHAR OldUP);
414 VOID ApSendFrame(
415 IN PRTMP_ADAPTER pAd,
416 IN PVOID pBuffer,
417 IN ULONG Length,
418 IN UCHAR TxRate,
419 IN UCHAR PID);
421 VOID ApEnqueueAckFrame(
422 IN PRTMP_ADAPTER pAd,
423 IN PUCHAR pAddr,
424 IN UCHAR TxRate,
425 IN UCHAR apidx);
427 // ap_sanity.c
430 BOOLEAN PeerAssocReqCmmSanity(
431 IN PRTMP_ADAPTER pAd,
432 IN BOOLEAN isRessoc,
433 IN VOID *Msg,
434 IN ULONG MsgLen,
435 OUT PUCHAR pAddr2,
436 OUT USHORT *pCapabilityInfo,
437 OUT USHORT *pListenInterval,
438 OUT PUCHAR pApAddr,
439 OUT UCHAR *pSsidLen,
440 OUT char *Ssid,
441 OUT UCHAR *pRatesLen,
442 OUT UCHAR Rates[],
443 OUT UCHAR *RSN,
444 OUT UCHAR *pRSNLen,
445 OUT BOOLEAN *pbWmmCapable,
446 OUT ULONG *pRalinkIe,
447 #ifdef DOT11N_DRAFT3
448 OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo,
449 #endif // DOT11N_DRAFT3 //
450 OUT UCHAR *pHtCapabilityLen,
451 OUT HT_CAPABILITY_IE *pHtCapability);
454 BOOLEAN PeerDisassocReqSanity(
455 IN PRTMP_ADAPTER pAd,
456 IN VOID *Msg,
457 IN ULONG MsgLen,
458 OUT PUCHAR pAddr2,
459 OUT USHORT *Reason);
461 BOOLEAN PeerDeauthReqSanity(
462 IN PRTMP_ADAPTER pAd,
463 IN VOID *Msg,
464 IN ULONG MsgLen,
465 OUT PUCHAR pAddr2,
466 OUT USHORT *Reason);
468 BOOLEAN APPeerAuthSanity(
469 IN PRTMP_ADAPTER pAd,
470 IN VOID *Msg,
471 IN ULONG MsgLen,
472 OUT PUCHAR pAddr1,
473 OUT PUCHAR pAddr2,
474 OUT USHORT *Alg,
475 OUT USHORT *Seq,
476 OUT USHORT *Status,
477 OUT CHAR *ChlgText
480 BOOLEAN APPeerProbeReqSanity(
481 IN PRTMP_ADAPTER pAd,
482 IN VOID *Msg,
483 IN ULONG MsgLen,
484 OUT PUCHAR pAddr2,
485 OUT CHAR Ssid[],
486 OUT UCHAR *SsidLen);
488 BOOLEAN APPeerBeaconAndProbeRspSanity(
489 IN PRTMP_ADAPTER pAd,
490 IN VOID *Msg,
491 IN ULONG MsgLen,
492 OUT PUCHAR pAddr2,
493 OUT PUCHAR pBssid,
494 OUT CHAR Ssid[],
495 OUT UCHAR *SsidLen,
496 OUT UCHAR *BssType,
497 OUT USHORT *BeaconPeriod,
498 OUT UCHAR *Channel,
499 OUT LARGE_INTEGER *Timestamp,
500 OUT USHORT *CapabilityInfo,
501 OUT UCHAR Rate[],
502 OUT UCHAR *RateLen,
503 OUT BOOLEAN *ExtendedRateIeExist,
504 OUT UCHAR *Erp);
505 #if defined(RT30xx) || defined(RT305x)
506 VOID EnableAPMIMOPS(
507 IN PRTMP_ADAPTER pAd);
509 VOID DisableAPMIMOPS(
510 IN PRTMP_ADAPTER pAd);
511 #endif
512 #endif // __AP_H__