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

📄 device.cpp

📁 atmel usb 无线网卡驱动程序
💻 CPP
字号:
/* Device.cpp *//*******************************************************************************************	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*******************************************************************************************/#include "Device.h"#include "DevConfig.h"#include "Decls.h"#include "WinterSetup.h"#ifdef OS_SOLARIS#include "Solaris.h"#endif // OS_SOLARIS#ifdef OS_LINUX#include "Linux.h"#endif // OS_LINUX// CVnetDeviceBase class implementation//======================================CVnetDeviceBase::CVnetDeviceBase( const wxString &devname ){	mDevName = devname;	mModel = new CWinterModel( );	isInit = false;}CVnetDeviceBase::~CVnetDeviceBase( ){	delete mModel;}void CVnetDeviceBase::AcquireLock( ){//	mCsIoctl.Enter();	return;}void CVnetDeviceBase::ReleaseLock( ){//	mCsIoctl.Leave( );	return;}CWinterModel *CVnetDeviceBase::GetModel( ){	return mModel;}bool CVnetDeviceBase::IsOk( ){	return false;}void CVnetDeviceBase::SetUFName( const wxString &ufname ){	mUFName = ufname;	return;}wxString CVnetDeviceBase::GetUFName( ){	return mUFName;}wxString CVnetDeviceBase::GetDevName( ){	return mDevName;}// Get Access Points listint CVnetDeviceBase::GetAPInfo( CBssInfoData dest[ MAX_BSS_ENTRIES ] ){	return -1;}bool CVnetDeviceBase::StartSiteSurvey( ){	return false;}bool CVnetDeviceBase::StopSiteSurvey( ){	return false;}// Site Survey Stateint CVnetDeviceBase::GetSiteSurveyState( ){	return -1;}bool CVnetDeviceBase::SelectAPByIndex( int index ){	return false;}bool CVnetDeviceBase::GetDeviceConfig( CDeviceConfigurationData *dest ){	return false;}bool CVnetDeviceBase::SetDeviceConfig( CDeviceConfigurationData *src ){	return false;}bool CVnetDeviceBase::GetStatistics( CStatisticsData *data ){	return false;}bool CVnetDeviceBase::GetMacAddress( CMacAddressData *data ){	return false;}// Get wep key informationbool CVnetDeviceBase::GetWepInfo( CWepInfoData *data ){	return false;}// Set custom wep key valuesbool CVnetDeviceBase::SetWepInfo( CWepInfoData *data ){	return false;}// Gets driver, firmware versions for driverbool CVnetDeviceBase::GetVersionInfo( CVersionInfoData *data ){	return false;}// resets card. We could also use DS_RESET_CARD defined in pcmcia/ds.h.bool CVnetDeviceBase::ResetCard( ){	return false;}// clears packetsbool CVnetDeviceBase::ClearPackets( ){	return false;}/*For GUI*/// Send Selected APbool CVnetDeviceBase::SendSelectedAP( ){	return false;}void CVnetDeviceBase::SetInit(){	isInit = true;}	bool CVnetDeviceBase::GetInit(){	return isInit;}	// CVnetDeviceManager class implementation//=========================================CVnetDeviceManager::CVnetDeviceManager( ){}CVnetDeviceManager::~CVnetDeviceManager( ){	CVnetDeviceBase *device;	while( mDevices.GetCount( ) != 0 )	{		device = mDevices[ 0 ];		delete device;		mDevices.Remove( device );	}}bool CVnetDeviceManager::Detect( ){#if 0	// for now I will assume that there is only	// /dev/vnet0 and I will open it.	int fd = open( "/dev/vnet0", O_RDWR, 0);	if( fd <= 0 )	{		return false;	}	mDevices.Add( new CVnetDeviceSolaris( fd ) );#endif	return true;}bool CVnetDeviceManager::AddDevice( CVnetDeviceBase *device ){	if( device->IsOk( ) )	{		mDevices.Add( device );		return true;	}	return false;}bool CVnetDeviceManager::RemoveDevice( CVnetDeviceBase *device ){		mDevices.Remove( device );		return true;}int CVnetDeviceManager::GetDeviceCount( ){	return mDevices.GetCount( );}CVnetDeviceBase *CVnetDeviceManager::GetDevice( int index ){	return mDevices[ index ];}// CVnetDeviceManagerSingleton class implementation//==================================================CVnetDeviceManager *CVnetDeviceManagerSingleton::mManager = NULL;CVnetDeviceManagerSingleton::CVnetDeviceManagerSingleton( ){}CVnetDeviceManagerSingleton::~CVnetDeviceManagerSingleton( ){}CVnetDeviceManager *CVnetDeviceManagerSingleton::Get( ){	if( mManager == NULL )	{#ifdef OS_SOLARIS		mManager = new CVnetDeviceManagerSolaris( );#endif // OS_SOLARIS#ifdef OS_LINUX		mManager = new CVnetDeviceManagerLinux( );#endif // OS_LINUX#ifdef OS_VIRTUAL		mManager = new CVnetDeviceManager( );#endif // OS_VIRTUAL	}	return mManager;}

⌨️ 快捷键说明

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