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

📄 xvnet.h

📁 atmel usb 无线网卡驱动程序
💻 H
字号:
/* xvnet.h *//*******************************************************************************************	Copyright 2002-2003 ATMEL Corporation.	This file is part of ATMEL Wireless LAN Drivers.	ATMEL Wireless LAN Drivers is free software; you can redistribute it and/or modify	it under the terms of the GNU General Public License as published by	the Free Software Foundation; either version 2 of the License, or	(at your option) any later version.	ATMEL Wireless LAN Drivers is distributed in the hope that it will be useful,	but WITHOUT ANY WARRANTY; without even the implied warranty of	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the	GNU General Public License for more details.	You should have received a copy of the GNU General Public License	along with ATMEL Wireless LAN Drivers; if not, write to the Free Software	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*******************************************************************************************/#ifndef __XVNET_H__#define __XVNET_H__#if( defined OS_SOLARIS || defined OS_VIRTUAL )#define MAX_SSID_LENGTH			32#define SHORT_WEP_KEY_SIZE		5#define LONG_WEP_KEY_SIZE		13#define MAX_BSS_ENTRIES			12#define BSS_TYPE_AD_HOC			1#define BSS_TYPE_INFRASTRUCTURE		2#define INT_ROAMING_ENABLED		0#define INT_ROAMING_DISABLED		1#define WEP_DISABLED			0#define WEP_64bit			1#define WEP_128bit			2#define NONE				0#define KEY1				1#define KEY2				2#define KEY3				3#define KEY4				4#define MAX_VNET_CARDS			8typedef unsigned char	UCHAR;typedef unsigned short	USHORT;typedef unsigned long	ULONG;typedef unsigned int	UINT;typedef unsigned char*	PUCHAR;typedef unsigned short*	PUSHORT;typedef struct __BSS_INFO{	UCHAR		Channel;	UCHAR		SSID[MAX_SSID_LENGTH];	UCHAR		SSIDsize;	UCHAR		BSSID[6];	UCHAR		RSSI;	UCHAR		UsingWEP;	UCHAR		PreambleType;	USHORT		BeaconPeriod;	UCHAR		BSStype;} BSS_INFO;#ifdef ATMEL_WLAN#define MAX_ENCRYPTION_KEYS				4#define MAX_ENCRYPTION_KEY_SIZE				40#define CIPHER_SUITE_NONE 0#define CIPHER_SUITE_WEP_64 1#define CIPHER_SUITE_TKIP 2#define CIPHER_SUITE_AES  3#define CIPHER_SUITE_CCX  4#define CIPHER_SUITE_WEP_128  5typedef struct __WEP_INFO{  UCHAR	WepKeyToUse;  UCHAR	WepMode;  USHORT AuthenticationType;  UCHAR	EncryptionLevel;		//0:Disabled, 1:64bit, 2:128 bit  UCHAR	GroupKeyIndex;  UCHAR	PairwiseKeyIndex;  UCHAR   PairwiseKeyLength;  UCHAR	GroupKeyLength;  UCHAR	PairwiseCipherSuite;  UCHAR	GroupCipherSuite;  UCHAR   BSSID[6];  UCHAR	KeyIndex;  UCHAR	KeyLength;  UCHAR	SetKey;  UCHAR	KeyMaterial[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE];  UCHAR	KeyRSC[4][8];} WEP_INFO;#elsetypedef struct __WEP_INFO{	UCHAR		WepKeyToUse;	UCHAR		WepMode;	USHORT		AuthenticationType;	UCHAR		EncryptionLevel;	//0:Disabled,1:64bit,2:128 bit	UCHAR		WepKey1[LONG_WEP_KEY_SIZE];	UCHAR		WepKey2[LONG_WEP_KEY_SIZE];	UCHAR		WepKey3[LONG_WEP_KEY_SIZE];	UCHAR		WepKey4[LONG_WEP_KEY_SIZE];}  WEP_INFO, *PWEP_INFO;typedef struct _CON_WEP_INFO{	UCHAR		WepHex[4][LONG_WEP_KEY_SIZE];	char		Wep_Ascii[4][28];	char		WepKeyLength;	char		EncryptionLevel;	char		WepToUse;	char		WepMode;	char		AuthType;} CON_WEP_INFO;#endiftypedef struct __VERSION_INFO{	UCHAR		DriverMajorVersion;	UCHAR		DriverMinorVersion;	UCHAR		DriverSubVersion;	USHORT		DriverBuild;	USHORT		FwMajorVersion;	USHORT		FwMinorVersion;	USHORT		FwSubVersion;	USHORT		FwBuild;} VERSION_INFO, *PVERSION_INFO;typedef struct _SUPPORT_INFO{	char		essid[32];	char		newc[32];	char		DriverState[200];	char		MAC[20];	char		SValue[8]; //used for signal strength value %	char		LValue[8]; //used for link quality	char		DTxSucc[8];	char		DRxSucc[8];	char		DTxUnS[8];	char		DRxUnS[8];	int		Channel;	int		OpMode;	int		PowerMgmtMode;	int		InternationalRoaming;	int		RadioIsOn;	char		RegDomain;	char		ChannelVector[14];	unsigned long	MgmtErrorCode;} SUPPORT_INFO, *PSUPPORT_INFO;//////////////////////////////////////////////////////////////////////////////////////////typedef struct _STATISTICS{	ULONG	TxDataPacketsOk;	ULONG	TxDataPacketsError;	ULONG	TxMgmtPacketsOk;	ULONG	TxMgmtPacketsError;	ULONG	RxDataPacketsOk;	ULONG	RxDataPacketsError;	ULONG	RxMgmtPacketsOk;	ULONG	RxMgmtPacketsError;	ULONG	RxLost;	ULONG	TxPacketsRejectedNotReady;	ULONG	TxPacketsRejectedResources;	ULONG	MatchingBeacons;		#ifdef ATMEL_WLAN			ULONG	RxWpaMicErrors;	ULONG	RxWpaCountermeasuresCount;	ULONG	RxWpaReplayErrors;	ULONG	WpaBlackListEntries;	ULONG	Reserved1;	ULONG	Reserved2;	ULONG	Reserved3;	ULONG	Reserved4;#endif	} STATISTICS;typedef struct __STATINFO{	char	DTxSucc[10];	char	DRxSucc[10];	char	DTxUnS[10];	char	DRxUnS[10];	char	MTxSucc[10];	char	MRxSucc[10];	char	MTxUnS[10];	char	MRxUnS[10];	char	RejTx[10];	char	RejRx[10];} STATINFO, *PSTATINFO;typedef struct __DEVICE_CONFIGURATION{	UCHAR			OperatingMode;			//AD_HOC_MODE or INFRASTRUCTURE_MODE	UCHAR			Channel;	UCHAR			SSID[MAX_SSID_LENGTH];	UCHAR			SSIDlength;	UCHAR			TxRate;				//0-4	UCHAR			PowerMgmtMode;			// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			TxPowerLevel;							//0-4	UCHAR			InternationalRoaming;		// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			RadioIsOn;			// Radio	UCHAR			PreambleType;			// LONG_PREAMBLE or SHORT_PREAMBLE	USHORT			FragmentationThreshold;	USHORT			RtsCtsThreshold;	UCHAR			BSSID[6];	UCHAR			StationState;	UCHAR			Rssi;	UCHAR			LinkQuality;	UCHAR			RegDomain;	UCHAR			ChannelVector[14];	ULONG			MgmtErrorCode;} DEVICE_CONFIGURATION, *PDEVICE_CONFIGURATION;#define CARD_TYPE_PCMCIA		0#define CARD_TYPE_PCMCIA_RFMD		1#define CARD_TYPE_USB			2#define CARD_TYPE_USB_RFMD		3#define CARD_TYPE_PCMCIA_REVD		4#define CARD_TYPE_PCMCIA_REVE		5#define CARD_TYPE_PCMCIA_504 		6#define CARD_TYPE_PCMCIA_504A 		7#define CARD_TYPE_PCMCIA_504_2958 	8#define CARD_TYPE_PCMCIA_PCI		9#define CARD_TYPE_USB_505		10#define CARD_TYPE_USB_505A		11#define CARD_TYPE_USB_505_2958		12#define CARD_TYPE_USB_505AMX		13/////////////////////////////////////////////////////////////////////////////////////////////=======================================================================================////=======================================================================================/////////////////////////////////////////////////////////////////////////////////////////////#define SITE_SURVEY_IDLE	0#define SITE_SURVEY_IN_PROGRESS	1#define SITE_SURVEY_COMPLETED	2#endif // OS_SOLARIS || OS_VIRTUAL#ifdef OS_LINUX#include <stdio.h>#include <string.h>#include <stdlib.h>#include <sys/types.h>#include <sys/ioctl.h>#include <sys/stat.h>#include <errno.h>#include <fcntl.h>#include <ctype.h>#include <unistd.h>#include <netdb.h>		/* gethostbyname, getnetbyname */#include <linux/if_arp.h>	/* For ARPHRD_ETHER */#include <linux/socket.h>	/* For AF_INET & struct sockaddr */#include <linux/wireless.h>#include "vnetioctl.h"#define MAX_SSID_LENGTH				32#define SHORT_WEP_KEY_SIZE			5#define LONG_WEP_KEY_SIZE			13#define BSS_TYPE_AD_HOC				1#define BSS_TYPE_INFRASTRUCTURE		2#define WEP_DISABLED				0#define WEP_64bit					1#define WEP_128bit					2#define MAX_VNET_CARDS				8typedef char 	CHAR;typedef unsigned char 	UCHAR;typedef unsigned short 	USHORT;typedef unsigned long 	ULONG;typedef unsigned int 	UINT;typedef unsigned char* 	PUCHAR;typedef unsigned short*	PUSHORT;typedef int	 	BOOLEAN;typedef void	VOID;typedef struct __BSS_INFO{	UCHAR		Channel;	UCHAR		SSID[MAX_SSID_LENGTH];	UCHAR		SSIDsize;	UCHAR		BSSID[6];	UCHAR		RSSI;	UCHAR		UsingWEP;	UCHAR		PreambleType;	USHORT  	BeaconPeriod;	UCHAR		BSStype;}BSS_INFO;// NEW#define WEP_DISABLED			0#define WEP_64BIT			1#define WEP_128BIT			2#define C80211_MGMT_AAN_OPENSYSTEM		0x0000#define C80211_MGMT_AAN_SHAREDKEY		0x0001#ifndef ATMEL_WLANtypedef struct __ENCRYPTION_INFO{	UCHAR						WepKeyToUse;	UCHAR						WepMode;	USHORT						AuthenticationType;	UCHAR						EncryptionLevel;					//0:Disabled,1:64bit,2:128 bit	UCHAR						WepKey1[LONG_WEP_KEY_SIZE];	UCHAR						WepKey2[LONG_WEP_KEY_SIZE];	UCHAR						WepKey3[LONG_WEP_KEY_SIZE];	UCHAR						WepKey4[LONG_WEP_KEY_SIZE];}  ENCRYPTION_INFO, *PENCRYPTION_INFO;#else#define CIPHER_SUITE_NONE 0#define CIPHER_SUITE_WEP_64 1#define CIPHER_SUITE_TKIP 2#define CIPHER_SUITE_AES  3#define CIPHER_SUITE_CCX  4#define CIPHER_SUITE_WEP_128  5typedef struct __ENCRYPTION_INFO{	UCHAR	WepKeyToUse;	UCHAR	WepMode;	USHORT	AuthenticationType;	UCHAR	EncryptionLevel;		//0:Disabled, 1:64bit, 2:128 bit  UCHAR	GroupKeyIndex;  UCHAR	PairwiseKeyIndex;  UCHAR   PairwiseKeyLength;  UCHAR	GroupKeyLength;  UCHAR	PairwiseCipherSuite;  UCHAR	GroupCipherSuite;  UCHAR   BSSID[6];  UCHAR	KeyIndex;  UCHAR	KeyLength;  UCHAR	SetKey;  UCHAR	KeyMaterial[4][40];  UCHAR	KeyRSC[4][8];}  ENCRYPTION_INFO, *PENCRYPTION_INFO;#endif	//ATMEL_WLAN#define MAX_BSS_ENTRIES		64	#define MAX_PAIRWISE_SUITES 4#define MAX_AUTH_MGMT_SUITES 4typedef struct __WPA_INFO{	USHORT	Version;	UCHAR	GroupSuite;	USHORT	PairwiseSuiteCnt;	UCHAR	PairwiseSuiteList[MAX_PAIRWISE_SUITES];	USHORT	AuthMgmtSuiteCnt;	UCHAR	AuthMgmtSuiteList[MAX_AUTH_MGMT_SUITES];	UCHAR	WpaCapabilities[2];} WPA_INFO, *PWPA_INFO;#define MAX_IE_LENGTH		400#define MAX_WPA_IE_LEN 64#define MAX_SUPPORTED_RATES_LENGTH	16typedef struct __BSS_INFO_EX{	UCHAR	Channel;	UCHAR	SSID[MAX_SSID_LENGTH];	UCHAR	SSIDsize;	UCHAR	BSSID[6];	CHAR	RSSI;	UCHAR	UsingWEP;	UCHAR	PreambleType;	USHORT  BeaconPeriod;	UCHAR	BSStype;	UCHAR	BeaconProbeInfo[MAX_IE_LENGTH];	USHORT	BeaconProbeLen;        UCHAR   WpaIE[MAX_WPA_IE_LEN * 2 + 30];        USHORT  WpaIELen;	ULONG	Capabilities;	UCHAR	FailedToConnect;	WPA_INFO WpaInfo;	WPA_INFO Wpa2Info;	UCHAR	SupportedRatesLength;	UCHAR	SupportedRates[MAX_SUPPORTED_RATES_LENGTH];} BSS_INFO_EX, *PBSS_INFO_EX;#ifdef ATMEL_WLAN#define MAX_ENCRYPTION_KEYS				4#define MAX_ENCRYPTION_KEY_SIZE				40#define CIPHER_SUITE_NONE 				0#define CIPHER_SUITE_WEP_64 				1#define CIPHER_SUITE_TKIP 				2#define CIPHER_SUITE_AES  				3#define CIPHER_SUITE_CCX  4#define CIPHER_SUITE_WEP_128  5typedef struct __WEP_INFO{  UCHAR	WepKeyToUse;  UCHAR	WepMode;  USHORT AuthenticationType;  UCHAR	EncryptionLevel;		//0:Disabled, 1:64bit, 2:128 bit  UCHAR	GroupKeyIndex;  UCHAR	PairwiseKeyIndex;  UCHAR   PairwiseKeyLength;  UCHAR	GroupKeyLength;  UCHAR	PairwiseCipherSuite;  UCHAR	GroupCipherSuite;  UCHAR   BSSID[6];  UCHAR	KeyIndex;  UCHAR	KeyLength;  UCHAR	SetKey;  UCHAR	KeyMaterial[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE];  UCHAR	KeyRSC[4][8];}  WEP_INFO;#elsetypedef struct __WEP_INFO{	UCHAR		WepKeyToUse;	UCHAR		WepMode;	USHORT		AuthenticationType;	UCHAR		EncryptionLevel;	//0:Disabled,1:64bit,2:128 bit	UCHAR		WepKey1[LONG_WEP_KEY_SIZE];	UCHAR		WepKey2[LONG_WEP_KEY_SIZE];	UCHAR		WepKey3[LONG_WEP_KEY_SIZE];	UCHAR		WepKey4[LONG_WEP_KEY_SIZE];}  WEP_INFO, *PWEP_INFO;typedef struct _CON_WEP_INFO{	UCHAR		WepHex[4][LONG_WEP_KEY_SIZE];	char		Wep_Ascii[4][28];	char 		WepKeyLength;	char 		EncryptionLevel;	char		WepToUse;	char		WepMode;	char		AuthType;} CON_WEP_INFO;#endif // ATMEL_WLANtypedef struct __VERSION_INFO{	UCHAR		DriverMajorVersion;	UCHAR		DriverMinorVersion;	UCHAR		DriverSubVersion;	USHORT		DriverBuild;	USHORT		FwMajorVersion;	USHORT		FwMinorVersion;	USHORT		FwSubVersion;	USHORT		FwBuild;} VERSION_INFO, *PVERSION_INFO;typedef struct _SUPPORT_INFO{	char 		essid[32];	char		newc[32];	char 		DriverState[200];	char  		MAC[20];	char  		SValue[8]; //used for signal strength value %	char 		LValue[8]; //used for link quality	char  		DTxSucc[8];	char  		DRxSucc[8];	char  		DTxUnS[8];	char  		DRxUnS[8];		int 		Channel;	int		OpMode;	int		PowerMgmtMode;	int		InternationalRoaming;	int		RadioIsOn;        char            RegDomain;        char            ChannelVector[14];        unsigned long   MgmtErrorCode;} SUPPORT_INFO, *PSUPPORT_INFO;typedef struct _STATISTICS{	ULONG	TxDataPacketsOk;	ULONG	TxDataPacketsError;	ULONG	TxMgmtPacketsOk;	ULONG	TxMgmtPacketsError;	ULONG	RxDataPacketsOk;	ULONG	RxDataPacketsError;	ULONG	RxMgmtPacketsOk;	ULONG	RxMgmtPacketsError;	ULONG	RxLost;	ULONG	TxPacketsRejectedNotReady;	ULONG	TxPacketsRejectedResources;	ULONG	MatchingBeacons;#ifdef ATMEL_WLAN			ULONG	RxWpaMicErrors;	ULONG	RxWpaCountermeasuresCount;	ULONG	RxWpaReplayErrors;	ULONG	WpaBlackListEntries;	ULONG	Reserved1;	ULONG	Reserved2;	ULONG	Reserved3;	ULONG	Reserved4;#endif	} STATISTICS;typedef struct __STATINFO{	char	DTxSucc[10];	char	DRxSucc[10];	char	DTxUnS[10];	char	DRxUnS[10];		char	MTxSucc[10];	char	MRxSucc[10];	char	MTxUnS[10];	char	MRxUnS[10];	char  	RejTx[10];	char  	RejRx[10];} STATINFO, *PSTATINFO;typedef struct __DEVICE_CONFIGURATION{	UCHAR			OperatingMode;					//AD_HOC_MODE or INFRASTRUCTURE_MODE	UCHAR			Channel;	UCHAR			SSID[MAX_SSID_LENGTH];	UCHAR			SSIDlength;	UCHAR			TxRate;							//0-4		UCHAR			PowerMgmtMode;					// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			TxPowerLevel;							//0-4	UCHAR			InternationalRoaming;					// PM_MODE_ACTIVE or PM_MODE_POWER_SAVE	UCHAR			RadioIsOn;					// Radio	UCHAR			PreambleType;					// LONG_PREAMBLE or SHORT_PREAMBLE		USHORT			FragmentationThreshold;		USHORT			RtsCtsThreshold;	UCHAR			BSSID[6];	UCHAR			StationState;	UCHAR			Rssi;	UCHAR			LinkQuality;        UCHAR                   RegDomain;        UCHAR                   ChannelVector[14];	ULONG			MgmtErrorCode;			} DEVICE_CONFIGURATION, *PDEVICE_CONFIGURATION;#define CARD_TYPE_PCMCIA		0#define CARD_TYPE_PCMCIA_RFMD		1#define CARD_TYPE_USB			2#define CARD_TYPE_USB_RFMD		3#define CARD_TYPE_PCMCIA_REVD		4#define CARD_TYPE_PCMCIA_REVE		5#define CARD_TYPE_PCMCIA_504 		6#define CARD_TYPE_PCMCIA_504A 		7#define CARD_TYPE_PCMCIA_504_2958 	8#define CARD_TYPE_PCMCIA_PCI		9#define CARD_TYPE_USB_505		10#define CARD_TYPE_USB_505A		11#define CARD_TYPE_USB_505_2958		12#define CARD_TYPE_USB_505AMX		13#define SITE_SURVEY_IDLE		0#define SITE_SURVEY_IN_PROGRESS		1#define SITE_SURVEY_COMPLETED		2#define NONE				0#define KEY1				1#define KEY2				2#define KEY3				3#define KEY4				4#endif // OS_LINUX#endif // __XVNET_H__

⌨️ 快捷键说明

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