⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtmp.h

📁 RT73_Linux_STA_Drv1.0.3.6 linux系统下
💻 H
📖 第 1 页 / 共 5 页
字号:
//	Statistic counter structure
//
typedef struct _COUNTER_802_3
{
	// General Stats
	ULONG		GoodTransmits;
	ULONG		GoodReceives;
	ULONG		TxErrors;
	ULONG		RxErrors;
	ULONG		RxNoBuffer;

	// Ethernet Stats
	ULONG		RcvAlignmentErrors;
	ULONG		OneCollision;
	ULONG		MoreCollisions;

}	COUNTER_802_3, *PCOUNTER_802_3;

typedef struct _COUNTER_802_11 {
	ULONG			Length;
	LARGE_INTEGER	TransmittedFragmentCount;
	LARGE_INTEGER	MulticastTransmittedFrameCount;
	LARGE_INTEGER	FailedCount;
	LARGE_INTEGER	NoRetryCount;
	LARGE_INTEGER	RetryCount;
	LARGE_INTEGER	MultipleRetryCount;
	LARGE_INTEGER	RTSSuccessCount;
	LARGE_INTEGER	RTSFailureCount;
	LARGE_INTEGER	ACKFailureCount;
	LARGE_INTEGER	FrameDuplicateCount;
	LARGE_INTEGER	ReceivedFragmentCount;
	LARGE_INTEGER	MulticastReceivedFrameCount;
	LARGE_INTEGER	FCSErrorCount;
} COUNTER_802_11, *PCOUNTER_802_11;

typedef struct _COUNTER_RALINK {
	ULONG			TransmittedByteCount;	// both successful and failure, used to calculate TX throughput
	ULONG			ReceivedByteCount;		// both CRC okay and CRC error, used to calculate RX throughput
	ULONG			BeenDisassociatedCount;
	ULONG			BadCQIAutoRecoveryCount;
	ULONG			PoorCQIRoamingCount;
	ULONG			MgmtRingFullCount;
	ULONG			RxCount;
	ULONG			RxRingErrCount;
	ULONG			KickTxCount;
	ULONG			TxRingErrCount;
	LARGE_INTEGER	RealFcsErrCount;
	ULONG			PendingNdisPacketCount;

	ULONG			OneSecOsTxCount[NUM_OF_TX_RING];
	ULONG			OneSecDmaDoneCount[NUM_OF_TX_RING];
	ULONG			OneSecTxDoneCount;
	ULONG			OneSecTxAggregationCount;
	ULONG			OneSecRxAggregationCount;

	ULONG			OneSecTxNoRetryOkCount;
	ULONG			OneSecTxRetryOkCount;
	ULONG			OneSecTxFailCount;
	ULONG			OneSecFalseCCACnt;		// CCA error count, for debug purpose, might move to global counter
	ULONG			OneSecRxOkCnt;			// RX without error
	ULONG			OneSecRxFcsErrCnt;		// CRC error
	ULONG			OneSecBeaconSentCnt;
} COUNTER_RALINK, *PCOUNTER_RALINK;

typedef struct _COUNTER_DRS {
	// to record the each TX rate's quality. 0 is best, the bigger the worse.
	USHORT			TxQuality[MAX_LEN_OF_SUPPORTED_RATES];
	UCHAR			PER[MAX_LEN_OF_SUPPORTED_RATES];
	UCHAR			TxRateUpPenalty;	  // extra # of second penalty due to last unstable condition
	ULONG			CurrTxRateStableTime; // # of second in current TX rate
	BOOLEAN 		fNoisyEnvironment;
	UCHAR			LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down
} COUNTER_DRS, *PCOUNTER_DRS;

typedef struct _COUNTER_QA {
	LARGE_INTEGER	CRCErrorCount;
	LARGE_INTEGER	RXOverFlowCount;
	LARGE_INTEGER	PHYErrorCount;
	LARGE_INTEGER	FalseCCACount;
	LARGE_INTEGER	U2MDataCount;
	LARGE_INTEGER	OtherDataCount;
	LARGE_INTEGER	BeaconCount;
	LARGE_INTEGER	othersCount;
}	COUNTER_QA, *PCOUNTER_QA;

//
//	Arcfour Structure Added by PaulWu
//
typedef struct	_ARCFOUR
{
	UINT			X;
	UINT			Y;
	UCHAR			STATE[256];
}	ARCFOURCONTEXT, *PARCFOURCONTEXT;

typedef	struct	_IV_CONTROL_
{
	union
	{
		struct 
		{
			UCHAR		rc0;
			UCHAR		rc1;
			UCHAR		rc2;

			union
			{
				struct
				{
#ifdef BIG_ENDIAN
					UCHAR	KeyID:2;
					UCHAR	ExtIV:1;
					UCHAR	Rsvd:5;
#else
					UCHAR	Rsvd:5;
					UCHAR	ExtIV:1;
					UCHAR	KeyID:2;
#endif
				}	field;
				UCHAR		Byte;
			}	CONTROL;
		}	field;
		
		ULONG	word;
	}	IV16;
	
	ULONG	IV32;
}	TKIP_IV, *PTKIP_IV;


// Shared key data structure
typedef struct	_WEP_KEY {
	UCHAR	KeyLen; 					// Key length for each key, 0: entry is invalid
	UCHAR	Key[MAX_LEN_OF_KEY];		// right now we implement 4 keys, 128 bits max
}	WEP_KEY, *PWEP_KEY;

typedef struct _CIPHER_KEY {
	UCHAR	BssId[6];
	UCHAR	CipherAlg;			// 0-none, 1:WEP64, 2:WEP128, 3:TKIP, 4:AES, 5:CKIP64, 6:CKIP128
	UCHAR	KeyLen; 			// Key length for each key, 0: entry is invalid
	UCHAR	Key[16];			// right now we implement 4 keys, 128 bits max
	UCHAR	RxMic[8];
	UCHAR	TxMic[8];
	UCHAR	TxTsc[6];			// 48bit TSC value
	UCHAR	RxTsc[6];			// 48bit TSC value
	UCHAR	Type;				// Indicate Pairwise/Group when reporting MIC error
}	CIPHER_KEY, *PCIPHER_KEY;

typedef struct _BBP_TUNING_STRUCT {
	BOOLEAN 	Enable;
	UCHAR		FalseCcaCountUpperBound;  // 100 per sec
	UCHAR		FalseCcaCountLowerBound;  // 10 per sec
	UCHAR		R17LowerBound;			  // specified in E2PROM
	UCHAR		R17UpperBound;			  // 0x68 according to David Tung
	UCHAR		CurrentR17Value;
} BBP_TUNING, *PBBP_TUNING;

typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
	UCHAR	  EvaluatePeriod;		 // 0:not evalute status, 1: evaluate status, 2: switching status
	UCHAR	  Pair1PrimaryRxAnt;	 // 0:Ant-E1, 1:Ant-E2
	UCHAR	  Pair1SecondaryRxAnt;	 // 0:Ant-E1, 1:Ant-E2
	UCHAR	  Pair2PrimaryRxAnt;	 // 0:Ant-E3, 1:Ant-E4
	UCHAR	  Pair2SecondaryRxAnt;	 // 0:Ant-E3, 1:Ant-E4
	SHORT	  Pair1AvgRssi[2];		 // AvgRssi[0]:E1, AvgRssi[1]:E2
	SHORT	  Pair2AvgRssi[2];		 // AvgRssi[0]:E3, AvgRssi[1]:E4
	SHORT	  Pair1LastAvgRssi; 	 // 
	SHORT	  Pair2LastAvgRssi; 	 // 
	ULONG	  RcvPktNumWhenEvaluate;
	BOOLEAN   FirstPktArrivedWhenEvaluate;
	RALINK_TIMER_STRUCT    RxAntDiversityTimer;
} SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;

typedef struct {
	BOOLEAN 	Enable;
	UCHAR		Delta;
	BOOLEAN 	PlusSign;
} CCK_TX_POWER_CALIBRATE, *PCCK_TX_POWER_CALIBRATE;

//
// Receive Tuple Cache Format
//
typedef struct	_TUPLE_CACHE	{
	BOOLEAN 		Valid;
	UCHAR			MacAddress[MAC_ADDR_LEN];
	USHORT			Sequence; 
	USHORT			Frag;
}	TUPLE_CACHE, *PTUPLE_CACHE;

//
// Fragment Frame structure
//
typedef struct	_FRAGMENT_FRAME {
	UCHAR		Header802_3[LENGTH_802_3];
	UCHAR		Header_LLC[LENGTH_802_1_H];
	UCHAR		Buffer[LENGTH_802_3 + MAX_FRAME_SIZE];	// Add header to prevent NETBUEI continuous buffer isssue
	ULONG		RxSize;
	USHORT		Sequence;
	USHORT		LastFrag;
	ULONG		Flags;			// Some extra frame information. bit 0: LLC presented
}	FRAGMENT_FRAME, *PFRAGMENT_FRAME;

//
// Tkip Key structure which RC4 key & MIC calculation
//
typedef struct	_TKIP_KEY_INFO	{
	UINT		nBytesInM;	// # bytes in M for MICKEY
	ULONG		IV16;
	ULONG		IV32;	
	ULONG		K0; 		// for MICKEY Low
	ULONG		K1; 		// for MICKEY Hig
	ULONG		L;			// Current state for MICKEY
	ULONG		R;			// Current state for MICKEY
	ULONG		M;			// Message accumulator for MICKEY
	UCHAR		RC4KEY[16];
	UCHAR		MIC[8];
}	TKIP_KEY_INFO, *PTKIP_KEY_INFO;

//
// Private / Misc data, counters for driver internal use
//
typedef struct	__PRIVATE_STRUC {
	ULONG		SystemResetCnt; 		// System reset counter
	ULONG		TxRingFullCnt;			// Tx ring full occurrance number
	ULONG		PhyRxErrCnt;			// PHY Rx error count, for debug purpose, might move to global counter
	// Variables for WEP encryption / decryption in rtmp_wep.c
	ULONG			FCSCRC32;
	ARCFOURCONTEXT	WEPCONTEXT;
	// Tkip stuff
	TKIP_KEY_INFO	Tx;
	TKIP_KEY_INFO	Rx;
}	PRIVATE_STRUC, *PPRIVATE_STRUC;

// structure to store Simple Config Attributes Info
typedef struct _WSC_LV_INFO {
    USHORT  ValueLen;
    UCHAR   Value[512];
} WSC_LV_INFO;

// structure to tune BBP R17 "RX AGC VGC init"
typedef struct _BBP_R17_TUNING {
	BOOLEAN 	bEnable;
	UCHAR		R17LowerBoundG;
	UCHAR		R17LowerBoundA;
	UCHAR		R17UpperBoundG;
	UCHAR		R17UpperBoundA;
//	  UCHAR 	  LastR17Value;
//	  SHORT 	  R17Dec;	  // R17Dec = 0x79 - RssiToDbm, for old version R17Dec = 0.
//							  // This is signed value
	USHORT		FalseCcaLowerThreshold;  // default 100
	USHORT		FalseCcaUpperThreshold;  // default 512
	UCHAR		R17Delta;				 // R17 +- R17Delta whenever false CCA over UpperThreshold or lower than LowerThreshold
	UCHAR		R17CurrentValue;
	BOOLEAN		R17LowerUpperSelect; //Before LinkUp, Used LowerBound or UpperBound as R17 value.
} BBP_R17_TUNING, *PBBP_R17_TUNING;

// structure to store channel TX power
typedef struct _CHANNEL_TX_POWER {
	UCHAR	   Channel;
	CHAR	   Power;
}	CHANNEL_TX_POWER, *PCHANNEL_TX_POWER;

typedef enum _ABGBAND_STATE_ {
	UNKNOWN_BAND,
	BG_BAND,
	A_BAND,
} ABGBAND_STATE;

typedef struct _MLME_MEMORY_STRUCT {
	PVOID							AllocVa;	//Pointer to the base virtual address of the allocated memory
	struct _MLME_MEMORY_STRUCT		*Next;		//Pointer to the next virtual address of the allocated memory
}	MLME_MEMORY_STRUCT, *PMLME_MEMORY_STRUCT;

typedef struct	_MLME_MEMORY_HANDLER {
	BOOLEAN 				MemRunning; 		//The flag of the Mlme memory handler's status
	UINT					MemoryCount;		//Total nonpaged system-space memory not size
	UINT					InUseCount; 		//Nonpaged system-space memory in used counts
	UINT					UnUseCount; 		//Nonpaged system-space memory available counts
	UINT					PendingCount;		//Nonpaged system-space memory for free counts
	PMLME_MEMORY_STRUCT 	pInUseHead; 		//Pointer to the first nonpaed memory not used
	PMLME_MEMORY_STRUCT 	pInUseTail; 		//Pointer to the last nonpaged memory not used
	PMLME_MEMORY_STRUCT 	pUnUseHead; 		//Pointer to the first nonpaged memory in used
	PMLME_MEMORY_STRUCT 	pUnUseTail; 		//Pointer to the last nonpaged memory in used
	PULONG					MemFreePending[MAX_MLME_HANDLER_MEMORY];   //an array to keep pending free-memory's pointer (32bits)
}	MLME_MEMORY_HANDLER, *PMLME_MEMORY_HANDLER;

typedef struct _MLME_STRUCT {
	STATE_MACHINE			CntlMachine;
	STATE_MACHINE			AssocMachine;
	STATE_MACHINE			AuthMachine;
	STATE_MACHINE			AuthRspMachine;
	STATE_MACHINE			SyncMachine;
	STATE_MACHINE			WpaPskMachine;
	STATE_MACHINE_FUNC		AssocFunc[ASSOC_FUNC_SIZE];
	STATE_MACHINE_FUNC		AuthFunc[AUTH_FUNC_SIZE];
	STATE_MACHINE_FUNC		AuthRspFunc[AUTH_RSP_FUNC_SIZE];
	STATE_MACHINE_FUNC		SyncFunc[SYNC_FUNC_SIZE];
	STATE_MACHINE_FUNC		WpaPskFunc[WPA_PSK_FUNC_SIZE];

	ULONG					ChannelQuality;  // 0..100, Channel Quality Indication for Roaming
	ULONG					Now32;			 // latch the value of NdisGetSystemUpTime() 

	BOOLEAN 				bRunning;
	spinlock_t				TaskLock;
	MLME_QUEUE				Queue;

	UINT					ShiftReg;
	
	RALINK_TIMER_STRUCT 	PeriodicTimer;
	RALINK_TIMER_STRUCT 	LinkDownTimer;
	ULONG					PeriodicRound;
	
	MLME_MEMORY_HANDLER 	MemHandler; 		//The handler of the nonpaged memory inside MLME  
} MLME_STRUCT, *PMLME_STRUCT;

//
// Management ring buffer format
//
typedef	struct	_MGMT_STRUC	{
	BOOLEAN		Valid;
	PUCHAR		pBuffer;
	ULONG		Length;
}	MGMT_STRUC, *PMGMT_STRUC;

// structure for radar detection and channel switch
typedef struct _RADAR_DETECT_STRUCT {
	UCHAR		CSCount;			//Channel switch counter
	UCHAR		CSPeriod;			//Channel switch period (beacon count)
	UCHAR		RDCount;			//Radar detection counter
	UCHAR		RDMode;				//Radar Detection mode
	UCHAR		BBPR16;
	UCHAR		BBPR17;
	UCHAR		BBPR18;
	UCHAR		BBPR21;
	UCHAR		BBPR22;
	UCHAR		BBPR64;
	ULONG		InServiceMonitorCount; // unit: sec
} RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT;

//
//	configuration and status
//
typedef struct _PORT_CONFIG {

	// MIB:ieee802dot11.dot11smt(1).dot11StationConfigTable(1)
	USHORT		Psm;				  // power management mode	 (PWR_ACTIVE|PWR_SAVE)
	USHORT		DisassocReason;
	UCHAR		DisassocSta[MAC_ADDR_LEN];
	USHORT		DeauthReason;
	UCHAR		DeauthSta[MAC_ADDR_LEN];
	USHORT		AuthFailReason;
	UCHAR		AuthFailSta[MAC_ADDR_LEN];

	NDIS_802_11_AUTHENTICATION_MODE 	AuthMode;		// This should match to whatever microsoft defined
	NDIS_802_11_WEP_STATUS				WepStatus;
	NDIS_802_11_WEP_STATUS				OrigWepStatus;	// Original wep status set from OID


	// Add to support different cipher suite for WPA2/WPA mode
	NDIS_802_11_ENCRYPTION_STATUS		GroupCipher;		// Multicast cipher suite
	NDIS_802_11_ENCRYPTION_STATUS		PairCipher;			// Unicast cipher suite
	BOOLEAN								bMixCipher;			// Indicate current Pair & Group use different cipher suites
	USHORT								RsnCapability;
	
	// MIB:ieee802dot11.dot11smt(1).dot11WEPDefaultKeysTable(3)
	CIPHER_KEY	PskKey; 				// WPA PSK mode PMK
	UCHAR		PTK[64];				// WPA PSK mode PTK
	BSSID_INFO	SavedPMK[PMKID_NO];
	ULONG		SavedPMKNum;			// Saved PMKID number

	// WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
	UCHAR		PortSecured;
	UCHAR		RSN_IE[44];
	UCHAR		RSN_IELen;

//#if WPA_SUPPLICANT_SUPPORT	
	BOOLEAN     IEEE8021X;				// Enable or disable IEEE 802.1x 
	CIPHER_KEY	DesireSharedKey[4];		// Record user desired WEP keys	
	BOOLEAN		IEEE8021x_required_keys;				// Enable or disable dynamic wep key updating
	BOOLEAN     WPA_Supplicant;         // Enable or disable WPA_SUPPLICANT 
	BOOLEAN     Send_Beacon;
//#endif

	// For WPA countermeasures
	ULONG		LastMicErrorTime;	// record last MIC error time
	ULONG		MicErrCnt;			// Should be 0, 1, 2, then reset to zero (after disassoiciation).
	BOOLEAN 	bBlockAssoc;		// Block associate attempt for 60 seconds after counter measure occurred.
	// For WPA-PSK supplicant state
	WPA_STATE	WpaState;			// Default is SS_NOTUSE and handled by microsoft 802.1x
	UCHAR		ReplayCounter[8];
	UCHAR		ANonce[32]; 		// ANonce for WPA-PSK from aurhenticator
	UCHAR		SNonce[32]; 		// SNonce for WPA-PSK
	
	// MIB:ieee802dot11.dot11smt(1).dot11PrivacyTable(5)
	UCHAR								DefaultKeyId;
	NDIS_802_11_PRIVACY_FILTER			PrivacyFilter;	// PrivacyFilter enum for 802.1X


	// MIB:ieee802dot11.dot11mac(2).dot11OperationTable(1)
	USHORT		RtsThreshold;			// in unit of BYTE
	USHORT		FragmentThreshold;		// in unit of BYTE
	BOOLEAN 	bFragmentZeroDisable;	// Microsoft use 0 as disable 
	
	// MIB:ieee802dot11.dot11phy(4).dot11PhyTxPowerTable(3)
	UCHAR		TxPower;				// in unit of mW
	ULONG		TxPowerPercentage;		// 0~100 %
	ULONG		TxPowerDefault; 		// keep for TxPowerPercentage

	// MIB:ieee802dot11.dot11phy(4).dot11PhyDSSSTable(5)
	UCHAR		Channel;		  // current (I)BSS channel used in the station
	UCHAR       AdhocChannel;     // current (I)BSS channel used in the station
	UCHAR		CountryRegion;	  // Enum of country region, 0:FCC, 1:IC, 2:ETSI, 3:SPAIN, 4:France, 5:MKK, 6:MKK1, 7:Israel
	UCHAR		CountryRegionForABand;	// Enum of country region for A band

	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -