2 ***************************************************************************
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 ***************************************************************************
22 Miniport generic portion header file
26 -------- ---------- ----------------------------------------------
27 Paul Lin 08-01-2002 created
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
;
54 typedef struct _QUEUE_HEADER
{
58 } QUEUE_HEADER
, *PQUEUE_HEADER
;
60 #define InitializeQueueHeader(QueueHeader) \
62 (QueueHeader)->Head = (QueueHeader)->Tail = NULL; \
63 (QueueHeader)->Number = 0; \
66 #define RemoveHeadQueue(QueueHeader) \
67 (QueueHeader)->Head; \
70 pNext = (QueueHeader)->Head->Next; \
71 (QueueHeader)->Head = pNext; \
73 (QueueHeader)->Tail = NULL; \
74 (QueueHeader)->Number--; \
77 #define InsertHeadQueue(QueueHeader, QueueEntry) \
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) \
88 ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
89 if ((QueueHeader)->Tail) \
90 (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
92 (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
93 (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
94 (QueueHeader)->Number++; \
98 // MACRO for debugging information
101 extern ULONG RTDebugLevel
;
103 #define DBGPRINT(Level, fmt, args...) \
105 if (Level <= RTDebugLevel) \
107 printk("%s %d> ", __FILE__, __LINE__); \
108 printk(fmt, ## args); \
112 #define DBGPRINT(Level, fmt, args...)
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
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,
184 // PRTMP_ADAPTER pAdapter,
185 // ULONG Register_Offset,
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))
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))
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; \
208 RTMP_IO_READ32(_A, BBPCSR, &Value.word); \
209 if (Value.field.Busy == IDLE) \
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) \
224 RTMP_IO_READ32(_A, RFCSR, &(Value.word)); \
225 if (Value.field.Busy == IDLE) \
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; \
239 RTMP_BBP_IO_WRITE32(_A, *(_pV)); \
241 RTMP_IO_READ32(_A, BBPCSR, &Value.word);\
242 if (Value.field.Busy == IDLE) \
245 } while (BusyCnt < MAX_BUSY_COUNT); \
246 if (BusyCnt == MAX_BUSY_COUNT) \
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; \
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; \
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
280 #define min(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
284 #define max(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
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
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) \
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); \
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); \
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
347 } RTMP_REG_PAIR
, *PRTMP_REG_PAIR
;
350 // Register set pair for initialzation register set definition
352 typedef struct _RTMP_RF_REGS
359 } RTMP_RF_REGS
, *PRTMP_RF_REGS
;
362 // Statistic counter structure
364 typedef struct _COUNTER_802_3
374 ULONG RcvAlignmentErrors
;
376 ULONG MoreCollisions
;
378 } COUNTER_802_3
, *PCOUNTER_802_3
;
380 typedef struct _COUNTER_802_11
{
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
;
405 ULONG RxRingErrCount
;
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
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
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_
485 } TKIP_IV
, *PTKIP_IV
;
487 // configuration to be used when this STA starts a new ADHOC network
488 typedef struct _IBSS_CONFIG
{
492 UCHAR SupportedRates
[MAX_LEN_OF_SUPPORTED_RATES
]; // Supported rates
493 UCHAR SupportedRatesLen
;
494 } IBSS_CONFIG
, *PIBSS_CONFIG
;
496 typedef struct _LED_CONTROL
{
499 RALINK_TIMER_STRUCT BlinkTimer
; // 50 ms periodic timer
503 typedef struct _BBP_TUNING_STRUCT
{
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
;
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
;
533 USHORT DisassocReason
;
537 USHORT AuthFailReason
;
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
550 // WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
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)
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,
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
];
612 // other parameters not defined in standard MIB
614 UCHAR DesiredRates
[MAX_LEN_OF_SUPPORTED_RATES
]; // OID_802_11_DESIRED_RATES
615 UCHAR MaxDesiredRate
;
618 MACADDR Broadcast
; // FF:FF:FF:FF:FF:FF
619 USHORT Pss
; // current power saving status (PWR_SAVE|PWR_ACTIVE)
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
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
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
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
;
708 RT_802_11_RX_AGC_VGC_TUNING BbpTuning
;
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
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
];
752 AUTH_RSP_AUX AuthRspAux
;
756 COUNTER_802_11 PrevWlanCounters
;
757 ULONG ChannelQuality
; // 0..100, Channel Quality Indication for Roaming
767 RALINK_TIMER_STRUCT PeriodicTimer
;
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
{
781 } MGMT_STRUC
, *PMGMT_STRUC
;
784 // P802.11 Frame control field, 16 bit
786 typedef struct PACKED _FRAME_CONTROL
{
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
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
831 USHORT Sequence
:12; // Sequence number
832 USHORT Frag
:4; // Fragment number
834 USHORT Frag
:4; // Fragment number
835 USHORT Sequence
:12; // Sequence number
837 } HEADER_802_11
, *PHEADER_802_11
;
840 // Receive Tuple Cache Format
842 typedef struct PACKED _TUPLE_CACHE
{
847 } TUPLE_CACHE
, *PTUPLE_CACHE
;
850 // Fragment Frame structure
852 typedef struct PACKED _FRAGMENT_FRAME
{
853 UCHAR Header802_3
[14];
855 UCHAR Buffer
[MAX_FRAME_SIZE
];
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
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
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
892 ARCFOURCONTEXT WEPCONTEXT
;
896 } PRIVATE_STRUC
, *PPRIVATE_STRUC
;
899 // All DMA ring formats
902 // Descriptor size & dma address
906 // Dma buffer size and address for real transfer
909 dma_addr_t pa_data_addr
;
910 UCHAR FrameType
; // Type of frame in ring buffer
914 typedef struct _ATE_INFO
{
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
936 unsigned long CSRBaseAddress
; // PCI MMIO Base Address, all access will use
937 // NdisReadRegisterXx or NdisWriteRegisterXx
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
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
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
1019 PQUEUE_ENTRY FirstEntryInQueue
; // The first packet in Tx queue
1021 // Control disconnect / connect event generation
1024 UCHAR LastSsidLen
; // the actual ssid length in used
1025 CHAR LastSsid
[MAX_LEN_OF_SSID
]; // NOT NULL-terminated
1027 BOOLEAN bConfigChanged
;
1029 PORT_CONFIG PortCfg
;
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
;
1043 struct net_device_stats stats
;
1047 #endif //#ifdef RALINK_ATE
1048 } RTMP_ADAPTER
, *PRTMP_ADAPTER
;
1058 ULONG sizeHi
, sizeLo
;
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
);
1076 IN
struct net_device
*net_dev
);
1078 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
1079 irqreturn_t
RTMPIsr(
1081 IN VOID
*dev_instance
,
1082 IN
struct pt_regs
*rgs
);
1086 IN VOID
*dev_instance
,
1087 IN
struct pt_regs
*rgs
);
1091 IN
unsigned long data
);
1094 IN
struct net_device
*net_dev
);
1096 INT
RTMPSendPackets(
1097 IN
struct sk_buff
*skb
,
1098 IN
struct net_device
*net_dev
);
1101 IN
struct pci_dev
*pPci_Dev
,
1102 IN
const struct pci_device_id
*ent
);
1105 IN
struct net_device
*net_dev
,
1106 IN OUT
struct ifreq
*rq
,
1109 VOID
RTMPRingCleanUp(
1110 IN PRTMP_ADAPTER pAdapter
,
1113 #if WIRELESS_EXT >= 12
1114 struct iw_statistics
*RT2500_get_wireless_stats(
1115 IN
struct net_device
*net_dev
);
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
);
1149 IN PRTMP_ADAPTER pAdapter
);
1152 IN PRTMP_ADAPTER pAdapter
);
1154 VOID
NICResetFromError(
1155 IN PRTMP_ADAPTER pAdapter
);
1157 PUCHAR
RTMPFindSection(
1161 INT
RTMPIsFindSection(
1165 INT
RTMPGetKeyParameter(
1172 VOID
RTMPReadParametersFromFile(
1173 IN PRTMP_ADAPTER pAd
);
1175 ULONG
RTMPEqualMemory(
1180 ULONG
RTMPCompareMemory(
1185 VOID
NdisZeroMemory(
1189 VOID
NdisMoveMemory(
1194 void AtoH(char * src
, UCHAR
* dest
, int destlen
);
1195 UCHAR
BtoH(char ch
);
1198 IN PRTMP_ADAPTER pAdapter
,
1199 IN PRALINK_TIMER_STRUCT pTimer
,
1200 IN PVOID pTimerFunc
);
1203 IN PRTMP_ADAPTER pAdapter
,
1204 IN PRALINK_TIMER_STRUCT pTimer
,
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
,
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
,
1268 IN UCHAR NumberRequired
);
1270 VOID
MlmeHardTransmit(
1271 IN PRTMP_ADAPTER pAdapter
,
1275 USHORT
RTMPCalcDuration(
1276 IN PRTMP_ADAPTER pAdapter
,
1280 VOID
RTMPWriteTxDescriptor(
1282 IN BOOLEAN DoEncrypt
,
1285 IN BOOLEAN Fragment
,
1286 IN BOOLEAN InsTimestamp
,
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
,
1314 VOID
RTMPSendNullFrame(
1315 IN PRTMP_ADAPTER pAdapter
,
1320 inline NDIS_STATUS
RTMPCheckRxDescriptor(
1321 IN PRXD_STRUC pRxD
);
1323 NDIS_STATUS
RTMPApplyPacketFilter(
1324 IN PRTMP_ADAPTER pAdapter
,
1326 IN PHEADER_802_11 pHeader
);
1328 PQUEUE_HEADER
RTMPCheckTxSwQueue(
1329 IN PRTMP_ADAPTER pAdapter
,
1331 OUT UCHAR
*AccessCategory
);
1334 inline VOID
RTMPDescriptorEndianChange(
1336 IN ULONG DescriptorType
);
1338 VOID
RTMPFrameEndianChange(
1339 IN PRTMP_ADAPTER pAdapter
,
1342 IN BOOLEAN FromRxDoneInt
);
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
,
1358 VOID
RTMPEncryptData(
1359 IN PRTMP_ADAPTER pAdapter
,
1364 BOOLEAN
RTMPDecryptData(
1365 IN PRTMP_ADAPTER pAdapter
,
1370 IN PRTMP_ADAPTER pAdapter
,
1374 IN PARCFOURCONTEXT Ctx
,
1379 IN PARCFOURCONTEXT Ctx
);
1381 VOID
ARCFOUR_DECRYPT(
1382 IN PARCFOURCONTEXT Ctx
,
1387 VOID
ARCFOUR_ENCRYPT(
1388 IN PARCFOURCONTEXT Ctx
,
1393 ULONG
RTMP_CALC_FCS32(
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
,
1414 VOID
AsicLockChannel(
1415 IN PRTMP_ADAPTER pAd
,
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
);
1432 IN PRTMP_ADAPTER pAdapter
,
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
);
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
);
1464 IN PRTMP_ADAPTER pAd
);
1466 VOID
AsicRestoreBbpSensibility(
1467 IN PRTMP_ADAPTER pAd
);
1469 VOID
MacAddrRandomBssid(
1470 IN PRTMP_ADAPTER pAdapter
,
1473 VOID
MgtMacHeaderInit(
1474 IN PRTMP_ADAPTER pAdapter
,
1478 // IN UCHAR AddrType,
1483 IN PRTMP_ADAPTER pAd
);
1486 IN PRTMP_ADAPTER pAd
);
1491 ULONG
BssTableSearch(
1495 VOID
BssTableDeleteEntry(
1496 IN OUT BSS_TABLE
*Tab
,
1500 IN PRTMP_ADAPTER pAdapter
,
1506 IN USHORT BeaconPeriod
,
1510 IN USHORT CapabilityInfo
,
1513 IN BOOLEAN ExtendedRateIeExist
,
1516 IN LARGE_INTEGER TimeStamp
,
1517 IN PNDIS_802_11_VARIABLE_IEs pVIE
);
1519 ULONG
BssTableSetEntry(
1520 IN PRTMP_ADAPTER pAdapter
,
1526 IN USHORT BeaconPeriod
,
1530 IN USHORT CapabilityInfo
,
1533 IN BOOLEAN ExtendedRateIeExist
,
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
,
1545 VOID
BssTableSortByRssi(
1546 IN OUT BSS_TABLE
*OutTab
);
1548 NDIS_802_11_WEP_STATUS
BssCipherParse(
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
,
1564 BOOLEAN
MlmeEnqueueForRecv(
1565 IN PRTMP_ADAPTER pAdapter
,
1566 OUT MLME_QUEUE
*Queue
,
1567 IN ULONG TimeStampHigh
,
1568 IN ULONG TimeStampLow
,
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(
1591 VOID
StateMachineInit(
1592 IN STATE_MACHINE
*Sm
,
1593 IN STATE_MACHINE_FUNC Trans
[],
1596 IN STATE_MACHINE_FUNC DefFunc
,
1600 VOID
StateMachineSetAction(
1601 IN STATE_MACHINE
*S
,
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
);
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
);
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
);
1674 IN PRTMP_ADAPTER pAdapter
,
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
);
1690 IN PRTMP_ADAPTER pAdapter
);
1692 VOID
ComposeNullFrame(
1693 IN PRTMP_ADAPTER pAdapter
);
1696 IN PRTMP_ADAPTER pAdapter
,
1698 IN USHORT CapabilityInfo
,
1702 IN BOOLEAN ExtendedRateIeExist
);
1704 VOID
AuthStateMachineInit(
1705 IN PRTMP_ADAPTER pAdapter
,
1706 IN PSTATE_MACHINE sm
,
1707 OUT STATE_MACHINE_FUNC Trans
[]);
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
);
1729 IN PRTMP_ADAPTER pAdapter
,
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
,
1780 //========================================
1782 VOID
SyncStateMachineInit(
1783 IN PRTMP_ADAPTER pAdapter
,
1784 IN STATE_MACHINE
*Sm
,
1785 OUT STATE_MACHINE_FUNC Trans
[]);
1788 IN
unsigned long data
);
1791 IN
unsigned long data
);
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
);
1813 IN PRTMP_ADAPTER pAdapter
,
1814 IN MLME_QUEUE_ELEM
*Elem
);
1816 VOID
EnqueueProbeRequest(
1817 IN PRTMP_ADAPTER pAd
);
1819 //=========================================
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
);
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
);
1880 IN PRTMP_ADAPTER pAdapter
,
1884 IN PRTMP_ADAPTER pAdapter
);
1886 VOID
MlmeCntlConfirm(
1887 IN PRTMP_ADAPTER pAdapter
,
1891 VOID
IterateOnBssTab(
1892 IN PRTMP_ADAPTER pAdapter
);
1894 VOID
IterateOnBssTab2(
1895 IN PRTMP_ADAPTER pAdapter
);;
1898 IN PRTMP_ADAPTER pAdapter
,
1899 IN OUT MLME_JOIN_REQ_STRUCT
*JoinReq
,
1903 IN PRTMP_ADAPTER pAdapter
,
1904 IN OUT MLME_ASSOC_REQ_STRUCT
*AssocReq
,
1906 IN USHORT CapabilityInfo
,
1908 IN USHORT ListenIntv
);
1911 IN PRTMP_ADAPTER pAdapter
,
1912 IN OUT MLME_SCAN_REQ_STRUCT
*ScanReq
,
1918 VOID
DisassocParmFill(
1919 IN PRTMP_ADAPTER pAdapter
,
1920 IN OUT MLME_DISASSOC_REQ_STRUCT
*DisassocReq
,
1925 IN PRTMP_ADAPTER pAdapter
,
1926 IN OUT MLME_START_REQ_STRUCT
*StartReq
,
1931 IN PRTMP_ADAPTER pAdapter
,
1932 IN OUT MLME_AUTH_REQ_STRUCT
*AuthReq
,
1937 IN PRTMP_ADAPTER pAdapter
);
1939 VOID
EnqueueBeaconFrame(
1940 IN PRTMP_ADAPTER pAdapter
);
1942 VOID
EnqueueNullFrame(
1943 IN PRTMP_ADAPTER pAdapter
,
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
);
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
,
1995 OUT UCHAR
*ScanType
);
1997 BOOLEAN
PeerBeaconAndProbeRspSanity(
1998 IN PRTMP_ADAPTER pAdapter
,
2006 OUT USHORT
*BeaconPeriod
,
2008 OUT LARGE_INTEGER
*Timestamp
,
2009 OUT BOOLEAN
*CfExist
,
2011 OUT USHORT
*AtimWin
,
2012 OUT USHORT
*CapabilityInfo
,
2015 OUT BOOLEAN
*ExtendedRateIeExist
,
2017 OUT UCHAR
*DtimCount
,
2018 OUT UCHAR
*DtimPeriod
,
2019 OUT UCHAR
*BcastFlag
,
2020 OUT UCHAR
*MessageToMe
,
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,
2032 // OUT ULONG *BssIdx,
2033 // OUT UCHAR SupportedRates[],
2034 // OUT UCHAR *SupportedRatesLen);
2036 BOOLEAN
MlmeAssocReqSanity(
2037 IN PRTMP_ADAPTER pAdapter
,
2040 OUT MACADDR
*ApAddr
,
2041 OUT USHORT
*CapabilityInfo
,
2043 OUT USHORT
*ListenIntv
);
2045 BOOLEAN
MlmeAuthReqSanity(
2046 IN PRTMP_ADAPTER pAdapter
,
2053 BOOLEAN
MlmeStartReqSanity(
2054 IN PRTMP_ADAPTER pAdapter
,
2058 OUT UCHAR
*Ssidlen
);
2060 BOOLEAN
PeerAuthSanity(
2061 IN PRTMP_ADAPTER pAdapter
,
2068 OUT CHAR ChlgText
[]);
2070 BOOLEAN
PeerAssocRspSanity(
2071 IN PRTMP_ADAPTER pAdapter
,
2075 OUT USHORT
*CapabilityInfo
,
2079 OUT UCHAR
*RatesLen
,
2080 OUT BOOLEAN
*ExtendedRateIeExist
);
2082 BOOLEAN
PeerDisassocSanity(
2083 IN PRTMP_ADAPTER pAdapter
,
2087 OUT USHORT
*Reason
);
2089 BOOLEAN
PeerDeauthSanity(
2090 IN PRTMP_ADAPTER pAdapter
,
2094 OUT USHORT
*Reason
);
2096 BOOLEAN
PeerProbeReqSanity(
2097 IN PRTMP_ADAPTER pAdapter
,
2102 OUT UCHAR
*SsidLen
);
2103 // OUT UCHAR Rates[],
2104 // OUT UCHAR *RatesLen);
2110 OUT UCHAR
*BcastFlag
,
2111 OUT UCHAR
*DtimCount
,
2112 OUT UCHAR
*DtimPeriod
,
2113 OUT UCHAR
*MessageToMe
);
2119 ULONG
MakeOutgoingFrame(
2121 OUT ULONG
*Length
, ...);
2124 IN PRTMP_ADAPTER pAdapter
,
2128 IN PRTMP_ADAPTER pAdapter
);
2130 VOID
MlmePeriodicExec(
2131 IN
unsigned long data
);
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
,
2146 VOID
MlmeCheckDynamicTxRateSwitching(
2147 IN PRTMP_ADAPTER pAd
);
2149 VOID
MlmeCheckChannelQuality(
2150 IN PRTMP_ADAPTER pAdapter
,
2153 VOID
MlmeCheckForPsmChange(
2154 IN PRTMP_ADAPTER pAdapter
,
2158 IN PRTMP_ADAPTER pAdapter
,
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
);
2173 IN PRTMP_ADAPTER pAdapter
);
2176 IN PRTMP_ADAPTER pAdapter
);
2178 NDIS_STATUS
MlmeInitMemoryHandler(
2179 IN PRTMP_ADAPTER pAd
,
2183 NDIS_STATUS
MlmeAllocateMemory(
2184 IN PRTMP_ADAPTER pAd
,
2185 OUT PVOID
*AllocVa
);
2187 VOID
MlmeFreeMemory(
2188 IN PRTMP_ADAPTER pAd
,
2191 VOID
MlmeFreeMemoryHandler(
2192 IN PRTMP_ADAPTER pAd
);
2194 VOID
BuildChannelList(
2195 IN PRTMP_ADAPTER pAdapter
);
2198 IN PRTMP_ADAPTER pAdapter
);
2201 IN PRTMP_ADAPTER pAdapter
,
2205 IN PRTMP_ADAPTER pAd
,
2209 IN PRTMP_ADAPTER pAd
,
2213 IN PRTMP_ADAPTER pAd
);
2216 IN PRTMP_ADAPTER pAd
,
2221 IN PRTMP_ADAPTER pAd
);
2224 IN PRTMP_ADAPTER pAd
);
2227 IN PRTMP_ADAPTER pAd
);
2229 USHORT
RTMP_EEPROM_READ16(
2230 IN PRTMP_ADAPTER pAd
,
2233 VOID
RTMP_EEPROM_WRITE16(
2234 IN PRTMP_ADAPTER pAd
,
2238 UCHAR
ChannelSanity(
2239 IN PRTMP_ADAPTER pAd
,
2243 // Prototypes of function definition in rtmp_tkip.c
2245 VOID
RTMPInitTkipEngine(
2246 IN PRTMP_ADAPTER pAdapter
,
2255 VOID
RTMPInitMICEngine(
2256 IN PRTMP_ADAPTER pAdapter
,
2262 BOOLEAN
RTMPTkipCompareMICValue(
2263 IN PRTMP_ADAPTER pAdapter
,
2270 VOID
RTMPCalculateMICValue(
2271 IN PRTMP_ADAPTER pAdapter
,
2272 IN
struct sk_buff
*skb
,
2275 IN PWPA_KEY pWpaKey
);
2277 BOOLEAN
RTMPTkipCompareMICValueWithLLC(
2278 IN PRTMP_ADAPTER pAdapter
,
2286 VOID
RTMPTkipAppend(
2287 IN PTKIP_KEY_INFO pTkip
,
2291 VOID
RTMPTkipGetMIC(
2292 IN PTKIP_KEY_INFO pTkip
);
2294 NDIS_STATUS
RTMPWPAAddKeyProc(
2295 IN PRTMP_ADAPTER pAdapter
,
2298 NDIS_STATUS
RTMPWPARemoveKeyProc(
2299 IN PRTMP_ADAPTER pAdapter
,
2302 VOID
RTMPWPARemoveAllKeys(
2303 IN PRTMP_ADAPTER pAdapter
);
2305 VOID
RTMPSetPhyMode(
2306 IN PRTMP_ADAPTER pAdapter
,
2309 VOID
RTMPSetDesiredRates(
2310 IN PRTMP_ADAPTER pAdapter
,
2313 INT
RTMPSetInformation(
2314 IN PRTMP_ADAPTER pAdapter
,
2315 IN OUT
struct ifreq
*rq
,
2318 INT
RTMPQueryInformation(
2319 IN PRTMP_ADAPTER pAdapter
,
2320 IN OUT
struct ifreq
*rq
,
2324 // Prototypes of function definition for *iwpriv* in rtmp_info.c
2326 INT
Set_CountryRegion_Proc(
2327 IN PRTMP_ADAPTER pAdapter
,
2331 IN PRTMP_ADAPTER pAdapter
,
2334 INT
Set_WirelessMode_Proc(
2335 IN PRTMP_ADAPTER pAdapter
,
2338 INT
Set_TxRate_Proc(
2339 IN PRTMP_ADAPTER pAdapter
,
2342 INT
Set_AdhocModeRate_Proc(
2343 IN PRTMP_ADAPTER pAdapter
,
2346 INT
Set_Channel_Proc(
2347 IN PRTMP_ADAPTER pAdapter
,
2353 IN PRTMP_ADAPTER pAdapter
,
2357 INT
Set_BGProtection_Proc(
2358 IN PRTMP_ADAPTER pAdapter
,
2361 INT
Set_TxPreamble_Proc(
2362 IN PRTMP_ADAPTER pAdapter
,
2365 INT
Set_RTSThreshold_Proc(
2366 IN PRTMP_ADAPTER pAdapter
,
2369 INT
Set_FragThreshold_Proc(
2370 IN PRTMP_ADAPTER pAdapter
,
2373 INT
Set_TxBurst_Proc(
2374 IN PRTMP_ADAPTER pAdapter
,
2377 INT
Set_TurboRate_Proc(
2378 IN PRTMP_ADAPTER pAdapter
,
2381 INT
Set_NetworkType_Proc(
2382 IN PRTMP_ADAPTER pAdapter
,
2385 INT
Set_AuthMode_Proc(
2386 IN PRTMP_ADAPTER pAdapter
,
2389 INT
Set_EncrypType_Proc(
2390 IN PRTMP_ADAPTER pAdapter
,
2393 INT
Set_DefaultKeyID_Proc(
2394 IN PRTMP_ADAPTER pAdapter
,
2398 IN PRTMP_ADAPTER pAdapter
,
2402 IN PRTMP_ADAPTER pAdapter
,
2406 IN PRTMP_ADAPTER pAdapter
,
2410 IN PRTMP_ADAPTER pAdapter
,
2413 INT
Set_WPAPSK_Proc(
2414 IN PRTMP_ADAPTER pAdapter
,
2418 IN PRTMP_ADAPTER pAdapter
,
2419 IN
struct iwreq
*wrq
);
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(
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
,
2461 IN PMACADDR pAddr1
);
2463 VOID
WpaHardEncrypt(
2464 IN PRTMP_ADAPTER pAdapter
,
2495 IN PRTMP_ADAPTER pAd
,
2498 VOID
AES_GTK_KEY_UNWRAP(
2500 OUT UCHAR
*plaintext
,
2501 IN UCHAR
*ciphertext
);
2503 ULONG
RTMPTkipGetUInt32(
2508 IN
const char * s2
);
2512 IN PRTMP_ADAPTER pAdapter
,
2515 INT
Set_ATE_DA_Proc(
2516 IN PRTMP_ADAPTER pAdapter
,
2519 INT
Set_ATE_SA_Proc(
2520 IN PRTMP_ADAPTER pAdapter
,
2523 INT
Set_ATE_BSSID_Proc(
2524 IN PRTMP_ADAPTER pAdapter
,
2527 INT
Set_ATE_CHANNEL_Proc(
2528 IN PRTMP_ADAPTER pAdapter
,
2531 INT
Set_ATE_TX_POWER_Proc(
2532 IN PRTMP_ADAPTER pAdapter
,
2535 INT
Set_ATE_TX_LENGTH_Proc(
2536 IN PRTMP_ADAPTER pAdapter
,
2539 INT
Set_ATE_TX_COUNT_Proc(
2540 IN PRTMP_ADAPTER pAdapter
,
2543 INT
Set_ATE_TX_RATE_Proc(
2544 IN PRTMP_ADAPTER pAdapter
,
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__