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
20 /* See debug.h for debug/trace constants */
21 DWORD DebugTraceLevel
= /*MIN_TRACE*/DEBUG_ULTRA
;
26 VOID STDCALL
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
;
66 * until we have PNP support, query the enum key and NdisFindDevice() each one
67 * NOTE- this will load and start other services before this one returns STATUS_SUCCESS.
68 * I hope there aren't code reentrancy problems. :)
72 return STATUS_SUCCESS
;
81 NdisWriteErrorLogEntry(
82 IN NDIS_HANDLE NdisAdapterHandle
,
83 IN NDIS_ERROR_CODE ErrorCode
,
84 IN ULONG NumberOfErrorValues
,
87 * FUNCTION: Write a syslog error
89 * NdisAdapterHandle: Handle passed into MiniportInitialize
90 * ErrorCode: 32-bit error code to be logged
91 * NumberOfErrorValues: number of errors to log
92 * Variable: list of log items
95 * - This needs to be fixed to do var args
96 * - FIXME - this needs to be properly implemented once we have an event log
99 NDIS_DbgPrint(MIN_TRACE
, ("ERROR: ErrorCode 0x%x\n", ErrorCode
));
109 NdisInitializeReadWriteLock(
110 IN PNDIS_RW_LOCK Lock
)
112 * FUNCTION: Initialize a NDIS_RW_LOCK
114 * Lock: pointer to the lock to initialize
119 memset(Lock
,0,sizeof(NDIS_RW_LOCK
));
128 NdisWriteEventLogEntry(
130 IN NDIS_STATUS EventCode
,
131 IN ULONG UniqueEventValue
,
132 IN USHORT NumStrings
,
133 IN PVOID StringsList OPTIONAL
,
135 IN PVOID Data OPTIONAL
)
137 * FUNCTION: Log an event in the system event log
139 * LogHandle: pointer to the driver object of the protocol logging the event
140 * EventCode: NDIS_STATUS_XXX describing the event
141 * UniqueEventValue: identifiees this instance of the error value
142 * NumStrings: number of strings in StringList
143 * StringList: list of strings to log
144 * DataSize: number of bytes in Data
145 * Data: binary dump data to help analyzing the event
147 * - STDCALL, not CDECL like WriteError...
148 * - FIXME Needs to use the real log interface, once there is one
152 * just returning true until we have an event log
154 NDIS_DbgPrint(MAX_TRACE
, ("Called.\n"));
155 return NDIS_STATUS_SUCCESS
;