[NDIS]
[reactos.git] / reactos / drivers / network / ndis / ndis / main.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: ndis/main.c
5 * PURPOSE: Driver entry point
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * Vizzini (vizzini@plasmic.com)
8 * REVISIONS:
9 * CSH 01/08-2000 Created
10 * 20 Aug 2003 Vizzini - NDIS4/5 revisions
11 * 3 Oct 2003 Vizzini - formatting and minor bugfixing
12 */
13
14 #include "ndissys.h"
15
16
17 #if DBG
18
19 /* See debug.h for debug/trace constants */
20 ULONG DebugTraceLevel = MIN_TRACE;
21
22 #endif /* DBG */
23
24 LONG CancelId;
25
26 \f
27 VOID NTAPI MainUnload(
28 PDRIVER_OBJECT DriverObject)
29 /*
30 * FUNCTION: Unloads the driver
31 * ARGUMENTS:
32 * DriverObject = Pointer to driver object created by the system
33 */
34 {
35 NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
36 }
37
38 \f
39 NTSTATUS
40 NTAPI
41 DriverEntry(
42 PDRIVER_OBJECT DriverObject,
43 PUNICODE_STRING RegistryPath)
44 /*
45 * FUNCTION: Main driver entry point
46 * ARGUMENTS:
47 * DriverObject = Pointer to a driver object for this driver
48 * RegistryPath = Registry node for configuration parameters
49 * RETURNS:
50 * Status of driver initialization
51 */
52 {
53 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
54
55 InitializeListHead(&ProtocolListHead);
56 KeInitializeSpinLock(&ProtocolListLock);
57
58 InitializeListHead(&MiniportListHead);
59 KeInitializeSpinLock(&MiniportListLock);
60
61 InitializeListHead(&AdapterListHead);
62 KeInitializeSpinLock(&AdapterListLock);
63
64 DriverObject->DriverUnload = MainUnload;
65
66 CancelId = 0;
67
68 return STATUS_SUCCESS;
69 }
70
71 \f
72 /*
73 * @implemented
74 */
75 VOID
76 _cdecl
77 NdisWriteErrorLogEntry(
78 IN NDIS_HANDLE NdisAdapterHandle,
79 IN NDIS_ERROR_CODE ErrorCode,
80 IN ULONG NumberOfErrorValues,
81 ...)
82 /*
83 * FUNCTION: Write a syslog error
84 * ARGUMENTS:
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
89 * NOTES:
90 * - THIS IS >CDECL<
91 * - This needs to be fixed to do var args
92 * - FIXME - this needs to be properly implemented once we have an event log
93 */
94 {
95 NDIS_DbgPrint(MIN_TRACE, ("ERROR: ErrorCode 0x%x\n", ErrorCode));
96 /* ASSERT(0); */
97 }
98
99 \f
100 /*
101 * @implemented
102 */
103 NDIS_STATUS
104 EXPORT
105 NdisWriteEventLogEntry(
106 IN PVOID LogHandle,
107 IN NDIS_STATUS EventCode,
108 IN ULONG UniqueEventValue,
109 IN USHORT NumStrings,
110 IN PVOID StringsList OPTIONAL,
111 IN ULONG DataSize,
112 IN PVOID Data OPTIONAL)
113 /*
114 * FUNCTION: Log an event in the system event log
115 * ARGUMENTS:
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
123 * NOTES:
124 * - NTAPI, not CDECL like WriteError...
125 * - FIXME Needs to use the real log interface, once there is one
126 */
127 {
128 /*
129 * just returning true until we have an event log
130 */
131 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
132 return NDIS_STATUS_SUCCESS;
133 }
134
135 /* EOF */
136