1 /*************************************************************************
3 * 4F, No. 2 Technology 5th Rd. *
4 * Science-based Industrial Park *
5 * Hsin-chu, Taiwan, R.O.C. *
7 * (c) Copyright 2002, Ralink Technology, Inc. *
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. *
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. *
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. *
24 *************************************************************************
30 Miniport generic portion header file
34 -------- ---------- ----------------------------------------------
35 Paul Lin 08-01-2002 created
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
;
62 typedef struct _QUEUE_HEADER
{
66 } QUEUE_HEADER
, *PQUEUE_HEADER
;
68 #define InitializeQueueHeader(QueueHeader) \
70 (QueueHeader)->Head = (QueueHeader)->Tail = NULL; \
71 (QueueHeader)->Number = 0; \
74 #define RemoveHeadQueue(QueueHeader) \
75 (QueueHeader)->Head; \
78 pNext = (QueueHeader)->Head->Next; \
79 (QueueHeader)->Head = pNext; \
81 (QueueHeader)->Tail = NULL; \
82 (QueueHeader)->Number--; \
85 #define InsertHeadQueue(QueueHeader, QueueEntry) \
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) \
96 ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
97 if ((QueueHeader)->Tail) \
98 (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
100 (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
101 (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
102 (QueueHeader)->Number++; \
106 // MACRO for debugging information
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); \
120 #define DBGPRINT(Level, fmt, args...)
124 // spin_lock enhanced for Nested spin lock
128 #define NdisAllocateSpinLock(lock) \
130 spin_lock_init(lock); \
133 #define NdisReleaseSpinLock(lock, IrqFlags) \
135 spin_unlock_irqrestore(lock, IrqFlags); \
138 #define NdisAcquireSpinLock(lock, IrqFlags) \
140 spin_lock_irqsave(lock, IrqFlags); \
143 #define NdisReleaseSpinLock(lock) \
145 spin_unlock_bh(lock); \
148 #define NdisAcquireSpinLock(lock) \
150 spin_lock_bh(lock); \
154 #define NdisFreeSpinLock(lock) \
158 #define RTMPFreeSkbBuffer(skb) \
160 dev_kfree_skb_any(skb); \
163 // Assert MACRO to make sure program running
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,
202 // PRTMP_ADAPTER pAdapter,
203 // ULONG Register_Offset,
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))
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)))
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; \
225 RTMP_IO_READ32(_A, BBPCSR, &Value.word); \
226 if (Value.field.Busy == IDLE) \
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) \
241 RTMP_IO_READ32(_A, RFCSR, &(Value.word)); \
242 if (Value.field.Busy == IDLE) \
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; \
256 RTMP_BBP_IO_WRITE32(_A, *(_pV)); \
258 RTMP_IO_READ32(_A, BBPCSR, &Value.word);\
259 if (Value.field.Busy == IDLE) \
262 } while (BusyCnt < MAX_BUSY_COUNT); \
263 if (BusyCnt == MAX_BUSY_COUNT) \
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; \
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; \
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
297 #define min(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
301 #define max(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
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)
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
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) \
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); \
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); \
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
368 } RTMP_REG_PAIR
, *PRTMP_REG_PAIR
;
371 // Register set pair for initialzation register set definition
373 typedef struct _RTMP_RF_REGS
380 } RTMP_RF_REGS
, *PRTMP_RF_REGS
;
383 // Statistic counter structure
385 typedef struct _COUNTER_802_3
395 ULONG RcvAlignmentErrors
;
397 ULONG MoreCollisions
;
399 } COUNTER_802_3
, *PCOUNTER_802_3
;
401 typedef struct _COUNTER_802_11
{
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
;
426 ULONG RxRingErrCount
;
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
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
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
;
476 typedef struct _IV_CONTROL_
508 } TKIP_IV
, *PTKIP_IV
;
511 typedef struct PACKED _IV_CONTROL_
538 } TKIP_IV
, *PTKIP_IV
;
540 // configuration to be used when this STA starts a new ADHOC network
541 typedef struct _IBSS_CONFIG
{
545 UCHAR SupportedRates
[MAX_LEN_OF_SUPPORTED_RATES
]; // Supported rates
546 UCHAR SupportedRatesLen
;
547 } IBSS_CONFIG
, *PIBSS_CONFIG
;
549 typedef struct _LED_CONTROL
{
552 RALINK_TIMER_STRUCT BlinkTimer
; // 50 ms periodic timer
556 typedef struct _BBP_TUNING_STRUCT
{
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
{
578 MACADDR EtherMacAddr
;
579 } STA_WITH_ETHER_BRIDGE
, *PSTA_WITH_ETHER_BRIDGE
;
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
;
594 USHORT DisassocReason
;
598 USHORT AuthFailReason
;
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
611 // WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
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)
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,
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
];
673 // other parameters not defined in standard MIB
675 UCHAR DesiredRates
[MAX_LEN_OF_SUPPORTED_RATES
]; // OID_802_11_DESIRED_RATES
676 UCHAR MaxDesiredRate
;
679 MACADDR Broadcast
; // FF:FF:FF:FF:FF:FF
680 USHORT Pss
; // current power saving status (PWR_SAVE|PWR_ACTIVE)
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
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
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
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
;
771 RT_802_11_RX_AGC_VGC_TUNING BbpTuning
;
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
];
816 AUTH_RSP_AUX AuthRspAux
;
820 COUNTER_802_11 PrevWlanCounters
;
821 ULONG ChannelQuality
; // 0..100, Channel Quality Indication for Roaming
831 RALINK_TIMER_STRUCT PeriodicTimer
;
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
{
845 } MGMT_STRUC
, *PMGMT_STRUC
;
848 // P802.11 Frame control field, 16 bit
850 typedef struct PACKED _FRAME_CONTROL
{
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
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
895 USHORT Sequence
:12; // Sequence number
896 USHORT Frag
:4; // Fragment number
898 USHORT Frag
:4; // Fragment number
899 USHORT Sequence
:12; // Sequence number
901 } HEADER_802_11
, *PHEADER_802_11
;
904 // Receive Tuple Cache Format
906 typedef struct PACKED _TUPLE_CACHE
{
911 } TUPLE_CACHE
, *PTUPLE_CACHE
;
914 // Fragment Frame structure
916 typedef struct PACKED _FRAGMENT_FRAME
{
917 UCHAR Header802_3
[14];
919 UCHAR Buffer
[LENGTH_802_3
+ MAX_FRAME_SIZE
];
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
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
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
956 ARCFOURCONTEXT WEPCONTEXT
;
960 } PRIVATE_STRUC
, *PPRIVATE_STRUC
;
963 // All DMA ring formats
966 // Descriptor size & dma address
970 // Dma buffer size and address for real transfer
973 dma_addr_t pa_data_addr
;
974 UCHAR FrameType
; // Type of frame in ring buffer
978 typedef struct _ATE_INFO
{
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
1000 unsigned long CSRBaseAddress
; // PCI MMIO Base Address, all access will use
1001 // NdisReadRegisterXx or NdisWriteRegisterXx
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
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
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
1083 PQUEUE_ENTRY FirstEntryInQueue
; // The first packet in Tx queue
1085 // Control disconnect / connect event generation
1088 UCHAR LastSsidLen
; // the actual ssid length in used
1089 CHAR LastSsid
[MAX_LEN_OF_SSID
]; // NOT NULL-terminated
1091 BOOLEAN bConfigChanged
;
1093 PORT_CONFIG PortCfg
;
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
;
1107 struct net_device_stats stats
;
1111 #endif //#ifdef RALINK_ATE
1112 } RTMP_ADAPTER
, *PRTMP_ADAPTER
;
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
1126 // Enable & Disable NIC interrupt via writing interrupt mask register
1127 // Since it use ADAPTER structure, it have to be put after structure definition.
1135 NICDisableInterrupt(
1136 IN PRTMP_ADAPTER pAdapter
);
1144 IN PRTMP_ADAPTER pAdapter
);
1146 BOOLEAN
NICCheckForHang(
1147 IN PRTMP_ADAPTER pAd
);
1151 IN
struct net_device
*net_dev
);
1153 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
1154 irqreturn_t
RTMPIsr(
1156 IN VOID
*dev_instance
,
1157 IN
struct pt_regs
*rgs
);
1161 IN VOID
*dev_instance
,
1162 IN
struct pt_regs
*rgs
);
1166 IN
unsigned long data
);
1169 IN
struct net_device
*net_dev
);
1171 INT
RTMPSendPackets(
1172 IN
struct sk_buff
*skb
,
1173 IN
struct net_device
*net_dev
);
1176 IN
struct pci_dev
*pPci_Dev
,
1177 IN
const struct pci_device_id
*ent
);
1180 IN
struct net_device
*net_dev
,
1181 IN OUT
struct ifreq
*rq
,
1184 VOID
RTMPRingCleanUp(
1185 IN PRTMP_ADAPTER pAdapter
,
1188 #if WIRELESS_EXT >= 12
1189 struct iw_statistics
*RT2500_get_wireless_stats(
1190 IN
struct net_device
*net_dev
);
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
);
1224 IN PRTMP_ADAPTER pAdapter
);
1227 IN PRTMP_ADAPTER pAdapter
);
1229 VOID
NICResetFromError(
1230 IN PRTMP_ADAPTER pAdapter
);
1232 PUCHAR
RTMPFindSection(
1236 INT
RTMPIsFindSection(
1240 INT
RTMPGetKeyParameter(
1247 VOID
RTMPReadParametersFromFile(
1248 IN PRTMP_ADAPTER pAd
);
1250 ULONG
RTMPEqualMemory(
1255 ULONG
RTMPCompareMemory(
1260 VOID
NdisZeroMemory(
1264 VOID
NdisMoveMemory(
1269 void AtoH(char * src
, UCHAR
* dest
, int destlen
);
1270 UCHAR
BtoH(char ch
);
1273 IN PRTMP_ADAPTER pAdapter
,
1274 IN PRALINK_TIMER_STRUCT pTimer
,
1275 IN PVOID pTimerFunc
);
1278 IN PRTMP_ADAPTER pAdapter
,
1279 IN PRALINK_TIMER_STRUCT pTimer
,
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
,
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
,
1343 IN UCHAR NumberRequired
);
1345 VOID
MlmeHardTransmit(
1346 IN PRTMP_ADAPTER pAdapter
,
1350 USHORT
RTMPCalcDuration(
1351 IN PRTMP_ADAPTER pAdapter
,
1355 VOID
RTMPWriteTxDescriptor(
1357 IN BOOLEAN DoEncrypt
,
1360 IN BOOLEAN Fragment
,
1361 IN BOOLEAN InsTimestamp
,
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
,
1389 VOID
RTMPSendNullFrame(
1390 IN PRTMP_ADAPTER pAdapter
,
1395 inline NDIS_STATUS
RTMPCheckRxDescriptor(
1396 IN PRXD_STRUC pRxD
);
1398 NDIS_STATUS
RTMPApplyPacketFilter(
1399 IN PRTMP_ADAPTER pAdapter
,
1401 IN PHEADER_802_11 pHeader
);
1403 PQUEUE_HEADER
RTMPCheckTxSwQueue(
1404 IN PRTMP_ADAPTER pAdapter
,
1406 OUT UCHAR
*AccessCategory
);
1409 inline VOID
RTMPDescriptorEndianChange(
1411 IN ULONG DescriptorType
);
1413 VOID
RTMPFrameEndianChange(
1414 IN PRTMP_ADAPTER pAdapter
,
1417 IN BOOLEAN FromRxDoneInt
);
1419 VOID
WriteBackToDescriptor(
1422 IN BOOLEAN DoEncrypt
,
1423 IN ULONG DescriptorType
);
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
,
1439 VOID
RTMPEncryptData(
1440 IN PRTMP_ADAPTER pAdapter
,
1445 BOOLEAN
RTMPDecryptData(
1446 IN PRTMP_ADAPTER pAdapter
,
1451 IN PRTMP_ADAPTER pAdapter
,
1455 IN PARCFOURCONTEXT Ctx
,
1460 IN PARCFOURCONTEXT Ctx
);
1462 VOID
ARCFOUR_DECRYPT(
1463 IN PARCFOURCONTEXT Ctx
,
1468 VOID
ARCFOUR_ENCRYPT(
1469 IN PARCFOURCONTEXT Ctx
,
1474 ULONG
RTMP_CALC_FCS32(
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
,
1495 VOID
AsicLockChannel(
1496 IN PRTMP_ADAPTER pAd
,
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
);
1513 IN PRTMP_ADAPTER pAdapter
,
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
);
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
);
1545 IN PRTMP_ADAPTER pAd
);
1547 VOID
AsicRestoreBbpSensibility(
1548 IN PRTMP_ADAPTER pAd
);
1550 VOID
MacAddrRandomBssid(
1551 IN PRTMP_ADAPTER pAdapter
,
1554 VOID
MgtMacHeaderInit(
1555 IN PRTMP_ADAPTER pAdapter
,
1559 // IN UCHAR AddrType,
1564 IN PRTMP_ADAPTER pAd
);
1567 IN PRTMP_ADAPTER pAd
);
1572 ULONG
BssTableSearch(
1576 VOID
BssTableDeleteEntry(
1577 IN OUT BSS_TABLE
*Tab
,
1581 IN PRTMP_ADAPTER pAdapter
,
1587 IN USHORT BeaconPeriod
,
1591 IN USHORT CapabilityInfo
,
1594 IN BOOLEAN ExtendedRateIeExist
,
1597 IN LARGE_INTEGER TimeStamp
,
1598 IN PNDIS_802_11_VARIABLE_IEs pVIE
);
1600 ULONG
BssTableSetEntry(
1601 IN PRTMP_ADAPTER pAdapter
,
1607 IN USHORT BeaconPeriod
,
1611 IN USHORT CapabilityInfo
,
1614 IN BOOLEAN ExtendedRateIeExist
,
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
,
1626 VOID
BssTableSortByRssi(
1627 IN OUT BSS_TABLE
*OutTab
);
1629 NDIS_802_11_WEP_STATUS
BssCipherParse(
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
,
1645 BOOLEAN
MlmeEnqueueForRecv(
1646 IN PRTMP_ADAPTER pAdapter
,
1647 OUT MLME_QUEUE
*Queue
,
1648 IN ULONG TimeStampHigh
,
1649 IN ULONG TimeStampLow
,
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(
1672 VOID
StateMachineInit(
1673 IN STATE_MACHINE
*Sm
,
1674 IN STATE_MACHINE_FUNC Trans
[],
1677 IN STATE_MACHINE_FUNC DefFunc
,
1681 VOID
StateMachineSetAction(
1682 IN STATE_MACHINE
*S
,
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
);
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
);
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
);
1755 IN PRTMP_ADAPTER pAdapter
,
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
);
1771 IN PRTMP_ADAPTER pAdapter
);
1773 VOID
ComposeNullFrame(
1774 IN PRTMP_ADAPTER pAdapter
);
1777 IN PRTMP_ADAPTER pAdapter
,
1779 IN USHORT CapabilityInfo
,
1783 IN BOOLEAN ExtendedRateIeExist
);
1785 VOID
AuthStateMachineInit(
1786 IN PRTMP_ADAPTER pAdapter
,
1787 IN PSTATE_MACHINE sm
,
1788 OUT STATE_MACHINE_FUNC Trans
[]);
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
);
1810 IN PRTMP_ADAPTER pAdapter
,
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
,
1861 //========================================
1863 VOID
SyncStateMachineInit(
1864 IN PRTMP_ADAPTER pAdapter
,
1865 IN STATE_MACHINE
*Sm
,
1866 OUT STATE_MACHINE_FUNC Trans
[]);
1869 IN
unsigned long data
);
1872 IN
unsigned long data
);
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
);
1894 IN PRTMP_ADAPTER pAdapter
,
1895 IN MLME_QUEUE_ELEM
*Elem
);
1897 VOID
EnqueueProbeRequest(
1898 IN PRTMP_ADAPTER pAd
);
1900 //=========================================
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
);
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
);
1961 IN PRTMP_ADAPTER pAdapter
,
1965 IN PRTMP_ADAPTER pAdapter
);
1967 VOID
MlmeCntlConfirm(
1968 IN PRTMP_ADAPTER pAdapter
,
1972 VOID
IterateOnBssTab(
1973 IN PRTMP_ADAPTER pAdapter
);
1975 VOID
IterateOnBssTab2(
1976 IN PRTMP_ADAPTER pAdapter
);;
1979 IN PRTMP_ADAPTER pAdapter
,
1980 IN OUT MLME_JOIN_REQ_STRUCT
*JoinReq
,
1984 IN PRTMP_ADAPTER pAdapter
,
1985 IN OUT MLME_ASSOC_REQ_STRUCT
*AssocReq
,
1987 IN USHORT CapabilityInfo
,
1989 IN USHORT ListenIntv
);
1992 IN PRTMP_ADAPTER pAdapter
,
1993 IN OUT MLME_SCAN_REQ_STRUCT
*ScanReq
,
1999 VOID
DisassocParmFill(
2000 IN PRTMP_ADAPTER pAdapter
,
2001 IN OUT MLME_DISASSOC_REQ_STRUCT
*DisassocReq
,
2006 IN PRTMP_ADAPTER pAdapter
,
2007 IN OUT MLME_START_REQ_STRUCT
*StartReq
,
2012 IN PRTMP_ADAPTER pAdapter
,
2013 IN OUT MLME_AUTH_REQ_STRUCT
*AuthReq
,
2018 IN PRTMP_ADAPTER pAdapter
);
2020 VOID
EnqueueBeaconFrame(
2021 IN PRTMP_ADAPTER pAdapter
);
2023 VOID
EnqueueNullFrame(
2024 IN PRTMP_ADAPTER pAdapter
,
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
);
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
,
2076 OUT UCHAR
*ScanType
);
2078 BOOLEAN
PeerBeaconAndProbeRspSanity(
2079 IN PRTMP_ADAPTER pAdapter
,
2087 OUT USHORT
*BeaconPeriod
,
2089 OUT LARGE_INTEGER
*Timestamp
,
2090 OUT BOOLEAN
*CfExist
,
2092 OUT USHORT
*AtimWin
,
2093 OUT USHORT
*CapabilityInfo
,
2096 OUT BOOLEAN
*ExtendedRateIeExist
,
2098 OUT UCHAR
*DtimCount
,
2099 OUT UCHAR
*DtimPeriod
,
2100 OUT UCHAR
*BcastFlag
,
2101 OUT UCHAR
*MessageToMe
,
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,
2113 // OUT ULONG *BssIdx,
2114 // OUT UCHAR SupportedRates[],
2115 // OUT UCHAR *SupportedRatesLen);
2117 BOOLEAN
MlmeAssocReqSanity(
2118 IN PRTMP_ADAPTER pAdapter
,
2121 OUT MACADDR
*ApAddr
,
2122 OUT USHORT
*CapabilityInfo
,
2124 OUT USHORT
*ListenIntv
);
2126 BOOLEAN
MlmeAuthReqSanity(
2127 IN PRTMP_ADAPTER pAdapter
,
2134 BOOLEAN
MlmeStartReqSanity(
2135 IN PRTMP_ADAPTER pAdapter
,
2139 OUT UCHAR
*Ssidlen
);
2141 BOOLEAN
PeerAuthSanity(
2142 IN PRTMP_ADAPTER pAdapter
,
2149 OUT CHAR ChlgText
[]);
2151 BOOLEAN
PeerAssocRspSanity(
2152 IN PRTMP_ADAPTER pAdapter
,
2156 OUT USHORT
*CapabilityInfo
,
2160 OUT UCHAR
*RatesLen
,
2161 OUT BOOLEAN
*ExtendedRateIeExist
);
2163 BOOLEAN
PeerDisassocSanity(
2164 IN PRTMP_ADAPTER pAdapter
,
2168 OUT USHORT
*Reason
);
2170 BOOLEAN
PeerDeauthSanity(
2171 IN PRTMP_ADAPTER pAdapter
,
2175 OUT USHORT
*Reason
);
2177 BOOLEAN
PeerProbeReqSanity(
2178 IN PRTMP_ADAPTER pAdapter
,
2183 OUT UCHAR
*SsidLen
);
2184 // OUT UCHAR Rates[],
2185 // OUT UCHAR *RatesLen);
2191 OUT UCHAR
*BcastFlag
,
2192 OUT UCHAR
*DtimCount
,
2193 OUT UCHAR
*DtimPeriod
,
2194 OUT UCHAR
*MessageToMe
);
2200 ULONG
MakeOutgoingFrame(
2202 OUT ULONG
*Length
, ...);
2205 IN PRTMP_ADAPTER pAdapter
,
2209 IN PRTMP_ADAPTER pAdapter
);
2211 VOID
MlmePeriodicExec(
2212 IN
unsigned long data
);
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
,
2227 VOID
MlmeCheckDynamicTxRateSwitching(
2228 IN PRTMP_ADAPTER pAd
);
2230 VOID
MlmeCheckChannelQuality(
2231 IN PRTMP_ADAPTER pAdapter
,
2234 VOID
MlmeCheckForPsmChange(
2235 IN PRTMP_ADAPTER pAdapter
,
2239 IN PRTMP_ADAPTER pAdapter
,
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
);
2254 IN PRTMP_ADAPTER pAdapter
);
2257 IN PRTMP_ADAPTER pAdapter
);
2259 NDIS_STATUS
MlmeInitMemoryHandler(
2260 IN PRTMP_ADAPTER pAd
,
2264 NDIS_STATUS
MlmeAllocateMemory(
2265 IN PRTMP_ADAPTER pAd
,
2266 OUT PVOID
*AllocVa
);
2268 VOID
MlmeFreeMemory(
2269 IN PRTMP_ADAPTER pAd
,
2272 VOID
MlmeFreeMemoryHandler(
2273 IN PRTMP_ADAPTER pAd
);
2275 VOID
BuildChannelList(
2276 IN PRTMP_ADAPTER pAdapter
);
2279 IN PRTMP_ADAPTER pAdapter
);
2282 IN PRTMP_ADAPTER pAdapter
,
2286 IN PRTMP_ADAPTER pAd
,
2290 IN PRTMP_ADAPTER pAd
,
2294 IN PRTMP_ADAPTER pAd
);
2297 IN PRTMP_ADAPTER pAd
,
2302 IN PRTMP_ADAPTER pAd
);
2305 IN PRTMP_ADAPTER pAd
);
2308 IN PRTMP_ADAPTER pAd
);
2310 USHORT
RTMP_EEPROM_READ16(
2311 IN PRTMP_ADAPTER pAd
,
2314 VOID
RTMP_EEPROM_WRITE16(
2315 IN PRTMP_ADAPTER pAd
,
2319 UCHAR
ChannelSanity(
2320 IN PRTMP_ADAPTER pAd
,
2324 // Prototypes of function definition in rtmp_tkip.c
2326 VOID
RTMPInitTkipEngine(
2327 IN PRTMP_ADAPTER pAdapter
,
2336 VOID
RTMPInitMICEngine(
2337 IN PRTMP_ADAPTER pAdapter
,
2343 BOOLEAN
RTMPTkipCompareMICValue(
2344 IN PRTMP_ADAPTER pAdapter
,
2351 VOID
RTMPCalculateMICValue(
2352 IN PRTMP_ADAPTER pAdapter
,
2353 IN
struct sk_buff
*skb
,
2356 IN PWPA_KEY pWpaKey
);
2358 BOOLEAN
RTMPTkipCompareMICValueWithLLC(
2359 IN PRTMP_ADAPTER pAdapter
,
2367 VOID
RTMPTkipAppend(
2368 IN PTKIP_KEY_INFO pTkip
,
2372 VOID
RTMPTkipGetMIC(
2373 IN PTKIP_KEY_INFO pTkip
);
2375 NDIS_STATUS
RTMPWPAAddKeyProc(
2376 IN PRTMP_ADAPTER pAdapter
,
2379 NDIS_STATUS
RTMPWPARemoveKeyProc(
2380 IN PRTMP_ADAPTER pAdapter
,
2383 VOID
RTMPWPARemoveAllKeys(
2384 IN PRTMP_ADAPTER pAdapter
);
2386 VOID
RTMPSetPhyMode(
2387 IN PRTMP_ADAPTER pAdapter
,
2390 VOID
RTMPSetDesiredRates(
2391 IN PRTMP_ADAPTER pAdapter
,
2394 INT
RTMPSetInformation(
2395 IN PRTMP_ADAPTER pAdapter
,
2396 IN OUT
struct ifreq
*rq
,
2399 INT
RTMPQueryInformation(
2400 IN PRTMP_ADAPTER pAdapter
,
2401 IN OUT
struct ifreq
*rq
,
2405 // Prototypes of function definition for *iwpriv* in rtmp_info.c
2407 INT
Set_CountryRegion_Proc(
2408 IN PRTMP_ADAPTER pAdapter
,
2412 IN PRTMP_ADAPTER pAdapter
,
2415 INT
Set_WirelessMode_Proc(
2416 IN PRTMP_ADAPTER pAdapter
,
2419 INT
Set_TxRate_Proc(
2420 IN PRTMP_ADAPTER pAdapter
,
2423 INT
Set_AdhocModeRate_Proc(
2424 IN PRTMP_ADAPTER pAdapter
,
2427 INT
Set_Channel_Proc(
2428 IN PRTMP_ADAPTER pAdapter
,
2434 IN PRTMP_ADAPTER pAdapter
,
2438 INT
Set_BGProtection_Proc(
2439 IN PRTMP_ADAPTER pAdapter
,
2442 INT
Set_TxPreamble_Proc(
2443 IN PRTMP_ADAPTER pAdapter
,
2446 INT
Set_StaWithEtherBridge_Proc(
2447 IN PRTMP_ADAPTER pAdapter
,
2450 INT
Set_RTSThreshold_Proc(
2451 IN PRTMP_ADAPTER pAdapter
,
2454 INT
Set_FragThreshold_Proc(
2455 IN PRTMP_ADAPTER pAdapter
,
2458 INT
Set_TxBurst_Proc(
2459 IN PRTMP_ADAPTER pAdapter
,
2462 INT
Set_TurboRate_Proc(
2463 IN PRTMP_ADAPTER pAdapter
,
2466 INT
Set_NetworkType_Proc(
2467 IN PRTMP_ADAPTER pAdapter
,
2470 INT
Set_AuthMode_Proc(
2471 IN PRTMP_ADAPTER pAdapter
,
2474 INT
Set_EncrypType_Proc(
2475 IN PRTMP_ADAPTER pAdapter
,
2478 INT
Set_DefaultKeyID_Proc(
2479 IN PRTMP_ADAPTER pAdapter
,
2483 IN PRTMP_ADAPTER pAdapter
,
2487 IN PRTMP_ADAPTER pAdapter
,
2491 IN PRTMP_ADAPTER pAdapter
,
2495 IN PRTMP_ADAPTER pAdapter
,
2498 INT
Set_WPAPSK_Proc(
2499 IN PRTMP_ADAPTER pAdapter
,
2502 INT
Set_WPANONE_Proc(
2503 IN PRTMP_ADAPTER pAdapter
,
2507 IN PRTMP_ADAPTER pAdapter
,
2508 IN
struct iwreq
*wrq
);
2511 IN PRTMP_ADAPTER pAdapter
,
2512 IN
struct iwreq
*wrq
);
2515 VOID
RTMPIoctlE2PROM(
2516 IN PRTMP_ADAPTER pAdapter
,
2517 IN
struct iwreq
*wrq
);
2520 // prototype in wpa.c
2522 BOOLEAN
WpaMsgTypeSubst(
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
,
2551 IN PMACADDR pAddr1
);
2553 VOID
WpaHardEncrypt(
2554 IN PRTMP_ADAPTER pAdapter
,
2585 IN PRTMP_ADAPTER pAd
,
2588 VOID
AES_GTK_KEY_UNWRAP(
2590 OUT UCHAR
*plaintext
,
2591 IN UCHAR
*ciphertext
);
2593 ULONG
RTMPTkipGetUInt32(
2598 IN
const char * s2
);
2602 IN PRTMP_ADAPTER pAdapter
,
2605 INT
Set_ATE_DA_Proc(
2606 IN PRTMP_ADAPTER pAdapter
,
2609 INT
Set_ATE_SA_Proc(
2610 IN PRTMP_ADAPTER pAdapter
,
2613 INT
Set_ATE_BSSID_Proc(
2614 IN PRTMP_ADAPTER pAdapter
,
2617 INT
Set_ATE_CHANNEL_Proc(
2618 IN PRTMP_ADAPTER pAdapter
,
2621 INT
Set_ATE_TX_POWER_Proc(
2622 IN PRTMP_ADAPTER pAdapter
,
2625 INT
Set_ATE_TX_LENGTH_Proc(
2626 IN PRTMP_ADAPTER pAdapter
,
2629 INT
Set_ATE_TX_COUNT_Proc(
2630 IN PRTMP_ADAPTER pAdapter
,
2633 INT
Set_ATE_TX_RATE_Proc(
2634 IN PRTMP_ADAPTER pAdapter
,
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__