Author: fireball
Date: Sat Jan 29 13:07:06 2011
New Revision: 50551
URL:
http://svn.reactos.org/svn/reactos?rev=50551&view=rev
Log:
[TDI]
- Move CTE routines into corresponding events.c and timer.c source code files before
further applying Oleg's patches.
Added:
trunk/reactos/drivers/network/tdi/cte/events.c (with props)
trunk/reactos/drivers/network/tdi/cte/timer.c (with props)
Removed:
trunk/reactos/drivers/network/tdi/cte/stubs.c
Modified:
trunk/reactos/drivers/network/tdi/tdi.rbuild
Added: trunk/reactos/drivers/network/tdi/cte/events.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tdi/cte/ev…
==============================================================================
--- trunk/reactos/drivers/network/tdi/cte/events.c (added)
+++ trunk/reactos/drivers/network/tdi/cte/events.c [iso-8859-1] Sat Jan 29 13:07:06 2011
@@ -1,0 +1,157 @@
+/*
+ * PROJECT: ReactOS TDI driver
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: drivers/network/tdi/cte/events.c
+ * PURPOSE: CTE events support
+ * PROGRAMMERS: Oleg Baikalow (obaikalow(a)gmail.com)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ntddk.h>
+
+typedef struct _CTEBLOCK_EVENT
+{
+ NTSTATUS Status;
+ KEVENT Event;
+} CTEBLOCK_EVENT, *PCTEBLOCK_EVENT;
+
+struct _CTE_DELAYED_EVENT;
+typedef void (*CTE_WORKER_ROUTINE)(struct _CTE_DELAYED_EVENT *, void *Context);
+
+typedef struct _CTE_DELAYED_EVENT
+{
+ BOOLEAN Queued;
+ KSPIN_LOCK Lock;
+ CTE_WORKER_ROUTINE WorkerRoutine;
+ PVOID Context;
+ WORK_QUEUE_ITEM WorkItem;
+} CTE_DELAYED_EVENT, *PCTE_DELAYED_EVENT;
+
+/* FUNCTIONS *****************************************************************/
+
+/*
+ * @implemented
+ */
+NTSTATUS
+NTAPI
+CTEBlock(PCTEBLOCK_EVENT Block)
+{
+ NTSTATUS Status;
+
+ /* Perform the wait */
+ Status = KeWaitForSingleObject(&Block->Event, UserRequest, KernelMode, FALSE,
NULL);
+
+ /* Update event status if wait was not successful */
+ if (!NT_SUCCESS(Status)) Block->Status = Status;
+
+ return Block->Status;
+}
+
+
+VOID
+NTAPI
+InternalWorker(IN PVOID Parameter)
+{
+ PCTE_DELAYED_EVENT Event = (PCTE_DELAYED_EVENT)Parameter;
+ KIRQL OldIrql;
+
+ /* Acquire the lock */
+ KeAcquireSpinLock(&Event->Lock, &OldIrql);
+
+ /* Make sure it is queued */
+ ASSERT(Event->Queued);
+ Event->Queued = FALSE;
+
+ /* Release the lock */
+ KeReleaseSpinLock(&Event->Lock, OldIrql);
+
+ /* Call the real worker routine */
+ (*Event->WorkerRoutine)(Event, Event->Context);
+}
+
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+CTEInitEvent(PCTE_DELAYED_EVENT Event,
+ CTE_WORKER_ROUTINE Routine)
+{
+ /* Init the structure, lock and a work item */
+ Event->Queued = FALSE;
+ KeInitializeSpinLock(&Event->Lock);
+ Event->WorkerRoutine = Routine;
+ ExInitializeWorkItem(&Event->WorkItem, InternalWorker, Event);
+}
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+CTELogEvent (
+ ULONG Unknown0,
+ ULONG Unknown1,
+ ULONG Unknown2,
+ ULONG Unknown3,
+ ULONG Unknown4,
+ ULONG Unknown5,
+ ULONG Unknown6
+ )
+{
+ /* Probably call
+ * IoAllocateErrorLogEntry and
+ * IoWriteErrorLogEntry
+ */
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @implemented
+ */
+BOOLEAN
+NTAPI
+CTEScheduleEvent(PCTE_DELAYED_EVENT Event,
+ PVOID Context)
+{
+ KIRQL OldIrql;
+
+ /* Acquire the lock */
+ KeAcquireSpinLock(&Event->Lock, &OldIrql);
+
+ /* Make sure it is queued */
+ if (!Event->Queued);
+ {
+ /* Mark it as queued and set optional context pointer */
+ Event->Queued = TRUE;
+ Event->Context = Context;
+
+ /* Actually queue it */
+ ExQueueWorkItem(&Event->WorkItem, CriticalWorkQueue);
+ }
+
+ /* Release the lock */
+ KeReleaseSpinLock(&Event->Lock, OldIrql);
+
+ return TRUE;
+}
+
+
+/*
+ * @implemented
+ */
+LONG
+NTAPI
+CTESignal(PCTEBLOCK_EVENT Block, NTSTATUS Status)
+{
+ /* Set status right away */
+ Block->Status = Status;
+
+ /* Set the event */
+ return KeSetEvent(&Block->Event, IO_NO_INCREMENT, FALSE);
+}
+
+/* EOF */
Propchange: trunk/reactos/drivers/network/tdi/cte/events.c
------------------------------------------------------------------------------
svn:eol-style = native
Removed: trunk/reactos/drivers/network/tdi/cte/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tdi/cte/st…
==============================================================================
--- trunk/reactos/drivers/network/tdi/cte/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tdi/cte/stubs.c (removed)
@@ -1,215 +1,0 @@
-/*
- * PROJECT: ReactOS TDI driver
- * LICENSE: GPL - See COPYING in the top level directory
- * FILE: drivers/network/tdi/stubs.c
- * PURPOSE: TDI misc support routines
- * PROGRAMMERS: Oleg Baikalow (obaikalow(a)gmail.com)
- */
-
-/* INCLUDES *****************************************************************/
-
-#include <ntddk.h>
-
-
-typedef struct _CTEBLOCK_EVENT
-{
- NTSTATUS Status;
- KEVENT Event;
-} CTEBLOCK_EVENT, *PCTEBLOCK_EVENT;
-
-struct _CTE_DELAYED_EVENT;
-typedef void (*CTE_WORKER_ROUTINE)(struct _CTE_DELAYED_EVENT *, void *Context);
-
-typedef struct _CTE_DELAYED_EVENT
-{
- BOOLEAN Queued;
- KSPIN_LOCK Lock;
- CTE_WORKER_ROUTINE WorkerRoutine;
- PVOID Context;
- WORK_QUEUE_ITEM WorkItem;
-} CTE_DELAYED_EVENT, *PCTE_DELAYED_EVENT;
-
-
-/* FUNCTIONS *****************************************************************/
-
-/*
- * @implemented
- */
-NTSTATUS
-NTAPI
-CTEBlock(PCTEBLOCK_EVENT Block)
-{
- NTSTATUS Status;
-
- /* Perform the wait */
- Status = KeWaitForSingleObject(&Block->Event, UserRequest, KernelMode, FALSE,
NULL);
-
- /* Update event status if wait was not successful */
- if (!NT_SUCCESS(Status)) Block->Status = Status;
-
- return Block->Status;
-}
-
-
-VOID
-NTAPI
-InternalWorker(IN PVOID Parameter)
-{
- PCTE_DELAYED_EVENT Event = (PCTE_DELAYED_EVENT)Parameter;
- KIRQL OldIrql;
-
- /* Acquire the lock */
- KeAcquireSpinLock(&Event->Lock, &OldIrql);
-
- /* Make sure it is queued */
- ASSERT(Event->Queued);
- Event->Queued = FALSE;
-
- /* Release the lock */
- KeReleaseSpinLock(&Event->Lock, OldIrql);
-
- /* Call the real worker routine */
- (*Event->WorkerRoutine)(Event, Event->Context);
-}
-
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-CTEInitEvent(PCTE_DELAYED_EVENT Event,
- CTE_WORKER_ROUTINE Routine)
-{
- /* Init the structure, lock and a work item */
- Event->Queued = FALSE;
- KeInitializeSpinLock(&Event->Lock);
- Event->WorkerRoutine = Routine;
- ExInitializeWorkItem(&Event->WorkItem, InternalWorker, Event);
-}
-
-
-/*
- * @unimplemented
- */
-VOID
-NTAPI
-CTEInitTimer (
- ULONG Unknown0
- )
-{
-}
-
-
-/*
- * @unimplemented
- */
-BOOLEAN
-NTAPI
-CTEInitialize (
- VOID
- )
-{
- /* FIXME: what should it initialize? */
- return TRUE;
-}
-
-
-/*
- * @unimplemented
- */
-NTSTATUS
-NTAPI
-CTELogEvent (
- ULONG Unknown0,
- ULONG Unknown1,
- ULONG Unknown2,
- ULONG Unknown3,
- ULONG Unknown4,
- ULONG Unknown5,
- ULONG Unknown6
- )
-{
- /* Probably call
- * IoAllocateErrorLogEntry and
- * IoWriteErrorLogEntry
- */
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/*
- * @implemented
- */
-BOOLEAN
-NTAPI
-CTEScheduleEvent(PCTE_DELAYED_EVENT Event,
- PVOID Context)
-{
- KIRQL OldIrql;
-
- /* Acquire the lock */
- KeAcquireSpinLock(&Event->Lock, &OldIrql);
-
- /* Make sure it is queued */
- if (!Event->Queued);
- {
- /* Mark it as queued and set optional context pointer */
- Event->Queued = TRUE;
- Event->Context = Context;
-
- /* Actually queue it */
- ExQueueWorkItem(&Event->WorkItem, CriticalWorkQueue);
- }
-
- /* Release the lock */
- KeReleaseSpinLock(&Event->Lock, OldIrql);
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-LONG
-NTAPI
-CTESignal(PCTEBLOCK_EVENT Block, NTSTATUS Status)
-{
- /* Set status right away */
- Block->Status = Status;
-
- /* Set the event */
- return KeSetEvent(&Block->Event, IO_NO_INCREMENT, FALSE);
-}
-
-
-/*
- * @unimplemented
- */
-BOOLEAN
-NTAPI
-CTEStartTimer (
- ULONG Unknown0,
- ULONG Unknown1,
- ULONG Unknown2,
- ULONG Unknown3
- )
-{
- return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-ULONG
-NTAPI
-CTESystemUpTime (
- VOID
- )
-{
- return 0;
-}
-
-/* EOF */
Added: trunk/reactos/drivers/network/tdi/cte/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tdi/cte/ti…
==============================================================================
--- trunk/reactos/drivers/network/tdi/cte/timer.c (added)
+++ trunk/reactos/drivers/network/tdi/cte/timer.c [iso-8859-1] Sat Jan 29 13:07:06 2011
@@ -1,0 +1,66 @@
+/*
+ * PROJECT: ReactOS TDI driver
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: drivers/network/tdi/cte/timer.c
+ * PURPOSE: CTE timer support
+ * PROGRAMMERS: Oleg Baikalow (obaikalow(a)gmail.com)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ntddk.h>
+
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+CTEInitTimer (
+ ULONG Unknown0
+ )
+{
+}
+
+
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+CTEInitialize (
+ VOID
+ )
+{
+ /* FIXME: what should it initialize? */
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOLEAN
+NTAPI
+CTEStartTimer (
+ ULONG Unknown0,
+ ULONG Unknown1,
+ ULONG Unknown2,
+ ULONG Unknown3
+ )
+{
+ return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+ULONG
+NTAPI
+CTESystemUpTime (
+ VOID
+ )
+{
+ return 0;
+}
+
+/* EOF */
Propchange: trunk/reactos/drivers/network/tdi/cte/timer.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/drivers/network/tdi/tdi.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tdi/tdi.rb…
==============================================================================
--- trunk/reactos/drivers/network/tdi/tdi.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tdi/tdi.rbuild [iso-8859-1] Sat Jan 29 13:07:06 2011
@@ -6,8 +6,9 @@
<library>hal</library>
<define name="_TDI_" />
<directory name="cte">
+ <file>events.c</file>
<file>string.c</file>
- <file>stubs.c</file>
+ <file>timer.c</file>
</directory>
<directory name="misc">
<file>main.c</file>