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
19 /* See debug.h for debug/trace constants */
20 ULONG DebugTraceLevel
= MIN_TRACE
;
27 VOID NTAPI
MainUnload(
28 PDRIVER_OBJECT DriverObject
)
30 * FUNCTION: Unloads the driver
32 * DriverObject = Pointer to driver object created by the system
35 NDIS_DbgPrint(MAX_TRACE
, ("Leaving.\n"));
42 PDRIVER_OBJECT DriverObject
,
43 PUNICODE_STRING RegistryPath
)
45 * FUNCTION: Main driver entry point
47 * DriverObject = Pointer to a driver object for this driver
48 * RegistryPath = Registry node for configuration parameters
50 * Status of driver initialization
53 NDIS_DbgPrint(MAX_TRACE
, ("Called.\n"));
55 InitializeListHead(&ProtocolListHead
);
56 KeInitializeSpinLock(&ProtocolListLock
);
58 InitializeListHead(&MiniportListHead
);
59 KeInitializeSpinLock(&MiniportListLock
);
61 InitializeListHead(&AdapterListHead
);
62 KeInitializeSpinLock(&AdapterListLock
);
64 DriverObject
->DriverUnload
= MainUnload
;
68 return STATUS_SUCCESS
;
77 NdisWriteErrorLogEntry(
78 IN NDIS_HANDLE NdisAdapterHandle
,
79 IN NDIS_ERROR_CODE ErrorCode
,
80 IN ULONG NumberOfErrorValues
,
83 * FUNCTION: Write a syslog error
85 * NdisAdapterHandle: Handle passed into MiniportInitialize
86 * ErrorCode: 32-bit error code to be logged
87 * NumberOfErrorValues: number of errors to log
88 * Variable: list of log items
91 * - This needs to be fixed to do var args
92 * - FIXME - this needs to be properly implemented once we have an event log
95 NDIS_DbgPrint(MIN_TRACE
, ("ERROR: ErrorCode 0x%x\n", ErrorCode
));
105 NdisWriteEventLogEntry(
107 IN NDIS_STATUS EventCode
,
108 IN ULONG UniqueEventValue
,
109 IN USHORT NumStrings
,
110 IN PVOID StringsList OPTIONAL
,
112 IN PVOID Data OPTIONAL
)
114 * FUNCTION: Log an event in the system event log
116 * LogHandle: pointer to the driver object of the protocol logging the event
117 * EventCode: NDIS_STATUS_XXX describing the event
118 * UniqueEventValue: identifiees this instance of the error value
119 * NumStrings: number of strings in StringList
120 * StringList: list of strings to log
121 * DataSize: number of bytes in Data
122 * Data: binary dump data to help analyzing the event
124 * - NTAPI, not CDECL like WriteError...
125 * - FIXME Needs to use the real log interface, once there is one
129 * just returning true until we have an event log
131 NDIS_DbgPrint(MAX_TRACE
, ("Called.\n"));
132 return NDIS_STATUS_SUCCESS
;