?? lan91c111_ndis.c
字號:
/*
*
* Copyright (c) Standard MicroSystems Corporation. All Rights Reserved.
*
* LAN91C111 Driver for Windows CE .NET
*
* Revision History
*_______________________________________________________________________________
* Author Date Version Description
*_______________________________________________________________________________
* Pramod Bhardwaj 6/18/2002 0.1 Beta Release
* Pramod Bhardwaj 7/15/2002 1.0 Release
* Pramod Bhardwaj 1/22/2003 1.1 Removed some platform dependencies
* Pramod Bhardwaj 4/15/2003 2.0 Added support for alloc interrupt
*_______________________________________________________________________________
*
*Description:
* Contains the functions to be exported.
*
*
*/
#include <Ndis.h>
#include "LAN91C111_Adapter.h"
#include "LAN91C111_Proto.h"
DBGPARAM dpCurSettings = {
TEXT("LAN91C111"), {
TEXT("Init"),TEXT("Critical"),TEXT("Interrupt"),TEXT("Message"),
TEXT(""),TEXT(""),TEXT(""),TEXT(""),
TEXT(""),TEXT(""),TEXT(""),TEXT(""),
TEXT(""),TEXT(""),TEXT("Warnings"), TEXT("Errors")},
0x00000000
};
const NDIS_PHYSICAL_ADDRESS HighestAcceptedMax = NDIS_PHYSICAL_ADDRESS_CONST(-1,-1);
NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
NDIS_MINIPORT_CHARACTERISTICS Characteristics;
NDIS_HANDLE LAN91C111_WrapperHandle;
NDIS_STATUS Status=NDIS_STATUS_SUCCESS;
RETAILMSG(1, (TEXT("\tSMSC LAN91C111 WindowsCE.NET 4.1 (NDIS%d.%d) Driver V2.0 Build#%d\r\n"), DRIVER_NDIS_MAJOR_VERSION, DRIVER_NDIS_MINOR_VERSION, DRIVER_BUILD_NUM));
DEBUGMSG(1, (TEXT("\tSMSC LAN91C111 WindowsCE.NET 4.1 (NDIS%d.%d) Driver V2.0 Build#%d\r\n"), DRIVER_NDIS_MAJOR_VERSION, DRIVER_NDIS_MINOR_VERSION, DRIVER_BUILD_NUM));
//Initialize the Wrapper.
NdisMInitializeWrapper( &LAN91C111_WrapperHandle,
DriverObject,
RegistryPath,
NULL
);
//Set up our Characteristics, but clear it first
NdisZeroMemory((PVOID) &Characteristics, sizeof(Characteristics));
Characteristics.MajorNdisVersion = DRIVER_NDIS_MAJOR_VERSION;
Characteristics.MinorNdisVersion = DRIVER_NDIS_MINOR_VERSION;
Characteristics.CheckForHangHandler = LAN91C111_MiniportCheckforHang; //Optional
Characteristics.DisableInterruptHandler = LAN91C111_MiniportDisableInterrupt;
Characteristics.EnableInterruptHandler = LAN91C111_MiniportEnableInterrupt;
Characteristics.HaltHandler = LAN91C111_MiniportHalt; //Required
Characteristics.HandleInterruptHandler = LAN91C111_MiniPortHandleInterrupt; //Required
Characteristics.InitializeHandler = LAN91C111_MiniportInitialize; //Required
Characteristics.ISRHandler = LAN91C111_MiniportISR; //Required
Characteristics.QueryInformationHandler = LAN91C111_MiniportQueryInformation; //Required
Characteristics.ReconfigureHandler = NULL;
Characteristics.ResetHandler = LAN91C111_MiniportReset; //Required
Characteristics.SendHandler = LAN91C111_MiniportSend; //Required
Characteristics.SetInformationHandler = LAN91C111_MiniportSetInformation;
Characteristics.TransferDataHandler = NULL;
//Register as an NDIS MiniPort Driver.
Status = NdisMRegisterMiniport(LAN91C111_WrapperHandle,
(NDIS_MINIPORT_CHARACTERISTICS *) &Characteristics,
sizeof(NDIS51_MINIPORT_CHARACTERISTICS));
if(Status != NDIS_STATUS_SUCCESS)
{
NdisTerminateWrapper (LAN91C111_WrapperHandle, NULL);
PrintDebugMsg(ZONE_INIT, (TEXT("LAN91C111 : NdisMRegisterMiniport Failed (%04x) !!\r\n"), Status));
}
PrintDebugMsg(ZONE_INIT, (TEXT("LAN91C111 <= DriverEntry\r\n")));
return(Status);
}
BOOL __stdcall DllEntry (
HANDLE hDLL,
DWORD dwReason,
LPVOID lpReserved
)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DEBUGREGISTER(hDLL);
PrintDebugMsg(ZONE_INIT, (TEXT("LAN91C111 : DLL Process Attach\r\n")));
break;
case DLL_PROCESS_DETACH:
PrintDebugMsg(ZONE_INIT, (TEXT("LAN91C111 : DLL Process Detach\r\n")));
break;
}
return TRUE;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -