MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / net / wireless / rtlink / Module / rtmp.h
blob3d7918e0d72fc06a509c7d59236dacd4cc5c1597
1 /*************************************************************************
2 * Ralink Tech Inc. *
3 * 4F, No. 2 Technology 5th Rd. *
4 * Science-based Industrial Park *
5 * Hsin-chu, Taiwan, R.O.C. *
6 * *
7 * (c) Copyright 2002, Ralink Technology, Inc. *
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 * This program is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17 * GNU General Public License for more details. *
18 * *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program; if not, write to the *
21 * Free Software Foundation, Inc., *
22 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23 * *
24 *************************************************************************
26 Module Name:
27 rtmp.h
29 Abstract:
30 Miniport generic portion header file
32 Revision History:
33 Who When What
34 -------- ---------- ----------------------------------------------
35 Paul Lin 08-01-2002 created
38 #ifndef __RTMP_H__
39 #define __RTMP_H__
41 #include "mlme.h"
42 #include "oid.h"
43 #include "wpa.h"
46 // Defines the state of the LAN media
48 typedef enum _NDIS_MEDIA_STATE
50 NdisMediaStateConnected,
51 NdisMediaStateDisconnected
52 } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
55 // Queue structure and macros
57 typedef struct _QUEUE_ENTRY {
58 struct _QUEUE_ENTRY *Next;
59 } QUEUE_ENTRY, *PQUEUE_ENTRY;
61 // Queue structure
62 typedef struct _QUEUE_HEADER {
63 PQUEUE_ENTRY Head;
64 PQUEUE_ENTRY Tail;
65 ULONG Number;
66 } QUEUE_HEADER, *PQUEUE_HEADER;
68 #define InitializeQueueHeader(QueueHeader) \
69 { \
70 (QueueHeader)->Head = (QueueHeader)->Tail = NULL; \
71 (QueueHeader)->Number = 0; \
74 #define RemoveHeadQueue(QueueHeader) \
75 (QueueHeader)->Head; \
76 { \
77 PQUEUE_ENTRY pNext; \
78 pNext = (QueueHeader)->Head->Next; \
79 (QueueHeader)->Head = pNext; \
80 if (pNext == NULL) \
81 (QueueHeader)->Tail = NULL; \
82 (QueueHeader)->Number--; \
85 #define InsertHeadQueue(QueueHeader, QueueEntry) \
86 { \
87 ((PQUEUE_ENTRY)QueueEntry)->Next = (QueueHeader)->Head; \
88 (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
89 if ((QueueHeader)->Tail == NULL) \
90 (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
91 (QueueHeader)->Number++; \
94 #define InsertTailQueue(QueueHeader, QueueEntry) \
95 { \
96 ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
97 if ((QueueHeader)->Tail) \
98 (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
99 else \
100 (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
101 (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
102 (QueueHeader)->Number++; \
106 // MACRO for debugging information
108 #ifdef RT2500_DBG
109 extern ULONG RTDebugLevel;
111 #define DBGPRINT(Level, fmt, args...) \
113 if (Level <= RTDebugLevel) \
115 printk(NIC_DBG_STRING); \
116 printk(KERN_DEBUG fmt, ## args); \
119 #else
120 #define DBGPRINT(Level, fmt, args...)
121 #endif
124 // spin_lock enhanced for Nested spin lock
128 #define NdisAllocateSpinLock(lock) \
130 spin_lock_init(lock); \
132 #if 1
133 #define NdisReleaseSpinLock(lock, IrqFlags) \
135 spin_unlock_irqrestore(lock, IrqFlags); \
138 #define NdisAcquireSpinLock(lock, IrqFlags) \
140 spin_lock_irqsave(lock, IrqFlags); \
142 #else
143 #define NdisReleaseSpinLock(lock) \
145 spin_unlock_bh(lock); \
148 #define NdisAcquireSpinLock(lock) \
150 spin_lock_bh(lock); \
152 #endif
154 #define NdisFreeSpinLock(lock) \
158 #define RTMPFreeSkbBuffer(skb) \
160 dev_kfree_skb_any(skb); \
163 // Assert MACRO to make sure program running
165 #undef ASSERT
166 #define ASSERT(x) \
168 if (!(x)) \
170 printk(KERN_WARNING __FILE__ ":%d assert " #x "failed\n", __LINE__); \
175 // Macros for flag and ref count operations
177 #define RTMP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F))
178 #define RTMP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F))
179 #define RTMP_CLEAR_FLAGS(_M) ((_M)->Flags = 0)
180 #define RTMP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0)
181 #define RTMP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))
183 #define RTMP_INC_RCV_REF(_A) ((_A)->RcvRefCount++)
184 #define RTMP_DEC_RCV_REF(_A) ((_A)->RcvRefCount--)
185 #define RTMP_GET_RCV_REF(_A) ((_A)->RcvRefCount)
187 #define RTMP_INC_SEND_REF(_A) ((_A)->SendRefCount++)
188 #define RTMP_DEC_SEND_REF(_A) ((_A)->SendRefCount--)
189 #define RTMP_GET_SEND_REF(_A) ((_A)->SendRefCount)
191 #define NdisEqualMemory(Source1, Source2, Length) RTMPEqualMemory(Source1, Source2, Length)
194 // MACRO for 32-bit PCI register read / write
196 // Usage : RTMP_IO_READ32(
197 // PRTMP_ADAPTER pAdapter,
198 // ULONG Register_Offset,
199 // PULONG pValue)
201 // RTMP_IO_WRITE32(
202 // PRTMP_ADAPTER pAdapter,
203 // ULONG Register_Offset,
204 // ULONG Value)
206 #if 0 //#ifdef RTMP_EMBEDDED
207 #define RTMP_IO_READ32(_A, _R, _pV) (*_pV = PCIMemRead32(__mem_pci(_A->CSRBaseAddress+_R)))
208 #define RTMP_IO_WRITE32(_A, _R, _V) (PCIMemWrite32(__mem_pci(_A->CSRBaseAddress+_R),_V))
209 #else
210 #define RTMP_IO_READ32(_A, _R, _pV) (*_pV = readl((void *)(_A->CSRBaseAddress+_R)))
211 #define RTMP_IO_WRITE32(_A, _R, _V) (writel(_V, (void *)(_A->CSRBaseAddress+_R)))
212 #endif
215 // BBP & RF are using indirect access. Before write any value into it.
216 // We have to make sure there is no outstanding command pending via checking busy bit.
218 #define MAX_BUSY_COUNT 100 // Nunber of retry before failing access BBP & RF indirect register
220 #define RTMP_BBP_IO_WRITE32(_A, _V) \
222 BBPCSR_STRUC Value; \
223 ULONG BusyCnt = 0; \
224 do { \
225 RTMP_IO_READ32(_A, BBPCSR, &Value.word); \
226 if (Value.field.Busy == IDLE) \
227 break; \
228 BusyCnt++; \
229 } while (BusyCnt < MAX_BUSY_COUNT); \
230 if (BusyCnt < MAX_BUSY_COUNT) \
232 RTMP_IO_WRITE32(_A, BBPCSR, _V); \
236 #define RTMP_RF_IO_WRITE32(_A, _V) \
238 RFCSR_STRUC Value; \
239 ULONG BusyCnt = 0; \
240 do { \
241 RTMP_IO_READ32(_A, RFCSR, &(Value.word)); \
242 if (Value.field.Busy == IDLE) \
243 break; \
244 BusyCnt++; \
245 } while (BusyCnt < MAX_BUSY_COUNT); \
246 if (BusyCnt < MAX_BUSY_COUNT) \
248 RTMP_IO_WRITE32(_A, RFCSR, _V); \
252 #define RTMP_BBP_IO_READ32(_A, _pV) \
254 BBPCSR_STRUC Value; \
255 ULONG BusyCnt = 0; \
256 RTMP_BBP_IO_WRITE32(_A, *(_pV)); \
257 do { \
258 RTMP_IO_READ32(_A, BBPCSR, &Value.word);\
259 if (Value.field.Busy == IDLE) \
260 break; \
261 BusyCnt++; \
262 } while (BusyCnt < MAX_BUSY_COUNT); \
263 if (BusyCnt == MAX_BUSY_COUNT) \
264 *(_pV) = 0xff; \
265 else \
266 *(_pV) = Value.field.Value; \
268 // Read BBP register by register's ID
269 #define RTMP_BBP_IO_READ32_BY_REG_ID(_A, _I, _pV) \
271 BBPCSR_STRUC BbpCsr; \
272 BbpCsr.word = 0; \
273 BbpCsr.field.WriteControl = 0; \
274 BbpCsr.field.Busy = 1; \
275 BbpCsr.field.RegNum = _I; \
276 RTMP_BBP_IO_READ32(_A, &BbpCsr.word); \
277 *(_pV) = (UCHAR) BbpCsr.field.Value; \
279 // Write BBP register by register's ID & value
280 #define RTMP_BBP_IO_WRITE32_BY_REG_ID(_A, _I, _V) \
282 BBPCSR_STRUC BbpCsr; \
283 BbpCsr.word = 0; \
284 BbpCsr.field.WriteControl = 1; \
285 BbpCsr.field.Busy = 1; \
286 BbpCsr.field.Value = _V; \
287 BbpCsr.field.RegNum = _I; \
288 RTMP_BBP_IO_WRITE32(_A, BbpCsr.word); \
289 (_A)->PortCfg.BbpWriteLatch[_I] = _V; \
294 // Some utility macros
296 #ifndef min
297 #define min(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
298 #endif
300 #ifndef max
301 #define max(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
302 #endif
304 #define INC_COUNTER(Val) (Val.QuadPart++)
306 #define INFRA_ON(_p) (((_p)->PortCfg.Massoc) == TRUE) // Check Massoc
307 #define ADHOC_ON(_p) (((_p)->PortCfg.Mibss) == TRUE) // check Mibss
309 #define RTMP_SET_PACKET_FRAGMENTS(_p, number) ((_p)->cb[10] = number)
310 #define RTMP_GET_PACKET_FRAGMENTS(_p) ((_p)->cb[10])
311 #define RTMP_SET_PACKET_RTS(_p, number) ((_p)->cb[11] = number)
312 #define RTMP_GET_PACKET_RTS(_p) ((_p)->cb[11])
314 #define MAKE_802_3_HEADER(_p, _pMac1, _pMac2, _pType) \
316 NdisMoveMemory(_p, _pMac1, ETH_LENGTH_OF_ADDRESS); \
317 NdisMoveMemory((_p + ETH_LENGTH_OF_ADDRESS), _pMac2, ETH_LENGTH_OF_ADDRESS); \
318 NdisMoveMemory((_p + ETH_LENGTH_OF_ADDRESS * 2), _pType, LENGTH_802_3_TYPE); \
321 #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22) )
322 #define pci_name(x) ((x)->slot_name)
323 #endif
325 // if pData has no LLC/SNAP (neither RFC1042 nor Bridge tunnel), keep it that way.
326 // else if the received frame is LLC/SNAP-encaped IPX or APPLETALK, preserve the LLC/SNAP field in the result Ethernet frame
327 // else remove the LLC/SNAP field from the result Ethernet frame
328 // Note:
329 // _pData & _DataSize may be altered (remove 8-byte LLC/SNAP) by this MACRO
330 #define CONVERT_TO_802_3(_p8023hdr, _pDA, _pSA, _pData, _DataSize) \
332 char LLC_Len[2]; \
334 if ((!RTMPEqualMemory(SNAP_802_1H, _pData, 6)) && \
335 (!RTMPEqualMemory(SNAP_BRIDGE_TUNNEL, _pData, 6))) \
337 LLC_Len[0] = (UCHAR)(_DataSize / 256); \
338 LLC_Len[1] = (UCHAR)(_DataSize % 256); \
339 MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \
341 else \
343 PUCHAR pProto = _pData + 6; \
345 if ((RTMPEqualMemory(IPX, pProto, 2) || RTMPEqualMemory(APPLE_TALK, pProto, 2)) && \
346 RTMPEqualMemory(SNAP_802_1H, _pData, 6)) \
348 LLC_Len[0] = (UCHAR)(_DataSize / 256); \
349 LLC_Len[1] = (UCHAR)(_DataSize % 256); \
350 MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \
352 else \
354 MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, pProto); \
355 _DataSize -= LENGTH_802_1_H; \
356 _pData += LENGTH_802_1_H; \
362 // Register set pair for initialzation register set definition
364 typedef struct _RTMP_REG_PAIR
366 ULONG Register;
367 ULONG Value;
368 } RTMP_REG_PAIR, *PRTMP_REG_PAIR;
371 // Register set pair for initialzation register set definition
373 typedef struct _RTMP_RF_REGS
375 UCHAR Channel;
376 ULONG R1;
377 ULONG R2;
378 ULONG R3;
379 ULONG R4;
380 } RTMP_RF_REGS, *PRTMP_RF_REGS;
383 // Statistic counter structure
385 typedef struct _COUNTER_802_3
387 // General Stats
388 ULONG GoodTransmits;
389 ULONG GoodReceives;
390 ULONG TxErrors;
391 ULONG RxErrors;
392 ULONG RxNoBuffer;
394 // Ethernet Stats
395 ULONG RcvAlignmentErrors;
396 ULONG OneCollision;
397 ULONG MoreCollisions;
399 } COUNTER_802_3, *PCOUNTER_802_3;
401 typedef struct _COUNTER_802_11 {
402 ULONG Length;
403 LARGE_INTEGER TransmittedFragmentCount;
404 LARGE_INTEGER MulticastTransmittedFrameCount;
405 LARGE_INTEGER FailedCount;
406 LARGE_INTEGER RetryCount;
407 LARGE_INTEGER MultipleRetryCount;
408 LARGE_INTEGER RTSSuccessCount;
409 LARGE_INTEGER RTSFailureCount;
410 LARGE_INTEGER ACKFailureCount;
411 LARGE_INTEGER FrameDuplicateCount;
412 LARGE_INTEGER ReceivedFragmentCount;
413 LARGE_INTEGER MulticastReceivedFrameCount;
414 LARGE_INTEGER FCSErrorCount;
415 } COUNTER_802_11, *PCOUNTER_802_11;
417 typedef struct _COUNTER_RALINK {
418 ULONG TransmittedByteCount; // both successful and failure, used to calculate TX throughput
419 ULONG ReceivedByteCount; // both CRC okay and CRC error, used to calculate RX throughput
420 ULONG BeenDisassociatedCount;
421 ULONG BadCQIAutoRecoveryCount;
422 ULONG PoorCQIRoamingCount;
423 ULONG MgmtRingFullCount;
424 ULONG RxCount;
425 ULONG DecryptCount;
426 ULONG RxRingErrCount;
427 ULONG EncryptCount;
428 ULONG KickTxCount;
429 ULONG TxRingErrCount;
430 LARGE_INTEGER RealFcsErrCount;
431 } COUNTER_RALINK, *PCOUNTER_RALINK;
433 typedef struct _COUNTER_DRS {
434 // to record the each TX rate's quality. 0 is best, the bigger the worse.
435 USHORT TxQuality[MAX_LEN_OF_SUPPORTED_RATES];
436 UCHAR PER[MAX_LEN_OF_SUPPORTED_RATES];
437 USHORT OneSecTxOkCount;
438 USHORT OneSecTxRetryOkCount;
439 USHORT OneSecTxFailCount;
440 UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
441 ULONG CurrTxRateStableTime; // # of second in current TX rate
442 BOOLEAN fNoisyEnvironment;
443 UCHAR LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down
444 } COUNTER_DRS, *PCOUNTER_DRS;
447 // Arcfour Structure Added by PaulWu
449 typedef struct PACKED _ARCFOUR
451 UINT X;
452 UINT Y;
453 UCHAR STATE[256];
454 } ARCFOURCONTEXT, *PARCFOURCONTEXT;
456 // Shared key data structure
457 typedef struct _WEP_KEY {
458 UCHAR KeyLen; // Key length for each key, 0: entry is invalid
459 UCHAR Key[MAX_LEN_OF_KEY]; // right now we implement 4 keys, 128 bits max
460 } WEP_KEY, *PWEP_KEY;
462 // Shared key data structure
463 typedef struct _WPA_KEY {
464 UCHAR KeyLen; // Key length for each key, 0: entry is invalid
465 UCHAR Key[16]; // right now we implement 4 keys, 128 bits max
466 UCHAR RxMic[8];
467 UCHAR TxMic[8];
468 NDIS_802_11_MAC_ADDRESS BssId; // For pairwise key only
469 UCHAR TxTsc[6]; // 48bit TSC value
470 UCHAR RxTsc[6]; // 48bit TSC value
471 UCHAR Type; // Indicate Pairwise / Group
472 } WPA_KEY, *PWPA_KEY;
475 #if 0
476 typedef struct _IV_CONTROL_
478 union
480 struct
482 UCHAR rc0;
483 UCHAR rc1;
484 UCHAR rc2;
486 union
488 struct
490 #ifdef BIG_ENDIAN
491 UCHAR KeyID:2;
492 UCHAR ExtIV:1;
493 UCHAR Rsvd:5;
494 #else
495 UCHAR Rsvd:5;
496 UCHAR ExtIV:1;
497 UCHAR KeyID:2;
498 #endif
499 } field;
500 UCHAR Byte;
501 } CONTROL;
502 } field;
504 ULONG word;
505 } IV16;
507 ULONG IV32;
508 } TKIP_IV, *PTKIP_IV;
509 #endif
511 typedef struct PACKED _IV_CONTROL_
513 union PACKED
515 struct PACKED
517 #ifdef BIG_ENDIAN
518 ULONG KeyID:2;
519 ULONG ExtIV:1;
520 ULONG Rsvd:5;
521 ULONG rc2:8;
522 ULONG rc1:8;
523 ULONG rc0:8;
524 #else
525 ULONG rc0:8;
526 ULONG rc1:8;
527 ULONG rc2:8;
528 ULONG Rsvd:5;
529 ULONG ExtIV:1;
530 ULONG KeyID:2;
531 #endif
532 }field;
533 ULONG word;
534 }IV16;
536 ULONG IV32;
538 } TKIP_IV, *PTKIP_IV;
540 // configuration to be used when this STA starts a new ADHOC network
541 typedef struct _IBSS_CONFIG {
542 USHORT BeaconPeriod;
543 USHORT AtimWin;
544 UCHAR Channel;
545 UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES]; // Supported rates
546 UCHAR SupportedRatesLen;
547 } IBSS_CONFIG, *PIBSS_CONFIG;
549 typedef struct _LED_CONTROL {
550 BOOLEAN fOdd;
551 BOOLEAN fRxActivity;
552 RALINK_TIMER_STRUCT BlinkTimer; // 50 ms periodic timer
553 ULONG LastLedCsr;
554 } LED_CONTROL;
556 typedef struct _BBP_TUNING_STRUCT {
557 BOOLEAN Enable;
558 UCHAR FalseCcaCountUpperBound; // 100 per sec
559 UCHAR FalseCcaCountLowerBound; // 10 per sec
560 UCHAR R17LowerBound; // specified in E2PROM
561 UCHAR R17UpperBound; // 0x68 according to David Tung
562 UCHAR CurrentR17Value;
563 } BBP_TUNING, *PBBP_TUNING;
565 typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
566 BOOLEAN PrimaryInUsed;
567 BOOLEAN FirstPktArrivedWhenEvaluate;
568 UCHAR PrimaryRxAnt; // 0:Ant-A, 1:Ant-B
569 UCHAR SecondaryRxAnt; // 0:Ant-A, 1:Ant-B
570 UCHAR CurrentRxAnt; // 0:Ant-A, 1:Ant-B
571 USHORT AvgRssi[2]; // AvgRssi[0]:Ant-A, AvgRssi[1]:Ant-B
572 ULONG RcvPktNumWhenEvaluate;
573 RALINK_TIMER_STRUCT RxAntDiversityTimer;
574 } SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;
576 typedef struct _STA_WITH_ETHER_BRIDGE_STRUCT {
577 BOOLEAN Enable;
578 MACADDR EtherMacAddr;
579 } STA_WITH_ETHER_BRIDGE, *PSTA_WITH_ETHER_BRIDGE;
581 // PortConfig
582 typedef struct _PORT_CONFIG {
584 // MIB:ieee802dot11.dot11smt(1).dot11StationConfigTable(1)
585 USHORT CapabilityInfo;
586 USHORT Psm; // power management mode (PWR_ACTIVE|PWR_SAVE)
587 USHORT BeaconPeriod; // in units of TU
589 USHORT CfpMaxDuration;
590 USHORT CfpDurRemain;
591 USHORT CfpCount;
592 USHORT CfpPeriod;
594 USHORT DisassocReason;
595 MACADDR DisassocSta;
596 USHORT DeauthReason;
597 MACADDR DeauthSta;
598 USHORT AuthFailReason;
599 MACADDR AuthFailSta;
601 NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
602 NDIS_802_11_WEP_STATUS WepStatus;
604 // MIB:ieee802dot11.dot11smt(1).dot11WEPDefaultKeysTable(3)
605 WEP_KEY SharedKey[SHARE_KEY_NO]; // Keep for backward compatiable
606 WPA_KEY PairwiseKey[PAIRWISE_KEY_NO];
607 WPA_KEY GroupKey[GROUP_KEY_NO];
608 WPA_KEY PskKey; // WPA PSK mode PMK
609 UCHAR PTK[64];
611 // WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
612 UCHAR PortSecured;
614 // For WPA countermeasures
615 ULONG LastMicErrorTime; // record last MIC error time
616 ULONG MicErrCnt; // Should be 0, 1, 2, then reset to zero (after disassoiciation).
617 BOOLEAN bBlockAssoc; // Block associate attempt for 60 seconds after counter measure occurred.
618 // For WPA-PSK supplicant state
619 WPA_STATE WpaState; // Default is SS_NOTUSE and handled by microsoft 802.1x
620 UCHAR ReplayCounter[8];
621 UCHAR ANonce[32]; // ANonce for WPA-PSK from aurhenticator
622 UCHAR SNonce[32]; // SNonce for WPA-PSK
624 // MIB:ieee802dot11.dot11smt(1).dot11WEPKeyMappingsTable(4)
625 // not implemented yet
627 // MIB:ieee802dot11.dot11smt(1).dot11PrivacyTable(5)
628 UCHAR DefaultKeyId;
629 NDIS_802_11_PRIVACY_FILTER PrivacyFilter; // PrivacyFilter enum for 802.1X
631 // MIB:ieee802dot11.dot11mac(2).dot11OperationTable(1)
632 USHORT RtsThreshold; // in units of BYTE
633 USHORT FragmentThreshold;
634 BOOLEAN bFragmentZeroDisable; // Microsoft use 0 as disable
636 // MIB:ieee802dot11.dot11phy(4).dot11PhyAntennaTable(2)
637 UCHAR CurrentTxAntenna;
638 UCHAR CurrentRxAntenna;
639 UCHAR NumberOfAntenna;
641 // MIB:ieee802dot11.dot11phy(4).dot11PhyTxPowerTable(3)
642 UCHAR CurrentTxPowerLevelIndex; //default&other value=MaxPower,1=MinPower,2=1*MaxPower/4,3=2*MaxPower/4,4=3*MaxPower/4,
643 UCHAR TxPower;
644 UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ...
645 BOOLEAN EnableAutoRateSwitching; // 1 - enable auto rate switching; 0 - disable
646 ULONG TxPowerPercentage; // 0~100 %
648 // MIB:ieee802dot11.dot11phy(4).dot11PhyDSSSTable(5)
649 UCHAR Channel; // current (I)BSS channel used in the station
650 UCHAR CountryRegion; // Enum of country region, 0:FCC, 1:IC, 2:ETSI, 3:SPAIN, 4:France, 5:MKK, 6:MKK1, 7:Israel
652 // MIB:ieee802dot11.dot11phy(4).dot11AntennasListTable(8)
653 BOOLEAN AntennaSupportTx;
654 BOOLEAN AntennaSupportRx;
655 BOOLEAN AntennaSupportDiversityRx;
657 // Use user changed MAC
658 BOOLEAN bLocalAdminMAC;
660 // MIB:ieee802dot11.dot11phy(4).dot11SupportedDataRatesTxTable(9)
661 // MIB:ieee802dot11.dot11phy(4).dot11SupportedDataRatesRxTable(10)
662 UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES]; // Supported rates
663 UCHAR SupportedRatesLen;
664 UCHAR ExpectedACKRate[MAX_LEN_OF_SUPPORTED_RATES];
665 // Copy supported rate from desired AP's beacon. We are trying to match
666 // AP's supported and extended rate settings.
667 UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
668 UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
669 UCHAR SupRateLen;
670 UCHAR ExtRateLen;
673 // other parameters not defined in standard MIB
675 UCHAR DesiredRates[MAX_LEN_OF_SUPPORTED_RATES]; // OID_802_11_DESIRED_RATES
676 UCHAR MaxDesiredRate;
677 USHORT RecvDtim;
678 MACADDR Bssid;
679 MACADDR Broadcast; // FF:FF:FF:FF:FF:FF
680 USHORT Pss; // current power saving status (PWR_SAVE|PWR_ACTIVE)
681 UCHAR RssiTrigger;
682 UCHAR RssiTriggerMode; // RSSI_TRIGGERED_UPON_BELOW_THRESHOLD or RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD
683 UCHAR LastRssi; // last received BEACON's RSSI
684 SHORT LastAvgRssi; // last
685 USHORT AvgRssi; // last 8 BEACON's average RSSI
686 USHORT AtimWin; // in kusec; IBSS parameter set element
687 USHORT Aid; // association ID
688 UCHAR RtsRate; // RATE_xxx
689 UCHAR MlmeRate; // RATE_xxx, used to send MLME frames
690 UCHAR MaxTxRate; // RATE_xxx
691 USHORT DefaultListenCount; // default listen count;
692 UCHAR BssType; // BSS_INFRA or BSS_INDEP
694 UCHAR SsidLen; // the actual ssid length in used
695 CHAR Ssid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
697 BSS_TABLE BssTab; // BSS Table
699 // global variables mXXXX used in MAC protocol state machines
700 BOOLEAN Mibss;
701 BOOLEAN Massoc;
702 BOOLEAN Mauth;
704 // PHY specification
705 UCHAR PhyMode; // PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED
706 USHORT Dsifs; // in units of usec
708 ULONG WindowsPowerMode; // Power mode for AC power
709 ULONG WindowsBatteryPowerMode; // Power mode for battery if exists
710 BOOLEAN WindowsACCAMEnable; // Enable CAM power mode when AC on
711 ULONG PacketFilter; // Packet filter for receiving
712 BOOLEAN AutoReconnect; // Set to TRUE when setting OID_802_11_SSID with no matching BSSID
714 ULONG WindowsTxPreamble; // Rt802_11PreambleLong, Rt802_11PreambleShort, Rt802_11PreambleAuto
716 UCHAR ChannelTxPower[MAX_LEN_OF_CHANNELS]; // Store Tx power value for all channels.
717 UCHAR ChannelTssiRef[MAX_LEN_OF_CHANNELS]; // Store Tssi Reference value for all channels.
718 UCHAR ChannelTssiDelta; // Store Tx TSSI delta increment / decrement value
719 BOOLEAN bAutoTxAgc;
720 UCHAR ChannelList[MAX_LEN_OF_CHANNELS]; // list all supported channels for site survey
721 UCHAR ChannelListNum; // number of channel in ChannelList[]
722 BOOLEAN bShowHiddenSSID;
724 // configuration to be used when this STA starts a new ADHOC network
725 IBSS_CONFIG IbssConfig;
727 ULONG LastBeaconRxTime; // OS's timestamp of the last BEACON RX time
728 ULONG Last11bBeaconRxTime; // OS's timestamp of the last 11B BEACON RX time
729 ULONG LastScanTime; // Record last scan time for issue BSSID_SCAN_LIST
730 ULONG IgnoredScanNumber; // Ignored BSSID_SCAN_LIST requests
731 BOOLEAN bSwRadio; // Software controlled Radio On/Off, TRUE: On
732 BOOLEAN bHwRadio; // Hardware controlled Radio On/Off, TRUE: On
733 BOOLEAN bRadio; // Radio state, And of Sw & Hw radio state
734 BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
736 LED_CONTROL LedCntl;
737 UCHAR RfType;
738 UCHAR LedMode;
739 RALINK_TIMER_STRUCT RfTuningTimer;
740 STA_WITH_ETHER_BRIDGE StaWithEtherBridge;
742 // New for WPA, windows want us to to keep association information and
743 // Fixed IEs from last association response
744 NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo;
745 // NDIS_802_11_FIXED_IEs FixIEs;
746 UCHAR ReqVarIELen; // Length of next VIE include EID & Length
747 UCHAR ReqVarIEs[MAX_VIE_LEN];
748 UCHAR ResVarIELen; // Length of next VIE include EID & Length
749 UCHAR ResVarIEs[MAX_VIE_LEN];
751 // the following fields are user setting from UI
752 ULONG EnableTurboRate; // 0: disable, 1: enable 72/100 Mbps whenever applicable
753 ULONG EnableTxBurst; // 0: disable, 1: enable TX PACKET BURST
754 ULONG UseBGProtection; // 0: auto, 1: always use, 2: always not use
755 ULONG UseShortSlotTime; // 0: disable, 1: enable 9us short slot time if AP supports
756 ULONG AdhocMode; // 0:WIFI mode (11b rates only), 1:allow OFDM rates
758 // this flag is the result calculated from UI settings and AP's ERP/Capability
759 ULONG BGProtectionInUsed; // 0: not in-used, 1: in-used
760 ULONG ShortSlotInUsed; // 0: not in-used, 1: in-used
761 USHORT TxPreambleInUsed; // Rt802_11PreambleLong, Rt802_11PreambleShort
763 // PCI clock adjustment round
764 UCHAR PciAdjustmentRound;
766 // latch th latest RF programming value here since RF IC doesn't support READ operation
767 RTMP_RF_REGS LatchRfRegs;
769 BOOLEAN BbpTuningEnable;
770 UCHAR VgcLowerBound;
771 RT_802_11_RX_AGC_VGC_TUNING BbpTuning;
772 UCHAR LastR17Value;
774 // New for RSSI to dbm veriable
775 UCHAR RssiToDbm; // EEPROM 0x7c
776 ULONG SystemErrorBitmap; // b0: E2PROM version error
778 // This soft Rx Antenna Diversity mechanism is used only when user set
779 // RX Antenna = DIVERSITY ON
780 SOFT_RX_ANT_DIVERSITY RxAnt;
782 ULONG Rt2560Version; // MAC/BBP serial interface issue solved after ver.D
783 ULONG EepromVersion; // byte 0: version, byte 1: revision, byte 2~3: unused
784 UCHAR BbpWriteLatch[100]; // record last BBP register value written via BBP_IO_WRITE
785 // ULONG CurrTxRateStableTime; // # of second in current TX rate
786 // UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
787 ULONG NumOfAvgRssiSample;
788 } PORT_CONFIG, *PPORT_CONFIG;
790 typedef struct _MLME_MEMORY_STRUCT {
791 PVOID AllocVa; //Pointer to the base virtual address of the allocated memory
792 struct _MLME_MEMORY_STRUCT *Next; //Pointer to the next virtual address of the allocated memory
793 } MLME_MEMORY_STRUCT, *PMLME_MEMORY_STRUCT;
795 typedef struct _MLME_MEMORY_HANDLER {
796 BOOLEAN MemRunning; //The flag of the Mlme memory handler's status
797 UINT MemoryCount; //Total nonpaged system-space memory not size
798 UINT InUseCount; //Nonpaged system-space memory in used counts
799 UINT UnUseCount; //Nonpaged system-space memory available counts
800 UINT PendingCount; //Nonpaged system-space memory for free counts
801 PMLME_MEMORY_STRUCT pInUseHead; //Pointer to the first nonpaed memory not used
802 PMLME_MEMORY_STRUCT pInUseTail; //Pointer to the last nonpaged memory not used
803 PMLME_MEMORY_STRUCT pUnUseHead; //Pointer to the first nonpaged memory in used
804 PMLME_MEMORY_STRUCT pUnUseTail; //Pointer to the last nonpaged memory in used
805 PULONG MemFreePending[MAX_MLME_HANDLER_MEMORY]; //an array to keep pending free-memory's pointer (32bits)
806 } MLME_MEMORY_HANDLER, *PMLME_MEMORY_HANDLER;
808 typedef struct _MLME_STRUCT {
809 STATE_MACHINE CntlMachine, AssocMachine, AuthMachine, AuthRspMachine, SyncMachine, WpaPskMachine;
810 STATE_MACHINE_FUNC CntlFunc[CNTL_FUNC_SIZE], AssocFunc[ASSOC_FUNC_SIZE];
811 STATE_MACHINE_FUNC AuthFunc[AUTH_FUNC_SIZE], AuthRspFunc[AUTH_RSP_FUNC_SIZE];
812 STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE], WpaPskFunc[WPA_PSK_FUNC_SIZE];
814 ASSOC_AUX AssocAux;
815 AUTH_AUX AuthAux;
816 AUTH_RSP_AUX AuthRspAux;
817 SYNC_AUX SyncAux;
818 CNTL_AUX CntlAux;
820 COUNTER_802_11 PrevWlanCounters;
821 ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming
823 BOOLEAN Running;
824 spinlock_t TaskLock;
825 MLME_QUEUE Queue;
827 UINT ShiftReg;
828 PSPOLL_FRAME PsFr;
829 MACHDR NullFr;
831 RALINK_TIMER_STRUCT PeriodicTimer;
832 ULONG PeriodicRound;
833 ULONG PrevTxCnt;
835 MLME_MEMORY_HANDLER MemHandler; //The handler of the nonpaged memory inside MLME
836 } MLME_STRUCT, *PMLME_STRUCT;
839 // Management ring buffer format
841 typedef struct _MGMT_STRUC {
842 BOOLEAN Valid;
843 PUCHAR pBuffer;
844 ULONG Length;
845 } MGMT_STRUC, *PMGMT_STRUC;
848 // P802.11 Frame control field, 16 bit
850 typedef struct PACKED _FRAME_CONTROL {
851 #ifdef BIG_ENDIAN
852 USHORT Order:1;
853 USHORT Wep:1;
854 USHORT MoreData:1;
855 USHORT PwrMgt:1;
856 USHORT Retry:1;
857 USHORT MoreFrag:1;
858 USHORT FrDs:1;
859 USHORT ToDs:1;
860 USHORT Subtype:4;
861 USHORT Type:2;
862 USHORT Ver:2;
863 #else
864 USHORT Ver:2; // Protocol version
865 USHORT Type:2; // MSDU type
866 USHORT Subtype:4; // MSDU subtype
867 USHORT ToDs:1; // To DS indication
868 USHORT FrDs:1; // From DS indication
869 USHORT MoreFrag:1; // More fragment bit
870 USHORT Retry:1; // Retry status bit
871 USHORT PwrMgt:1; // Power management bit
872 USHORT MoreData:1; // More data bit
873 USHORT Wep:1; // Wep data
874 USHORT Order:1; // Strict order expected
875 #endif
876 } FRAME_CONTROL, *PFRAME_CONTROL;
879 // P802.11 intermediate header format
881 typedef struct PACKED _CONTROL_HEADER {
882 FRAME_CONTROL Frame; // Frame control structure
883 USHORT Duration; // Duration value
884 MACADDR Addr1; // Address 1 field
885 MACADDR Addr2; // Address 2 field
886 } CONTROL_HEADER, *PCONTROL_HEADER;
889 // P802.11 header format
891 typedef struct PACKED _HEADER_802_11 {
892 CONTROL_HEADER Controlhead;
893 MACADDR Addr3; // Address 3 field
894 #ifdef BIG_ENDIAN
895 USHORT Sequence:12; // Sequence number
896 USHORT Frag:4; // Fragment number
897 #else
898 USHORT Frag:4; // Fragment number
899 USHORT Sequence:12; // Sequence number
900 #endif
901 } HEADER_802_11, *PHEADER_802_11;
904 // Receive Tuple Cache Format
906 typedef struct PACKED _TUPLE_CACHE {
907 BOOLEAN Valid;
908 MACADDR MAC;
909 USHORT Sequence;
910 USHORT Frag;
911 } TUPLE_CACHE, *PTUPLE_CACHE;
914 // Fragment Frame structure
916 typedef struct PACKED _FRAGMENT_FRAME {
917 UCHAR Header802_3[14];
918 UCHAR Header_LLC[8];
919 UCHAR Buffer[LENGTH_802_3 + MAX_FRAME_SIZE];
920 ULONG RxSize;
921 USHORT Sequence;
922 USHORT LastFrag;
923 ULONG Flags; // Some extra frame information. bit 0: LLC presented
924 } FRAGMENT_FRAME, *PFRAGMENT_FRAME;
927 // Tkip Key structure which RC4 key & MIC calculation
929 typedef struct PACKED _TKIP_KEY_INFO {
930 UINT nBytesInM; // # bytes in M for MICKEY
931 ULONG IV16;
932 ULONG IV32;
933 ULONG K0; // for MICKEY Low
934 ULONG K1; // for MICKEY Hig
935 ULONG L; // Current state for MICKEY
936 ULONG R; // Current state for MICKEY
937 ULONG M; // Message accumulator for MICKEY
938 UCHAR RC4KEY[16];
939 UCHAR MIC[8];
940 } TKIP_KEY_INFO, *PTKIP_KEY_INFO;
943 // Private / Misc data, counters for driver internal use
945 typedef struct __PRIVATE_STRUC {
946 ULONG SystemResetCnt; // System reset counter
947 ULONG TxRingFullCnt; // Tx ring full occurrance number
948 ULONG ResetCountDown; // Count down before issue reset, patch for RT2430
949 ULONG CCAErrCnt; // CCA error count, for debug purpose, might move to global counter
950 ULONG PhyRxErrCnt; // PHY Rx error count, for debug purpose, might move to global counter
951 ULONG PhyTxErrCnt; // PHY Tx error count, for debug purpose, might move to global counter
952 // Variables for WEP encryption / decryption in rtmp_wep.c
953 ULONG FCSCRC32;
954 ULONG RxSetCnt;
955 ULONG DecryptCnt;
956 ARCFOURCONTEXT WEPCONTEXT;
957 // Tkip stuff
958 TKIP_KEY_INFO Tx;
959 TKIP_KEY_INFO Rx;
960 } PRIVATE_STRUC, *PPRIVATE_STRUC;
963 // All DMA ring formats
965 struct ring_desc {
966 // Descriptor size & dma address
967 u32 size;
968 void *va_addr;
969 dma_addr_t pa_addr;
970 // Dma buffer size and address for real transfer
971 u32 data_size;
972 void *va_data_addr;
973 dma_addr_t pa_data_addr;
974 UCHAR FrameType; // Type of frame in ring buffer
977 #ifdef RALINK_ATE
978 typedef struct _ATE_INFO {
979 UCHAR Mode;
980 UCHAR TxPower;
981 UCHAR Addr1[6];
982 UCHAR Addr2[6];
983 UCHAR Addr3[6];
984 UCHAR Channel;
985 ULONG TxLength;
986 ULONG TxCount;
987 ULONG TxDoneCount;
988 ULONG TxRate;
989 } ATE_INFO, *PATE_INFO;
990 #endif //#ifdef RALINK_ATE
993 // The miniport adapter structure
995 typedef struct _RTMP_ADAPTER
997 char nickn[IW_ESSID_MAX_SIZE+1]; // nickname, only used in the iwconfig i/f
998 int chip_id;
1000 unsigned long CSRBaseAddress; // PCI MMIO Base Address, all access will use
1001 // NdisReadRegisterXx or NdisWriteRegisterXx
1003 // configuration
1004 UCHAR PermanentAddress[ETH_LENGTH_OF_ADDRESS]; // Factory default MAC address
1005 UCHAR CurrentAddress[ETH_LENGTH_OF_ADDRESS]; // User changed MAC address
1007 UCHAR EEPROMAddressNum; // 93c46=6 93c66=8
1008 USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS];
1010 // resource for DMA operation
1011 struct ring_desc TxRing[TX_RING_SIZE]; // Tx Ring
1012 struct ring_desc AtimRing[ATIM_RING_SIZE]; // Atim Ring
1013 struct ring_desc PrioRing[PRIO_RING_SIZE]; // Priority Ring
1014 struct ring_desc RxRing[RX_RING_SIZE]; // Rx Ring
1015 struct ring_desc BeaconRing; // Beacon Ring, only one
1017 MGMT_STRUC MgmtRing[MGMT_RING_SIZE]; // management ring size
1019 ULONG CurRxIndex; // Next RxD read pointer
1020 ULONG CurDecryptIndex; // Next RxD decrypt read pointer
1021 ULONG CurTxIndex; // Next TxD write pointer
1022 ULONG CurEncryptIndex; // Next TxD encrypt write pointer
1023 ULONG CurAtimIndex; // Next AtimD write pointer
1024 ULONG CurPrioIndex; // Next PrioD write pointer
1025 ULONG PushMgmtIndex; // Next SW management ring index
1026 ULONG PopMgmtIndex; // Next SW management ring index
1027 ULONG MgmtQueueSize; // Number of Mgmt request stored in MgmtRing
1028 ULONG NextEncryptDoneIndex;
1029 ULONG NextTxDoneIndex;
1030 ULONG NextAtimDoneIndex;
1031 ULONG NextPrioDoneIndex;
1032 ULONG NextDecryptDoneIndex;
1034 // 802.3 multicast support
1035 ULONG NumberOfMcAddresses; // Number of mcast entry exists
1036 UCHAR McastTable[MAX_MCAST_LIST_SIZE][ETH_LENGTH_OF_ADDRESS]; // Mcast list
1037 //flags
1038 ULONG Flags; // Represent current device status
1040 // Tx software priority queue list, 802.1q priority information mapped as.
1041 // 0,1 -> queue0, 2,3 -> queue1, 4,5 -> queue2, 6,7 -> queue3
1042 QUEUE_HEADER TxSwQueue0; // Tx software priority queue 0 mapped to 0.1
1043 QUEUE_HEADER TxSwQueue1; // Tx software priority queue 1 mapped to 2.3
1044 QUEUE_HEADER TxSwQueue2; // Tx software priority queue 2 mapped to 4.5
1045 QUEUE_HEADER TxSwQueue3;
1047 USHORT Sequence; // Current sequence number
1049 TUPLE_CACHE TupleCache[MAX_CLIENT]; // Maximum number of tuple caches, only useful in Ad-Hoc
1050 UCHAR TupleCacheLastUpdateIndex; // 0..MAX_CLIENT-1
1051 FRAGMENT_FRAME FragFrame; // Frame storage for fragment frame
1053 // For MiniportTransferData
1054 PUCHAR pRxData; // Pointer to current RxRing offset / fragment frame offset
1056 // Counters for 802.3 & generic.
1057 // Add 802.11 specific counters later
1058 COUNTER_802_3 Counters; // 802.3 counters
1059 COUNTER_802_11 WlanCounters; // 802.11 MIB counters
1060 COUNTER_RALINK RalinkCounters; // Ralink propriety counters
1061 COUNTER_DRS DrsCounters; // counters for Dynamic Rate Switching
1063 NDIS_MEDIA_STATE MediaState;
1065 PRIVATE_STRUC PrivateInfo; // Private information & counters
1067 // SpinLocks
1068 spinlock_t TxRingLock; // Tx Ring spinlock
1069 spinlock_t PrioRingLock; // Prio Ring spinlock
1070 spinlock_t AtimRingLock; // Atim Ring spinlock
1071 spinlock_t RxRingLock; // Rx Ring spinlock
1072 spinlock_t TxSwQueueLock; // SendTxWaitQueue spinlock
1073 spinlock_t MemLock; // Memory handler spinlock
1075 // Boolean control for packet filter
1076 BOOLEAN bAcceptDirect;
1077 BOOLEAN bAcceptMulticast;
1078 BOOLEAN bAcceptBroadcast;
1079 BOOLEAN bAcceptAllMulticast;
1081 // Control to check Tx hang
1082 BOOLEAN bTxBusy;
1083 PQUEUE_ENTRY FirstEntryInQueue; // The first packet in Tx queue
1085 // Control disconnect / connect event generation
1086 ULONG LinkDownTime;
1087 ULONG LastRxRate;
1088 UCHAR LastSsidLen; // the actual ssid length in used
1089 CHAR LastSsid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
1090 MACADDR LastBssid;
1091 BOOLEAN bConfigChanged;
1093 PORT_CONFIG PortCfg;
1094 MLME_STRUCT Mlme;
1096 struct pci_dev *pPci_Dev;
1097 struct net_device *net_dev;
1099 RALINK_TIMER_STRUCT timer; // Periodic Media monitoring timer.
1101 BOOLEAN bNetDeviceStopQueue;
1102 BOOLEAN NeedSwapToLittleEndian;
1104 #if WIRELESS_EXT >= 12
1105 struct iw_statistics iw_stats;
1106 #endif
1107 struct net_device_stats stats;
1109 #ifdef RALINK_ATE
1110 ATE_INFO ate;
1111 #endif //#ifdef RALINK_ATE
1112 } RTMP_ADAPTER, *PRTMP_ADAPTER;
1115 // SHA context
1117 typedef struct _SHA_CTX
1119 ULONG Buf[5]; // buffers of five states
1120 UCHAR Input[80]; // input message
1121 ULONG LenInBitCount[2]; // length counter for input message, 0 up to 64 bits
1123 } SHA_CTX;
1126 // Enable & Disable NIC interrupt via writing interrupt mask register
1127 // Since it use ADAPTER structure, it have to be put after structure definition.
1130 #ifdef BIG_ENDIAN
1131 inline VOID
1132 #else
1133 VOID
1134 #endif
1135 NICDisableInterrupt(
1136 IN PRTMP_ADAPTER pAdapter);
1138 #ifdef BIG_ENDIAN
1139 inline VOID
1140 #else
1141 VOID
1142 #endif
1143 NICEnableInterrupt(
1144 IN PRTMP_ADAPTER pAdapter);
1146 BOOLEAN NICCheckForHang(
1147 IN PRTMP_ADAPTER pAd);
1150 INT RT2500_close(
1151 IN struct net_device *net_dev);
1153 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
1154 irqreturn_t RTMPIsr(
1155 IN INT irq,
1156 IN VOID *dev_instance,
1157 IN struct pt_regs *rgs);
1158 #else
1159 VOID RTMPIsr(
1160 IN INT irq,
1161 IN VOID *dev_instance,
1162 IN struct pt_regs *rgs);
1163 #endif
1165 VOID RT2500_timer(
1166 IN unsigned long data);
1168 INT RT2500_open(
1169 IN struct net_device *net_dev);
1171 INT RTMPSendPackets(
1172 IN struct sk_buff *skb,
1173 IN struct net_device *net_dev);
1175 INT RT2500_probe(
1176 IN struct pci_dev *pPci_Dev,
1177 IN const struct pci_device_id *ent);
1179 INT RT2500_ioctl(
1180 IN struct net_device *net_dev,
1181 IN OUT struct ifreq *rq,
1182 IN INT cmd);
1184 VOID RTMPRingCleanUp(
1185 IN PRTMP_ADAPTER pAdapter,
1186 IN UCHAR RingType);
1188 #if WIRELESS_EXT >= 12
1189 struct iw_statistics *RT2500_get_wireless_stats(
1190 IN struct net_device *net_dev);
1191 #endif
1193 struct net_device_stats *RT2500_get_ether_stats(
1194 IN struct net_device *net_dev);
1196 VOID RT2500_set_rx_mode(
1197 IN struct net_device *net_dev);
1199 NDIS_STATUS RTMPAllocDMAMemory(
1200 IN PRTMP_ADAPTER pAd);
1202 VOID RTMPFreeDMAMemory(
1203 IN PRTMP_ADAPTER pAd);
1205 VOID NICReadEEPROMParameters(
1206 IN PRTMP_ADAPTER pAdapter);
1208 VOID NICInitAsicFromEEPROM(
1209 IN PRTMP_ADAPTER pAdapter);
1211 VOID NICInitTransmit(
1212 IN PRTMP_ADAPTER pAdapter);
1214 NDIS_STATUS NICReadAdapterInfo(
1215 IN PRTMP_ADAPTER pAdapter);
1217 VOID NICInitializeAdapter(
1218 IN PRTMP_ADAPTER pAdapter);
1220 VOID NICInitializeAsic(
1221 IN PRTMP_ADAPTER pAdapter);
1223 VOID NICIssueReset(
1224 IN PRTMP_ADAPTER pAdapter);
1226 VOID PortCfgInit(
1227 IN PRTMP_ADAPTER pAdapter);
1229 VOID NICResetFromError(
1230 IN PRTMP_ADAPTER pAdapter);
1232 PUCHAR RTMPFindSection(
1233 IN PCHAR buffer,
1234 IN PCHAR section);
1236 INT RTMPIsFindSection(
1237 IN PUCHAR ptr,
1238 IN PUCHAR buffer);
1240 INT RTMPGetKeyParameter(
1241 IN PUCHAR section,
1242 IN PCHAR key,
1243 OUT PCHAR dest,
1244 IN INT destsize,
1245 IN PCHAR buffer);
1247 VOID RTMPReadParametersFromFile(
1248 IN PRTMP_ADAPTER pAd);
1250 ULONG RTMPEqualMemory(
1251 IN PVOID pSrc1,
1252 IN PVOID pSrc2,
1253 IN ULONG Length);
1255 ULONG RTMPCompareMemory(
1256 IN PVOID pSrc1,
1257 IN PVOID pSrc2,
1258 IN ULONG Length);
1260 VOID NdisZeroMemory(
1261 IN PVOID pSrc,
1262 IN ULONG Length);
1264 VOID NdisMoveMemory(
1265 OUT PVOID pDest,
1266 IN PVOID pSrc,
1267 IN ULONG Length);
1269 void AtoH(char * src, UCHAR * dest, int destlen);
1270 UCHAR BtoH(char ch);
1272 VOID RTMPInitTimer(
1273 IN PRTMP_ADAPTER pAdapter,
1274 IN PRALINK_TIMER_STRUCT pTimer,
1275 IN PVOID pTimerFunc);
1277 VOID RTMPSetTimer(
1278 IN PRTMP_ADAPTER pAdapter,
1279 IN PRALINK_TIMER_STRUCT pTimer,
1280 IN ULONG Value);
1282 VOID RTMPCancelTimer(
1283 IN PRALINK_TIMER_STRUCT pTimer);
1286 // Private routines in rtmp_data.c
1288 VOID RTMPHandleRxDoneInterrupt(
1289 IN PRTMP_ADAPTER pAdapter);
1291 VOID RTMPHandleTxRingTxDoneInterrupt(
1292 IN PRTMP_ADAPTER pAdapter);
1294 VOID RTMPHandlePrioRingTxDoneInterrupt(
1295 IN PRTMP_ADAPTER pAdapter);
1297 VOID RTMPHandleAtimRingTxDoneInterrupt(
1298 IN PRTMP_ADAPTER pAdapter);
1300 VOID RTMPHandleTbcnInterrupt(
1301 IN PRTMP_ADAPTER pAdapter);
1303 VOID RTMPHandleTwakeupInterrupt(
1304 IN PRTMP_ADAPTER pAdapter);
1306 VOID RTMPHandleDecryptionDoneInterrupt(
1307 IN PRTMP_ADAPTER pAdapter);
1309 VOID RTMPHandleEncryptionDoneInterrupt(
1310 IN PRTMP_ADAPTER pAdapter);
1312 VOID RTMPHardTransmitDone(
1313 IN PRTMP_ADAPTER pAdapter,
1314 IN PTXD_STRUC pTxD,
1315 IN UCHAR FrameType);
1317 NDIS_STATUS RTMPSendPacket(
1318 IN PRTMP_ADAPTER pAdapter,
1319 IN struct sk_buff *skb);
1321 //VOID RTMPDeQueuePacket(
1322 // IN PRTMP_ADAPTER pAdapter,
1323 // IN PQUEUE_HEADER pQueue);
1325 VOID RTMPDeQueuePacket(
1326 IN PRTMP_ADAPTER pAdapter);
1328 NDIS_STATUS RTMPHardEncrypt(
1329 IN PRTMP_ADAPTER pAdapter,
1330 IN struct sk_buff *skb,
1331 IN UCHAR NumberRequired,
1332 IN ULONG EnableTxBurst,
1333 IN UCHAR AccessCategory);
1335 NDIS_STATUS RTMPHardTransmit(
1336 IN PRTMP_ADAPTER pAdapter,
1337 IN struct sk_buff *skb,
1338 IN UCHAR NumberRequired);
1340 NDIS_STATUS RTMPFreeDescriptorRequest(
1341 IN PRTMP_ADAPTER pAdapter,
1342 IN UCHAR RingType,
1343 IN UCHAR NumberRequired);
1345 VOID MlmeHardTransmit(
1346 IN PRTMP_ADAPTER pAdapter,
1347 IN PVOID pBuffer,
1348 IN ULONG Length);
1350 USHORT RTMPCalcDuration(
1351 IN PRTMP_ADAPTER pAdapter,
1352 IN UCHAR Rate,
1353 IN ULONG Size);
1355 VOID RTMPWriteTxDescriptor(
1356 IN PTXD_STRUC pTxD,
1357 IN BOOLEAN DoEncrypt,
1358 IN UCHAR CipherAlg,
1359 IN BOOLEAN Ack,
1360 IN BOOLEAN Fragment,
1361 IN BOOLEAN InsTimestamp,
1362 IN UCHAR RetryMode,
1363 IN UCHAR Ifs,
1364 IN UINT Rate,
1365 IN UCHAR Service,
1366 IN ULONG Length,
1367 IN USHORT TxPreamble,
1368 IN UCHAR AccessCategory);
1370 BOOLEAN RTMPSearchTupleCache(
1371 IN PRTMP_ADAPTER pAdapter,
1372 IN PHEADER_802_11 pHeader);
1374 VOID RTMPUpdateTupleCache(
1375 IN PRTMP_ADAPTER pAdapter,
1376 IN PHEADER_802_11 pHeader);
1378 VOID RTMPSuspendMsduTransmission(
1379 IN PRTMP_ADAPTER pAdapter);
1381 VOID RTMPResumeMsduTransmission(
1382 IN PRTMP_ADAPTER pAdapter);
1384 NDIS_STATUS MiniportMMRequest(
1385 IN PRTMP_ADAPTER pAdapter,
1386 IN PVOID pBuffer,
1387 IN ULONG Length);
1389 VOID RTMPSendNullFrame(
1390 IN PRTMP_ADAPTER pAdapter,
1391 IN PVOID pBuffer,
1392 IN ULONG Length,
1393 IN UCHAR TxRate);
1395 inline NDIS_STATUS RTMPCheckRxDescriptor(
1396 IN PRXD_STRUC pRxD);
1398 NDIS_STATUS RTMPApplyPacketFilter(
1399 IN PRTMP_ADAPTER pAdapter,
1400 IN PRXD_STRUC pRxD,
1401 IN PHEADER_802_11 pHeader);
1403 PQUEUE_HEADER RTMPCheckTxSwQueue(
1404 IN PRTMP_ADAPTER pAdapter,
1405 OUT ULONG *Number,
1406 OUT UCHAR *AccessCategory);
1408 #ifdef BIG_ENDIAN
1409 inline VOID RTMPDescriptorEndianChange(
1410 IN PUCHAR pData,
1411 IN ULONG DescriptorType);
1413 VOID RTMPFrameEndianChange(
1414 IN PRTMP_ADAPTER pAdapter,
1415 IN PUCHAR pData,
1416 IN ULONG Dir,
1417 IN BOOLEAN FromRxDoneInt);
1419 VOID WriteBackToDescriptor(
1420 IN PUCHAR Dest,
1421 IN PUCHAR Src,
1422 IN BOOLEAN DoEncrypt,
1423 IN ULONG DescriptorType);
1424 #endif
1426 VOID RTMPReportMicError(
1427 IN PRTMP_ADAPTER pAdapter,
1428 IN PWPA_KEY pWpaKey);
1430 // Private routines in rtmp_wep.c
1432 VOID RTMPInitWepEngine(
1433 IN PRTMP_ADAPTER pAdapter,
1434 IN PUCHAR pKey,
1435 IN UCHAR KeyId,
1436 IN UCHAR KeyLen,
1437 IN PUCHAR pDest);
1439 VOID RTMPEncryptData(
1440 IN PRTMP_ADAPTER pAdapter,
1441 IN PUCHAR pSrc,
1442 IN PUCHAR pDest,
1443 IN UINT Len);
1445 BOOLEAN RTMPDecryptData(
1446 IN PRTMP_ADAPTER pAdapter,
1447 IN PUCHAR pSrc,
1448 IN UINT Len);
1450 VOID RTMPSetICV(
1451 IN PRTMP_ADAPTER pAdapter,
1452 IN PUCHAR pDest);
1454 VOID ARCFOUR_INIT(
1455 IN PARCFOURCONTEXT Ctx,
1456 IN PUCHAR pKey,
1457 IN UINT KeyLen);
1459 UCHAR ARCFOUR_BYTE(
1460 IN PARCFOURCONTEXT Ctx);
1462 VOID ARCFOUR_DECRYPT(
1463 IN PARCFOURCONTEXT Ctx,
1464 IN PUCHAR pDest,
1465 IN PUCHAR pSrc,
1466 IN UINT Len);
1468 VOID ARCFOUR_ENCRYPT(
1469 IN PARCFOURCONTEXT Ctx,
1470 IN PUCHAR pDest,
1471 IN PUCHAR pSrc,
1472 IN UINT Len);
1474 ULONG RTMP_CALC_FCS32(
1475 IN ULONG Fcs,
1476 IN PUCHAR Cp,
1477 IN INT Len);
1480 // MLME routines
1482 //VOID Arc4Init(ARC4_CONTEXT *Ctx, UCHAR *Key, ULONG KeyLen);
1483 //UCHAR Arc4Byte(ARC4_CONTEXT *Ctx);
1484 //VOID Arc4Cipher(ARC4_CONTEXT *Ctx, UCHAR *Dest, UCHAR *Src, ULONG Len);
1486 // Asic/RF/BBP related functions
1488 VOID AsicAdjustTxPower(
1489 IN PRTMP_ADAPTER pAd);
1491 VOID AsicSwitchChannel(
1492 IN PRTMP_ADAPTER pAdapter,
1493 IN UCHAR Channel);
1495 VOID AsicLockChannel(
1496 IN PRTMP_ADAPTER pAd,
1497 IN UCHAR Channel) ;
1499 VOID AsicRfTuningExec(
1500 IN unsigned long data);
1502 VOID AsicSleepThenAutoWakeup(
1503 IN PRTMP_ADAPTER pAdapter,
1504 IN USHORT TbttNumToNextWakeUp);
1506 VOID AsicForceSleep(
1507 IN PRTMP_ADAPTER pAdapter);
1509 VOID AsicForceWakeup(
1510 IN PRTMP_ADAPTER pAdapter);
1512 VOID AsicSetBssid(
1513 IN PRTMP_ADAPTER pAdapter,
1514 IN MACADDR *Bssid);
1516 VOID AsicDisableSync(
1517 IN PRTMP_ADAPTER pAdapter);
1519 VOID AsicEnableBssSync(
1520 IN PRTMP_ADAPTER pAdapter);
1522 VOID AsicEnableIbssSync(
1523 IN PRTMP_ADAPTER pAdapter);
1525 VOID AsicLedPeriodicExec(
1526 IN unsigned long data);
1528 VOID AsicSetRxAnt(
1529 IN PRTMP_ADAPTER pAd);
1531 VOID AsicEvaluateSecondaryRxAnt(
1532 IN PRTMP_ADAPTER pAd);
1534 VOID AsicRxAntEvalTimeout(
1535 IN unsigned long data);
1537 VOID AsicSetSlotTime(
1538 IN PRTMP_ADAPTER pAd,
1539 IN BOOLEAN UseShortSlotTime);
1541 VOID AsicAdjustUsec(
1542 IN PRTMP_ADAPTER pAd);
1544 VOID AsicBbpTuning(
1545 IN PRTMP_ADAPTER pAd);
1547 VOID AsicRestoreBbpSensibility(
1548 IN PRTMP_ADAPTER pAd);
1550 VOID MacAddrRandomBssid(
1551 IN PRTMP_ADAPTER pAdapter,
1552 OUT PMACADDR Addr);
1554 VOID MgtMacHeaderInit(
1555 IN PRTMP_ADAPTER pAdapter,
1556 IN OUT PMACHDR Hdr,
1557 IN UCHAR Subtype,
1558 IN UCHAR ToDs,
1559 // IN UCHAR AddrType,
1560 IN PMACADDR Ds,
1561 IN PMACADDR Bssid);
1563 VOID MlmeRadioOff(
1564 IN PRTMP_ADAPTER pAd);
1566 VOID MlmeRadioOn(
1567 IN PRTMP_ADAPTER pAd);
1569 VOID BssTableInit(
1570 IN BSS_TABLE *Tab);
1572 ULONG BssTableSearch(
1573 IN BSS_TABLE *Tab,
1574 IN PMACADDR Bssid);
1576 VOID BssTableDeleteEntry(
1577 IN OUT BSS_TABLE *Tab,
1578 IN PMACADDR Bssid);
1580 VOID BssEntrySet(
1581 IN PRTMP_ADAPTER pAdapter,
1582 OUT BSS_ENTRY *Bss,
1583 IN MACADDR *Bssid,
1584 IN CHAR Ssid[],
1585 IN UCHAR SsidLen,
1586 IN UCHAR BssType,
1587 IN USHORT BeaconPeriod,
1588 IN BOOLEAN CfExist,
1589 IN CF_PARM *CfParm,
1590 IN USHORT AtimWin,
1591 IN USHORT CapabilityInfo,
1592 IN UCHAR Rates[],
1593 IN UCHAR RatesLen,
1594 IN BOOLEAN ExtendedRateIeExist,
1595 IN UCHAR Channel,
1596 IN UCHAR Rssi,
1597 IN LARGE_INTEGER TimeStamp,
1598 IN PNDIS_802_11_VARIABLE_IEs pVIE);
1600 ULONG BssTableSetEntry(
1601 IN PRTMP_ADAPTER pAdapter,
1602 OUT BSS_TABLE *Tab,
1603 IN MACADDR *Bssid,
1604 IN CHAR Ssid[],
1605 IN UCHAR SsidLen,
1606 IN UCHAR BssType,
1607 IN USHORT BeaconPeriod,
1608 IN BOOLEAN CfExist,
1609 IN CF_PARM *CfParm,
1610 IN USHORT AtimWin,
1611 IN USHORT CapabilityInfo,
1612 IN UCHAR Rates[],
1613 IN UCHAR RatesLen,
1614 IN BOOLEAN ExtendedRateIeExist,
1615 IN UCHAR Channel,
1616 IN UCHAR Rssi,
1617 IN LARGE_INTEGER TimeStamp,
1618 IN PNDIS_802_11_VARIABLE_IEs pVIE);
1620 VOID BssTableSsidSort(
1621 IN PRTMP_ADAPTER pAd,
1622 OUT BSS_TABLE *OutTab,
1623 IN CHAR Ssid[],
1624 IN UCHAR SsidLen);
1626 VOID BssTableSortByRssi(
1627 IN OUT BSS_TABLE *OutTab);
1629 NDIS_802_11_WEP_STATUS BssCipherParse(
1630 IN PUCHAR pCipher);
1632 NDIS_STATUS MlmeQueueInit(
1633 IN MLME_QUEUE *Queue);
1635 VOID MlmeQueueDestroy(
1636 IN MLME_QUEUE *Queue);
1638 BOOLEAN MlmeEnqueue(
1639 OUT MLME_QUEUE *Queue,
1640 IN ULONG Machine,
1641 IN ULONG MsgType,
1642 IN ULONG MsgLen,
1643 IN VOID *Msg);
1645 BOOLEAN MlmeEnqueueForRecv(
1646 IN PRTMP_ADAPTER pAdapter,
1647 OUT MLME_QUEUE *Queue,
1648 IN ULONG TimeStampHigh,
1649 IN ULONG TimeStampLow,
1650 IN UCHAR Rssi,
1651 IN ULONG MsgLen,
1652 IN PVOID Msg);
1654 BOOLEAN MlmeDequeue(
1655 IN MLME_QUEUE *Queue,
1656 OUT MLME_QUEUE_ELEM **Elem);
1658 VOID MlmeRestartStateMachine(
1659 IN PRTMP_ADAPTER pAd);
1661 BOOLEAN MlmeQueueEmpty(
1662 IN MLME_QUEUE *Queue);
1664 BOOLEAN MlmeQueueFull(
1665 IN MLME_QUEUE *Queue);
1667 BOOLEAN MsgTypeSubst(
1668 IN MACFRAME *Fr,
1669 OUT INT *Machine,
1670 OUT INT *MsgType);
1672 VOID StateMachineInit(
1673 IN STATE_MACHINE *Sm,
1674 IN STATE_MACHINE_FUNC Trans[],
1675 IN ULONG StNr,
1676 IN ULONG MsgNr,
1677 IN STATE_MACHINE_FUNC DefFunc,
1678 IN ULONG InitState,
1679 IN ULONG Base);
1681 VOID StateMachineSetAction(
1682 IN STATE_MACHINE *S,
1683 IN ULONG St,
1684 ULONG Msg,
1685 IN STATE_MACHINE_FUNC F);
1687 VOID StateMachinePerformAction(
1688 IN PRTMP_ADAPTER pAdapter,
1689 IN STATE_MACHINE *S,
1690 IN MLME_QUEUE_ELEM *Elem);
1692 VOID Drop(
1693 IN PRTMP_ADAPTER pAdapter,
1694 IN MLME_QUEUE_ELEM *Elem);
1696 VOID StateMachineDestroy(
1697 IN STATE_MACHINE *Sm);
1699 VOID AssocStateMachineInit(
1700 IN PRTMP_ADAPTER pAdapter,
1701 IN STATE_MACHINE *Sm,
1702 OUT STATE_MACHINE_FUNC Trans[]);
1704 VOID ReassocTimeout(
1705 IN unsigned long data);
1707 VOID AssocTimeout(
1708 IN unsigned long data);
1710 VOID DisassocTimeout(
1711 IN unsigned long data);
1713 //----------------------------------------------
1714 VOID MlmeDisassocReqAction(
1715 IN PRTMP_ADAPTER pAdapter,
1716 IN MLME_QUEUE_ELEM *Elem);
1718 VOID MlmeAssocReqAction(
1719 IN PRTMP_ADAPTER pAdapter,
1720 IN MLME_QUEUE_ELEM *Elem);
1722 VOID MlmeReassocReqAction(
1723 IN PRTMP_ADAPTER pAdapter,
1724 IN MLME_QUEUE_ELEM *Elem);
1726 VOID MlmeDisassocReqAction(
1727 IN PRTMP_ADAPTER pAdapter,
1728 IN MLME_QUEUE_ELEM *Elem);
1730 VOID PeerAssocRspAction(
1731 IN PRTMP_ADAPTER pAdapter,
1732 IN MLME_QUEUE_ELEM *Elem);
1734 VOID PeerReassocRspAction(
1735 IN PRTMP_ADAPTER pAdapter,
1736 IN MLME_QUEUE_ELEM *Elem);
1738 VOID PeerDisassocAction(
1739 IN PRTMP_ADAPTER pAdapter,
1740 IN MLME_QUEUE_ELEM *Elem);
1742 VOID DisassocTimeoutAction(
1743 IN PRTMP_ADAPTER pAdapter,
1744 IN MLME_QUEUE_ELEM *Elem);
1746 VOID AssocTimeoutAction(
1747 IN PRTMP_ADAPTER pAdapter,
1748 IN MLME_QUEUE_ELEM *Elem);
1750 VOID ReassocTimeoutAction(
1751 IN PRTMP_ADAPTER pAdapter,
1752 IN MLME_QUEUE_ELEM *Elem);
1754 VOID Cls3errAction(
1755 IN PRTMP_ADAPTER pAdapter,
1756 IN PMACADDR pAddr);
1758 VOID InvalidStateWhenAssoc(
1759 IN PRTMP_ADAPTER pAdapter,
1760 IN MLME_QUEUE_ELEM *Elem);
1762 VOID InvalidStateWhenReassoc(
1763 IN PRTMP_ADAPTER pAdapter,
1764 IN MLME_QUEUE_ELEM *Elem);
1766 VOID InvalidStateWhenDisassociate(
1767 IN PRTMP_ADAPTER pAdapter,
1768 IN MLME_QUEUE_ELEM *Elem);
1770 VOID ComposePsPoll(
1771 IN PRTMP_ADAPTER pAdapter);
1773 VOID ComposeNullFrame(
1774 IN PRTMP_ADAPTER pAdapter);
1776 VOID AssocPostProc(
1777 IN PRTMP_ADAPTER pAdapter,
1778 IN MACADDR *Addr2,
1779 IN USHORT CapabilityInfo,
1780 IN USHORT Aid,
1781 IN UCHAR Rates[],
1782 IN UCHAR RatesLen,
1783 IN BOOLEAN ExtendedRateIeExist);
1785 VOID AuthStateMachineInit(
1786 IN PRTMP_ADAPTER pAdapter,
1787 IN PSTATE_MACHINE sm,
1788 OUT STATE_MACHINE_FUNC Trans[]);
1790 VOID AuthTimeout(
1791 IN unsigned long data);
1793 VOID MlmeAuthReqAction(
1794 IN PRTMP_ADAPTER pAdapter,
1795 IN MLME_QUEUE_ELEM *Elem);
1797 VOID PeerAuthRspAtSeq2Action(
1798 IN PRTMP_ADAPTER pAdapter,
1799 IN MLME_QUEUE_ELEM *Elem);
1801 VOID PeerAuthRspAtSeq4Action(
1802 IN PRTMP_ADAPTER pAdapter,
1803 IN MLME_QUEUE_ELEM *Elem);
1805 VOID AuthTimeoutAction(
1806 IN PRTMP_ADAPTER pAdapter,
1807 IN MLME_QUEUE_ELEM *Elem);
1809 VOID Cls2errAction(
1810 IN PRTMP_ADAPTER pAdapter,
1811 IN PMACADDR pAddr);
1813 VOID MlmeDeauthReqAction(
1814 IN PRTMP_ADAPTER pAdapter,
1815 IN MLME_QUEUE_ELEM *Elem);
1817 VOID InvalidStateWhenAuth(
1818 IN PRTMP_ADAPTER pAdapter,
1819 IN MLME_QUEUE_ELEM *Elem);
1821 //VOID MlmeDeauthReqProc(
1822 // IN PRTMP_ADAPTER pAdapter,
1823 // IN MACADDR *Addr,
1824 // IN USHORT Reason);
1826 //=============================================
1828 VOID AuthRspStateMachineInit(
1829 IN PRTMP_ADAPTER pAdapter,
1830 IN PSTATE_MACHINE Sm,
1831 IN STATE_MACHINE_FUNC Trans[]);
1834 VOID AuthRspChallengeTimeout(
1835 IN unsigned long data);
1837 VOID AuthRspChallengeTimeoutAction(
1838 IN PRTMP_ADAPTER pAdapter,
1839 IN MLME_QUEUE_ELEM *Elem);
1841 VOID PeerAuthAtAuthRspIdleAction(
1842 IN PRTMP_ADAPTER pAdapter,
1843 IN MLME_QUEUE_ELEM *Elem);
1845 VOID PeerAuthAtAuthRspWaitAction(
1846 IN PRTMP_ADAPTER pAdapter,
1847 IN MLME_QUEUE_ELEM *Elem);
1849 VOID PeerDeauthAction(
1850 IN PRTMP_ADAPTER pAdaptor,
1851 IN MLME_QUEUE_ELEM *Elem);
1853 VOID PeerAuthSimpleRspGenAndSend(
1854 IN PRTMP_ADAPTER pAdapter,
1855 IN PMACHDR Hdr,
1856 IN USHORT Alg,
1857 IN USHORT Seq,
1858 IN USHORT Reason,
1859 IN USHORT Status);
1861 //========================================
1863 VOID SyncStateMachineInit(
1864 IN PRTMP_ADAPTER pAdapter,
1865 IN STATE_MACHINE *Sm,
1866 OUT STATE_MACHINE_FUNC Trans[]);
1868 VOID BeaconTimeout(
1869 IN unsigned long data);
1871 VOID AtimTimeout(
1872 IN unsigned long data);
1874 VOID ScanTimeout(
1875 IN unsigned long data);
1877 VOID MlmeScanReqAction(
1878 IN PRTMP_ADAPTER pAdapter,
1879 IN MLME_QUEUE_ELEM *Elem);
1881 VOID InvalidStateWhenScan(
1882 IN PRTMP_ADAPTER pAdapter,
1883 IN MLME_QUEUE_ELEM *Elem);
1885 VOID InvalidStateWhenJoin(
1886 IN PRTMP_ADAPTER pAdapter,
1887 IN MLME_QUEUE_ELEM *Elem);
1889 VOID InvalidStateWhenStart(
1890 IN PRTMP_ADAPTER pAdapter,
1891 IN MLME_QUEUE_ELEM *Elem);
1893 VOID PeerBeacon(
1894 IN PRTMP_ADAPTER pAdapter,
1895 IN MLME_QUEUE_ELEM *Elem);
1897 VOID EnqueueProbeRequest(
1898 IN PRTMP_ADAPTER pAd);
1900 //=========================================
1902 VOID MlmeCntlInit(
1903 IN PRTMP_ADAPTER pAdapter,
1904 IN STATE_MACHINE *S,
1905 OUT STATE_MACHINE_FUNC Trans[]);
1907 VOID MlmeCntlMachinePerformAction(
1908 IN PRTMP_ADAPTER pAdapter,
1909 IN STATE_MACHINE *S,
1910 IN MLME_QUEUE_ELEM *Elem);
1912 VOID CntlIdleProc(
1913 IN PRTMP_ADAPTER pAdapter,
1914 IN MLME_QUEUE_ELEM *Elem);
1916 VOID CntlOidScanProc(
1917 IN PRTMP_ADAPTER pAdapter,
1918 IN MLME_QUEUE_ELEM *Elem);
1920 VOID CntlOidSsidProc(
1921 IN PRTMP_ADAPTER pAdapter,
1922 IN MLME_QUEUE_ELEM * Elem);
1924 VOID CntlOidRTBssidProc(
1925 IN PRTMP_ADAPTER pAdapter,
1926 IN MLME_QUEUE_ELEM *Elem);
1928 VOID CntlMlmeRoamingProc(
1929 IN PRTMP_ADAPTER pAdapter,
1930 IN MLME_QUEUE_ELEM *Elem);
1932 VOID CntlWaitDisassocProc(
1933 IN PRTMP_ADAPTER pAdapter,
1934 IN MLME_QUEUE_ELEM *Elem);
1936 VOID CntlWaitJoinProc(
1937 IN PRTMP_ADAPTER pAdapter,
1938 IN MLME_QUEUE_ELEM *Elem);
1940 VOID CntlWaitReassocProc(
1941 IN PRTMP_ADAPTER pAdapter,
1942 IN MLME_QUEUE_ELEM *Elem);
1944 VOID CntlWaitStartProc(
1945 IN PRTMP_ADAPTER pAdapter,
1946 IN MLME_QUEUE_ELEM *Elem);
1948 VOID CntlWaitAuthProc(
1949 IN PRTMP_ADAPTER pAdapter,
1950 IN MLME_QUEUE_ELEM *Elem);
1952 VOID CntlWaitAuthProc2(
1953 IN PRTMP_ADAPTER pAdapter,
1954 IN MLME_QUEUE_ELEM *Elem);
1956 VOID CntlWaitAssocProc(
1957 IN PRTMP_ADAPTER pAdapter,
1958 IN MLME_QUEUE_ELEM *Elem);
1960 VOID LinkUp(
1961 IN PRTMP_ADAPTER pAdapter,
1962 IN UCHAR BssType);
1964 VOID LinkDown(
1965 IN PRTMP_ADAPTER pAdapter);
1967 VOID MlmeCntlConfirm(
1968 IN PRTMP_ADAPTER pAdapter,
1969 IN ULONG MsgType,
1970 IN USHORT Msg);
1972 VOID IterateOnBssTab(
1973 IN PRTMP_ADAPTER pAdapter);
1975 VOID IterateOnBssTab2(
1976 IN PRTMP_ADAPTER pAdapter);;
1978 VOID JoinParmFill(
1979 IN PRTMP_ADAPTER pAdapter,
1980 IN OUT MLME_JOIN_REQ_STRUCT *JoinReq,
1981 IN ULONG BssIdx);
1983 VOID AssocParmFill(
1984 IN PRTMP_ADAPTER pAdapter,
1985 IN OUT MLME_ASSOC_REQ_STRUCT *AssocReq,
1986 IN MACADDR *Addr,
1987 IN USHORT CapabilityInfo,
1988 IN ULONG Timeout,
1989 IN USHORT ListenIntv);
1991 VOID ScanParmFill(
1992 IN PRTMP_ADAPTER pAdapter,
1993 IN OUT MLME_SCAN_REQ_STRUCT *ScanReq,
1994 IN CHAR Ssid[],
1995 IN UCHAR SsidLen,
1996 IN UCHAR BssType,
1997 IN UCHAR ScanType);
1999 VOID DisassocParmFill(
2000 IN PRTMP_ADAPTER pAdapter,
2001 IN OUT MLME_DISASSOC_REQ_STRUCT *DisassocReq,
2002 IN MACADDR *Addr,
2003 IN USHORT Reason);
2005 VOID StartParmFill(
2006 IN PRTMP_ADAPTER pAdapter,
2007 IN OUT MLME_START_REQ_STRUCT *StartReq,
2008 IN CHAR Ssid[],
2009 IN UCHAR SsidLen);
2011 VOID AuthParmFill(
2012 IN PRTMP_ADAPTER pAdapter,
2013 IN OUT MLME_AUTH_REQ_STRUCT *AuthReq,
2014 IN MACADDR *Addr,
2015 IN USHORT Alg);
2017 VOID EnqueuePsPoll(
2018 IN PRTMP_ADAPTER pAdapter);
2020 VOID EnqueueBeaconFrame(
2021 IN PRTMP_ADAPTER pAdapter);
2023 VOID EnqueueNullFrame(
2024 IN PRTMP_ADAPTER pAdapter,
2025 IN UCHAR TxRate);
2027 VOID MlmeJoinReqAction(
2028 IN PRTMP_ADAPTER pAdapter,
2029 IN MLME_QUEUE_ELEM *Elem);
2031 VOID MlmeScanReqAction(
2032 IN PRTMP_ADAPTER pAdapter,
2033 IN MLME_QUEUE_ELEM *Elem);
2035 VOID MlmeStartReqAction(
2036 IN PRTMP_ADAPTER pAdapter,
2037 IN MLME_QUEUE_ELEM *Elem);
2039 VOID ScanTimeoutAction(
2040 IN PRTMP_ADAPTER pAdapter,
2041 IN MLME_QUEUE_ELEM *Elem);
2043 VOID BeaconTimeoutAtJoinAction(
2044 IN PRTMP_ADAPTER pAdapter,
2045 IN MLME_QUEUE_ELEM *Elem);
2047 VOID PeerBeaconAtScanAction(
2048 IN PRTMP_ADAPTER pAdapter,
2049 IN MLME_QUEUE_ELEM *Elem);
2051 VOID PeerBeaconAtJoinAction(
2052 IN PRTMP_ADAPTER pAdapter,
2053 IN MLME_QUEUE_ELEM *Elem);
2055 VOID PeerBeacon(
2056 IN PRTMP_ADAPTER pAdapter,
2057 IN MLME_QUEUE_ELEM *Elem);
2059 VOID PeerProbeReqAction(
2060 IN PRTMP_ADAPTER pAd,
2061 IN MLME_QUEUE_ELEM *Elem);
2063 VOID ScanNextChannel(
2064 IN PRTMP_ADAPTER pAdapter);
2066 ULONG MakeIbssBeacon(
2067 IN PRTMP_ADAPTER pAdapter);
2069 BOOLEAN MlmeScanReqSanity(
2070 IN PRTMP_ADAPTER pAdapter,
2071 IN VOID *Msg,
2072 IN ULONG MsgLen,
2073 OUT UCHAR *BssType,
2074 OUT CHAR ssid[],
2075 OUT UCHAR *SsidLen,
2076 OUT UCHAR *ScanType);
2078 BOOLEAN PeerBeaconAndProbeRspSanity(
2079 IN PRTMP_ADAPTER pAdapter,
2080 IN VOID *Msg,
2081 IN ULONG MsgLen,
2082 OUT MACADDR *Addr2,
2083 OUT MACADDR *Bssid,
2084 OUT CHAR Ssid[],
2085 OUT UCHAR *SsidLen,
2086 OUT UCHAR *BssType,
2087 OUT USHORT *BeaconPeriod,
2088 OUT UCHAR *Channel,
2089 OUT LARGE_INTEGER *Timestamp,
2090 OUT BOOLEAN *CfExist,
2091 OUT CF_PARM *Cf,
2092 OUT USHORT *AtimWin,
2093 OUT USHORT *CapabilityInfo,
2094 OUT UCHAR Rate[],
2095 OUT UCHAR *RateLen,
2096 OUT BOOLEAN *ExtendedRateIeExist,
2097 OUT UCHAR *Erp,
2098 OUT UCHAR *DtimCount,
2099 OUT UCHAR *DtimPeriod,
2100 OUT UCHAR *BcastFlag,
2101 OUT UCHAR *MessageToMe,
2102 OUT UCHAR *Legacy,
2103 OUT UCHAR SupRate[],
2104 OUT UCHAR *SupRateLen,
2105 OUT UCHAR ExtRate[],
2106 OUT UCHAR *ExtRateLen,
2107 OUT PNDIS_802_11_VARIABLE_IEs pVIE);
2109 //BOOLEAN JoinParmSanity(
2110 // IN PRTMP_ADAPTER pAdapter,
2111 // IN VOID *Msg,
2112 // IN ULONG MsgLen,
2113 // OUT ULONG *BssIdx,
2114 // OUT UCHAR SupportedRates[],
2115 // OUT UCHAR *SupportedRatesLen);
2117 BOOLEAN MlmeAssocReqSanity(
2118 IN PRTMP_ADAPTER pAdapter,
2119 IN VOID *Msg,
2120 IN ULONG MsgLen,
2121 OUT MACADDR *ApAddr,
2122 OUT USHORT *CapabilityInfo,
2123 OUT ULONG *Timeout,
2124 OUT USHORT *ListenIntv);
2126 BOOLEAN MlmeAuthReqSanity(
2127 IN PRTMP_ADAPTER pAdapter,
2128 IN VOID *Msg,
2129 IN ULONG MsgLen,
2130 OUT MACADDR *Addr,
2131 OUT ULONG *Timeout,
2132 OUT USHORT *Alg);
2134 BOOLEAN MlmeStartReqSanity(
2135 IN PRTMP_ADAPTER pAdapter,
2136 IN VOID *Msg,
2137 IN ULONG MsgLen,
2138 OUT CHAR Ssid[],
2139 OUT UCHAR *Ssidlen);
2141 BOOLEAN PeerAuthSanity(
2142 IN PRTMP_ADAPTER pAdapter,
2143 IN VOID *Msg,
2144 IN ULONG MsgLen,
2145 OUT MACADDR *Addr,
2146 OUT USHORT *Alg,
2147 OUT USHORT *Seq,
2148 OUT USHORT *Status,
2149 OUT CHAR ChlgText[]);
2151 BOOLEAN PeerAssocRspSanity(
2152 IN PRTMP_ADAPTER pAdapter,
2153 IN VOID *Msg,
2154 IN ULONG MsgLen,
2155 OUT MACADDR *Addr2,
2156 OUT USHORT *CapabilityInfo,
2157 OUT USHORT *Status,
2158 OUT USHORT *Aid,
2159 OUT UCHAR Rates[],
2160 OUT UCHAR *RatesLen,
2161 OUT BOOLEAN *ExtendedRateIeExist);
2163 BOOLEAN PeerDisassocSanity(
2164 IN PRTMP_ADAPTER pAdapter,
2165 IN VOID *Msg,
2166 IN ULONG MsgLen,
2167 OUT MACADDR *Addr2,
2168 OUT USHORT *Reason);
2170 BOOLEAN PeerDeauthSanity(
2171 IN PRTMP_ADAPTER pAdapter,
2172 IN VOID *Msg,
2173 IN ULONG MsgLen,
2174 OUT MACADDR *Addr2,
2175 OUT USHORT *Reason);
2177 BOOLEAN PeerProbeReqSanity(
2178 IN PRTMP_ADAPTER pAdapter,
2179 IN VOID *Msg,
2180 IN ULONG MsgLen,
2181 OUT MACADDR *Addr2,
2182 OUT CHAR Ssid[],
2183 OUT UCHAR *SsidLen);
2184 // OUT UCHAR Rates[],
2185 // OUT UCHAR *RatesLen);
2187 BOOLEAN GetTimBit(
2188 IN CHAR *Ptr,
2189 IN USHORT Aid,
2190 OUT UCHAR *TimLen,
2191 OUT UCHAR *BcastFlag,
2192 OUT UCHAR *DtimCount,
2193 OUT UCHAR *DtimPeriod,
2194 OUT UCHAR *MessageToMe);
2196 BOOLEAN GetLegacy(
2197 IN CHAR *Ptr,
2198 OUT UCHAR *Legacy);
2200 ULONG MakeOutgoingFrame(
2201 OUT CHAR *Buffer,
2202 OUT ULONG *Length, ...);
2204 VOID LfsrInit(
2205 IN PRTMP_ADAPTER pAdapter,
2206 IN ULONG Seed);
2208 UCHAR RandomByte(
2209 IN PRTMP_ADAPTER pAdapter);
2211 VOID MlmePeriodicExec(
2212 IN unsigned long data);
2214 VOID MlmeAutoScan(
2215 IN PRTMP_ADAPTER pAdapter);
2217 VOID MlmeAutoRecoverNetwork(
2218 IN PRTMP_ADAPTER pAdapter);
2220 VOID MlmeAutoReconnectLastSSID(
2221 IN PRTMP_ADAPTER pAdapter);
2223 VOID MlmeCheckForRoaming(
2224 IN PRTMP_ADAPTER pAdapter,
2225 IN ULONG Now32);
2227 VOID MlmeCheckDynamicTxRateSwitching(
2228 IN PRTMP_ADAPTER pAd);
2230 VOID MlmeCheckChannelQuality(
2231 IN PRTMP_ADAPTER pAdapter,
2232 IN ULONG Now);
2234 VOID MlmeCheckForPsmChange(
2235 IN PRTMP_ADAPTER pAdapter,
2236 IN ULONG Now32);
2238 VOID MlmeSetPsmBit(
2239 IN PRTMP_ADAPTER pAdapter,
2240 IN USHORT psm);
2242 VOID MlmeSetTxPreamble(
2243 IN PRTMP_ADAPTER pAdapter,
2244 IN USHORT TxPreamble);
2246 VOID MlmeUpdateTxRates(
2247 IN PRTMP_ADAPTER pAdapter,
2248 IN BOOLEAN bLinkUp);
2250 NDIS_STATUS MlmeInit(
2251 IN PRTMP_ADAPTER pAdapter);
2253 VOID MlmeHandler(
2254 IN PRTMP_ADAPTER pAdapter);
2256 VOID MlmeHalt(
2257 IN PRTMP_ADAPTER pAdapter);
2259 NDIS_STATUS MlmeInitMemoryHandler(
2260 IN PRTMP_ADAPTER pAd,
2261 IN UINT Number,
2262 IN UINT Size);
2264 NDIS_STATUS MlmeAllocateMemory(
2265 IN PRTMP_ADAPTER pAd,
2266 OUT PVOID *AllocVa);
2268 VOID MlmeFreeMemory(
2269 IN PRTMP_ADAPTER pAd,
2270 IN PVOID AllocVa);
2272 VOID MlmeFreeMemoryHandler(
2273 IN PRTMP_ADAPTER pAd);
2275 VOID BuildChannelList(
2276 IN PRTMP_ADAPTER pAdapter);
2278 UCHAR FirstChannel(
2279 IN PRTMP_ADAPTER pAdapter);
2281 UCHAR NextChannel(
2282 IN PRTMP_ADAPTER pAdapter,
2283 IN UCHAR channel);
2285 VOID RaiseClock(
2286 IN PRTMP_ADAPTER pAd,
2287 IN ULONG *x);
2289 VOID LowerClock(
2290 IN PRTMP_ADAPTER pAd,
2291 IN ULONG *x);
2293 USHORT ShiftInBits(
2294 IN PRTMP_ADAPTER pAd);
2296 VOID ShiftOutBits(
2297 IN PRTMP_ADAPTER pAd,
2298 IN USHORT data,
2299 IN USHORT count);
2301 VOID EEpromCleanup(
2302 IN PRTMP_ADAPTER pAd);
2304 VOID EWDS(
2305 IN PRTMP_ADAPTER pAd);
2307 VOID EWEN(
2308 IN PRTMP_ADAPTER pAd);
2310 USHORT RTMP_EEPROM_READ16(
2311 IN PRTMP_ADAPTER pAd,
2312 IN USHORT Offset);
2314 VOID RTMP_EEPROM_WRITE16(
2315 IN PRTMP_ADAPTER pAd,
2316 IN USHORT Offset,
2317 IN USHORT Data);
2319 UCHAR ChannelSanity(
2320 IN PRTMP_ADAPTER pAd,
2321 IN UCHAR channel);
2324 // Prototypes of function definition in rtmp_tkip.c
2326 VOID RTMPInitTkipEngine(
2327 IN PRTMP_ADAPTER pAdapter,
2328 IN PUCHAR pTKey,
2329 IN UCHAR KeyId,
2330 IN PUCHAR pTA,
2331 IN PUCHAR pMICKey,
2332 IN PUCHAR pTSC,
2333 OUT PULONG pIV16,
2334 OUT PULONG pIV32);
2336 VOID RTMPInitMICEngine(
2337 IN PRTMP_ADAPTER pAdapter,
2338 IN PUCHAR pKey,
2339 IN PUCHAR pDA,
2340 IN PUCHAR pSA,
2341 IN PUCHAR pMICKey);
2343 BOOLEAN RTMPTkipCompareMICValue(
2344 IN PRTMP_ADAPTER pAdapter,
2345 IN PUCHAR pSrc,
2346 IN PUCHAR pDA,
2347 IN PUCHAR pSA,
2348 IN PUCHAR pMICKey,
2349 IN UINT Len);
2351 VOID RTMPCalculateMICValue(
2352 IN PRTMP_ADAPTER pAdapter,
2353 IN struct sk_buff *skb,
2354 IN PUCHAR pEncap,
2355 IN INT LenEncap,
2356 IN PWPA_KEY pWpaKey);
2358 BOOLEAN RTMPTkipCompareMICValueWithLLC(
2359 IN PRTMP_ADAPTER pAdapter,
2360 IN PUCHAR pLLC,
2361 IN PUCHAR pSrc,
2362 IN PUCHAR pDA,
2363 IN PUCHAR pSA,
2364 IN PUCHAR pMICKey,
2365 IN UINT Len);
2367 VOID RTMPTkipAppend(
2368 IN PTKIP_KEY_INFO pTkip,
2369 IN PUCHAR pSrc,
2370 IN UINT nBytes);
2372 VOID RTMPTkipGetMIC(
2373 IN PTKIP_KEY_INFO pTkip);
2375 NDIS_STATUS RTMPWPAAddKeyProc(
2376 IN PRTMP_ADAPTER pAdapter,
2377 IN PVOID pBuf);
2379 NDIS_STATUS RTMPWPARemoveKeyProc(
2380 IN PRTMP_ADAPTER pAdapter,
2381 IN PVOID pBuf);
2383 VOID RTMPWPARemoveAllKeys(
2384 IN PRTMP_ADAPTER pAdapter);
2386 VOID RTMPSetPhyMode(
2387 IN PRTMP_ADAPTER pAdapter,
2388 IN ULONG phymode);
2390 VOID RTMPSetDesiredRates(
2391 IN PRTMP_ADAPTER pAdapter,
2392 IN LONG Rates);
2394 INT RTMPSetInformation(
2395 IN PRTMP_ADAPTER pAdapter,
2396 IN OUT struct ifreq *rq,
2397 IN INT cmd);
2399 INT RTMPQueryInformation(
2400 IN PRTMP_ADAPTER pAdapter,
2401 IN OUT struct ifreq *rq,
2402 IN INT cmd);
2405 // Prototypes of function definition for *iwpriv* in rtmp_info.c
2407 INT Set_CountryRegion_Proc(
2408 IN PRTMP_ADAPTER pAdapter,
2409 IN PUCHAR arg);
2411 INT Set_SSID_Proc(
2412 IN PRTMP_ADAPTER pAdapter,
2413 IN PUCHAR arg);
2415 INT Set_WirelessMode_Proc(
2416 IN PRTMP_ADAPTER pAdapter,
2417 IN PUCHAR arg);
2419 INT Set_TxRate_Proc(
2420 IN PRTMP_ADAPTER pAdapter,
2421 IN PUCHAR arg);
2423 INT Set_AdhocModeRate_Proc(
2424 IN PRTMP_ADAPTER pAdapter,
2425 IN PUCHAR arg);
2427 INT Set_Channel_Proc(
2428 IN PRTMP_ADAPTER pAdapter,
2429 IN PUCHAR
2430 arg);
2432 #ifdef RT2500_DBG
2433 INT Set_Debug_Proc(
2434 IN PRTMP_ADAPTER pAdapter,
2435 IN PUCHAR arg);
2436 #endif
2438 INT Set_BGProtection_Proc(
2439 IN PRTMP_ADAPTER pAdapter,
2440 IN PUCHAR arg);
2442 INT Set_TxPreamble_Proc(
2443 IN PRTMP_ADAPTER pAdapter,
2444 IN PUCHAR arg);
2446 INT Set_StaWithEtherBridge_Proc(
2447 IN PRTMP_ADAPTER pAdapter,
2448 IN PUCHAR arg);
2450 INT Set_RTSThreshold_Proc(
2451 IN PRTMP_ADAPTER pAdapter,
2452 IN PUCHAR arg);
2454 INT Set_FragThreshold_Proc(
2455 IN PRTMP_ADAPTER pAdapter,
2456 IN PUCHAR arg);
2458 INT Set_TxBurst_Proc(
2459 IN PRTMP_ADAPTER pAdapter,
2460 IN PUCHAR arg);
2462 INT Set_TurboRate_Proc(
2463 IN PRTMP_ADAPTER pAdapter,
2464 IN PUCHAR arg);
2466 INT Set_NetworkType_Proc(
2467 IN PRTMP_ADAPTER pAdapter,
2468 IN PUCHAR arg);
2470 INT Set_AuthMode_Proc(
2471 IN PRTMP_ADAPTER pAdapter,
2472 IN PUCHAR arg);
2474 INT Set_EncrypType_Proc(
2475 IN PRTMP_ADAPTER pAdapter,
2476 IN PUCHAR arg);
2478 INT Set_DefaultKeyID_Proc(
2479 IN PRTMP_ADAPTER pAdapter,
2480 IN PUCHAR arg);
2482 INT Set_Key1_Proc(
2483 IN PRTMP_ADAPTER pAdapter,
2484 IN PUCHAR arg);
2486 INT Set_Key2_Proc(
2487 IN PRTMP_ADAPTER pAdapter,
2488 IN PUCHAR arg);
2490 INT Set_Key3_Proc(
2491 IN PRTMP_ADAPTER pAdapter,
2492 IN PUCHAR arg);
2494 INT Set_Key4_Proc(
2495 IN PRTMP_ADAPTER pAdapter,
2496 IN PUCHAR arg);
2498 INT Set_WPAPSK_Proc(
2499 IN PRTMP_ADAPTER pAdapter,
2500 IN PUCHAR arg);
2502 INT Set_WPANONE_Proc(
2503 IN PRTMP_ADAPTER pAdapter,
2504 IN PUCHAR arg);
2506 VOID RTMPIoctlBBP(
2507 IN PRTMP_ADAPTER pAdapter,
2508 IN struct iwreq *wrq);
2510 VOID RTMPIoctlMAC(
2511 IN PRTMP_ADAPTER pAdapter,
2512 IN struct iwreq *wrq);
2514 #ifdef RALINK_ATE
2515 VOID RTMPIoctlE2PROM(
2516 IN PRTMP_ADAPTER pAdapter,
2517 IN struct iwreq *wrq);
2518 #endif
2520 // prototype in wpa.c
2522 BOOLEAN WpaMsgTypeSubst(
2523 IN UCHAR EAPType,
2524 OUT ULONG *MsgType);
2526 VOID WpaPskStateMachineInit(
2527 IN PRTMP_ADAPTER pAd,
2528 IN STATE_MACHINE *S,
2529 OUT STATE_MACHINE_FUNC Trans[]);
2531 VOID WpaEAPOLKeyAction(
2532 IN PRTMP_ADAPTER pAdapter,
2533 IN MLME_QUEUE_ELEM *Elem);
2535 VOID WpaPairMsg1Action(
2536 IN PRTMP_ADAPTER pAdapter,
2537 IN MLME_QUEUE_ELEM *Elem);
2539 VOID WpaPairMsg3Action(
2540 IN PRTMP_ADAPTER pAdapter,
2541 IN MLME_QUEUE_ELEM *Elem);
2543 VOID WpaGroupMsg1Action(
2544 IN PRTMP_ADAPTER pAdapter,
2545 IN MLME_QUEUE_ELEM *Elem);
2547 VOID WpaMacHeaderInit(
2548 IN PRTMP_ADAPTER pAd,
2549 IN OUT PHEADER_802_11 Hdr,
2550 IN UCHAR wep,
2551 IN PMACADDR pAddr1);
2553 VOID WpaHardEncrypt(
2554 IN PRTMP_ADAPTER pAdapter,
2555 IN PUCHAR pPacket,
2556 IN ULONG Len);
2558 VOID HMAC_SHA1(
2559 IN UCHAR *text,
2560 IN UINT text_len,
2561 IN UCHAR *key,
2562 IN UINT key_len,
2563 IN UCHAR *digest);
2565 VOID PRF(
2566 IN UCHAR *key,
2567 IN INT key_len,
2568 IN UCHAR *prefix,
2569 IN INT prefix_len,
2570 IN UCHAR *data,
2571 IN INT data_len,
2572 OUT UCHAR *output,
2573 IN INT len);
2575 VOID WpaCountPTK(
2576 IN UCHAR *PMK,
2577 IN UCHAR *ANonce,
2578 IN UCHAR *AA,
2579 IN UCHAR *SNonce,
2580 IN UCHAR *SA,
2581 OUT UCHAR *output,
2582 IN UINT len);
2584 VOID GenRandom(
2585 IN PRTMP_ADAPTER pAd,
2586 OUT UCHAR *random);
2588 VOID AES_GTK_KEY_UNWRAP(
2589 IN UCHAR *key,
2590 OUT UCHAR *plaintext,
2591 IN UCHAR *ciphertext);
2593 ULONG RTMPTkipGetUInt32(
2594 IN PUCHAR pMICKey);
2596 char * rtstrstr(
2597 IN const char * s1,
2598 IN const char * s2);
2600 #ifdef RALINK_ATE
2601 INT Set_ATE_Proc(
2602 IN PRTMP_ADAPTER pAdapter,
2603 IN PUCHAR arg);
2605 INT Set_ATE_DA_Proc(
2606 IN PRTMP_ADAPTER pAdapter,
2607 IN PUCHAR arg);
2609 INT Set_ATE_SA_Proc(
2610 IN PRTMP_ADAPTER pAdapter,
2611 IN PUCHAR arg);
2613 INT Set_ATE_BSSID_Proc(
2614 IN PRTMP_ADAPTER pAdapter,
2615 IN PUCHAR arg);
2617 INT Set_ATE_CHANNEL_Proc(
2618 IN PRTMP_ADAPTER pAdapter,
2619 IN PUCHAR arg);
2621 INT Set_ATE_TX_POWER_Proc(
2622 IN PRTMP_ADAPTER pAdapter,
2623 IN PUCHAR arg);
2625 INT Set_ATE_TX_LENGTH_Proc(
2626 IN PRTMP_ADAPTER pAdapter,
2627 IN PUCHAR arg);
2629 INT Set_ATE_TX_COUNT_Proc(
2630 IN PRTMP_ADAPTER pAdapter,
2631 IN PUCHAR arg);
2633 INT Set_ATE_TX_RATE_Proc(
2634 IN PRTMP_ADAPTER pAdapter,
2635 IN PUCHAR arg);
2637 VOID RTMPStationStop(
2638 IN PRTMP_ADAPTER pAd);
2640 VOID RTMPStationStart(
2641 IN PRTMP_ADAPTER pAd);
2643 #endif //#ifdef RALINK_ATE
2645 #endif // __RTMP_H__