2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
5 * PURPOSE: Driver entry point
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * Vizzini (vizzini@plasmic.com)
9 * CSH 01/08-2000 Created
10 * 20 Aug 2003 Vizzini - NDIS4/5 revisions
11 * 3 Oct 2003 Vizzini - formatting and minor bugfixing
18 /* See debug.h for debug/trace constants */
19 ULONG DebugTraceLevel
= MIN_TRACE
;
26 VOID NTAPI
MainUnload(
27 PDRIVER_OBJECT DriverObject
)
29 * FUNCTION: Unloads the driver
31 * DriverObject = Pointer to driver object created by the system
34 NDIS_DbgPrint(MAX_TRACE
, ("Leaving.\n"));
41 PDRIVER_OBJECT DriverObject
,
42 PUNICODE_STRING RegistryPath
)
44 * FUNCTION: Main driver entry point
46 * DriverObject = Pointer to a driver object for this driver
47 * RegistryPath = Registry node for configuration parameters
49 * Status of driver initialization
52 NDIS_DbgPrint(MAX_TRACE
, ("Called.\n"));
54 InitializeListHead(&ProtocolListHead
);
55 KeInitializeSpinLock(&ProtocolListLock
);
57 InitializeListHead(&MiniportListHead
);
58 KeInitializeSpinLock(&MiniportListLock
);
60 InitializeListHead(&AdapterListHead
);
61 KeInitializeSpinLock(&AdapterListLock
);
63 DriverObject
->DriverUnload
= MainUnload
;
67 return STATUS_SUCCESS
;
76 NdisWriteErrorLogEntry(
77 IN NDIS_HANDLE NdisAdapterHandle
,
78 IN NDIS_ERROR_CODE ErrorCode
,
79 IN ULONG NumberOfErrorValues
,
82 * FUNCTION: Write a syslog error
84 * NdisAdapterHandle: Handle passed into MiniportInitialize
85 * ErrorCode: 32-bit error code to be logged
86 * NumberOfErrorValues: number of errors to log
87 * Variable: list of log items
90 * - This needs to be fixed to do var args
91 * - FIXME - this needs to be properly implemented once we have an event log
94 NDIS_DbgPrint(MIN_TRACE
, ("ERROR: ErrorCode 0x%x\n", ErrorCode
));
104 NdisWriteEventLogEntry(
106 IN NDIS_STATUS EventCode
,
107 IN ULONG UniqueEventValue
,
108 IN USHORT NumStrings
,
109 IN PVOID StringsList OPTIONAL
,
111 IN PVOID Data OPTIONAL
)
113 * FUNCTION: Log an event in the system event log
115 * LogHandle: pointer to the driver object of the protocol logging the event
116 * EventCode: NDIS_STATUS_XXX describing the event
117 * UniqueEventValue: identifies this instance of the error value
118 * NumStrings: number of strings in StringList
119 * StringList: list of strings to log
120 * DataSize: number of bytes in Data
121 * Data: binary dump data to help analyzing the event
123 * - NTAPI, not CDECL like WriteError...
124 * - FIXME Needs to use the real log interface, once there is one
128 * just returning true until we have an event log
130 NDIS_DbgPrint(MAX_TRACE
, ("Called.\n"));
131 return NDIS_STATUS_SUCCESS
;