Author: cgutman
Date: Wed Sep 24 20:02:08 2008
New Revision: 36500
URL:
http://svn.reactos.org/svn/reactos?rev=36500&view=rev
Log:
- Created a dummy nic driver for testing purposes
- Still a work in progress
Added:
branches/aicom-network-fixes/drivers/network/dd/dummynic/ (with props)
branches/aicom-network-fixes/drivers/network/dd/dummynic/debug.h (with props)
branches/aicom-network-fixes/drivers/network/dd/dummynic/dummynic.rbuild (with
props)
branches/aicom-network-fixes/drivers/network/dd/dummynic/main.c (with props)
Modified:
branches/aicom-network-fixes/drivers/network/dd/directory.rbuild
Modified: branches/aicom-network-fixes/drivers/network/dd/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/dd/directory.rbuild [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/dd/directory.rbuild [iso-8859-1] Wed Sep
24 20:02:08 2008
@@ -7,4 +7,7 @@
<directory name="pcnet">
<xi:include href="pcnet/pcnet.rbuild" />
</directory>
+ <directory name="dummynic">
+ <xi:include href="dummynic/dummynic.rbuild" />
+ </directory>
</group>
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Wed Sep 24 20:02:08 2008
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: branches/aicom-network-fixes/drivers/network/dd/dummynic/debug.h
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/dd/dummynic/debug.h (added)
+++ branches/aicom-network-fixes/drivers/network/dd/dummynic/debug.h [iso-8859-1] Wed Sep
24 20:02:08 2008
@@ -1,0 +1,22 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: Dummy NIC Driver
+ * FILE: debug.h
+ * PURPOSE: Debugging support macros
+ */
+#ifndef __DEBUG_H
+#define __DEBUG_H
+
+#ifdef DBG
+
+#define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql() == (x))
+
+#else /* DBG */
+
+#define ASSERT_IRQL_EQUAL(x)
+
+#endif /* DBG */
+
+#endif /* __DEBUG_H */
+
+/* EOF */
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/debug.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/aicom-network-fixes/drivers/network/dd/dummynic/dummynic.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/dd/dummynic/dummynic.rbuild (added)
+++ branches/aicom-network-fixes/drivers/network/dd/dummynic/dummynic.rbuild [iso-8859-1]
Wed Sep 24 20:02:08 2008
@@ -1,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
+<module name="dummynic" type="kernelmodedriver"
installbase="system32/drivers" installname="dummynic.sys">
+ <include base="dummynic">.</include>
+ <define name="NDIS50_MINIPORT" />
+ <define name="NDIS_MINIPORT_DRIVER" />
+ <define name="NDIS_LEGACY_MINIPORT" />
+ <define name="NDIS51_MINIPORT" />
+ <library>ndis</library>
+ <library>ntoskrnl</library>
+ <library>hal</library>
+ <file>main.c</file>
+</module>
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/dummynic.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/aicom-network-fixes/drivers/network/dd/dummynic/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/dd/dummynic/main.c (added)
+++ branches/aicom-network-fixes/drivers/network/dd/dummynic/main.c [iso-8859-1] Wed Sep
24 20:02:08 2008
@@ -1,0 +1,161 @@
+/*
+ * Dummy NIC Driver
+ *
+ * Copyright (C) 2008 Cameron Gutman <cgutman(a)reactos.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <ndis.h>
+
+#define NDEBUG
+#include <debug.h>
+#include "debug.h"
+
+static VOID
+STDCALL
+MiniportHandleInterrupt(
+ IN NDIS_HANDLE MiniportAdapterContext)
+{
+ DbgPrint("MiniportHandleInterrupt Called\n");
+
+ ASSERT(MiniportAdapterContext);
+ ASSERT_IRQL_EQUAL(DISPATCH_LEVEL);
+}
+
+
+
+static VOID
+STDCALL
+MiniportHalt(
+ IN NDIS_HANDLE MiniportAdapterContext)
+{
+ DbgPrint("MiniportHalt Called\n");
+ ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
+ ASSERT(MiniportAdapterContext);
+}
+
+static NDIS_STATUS
+STDCALL
+MiniportInitialize(
+ OUT PNDIS_STATUS OpenErrorStatus,
+ OUT PUINT SelectedMediumIndex,
+ IN PNDIS_MEDIUM MediumArray,
+ IN UINT MediumArraySize,
+ IN NDIS_HANDLE MiniportAdapterHandle,
+ IN NDIS_HANDLE WrapperConfigurationContext)
+{
+ UINT i = 0;
+ NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
+
+ DbgPrint("MiniportInitialize Called\n");
+
+ ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
+ ASSERT(MiniportAdapterHandle);
+ ASSERT(WrapperConfigurationContext);
+
+ for(i = 0; i < MediumArraySize; i++)
+ if(MediumArray[i] == NdisMedium802_3)
+ break;
+
+ if(i == MediumArraySize)
+ Status = NDIS_STATUS_UNSUPPORTED_MEDIA;
+ else
+ *SelectedMediumIndex = i;
+
+ *OpenErrorStatus = Status;
+
+ return Status;
+}
+
+static VOID
+STDCALL
+MiniportISR(
+ OUT PBOOLEAN InterruptRecognized,
+ OUT PBOOLEAN QueueMiniportHandleInterrupt,
+ IN NDIS_HANDLE MiniportAdapterContext)
+{
+ DbgPrint("MiniportISR Called\n");
+ ASSERT(MiniportAdapterContext);
+}
+
+static NDIS_STATUS
+STDCALL
+MiniportReset(
+ OUT PBOOLEAN AddressingReset,
+ IN NDIS_HANDLE MiniportAdapterContext)
+{
+ DbgPrint("MiniportReset Called\n");
+
+ ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
+ ASSERT(MiniportAdapterContext);
+
+ *AddressingReset = FALSE;
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+static NDIS_STATUS
+STDCALL
+MiniportSend(
+ IN NDIS_HANDLE MiniportAdapterContext,
+ IN PNDIS_PACKET Packet,
+ IN UINT Flags)
+{
+ DbgPrint("MiniportSend Called\n");
+
+ ASSERT(MiniportAdapterContext);
+ ASSERT_IRQL_EQUAL(DISPATCH_LEVEL);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+NTSTATUS
+STDCALL
+DriverEntry(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PUNICODE_STRING RegistryPath)
+{
+ NDIS_HANDLE WrapperHandle;
+ NDIS_MINIPORT_CHARACTERISTICS Characteristics;
+ NDIS_STATUS Status;
+
+ RtlZeroMemory(&Characteristics, sizeof(NDIS_MINIPORT_CHARACTERISTICS));
+ Characteristics.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION;
+ Characteristics.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION;
+ Characteristics.HaltHandler = MiniportHalt;
+ Characteristics.HandleInterruptHandler = MiniportHandleInterrupt;
+ Characteristics.InitializeHandler = MiniportInitialize;
+ Characteristics.ISRHandler = MiniportISR;
+ //Characteristics.QueryInformationHandler = MiniportQueryInformation;
+ Characteristics.ResetHandler = MiniportReset;
+ //Characteristics.SetInformationHandler = MiniportSetInformation;
+ Characteristics.SendHandler = MiniportSend;
+
+ NdisMInitializeWrapper(&WrapperHandle, DriverObject, RegistryPath, 0);
+
+ if (!WrapperHandle)
+ return NDIS_STATUS_FAILURE;
+
+ Status = NdisMRegisterMiniport(WrapperHandle, &Characteristics,
sizeof(NDIS_MINIPORT_CHARACTERISTICS));
+ if (Status != NDIS_STATUS_SUCCESS) {
+ NdisTerminateWrapper(WrapperHandle, 0);
+ return NDIS_STATUS_FAILURE;
+ }
+
+ return NDIS_STATUS_SUCCESS;
+}
+
Propchange: branches/aicom-network-fixes/drivers/network/dd/dummynic/main.c
------------------------------------------------------------------------------
svn:eol-style = native