MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / net / wireless / rtlink.org / rtmp.h
blobcd69e3f100f13c037ac9a7254efb19cb62188d2d
1 /*
2 ***************************************************************************
3 * Ralink Tech Inc.
4 * 4F, No. 2 Technology 5th Rd.
5 * Science-based Industrial Park
6 * Hsin-chu, Taiwan, R.O.C.
8 * (c) Copyright 2002, Ralink Technology, Inc.
10 * All rights reserved. Ralink's source code is an unpublished work and the
11 * use of a copyright notice does not imply otherwise. This source code
12 * contains confidential trade secret material of Ralink Tech. Any attemp
13 * or participation in deciphering, decoding, reverse engineering or in any
14 * way altering the source code is stricitly prohibited, unless the prior
15 * written consent of Ralink Technology, Inc. is obtained.
16 ***************************************************************************
18 Module Name:
19 rtmp.h
21 Abstract:
22 Miniport generic portion header file
24 Revision History:
25 Who When What
26 -------- ---------- ----------------------------------------------
27 Paul Lin 08-01-2002 created
30 #ifndef __RTMP_H__
31 #define __RTMP_H__
33 #include "mlme.h"
34 #include "oid.h"
35 #include "wpa.h"
38 // Defines the state of the LAN media
40 typedef enum _NDIS_MEDIA_STATE
42 NdisMediaStateConnected,
43 NdisMediaStateDisconnected
44 } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
47 // Queue structure and macros
49 typedef struct _QUEUE_ENTRY {
50 struct _QUEUE_ENTRY *Next;
51 } QUEUE_ENTRY, *PQUEUE_ENTRY;
53 // Queue structure
54 typedef struct _QUEUE_HEADER {
55 PQUEUE_ENTRY Head;
56 PQUEUE_ENTRY Tail;
57 ULONG Number;
58 } QUEUE_HEADER, *PQUEUE_HEADER;
60 #define InitializeQueueHeader(QueueHeader) \
61 { \
62 (QueueHeader)->Head = (QueueHeader)->Tail = NULL; \
63 (QueueHeader)->Number = 0; \
66 #define RemoveHeadQueue(QueueHeader) \
67 (QueueHeader)->Head; \
68 { \
69 PQUEUE_ENTRY pNext; \
70 pNext = (QueueHeader)->Head->Next; \
71 (QueueHeader)->Head = pNext; \
72 if (pNext == NULL) \
73 (QueueHeader)->Tail = NULL; \
74 (QueueHeader)->Number--; \
77 #define InsertHeadQueue(QueueHeader, QueueEntry) \
78 { \
79 ((PQUEUE_ENTRY)QueueEntry)->Next = (QueueHeader)->Head; \
80 (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
81 if ((QueueHeader)->Tail == NULL) \
82 (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
83 (QueueHeader)->Number++; \
86 #define InsertTailQueue(QueueHeader, QueueEntry) \
87 { \
88 ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
89 if ((QueueHeader)->Tail) \
90 (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
91 else \
92 (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
93 (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
94 (QueueHeader)->Number++; \
98 // MACRO for debugging information
100 #ifdef RT2500_DBG
101 extern ULONG RTDebugLevel;
103 #define DBGPRINT(Level, fmt, args...) \
105 if (Level <= RTDebugLevel) \
107 printk("%s %d> ", __FILE__, __LINE__); \
108 printk(fmt, ## args); \
111 #else
112 #define DBGPRINT(Level, fmt, args...)
113 #endif
116 // spin_lock enhanced for Nested spin lock
119 //extern unsigned long IrqFlags;
121 #define NdisAllocateSpinLock(lock) \
123 *lock = SPIN_LOCK_UNLOCKED; \
126 #define NdisReleaseSpinLock(lock) \
128 spin_unlock_irqrestore(lock, IrqFlags); \
131 #define NdisAcquireSpinLock(lock) \
133 spin_lock_irqsave(lock, IrqFlags); \
136 #define NdisFreeSpinLock(lock) \
140 #define RTMPFreeSkbBuffer(skb) \
142 dev_kfree_skb_any(skb); \
145 // Assert MACRO to make sure program running
147 #undef ASSERT
148 #define ASSERT(x) \
150 if (!(x)) \
152 printk(KERN_WARNING __FILE__ ":%d assert " #x "failed\n", __LINE__); \
157 // Macros for flag and ref count operations
159 #define RTMP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F))
160 #define RTMP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F))
161 #define RTMP_CLEAR_FLAGS(_M) ((_M)->Flags = 0)
162 #define RTMP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0)
163 #define RTMP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))
165 #define RTMP_INC_RCV_REF(_A) ((_A)->RcvRefCount++)
166 #define RTMP_DEC_RCV_REF(_A) ((_A)->RcvRefCount--)
167 #define RTMP_GET_RCV_REF(_A) ((_A)->RcvRefCount)
169 #define RTMP_INC_SEND_REF(_A) ((_A)->SendRefCount++)
170 #define RTMP_DEC_SEND_REF(_A) ((_A)->SendRefCount--)
171 #define RTMP_GET_SEND_REF(_A) ((_A)->SendRefCount)
173 #define NdisEqualMemory(Source1, Source2, Length) RTMPEqualMemory(Source1, Source2, Length)
176 // MACRO for 32-bit PCI register read / write
178 // Usage : RTMP_IO_READ32(
179 // PRTMP_ADAPTER pAdapter,
180 // ULONG Register_Offset,
181 // PULONG pValue)
183 // RTMP_IO_WRITE32(
184 // PRTMP_ADAPTER pAdapter,
185 // ULONG Register_Offset,
186 // ULONG Value)
188 #ifdef RTMP_EMBEDDED
189 #define RTMP_IO_READ32(_A, _R, _pV) (*_pV = PCIMemRead32(__mem_pci(_A->CSRBaseAddress+_R)))
190 #define RTMP_IO_WRITE32(_A, _R, _V) (PCIMemWrite32(__mem_pci(_A->CSRBaseAddress+_R),_V))
191 #else
192 #define RTMP_IO_READ32(_A, _R, _pV) (*_pV = readl(_A->CSRBaseAddress+_R))
193 #define RTMP_IO_WRITE32(_A, _R, _V) (writel(_V, _A->CSRBaseAddress+_R))
194 #endif
197 // BBP & RF are using indirect access. Before write any value into it.
198 // We have to make sure there is no outstanding command pending via checking busy bit.
200 // Scott:2004-11-29 #define MAX_BUSY_COUNT 10 // Nunber of retry before failing access BBP & RF indirect register
201 #define MAX_BUSY_COUNT 100 // Nunber of retry before failing access BBP & RF indirect register
203 #define RTMP_BBP_IO_WRITE32(_A, _V) \
205 BBPCSR_STRUC Value; \
206 ULONG BusyCnt = 0; \
207 do { \
208 RTMP_IO_READ32(_A, BBPCSR, &Value.word); \
209 if (Value.field.Busy == IDLE) \
210 break; \
211 BusyCnt++; \
212 } while (BusyCnt < MAX_BUSY_COUNT); \
213 if (BusyCnt < MAX_BUSY_COUNT) \
215 RTMP_IO_WRITE32(_A, BBPCSR, _V); \
219 #define RTMP_RF_IO_WRITE32(_A, _V) \
221 RFCSR_STRUC Value; \
222 ULONG BusyCnt = 0; \
223 do { \
224 RTMP_IO_READ32(_A, RFCSR, &(Value.word)); \
225 if (Value.field.Busy == IDLE) \
226 break; \
227 BusyCnt++; \
228 } while (BusyCnt < MAX_BUSY_COUNT); \
229 if (BusyCnt < MAX_BUSY_COUNT) \
231 RTMP_IO_WRITE32(_A, RFCSR, _V); \
235 #define RTMP_BBP_IO_READ32(_A, _pV) \
237 BBPCSR_STRUC Value; \
238 ULONG BusyCnt = 0; \
239 RTMP_BBP_IO_WRITE32(_A, *(_pV)); \
240 do { \
241 RTMP_IO_READ32(_A, BBPCSR, &Value.word);\
242 if (Value.field.Busy == IDLE) \
243 break; \
244 BusyCnt++; \
245 } while (BusyCnt < MAX_BUSY_COUNT); \
246 if (BusyCnt == MAX_BUSY_COUNT) \
247 *(_pV) = 0xff; \
248 else \
249 *(_pV) = Value.field.Value; \
251 // Read BBP register by register's ID
252 #define RTMP_BBP_IO_READ32_BY_REG_ID(_A, _I, _pV) \
254 BBPCSR_STRUC BbpCsr; \
255 BbpCsr.word = 0; \
256 BbpCsr.field.WriteControl = 0; \
257 BbpCsr.field.Busy = 1; \
258 BbpCsr.field.RegNum = _I; \
259 RTMP_BBP_IO_READ32(_A, &BbpCsr.word); \
260 *(_pV) = (UCHAR) BbpCsr.field.Value; \
262 // Write BBP register by register's ID & value
263 #define RTMP_BBP_IO_WRITE32_BY_REG_ID(_A, _I, _V) \
265 BBPCSR_STRUC BbpCsr; \
266 BbpCsr.word = 0; \
267 BbpCsr.field.WriteControl = 1; \
268 BbpCsr.field.Busy = 1; \
269 BbpCsr.field.Value = _V; \
270 BbpCsr.field.RegNum = _I; \
271 RTMP_BBP_IO_WRITE32(_A, BbpCsr.word); \
272 (_A)->PortCfg.BbpWriteLatch[_I] = _V; \
277 // Some utility macros
279 #ifndef min
280 #define min(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
281 #endif
283 #ifndef max
284 #define max(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
285 #endif
287 #define INC_COUNTER(Val) (Val.QuadPart++)
289 #define INFRA_ON(_p) (((_p)->PortCfg.Massoc) == TRUE) // Check Massoc
290 #define ADHOC_ON(_p) (((_p)->PortCfg.Mibss) == TRUE) // check Mibss
292 #define RTMP_SET_PACKET_FRAGMENTS(_p, number) ((_p)->cb[10] = number)
293 #define RTMP_GET_PACKET_FRAGMENTS(_p) ((_p)->cb[10])
294 #define RTMP_SET_PACKET_RTS(_p, number) ((_p)->cb[11] = number)
295 #define RTMP_GET_PACKET_RTS(_p) ((_p)->cb[11])
297 #define MAKE_802_3_HEADER(_p, _pMac1, _pMac2, _pType) \
299 NdisMoveMemory(_p, _pMac1, ETH_LENGTH_OF_ADDRESS); \
300 NdisMoveMemory((_p + ETH_LENGTH_OF_ADDRESS), _pMac2, ETH_LENGTH_OF_ADDRESS); \
301 NdisMoveMemory((_p + ETH_LENGTH_OF_ADDRESS * 2), _pType, LENGTH_802_3_TYPE); \
304 // if pData has no LLC/SNAP (neither RFC1042 nor Bridge tunnel), keep it that way.
305 // else if the received frame is LLC/SNAP-encaped IPX or APPLETALK, preserve the LLC/SNAP field in the result Ethernet frame
306 // else remove the LLC/SNAP field from the result Ethernet frame
307 // Note:
308 // _pData & _DataSize may be altered (remove 8-byte LLC/SNAP) by this MACRO
309 #define CONVERT_TO_802_3(_p8023hdr, _pDA, _pSA, _pData, _DataSize) \
311 char LLC_Len[2]; \
313 if ((!RTMPEqualMemory(SNAP_802_1H, _pData, 6)) && \
314 (!RTMPEqualMemory(SNAP_BRIDGE_TUNNEL, _pData, 6))) \
316 LLC_Len[0] = (UCHAR)(_DataSize / 256); \
317 LLC_Len[1] = (UCHAR)(_DataSize % 256); \
318 MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \
320 else \
322 PUCHAR pProto = _pData + 6; \
324 if ((RTMPEqualMemory(IPX, pProto, 2) || RTMPEqualMemory(APPLE_TALK, pProto, 2)) && \
325 RTMPEqualMemory(SNAP_802_1H, _pData, 6)) \
327 LLC_Len[0] = (UCHAR)(_DataSize / 256); \
328 LLC_Len[1] = (UCHAR)(_DataSize % 256); \
329 MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \
331 else \
333 MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, pProto); \
334 _DataSize -= LENGTH_802_1_H; \
335 _pData += LENGTH_802_1_H; \
341 // Register set pair for initialzation register set definition
343 typedef struct _RTMP_REG_PAIR
345 ULONG Register;
346 ULONG Value;
347 } RTMP_REG_PAIR, *PRTMP_REG_PAIR;
350 // Register set pair for initialzation register set definition
352 typedef struct _RTMP_RF_REGS
354 UCHAR Channel;
355 ULONG R1;
356 ULONG R2;
357 ULONG R3;
358 ULONG R4;
359 } RTMP_RF_REGS, *PRTMP_RF_REGS;
362 // Statistic counter structure
364 typedef struct _COUNTER_802_3
366 // General Stats
367 ULONG GoodTransmits;
368 ULONG GoodReceives;
369 ULONG TxErrors;
370 ULONG RxErrors;
371 ULONG RxNoBuffer;
373 // Ethernet Stats
374 ULONG RcvAlignmentErrors;
375 ULONG OneCollision;
376 ULONG MoreCollisions;
378 } COUNTER_802_3, *PCOUNTER_802_3;
380 typedef struct _COUNTER_802_11 {
381 ULONG Length;
382 LARGE_INTEGER TransmittedFragmentCount;
383 LARGE_INTEGER MulticastTransmittedFrameCount;
384 LARGE_INTEGER FailedCount;
385 LARGE_INTEGER RetryCount;
386 LARGE_INTEGER MultipleRetryCount;
387 LARGE_INTEGER RTSSuccessCount;
388 LARGE_INTEGER RTSFailureCount;
389 LARGE_INTEGER ACKFailureCount;
390 LARGE_INTEGER FrameDuplicateCount;
391 LARGE_INTEGER ReceivedFragmentCount;
392 LARGE_INTEGER MulticastReceivedFrameCount;
393 LARGE_INTEGER FCSErrorCount;
394 } COUNTER_802_11, *PCOUNTER_802_11;
396 typedef struct _COUNTER_RALINK {
397 ULONG TransmittedByteCount; // both successful and failure, used to calculate TX throughput
398 ULONG ReceivedByteCount; // both CRC okay and CRC error, used to calculate RX throughput
399 ULONG BeenDisassociatedCount;
400 ULONG BadCQIAutoRecoveryCount;
401 ULONG PoorCQIRoamingCount;
402 ULONG MgmtRingFullCount;
403 ULONG RxCount;
404 ULONG DecryptCount;
405 ULONG RxRingErrCount;
406 ULONG EncryptCount;
407 ULONG KickTxCount;
408 ULONG TxRingErrCount;
409 LARGE_INTEGER RealFcsErrCount;
410 } COUNTER_RALINK, *PCOUNTER_RALINK;
412 typedef struct _COUNTER_DRS {
413 // to record the each TX rate's quality. 0 is best, the bigger the worse.
414 USHORT TxQuality[MAX_LEN_OF_SUPPORTED_RATES];
415 UCHAR PER[MAX_LEN_OF_SUPPORTED_RATES];
416 USHORT OneSecTxOkCount;
417 USHORT OneSecTxRetryOkCount;
418 USHORT OneSecTxFailCount;
419 UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
420 ULONG CurrTxRateStableTime; // # of second in current TX rate
421 BOOLEAN fNoisyEnvironment;
422 UCHAR LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down
423 } COUNTER_DRS, *PCOUNTER_DRS;
426 // Arcfour Structure Added by PaulWu
428 typedef struct PACKED _ARCFOUR
430 UINT X;
431 UINT Y;
432 UCHAR STATE[256];
433 } ARCFOURCONTEXT, *PARCFOURCONTEXT;
435 // Shared key data structure
436 typedef struct _WEP_KEY {
437 UCHAR KeyLen; // Key length for each key, 0: entry is invalid
438 UCHAR Key[MAX_LEN_OF_KEY]; // right now we implement 4 keys, 128 bits max
439 } WEP_KEY, *PWEP_KEY;
441 // Shared key data structure
442 typedef struct _WPA_KEY {
443 UCHAR KeyLen; // Key length for each key, 0: entry is invalid
444 UCHAR Key[16]; // right now we implement 4 keys, 128 bits max
445 UCHAR RxMic[8];
446 UCHAR TxMic[8];
447 NDIS_802_11_MAC_ADDRESS BssId; // For pairwise key only
448 UCHAR TxTsc[6]; // 48bit TSC value
449 UCHAR RxTsc[6]; // 48bit TSC value
450 UCHAR Type; // Indicate Pairwise / Group
451 } WPA_KEY, *PWPA_KEY;
453 typedef struct _IV_CONTROL_
455 union
457 struct
459 UCHAR rc0;
460 UCHAR rc1;
461 UCHAR rc2;
463 union
465 struct
467 #ifdef BIG_ENDIAN
468 UCHAR KeyID:2;
469 UCHAR ExtIV:1;
470 UCHAR Rsvd:5;
471 #else
472 UCHAR Rsvd:5;
473 UCHAR ExtIV:1;
474 UCHAR KeyID:2;
475 #endif
476 } field;
477 UCHAR Byte;
478 } CONTROL;
479 } field;
481 ULONG word;
482 } IV16;
484 ULONG IV32;
485 } TKIP_IV, *PTKIP_IV;
487 // configuration to be used when this STA starts a new ADHOC network
488 typedef struct _IBSS_CONFIG {
489 USHORT BeaconPeriod;
490 USHORT AtimWin;
491 UCHAR Channel;
492 UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES]; // Supported rates
493 UCHAR SupportedRatesLen;
494 } IBSS_CONFIG, *PIBSS_CONFIG;
496 typedef struct _LED_CONTROL {
497 BOOLEAN fOdd;
498 BOOLEAN fRxActivity;
499 RALINK_TIMER_STRUCT BlinkTimer; // 50 ms periodic timer
500 ULONG LastLedCsr;
501 } LED_CONTROL;
503 typedef struct _BBP_TUNING_STRUCT {
504 BOOLEAN Enable;
505 UCHAR FalseCcaCountUpperBound; // 100 per sec
506 UCHAR FalseCcaCountLowerBound; // 10 per sec
507 UCHAR R17LowerBound; // specified in E2PROM
508 UCHAR R17UpperBound; // 0x68 according to David Tung
509 UCHAR CurrentR17Value;
510 } BBP_TUNING, *PBBP_TUNING;
512 typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
513 BOOLEAN PrimaryInUsed;
514 UCHAR PrimaryRxAnt; // 0:Ant-A, 1:Ant-B
515 UCHAR SecondaryRxAnt; // 0:Ant-A, 1:Ant-B
516 USHORT AvgRssi[2]; // AvgRssi[0]:Ant-A, AvgRssi[1]:Ant-B
517 RALINK_TIMER_STRUCT RxAntDiversityTimer;
518 } SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;
520 // PortConfig
521 typedef struct _PORT_CONFIG {
523 // MIB:ieee802dot11.dot11smt(1).dot11StationConfigTable(1)
524 USHORT CapabilityInfo;
525 USHORT Psm; // power management mode (PWR_ACTIVE|PWR_SAVE)
526 USHORT BeaconPeriod; // in units of TU
528 USHORT CfpMaxDuration;
529 USHORT CfpDurRemain;
530 USHORT CfpCount;
531 USHORT CfpPeriod;
533 USHORT DisassocReason;
534 MACADDR DisassocSta;
535 USHORT DeauthReason;
536 MACADDR DeauthSta;
537 USHORT AuthFailReason;
538 MACADDR AuthFailSta;
540 NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
541 NDIS_802_11_WEP_STATUS WepStatus;
543 // MIB:ieee802dot11.dot11smt(1).dot11WEPDefaultKeysTable(3)
544 WEP_KEY SharedKey[SHARE_KEY_NO]; // Keep for backward compatiable
545 WPA_KEY PairwiseKey[PAIRWISE_KEY_NO];
546 WPA_KEY GroupKey[GROUP_KEY_NO];
547 WPA_KEY PskKey; // WPA PSK mode PMK
548 UCHAR PTK[64];
550 // WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
551 UCHAR PortSecured;
553 // For WPA countermeasures
554 ULONG LastMicErrorTime; // record last MIC error time
555 ULONG MicErrCnt; // Should be 0, 1, 2, then reset to zero (after disassoiciation).
556 BOOLEAN bBlockAssoc; // Block associate attempt for 60 seconds after counter measure occurred.
557 // For WPA-PSK supplicant state
558 WPA_STATE WpaState; // Default is SS_NOTUSE and handled by microsoft 802.1x
559 UCHAR ReplayCounter[8];
560 UCHAR ANonce[32]; // ANonce for WPA-PSK from aurhenticator
561 UCHAR SNonce[32]; // SNonce for WPA-PSK
563 // MIB:ieee802dot11.dot11smt(1).dot11WEPKeyMappingsTable(4)
564 // not implemented yet
566 // MIB:ieee802dot11.dot11smt(1).dot11PrivacyTable(5)
567 UCHAR DefaultKeyId;
568 NDIS_802_11_PRIVACY_FILTER PrivacyFilter; // PrivacyFilter enum for 802.1X
570 // MIB:ieee802dot11.dot11mac(2).dot11OperationTable(1)
571 USHORT RtsThreshold; // in units of BYTE
572 USHORT FragmentThreshold;
573 BOOLEAN bFragmentZeroDisable; // Microsoft use 0 as disable
575 // MIB:ieee802dot11.dot11phy(4).dot11PhyAntennaTable(2)
576 UCHAR CurrentTxAntenna;
577 UCHAR CurrentRxAntenna;
578 UCHAR NumberOfAntenna;
580 // MIB:ieee802dot11.dot11phy(4).dot11PhyTxPowerTable(3)
581 UCHAR CurrentTxPowerLevelIndex; //default&other value=MaxPower,1=MinPower,2=1*MaxPower/4,3=2*MaxPower/4,4=3*MaxPower/4,
582 UCHAR TxPower;
583 UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ...
584 BOOLEAN EnableAutoRateSwitching; // 1 - enable auto rate switching; 0 - disable
585 ULONG TxPowerPercentage; // 0~100 %
587 // MIB:ieee802dot11.dot11phy(4).dot11PhyDSSSTable(5)
588 UCHAR Channel; // current (I)BSS channel used in the station
589 UCHAR CountryRegion; // Enum of country region, 0:FCC, 1:IC, 2:ETSI, 3:SPAIN, 4:France, 5:MKK, 6:MKK1, 7:Israel
591 // MIB:ieee802dot11.dot11phy(4).dot11AntennasListTable(8)
592 BOOLEAN AntennaSupportTx;
593 BOOLEAN AntennaSupportRx;
594 BOOLEAN AntennaSupportDiversityRx;
596 // Use user changed MAC
597 BOOLEAN bLocalAdminMAC;
599 // MIB:ieee802dot11.dot11phy(4).dot11SupportedDataRatesTxTable(9)
600 // MIB:ieee802dot11.dot11phy(4).dot11SupportedDataRatesRxTable(10)
601 UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES]; // Supported rates
602 UCHAR SupportedRatesLen;
603 UCHAR ExpectedACKRate[MAX_LEN_OF_SUPPORTED_RATES];
604 // Copy supported rate from desired AP's beacon. We are trying to match
605 // AP's supported and extended rate settings.
606 UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
607 UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
608 UCHAR SupRateLen;
609 UCHAR ExtRateLen;
612 // other parameters not defined in standard MIB
614 UCHAR DesiredRates[MAX_LEN_OF_SUPPORTED_RATES]; // OID_802_11_DESIRED_RATES
615 UCHAR MaxDesiredRate;
616 USHORT RecvDtim;
617 MACADDR Bssid;
618 MACADDR Broadcast; // FF:FF:FF:FF:FF:FF
619 USHORT Pss; // current power saving status (PWR_SAVE|PWR_ACTIVE)
620 UCHAR RssiTrigger;
621 UCHAR RssiTriggerMode; // RSSI_TRIGGERED_UPON_BELOW_THRESHOLD or RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD
622 UCHAR LastRssi; // last received BEACON's RSSI
623 USHORT AvgRssi; // last 8 BEACON's average RSSI
624 USHORT AtimWin; // in kusec; IBSS parameter set element
625 USHORT Aid; // association ID
626 UCHAR RtsRate; // RATE_xxx
627 UCHAR MlmeRate; // RATE_xxx, used to send MLME frames
628 UCHAR MaxTxRate; // RATE_xxx
629 USHORT DefaultListenCount; // default listen count;
630 UCHAR BssType; // BSS_INFRA or BSS_INDEP
632 UCHAR SsidLen; // the actual ssid length in used
633 CHAR Ssid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
635 BSS_TABLE BssTab; // BSS Table
637 // global variables mXXXX used in MAC protocol state machines
638 BOOLEAN Mibss;
639 BOOLEAN Massoc;
640 BOOLEAN Mauth;
642 // PHY specification
643 UCHAR PhyMode; // PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED
644 USHORT Dsifs; // in units of usec
646 ULONG WindowsPowerMode; // Power mode for AC power
647 ULONG WindowsBatteryPowerMode; // Power mode for battery if exists
648 BOOLEAN WindowsACCAMEnable; // Enable CAM power mode when AC on
649 ULONG PacketFilter; // Packet filter for receiving
650 BOOLEAN AutoReconnect; // Set to TRUE when setting OID_802_11_SSID with no matching BSSID
652 ULONG WindowsTxPreamble; // Rt802_11PreambleLong, Rt802_11PreambleShort, Rt802_11PreambleAuto
654 UCHAR ChannelTxPower[MAX_LEN_OF_CHANNELS]; // Store Tx power value for all channels.
655 UCHAR ChannelTssiRef[MAX_LEN_OF_CHANNELS]; // Store Tssi Reference value for all channels.
656 UCHAR ChannelTssiDelta; // Store Tx TSSI delta increment / decrement value
657 BOOLEAN bAutoTxAgc;
658 UCHAR ChannelList[MAX_LEN_OF_CHANNELS]; // list all supported channels for site survey
659 UCHAR ChannelListNum; // number of channel in ChannelList[]
660 BOOLEAN bShowHiddenSSID;
662 // configuration to be used when this STA starts a new ADHOC network
663 IBSS_CONFIG IbssConfig;
665 ULONG LastBeaconRxTime; // OS's timestamp of the last BEACON RX time
666 ULONG Last11bBeaconRxTime; // OS's timestamp of the last 11B BEACON RX time
667 ULONG LastScanTime; // Record last scan time for issue BSSID_SCAN_LIST
668 ULONG IgnoredScanNumber; // Ignored BSSID_SCAN_LIST requests
669 BOOLEAN bSwRadio; // Software controlled Radio On/Off, TRUE: On
670 BOOLEAN bHwRadio; // Hardware controlled Radio On/Off, TRUE: On
671 BOOLEAN bRadio; // Radio state, And of Sw & Hw radio state
672 BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
674 LED_CONTROL LedCntl;
675 UCHAR RfType;
676 UCHAR LedMode;
677 RALINK_TIMER_STRUCT RfTuningTimer;
679 // New for WPA, windows want us to to keep association information and
680 // Fixed IEs from last association response
681 NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo;
682 // NDIS_802_11_FIXED_IEs FixIEs;
683 UCHAR ReqVarIELen; // Length of next VIE include EID & Length
684 UCHAR ReqVarIEs[MAX_VIE_LEN];
685 UCHAR ResVarIELen; // Length of next VIE include EID & Length
686 UCHAR ResVarIEs[MAX_VIE_LEN];
688 // the following fields are user setting from UI
689 ULONG EnableTurboRate; // 0: disable, 1: enable 72/100 Mbps whenever applicable
690 ULONG EnableTxBurst; // 0: disable, 1: enable TX PACKET BURST
691 ULONG UseBGProtection; // 0: auto, 1: always use, 2: always not use
692 ULONG UseShortSlotTime; // 0: disable, 1: enable 9us short slot time if AP supports
693 ULONG AdhocMode; // 0:WIFI mode (11b rates only), 1:allow OFDM rates
695 // this flag is the result calculated from UI settings and AP's ERP/Capability
696 ULONG BGProtectionInUsed; // 0: not in-used, 1: in-used
697 ULONG ShortSlotInUsed; // 0: not in-used, 1: in-used
698 USHORT TxPreambleInUsed; // Rt802_11PreambleLong, Rt802_11PreambleShort
700 // PCI clock adjustment round
701 UCHAR PciAdjustmentRound;
703 // latch th latest RF programming value here since RF IC doesn't support READ operation
704 RTMP_RF_REGS LatchRfRegs;
706 BOOLEAN BbpTuningEnable;
707 UCHAR VgcLowerBound;
708 RT_802_11_RX_AGC_VGC_TUNING BbpTuning;
709 UCHAR LastR17Value;
711 ULONG SystemErrorBitmap; // b0: E2PROM version error
713 // This soft Rx Antenna Diversity mechanism is used only when user set
714 // RX Antenna = DIVERSITY ON
715 SOFT_RX_ANT_DIVERSITY RxAnt;
717 ULONG Rt2560Version; // MAC/BBP serial interface issue solved after ver.D
718 ULONG EepromVersion; // byte 0: version, byte 1: revision, byte 2~3: unused
719 UCHAR BbpWriteLatch[100]; // record last BBP register value written via BBP_IO_WRITE
720 // ULONG CurrTxRateStableTime; // # of second in current TX rate
721 // UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
722 } PORT_CONFIG, *PPORT_CONFIG;
724 typedef struct _MLME_MEMORY_STRUCT {
725 PVOID AllocVa; //Pointer to the base virtual address of the allocated memory
726 struct _MLME_MEMORY_STRUCT *Next; //Pointer to the next virtual address of the allocated memory
727 } MLME_MEMORY_STRUCT, *PMLME_MEMORY_STRUCT;
729 typedef struct _MLME_MEMORY_HANDLER {
730 BOOLEAN MemRunning; //The flag of the Mlme memory handler's status
731 UINT MemoryCount; //Total nonpaged system-space memory not size
732 UINT InUseCount; //Nonpaged system-space memory in used counts
733 UINT UnUseCount; //Nonpaged system-space memory available counts
734 UINT PendingCount; //Nonpaged system-space memory for free counts
735 UINT PendingHead;
736 UINT PendingTail;
737 PMLME_MEMORY_STRUCT pInUseHead; //Pointer to the first nonpaed memory not used
738 PMLME_MEMORY_STRUCT pInUseTail; //Pointer to the last nonpaged memory not used
739 PMLME_MEMORY_STRUCT pUnUseHead; //Pointer to the first nonpaged memory in used
740 PMLME_MEMORY_STRUCT pUnUseTail; //Pointer to the last nonpaged memory in used
741 PULONG MemFreePending[MAX_MLME_HANDLER_MEMORY]; //an array to keep pending free-memory's pointer (32bits)
742 } MLME_MEMORY_HANDLER, *PMLME_MEMORY_HANDLER;
744 typedef struct _MLME_STRUCT {
745 STATE_MACHINE CntlMachine, AssocMachine, AuthMachine, AuthRspMachine, SyncMachine, WpaPskMachine;
746 STATE_MACHINE_FUNC CntlFunc[CNTL_FUNC_SIZE], AssocFunc[ASSOC_FUNC_SIZE];
747 STATE_MACHINE_FUNC AuthFunc[AUTH_FUNC_SIZE], AuthRspFunc[AUTH_RSP_FUNC_SIZE];
748 STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE], WpaPskFunc[WPA_PSK_FUNC_SIZE];
750 ASSOC_AUX AssocAux;
751 AUTH_AUX AuthAux;
752 AUTH_RSP_AUX AuthRspAux;
753 SYNC_AUX SyncAux;
754 CNTL_AUX CntlAux;
756 COUNTER_802_11 PrevWlanCounters;
757 ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming
759 BOOLEAN Running;
760 spinlock_t TaskLock;
761 MLME_QUEUE Queue;
763 UINT ShiftReg;
764 PSPOLL_FRAME PsFr;
765 MACHDR NullFr;
767 RALINK_TIMER_STRUCT PeriodicTimer;
768 ULONG PeriodicRound;
769 ULONG PrevTxCnt;
771 MLME_MEMORY_HANDLER MemHandler; //The handler of the nonpaged memory inside MLME
772 } MLME_STRUCT, *PMLME_STRUCT;
775 // Management ring buffer format
777 typedef struct _MGMT_STRUC {
778 BOOLEAN Valid;
779 PUCHAR pBuffer;
780 ULONG Length;
781 } MGMT_STRUC, *PMGMT_STRUC;
784 // P802.11 Frame control field, 16 bit
786 typedef struct PACKED _FRAME_CONTROL {
787 #ifdef BIG_ENDIAN
788 USHORT Order:1;
789 USHORT Wep:1;
790 USHORT MoreData:1;
791 USHORT PwrMgt:1;
792 USHORT Retry:1;
793 USHORT MoreFrag:1;
794 USHORT FrDs:1;
795 USHORT ToDs:1;
796 USHORT Subtype:4;
797 USHORT Type:2;
798 USHORT Ver:2;
799 #else
800 USHORT Ver:2; // Protocol version
801 USHORT Type:2; // MSDU type
802 USHORT Subtype:4; // MSDU subtype
803 USHORT ToDs:1; // To DS indication
804 USHORT FrDs:1; // From DS indication
805 USHORT MoreFrag:1; // More fragment bit
806 USHORT Retry:1; // Retry status bit
807 USHORT PwrMgt:1; // Power management bit
808 USHORT MoreData:1; // More data bit
809 USHORT Wep:1; // Wep data
810 USHORT Order:1; // Strict order expected
811 #endif
812 } FRAME_CONTROL, *PFRAME_CONTROL;
815 // P802.11 intermediate header format
817 typedef struct PACKED _CONTROL_HEADER {
818 FRAME_CONTROL Frame; // Frame control structure
819 USHORT Duration; // Duration value
820 MACADDR Addr1; // Address 1 field
821 MACADDR Addr2; // Address 2 field
822 } CONTROL_HEADER, *PCONTROL_HEADER;
825 // P802.11 header format
827 typedef struct PACKED _HEADER_802_11 {
828 CONTROL_HEADER Controlhead;
829 MACADDR Addr3; // Address 3 field
830 #ifdef BIG_ENDIAN
831 USHORT Sequence:12; // Sequence number
832 USHORT Frag:4; // Fragment number
833 #else
834 USHORT Frag:4; // Fragment number
835 USHORT Sequence:12; // Sequence number
836 #endif
837 } HEADER_802_11, *PHEADER_802_11;
840 // Receive Tuple Cache Format
842 typedef struct PACKED _TUPLE_CACHE {
843 BOOLEAN Valid;
844 MACADDR MAC;
845 USHORT Sequence;
846 USHORT Frag;
847 } TUPLE_CACHE, *PTUPLE_CACHE;
850 // Fragment Frame structure
852 typedef struct PACKED _FRAGMENT_FRAME {
853 UCHAR Header802_3[14];
854 UCHAR Header_LLC[8];
855 UCHAR Buffer[MAX_FRAME_SIZE];
856 ULONG RxSize;
857 USHORT Sequence;
858 USHORT LastFrag;
859 ULONG Flags; // Some extra frame information. bit 0: LLC presented
860 } FRAGMENT_FRAME, *PFRAGMENT_FRAME;
863 // Tkip Key structure which RC4 key & MIC calculation
865 typedef struct PACKED _TKIP_KEY_INFO {
866 UINT nBytesInM; // # bytes in M for MICKEY
867 ULONG IV16;
868 ULONG IV32;
869 ULONG K0; // for MICKEY Low
870 ULONG K1; // for MICKEY Hig
871 ULONG L; // Current state for MICKEY
872 ULONG R; // Current state for MICKEY
873 ULONG M; // Message accumulator for MICKEY
874 UCHAR RC4KEY[16];
875 UCHAR MIC[8];
876 } TKIP_KEY_INFO, *PTKIP_KEY_INFO;
879 // Private / Misc data, counters for driver internal use
881 typedef struct __PRIVATE_STRUC {
882 ULONG SystemResetCnt; // System reset counter
883 ULONG TxRingFullCnt; // Tx ring full occurrance number
884 ULONG ResetCountDown; // Count down before issue reset, patch for RT2430
885 ULONG CCAErrCnt; // CCA error count, for debug purpose, might move to global counter
886 ULONG PhyRxErrCnt; // PHY Rx error count, for debug purpose, might move to global counter
887 ULONG PhyTxErrCnt; // PHY Tx error count, for debug purpose, might move to global counter
888 // Variables for WEP encryption / decryption in rtmp_wep.c
889 ULONG FCSCRC32;
890 ULONG RxSetCnt;
891 ULONG DecryptCnt;
892 ARCFOURCONTEXT WEPCONTEXT;
893 // Tkip stuff
894 TKIP_KEY_INFO Tx;
895 TKIP_KEY_INFO Rx;
896 } PRIVATE_STRUC, *PPRIVATE_STRUC;
899 // All DMA ring formats
901 struct ring_desc {
902 // Descriptor size & dma address
903 u32 size;
904 void *va_addr;
905 dma_addr_t pa_addr;
906 // Dma buffer size and address for real transfer
907 u32 data_size;
908 void *va_data_addr;
909 dma_addr_t pa_data_addr;
910 UCHAR FrameType; // Type of frame in ring buffer
913 #ifdef RALINK_ATE
914 typedef struct _ATE_INFO {
915 UCHAR Mode;
916 UCHAR TxPower;
917 UCHAR Addr1[6];
918 UCHAR Addr2[6];
919 UCHAR Addr3[6];
920 UCHAR Channel;
921 ULONG TxLength;
922 ULONG TxCount;
923 ULONG TxDoneCount;
924 ULONG TxRate;
925 } ATE_INFO, *PATE_INFO;
926 #endif //#ifdef RALINK_ATE
929 // The miniport adapter structure
931 typedef struct _RTMP_ADAPTER
933 char nickn[IW_ESSID_MAX_SIZE+1]; // nickname, only used in the iwconfig i/f
934 int chip_id;
936 unsigned long CSRBaseAddress; // PCI MMIO Base Address, all access will use
937 // NdisReadRegisterXx or NdisWriteRegisterXx
939 // configuration
940 UCHAR PermanentAddress[ETH_LENGTH_OF_ADDRESS]; // Factory default MAC address
941 UCHAR CurrentAddress[ETH_LENGTH_OF_ADDRESS]; // User changed MAC address
943 UCHAR EEPROMAddressNum; // 93c46=6 93c66=8
944 USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS];
946 // resource for DMA operation
947 struct ring_desc TxRing[TX_RING_SIZE]; // Tx Ring
948 struct ring_desc AtimRing[ATIM_RING_SIZE]; // Atim Ring
949 struct ring_desc PrioRing[PRIO_RING_SIZE]; // Priority Ring
950 struct ring_desc RxRing[RX_RING_SIZE]; // Rx Ring
951 struct ring_desc BeaconRing; // Beacon Ring, only one
953 MGMT_STRUC MgmtRing[MGMT_RING_SIZE]; // management ring size
955 ULONG CurRxIndex; // Next RxD read pointer
956 ULONG CurDecryptIndex; // Next RxD decrypt read pointer
957 ULONG CurTxIndex; // Next TxD write pointer
958 ULONG CurEncryptIndex; // Next TxD encrypt write pointer
959 ULONG CurAtimIndex; // Next AtimD write pointer
960 ULONG CurPrioIndex; // Next PrioD write pointer
961 ULONG PushMgmtIndex; // Next SW management ring index
962 ULONG PopMgmtIndex; // Next SW management ring index
963 ULONG MgmtQueueSize; // Number of Mgmt request stored in MgmtRing
964 ULONG NextEncryptDoneIndex;
965 ULONG NextTxDoneIndex;
966 ULONG NextAtimDoneIndex;
967 ULONG NextPrioDoneIndex;
968 ULONG NextDecryptDoneIndex;
970 // 802.3 multicast support
971 ULONG NumberOfMcAddresses; // Number of mcast entry exists
972 UCHAR McastTable[MAX_MCAST_LIST_SIZE][ETH_LENGTH_OF_ADDRESS]; // Mcast list
973 //flags
974 ULONG Flags; // Represent current device status
976 // Tx software priority queue list, 802.1q priority information mapped as.
977 // 0,1 -> queue0, 2,3 -> queue1, 4,5 -> queue2, 6,7 -> queue3
978 QUEUE_HEADER TxSwQueue0; // Tx software priority queue 0 mapped to 0.1
979 QUEUE_HEADER TxSwQueue1; // Tx software priority queue 1 mapped to 2.3
980 QUEUE_HEADER TxSwQueue2; // Tx software priority queue 2 mapped to 4.5
981 QUEUE_HEADER TxSwQueue3;
983 USHORT Sequence; // Current sequence number
985 TUPLE_CACHE TupleCache[MAX_CLIENT]; // Maximum number of tuple caches, only useful in Ad-Hoc
986 UCHAR TupleCacheLastUpdateIndex; // 0..MAX_CLIENT-1
987 FRAGMENT_FRAME FragFrame; // Frame storage for fragment frame
989 // For MiniportTransferData
990 PUCHAR pRxData; // Pointer to current RxRing offset / fragment frame offset
992 // Counters for 802.3 & generic.
993 // Add 802.11 specific counters later
994 COUNTER_802_3 Counters; // 802.3 counters
995 COUNTER_802_11 WlanCounters; // 802.11 MIB counters
996 COUNTER_RALINK RalinkCounters; // Ralink propriety counters
997 COUNTER_DRS DrsCounters; // counters for Dynamic Rate Switching
999 NDIS_MEDIA_STATE MediaState;
1001 PRIVATE_STRUC PrivateInfo; // Private information & counters
1003 // SpinLocks
1004 spinlock_t TxRingLock; // Tx Ring spinlock
1005 spinlock_t PrioRingLock; // Prio Ring spinlock
1006 spinlock_t AtimRingLock; // Atim Ring spinlock
1007 spinlock_t RxRingLock; // Rx Ring spinlock
1008 spinlock_t TxSwQueueLock; // SendTxWaitQueue spinlock
1009 spinlock_t MemLock; // Memory handler spinlock
1011 // Boolean control for packet filter
1012 BOOLEAN bAcceptDirect;
1013 BOOLEAN bAcceptMulticast;
1014 BOOLEAN bAcceptBroadcast;
1015 BOOLEAN bAcceptAllMulticast;
1017 // Control to check Tx hang
1018 BOOLEAN bTxBusy;
1019 PQUEUE_ENTRY FirstEntryInQueue; // The first packet in Tx queue
1021 // Control disconnect / connect event generation
1022 ULONG LinkDownTime;
1023 ULONG LastRxRate;
1024 UCHAR LastSsidLen; // the actual ssid length in used
1025 CHAR LastSsid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
1026 MACADDR LastBssid;
1027 BOOLEAN bConfigChanged;
1029 PORT_CONFIG PortCfg;
1030 MLME_STRUCT Mlme;
1032 struct pci_dev *pPci_Dev;
1033 struct net_device *net_dev;
1035 RALINK_TIMER_STRUCT timer; // Periodic Media monitoring timer.
1037 BOOLEAN bNetDeviceStopQueue;
1038 BOOLEAN NeedSwapToLittleEndian;
1040 #if WIRELESS_EXT >= 12
1041 struct iw_statistics iw_stats;
1042 #endif
1043 struct net_device_stats stats;
1045 #ifdef RALINK_ATE
1046 ATE_INFO ate;
1047 #endif //#ifdef RALINK_ATE
1048 } RTMP_ADAPTER, *PRTMP_ADAPTER;
1051 // SHA context
1053 typedef struct
1055 ULONG H[5];
1056 ULONG W[80];
1057 INT lenW;
1058 ULONG sizeHi, sizeLo;
1059 } SHA_CTX;
1062 // Enable & Disable NIC interrupt via writing interrupt mask register
1063 // Since it use ADAPTER structure, it have to be put after structure definition.
1065 inline VOID NICDisableInterrupt(
1066 IN PRTMP_ADAPTER pAdapter);
1068 inline VOID NICEnableInterrupt(
1069 IN PRTMP_ADAPTER pAdapter);
1071 BOOLEAN NICCheckForHang(
1072 IN PRTMP_ADAPTER pAd);
1075 INT RT2500_close(
1076 IN struct net_device *net_dev);
1078 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
1079 irqreturn_t RTMPIsr(
1080 IN INT irq,
1081 IN VOID *dev_instance,
1082 IN struct pt_regs *rgs);
1083 #else
1084 VOID RTMPIsr(
1085 IN INT irq,
1086 IN VOID *dev_instance,
1087 IN struct pt_regs *rgs);
1088 #endif
1090 VOID RT2500_timer(
1091 IN unsigned long data);
1093 INT RT2500_open(
1094 IN struct net_device *net_dev);
1096 INT RTMPSendPackets(
1097 IN struct sk_buff *skb,
1098 IN struct net_device *net_dev);
1100 INT RT2500_probe(
1101 IN struct pci_dev *pPci_Dev,
1102 IN const struct pci_device_id *ent);
1104 INT RT2500_ioctl(
1105 IN struct net_device *net_dev,
1106 IN OUT struct ifreq *rq,
1107 IN INT cmd);
1109 VOID RTMPRingCleanUp(
1110 IN PRTMP_ADAPTER pAdapter,
1111 IN UCHAR RingType);
1113 #if WIRELESS_EXT >= 12
1114 struct iw_statistics *RT2500_get_wireless_stats(
1115 IN struct net_device *net_dev);
1116 #endif
1118 struct net_device_stats *RT2500_get_ether_stats(
1119 IN struct net_device *net_dev);
1121 VOID RT2500_set_rx_mode(
1122 IN struct net_device *net_dev);
1124 NDIS_STATUS RTMPAllocDMAMemory(
1125 IN PRTMP_ADAPTER pAd);
1127 VOID RTMPFreeDMAMemory(
1128 IN PRTMP_ADAPTER pAd);
1130 VOID NICReadEEPROMParameters(
1131 IN PRTMP_ADAPTER pAdapter);
1133 VOID NICInitAsicFromEEPROM(
1134 IN PRTMP_ADAPTER pAdapter);
1136 VOID NICInitTransmit(
1137 IN PRTMP_ADAPTER pAdapter);
1139 NDIS_STATUS NICReadAdapterInfo(
1140 IN PRTMP_ADAPTER pAdapter);
1142 VOID NICInitializeAdapter(
1143 IN PRTMP_ADAPTER pAdapter);
1145 VOID NICInitializeAsic(
1146 IN PRTMP_ADAPTER pAdapter);
1148 VOID NICIssueReset(
1149 IN PRTMP_ADAPTER pAdapter);
1151 VOID PortCfgInit(
1152 IN PRTMP_ADAPTER pAdapter);
1154 VOID NICResetFromError(
1155 IN PRTMP_ADAPTER pAdapter);
1157 PUCHAR RTMPFindSection(
1158 IN PCHAR buffer,
1159 IN PCHAR section);
1161 INT RTMPIsFindSection(
1162 IN PUCHAR ptr,
1163 IN PUCHAR buffer);
1165 INT RTMPGetKeyParameter(
1166 IN PUCHAR section,
1167 IN PCHAR key,
1168 OUT PCHAR dest,
1169 IN INT destsize,
1170 IN PCHAR buffer);
1172 VOID RTMPReadParametersFromFile(
1173 IN PRTMP_ADAPTER pAd);
1175 ULONG RTMPEqualMemory(
1176 IN PVOID pSrc1,
1177 IN PVOID pSrc2,
1178 IN ULONG Length);
1180 ULONG RTMPCompareMemory(
1181 IN PVOID pSrc1,
1182 IN PVOID pSrc2,
1183 IN ULONG Length);
1185 VOID NdisZeroMemory(
1186 IN PVOID pSrc,
1187 IN ULONG Length);
1189 VOID NdisMoveMemory(
1190 OUT PVOID pDest,
1191 IN PVOID pSrc,
1192 IN ULONG Length);
1194 void AtoH(char * src, UCHAR * dest, int destlen);
1195 UCHAR BtoH(char ch);
1197 VOID RTMPInitTimer(
1198 IN PRTMP_ADAPTER pAdapter,
1199 IN PRALINK_TIMER_STRUCT pTimer,
1200 IN PVOID pTimerFunc);
1202 VOID RTMPSetTimer(
1203 IN PRTMP_ADAPTER pAdapter,
1204 IN PRALINK_TIMER_STRUCT pTimer,
1205 IN ULONG Value);
1207 VOID RTMPCancelTimer(
1208 IN PRALINK_TIMER_STRUCT pTimer);
1211 // Private routines in rtmp_data.c
1213 VOID RTMPHandleRxDoneInterrupt(
1214 IN PRTMP_ADAPTER pAdapter);
1216 VOID RTMPHandleTxRingTxDoneInterrupt(
1217 IN PRTMP_ADAPTER pAdapter);
1219 VOID RTMPHandlePrioRingTxDoneInterrupt(
1220 IN PRTMP_ADAPTER pAdapter);
1222 VOID RTMPHandleAtimRingTxDoneInterrupt(
1223 IN PRTMP_ADAPTER pAdapter);
1225 VOID RTMPHandleTbcnInterrupt(
1226 IN PRTMP_ADAPTER pAdapter);
1228 VOID RTMPHandleTwakeupInterrupt(
1229 IN PRTMP_ADAPTER pAdapter);
1231 VOID RTMPHandleDecryptionDoneInterrupt(
1232 IN PRTMP_ADAPTER pAdapter);
1234 VOID RTMPHandleEncryptionDoneInterrupt(
1235 IN PRTMP_ADAPTER pAdapter);
1237 VOID RTMPHardTransmitDone(
1238 IN PRTMP_ADAPTER pAdapter,
1239 IN PTXD_STRUC pTxD,
1240 IN UCHAR FrameType);
1242 NDIS_STATUS RTMPSendPacket(
1243 IN PRTMP_ADAPTER pAdapter,
1244 IN struct sk_buff *skb);
1246 //VOID RTMPDeQueuePacket(
1247 // IN PRTMP_ADAPTER pAdapter,
1248 // IN PQUEUE_HEADER pQueue);
1250 VOID RTMPDeQueuePacket(
1251 IN PRTMP_ADAPTER pAdapter);
1253 NDIS_STATUS RTMPHardEncrypt(
1254 IN PRTMP_ADAPTER pAdapter,
1255 IN struct sk_buff *skb,
1256 IN UCHAR NumberRequired,
1257 IN ULONG EnableTxBurst,
1258 IN UCHAR AccessCategory);
1260 NDIS_STATUS RTMPHardTransmit(
1261 IN PRTMP_ADAPTER pAdapter,
1262 IN struct sk_buff *skb,
1263 IN UCHAR NumberRequired);
1265 NDIS_STATUS RTMPFreeDescriptorRequest(
1266 IN PRTMP_ADAPTER pAdapter,
1267 IN UCHAR RingType,
1268 IN UCHAR NumberRequired);
1270 VOID MlmeHardTransmit(
1271 IN PRTMP_ADAPTER pAdapter,
1272 IN PVOID pBuffer,
1273 IN ULONG Length);
1275 USHORT RTMPCalcDuration(
1276 IN PRTMP_ADAPTER pAdapter,
1277 IN UCHAR Rate,
1278 IN ULONG Size);
1280 VOID RTMPWriteTxDescriptor(
1281 IN PTXD_STRUC pTxD,
1282 IN BOOLEAN DoEncrypt,
1283 IN UCHAR CipherAlg,
1284 IN BOOLEAN Ack,
1285 IN BOOLEAN Fragment,
1286 IN BOOLEAN InsTimestamp,
1287 IN UCHAR RetryMode,
1288 IN UCHAR Ifs,
1289 IN UINT Rate,
1290 IN UCHAR Service,
1291 IN ULONG Length,
1292 IN USHORT TxPreamble,
1293 IN UCHAR AccessCategory);
1295 BOOLEAN RTMPSearchTupleCache(
1296 IN PRTMP_ADAPTER pAdapter,
1297 IN PHEADER_802_11 pHeader);
1299 VOID RTMPUpdateTupleCache(
1300 IN PRTMP_ADAPTER pAdapter,
1301 IN PHEADER_802_11 pHeader);
1303 VOID RTMPSuspendMsduTransmission(
1304 IN PRTMP_ADAPTER pAdapter);
1306 VOID RTMPResumeMsduTransmission(
1307 IN PRTMP_ADAPTER pAdapter);
1309 NDIS_STATUS MiniportMMRequest(
1310 IN PRTMP_ADAPTER pAdapter,
1311 IN PVOID pBuffer,
1312 IN ULONG Length);
1314 VOID RTMPSendNullFrame(
1315 IN PRTMP_ADAPTER pAdapter,
1316 IN PVOID pBuffer,
1317 IN ULONG Length,
1318 IN UCHAR TxRate);
1320 inline NDIS_STATUS RTMPCheckRxDescriptor(
1321 IN PRXD_STRUC pRxD);
1323 NDIS_STATUS RTMPApplyPacketFilter(
1324 IN PRTMP_ADAPTER pAdapter,
1325 IN PRXD_STRUC pRxD,
1326 IN PHEADER_802_11 pHeader);
1328 PQUEUE_HEADER RTMPCheckTxSwQueue(
1329 IN PRTMP_ADAPTER pAdapter,
1330 OUT ULONG *Number,
1331 OUT UCHAR *AccessCategory);
1333 #ifdef BIG_ENDIAN
1334 inline VOID RTMPDescriptorEndianChange(
1335 IN PUCHAR pData,
1336 IN ULONG DescriptorType);
1338 VOID RTMPFrameEndianChange(
1339 IN PRTMP_ADAPTER pAdapter,
1340 IN PUCHAR pData,
1341 IN ULONG Dir,
1342 IN BOOLEAN FromRxDoneInt);
1343 #endif
1345 VOID RTMPReportMicError(
1346 IN PRTMP_ADAPTER pAdapter,
1347 IN PWPA_KEY pWpaKey);
1349 // Private routines in rtmp_wep.c
1351 VOID RTMPInitWepEngine(
1352 IN PRTMP_ADAPTER pAdapter,
1353 IN PUCHAR pKey,
1354 IN UCHAR KeyId,
1355 IN UCHAR KeyLen,
1356 IN PUCHAR pDest);
1358 VOID RTMPEncryptData(
1359 IN PRTMP_ADAPTER pAdapter,
1360 IN PUCHAR pSrc,
1361 IN PUCHAR pDest,
1362 IN UINT Len);
1364 BOOLEAN RTMPDecryptData(
1365 IN PRTMP_ADAPTER pAdapter,
1366 IN PUCHAR pSrc,
1367 IN UINT Len);
1369 VOID RTMPSetICV(
1370 IN PRTMP_ADAPTER pAdapter,
1371 IN PUCHAR pDest);
1373 VOID ARCFOUR_INIT(
1374 IN PARCFOURCONTEXT Ctx,
1375 IN PUCHAR pKey,
1376 IN UINT KeyLen);
1378 UCHAR ARCFOUR_BYTE(
1379 IN PARCFOURCONTEXT Ctx);
1381 VOID ARCFOUR_DECRYPT(
1382 IN PARCFOURCONTEXT Ctx,
1383 IN PUCHAR pDest,
1384 IN PUCHAR pSrc,
1385 IN UINT Len);
1387 VOID ARCFOUR_ENCRYPT(
1388 IN PARCFOURCONTEXT Ctx,
1389 IN PUCHAR pDest,
1390 IN PUCHAR pSrc,
1391 IN UINT Len);
1393 ULONG RTMP_CALC_FCS32(
1394 IN ULONG Fcs,
1395 IN PUCHAR Cp,
1396 IN INT Len);
1399 // MLME routines
1401 //VOID Arc4Init(ARC4_CONTEXT *Ctx, UCHAR *Key, ULONG KeyLen);
1402 //UCHAR Arc4Byte(ARC4_CONTEXT *Ctx);
1403 //VOID Arc4Cipher(ARC4_CONTEXT *Ctx, UCHAR *Dest, UCHAR *Src, ULONG Len);
1405 // Asic/RF/BBP related functions
1407 VOID AsicAdjustTxPower(
1408 IN PRTMP_ADAPTER pAd);
1410 VOID AsicSwitchChannel(
1411 IN PRTMP_ADAPTER pAdapter,
1412 IN UCHAR Channel);
1414 VOID AsicLockChannel(
1415 IN PRTMP_ADAPTER pAd,
1416 IN UCHAR Channel) ;
1418 VOID AsicRfTuningExec(
1419 IN unsigned long data);
1421 VOID AsicSleepThenAutoWakeup(
1422 IN PRTMP_ADAPTER pAdapter,
1423 IN USHORT TbttNumToNextWakeUp);
1425 VOID AsicForceSleep(
1426 IN PRTMP_ADAPTER pAdapter);
1428 VOID AsicForceWakeup(
1429 IN PRTMP_ADAPTER pAdapter);
1431 VOID AsicSetBssid(
1432 IN PRTMP_ADAPTER pAdapter,
1433 IN MACADDR *Bssid);
1435 VOID AsicDisableSync(
1436 IN PRTMP_ADAPTER pAdapter);
1438 VOID AsicEnableBssSync(
1439 IN PRTMP_ADAPTER pAdapter);
1441 VOID AsicEnableIbssSync(
1442 IN PRTMP_ADAPTER pAdapter);
1444 VOID AsicLedPeriodicExec(
1445 IN unsigned long data);
1447 VOID AsicSetRxAnt(
1448 IN PRTMP_ADAPTER pAd);
1450 VOID AsicEvaluateSecondaryRxAnt(
1451 IN PRTMP_ADAPTER pAd);
1453 VOID AsicRxAntEvalTimeout(
1454 IN unsigned long data);
1456 VOID AsicSetSlotTime(
1457 IN PRTMP_ADAPTER pAd,
1458 IN BOOLEAN UseShortSlotTime);
1460 VOID AsicAdjustUsec(
1461 IN PRTMP_ADAPTER pAd);
1463 VOID AsicBbpTuning(
1464 IN PRTMP_ADAPTER pAd);
1466 VOID AsicRestoreBbpSensibility(
1467 IN PRTMP_ADAPTER pAd);
1469 VOID MacAddrRandomBssid(
1470 IN PRTMP_ADAPTER pAdapter,
1471 OUT PMACADDR Addr);
1473 VOID MgtMacHeaderInit(
1474 IN PRTMP_ADAPTER pAdapter,
1475 IN OUT PMACHDR Hdr,
1476 IN UCHAR Subtype,
1477 IN UCHAR ToDs,
1478 // IN UCHAR AddrType,
1479 IN PMACADDR Ds,
1480 IN PMACADDR Bssid);
1482 VOID MlmeRadioOff(
1483 IN PRTMP_ADAPTER pAd);
1485 VOID MlmeRadioOn(
1486 IN PRTMP_ADAPTER pAd);
1488 VOID BssTableInit(
1489 IN BSS_TABLE *Tab);
1491 ULONG BssTableSearch(
1492 IN BSS_TABLE *Tab,
1493 IN PMACADDR Bssid);
1495 VOID BssTableDeleteEntry(
1496 IN OUT BSS_TABLE *Tab,
1497 IN PMACADDR Bssid);
1499 VOID BssEntrySet(
1500 IN PRTMP_ADAPTER pAdapter,
1501 OUT BSS_ENTRY *Bss,
1502 IN MACADDR *Bssid,
1503 IN CHAR Ssid[],
1504 IN UCHAR SsidLen,
1505 IN UCHAR BssType,
1506 IN USHORT BeaconPeriod,
1507 IN BOOLEAN CfExist,
1508 IN CF_PARM *CfParm,
1509 IN USHORT AtimWin,
1510 IN USHORT CapabilityInfo,
1511 IN UCHAR Rates[],
1512 IN UCHAR RatesLen,
1513 IN BOOLEAN ExtendedRateIeExist,
1514 IN UCHAR Channel,
1515 IN UCHAR Rssi,
1516 IN LARGE_INTEGER TimeStamp,
1517 IN PNDIS_802_11_VARIABLE_IEs pVIE);
1519 ULONG BssTableSetEntry(
1520 IN PRTMP_ADAPTER pAdapter,
1521 OUT BSS_TABLE *Tab,
1522 IN MACADDR *Bssid,
1523 IN CHAR Ssid[],
1524 IN UCHAR SsidLen,
1525 IN UCHAR BssType,
1526 IN USHORT BeaconPeriod,
1527 IN BOOLEAN CfExist,
1528 IN CF_PARM *CfParm,
1529 IN USHORT AtimWin,
1530 IN USHORT CapabilityInfo,
1531 IN UCHAR Rates[],
1532 IN UCHAR RatesLen,
1533 IN BOOLEAN ExtendedRateIeExist,
1534 IN UCHAR Channel,
1535 IN UCHAR Rssi,
1536 IN LARGE_INTEGER TimeStamp,
1537 IN PNDIS_802_11_VARIABLE_IEs pVIE);
1539 VOID BssTableSsidSort(
1540 IN PRTMP_ADAPTER pAd,
1541 OUT BSS_TABLE *OutTab,
1542 IN CHAR Ssid[],
1543 IN UCHAR SsidLen);
1545 VOID BssTableSortByRssi(
1546 IN OUT BSS_TABLE *OutTab);
1548 NDIS_802_11_WEP_STATUS BssCipherParse(
1549 IN PUCHAR pCipher);
1551 NDIS_STATUS MlmeQueueInit(
1552 IN MLME_QUEUE *Queue);
1554 VOID MlmeQueueDestroy(
1555 IN MLME_QUEUE *Queue);
1557 BOOLEAN MlmeEnqueue(
1558 OUT MLME_QUEUE *Queue,
1559 IN ULONG Machine,
1560 IN ULONG MsgType,
1561 IN ULONG MsgLen,
1562 IN VOID *Msg);
1564 BOOLEAN MlmeEnqueueForRecv(
1565 IN PRTMP_ADAPTER pAdapter,
1566 OUT MLME_QUEUE *Queue,
1567 IN ULONG TimeStampHigh,
1568 IN ULONG TimeStampLow,
1569 IN UCHAR Rssi,
1570 IN ULONG MsgLen,
1571 IN PVOID Msg);
1573 BOOLEAN MlmeDequeue(
1574 IN MLME_QUEUE *Queue,
1575 OUT MLME_QUEUE_ELEM **Elem);
1577 VOID MlmeRestartStateMachine(
1578 IN PRTMP_ADAPTER pAd);
1580 BOOLEAN MlmeQueueEmpty(
1581 IN MLME_QUEUE *Queue);
1583 BOOLEAN MlmeQueueFull(
1584 IN MLME_QUEUE *Queue);
1586 BOOLEAN MsgTypeSubst(
1587 IN MACFRAME *Fr,
1588 OUT INT *Machine,
1589 OUT INT *MsgType);
1591 VOID StateMachineInit(
1592 IN STATE_MACHINE *Sm,
1593 IN STATE_MACHINE_FUNC Trans[],
1594 IN ULONG StNr,
1595 IN ULONG MsgNr,
1596 IN STATE_MACHINE_FUNC DefFunc,
1597 IN ULONG InitState,
1598 IN ULONG Base);
1600 VOID StateMachineSetAction(
1601 IN STATE_MACHINE *S,
1602 IN ULONG St,
1603 ULONG Msg,
1604 IN STATE_MACHINE_FUNC F);
1606 VOID StateMachinePerformAction(
1607 IN PRTMP_ADAPTER pAdapter,
1608 IN STATE_MACHINE *S,
1609 IN MLME_QUEUE_ELEM *Elem);
1611 VOID Drop(
1612 IN PRTMP_ADAPTER pAdapter,
1613 IN MLME_QUEUE_ELEM *Elem);
1615 VOID StateMachineDestroy(
1616 IN STATE_MACHINE *Sm);
1618 VOID AssocStateMachineInit(
1619 IN PRTMP_ADAPTER pAdapter,
1620 IN STATE_MACHINE *Sm,
1621 OUT STATE_MACHINE_FUNC Trans[]);
1623 VOID ReassocTimeout(
1624 IN unsigned long data);
1626 VOID AssocTimeout(
1627 IN unsigned long data);
1629 VOID DisassocTimeout(
1630 IN unsigned long data);
1632 //----------------------------------------------
1633 VOID MlmeDisassocReqAction(
1634 IN PRTMP_ADAPTER pAdapter,
1635 IN MLME_QUEUE_ELEM *Elem);
1637 VOID MlmeAssocReqAction(
1638 IN PRTMP_ADAPTER pAdapter,
1639 IN MLME_QUEUE_ELEM *Elem);
1641 VOID MlmeReassocReqAction(
1642 IN PRTMP_ADAPTER pAdapter,
1643 IN MLME_QUEUE_ELEM *Elem);
1645 VOID MlmeDisassocReqAction(
1646 IN PRTMP_ADAPTER pAdapter,
1647 IN MLME_QUEUE_ELEM *Elem);
1649 VOID PeerAssocRspAction(
1650 IN PRTMP_ADAPTER pAdapter,
1651 IN MLME_QUEUE_ELEM *Elem);
1653 VOID PeerReassocRspAction(
1654 IN PRTMP_ADAPTER pAdapter,
1655 IN MLME_QUEUE_ELEM *Elem);
1657 VOID PeerDisassocAction(
1658 IN PRTMP_ADAPTER pAdapter,
1659 IN MLME_QUEUE_ELEM *Elem);
1661 VOID DisassocTimeoutAction(
1662 IN PRTMP_ADAPTER pAdapter,
1663 IN MLME_QUEUE_ELEM *Elem);
1665 VOID AssocTimeoutAction(
1666 IN PRTMP_ADAPTER pAdapter,
1667 IN MLME_QUEUE_ELEM *Elem);
1669 VOID ReassocTimeoutAction(
1670 IN PRTMP_ADAPTER pAdapter,
1671 IN MLME_QUEUE_ELEM *Elem);
1673 VOID Cls3errAction(
1674 IN PRTMP_ADAPTER pAdapter,
1675 IN PMACADDR pAddr);
1677 VOID InvalidStateWhenAssoc(
1678 IN PRTMP_ADAPTER pAdapter,
1679 IN MLME_QUEUE_ELEM *Elem);
1681 VOID InvalidStateWhenReassoc(
1682 IN PRTMP_ADAPTER pAdapter,
1683 IN MLME_QUEUE_ELEM *Elem);
1685 VOID InvalidStateWhenDisassociate(
1686 IN PRTMP_ADAPTER pAdapter,
1687 IN MLME_QUEUE_ELEM *Elem);
1689 VOID ComposePsPoll(
1690 IN PRTMP_ADAPTER pAdapter);
1692 VOID ComposeNullFrame(
1693 IN PRTMP_ADAPTER pAdapter);
1695 VOID AssocPostProc(
1696 IN PRTMP_ADAPTER pAdapter,
1697 IN MACADDR *Addr2,
1698 IN USHORT CapabilityInfo,
1699 IN USHORT Aid,
1700 IN UCHAR Rates[],
1701 IN UCHAR RatesLen,
1702 IN BOOLEAN ExtendedRateIeExist);
1704 VOID AuthStateMachineInit(
1705 IN PRTMP_ADAPTER pAdapter,
1706 IN PSTATE_MACHINE sm,
1707 OUT STATE_MACHINE_FUNC Trans[]);
1709 VOID AuthTimeout(
1710 IN unsigned long data);
1712 VOID MlmeAuthReqAction(
1713 IN PRTMP_ADAPTER pAdapter,
1714 IN MLME_QUEUE_ELEM *Elem);
1716 VOID PeerAuthRspAtSeq2Action(
1717 IN PRTMP_ADAPTER pAdapter,
1718 IN MLME_QUEUE_ELEM *Elem);
1720 VOID PeerAuthRspAtSeq4Action(
1721 IN PRTMP_ADAPTER pAdapter,
1722 IN MLME_QUEUE_ELEM *Elem);
1724 VOID AuthTimeoutAction(
1725 IN PRTMP_ADAPTER pAdapter,
1726 IN MLME_QUEUE_ELEM *Elem);
1728 VOID Cls2errAction(
1729 IN PRTMP_ADAPTER pAdapter,
1730 IN PMACADDR pAddr);
1732 VOID MlmeDeauthReqAction(
1733 IN PRTMP_ADAPTER pAdapter,
1734 IN MLME_QUEUE_ELEM *Elem);
1736 VOID InvalidStateWhenAuth(
1737 IN PRTMP_ADAPTER pAdapter,
1738 IN MLME_QUEUE_ELEM *Elem);
1740 //VOID MlmeDeauthReqProc(
1741 // IN PRTMP_ADAPTER pAdapter,
1742 // IN MACADDR *Addr,
1743 // IN USHORT Reason);
1745 //=============================================
1747 VOID AuthRspStateMachineInit(
1748 IN PRTMP_ADAPTER pAdapter,
1749 IN PSTATE_MACHINE Sm,
1750 IN STATE_MACHINE_FUNC Trans[]);
1753 VOID AuthRspChallengeTimeout(
1754 IN unsigned long data);
1756 VOID AuthRspChallengeTimeoutAction(
1757 IN PRTMP_ADAPTER pAdapter,
1758 IN MLME_QUEUE_ELEM *Elem);
1760 VOID PeerAuthAtAuthRspIdleAction(
1761 IN PRTMP_ADAPTER pAdapter,
1762 IN MLME_QUEUE_ELEM *Elem);
1764 VOID PeerAuthAtAuthRspWaitAction(
1765 IN PRTMP_ADAPTER pAdapter,
1766 IN MLME_QUEUE_ELEM *Elem);
1768 VOID PeerDeauthAction(
1769 IN PRTMP_ADAPTER pAdaptor,
1770 IN MLME_QUEUE_ELEM *Elem);
1772 VOID PeerAuthSimpleRspGenAndSend(
1773 IN PRTMP_ADAPTER pAdapter,
1774 IN PMACHDR Hdr,
1775 IN USHORT Alg,
1776 IN USHORT Seq,
1777 IN USHORT Reason,
1778 IN USHORT Status);
1780 //========================================
1782 VOID SyncStateMachineInit(
1783 IN PRTMP_ADAPTER pAdapter,
1784 IN STATE_MACHINE *Sm,
1785 OUT STATE_MACHINE_FUNC Trans[]);
1787 VOID BeaconTimeout(
1788 IN unsigned long data);
1790 VOID AtimTimeout(
1791 IN unsigned long data);
1793 VOID ScanTimeout(
1794 IN unsigned long data);
1796 VOID MlmeScanReqAction(
1797 IN PRTMP_ADAPTER pAdapter,
1798 IN MLME_QUEUE_ELEM *Elem);
1800 VOID InvalidStateWhenScan(
1801 IN PRTMP_ADAPTER pAdapter,
1802 IN MLME_QUEUE_ELEM *Elem);
1804 VOID InvalidStateWhenJoin(
1805 IN PRTMP_ADAPTER pAdapter,
1806 IN MLME_QUEUE_ELEM *Elem);
1808 VOID InvalidStateWhenStart(
1809 IN PRTMP_ADAPTER pAdapter,
1810 IN MLME_QUEUE_ELEM *Elem);
1812 VOID PeerBeacon(
1813 IN PRTMP_ADAPTER pAdapter,
1814 IN MLME_QUEUE_ELEM *Elem);
1816 VOID EnqueueProbeRequest(
1817 IN PRTMP_ADAPTER pAd);
1819 //=========================================
1821 VOID MlmeCntlInit(
1822 IN PRTMP_ADAPTER pAdapter,
1823 IN STATE_MACHINE *S,
1824 OUT STATE_MACHINE_FUNC Trans[]);
1826 VOID MlmeCntlMachinePerformAction(
1827 IN PRTMP_ADAPTER pAdapter,
1828 IN STATE_MACHINE *S,
1829 IN MLME_QUEUE_ELEM *Elem);
1831 VOID CntlIdleProc(
1832 IN PRTMP_ADAPTER pAdapter,
1833 IN MLME_QUEUE_ELEM *Elem);
1835 VOID CntlOidScanProc(
1836 IN PRTMP_ADAPTER pAdapter,
1837 IN MLME_QUEUE_ELEM *Elem);
1839 VOID CntlOidSsidProc(
1840 IN PRTMP_ADAPTER pAdapter,
1841 IN MLME_QUEUE_ELEM * Elem);
1843 VOID CntlOidRTBssidProc(
1844 IN PRTMP_ADAPTER pAdapter,
1845 IN MLME_QUEUE_ELEM *Elem);
1847 VOID CntlMlmeRoamingProc(
1848 IN PRTMP_ADAPTER pAdapter,
1849 IN MLME_QUEUE_ELEM *Elem);
1851 VOID CntlWaitDisassocProc(
1852 IN PRTMP_ADAPTER pAdapter,
1853 IN MLME_QUEUE_ELEM *Elem);
1855 VOID CntlWaitJoinProc(
1856 IN PRTMP_ADAPTER pAdapter,
1857 IN MLME_QUEUE_ELEM *Elem);
1859 VOID CntlWaitReassocProc(
1860 IN PRTMP_ADAPTER pAdapter,
1861 IN MLME_QUEUE_ELEM *Elem);
1863 VOID CntlWaitStartProc(
1864 IN PRTMP_ADAPTER pAdapter,
1865 IN MLME_QUEUE_ELEM *Elem);
1867 VOID CntlWaitAuthProc(
1868 IN PRTMP_ADAPTER pAdapter,
1869 IN MLME_QUEUE_ELEM *Elem);
1871 VOID CntlWaitAuthProc2(
1872 IN PRTMP_ADAPTER pAdapter,
1873 IN MLME_QUEUE_ELEM *Elem);
1875 VOID CntlWaitAssocProc(
1876 IN PRTMP_ADAPTER pAdapter,
1877 IN MLME_QUEUE_ELEM *Elem);
1879 VOID LinkUp(
1880 IN PRTMP_ADAPTER pAdapter,
1881 IN UCHAR BssType);
1883 VOID LinkDown(
1884 IN PRTMP_ADAPTER pAdapter);
1886 VOID MlmeCntlConfirm(
1887 IN PRTMP_ADAPTER pAdapter,
1888 IN ULONG MsgType,
1889 IN USHORT Msg);
1891 VOID IterateOnBssTab(
1892 IN PRTMP_ADAPTER pAdapter);
1894 VOID IterateOnBssTab2(
1895 IN PRTMP_ADAPTER pAdapter);;
1897 VOID JoinParmFill(
1898 IN PRTMP_ADAPTER pAdapter,
1899 IN OUT MLME_JOIN_REQ_STRUCT *JoinReq,
1900 IN ULONG BssIdx);
1902 VOID AssocParmFill(
1903 IN PRTMP_ADAPTER pAdapter,
1904 IN OUT MLME_ASSOC_REQ_STRUCT *AssocReq,
1905 IN MACADDR *Addr,
1906 IN USHORT CapabilityInfo,
1907 IN ULONG Timeout,
1908 IN USHORT ListenIntv);
1910 VOID ScanParmFill(
1911 IN PRTMP_ADAPTER pAdapter,
1912 IN OUT MLME_SCAN_REQ_STRUCT *ScanReq,
1913 IN CHAR Ssid[],
1914 IN UCHAR SsidLen,
1915 IN UCHAR BssType,
1916 IN UCHAR ScanType);
1918 VOID DisassocParmFill(
1919 IN PRTMP_ADAPTER pAdapter,
1920 IN OUT MLME_DISASSOC_REQ_STRUCT *DisassocReq,
1921 IN MACADDR *Addr,
1922 IN USHORT Reason);
1924 VOID StartParmFill(
1925 IN PRTMP_ADAPTER pAdapter,
1926 IN OUT MLME_START_REQ_STRUCT *StartReq,
1927 IN CHAR Ssid[],
1928 IN UCHAR SsidLen);
1930 VOID AuthParmFill(
1931 IN PRTMP_ADAPTER pAdapter,
1932 IN OUT MLME_AUTH_REQ_STRUCT *AuthReq,
1933 IN MACADDR *Addr,
1934 IN USHORT Alg);
1936 VOID EnqueuePsPoll(
1937 IN PRTMP_ADAPTER pAdapter);
1939 VOID EnqueueBeaconFrame(
1940 IN PRTMP_ADAPTER pAdapter);
1942 VOID EnqueueNullFrame(
1943 IN PRTMP_ADAPTER pAdapter,
1944 IN UCHAR TxRate);
1946 VOID MlmeJoinReqAction(
1947 IN PRTMP_ADAPTER pAdapter,
1948 IN MLME_QUEUE_ELEM *Elem);
1950 VOID MlmeScanReqAction(
1951 IN PRTMP_ADAPTER pAdapter,
1952 IN MLME_QUEUE_ELEM *Elem);
1954 VOID MlmeStartReqAction(
1955 IN PRTMP_ADAPTER pAdapter,
1956 IN MLME_QUEUE_ELEM *Elem);
1958 VOID ScanTimeoutAction(
1959 IN PRTMP_ADAPTER pAdapter,
1960 IN MLME_QUEUE_ELEM *Elem);
1962 VOID BeaconTimeoutAtJoinAction(
1963 IN PRTMP_ADAPTER pAdapter,
1964 IN MLME_QUEUE_ELEM *Elem);
1966 VOID PeerBeaconAtScanAction(
1967 IN PRTMP_ADAPTER pAdapter,
1968 IN MLME_QUEUE_ELEM *Elem);
1970 VOID PeerBeaconAtJoinAction(
1971 IN PRTMP_ADAPTER pAdapter,
1972 IN MLME_QUEUE_ELEM *Elem);
1974 VOID PeerBeacon(
1975 IN PRTMP_ADAPTER pAdapter,
1976 IN MLME_QUEUE_ELEM *Elem);
1978 VOID PeerProbeReqAction(
1979 IN PRTMP_ADAPTER pAd,
1980 IN MLME_QUEUE_ELEM *Elem);
1982 VOID ScanNextChannel(
1983 IN PRTMP_ADAPTER pAdapter);
1985 ULONG MakeIbssBeacon(
1986 IN PRTMP_ADAPTER pAdapter);
1988 BOOLEAN MlmeScanReqSanity(
1989 IN PRTMP_ADAPTER pAdapter,
1990 IN VOID *Msg,
1991 IN ULONG MsgLen,
1992 OUT UCHAR *BssType,
1993 OUT CHAR ssid[],
1994 OUT UCHAR *SsidLen,
1995 OUT UCHAR *ScanType);
1997 BOOLEAN PeerBeaconAndProbeRspSanity(
1998 IN PRTMP_ADAPTER pAdapter,
1999 IN VOID *Msg,
2000 IN ULONG MsgLen,
2001 OUT MACADDR *Addr2,
2002 OUT MACADDR *Bssid,
2003 OUT CHAR Ssid[],
2004 OUT UCHAR *SsidLen,
2005 OUT UCHAR *BssType,
2006 OUT USHORT *BeaconPeriod,
2007 OUT UCHAR *Channel,
2008 OUT LARGE_INTEGER *Timestamp,
2009 OUT BOOLEAN *CfExist,
2010 OUT CF_PARM *Cf,
2011 OUT USHORT *AtimWin,
2012 OUT USHORT *CapabilityInfo,
2013 OUT UCHAR Rate[],
2014 OUT UCHAR *RateLen,
2015 OUT BOOLEAN *ExtendedRateIeExist,
2016 OUT UCHAR *Erp,
2017 OUT UCHAR *DtimCount,
2018 OUT UCHAR *DtimPeriod,
2019 OUT UCHAR *BcastFlag,
2020 OUT UCHAR *MessageToMe,
2021 OUT UCHAR *Legacy,
2022 OUT UCHAR SupRate[],
2023 OUT UCHAR *SupRateLen,
2024 OUT UCHAR ExtRate[],
2025 OUT UCHAR *ExtRateLen,
2026 OUT PNDIS_802_11_VARIABLE_IEs pVIE);
2028 //BOOLEAN JoinParmSanity(
2029 // IN PRTMP_ADAPTER pAdapter,
2030 // IN VOID *Msg,
2031 // IN ULONG MsgLen,
2032 // OUT ULONG *BssIdx,
2033 // OUT UCHAR SupportedRates[],
2034 // OUT UCHAR *SupportedRatesLen);
2036 BOOLEAN MlmeAssocReqSanity(
2037 IN PRTMP_ADAPTER pAdapter,
2038 IN VOID *Msg,
2039 IN ULONG MsgLen,
2040 OUT MACADDR *ApAddr,
2041 OUT USHORT *CapabilityInfo,
2042 OUT ULONG *Timeout,
2043 OUT USHORT *ListenIntv);
2045 BOOLEAN MlmeAuthReqSanity(
2046 IN PRTMP_ADAPTER pAdapter,
2047 IN VOID *Msg,
2048 IN ULONG MsgLen,
2049 OUT MACADDR *Addr,
2050 OUT ULONG *Timeout,
2051 OUT USHORT *Alg);
2053 BOOLEAN MlmeStartReqSanity(
2054 IN PRTMP_ADAPTER pAdapter,
2055 IN VOID *Msg,
2056 IN ULONG MsgLen,
2057 OUT CHAR Ssid[],
2058 OUT UCHAR *Ssidlen);
2060 BOOLEAN PeerAuthSanity(
2061 IN PRTMP_ADAPTER pAdapter,
2062 IN VOID *Msg,
2063 IN ULONG MsgLen,
2064 OUT MACADDR *Addr,
2065 OUT USHORT *Alg,
2066 OUT USHORT *Seq,
2067 OUT USHORT *Status,
2068 OUT CHAR ChlgText[]);
2070 BOOLEAN PeerAssocRspSanity(
2071 IN PRTMP_ADAPTER pAdapter,
2072 IN VOID *Msg,
2073 IN ULONG MsgLen,
2074 OUT MACADDR *Addr2,
2075 OUT USHORT *CapabilityInfo,
2076 OUT USHORT *Status,
2077 OUT USHORT *Aid,
2078 OUT UCHAR Rates[],
2079 OUT UCHAR *RatesLen,
2080 OUT BOOLEAN *ExtendedRateIeExist);
2082 BOOLEAN PeerDisassocSanity(
2083 IN PRTMP_ADAPTER pAdapter,
2084 IN VOID *Msg,
2085 IN ULONG MsgLen,
2086 OUT MACADDR *Addr2,
2087 OUT USHORT *Reason);
2089 BOOLEAN PeerDeauthSanity(
2090 IN PRTMP_ADAPTER pAdapter,
2091 IN VOID *Msg,
2092 IN ULONG MsgLen,
2093 OUT MACADDR *Addr2,
2094 OUT USHORT *Reason);
2096 BOOLEAN PeerProbeReqSanity(
2097 IN PRTMP_ADAPTER pAdapter,
2098 IN VOID *Msg,
2099 IN ULONG MsgLen,
2100 OUT MACADDR *Addr2,
2101 OUT CHAR Ssid[],
2102 OUT UCHAR *SsidLen);
2103 // OUT UCHAR Rates[],
2104 // OUT UCHAR *RatesLen);
2106 BOOLEAN GetTimBit(
2107 IN CHAR *Ptr,
2108 IN USHORT Aid,
2109 OUT UCHAR *TimLen,
2110 OUT UCHAR *BcastFlag,
2111 OUT UCHAR *DtimCount,
2112 OUT UCHAR *DtimPeriod,
2113 OUT UCHAR *MessageToMe);
2115 BOOLEAN GetLegacy(
2116 IN CHAR *Ptr,
2117 OUT UCHAR *Legacy);
2119 ULONG MakeOutgoingFrame(
2120 OUT CHAR *Buffer,
2121 OUT ULONG *Length, ...);
2123 VOID LfsrInit(
2124 IN PRTMP_ADAPTER pAdapter,
2125 IN ULONG Seed);
2127 UCHAR RandomByte(
2128 IN PRTMP_ADAPTER pAdapter);
2130 VOID MlmePeriodicExec(
2131 IN unsigned long data);
2133 VOID MlmeAutoScan(
2134 IN PRTMP_ADAPTER pAdapter);
2136 VOID MlmeAutoRecoverNetwork(
2137 IN PRTMP_ADAPTER pAdapter);
2139 VOID MlmeAutoReconnectLastSSID(
2140 IN PRTMP_ADAPTER pAdapter);
2142 VOID MlmeCheckForRoaming(
2143 IN PRTMP_ADAPTER pAdapter,
2144 IN ULONG Now32);
2146 VOID MlmeCheckDynamicTxRateSwitching(
2147 IN PRTMP_ADAPTER pAd);
2149 VOID MlmeCheckChannelQuality(
2150 IN PRTMP_ADAPTER pAdapter,
2151 IN ULONG Now);
2153 VOID MlmeCheckForPsmChange(
2154 IN PRTMP_ADAPTER pAdapter,
2155 IN ULONG Now32);
2157 VOID MlmeSetPsmBit(
2158 IN PRTMP_ADAPTER pAdapter,
2159 IN USHORT psm);
2161 VOID MlmeSetTxPreamble(
2162 IN PRTMP_ADAPTER pAdapter,
2163 IN USHORT TxPreamble);
2165 VOID MlmeUpdateTxRates(
2166 IN PRTMP_ADAPTER pAdapter,
2167 IN BOOLEAN bLinkUp);
2169 NDIS_STATUS MlmeInit(
2170 IN PRTMP_ADAPTER pAdapter);
2172 VOID MlmeHandler(
2173 IN PRTMP_ADAPTER pAdapter);
2175 VOID MlmeHalt(
2176 IN PRTMP_ADAPTER pAdapter);
2178 NDIS_STATUS MlmeInitMemoryHandler(
2179 IN PRTMP_ADAPTER pAd,
2180 IN UINT Number,
2181 IN UINT Size);
2183 NDIS_STATUS MlmeAllocateMemory(
2184 IN PRTMP_ADAPTER pAd,
2185 OUT PVOID *AllocVa);
2187 VOID MlmeFreeMemory(
2188 IN PRTMP_ADAPTER pAd,
2189 IN PVOID AllocVa);
2191 VOID MlmeFreeMemoryHandler(
2192 IN PRTMP_ADAPTER pAd);
2194 VOID BuildChannelList(
2195 IN PRTMP_ADAPTER pAdapter);
2197 UCHAR FirstChannel(
2198 IN PRTMP_ADAPTER pAdapter);
2200 UCHAR NextChannel(
2201 IN PRTMP_ADAPTER pAdapter,
2202 IN UCHAR channel);
2204 VOID RaiseClock(
2205 IN PRTMP_ADAPTER pAd,
2206 IN ULONG *x);
2208 VOID LowerClock(
2209 IN PRTMP_ADAPTER pAd,
2210 IN ULONG *x);
2212 USHORT ShiftInBits(
2213 IN PRTMP_ADAPTER pAd);
2215 VOID ShiftOutBits(
2216 IN PRTMP_ADAPTER pAd,
2217 IN USHORT data,
2218 IN USHORT count);
2220 VOID EEpromCleanup(
2221 IN PRTMP_ADAPTER pAd);
2223 VOID EWDS(
2224 IN PRTMP_ADAPTER pAd);
2226 VOID EWEN(
2227 IN PRTMP_ADAPTER pAd);
2229 USHORT RTMP_EEPROM_READ16(
2230 IN PRTMP_ADAPTER pAd,
2231 IN USHORT Offset);
2233 VOID RTMP_EEPROM_WRITE16(
2234 IN PRTMP_ADAPTER pAd,
2235 IN USHORT Offset,
2236 IN USHORT Data);
2238 UCHAR ChannelSanity(
2239 IN PRTMP_ADAPTER pAd,
2240 IN UCHAR channel);
2243 // Prototypes of function definition in rtmp_tkip.c
2245 VOID RTMPInitTkipEngine(
2246 IN PRTMP_ADAPTER pAdapter,
2247 IN PUCHAR pTKey,
2248 IN UCHAR KeyId,
2249 IN PUCHAR pTA,
2250 IN PUCHAR pMICKey,
2251 IN PUCHAR pTSC,
2252 OUT PULONG pIV16,
2253 OUT PULONG pIV32);
2255 VOID RTMPInitMICEngine(
2256 IN PRTMP_ADAPTER pAdapter,
2257 IN PUCHAR pKey,
2258 IN PUCHAR pDA,
2259 IN PUCHAR pSA,
2260 IN PUCHAR pMICKey);
2262 BOOLEAN RTMPTkipCompareMICValue(
2263 IN PRTMP_ADAPTER pAdapter,
2264 IN PUCHAR pSrc,
2265 IN PUCHAR pDA,
2266 IN PUCHAR pSA,
2267 IN PUCHAR pMICKey,
2268 IN UINT Len);
2270 VOID RTMPCalculateMICValue(
2271 IN PRTMP_ADAPTER pAdapter,
2272 IN struct sk_buff *skb,
2273 IN PUCHAR pEncap,
2274 IN INT LenEncap,
2275 IN PWPA_KEY pWpaKey);
2277 BOOLEAN RTMPTkipCompareMICValueWithLLC(
2278 IN PRTMP_ADAPTER pAdapter,
2279 IN PUCHAR pLLC,
2280 IN PUCHAR pSrc,
2281 IN PUCHAR pDA,
2282 IN PUCHAR pSA,
2283 IN PUCHAR pMICKey,
2284 IN UINT Len);
2286 VOID RTMPTkipAppend(
2287 IN PTKIP_KEY_INFO pTkip,
2288 IN PUCHAR pSrc,
2289 IN UINT nBytes);
2291 VOID RTMPTkipGetMIC(
2292 IN PTKIP_KEY_INFO pTkip);
2294 NDIS_STATUS RTMPWPAAddKeyProc(
2295 IN PRTMP_ADAPTER pAdapter,
2296 IN PVOID pBuf);
2298 NDIS_STATUS RTMPWPARemoveKeyProc(
2299 IN PRTMP_ADAPTER pAdapter,
2300 IN PVOID pBuf);
2302 VOID RTMPWPARemoveAllKeys(
2303 IN PRTMP_ADAPTER pAdapter);
2305 VOID RTMPSetPhyMode(
2306 IN PRTMP_ADAPTER pAdapter,
2307 IN ULONG phymode);
2309 VOID RTMPSetDesiredRates(
2310 IN PRTMP_ADAPTER pAdapter,
2311 IN LONG Rates);
2313 INT RTMPSetInformation(
2314 IN PRTMP_ADAPTER pAdapter,
2315 IN OUT struct ifreq *rq,
2316 IN INT cmd);
2318 INT RTMPQueryInformation(
2319 IN PRTMP_ADAPTER pAdapter,
2320 IN OUT struct ifreq *rq,
2321 IN INT cmd);
2324 // Prototypes of function definition for *iwpriv* in rtmp_info.c
2326 INT Set_CountryRegion_Proc(
2327 IN PRTMP_ADAPTER pAdapter,
2328 IN PUCHAR arg);
2330 INT Set_SSID_Proc(
2331 IN PRTMP_ADAPTER pAdapter,
2332 IN PUCHAR arg);
2334 INT Set_WirelessMode_Proc(
2335 IN PRTMP_ADAPTER pAdapter,
2336 IN PUCHAR arg);
2338 INT Set_TxRate_Proc(
2339 IN PRTMP_ADAPTER pAdapter,
2340 IN PUCHAR arg);
2342 INT Set_AdhocModeRate_Proc(
2343 IN PRTMP_ADAPTER pAdapter,
2344 IN PUCHAR arg);
2346 INT Set_Channel_Proc(
2347 IN PRTMP_ADAPTER pAdapter,
2348 IN PUCHAR
2349 arg);
2351 #ifdef RT2500_DBG
2352 INT Set_Debug_Proc(
2353 IN PRTMP_ADAPTER pAdapter,
2354 IN PUCHAR arg);
2355 #endif
2357 INT Set_BGProtection_Proc(
2358 IN PRTMP_ADAPTER pAdapter,
2359 IN PUCHAR arg);
2361 INT Set_TxPreamble_Proc(
2362 IN PRTMP_ADAPTER pAdapter,
2363 IN PUCHAR arg);
2365 INT Set_RTSThreshold_Proc(
2366 IN PRTMP_ADAPTER pAdapter,
2367 IN PUCHAR arg);
2369 INT Set_FragThreshold_Proc(
2370 IN PRTMP_ADAPTER pAdapter,
2371 IN PUCHAR arg);
2373 INT Set_TxBurst_Proc(
2374 IN PRTMP_ADAPTER pAdapter,
2375 IN PUCHAR arg);
2377 INT Set_TurboRate_Proc(
2378 IN PRTMP_ADAPTER pAdapter,
2379 IN PUCHAR arg);
2381 INT Set_NetworkType_Proc(
2382 IN PRTMP_ADAPTER pAdapter,
2383 IN PUCHAR arg);
2385 INT Set_AuthMode_Proc(
2386 IN PRTMP_ADAPTER pAdapter,
2387 IN PUCHAR arg);
2389 INT Set_EncrypType_Proc(
2390 IN PRTMP_ADAPTER pAdapter,
2391 IN PUCHAR arg);
2393 INT Set_DefaultKeyID_Proc(
2394 IN PRTMP_ADAPTER pAdapter,
2395 IN PUCHAR arg);
2397 INT Set_Key1_Proc(
2398 IN PRTMP_ADAPTER pAdapter,
2399 IN PUCHAR arg);
2401 INT Set_Key2_Proc(
2402 IN PRTMP_ADAPTER pAdapter,
2403 IN PUCHAR arg);
2405 INT Set_Key3_Proc(
2406 IN PRTMP_ADAPTER pAdapter,
2407 IN PUCHAR arg);
2409 INT Set_Key4_Proc(
2410 IN PRTMP_ADAPTER pAdapter,
2411 IN PUCHAR arg);
2413 INT Set_WPAPSK_Proc(
2414 IN PRTMP_ADAPTER pAdapter,
2415 IN PUCHAR arg);
2417 VOID RTMPIoctlBBP(
2418 IN PRTMP_ADAPTER pAdapter,
2419 IN struct iwreq *wrq);
2421 VOID RTMPIoctlMAC(
2422 IN PRTMP_ADAPTER pAdapter,
2423 IN struct iwreq *wrq);
2425 VOID RTMPIoctlE2PROM(
2426 IN PRTMP_ADAPTER pAdapter,
2427 IN struct iwreq *wrq);
2430 // prototype in wpa.c
2432 BOOLEAN WpaMsgTypeSubst(
2433 IN UCHAR EAPType,
2434 OUT ULONG *MsgType);
2436 VOID WpaPskStateMachineInit(
2437 IN PRTMP_ADAPTER pAd,
2438 IN STATE_MACHINE *S,
2439 OUT STATE_MACHINE_FUNC Trans[]);
2441 VOID WpaEAPOLKeyAction(
2442 IN PRTMP_ADAPTER pAdapter,
2443 IN MLME_QUEUE_ELEM *Elem);
2445 VOID WpaPairMsg1Action(
2446 IN PRTMP_ADAPTER pAdapter,
2447 IN MLME_QUEUE_ELEM *Elem);
2449 VOID WpaPairMsg3Action(
2450 IN PRTMP_ADAPTER pAdapter,
2451 IN MLME_QUEUE_ELEM *Elem);
2453 VOID WpaGroupMsg1Action(
2454 IN PRTMP_ADAPTER pAdapter,
2455 IN MLME_QUEUE_ELEM *Elem);
2457 VOID WpaMacHeaderInit(
2458 IN PRTMP_ADAPTER pAd,
2459 IN OUT PHEADER_802_11 Hdr,
2460 IN UCHAR wep,
2461 IN PMACADDR pAddr1);
2463 VOID WpaHardEncrypt(
2464 IN PRTMP_ADAPTER pAdapter,
2465 IN PUCHAR pPacket,
2466 IN ULONG Len);
2468 VOID HMAC_SHA1(
2469 IN UCHAR *text,
2470 IN UINT text_len,
2471 IN UCHAR *key,
2472 IN UINT key_len,
2473 IN UCHAR *digest);
2475 VOID PRF(
2476 IN UCHAR *key,
2477 IN INT key_len,
2478 IN UCHAR *prefix,
2479 IN INT prefix_len,
2480 IN UCHAR *data,
2481 IN INT data_len,
2482 OUT UCHAR *output,
2483 IN INT len);
2485 VOID WpaCountPTK(
2486 IN UCHAR *PMK,
2487 IN UCHAR *ANonce,
2488 IN UCHAR *AA,
2489 IN UCHAR *SNonce,
2490 IN UCHAR *SA,
2491 OUT UCHAR *output,
2492 IN UINT len);
2494 VOID GenRandom(
2495 IN PRTMP_ADAPTER pAd,
2496 OUT UCHAR *random);
2498 VOID AES_GTK_KEY_UNWRAP(
2499 IN UCHAR *key,
2500 OUT UCHAR *plaintext,
2501 IN UCHAR *ciphertext);
2503 ULONG RTMPTkipGetUInt32(
2504 IN PUCHAR pMICKey);
2506 char * rtstrstr(
2507 IN const char * s1,
2508 IN const char * s2);
2510 #ifdef RALINK_ATE
2511 INT Set_ATE_Proc(
2512 IN PRTMP_ADAPTER pAdapter,
2513 IN PUCHAR arg);
2515 INT Set_ATE_DA_Proc(
2516 IN PRTMP_ADAPTER pAdapter,
2517 IN PUCHAR arg);
2519 INT Set_ATE_SA_Proc(
2520 IN PRTMP_ADAPTER pAdapter,
2521 IN PUCHAR arg);
2523 INT Set_ATE_BSSID_Proc(
2524 IN PRTMP_ADAPTER pAdapter,
2525 IN PUCHAR arg);
2527 INT Set_ATE_CHANNEL_Proc(
2528 IN PRTMP_ADAPTER pAdapter,
2529 IN PUCHAR arg);
2531 INT Set_ATE_TX_POWER_Proc(
2532 IN PRTMP_ADAPTER pAdapter,
2533 IN PUCHAR arg);
2535 INT Set_ATE_TX_LENGTH_Proc(
2536 IN PRTMP_ADAPTER pAdapter,
2537 IN PUCHAR arg);
2539 INT Set_ATE_TX_COUNT_Proc(
2540 IN PRTMP_ADAPTER pAdapter,
2541 IN PUCHAR arg);
2543 INT Set_ATE_TX_RATE_Proc(
2544 IN PRTMP_ADAPTER pAdapter,
2545 IN PUCHAR arg);
2547 VOID RTMPStationStop(
2548 IN PRTMP_ADAPTER pAd);
2550 VOID RTMPStationStart(
2551 IN PRTMP_ADAPTER pAd);
2553 #endif //#ifdef RALINK_ATE
2555 #endif // __RTMP_H__