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

📄 vnet.h

📁 atmel usb 无线网卡驱动程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/***************************************************************************************	Copyright 2000-2001 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 __VNet_h_OK__#define __VNet_h_OK__#define MAX_SSID_LENGTH 							32#define VNetMoveMemory(x, y, bytes) memcpy(x,y, bytes)#define VNetZeroMemory(x, bytes) memset(x,0, bytes)#define VNetMemCompare(x, y, bytes) memcmp(x, y, bytes)#include "vnet_linux.h"#define SUPPORTED_RATES_ELEMENT_ID                                 1#define WPA_MODE_OFF  0#define WPA_MODE_1    1#define WPA_MODE_2    2#define SSID_ELEMENT_OFFSET             14      //12+2#define SSID_ELEMENT_LENGTH_OFFSET          13      //12+1#define SSID_ELEMENT_ID_OFFSET            12      //12+1#define SUP_RATES_ELEMENT_LENGTH_REL_OFFSET     15      //12+2+1#define DS_PARAM_SET_ELEMENT_REL_OFFSET       18      //12+2+2+2#define BSSID_HEADER_OFFSET             16#define MGMT_FRAME_BODY_OFFSET            24#define EAPOL_NONE            0#define EAPOL_RX_HANDSHAKE_MSG1   1#define EAPOL_TX_HANDSHAKE_MSG2   2#define EAPOL_RX_HANDSHAKE_MSG3   3#define EAPOL_TX_HANDSHAKE_MSG4   4#define EAPOL_RX_GROUP_UPDATE_MSG1  5#define EAPOL_TX_GROUP_UPDATE_MSG2  6#define EAPOL_TX_MIC_ERROR_MSG    7#define EAPOL_LOG_OFF           8#define EAP_REQUEST           10#define EAP_RESPONSE          11#define EAP_SUCCESS           12#define EAP_REJECT            13#define EAP_START             14#define LEAP_CHALLENGE          15#define LEAP_CHALLENGE_OFF      0#define LEAP_CHALLENGE_ON       1#define VNet_LENGTH_OF_ADDRESS				6typedef UCHAR MACADDR[VNet_LENGTH_OF_ADDRESS];typedef enum __ASSOCIATION_METHOD{   AssocMethodNoRequest,   AssocMethodAssociationRequest,   AssocMethodReAssociationRequest}ASSOCIATION_METHOD, *PASSOCIATION_METHOD;typedef enum _802_11_WEP_STATUS{    _802_11WEPEnabled,    _802_11Encryption1Enabled = _802_11WEPEnabled,    _802_11WEPDisabled,    _802_11EncryptionDisabled = _802_11WEPDisabled,    _802_11WEPKeyAbsent,    _802_11Encryption1KeyAbsent = _802_11WEPKeyAbsent,    _802_11WEPNotSupported,    _802_11EncryptionNotSupported = _802_11WEPNotSupported,    _802_11Encryption2Enabled,    _802_11Encryption2KeyAbsent,    _802_11Encryption3Enabled,    _802_11Encryption3KeyAbsent} __802_11_WEP_STATUS, *P_802_11_WEP_STATUS, __802_11_ENCRYPTION_STATUS, *P__802_11_ENCRYPTION_STATUS;// Add new authentication modestypedef enum _802_11_AUTHENTICATION_MODE{    _802_11AuthModeOpen,    _802_11AuthModeShared,    _802_11AuthModeAutoSwitch,    _802_11AuthModeWPA,    _802_11AuthModeWPAPSK,    _802_11AuthModeWPANone,    _802_11AuthModeWPA2,    _802_11AuthModeWPA2PSK,    _802_11AuthModeMax               // Not a real mode, defined as upper bound} __802_11_AUTHENTICATION_MODE, *P__802_11_AUTHENTICATION_MODE;// WPA SPECIFICtypedef struct __MIC_BLACK_LIST{	UCHAR		Bssid[6];	UCHAR		InUse;	ULONG64		TimeStamp;}MIC_BLACK_LIST, *PMIC_BLACK_LIST;BOOLEAN WPA_AddAPInBlackList(MIC_BLACK_LIST* MicBlackList, unsigned char ListEntries, unsigned char* pValidListEntries, unsigned char* pBSSID, void* pTime);BOOLEAN WPA_IsOkToConnect(MIC_BLACK_LIST* MicBlackList, unsigned char ListEntries, unsigned char* pValidListEntries, unsigned char* pBSSID, void* pCurrentTime);// #include "debug.h"#include "appint.h"#include "at76c502.h"#include "frame.h"#define FAST_VNET_MAJOR_VERSION 		2#define FAST_VNET_MINOR_VERSION 		2#define FAST_VNET_SUB_VERSION			2#define FAST_VNET_BUILD 			2#define PRODUCT_NAME						"PCMCIA Wireless Network Adapter"#define MAX_DRIVER_DESC_LENGTH				100#define MAX_CMD_Q_ENTRIES					30#ifdef PCI#define ATMEL_PCI_VENDOR_ID 			0x1114#define ATMEL_PCI_DEVICE_ID 			0x0506#endif#define AUTHENTICATION_RESPONSE_TIME_OUT	1000///////////////////////////////////////////////////////////////////////////// General definitions///////////////////////////////////////////////////////////////////////////#define VNet_MAX_FRAME_SIZE 				1500#define VNet_HEADER_SIZE					14#define MAX_WIRELESS_FRAME_SIZE 			1550 // 1500 + 14 + 18 + ...#define VNet_MAX_LOOKAHEAD					VNet_MAX_FRAME_SIZE #define DEFAULT_MULTICASTLISTMAX			32#ifdef SNIFFER#define MAX_RX_PACKET_SIZE					2000#endif#define LOOP_RETRY_LIMIT					500000#define PERIODIC_TIMER_TOUT 				2000#define MAX_DEVICE_ID_LENGTH				50#define ACTIVE_MODE     1#define PS_MODE                 2#ifndef RFMD_3COM#define SPS_MODE                3#endif#define MIN_BEACON_PROBE_BYTES				60#define TX_TIMEOUT_JIFFIES      (5*HZ)#define MAX_TX_POWER_LEVEL                                       200#define MIN_MWATTS_TX_POWER                                      5#define MAX_MWATTS_TX_POWER                                      100///////////////////////////////////////////////////////////////////////////// 802.11 related definitions/////////////////////////////////////////////////////////////////////////////// Regulatory Domains//#define REG_DOMAIN_FCC		0x10	//Channels	1-11	USA#define REG_DOMAIN_DOC		0x20	//Channel	1-11	Canada#define REG_DOMAIN_ETSI		0x30	//Channel	1-13	Europe (ex Spain/France)#define REG_DOMAIN_SPAIN	0x31	//Channel	10-11	Spain#define REG_DOMAIN_FRANCE	0x32	//Channel	10-13	France#define REG_DOMAIN_MKK		0x40	//Channel	14		Japan#define REG_DOMAIN_MKK1		0x41	//Channel	1-14	Japan(MKK1)//#define REG_DOMAIN_ISRAEL	0x50	//Channel	3-9	ISRAEL#define REG_DOMAIN_ISRAEL1	0x50	//Channel	3-9		Israel1#define REG_DOMAIN_ISRAEL2	0x51	//Channel	3-7		Israel1#define REG_DOMAIN_ISRAEL3	0x52	//Channel	4-8		Israel1#define REG_DOMAIN_ISRAEL4	0x53	//Channel	5-7		Israel1#define AD_HOC_MODE 						0#define INFRASTRUCTURE_MODE 				1#define AUTO_MODE							2#define BSS_TYPE_AD_HOC 					1#define BSS_TYPE_INFRASTRUCTURE 			2#define SCAN_TYPE_ACTIVE					0#define SCAN_TYPE_PASSIVE					1#define PREAMBLE_TYPE_LONG					0#define PREAMBLE_TYPE_SHORT						1#define AUTO_PREAMBLE						2#define AUTO_SWITCH_AUTH_ALGORITHM			2// WEP key values#define WEP_DISABLED                    0#define WEP_64BIT                               1#define WEP_128BIT                              2#define WEP_MODE_OPTIONAL					0#define WEP_MODE_MANDATORY					1#define LISTEN_INTERVAL 					200#define DATA_FRAME_WS_HEADER_SIZE			30#define CTRL_FRAMES_TX_RATE 				1#define MGMT_FRAMES_TX_RATE 				1#define PROM_MODE_OFF						0x0#define PROM_MODE_UNKNOWN					0x1#define PROM_MODE_CRC_FAILED				0x2#define PROM_MODE_DUPLICATED				0x4#define PROM_MODE_MGMT						0x8#define PROM_MODE_CTRL						0x10#define PROM_MODE_BAD_PROTOCOL				0x20#define CARD_TYPE_PARALLEL_FLASH			0x1#define CARD_TYPE_SPI_FLASH 				0x2#define CARD_TYPE_EEPROM					0x3///////////////////////////////////////////////////////////////////////////// FLASH programming related definitions///////////////////////////////////////////////////////////////////////////#define BANK_SIZE							0x10000#define ATMEL_ID							0x1f#define ST_ID								0x20#define ST_M29W010B 						0x23 #define ATMEL_49LV002						0x07#define ATMEL_49LV002T						0x08#define ATMEL_49LV001						0x05#define ATMEL_49LV001T						0x04#define ATMEL_29LV512						0x3d#define ATMEL_29LV010						0x35#define ATMEL_29LV020						0xba#define ATMEL_29LV040						0xc4#define CIS_BYTES							1024#define HW_CONFIG_BYTES 					0x700#define HW_CONFIG_OFFSET					0x1C000///////////////////////////////////////////////////////////////////////////// type definitions/////////////////////////////////////////////////////////////////////////////IMPORTING STRUCTURES FROM BILL#define MAX_ASSOC_BUFF_LEN      255typedef struct __ASSOCIATION_INFO{UCHAR			CurrentBSSID[6];USHORT 			AssocCapabilities;UCHAR			LastBSSID[6];USHORT 			ListenInterval;UCHAR 			CurrentAddress[6];USHORT 			BeaconPeriod;UCHAR 			DesiredSSID[MAX_SSID_LENGTH];UCHAR			IPAddress[4];USHORT			CwMin;USHORT			CwMax;UCHAR 			PreambleType;UCHAR 			DesiredSSIDsize;UCHAR			AssociationRequestRetryCnt;UCHAR			ReAssociationRequestRetryCnt;USHORT			AssociationRespFrameBodyBytes;ASSOCIATION_METHOD	AssociationMethod;BSS_INFO_EX		CurrentBSSinfo;ULONG                                           LastAssReasReqBytes;UCHAR                                           LastAssReasReqFrameBody[1500];UCHAR                                           AssReassIEInfoBuffer[MAX_ASSOC_BUFF_LEN];USHORT                                           AssReassIEInfoBufferLength;} ASSOCIATION_INFO, *PASSOCIATION_INFO;typedef struct __AUTHENTICATION_INFO{USHORT			CurrentAuthentTransactionSeqNum;USHORT			ExpectedAuthentTransactionSeqNum;	UCHAR 			pChallengeText[254];UCHAR 			ChallengeTextLength;UCHAR			AuthenticationRequestRetryCnt;} AUTHENTICATION_INFO, *PAUTHENTICATION_INFO;#define MAX_PMKID_LIST_ENTRIES		16#define MAX_PKMID_INFO_ENTRIES  16#define MAX_PMKID_COUNT     4#define RSN_ELEMENT_GROUP_SUITE_OFFSET    2#define RSN_ELEMENT_PW_SUITE_OFFSET     6#define RSN_ELEMENT_PW_LIST_OFFSET      8#define MIN_RSN_ELEMENT_DATA_SIZE     2// PMKID Structurestypedef UCHAR   _802_11_PMKID_VALUE[16];typedef struct _BSSID_INFO{    MACADDR BSSID;    _802_11_PMKID_VALUE PMKID;}  BSSID_INFO, *PBSSID_INFO;typedef struct _802_11_PMKID_LIST{    ULONG Length;    ULONG BSSIDInfoCount;    BSSID_INFO BSSIDInfo[MAX_PMKID_LIST_ENTRIES];}  __802_11_PMKID_LIST, *P__802_11_PMKID_LIST;typedef struct _PMKID_CANDIDATE {    MACADDR BSSID;    ULONG Flags;}  PMKID_CANDIDATE, *PPMKID_CANDIDATE;typedef struct _PMKID_CANDIDATELIST{    ULONG Version;       // Version of the structure    ULONG NumCandidates; // No. of pmkid candidates    PMKID_CANDIDATE CandidateList[MAX_PKMID_INFO_ENTRIES];}  PMKID_CANDIDATELIST, *PPMKID_CANDIDATELIST;typedef enum _802_11_PRIVACY_FILTER{    _802_11PrivFilterAcceptAll,    _802_11PrivFilter8021xWEP} __802_11_PRIVACY_FILTER, *P__802_11_PRIVACY_FILTER;typedef struct __SECURITY_INFO{	__802_11_AUTHENTICATION_MODE 	AuthenticationMode;	__802_11_PRIVACY_FILTER			PrivacyFilter;__802_11_ENCRYPTION_STATUS		EncryptionStatus;	ENCRYPTION_INFO					EncryptionInfo;	BOOLEAN 						AutoSwitchAuthAlgorithm;	BOOLEAN							PairwiseKeyAvailable;	BOOLEAN							GroupKeyAvailable;	UCHAR							InWpaMode;	UCHAR							MicErrorCnt;	BOOLEAN							AllKeysRemoved;	BOOLEAN							WPA_MixedModeDisabled;	UCHAR							MicBlackListEntries;	MIC_BLACK_LIST					MicBlackList[MAX_BSS_ENTRIES];	unsigned long long				MicErrorDetected;#ifdef WPA2	__802_11_PMKID_LIST				PMKIDList;	PMKID_CANDIDATELIST				PMKIDCandidateList;	PMKID_CANDIDATELIST				PMKIDCandidateList2App;#endif#ifdef CCX	CCX_INFO								CCXinfo;#endif} SECURITY_INFO, *PSECURITY_INFO;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	IFACE/////////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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