Initial revision
authorCasper Hornstrup <chorns@users.sourceforge.net>
Tue, 1 Aug 2000 18:43:15 +0000 (18:43 +0000)
committerCasper Hornstrup <chorns@users.sourceforge.net>
Tue, 1 Aug 2000 18:43:15 +0000 (18:43 +0000)
svn path=/trunk/; revision=1277

30 files changed:
reactos/drivers/net/ndis/DIRS [new file with mode: 0644]
reactos/drivers/net/ndis/include/buffer.h [new file with mode: 0644]
reactos/drivers/net/ndis/include/debug.h [new file with mode: 0644]
reactos/drivers/net/ndis/include/miniport.h [new file with mode: 0644]
reactos/drivers/net/ndis/include/ndissys.h [new file with mode: 0644]
reactos/drivers/net/ndis/include/protocol.h [new file with mode: 0644]
reactos/drivers/net/ndis/makefile_rex [new file with mode: 0644]
reactos/drivers/net/ndis/ndis.def [new file with mode: 0644]
reactos/drivers/net/ndis/ndis.edf [new file with mode: 0644]
reactos/drivers/net/ndis/ndis.rc [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/40gone.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/50gone.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/MAKEFILE [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/NDIS.DEF [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/RESOURCE.RC [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/SOURCES [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/buffer.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/cl.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/cm.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/co.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/control.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/hardware.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/io.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/main.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/memory.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/miniport.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/protocol.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/string.c [new file with mode: 0644]
reactos/drivers/net/ndis/ndis/time.c [new file with mode: 0644]
reactos/drivers/net/ndis/readme.txt [new file with mode: 0644]

diff --git a/reactos/drivers/net/ndis/DIRS b/reactos/drivers/net/ndis/DIRS
new file mode 100644 (file)
index 0000000..f8cacae
--- /dev/null
@@ -0,0 +1 @@
+DIRS= ndis
diff --git a/reactos/drivers/net/ndis/include/buffer.h b/reactos/drivers/net/ndis/include/buffer.h
new file mode 100644 (file)
index 0000000..eaa2a1e
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        include/buffer.h
+ * PURPOSE:     Buffer management routine definitions
+ */
+#ifndef __BUFFER_H
+#define __BUFFER_H
+
+#include <ndissys.h>
+
+
+/* FIXME: Possibly move this to ntddk.h */
+typedef struct _NETWORK_HEADER
+{
+    MDL Mdl;                                /* Memory Descriptor List */
+    struct _NETWORK_HEADER *Next;           /* Link to next NDIS buffer in pool */
+    struct _NDIS_BUFFER_POOL *BufferPool;   /* Link to NDIS buffer pool */
+} NETWORK_HEADER, *PNETWORK_HEADER;
+
+typedef struct _NDIS_BUFFER_POOL
+{
+    KSPIN_LOCK SpinLock;
+    PNETWORK_HEADER FreeList;
+    NETWORK_HEADER Buffers[0];
+} NDIS_BUFFER_POOL, *PNDIS_BUFFER_POOL;
+
+#endif /* __BUFFER_H */
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/include/debug.h b/reactos/drivers/net/ndis/include/debug.h
new file mode 100644 (file)
index 0000000..35c0aef
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        include/debug.h
+ * PURPOSE:     Debugging support macros
+ * DEFINES:     DBG     - Enable debug output
+ *              NASSERT - Disable assertions
+ */
+#ifndef __DEBUG_H
+#define __DEBUG_H
+
+#define NORMAL_MASK    0x000000FF
+#define SPECIAL_MASK   0xFFFFFF00
+#define MIN_TRACE      0x00000001
+#define MID_TRACE      0x00000002
+#define MAX_TRACE      0x00000003
+
+#define DEBUG_REFCOUNT 0x00000100
+#define DEBUG_MINIPORT 0x00000200
+#define DEBUG_PROTOCOL 0x00000400
+#define DEBUG_ULTRA    0xFFFFFFFF
+
+#ifdef DBG
+
+extern DWORD DebugTraceLevel;
+
+#ifdef _MSC_VER
+
+#define NDIS_DbgPrint(_t_, _x_) \
+    if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
+        ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
+        DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
+        DbgPrint _x_ ; \
+    }
+
+#else /* _MSC_VER */
+
+#define NDIS_DbgPrint(_t_, _x_) \
+    if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
+        ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
+        DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
+        DbgPrint _x_ ; \
+    }
+
+#endif /* _MSC_VER */
+
+
+#ifdef ASSERT
+#undef ASSERT
+#endif
+
+#ifdef NASSERT
+#define ASSERT(x)
+#else /* NASSERT */
+#define ASSERT(x) if (!(x)) { NDIS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
+#endif /* NASSERT */
+
+#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
+
+#else /* DBG */
+
+#define NDIS_DbgPrint(_t_, _x_)
+
+#define ASSERT_IRQL(x)
+#define ASSERT(x)
+
+#endif /* DBG */
+
+
+#define assert(x) ASSERT(x)
+#define assert_irql(x) ASSERT_IRQL(x)
+
+
+#ifdef _MSC_VER
+
+#define UNIMPLEMENTED \
+    NDIS_DbgPrint(MIN_TRACE, ("The function at %s:%d is unimplemented.\n", __FILE__, __LINE__));
+
+#else /* _MSC_VER */
+
+#define UNIMPLEMENTED \
+    NDIS_DbgPrint(MIN_TRACE, ("(%s) at (%s:%d) is unimplemented.\n", __FUNCTION__, __FILE__, __LINE__));
+
+#endif /* _MSC_VER */
+
+
+#define CHECKPOINT \
+    do { NDIS_DbgPrint(MIN_TRACE, ("%s:%d\n", __FILE__, __LINE__)); } while(0);
+
+#endif /* __DEBUG_H */
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/include/miniport.h b/reactos/drivers/net/ndis/include/miniport.h
new file mode 100644 (file)
index 0000000..27ce3f6
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/miniport.h
+ * PURPOSE:     Definitions for routines used by NDIS miniport drivers
+ */
+
+#ifndef __MINIPORT_H
+#define __MINIPORT_H
+
+#include <ndissys.h>
+
+
+/* Information about a miniport */
+typedef struct _MINIPORT_DRIVER {
+    LIST_ENTRY                      ListEntry;          /* Entry on global list */
+    KSPIN_LOCK                      Lock;               /* Protecting spin lock */
+    ULONG                           RefCount;           /* Reference count */
+    NDIS_MINIPORT_CHARACTERISTICS   Chars;              /* Miniport characteristics */
+    WORK_QUEUE_ITEM                 WorkItem;           /* Work item */
+    PDRIVER_OBJECT                  DriverObject;       /* Driver object of miniport */
+    NDIS_STRING                     RegistryPath;       /* Registry path of miniport */
+    LIST_ENTRY                      AdapterListHead;    /* Adapters created by miniport */
+} MINIPORT_DRIVER, *PMINIPORT_DRIVER;
+
+#define GET_MINIPORT_DRIVER(Handle)((PMINIPORT_DRIVER)Handle)
+
+/* Information about a logical adapter */
+typedef struct _LOGICAL_ADAPTER {
+    LIST_ENTRY                  ListEntry;              /* Entry on global list */
+    LIST_ENTRY                  MiniportListEntry;      /* Entry on miniport driver list */
+    KSPIN_LOCK                  Lock;                   /* Protecting spin lock */
+    ULONG                       RefCount;               /* Reference count */
+    PMINIPORT_DRIVER            Miniport;               /* Miniport owning this adapter */
+    UNICODE_STRING              DeviceName;             /* Device name of this adapter */
+    PDEVICE_OBJECT              DeviceObject;           /* Device object of adapter */
+    PVOID                       MiniportAdapterContext; /* Adapter context for miniport */
+    ULONG                       Attributes;             /* Attributes of adapter */
+    NDIS_INTERFACE_TYPE         AdapterType;            /* Type of adapter interface */
+    /* TRUE if the miniport has called NdisSetAttributes(Ex) for this adapter */
+    BOOLEAN                     AttributesSet;
+    PNDIS_MINIPORT_INTERRUPT    InterruptObject;        /* Interrupt object for adapter */
+    PVOID                       QueryBuffer;            /* Buffer to use for queries */
+    ULONG                       QueryBufferLength;      /* Length of QueryBuffer */
+} LOGICAL_ADAPTER, *PLOGICAL_ADAPTER;
+
+#define GET_LOGICAL_ADAPTER(Handle)((PLOGICAL_ADAPTER)Handle)
+
+
+extern LIST_ENTRY MiniportListHead;
+extern KSPIN_LOCK MiniportListLock;
+extern LIST_ENTRY AdapterListHead;
+extern KSPIN_LOCK AdapterListLock;
+
+PLOGICAL_ADAPTER MiniLocateDevice(
+    PNDIS_STRING AdapterName);
+
+NDIS_STATUS MiniQueryInformation(
+    PLOGICAL_ADAPTER    Adapter,
+    NDIS_OID            Oid,
+    ULONG               Size,
+    PULONG              BytesWritten);
+
+#endif /* __MINIPORT_H */
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/include/ndissys.h b/reactos/drivers/net/ndis/include/ndissys.h
new file mode 100644 (file)
index 0000000..bed6df7
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndissys.h
+ * PURPOSE:     NDIS library definitions
+ * NOTES:       Spin lock acquire order:
+ *                - Miniport list lock
+ *                - Adapter list lock
+ */
+#ifndef __NDISSYS_H
+#define __NDISSYS_H
+
+#define NDIS50 1    /* Use NDIS 5.0 structures by default */
+
+#ifdef _MSC_VER
+#include <basetsd.h>
+#include <ntddk.h>
+#include <windef.h>
+#include <ndis.h>
+#else /* _MSC_VER */
+#include <ddk/ntddk.h>
+#include <net/ndis.h>
+#endif /* _MSC_VER */
+
+#include <debug.h>
+
+
+#ifndef _MSC_VER
+/* FIXME: The following should be moved to ntddk.h */
+
+/* i386 specific constants */
+
+/* Page size for the Intel 386 is 4096 */
+#define PAGE_SIZE (ULONG)0x1000
+
+/* 4096 is 2^12. Used to find the virtual page number from a virtual address */
+#define PAGE_SHIFT 12L
+
+/*
+ * ULONG ADDRESS_AND_SIZE_TO_SPAN_PAGES(
+ *     IN  PVOID   Va,
+ *     IN  ULONG   Size);
+ */
+#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va, Size)            \
+    ((((ULONG)((ULONG)(Size) - 1) >> PAGE_SHIFT) +          \
+    (((((ULONG)(Size - 1) & (PAGE_SIZE - 1)) +              \
+    ((ULONG)Va & (PAGE_SIZE - 1)))) >> PAGE_SHIFT)) + 1)
+
+/*
+ * ULONG MmGetMdlByteCount(
+ *     IN  PMDL    Mdl)
+ */
+#define MmGetMdlByteCount(Mdl)  \
+    ((Mdl)->ByteCount)
+
+#endif
+
+
+/* Exported functions */
+#ifdef _MSC_VER
+#define EXPORT __declspec(dllexport)
+#else
+#define EXPORT STDCALL
+#endif
+
+
+#ifdef DBG
+
+#define DEBUG_REFCHECK(Object) {            \
+    if ((Object)->RefCount <= 0) {          \
+        NDIS_DbgPrint(MIN_TRACE, ("Object at (0x%X) has invalid reference count (%d).\n", \
+            (Object), (Object)->RefCount)); \
+        }                                   \
+}
+
+#else
+
+#define DEBUG_REFCHECK(Object)
+
+#endif
+
+
+/*
+ * VOID ReferenceObject(
+ *     PVOID Object)
+ */
+#define ReferenceObject(Object)                  \
+{                                                \
+    DEBUG_REFCHECK(Object);                      \
+    NDIS_DbgPrint(DEBUG_REFCOUNT, ("Referencing object at (0x%X). RefCount (%d).\n", \
+        (Object), (Object)->RefCount));          \
+                                                 \
+    InterlockedIncrement(&((Object)->RefCount)); \
+}
+
+/*
+ * VOID DereferenceObject(
+ *     PVOID Object)
+ */
+#define DereferenceObject(Object)                         \
+{                                                         \
+    DEBUG_REFCHECK(Object);                               \
+    NDIS_DbgPrint(DEBUG_REFCOUNT, ("Dereferencing object at (0x%X). RefCount (%d).\n", \
+        (Object), (Object)->RefCount));                   \
+                                                          \
+    if (InterlockedDecrement(&((Object)->RefCount)) == 0) \
+        PoolFreeBuffer(Object);                           \
+}
+
+#endif /* __NDISSYS_H */
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/include/protocol.h b/reactos/drivers/net/ndis/include/protocol.h
new file mode 100644 (file)
index 0000000..ba4c025
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/protocol.h
+ * PURPOSE:     Definitions for routines used by NDIS protocol drivers
+ */
+
+#ifndef __PROTOCOL_H
+#define __PROTOCOL_H
+
+#include <ndissys.h>
+#include <miniport.h>
+
+
+typedef struct _PROTOCOL_BINDING {
+    LIST_ENTRY                    ListEntry;        /* Entry on global list */
+    KSPIN_LOCK                    Lock;             /* Protecting spin lock */
+    ULONG                         RefCount;         /* Reference count */
+    NDIS_PROTOCOL_CHARACTERISTICS Chars;            /* Characteristics */
+    WORK_QUEUE_ITEM               WorkItem;         /* Work item */
+    LIST_ENTRY                    AdapterListHead;  /* List of adapter bindings */
+} PROTOCOL_BINDING, *PPROTOCOL_BINDING;
+
+#define GET_PROTOCOL_BINDING(Handle)((PPROTOCOL_BINDING)Handle)
+
+
+typedef struct _ADAPTER_BINDING {
+    LIST_ENTRY       ListEntry;         /* Entry on global list */
+    LIST_ENTRY       ProtocolListEntry; /* Entry on protocol binding adapter list */
+    KSPIN_LOCK       Lock;              /* Protecting spin lock */
+    ULONG            RefCount;          /* Reference count */
+    PLOGICAL_ADAPTER Adapter;           /* Adapter opened by protocol */
+} ADAPTER_BINDING, *PADAPTER_BINDING;
+
+#define GET_ADAPTER_BINDING(Handle)((PADAPTER_BINDING)Handle)
+
+
+extern LIST_ENTRY ProtocolListHead;
+extern KSPIN_LOCK ProtocolListLock;
+
+#endif /* __PROTOCOL_H */
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/makefile_rex b/reactos/drivers/net/ndis/makefile_rex
new file mode 100644 (file)
index 0000000..a731195
--- /dev/null
@@ -0,0 +1,93 @@
+# NDIS.SYS - NDIS library
+
+TARGETNAME=ndis
+
+BASE_CFLAGS = -I./include -I../../../include -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1
+
+RESOURCE_OBJECT = $(TARGETNAME).coff
+NDIS_OBJECTS    = ndis/main.o ndis/40gone.o ndis/50gone.o ndis/buffer.o ndis/cl.o \
+                  ndis/cm.o ndis/co.o ndis/control.o ndis/hardware.o \
+                  ndis/io.o ndis/memory.o ndis/miniport.o \
+                                 ndis/protocol.o ndis/string.o ndis/stubs.o ndis/time.o
+
+all: objects $(TARGETNAME).sys
+
+objects:
+       mkdir objects
+
+$(TARGETNAME).coff: $(TARGETNAME).rc ../../../include/reactos/resource.h
+
+OBJECTS = $(NDIS_OBJECTS) $(RESOURCE_OBJECT) ../../../ntoskrnl/ntoskrnl.a
+
+
+ifeq ($(DOSCLI),yes)
+CLEAN_FILES = *.o objects\*.o ndis\*.o $(TARGETNAME).coff $(TARGETNAME).o $(TARGETNAME).a \
+              junk.tmp base.tmp temp.exp $(TARGETNAME).sys $(TARGETNAME).sym
+else
+CLEAN_FILES = *.o objects/*.o ndis/*.o $(TARGETNAME).coff $(TARGETNAME).o $(TARGETNAME).a \
+              junk.tmp base.tmp temp.exp $(TARGETNAME).sys $(TARGETNAME).sym
+endif
+
+$(TARGETNAME).sys: $(OBJECTS)
+       $(DLLTOOL) \
+               --dllname $(TARGETNAME).sys \
+               --def $(TARGETNAME).def \
+               --kill-at \
+               --output-lib $(TARGETNAME).a
+       $(CC) \
+               -mdll \
+               -specs=../../svc_specs \
+               -Wl,-e,_DriverEntry@8 \
+               -Wl,--base-file,base.tmp \
+               -Wl,--defsym,_end=end  \
+               -Wl,--defsym,_edata=__data_end__ \
+               -Wl,--defsym,_etext=etext \
+        $(OBJECTS) \
+        -o junk.tmp
+       - $(RM) junk.tmp
+       $(DLLTOOL) \
+        --dllname $(TARGETNAME).sys \
+        --base-file base.tmp \
+        --output-exp temp.exp \
+        --def $(TARGETNAME).edf
+       - $(RM) base.tmp
+       $(CC) \
+               -mdll \
+               -specs=../../svc_specs \
+               -Wl,--image-base,0x10000 \
+               -Wl,-e,_DriverEntry@8 \
+               -Wl,temp.exp \
+        $(OBJECTS) \
+        -o $(TARGETNAME).sys
+       - $(RM) temp.exp
+       $(NM) --numeric-sort $(TARGETNAME).sys > $(TARGETNAME).sym
+
+clean: $(CLEAN_FILES:%=%_clean)
+
+$(CLEAN_FILES:%=%_clean): %_clean:
+       - $(RM) $*
+
+.PHONY: clean $(CLEAN_FILES:%=%_clean)
+
+floppy: $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
+
+$(FLOPPY_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
+ifeq ($(DOSCLI),yes)
+       $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)\drivers\$(TARGETNAME).sys
+else
+       $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
+endif
+
+dist: $(DIST_DIR)/drivers/$(TARGETNAME).sys
+
+$(DIST_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
+ifeq ($(DOSCLI),yes)
+       $(CP) $(TARGETNAME).sys ..\..\$(DIST_DIR)\drivers\$(TARGETNAME).sys
+else
+       $(CP) $(TARGETNAME).sys ../../$(DIST_DIR)/drivers/$(TARGETNAME).sys
+endif
+
+#WITH_DEBUGGING      = yes
+#WIN32_LEAN_AND_MEAN = yes
+#WARNINGS_ARE_ERRORS = yes
+include ../../../rules.mak
diff --git a/reactos/drivers/net/ndis/ndis.def b/reactos/drivers/net/ndis/ndis.def
new file mode 100644 (file)
index 0000000..89e628c
--- /dev/null
@@ -0,0 +1,314 @@
+; NDIS Kernel Module - ReactOS Operating System
+
+LIBRARY NDIS.SYS
+
+EXPORTS
+ArcFilterDprIndicateReceive@16
+ArcFilterDprIndicateReceiveComplete@4
+EthChangeFilterAddresses@24
+EthCreateFilter@28
+EthDeleteFilter@4
+EthDeleteFilterOpenAdapter@12
+EthFilterAdjust@20
+;EthFilterDprIndicateReceive@32 ?
+;EthFilterDprIndicateReceiveComplete@4 ?
+EthFilterIndicateReceive@32
+EthFilterIndicateReceiveComplete@4
+EthNoteFilterOpenAdapter@16
+EthNumberOfOpenFilterAddresses@8
+EthQueryGlobalFilterAddresses@20
+EthQueryOpenFilterAddresses@24
+EthShouldAddressLoopBack@8
+FddiChangeFilterLongAddresses@24
+FddiChangeFilterShortAddresses@24
+FddiCreateFilter@36
+FddiDeleteFilter@4
+FddiDeleteFilterOpenAdapter@12
+FddiFilterAdjust@20
+;FddiFilterDprIndicateReceive@36 ?
+;FddiFilterDprIndicateReceiveComplete@4 ?
+FddiFilterIndicateReceive@36
+FddiFilterIndicateReceiveComplete@4
+FddiNoteFilterOpenAdapter@16
+FddiNumberOfOpenFilterLongAddresses@8
+FddiNumberOfOpenFilterShortAddresses@8
+FddiQueryGlobalFilterLongAddresses@20
+FddiQueryGlobalFilterShortAddresses@20
+FddiQueryOpenFilterLongAddresses@24
+FddiQueryOpenFilterShortAddresses@24
+FddiShouldAddressLoopBack@12
+NDIS_BUFFER_TO_SPAN_PAGES@4
+NdisAcquireReadWriteLock@12
+NdisAcquireSpinLock@4
+NdisAdjustBufferLength@8
+NdisAllocateBuffer@20
+NdisAllocateBufferPool@12
+NdisAllocateDmaChannel@20
+NdisAllocateMemory@20
+NdisAllocateMemoryWithTag@12
+NdisAllocatePacket@12
+NdisAllocatePacketPool@16
+NdisAllocatePacketPoolEx@20
+NdisAllocateSharedMemory@20
+NdisAllocateSpinLock@4
+NdisAnsiStringToUnicodeString@8
+NdisBufferLength@4
+NdisBufferVirtualAddress@4
+NdisCancelTimer@8
+NdisClAddParty@16
+NdisClCloseAddressFamily@4
+NdisClCloseCall@16
+NdisClDeregisterSap@4
+NdisClDropParty@12
+NdisClIncomingCallComplete@12
+NdisClMakeCall@16
+NdisClModifyCallQoS@8
+NdisClOpenAddressFamily@24
+NdisClRegisterSap@16
+NdisCloseAdapter@8
+NdisCloseConfiguration@4
+NdisCloseFile@4
+NdisCmActivateVc@8
+NdisCmAddPartyComplete@16
+NdisCmCloseAddressFamilyComplete@8
+NdisCmCloseCallComplete@12
+NdisCmDeactivateVc@4
+NdisCmDeregisterSapComplete@8
+NdisCmDispatchCallConnected@4
+NdisCmDispatchIncomingCall@12
+NdisCmDispatchIncomingCallQoSChange@8
+NdisCmDispatchIncomingCloseCall@16
+NdisCmDispatchIncomingDropParty@16
+NdisCmDropPartyComplete@8
+NdisCmMakeCallComplete@20
+NdisCmModifyCallQoSComplete@12
+NdisCmOpenAddressFamilyComplete@12
+NdisCmRegisterAddressFamily@16
+NdisCmRegisterSapComplete@12
+NdisCoCreateVc@16
+NdisCoDeleteVc@4
+NdisCoRequest@20
+NdisCoRequestComplete@20
+NdisCoSendPackets@12
+;NdisCompareAnsiString ?
+;NdisCompareUnicodeString ?
+NdisCompleteBindAdapter@12
+NdisCompleteCloseAdapter@8
+NdisCompleteDmaTransfer@24
+NdisCompleteOpenAdapter@12
+NdisCompletePnPEvent@12
+NdisCompleteQueryStatistics@12
+NdisCompleteUnbindAdapter@8
+NdisConvertStringToAtmAddress@12
+NdisCopyBuffer@24
+NdisCopyFromPacketToPacket@24
+NdisDeregisterAdapter@4
+NdisDeregisterAdapterShutdownHandler@4
+NdisDeregisterMac@8
+NdisDeregisterProtocol@8
+NdisDprAcquireSpinLock@4
+NdisDprAllocatePacket@12
+NdisDprAllocatePacketNonInterlocked@12
+NdisDprFreePacket@4
+NdisDprFreePacketNonInterlocked@4
+NdisDprReleaseSpinLock@4
+NdisEqualString@12
+NdisFlushBuffer@8
+NdisFreeBuffer@4
+NdisFreeBufferPool@4
+NdisFreeDmaChannel@4
+NdisFreeMemory@12
+NdisFreePacket@4
+NdisFreePacketPool@4
+NdisFreeSharedMemory@24
+NdisFreeSpinLock@4
+NdisGetBufferPhysicalArraySize@8
+NdisGetCurrentProcessorCounts@12
+NdisGetCurrentProcessorCpuUsage@4
+NdisGetCurrentSystemTime@4
+NdisGetDriverHandle@8
+NdisGetFirstBufferFromPacket@20
+NdisGetReceivedPacket@8
+NdisGetSystemUptime@4
+NdisIMAssociateMiniport@8
+NdisIMCancelInitializeDeviceInstance@8
+NdisIMCopySendCompletePerPacketInfo@8
+NdisIMCopySendPerPacketInfo@8
+NdisIMDeInitializeDeviceInstance@4
+NdisIMDeregisterLayeredMiniport@4
+NdisIMGetBindingContext@4
+NdisIMGetDeviceContext@4
+NdisIMInitializeDeviceInstance@8
+NdisIMInitializeDeviceInstanceEx@12
+NdisImmediateReadPciSlotInformation@20
+NdisImmediateReadPortUchar@12
+NdisImmediateReadPortUlong@12
+NdisImmediateReadPortUshort@12
+NdisImmediateReadSharedMemory@16
+NdisImmediateWritePciSlotInformation@20
+NdisImmediateWritePortUchar@12
+NdisImmediateWritePortUlong@12
+NdisImmediateWritePortUshort@12
+NdisImmediateWriteSharedMemory@16
+NdisIMQueueMiniportCallback@12
+NdisIMRegisterLayeredMiniport@16
+NdisIMRevertBack@8
+NdisIMSwitchToMiniport@8
+NdisInitAnsiString@8
+NdisInitializeEvent@4
+NdisInitializeInterrupt@40
+NdisInitializeReadWriteLock@4
+NdisInitializeString@8
+NdisInitializeTimer@12
+NdisInitializeWrapper@16
+NdisInitUnicodeString@8
+;NdisInterlockedAddLargeInterger ?
+NdisInterlockedAddUlong@12
+NdisInterlockedDecrement@4
+NdisInterlockedIncrement@4
+NdisInterlockedInsertHeadList@12
+NdisInterlockedInsertTailList@12
+NdisInterlockedPopEntrySList@8
+NdisInterlockedPushEntrySList@12
+NdisInterlockedRemoveHeadList@8
+NdisMAllocateMapRegisters@20
+NdisMAllocateSharedMemory@20
+NdisMAllocateSharedMemoryAsync@16
+NdisMapFile@12
+NdisMapIoSpace@24
+;NdisMatchPdoWithPacket ?
+NdisMCancelTimer@8
+NdisMCloseLog@4
+NdisMCmActivateVc@8
+NdisMCmCreateVc@16
+NdisMCmDeactivateVc@4
+NdisMCmDeleteVc@4
+NdisMCmRegisterAddressFamily@16
+NdisMCmRequest@16
+NdisMCoActivateVcComplete@12
+NdisMCoDeactivateVcComplete@8
+NdisMCoIndicateReceivePacket@12
+NdisMCoIndicateStatus@20
+NdisMCompleteBufferPhysicalMapping@12
+NdisMCoReceiveComplete@4
+NdisMCoRequestComplete@12
+NdisMCoSendComplete@12
+NdisMCreateLog@12
+NdisMDeregisterAdapterShutdownHandler@4
+NdisMDeregisterDevice@4
+NdisMDeregisterDmaChannel@4
+NdisMDeregisterInterrupt@4
+NdisMDeregisterIoPortRange@16
+NdisMFlushLog@4
+NdisMFreeMapRegisters@4
+NdisMFreeSharedMemory@24
+NdisMGetDeviceProperty@24
+NdisMIndicateStatus@16
+NdisMIndicateStatusComplete@4
+NdisMInitializeScatterGatherDma@12
+NdisMInitializeTimer@16
+NdisMMapIoSpace@20
+NdisMPciAssignResources@12
+NdisMPromoteMiniport@4
+NdisMQueryAdapterInstanceName@8
+NdisMQueryAdapterResources@16
+NdisMQueryInformationComplete@8
+NdisMReadDmaCounter@4
+NdisMRegisterAdapterShutdownHandler@12
+NdisMRegisterDevice@24
+NdisMRegisterDmaChannel@24
+NdisMRegisterInterrupt@28
+NdisMRegisterIoPortRange@16
+NdisMRegisterMiniport@12
+NdisMRegisterUnloadHandler@8
+NdisMRemoveMiniport@4
+NdisMResetComplete@12
+NdisMSendComplete@12
+NdisMSendResourcesAvailable@4
+NdisMSetAttributes@16
+NdisMSetAttributesEx@20
+NdisMSetInformationComplete@8
+NdisMSetMiniportSecondary@8
+NdisMSetPeriodicTimer@8
+NdisMSetTimer@8
+NdisMSleep@4
+NdisMStartBufferPhysicalMapping@24
+NdisMSynchronizeWithInterrupt@12
+NdisMTransferDataComplete@16
+NdisMUnmapIoSpace@12
+NdisMWanIndicateReceive@20
+NdisMWanIndicateReceiveComplete@4
+NdisMWanSendComplete@12
+NdisMWriteLogData@12
+NdisOpenAdapter@44
+NdisOpenConfiguration@12
+NdisOpenConfigurationKeyByIndex@20
+NdisOpenConfigurationKeyByName@16
+NdisOpenFile@24
+NdisOpenProtocolConfiguration@12
+;NdisOverrideBusNumber ?
+NdisPacketPoolUsage@4
+NdisPciAssignResources@20
+NdisQueryAdapterInstanceName@8
+;NdisQueryBindInstanceName?
+NdisQueryBuffer@12
+NdisQueryBufferOffset@12
+NdisQueryBufferSafe@16
+NdisQueryMapRegisterCount@8
+NdisReadConfiguration@20
+NdisReadEisaSlotInformation@16
+NdisReadEisaSlotInformationEx@20
+NdisReadMcaPosInformation@16
+NdisReadNetworkAddress@16
+NdisReadPciSlotInformation@20
+NdisReadPcmciaAttributeMemory@16
+;NdisReEnumerateProtocolBindings ?
+NdisRegisterAdapter@24
+NdisRegisterAdapterShutdownHandler@12
+NdisRegisterMac@24
+NdisRegisterProtocol@16
+;NdisRegisterTdiCallBack ?
+NdisReleaseAdapterResources@4
+NdisReleaseReadWriteLock@8
+NdisReleaseSpinLock@4
+NdisRemoveInterrupt@4
+NdisRequest@12
+NdisReset@8
+NdisResetEvent@4
+NdisReturnPackets@8
+NdisSend@12
+NdisSendPackets@12
+NdisSetEvent@4
+;NdisSetPacketPoolProtocolId ?
+;NdisSetProtocolFilter ?
+NdisSetTimer@8
+NdisSetupDmaTransfer@24
+NdisSystemProcessorCount@0
+NdisTerminateWrapper@8
+NdisTransferData@28
+NdisUnchainBufferAtBack@8
+NdisUnchainBufferAtFront@8
+NdisUnicodeStringToAnsiString@8
+NdisUnmapFile@4
+NdisUpcaseUnicodeString@8
+NdisUpdateSharedMemory@20
+NdisWaitEvent@8
+NdisWriteConfiguration@16
+;NdisWriteErrorLogEntry ?
+NdisWriteEventLogEntry@28
+NdisWritePciSlotInformation@20
+NdisWritePcmciaAttributeMemory@16
+TrChangeFunctionalAddress@20
+TrChangeGroupAddress@20
+TrCreateFilter@28
+TrDeleteFilter@4
+TrDeleteFilterOpenAdapter@12
+TrFilterAdjust@20
+;TrFilterDprIndicateReceive@28
+;TrFilterDprIndicateReceiveComplete@4
+TrFilterIndicateReceive@28
+TrFilterIndicateReceiveComplete@4
+TrNoteFilterOpenAdapter@16
+TrShouldAddressLoopBack@12
+
+; EOF
diff --git a/reactos/drivers/net/ndis/ndis.edf b/reactos/drivers/net/ndis/ndis.edf
new file mode 100644 (file)
index 0000000..2997d85
--- /dev/null
@@ -0,0 +1,314 @@
+; NDIS Kernel Module - ReactOS Operating System
+
+LIBRARY NDIS.SYS
+
+EXPORTS
+ArcFilterDprIndicateReceive=ArcFilterDprIndicateReceive@16
+ArcFilterDprIndicateReceiveComplete=ArcFilterDprIndicateReceiveComplete@4
+EthChangeFilterAddresses=EthChangeFilterAddresses@24
+EthCreateFilter=EthCreateFilter@28
+EthDeleteFilter=EthDeleteFilter@4
+EthDeleteFilterOpenAdapter=EthDeleteFilterOpenAdapter@12
+EthFilterAdjust=EthFilterAdjust@20
+;EthFilterDprIndicateReceive@32 ?
+;EthFilterDprIndicateReceiveComplete@4 ?
+EthFilterIndicateReceive=EthFilterIndicateReceive@32
+EthFilterIndicateReceiveComplete=EthFilterIndicateReceiveComplete@4
+EthNoteFilterOpenAdapter=EthNoteFilterOpenAdapter@16
+EthNumberOfOpenFilterAddresses=EthNumberOfOpenFilterAddresses@8
+EthQueryGlobalFilterAddresses=EthQueryGlobalFilterAddresses@20
+EthQueryOpenFilterAddresses=EthQueryOpenFilterAddresses@24
+EthShouldAddressLoopBack=EthShouldAddressLoopBack@8
+FddiChangeFilterLongAddresses=FddiChangeFilterLongAddresses@24
+FddiChangeFilterShortAddresses=FddiChangeFilterShortAddresses@24
+FddiCreateFilter=FddiCreateFilter@36
+FddiDeleteFilter=FddiDeleteFilter@4
+FddiDeleteFilterOpenAdapter=FddiDeleteFilterOpenAdapter@12
+FddiFilterAdjust=FddiFilterAdjust@20
+;FddiFilterDprIndicateReceive@36 ?
+;FddiFilterDprIndicateReceiveComplete@4 ?
+FddiFilterIndicateReceive=FddiFilterIndicateReceive@36
+FddiFilterIndicateReceiveComplete=FddiFilterIndicateReceiveComplete@4
+FddiNoteFilterOpenAdapter=FddiNoteFilterOpenAdapter@16
+FddiNumberOfOpenFilterLongAddresses=FddiNumberOfOpenFilterLongAddresses@8
+FddiNumberOfOpenFilterShortAddresses=FddiNumberOfOpenFilterShortAddresses@8
+FddiQueryGlobalFilterLongAddresses=FddiQueryGlobalFilterLongAddresses@20
+FddiQueryGlobalFilterShortAddresses=FddiQueryGlobalFilterShortAddresses@20
+FddiQueryOpenFilterLongAddresses=FddiQueryOpenFilterLongAddresses@24
+FddiQueryOpenFilterShortAddresses=FddiQueryOpenFilterShortAddresses@24
+FddiShouldAddressLoopBack=FddiShouldAddressLoopBack@12
+NDIS_BUFFER_TO_SPAN_PAGES=NDIS_BUFFER_TO_SPAN_PAGES@4
+NdisAcquireReadWriteLock=NdisAcquireReadWriteLock@12
+NdisAcquireSpinLock=NdisAcquireSpinLock@4
+NdisAdjustBufferLength=NdisAdjustBufferLength@8
+NdisAllocateBuffer=NdisAllocateBuffer@20
+NdisAllocateBufferPool=NdisAllocateBufferPool@12
+NdisAllocateDmaChannel=NdisAllocateDmaChannel@20
+NdisAllocateMemory=NdisAllocateMemory@20
+NdisAllocateMemoryWithTag=NdisAllocateMemoryWithTag@12
+NdisAllocatePacket=NdisAllocatePacket@12
+NdisAllocatePacketPool=NdisAllocatePacketPool@16
+NdisAllocatePacketPoolEx=NdisAllocatePacketPoolEx@20
+NdisAllocateSharedMemory=NdisAllocateSharedMemory@20
+NdisAllocateSpinLock=NdisAllocateSpinLock@4
+NdisAnsiStringToUnicodeString=NdisAnsiStringToUnicodeString@8
+NdisBufferLength=NdisBufferLength@4
+NdisBufferVirtualAddress=NdisBufferVirtualAddress@4
+NdisCancelTimer=NdisCancelTimer@8
+NdisClAddParty=NdisClAddParty@16
+NdisClCloseAddressFamily=NdisClCloseAddressFamily@4
+NdisClCloseCall=NdisClCloseCall@16
+NdisClDeregisterSap=NdisClDeregisterSap@4
+NdisClDropParty=NdisClDropParty@12
+NdisClIncomingCallComplete=NdisClIncomingCallComplete@12
+NdisClMakeCall=NdisClMakeCall@16
+NdisClModifyCallQoS=NdisClModifyCallQoS@8
+NdisClOpenAddressFamily=NdisClOpenAddressFamily@24
+NdisClRegisterSap=NdisClRegisterSap@16
+NdisCloseAdapter=NdisCloseAdapter@8
+NdisCloseConfiguration=NdisCloseConfiguration@4
+NdisCloseFile=NdisCloseFile@4
+NdisCmActivateVc=NdisCmActivateVc@8
+NdisCmAddPartyComplete=NdisCmAddPartyComplete@16
+NdisCmCloseAddressFamilyComplete=NdisCmCloseAddressFamilyComplete@8
+NdisCmCloseCallComplete=NdisCmCloseCallComplete@12
+NdisCmDeactivateVc=NdisCmDeactivateVc@4
+NdisCmDeregisterSapComplete=NdisCmDeregisterSapComplete@8
+NdisCmDispatchCallConnected=NdisCmDispatchCallConnected@4
+NdisCmDispatchIncomingCall=NdisCmDispatchIncomingCall@12
+NdisCmDispatchIncomingCallQoSChange=NdisCmDispatchIncomingCallQoSChange@8
+NdisCmDispatchIncomingCloseCall=NdisCmDispatchIncomingCloseCall@16
+NdisCmDispatchIncomingDropParty=NdisCmDispatchIncomingDropParty@16
+NdisCmDropPartyComplete=NdisCmDropPartyComplete@8
+NdisCmMakeCallComplete=NdisCmMakeCallComplete@20
+NdisCmModifyCallQoSComplete=NdisCmModifyCallQoSComplete@12
+NdisCmOpenAddressFamilyComplete=NdisCmOpenAddressFamilyComplete@12
+NdisCmRegisterAddressFamily=NdisCmRegisterAddressFamily@16
+NdisCmRegisterSapComplete=NdisCmRegisterSapComplete@12
+NdisCoCreateVc=NdisCoCreateVc@16
+NdisCoDeleteVc=NdisCoDeleteVc@4
+NdisCoRequest=NdisCoRequest@20
+NdisCoRequestComplete=NdisCoRequestComplete@20
+NdisCoSendPackets=NdisCoSendPackets@12
+;NdisCompareAnsiString ?
+;NdisCompareUnicodeString ?
+NdisCompleteBindAdapter=NdisCompleteBindAdapter@12
+NdisCompleteCloseAdapter=NdisCompleteCloseAdapter@8
+NdisCompleteDmaTransfer=NdisCompleteDmaTransfer@24
+NdisCompleteOpenAdapter=NdisCompleteOpenAdapter@12
+NdisCompletePnPEvent=NdisCompletePnPEvent@12
+NdisCompleteQueryStatistics=NdisCompleteQueryStatistics@12
+NdisCompleteUnbindAdapter=NdisCompleteUnbindAdapter@8
+NdisConvertStringToAtmAddress=NdisConvertStringToAtmAddress@12
+NdisCopyBuffer=NdisCopyBuffer@24
+NdisCopyFromPacketToPacket=NdisCopyFromPacketToPacket@24
+NdisDeregisterAdapter=NdisDeregisterAdapter@4
+NdisDeregisterAdapterShutdownHandler=NdisDeregisterAdapterShutdownHandler@4
+NdisDeregisterMac=NdisDeregisterMac@8
+NdisDeregisterProtocol=NdisDeregisterProtocol@8
+NdisDprAcquireSpinLock=NdisDprAcquireSpinLock@4
+NdisDprAllocatePacket=NdisDprAllocatePacket@12
+NdisDprAllocatePacketNonInterlocked=NdisDprAllocatePacketNonInterlocked@12
+NdisDprFreePacket=NdisDprFreePacket@4
+NdisDprFreePacketNonInterlocked=NdisDprFreePacketNonInterlocked@4
+NdisDprReleaseSpinLock=NdisDprReleaseSpinLock@4
+NdisEqualString=NdisEqualString@12
+NdisFlushBuffer=NdisFlushBuffer@8
+NdisFreeBuffer=NdisFreeBuffer@4
+NdisFreeBufferPool=NdisFreeBufferPool@4
+NdisFreeDmaChannel=NdisFreeDmaChannel@4
+NdisFreeMemory=NdisFreeMemory@12
+NdisFreePacket=NdisFreePacket@4
+NdisFreePacketPool=NdisFreePacketPool@4
+NdisFreeSharedMemory=NdisFreeSharedMemory@24
+NdisFreeSpinLock=NdisFreeSpinLock@4
+NdisGetBufferPhysicalArraySize=NdisGetBufferPhysicalArraySize@8
+NdisGetCurrentProcessorCounts=NdisGetCurrentProcessorCounts@12
+NdisGetCurrentProcessorCpuUsage=NdisGetCurrentProcessorCpuUsage@4
+NdisGetCurrentSystemTime=NdisGetCurrentSystemTime@4
+NdisGetDriverHandle=NdisGetDriverHandle@8
+NdisGetFirstBufferFromPacket=NdisGetFirstBufferFromPacket@20
+NdisGetReceivedPacket=NdisGetReceivedPacket@8
+NdisGetSystemUptime=NdisGetSystemUptime@4
+NdisIMAssociateMiniport=NdisIMAssociateMiniport@8
+NdisIMCancelInitializeDeviceInstance=NdisIMCancelInitializeDeviceInstance@8
+NdisIMCopySendCompletePerPacketInfo=NdisIMCopySendCompletePerPacketInfo@8
+NdisIMCopySendPerPacketInfo=NdisIMCopySendPerPacketInfo@8
+NdisIMDeInitializeDeviceInstance=NdisIMDeInitializeDeviceInstance@4
+NdisIMDeregisterLayeredMiniport=NdisIMDeregisterLayeredMiniport@4
+NdisIMGetBindingContext=NdisIMGetBindingContext@4
+NdisIMGetDeviceContext=NdisIMGetDeviceContext@4
+NdisIMInitializeDeviceInstance=NdisIMInitializeDeviceInstance@8
+NdisIMInitializeDeviceInstanceEx=NdisIMInitializeDeviceInstanceEx@12
+NdisImmediateReadPciSlotInformation=NdisImmediateReadPciSlotInformation@20
+NdisImmediateReadPortUchar=NdisImmediateReadPortUchar@12
+NdisImmediateReadPortUlong=NdisImmediateReadPortUlong@12
+NdisImmediateReadPortUshort=NdisImmediateReadPortUshort@12
+NdisImmediateReadSharedMemory=NdisImmediateReadSharedMemory@16
+NdisImmediateWritePciSlotInformation=NdisImmediateWritePciSlotInformation@20
+NdisImmediateWritePortUchar=NdisImmediateWritePortUchar@12
+NdisImmediateWritePortUlong=NdisImmediateWritePortUlong@12
+NdisImmediateWritePortUshort=NdisImmediateWritePortUshort@12
+NdisImmediateWriteSharedMemory=NdisImmediateWriteSharedMemory@16
+NdisIMQueueMiniportCallback=NdisIMQueueMiniportCallback@12
+NdisIMRegisterLayeredMiniport=NdisIMRegisterLayeredMiniport@16
+NdisIMRevertBack=NdisIMRevertBack@8
+NdisIMSwitchToMiniport=NdisIMSwitchToMiniport@8
+NdisInitAnsiString=NdisInitAnsiString@8
+NdisInitializeEvent=NdisInitializeEvent@4
+NdisInitializeInterrupt=NdisInitializeInterrupt@40
+NdisInitializeReadWriteLock=NdisInitializeReadWriteLock@4
+NdisInitializeString=NdisInitializeString@8
+NdisInitializeTimer=NdisInitializeTimer@12
+NdisInitializeWrapper=NdisInitializeWrapper@16
+NdisInitUnicodeString=NdisInitUnicodeString@8
+;NdisInterlockedAddLargeInterger ?
+NdisInterlockedAddUlong=NdisInterlockedAddUlong@12
+NdisInterlockedDecrement=NdisInterlockedDecrement@4
+NdisInterlockedIncrement=NdisInterlockedIncrement@4
+NdisInterlockedInsertHeadList=NdisInterlockedInsertHeadList@12
+NdisInterlockedInsertTailList=NdisInterlockedInsertTailList@12
+NdisInterlockedPopEntrySList=NdisInterlockedPopEntrySList@8
+NdisInterlockedPushEntrySList=NdisInterlockedPushEntrySList@12
+NdisInterlockedRemoveHeadList=NdisInterlockedRemoveHeadList@8
+NdisMAllocateMapRegisters=NdisMAllocateMapRegisters@20
+NdisMAllocateSharedMemory=NdisMAllocateSharedMemory@20
+NdisMAllocateSharedMemoryAsync=NdisMAllocateSharedMemoryAsync@16
+NdisMapFile=NdisMapFile@12
+NdisMapIoSpace=NdisMapIoSpace@24
+;NdisMatchPdoWithPacket ?
+NdisMCancelTimer=NdisMCancelTimer@8
+NdisMCloseLog=NdisMCloseLog@4
+NdisMCmActivateVc=NdisMCmActivateVc@8
+NdisMCmCreateVc=NdisMCmCreateVc@16
+NdisMCmDeactivateVc=NdisMCmDeactivateVc@4
+NdisMCmDeleteVc=NdisMCmDeleteVc@4
+NdisMCmRegisterAddressFamily=NdisMCmRegisterAddressFamily@16
+NdisMCmRequest=NdisMCmRequest@16
+NdisMCoActivateVcComplete=NdisMCoActivateVcComplete@12
+NdisMCoDeactivateVcComplete=NdisMCoDeactivateVcComplete@8
+NdisMCoIndicateReceivePacket=NdisMCoIndicateReceivePacket@12
+NdisMCoIndicateStatus=NdisMCoIndicateStatus@20
+NdisMCompleteBufferPhysicalMapping=NdisMCompleteBufferPhysicalMapping@12
+NdisMCoReceiveComplete=NdisMCoReceiveComplete@4
+NdisMCoRequestComplete=NdisMCoRequestComplete@12
+NdisMCoSendComplete=NdisMCoSendComplete@12
+NdisMCreateLog=NdisMCreateLog@12
+NdisMDeregisterAdapterShutdownHandler=NdisMDeregisterAdapterShutdownHandler@4
+NdisMDeregisterDevice=NdisMDeregisterDevice@4
+NdisMDeregisterDmaChannel=NdisMDeregisterDmaChannel@4
+NdisMDeregisterInterrupt=NdisMDeregisterInterrupt@4
+NdisMDeregisterIoPortRange=NdisMDeregisterIoPortRange@16
+NdisMFlushLog=NdisMFlushLog@4
+NdisMFreeMapRegisters=NdisMFreeMapRegisters@4
+NdisMFreeSharedMemory=NdisMFreeSharedMemory@24
+NdisMGetDeviceProperty=NdisMGetDeviceProperty@24
+NdisMIndicateStatus=NdisMIndicateStatus@16
+NdisMIndicateStatusComplete=NdisMIndicateStatusComplete@4
+NdisMInitializeScatterGatherDma=NdisMInitializeScatterGatherDma@12
+NdisMInitializeTimer=NdisMInitializeTimer@16
+NdisMMapIoSpace=NdisMMapIoSpace@20
+NdisMPciAssignResources=NdisMPciAssignResources@12
+NdisMPromoteMiniport=NdisMPromoteMiniport@4
+NdisMQueryAdapterInstanceName=NdisMQueryAdapterInstanceName@8
+NdisMQueryAdapterResources=NdisMQueryAdapterResources@16
+NdisMQueryInformationComplete=NdisMQueryInformationComplete@8
+NdisMReadDmaCounter=NdisMReadDmaCounter@4
+NdisMRegisterAdapterShutdownHandler=NdisMRegisterAdapterShutdownHandler@12
+NdisMRegisterDevice=NdisMRegisterDevice@24
+NdisMRegisterDmaChannel=NdisMRegisterDmaChannel@24
+NdisMRegisterInterrupt=NdisMRegisterInterrupt@28
+NdisMRegisterIoPortRange=NdisMRegisterIoPortRange@16
+NdisMRegisterMiniport=NdisMRegisterMiniport@12
+NdisMRegisterUnloadHandler=NdisMRegisterUnloadHandler@8
+NdisMRemoveMiniport=NdisMRemoveMiniport@4
+NdisMResetComplete=NdisMResetComplete@12
+NdisMSendComplete=NdisMSendComplete@12
+NdisMSendResourcesAvailable=NdisMSendResourcesAvailable@4
+NdisMSetAttributes=NdisMSetAttributes@16
+NdisMSetAttributesEx=NdisMSetAttributesEx@20
+NdisMSetInformationComplete=NdisMSetInformationComplete@8
+NdisMSetMiniportSecondary=NdisMSetMiniportSecondary@8
+NdisMSetPeriodicTimer=NdisMSetPeriodicTimer@8
+NdisMSetTimer=NdisMSetTimer@8
+NdisMSleep=NdisMSleep@4
+NdisMStartBufferPhysicalMapping=NdisMStartBufferPhysicalMapping@24
+NdisMSynchronizeWithInterrupt=NdisMSynchronizeWithInterrupt@12
+NdisMTransferDataComplete=NdisMTransferDataComplete@16
+NdisMUnmapIoSpace=NdisMUnmapIoSpace@12
+NdisMWanIndicateReceive=NdisMWanIndicateReceive@20
+NdisMWanIndicateReceiveComplete=NdisMWanIndicateReceiveComplete@4
+NdisMWanSendComplete=NdisMWanSendComplete@12
+NdisMWriteLogData=NdisMWriteLogData@12
+NdisOpenAdapter=NdisOpenAdapter@44
+NdisOpenConfiguration=NdisOpenConfiguration@12
+NdisOpenConfigurationKeyByIndex=NdisOpenConfigurationKeyByIndex@20
+NdisOpenConfigurationKeyByName=NdisOpenConfigurationKeyByName@16
+NdisOpenFile=NdisOpenFile@24
+NdisOpenProtocolConfiguration=NdisOpenProtocolConfiguration@12
+;NdisOverrideBusNumber ?
+NdisPacketPoolUsage=NdisPacketPoolUsage@4
+NdisPciAssignResources=NdisPciAssignResources@20
+NdisQueryAdapterInstanceName=NdisQueryAdapterInstanceName@8
+;NdisQueryBindInstanceName?
+NdisQueryBuffer=NdisQueryBuffer@12
+NdisQueryBufferOffset=NdisQueryBufferOffset@12
+NdisQueryBufferSafe=NdisQueryBufferSafe@16
+NdisQueryMapRegisterCount=NdisQueryMapRegisterCount@8
+NdisReadConfiguration=NdisReadConfiguration@20
+NdisReadEisaSlotInformation=NdisReadEisaSlotInformation@16
+NdisReadEisaSlotInformationEx=NdisReadEisaSlotInformationEx@20
+NdisReadMcaPosInformation=NdisReadMcaPosInformation@16
+NdisReadNetworkAddress=NdisReadNetworkAddress@16
+NdisReadPciSlotInformation=NdisReadPciSlotInformation@20
+NdisReadPcmciaAttributeMemory=NdisReadPcmciaAttributeMemory@16
+;NdisReEnumerateProtocolBindings ?
+NdisRegisterAdapter=NdisRegisterAdapter@24
+NdisRegisterAdapterShutdownHandler=NdisRegisterAdapterShutdownHandler@12
+NdisRegisterMac=NdisRegisterMac@24
+NdisRegisterProtocol=NdisRegisterProtocol@16
+;NdisRegisterTdiCallBack ?
+NdisReleaseAdapterResources=NdisReleaseAdapterResources@4
+NdisReleaseReadWriteLock=NdisReleaseReadWriteLock@8
+NdisReleaseSpinLock=NdisReleaseSpinLock@4
+NdisRemoveInterrupt=NdisRemoveInterrupt@4
+NdisRequest=NdisRequest@12
+NdisReset=NdisReset@8
+NdisResetEvent=NdisResetEvent@4
+NdisReturnPackets=NdisReturnPackets@8
+NdisSend=NdisSend@12
+NdisSendPackets=NdisSendPackets@12
+NdisSetEvent=NdisSetEvent@4
+;NdisSetPacketPoolProtocolId ?
+;NdisSetProtocolFilter ?
+NdisSetTimer=NdisSetTimer@8
+NdisSetupDmaTransfer=NdisSetupDmaTransfer@24
+NdisSystemProcessorCount=NdisSystemProcessorCount@0
+NdisTerminateWrapper=NdisTerminateWrapper@8
+NdisTransferData=NdisTransferData@28
+NdisUnchainBufferAtBack=NdisUnchainBufferAtBack@8
+NdisUnchainBufferAtFront=NdisUnchainBufferAtFront@8
+NdisUnicodeStringToAnsiString=NdisUnicodeStringToAnsiString@8
+NdisUnmapFile=NdisUnmapFile@4
+NdisUpcaseUnicodeString=NdisUpcaseUnicodeString@8
+NdisUpdateSharedMemory=NdisUpdateSharedMemory@20
+NdisWaitEvent=NdisWaitEvent@8
+NdisWriteConfiguration=NdisWriteConfiguration@16
+;NdisWriteErrorLogEntry ?
+NdisWriteEventLogEntry=NdisWriteEventLogEntry@28
+NdisWritePciSlotInformation=NdisWritePciSlotInformation@20
+NdisWritePcmciaAttributeMemory=NdisWritePcmciaAttributeMemory@16
+TrChangeFunctionalAddress=TrChangeFunctionalAddress@20
+TrChangeGroupAddress=TrChangeGroupAddress@20
+TrCreateFilter=TrCreateFilter@28
+TrDeleteFilter=TrDeleteFilter@4
+TrDeleteFilterOpenAdapter=TrDeleteFilterOpenAdapter@12
+TrFilterAdjust=TrFilterAdjust@20
+;TrFilterDprIndicateReceive@28
+;TrFilterDprIndicateReceiveComplete@4
+TrFilterIndicateReceive=TrFilterIndicateReceive@28
+TrFilterIndicateReceiveComplete=TrFilterIndicateReceiveComplete@4
+TrNoteFilterOpenAdapter=TrNoteFilterOpenAdapter@16
+TrShouldAddressLoopBack=TrShouldAddressLoopBack@12
+
+; EOF
diff --git a/reactos/drivers/net/ndis/ndis.rc b/reactos/drivers/net/ndis/ndis.rc
new file mode 100644 (file)
index 0000000..2ea36d0
--- /dev/null
@@ -0,0 +1,38 @@
+#include <defines.h>
+#include <reactos/resource.h>
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+VS_VERSION_INFO VERSIONINFO
+       FILEVERSION     RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
+       PRODUCTVERSION  RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
+       FILEFLAGSMASK   0x3fL
+#ifdef _DEBUG
+       FILEFLAGS       0x1L
+#else
+       FILEFLAGS       0x0L
+#endif
+       FILEOS          0x40004L
+       FILETYPE        0x2L
+       FILESUBTYPE     0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName",         RES_STR_COMPANY_NAME
+            VALUE "FileDescription",  "NDIS library\0"
+            VALUE "FileVersion",         "0.0.0\0"
+            VALUE "InternalName",        "ndis\0"
+            VALUE "LegalCopyright",      RES_STR_LEGAL_COPYRIGHT
+            VALUE "OriginalFilename", "ndis.sys\0"
+            VALUE "ProductName",         RES_STR_PRODUCT_NAME
+            VALUE "ProductVersion",      RES_STR_PRODUCT_VERSION
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
diff --git a/reactos/drivers/net/ndis/ndis/40gone.c b/reactos/drivers/net/ndis/ndis/40gone.c
new file mode 100644 (file)
index 0000000..64e4cd5
--- /dev/null
@@ -0,0 +1,749 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/40gone.c
+ * PURPOSE:     Obsoleted functions in NDIS 4.0
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+VOID
+EXPORT
+ArcFilterDprIndicateReceive(
+    IN  PARC_FILTER Filter,
+    IN  PUCHAR      pRawHeader,
+    IN  PUCHAR      pData,
+    IN  UINT        Length)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+ArcFilterDprIndicateReceiveComplete(
+    IN  PARC_FILTER Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+EthChangeFilterAddresses(
+    IN  PETH_FILTER     Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  UINT            AddressCount,
+    IN  CHAR            Addresses [] [ETH_LENGTH_OF_ADDRESS],
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+BOOLEAN
+EXPORT
+EthCreateFilter(
+    IN  UINT                MaximumMulticastAddresses,
+    IN  ETH_ADDRESS_CHANGE  AddressChangeAction,
+    IN  ETH_FILTER_CHANGE   FilterChangeAction,
+    IN  ETH_DEFERRED_CLOSE  CloseAction,
+    IN  PUCHAR              AdapterAddress,
+    IN  PNDIS_SPIN_LOCK     Lock,
+    OUT PETH_FILTER         * Filter)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+VOID
+EXPORT
+EthDeleteFilter(
+    IN  PETH_FILTER Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+EthDeleteFilterOpenAdapter(
+    IN  PETH_FILTER    Filter,
+    IN  NDIS_HANDLE    NdisFilterHandle,
+    IN  PNDIS_REQUEST  NdisRequest)
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+EthFilterAdjust(
+    IN  PETH_FILTER     Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  UINT            FilterClasses,
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+EthFilterIndicateReceive(
+    IN PETH_FILTER Filter,
+    IN NDIS_HANDLE MacReceiveContext,
+    IN PCHAR       Address,
+    IN PVOID       HeaderBuffer,
+    IN UINT        HeaderBufferSize,
+    IN PVOID       LookaheadBuffer,
+    IN UINT        LookaheadBufferSize,
+    IN UINT        PacketSize)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+EthFilterIndicateReceiveComplete(
+    IN  PETH_FILTER Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+EthNoteFilterOpenAdapter(
+    IN  PETH_FILTER     Filter,
+    IN  NDIS_HANDLE     MacBindingHandle,
+    IN  NDIS_HANDLE     NdisBindingContext,
+    OUT PNDIS_HANDLE    NdisFilterHandle)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+UINT
+EXPORT
+EthNumberOfOpenFilterAddresses(
+    IN  PETH_FILTER Filter,
+    IN  NDIS_HANDLE NdisFilterHandle)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+VOID
+EXPORT
+EthQueryGlobalFilterAddresses (
+    OUT PNDIS_STATUS    Status,
+    IN  PETH_FILTER     Filter,
+    IN  UINT            SizeOfArray,
+    OUT PUINT           NumberOfAddresses,
+    IN  OUT    CHAR        AddressArray [] [ETH_LENGTH_OF_ADDRESS])
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+EthQueryOpenFilterAddresses(
+    OUT            PNDIS_STATUS    Status,
+    IN     PETH_FILTER     Filter,
+    IN     NDIS_HANDLE     NdisFilterHandle,
+    IN     UINT            SizeOfArray,
+    OUT            PUINT           NumberOfAddresses,
+    IN OUT  CHAR            AddressArray [] [ETH_LENGTH_OF_ADDRESS])
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+EthShouldAddressLoopBack(
+    IN  PETH_FILTER Filter,
+    IN  CHAR        Address [ETH_LENGTH_OF_ADDRESS])
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+NDIS_STATUS
+EXPORT
+FddiChangeFilterLongAddresses(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  UINT            AddressCount,
+    IN  CHAR            Addresses [] [FDDI_LENGTH_OF_LONG_ADDRESS],
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+FddiChangeFilterShortAddresses(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  UINT            AddressCount,
+    IN  CHAR            Addresses [] [FDDI_LENGTH_OF_SHORT_ADDRESS],
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+BOOLEAN
+EXPORT
+FddiCreateFilter(
+    IN  UINT                MaximumMulticastLongAddresses,
+    IN  UINT                MaximumMulticastShortAddresses,
+    IN  FDDI_ADDRESS_CHANGE AddressChangeAction,
+    IN  FDDI_FILTER_CHANGE  FilterChangeAction,
+    IN  FDDI_DEFERRED_CLOSE CloseAction,
+    IN  PUCHAR              AdapterLongAddress,
+    IN  PUCHAR              AdapterShortAddress,
+    IN  PNDIS_SPIN_LOCK     Lock,
+    OUT PFDDI_FILTER        * Filter)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+VOID
+EXPORT
+FddiDeleteFilter(
+    IN  PFDDI_FILTER    Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+FddiDeleteFilterOpenAdapter(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_SUCCESS;
+}
+
+
+NDIS_STATUS
+EXPORT
+FddiFilterAdjust(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  UINT            FilterClasses,
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+FddiFilterIndicateReceive(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     MacReceiveContext,
+    IN  PCHAR           Address,
+    IN  UINT            AddressLength,
+    IN  PVOID           HeaderBuffer,
+    IN  UINT            HeaderBufferSize,
+    IN  PVOID           LookaheadBuffer,
+    IN  UINT            LookaheadBufferSize,
+    IN  UINT            PacketSize)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+FddiFilterIndicateReceiveComplete(
+    IN  PFDDI_FILTER    Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+FddiNoteFilterOpenAdapter(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     MacBindingHandle,
+    IN  NDIS_HANDLE     NdisBindingContext,
+    OUT PNDIS_HANDLE    NdisFilterHandle)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+UINT
+EXPORT
+FddiNumberOfOpenFilterLongAddresses(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+UINT
+EXPORT
+FddiNumberOfOpenFilterShortAddresses(
+    IN  PFDDI_FILTER    Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+VOID
+EXPORT
+FddiQueryGlobalFilterLongAddresses(
+    OUT     PNDIS_STATUS    Status,
+    IN      PFDDI_FILTER    Filter,
+    IN      UINT            SizeOfArray,
+    OUT     PUINT           NumberOfAddresses,
+    IN OUT  CHAR            AddressArray [] [FDDI_LENGTH_OF_LONG_ADDRESS])
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+FddiQueryGlobalFilterShortAddresses(
+    OUT     PNDIS_STATUS    Status,
+    IN      PFDDI_FILTER    Filter,
+    IN      UINT            SizeOfArray,
+    OUT     PUINT           NumberOfAddresses,
+    IN OUT  CHAR            AddressArray [] [FDDI_LENGTH_OF_SHORT_ADDRESS])
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+FddiQueryOpenFilterLongAddresses(
+    OUT     PNDIS_STATUS    Status,
+    IN      PFDDI_FILTER    Filter,
+    IN      NDIS_HANDLE     NdisFilterHandle,
+    IN      UINT            SizeOfArray,
+    OUT     PUINT           NumberOfAddresses,
+    IN OUT  CHAR            AddressArray [] [FDDI_LENGTH_OF_LONG_ADDRESS])
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+FddiQueryOpenFilterShortAddresses(
+    OUT     PNDIS_STATUS    Status,
+    IN      PFDDI_FILTER    Filter,
+    IN      NDIS_HANDLE     NdisFilterHandle,
+    IN      UINT            SizeOfArray,
+    OUT     PUINT           NumberOfAddresses,
+    IN OUT  CHAR            AddressArray [] [FDDI_LENGTH_OF_SHORT_ADDRESS])
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+FddiShouldAddressLoopBack(
+    IN  PFDDI_FILTER    Filter,
+    IN  CHAR            Address [],
+    IN  UINT            LengthOfAddress)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+VOID
+EXPORT
+NdisAllocateDmaChannel(
+    OUT PNDIS_STATUS            Status,
+    OUT PNDIS_HANDLE            NdisDmaHandle,
+    IN  NDIS_HANDLE             NdisAdapterHandle,
+    IN  PNDIS_DMA_DESCRIPTION   DmaDescription,
+    IN  ULONG                   MaximumLength)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisAllocateSharedMemory(
+    IN  NDIS_HANDLE             NdisAdapterHandle,
+    IN  ULONG                   Length,
+    IN  BOOLEAN                 Cached,
+    OUT PVOID                   *VirtualAddress,
+    OUT PNDIS_PHYSICAL_ADDRESS  PhysicalAddress)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCompleteBufferPhysicalMapping(
+    IN  NDIS_HANDLE     NdisAdapterHandle,
+    IN  PNDIS_BUFFER    Buffer,
+    IN  ULONG           PhysicalMapRegister)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCompleteRequest(
+    IN  NDIS_HANDLE     NdisBindingContext,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  NDIS_STATUS     Status)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCompleteReset(
+    IN  NDIS_HANDLE NdisBindingContext,
+    IN  NDIS_STATUS Status)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCompleteSend(
+    IN  NDIS_HANDLE     NdisBindingContext,
+    IN  PNDIS_PACKET    Packet,
+    IN  NDIS_STATUS     Status)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCompleteTransferData(
+    IN  NDIS_HANDLE     NdisBindingContext,
+    IN  PNDIS_PACKET    Packet,
+    IN  NDIS_STATUS     Status,
+    IN  UINT            BytesTransferred)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisIndicateReceive(
+    OUT PNDIS_STATUS    Status,
+    IN  NDIS_HANDLE     NdisBindingContext,
+    IN  NDIS_HANDLE     MacReceiveContext,
+    IN  PVOID           HeaderBuffer,
+    IN  UINT            HeaderBufferSize,
+    IN  PVOID           LookaheadBuffer,
+    IN  UINT            LookaheadBufferSize,
+    IN  UINT            PacketSize)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisIndicateReceiveComplete(
+    IN  NDIS_HANDLE NdisBindingContext)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisIndicateStatus(
+    IN  NDIS_HANDLE NdisBindingContext,
+    IN  NDIS_STATUS GeneralStatus,
+    IN  PVOID       StatusBuffer,
+    IN  UINT        StatusBufferSize)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisIndicateStatusComplete(
+    IN  NDIS_HANDLE NdisBindingContext)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisPciAssignResources(
+    IN  NDIS_HANDLE         NdisMacHandle,
+    IN  NDIS_HANDLE         NdisWrapperHandle,
+    IN  NDIS_HANDLE         WrapperConfigurationContext,
+    IN  ULONG               SlotNumber,
+    OUT PNDIS_RESOURCE_LIST *AssignedResources)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisReadBindingInformation (
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_STRING    * Binding,
+    IN  NDIS_HANDLE     ConfigurationHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+ULONG
+EXPORT
+NdisReadDmaCounter(
+    IN  NDIS_HANDLE NdisDmaHandle)
+{
+    UNIMPLEMENTED
+
+    return 0;
+}
+
+
+VOID
+EXPORT
+NdisStartBufferPhysicalMapping(
+    IN  NDIS_HANDLE                 NdisAdapterHandle,
+    IN  PNDIS_BUFFER                Buffer,
+    IN  ULONG                       PhysicalMapRegister,
+    IN  BOOLEAN                     WriteToDevice,
+    OUT PNDIS_PHYSICAL_ADDRESS_UNIT PhysicalAddressArray,
+    OUT PUINT                       ArraySize)
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+NdisSynchronizeWithInterrupt(
+    IN  PNDIS_INTERRUPT Interrupt,
+    IN  PVOID           SynchronizeFunction,
+    IN  PVOID           SynchronizeContext)
+{
+    UNIMPLEMENTED
+
+    return FALSE;
+}
+
+
+VOID
+EXPORT
+NdisUnmapIoSpace(
+    IN  NDIS_HANDLE NdisAdapterHandle,
+    IN  PVOID       VirtualAddress,
+    IN  UINT        Length)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+TrChangeFunctionalAddress(
+    IN  PTR_FILTER      Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  CHAR            FunctionalAddressArray [TR_LENGTH_OF_FUNCTIONAL],
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+TrChangeGroupAddress(
+    IN  PTR_FILTER      Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  CHAR            GroupAddressArray [TR_LENGTH_OF_FUNCTIONAL],
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+BOOLEAN
+EXPORT
+TrCreateFilter(
+    IN  TR_ADDRESS_CHANGE   AddressChangeAction,
+    IN  TR_GROUP_CHANGE     GroupChangeAction,
+    IN  TR_FILTER_CHANGE    FilterChangeAction,
+    IN  TR_DEFERRED_CLOSE   CloseAction,
+    IN  PUCHAR              AdapterAddress,
+    IN  PNDIS_SPIN_LOCK     Lock,
+    OUT PTR_FILTER          * Filter)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+VOID
+EXPORT
+TrDeleteFilter(
+    IN  PTR_FILTER  Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+TrDeleteFilterOpenAdapter (
+    IN  PTR_FILTER      Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_SUCCESS;
+}
+
+
+NDIS_STATUS
+EXPORT
+TrFilterAdjust(
+    IN  PTR_FILTER      Filter,
+    IN  NDIS_HANDLE     NdisFilterHandle,
+    IN  PNDIS_REQUEST   NdisRequest,
+    IN  UINT            FilterClasses,
+    IN  BOOLEAN         Set)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+TrFilterIndicateReceive(
+    IN  PTR_FILTER  Filter,
+    IN  NDIS_HANDLE MacReceiveContext,
+    IN  PVOID       HeaderBuffer,
+    IN  UINT        HeaderBufferSize,
+    IN  PVOID       LookaheadBuffer,
+    IN  UINT        LookaheadBufferSize,
+    IN  UINT        PacketSize)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+TrFilterIndicateReceiveComplete(
+    IN  PTR_FILTER  Filter)
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+TrNoteFilterOpenAdapter(
+    IN  PTR_FILTER      Filter,
+    IN  NDIS_HANDLE     MacBindingHandle,
+    IN  NDIS_HANDLE     NdisBindingContext,
+    OUT PNDIS_HANDLE    NdisFilterHandle)
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+BOOLEAN
+EXPORT
+TrShouldAddressLoopBack(
+    IN  PTR_FILTER  Filter,
+    IN  CHAR        DestinationAddress [TR_LENGTH_OF_ADDRESS],
+    IN  CHAR        SourceAddress [TR_LENGTH_OF_ADDRESS])
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/50gone.c b/reactos/drivers/net/ndis/ndis/50gone.c
new file mode 100644 (file)
index 0000000..1f1a4b5
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/50gone.c
+ * PURPOSE:     Obsoleted functions in NDIS 5.0
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+VOID
+EXPORT
+NdisCompleteCloseAdapter(
+    IN  NDIS_HANDLE NdisBindingContext,
+    IN  NDIS_STATUS Status)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCompleteOpenAdapter(
+    IN  NDIS_HANDLE NdisBindingContext,
+    IN  NDIS_STATUS Status,
+    IN  NDIS_STATUS OpenErrorStatus)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisDeregisterAdapter(
+    IN  NDIS_HANDLE NdisAdapterHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisDeregisterAdapterShutdownHandler(
+    IN  NDIS_HANDLE NdisAdapterHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisDeregisterMac(
+    OUT PNDIS_STATUS    Status,
+    IN  NDIS_HANDLE     NdisMacHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisFreeDmaChannel(
+    IN  PNDIS_HANDLE    NdisDmaHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisFreeSharedMemory(
+    IN NDIS_HANDLE              NdisAdapterHandle,
+    IN ULONG                    Length,
+    IN BOOLEAN                  Cached,
+    IN PVOID                    VirtualAddress,
+    IN NDIS_PHYSICAL_ADDRESS    PhysicalAddress)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisIMQueueMiniportCallback(
+    IN  NDIS_HANDLE         MiniportAdapterHandle,
+    IN  W_MINIPORT_CALLBACK CallbackRoutine,
+    IN  PVOID               CallbackContext)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisIMRevertBack(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  NDIS_HANDLE SwitchHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+NdisIMSwitchToMiniport(
+    IN  NDIS_HANDLE     MiniportAdapterHandle,
+    OUT PNDIS_HANDLE    SwitchHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+
+       return FALSE;
+}
+
+
+VOID
+EXPORT
+NdisInitializeInterrupt(
+    OUT     PNDIS_STATUS                Status,
+    IN OUT  PNDIS_INTERRUPT             Interrupt,
+    IN      NDIS_HANDLE                 NdisAdapterHandle,
+    IN      PNDIS_INTERRUPT_SERVICE     InterruptServiceRoutine,
+    IN      PVOID                       InterruptContext,
+    IN      PNDIS_DEFERRED_PROCESSING   DeferredProcessingRoutine,
+    IN      UINT                        InterruptVector,
+    IN      UINT                        InterruptLevel,
+    IN      BOOLEAN                     SharedInterrupt,
+    IN      NDIS_INTERRUPT_MODE         InterruptMode)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMapIoSpace(
+    OUT PNDIS_STATUS            Status,
+    OUT PVOID                   *VirtualAddress,
+    IN  NDIS_HANDLE             NdisAdapterHandle,
+    IN  NDIS_PHYSICAL_ADDRESS   PhysicalAddress,
+    IN  UINT                    Length)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisOverrideBusNumber(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  NDIS_HANDLE MiniportAdapterHandle   OPTIONAL,
+    IN  ULONG       BusNumber)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisQueryReceiveInformation(
+    IN  NDIS_HANDLE NdisBindingHandle,
+    IN  NDIS_HANDLE MacContext,
+    OUT PLONGLONG   TimeSent        OPTIONAL,
+    OUT PLONGLONG   TimeReceived    OPTIONAL,
+    IN  PUCHAR      Buffer,
+    IN  UINT        BufferSize,
+    OUT PUINT       SizeNeeded)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisReadMcaPosInformation(
+    OUT PNDIS_STATUS        Status,
+    IN  NDIS_HANDLE         WrapperConfigurationContext,
+    IN  PUINT               ChannelNumber,
+    OUT PNDIS_MCA_POS_DATA  McaData)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisRegisterAdapter(
+    OUT PNDIS_HANDLE    NdisAdapterHandle,
+    IN  NDIS_HANDLE     NdisMacHandle,
+    IN  NDIS_HANDLE     MacAdapterContext,
+    IN  NDIS_HANDLE     WrapperConfigurationContext,
+    IN  PNDIS_STRING    AdapterName,
+    IN  PVOID           AdapterInformation)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisRegisterAdapterShutdownHandler(
+    IN  NDIS_HANDLE                 NdisAdapterHandle,
+    IN  PVOID                       ShutdownContext,
+    IN  ADAPTER_SHUTDOWN_HANDLER    ShutdownHandler)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisRegisterMac(
+    OUT PNDIS_STATUS                Status,
+    OUT PNDIS_HANDLE                NdisMacHandle,
+    IN  NDIS_HANDLE                 NdisWrapperHandle,
+    IN  NDIS_HANDLE                 MacMacContext,
+    IN  PNDIS_MAC_CHARACTERISTICS   MacCharacteristics,
+    IN  UINT                        CharacteristicsLength)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisReleaseAdapterResources(
+    IN  NDIS_HANDLE NdisAdapterHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisRemoveInterrupt(
+    IN  PNDIS_INTERRUPT Interrupt)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisSetupDmaTransfer(
+    OUT PNDIS_STATUS    Status,
+    IN  PNDIS_HANDLE    NdisDmaHandle,
+    IN  PNDIS_BUFFER    Buffer,
+    IN  ULONG           Offset,
+    IN  ULONG           Length,
+    IN  BOOLEAN         WriteToDevice)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisUpdateSharedMemory(
+    IN  NDIS_HANDLE             NdisAdapterHandle,
+    IN  ULONG                   Length,
+    IN  PVOID                   VirtualAddress,
+    IN  NDIS_PHYSICAL_ADDRESS   PhysicalAddress)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 4.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/MAKEFILE b/reactos/drivers/net/ndis/ndis/MAKEFILE
new file mode 100644 (file)
index 0000000..5818975
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
+# file to this component.  This file merely indirects to the real make file
+# that is shared by all the driver components of the Windows NT DDK
+#
+
+!INCLUDE $(NTMAKEENV)\makefile.def
diff --git a/reactos/drivers/net/ndis/ndis/NDIS.DEF b/reactos/drivers/net/ndis/ndis/NDIS.DEF
new file mode 100644 (file)
index 0000000..0e8131d
--- /dev/null
@@ -0,0 +1,314 @@
+; NDIS Kernel Module - ReactOS Operating System
+
+LIBRARY NDIS.SYS
+
+EXPORTS
+ArcFilterDprIndicateReceive
+ArcFilterDprIndicateReceiveComplete
+EthChangeFilterAddresses
+EthCreateFilter
+EthDeleteFilter
+EthDeleteFilterOpenAdapter
+EthFilterAdjust
+;EthFilterDprIndicateReceive ?
+;EthFilterDprIndicateReceiveComplete ?
+EthFilterIndicateReceive
+EthFilterIndicateReceiveComplete
+EthNoteFilterOpenAdapter
+EthNumberOfOpenFilterAddresses
+EthQueryGlobalFilterAddresses
+EthQueryOpenFilterAddresses
+EthShouldAddressLoopBack
+FddiChangeFilterLongAddresses
+FddiChangeFilterShortAddresses
+FddiCreateFilter
+FddiDeleteFilter
+FddiDeleteFilterOpenAdapter
+FddiFilterAdjust
+;FddiFilterDprIndicateReceive ?
+;FddiFilterDprIndicateReceiveComplete ?
+FddiFilterIndicateReceive
+FddiFilterIndicateReceiveComplete
+FddiNoteFilterOpenAdapter
+FddiNumberOfOpenFilterLongAddresses
+FddiNumberOfOpenFilterShortAddresses
+FddiQueryGlobalFilterLongAddresses
+FddiQueryGlobalFilterShortAddresses
+FddiQueryOpenFilterLongAddresses
+FddiQueryOpenFilterShortAddresses
+FddiShouldAddressLoopBack
+NDIS_BUFFER_TO_SPAN_PAGES
+NdisAcquireReadWriteLock
+NdisAcquireSpinLock
+NdisAdjustBufferLength
+NdisAllocateBuffer
+NdisAllocateBufferPool
+NdisAllocateDmaChannel
+NdisAllocateMemory
+NdisAllocateMemoryWithTag
+NdisAllocatePacket
+NdisAllocatePacketPool
+NdisAllocatePacketPoolEx
+NdisAllocateSharedMemory
+NdisAllocateSpinLock
+NdisAnsiStringToUnicodeString
+NdisBufferLength
+NdisBufferVirtualAddress
+NdisCancelTimer
+NdisClAddParty
+NdisClCloseAddressFamily
+NdisClCloseCall
+NdisClDeregisterSap
+NdisClDropParty
+NdisClIncomingCallComplete
+NdisClMakeCall
+NdisClModifyCallQoS
+NdisClOpenAddressFamily
+NdisClRegisterSap
+NdisCloseAdapter
+NdisCloseConfiguration
+NdisCloseFile
+NdisCmActivateVc
+NdisCmAddPartyComplete
+NdisCmCloseAddressFamilyComplete
+NdisCmCloseCallComplete
+NdisCmDeactivateVc
+NdisCmDeregisterSapComplete
+NdisCmDispatchCallConnected
+NdisCmDispatchIncomingCall
+NdisCmDispatchIncomingCallQoSChange
+NdisCmDispatchIncomingCloseCall
+NdisCmDispatchIncomingDropParty
+NdisCmDropPartyComplete
+NdisCmMakeCallComplete
+NdisCmModifyCallQoSComplete
+NdisCmOpenAddressFamilyComplete
+NdisCmRegisterAddressFamily
+NdisCmRegisterSapComplete
+NdisCoCreateVc
+NdisCoDeleteVc
+NdisCoRequest
+NdisCoRequestComplete
+NdisCoSendPackets
+;NdisCompareAnsiString ?
+;NdisCompareUnicodeString ?
+NdisCompleteBindAdapter
+NdisCompleteCloseAdapter
+NdisCompleteDmaTransfer
+NdisCompleteOpenAdapter
+NdisCompletePnPEvent
+NdisCompleteQueryStatistics
+NdisCompleteUnbindAdapter
+NdisConvertStringToAtmAddress
+NdisCopyBuffer
+NdisCopyFromPacketToPacket
+NdisDeregisterAdapter
+NdisDeregisterAdapterShutdownHandler
+NdisDeregisterMac
+NdisDeregisterProtocol
+NdisDprAcquireSpinLock
+NdisDprAllocatePacket
+NdisDprAllocatePacketNonInterlocked
+NdisDprFreePacket
+NdisDprFreePacketNonInterlocked
+NdisDprReleaseSpinLock
+NdisEqualString
+NdisFlushBuffer
+NdisFreeBuffer
+NdisFreeBufferPool
+NdisFreeDmaChannel
+NdisFreeMemory
+NdisFreePacket
+NdisFreePacketPool
+NdisFreeSharedMemory
+NdisFreeSpinLock
+NdisGetBufferPhysicalArraySize
+NdisGetCurrentProcessorCounts
+NdisGetCurrentProcessorCpuUsage
+NdisGetCurrentSystemTime
+NdisGetDriverHandle
+NdisGetFirstBufferFromPacket
+NdisGetReceivedPacket
+NdisGetSystemUptime
+NdisIMAssociateMiniport
+NdisIMCancelInitializeDeviceInstance
+NdisIMCopySendCompletePerPacketInfo
+NdisIMCopySendPerPacketInfo
+NdisIMDeInitializeDeviceInstance
+NdisIMDeregisterLayeredMiniport
+NdisIMGetBindingContext
+NdisIMGetDeviceContext
+NdisIMInitializeDeviceInstance
+NdisIMInitializeDeviceInstanceEx
+NdisImmediateReadPciSlotInformation
+NdisImmediateReadPortUchar
+NdisImmediateReadPortUlong
+NdisImmediateReadPortUshort
+NdisImmediateReadSharedMemory
+NdisImmediateWritePciSlotInformation
+NdisImmediateWritePortUchar
+NdisImmediateWritePortUlong
+NdisImmediateWritePortUshort
+NdisImmediateWriteSharedMemory
+NdisIMQueueMiniportCallback
+NdisIMRegisterLayeredMiniport
+NdisIMRevertBack
+NdisIMSwitchToMiniport
+NdisInitAnsiString
+NdisInitializeEvent
+NdisInitializeInterrupt
+NdisInitializeReadWriteLock
+NdisInitializeString
+NdisInitializeTimer
+NdisInitializeWrapper
+NdisInitUnicodeString
+;NdisInterlockedAddLargeInterger ?
+NdisInterlockedAddUlong
+NdisInterlockedDecrement
+NdisInterlockedIncrement
+NdisInterlockedInsertHeadList
+NdisInterlockedInsertTailList
+NdisInterlockedPopEntrySList
+NdisInterlockedPushEntrySList
+NdisInterlockedRemoveHeadList
+NdisMAllocateMapRegisters
+NdisMAllocateSharedMemory
+NdisMAllocateSharedMemoryAsync
+NdisMapFile
+NdisMapIoSpace
+;NdisMatchPdoWithPacket ?
+NdisMCancelTimer
+NdisMCloseLog
+NdisMCmActivateVc
+NdisMCmCreateVc
+NdisMCmDeactivateVc
+NdisMCmDeleteVc
+NdisMCmRegisterAddressFamily
+NdisMCmRequest
+NdisMCoActivateVcComplete
+NdisMCoDeactivateVcComplete
+NdisMCoIndicateReceivePacket
+NdisMCoIndicateStatus
+NdisMCompleteBufferPhysicalMapping
+NdisMCoReceiveComplete
+NdisMCoRequestComplete
+NdisMCoSendComplete
+NdisMCreateLog
+NdisMDeregisterAdapterShutdownHandler
+NdisMDeregisterDevice
+NdisMDeregisterDmaChannel
+NdisMDeregisterInterrupt
+NdisMDeregisterIoPortRange
+NdisMFlushLog
+NdisMFreeMapRegisters
+NdisMFreeSharedMemory
+NdisMGetDeviceProperty
+NdisMIndicateStatus
+NdisMIndicateStatusComplete
+NdisMInitializeScatterGatherDma
+NdisMInitializeTimer
+NdisMMapIoSpace
+NdisMPciAssignResources
+NdisMPromoteMiniport
+NdisMQueryAdapterInstanceName
+NdisMQueryAdapterResources
+NdisMQueryInformationComplete
+NdisMReadDmaCounter
+NdisMRegisterAdapterShutdownHandler
+NdisMRegisterDevice
+NdisMRegisterDmaChannel
+NdisMRegisterInterrupt
+NdisMRegisterIoPortRange
+NdisMRegisterMiniport
+NdisMRegisterUnloadHandler
+NdisMRemoveMiniport
+NdisMResetComplete
+NdisMSendComplete
+NdisMSendResourcesAvailable
+NdisMSetAttributes
+NdisMSetAttributesEx
+NdisMSetInformationComplete
+NdisMSetMiniportSecondary
+NdisMSetPeriodicTimer
+NdisMSetTimer
+NdisMSleep
+NdisMStartBufferPhysicalMapping
+NdisMSynchronizeWithInterrupt
+NdisMTransferDataComplete
+NdisMUnmapIoSpace
+NdisMWanIndicateReceive
+NdisMWanIndicateReceiveComplete
+NdisMWanSendComplete
+NdisMWriteLogData
+NdisOpenAdapter
+NdisOpenConfiguration
+NdisOpenConfigurationKeyByIndex
+NdisOpenConfigurationKeyByName
+NdisOpenFile
+NdisOpenProtocolConfiguration
+;NdisOverrideBusNumber ?
+NdisPacketPoolUsage
+NdisPciAssignResources
+NdisQueryAdapterInstanceName
+;NdisQueryBindInstanceName?
+NdisQueryBuffer
+NdisQueryBufferOffset
+NdisQueryBufferSafe
+NdisQueryMapRegisterCount
+NdisReadConfiguration
+NdisReadEisaSlotInformation
+NdisReadEisaSlotInformationEx
+NdisReadMcaPosInformation
+NdisReadNetworkAddress
+NdisReadPciSlotInformation
+NdisReadPcmciaAttributeMemory
+;NdisReEnumerateProtocolBindings ?
+NdisRegisterAdapter
+NdisRegisterAdapterShutdownHandler
+NdisRegisterMac
+NdisRegisterProtocol
+;NdisRegisterTdiCallBack ?
+NdisReleaseAdapterResources
+NdisReleaseReadWriteLock
+NdisReleaseSpinLock
+NdisRemoveInterrupt
+NdisRequest
+NdisReset
+NdisResetEvent
+NdisReturnPackets
+NdisSend
+NdisSendPackets
+NdisSetEvent
+;NdisSetPacketPoolProtocolId ?
+;NdisSetProtocolFilter ?
+NdisSetTimer
+NdisSetupDmaTransfer
+NdisSystemProcessorCount
+NdisTerminateWrapper
+NdisTransferData
+NdisUnchainBufferAtBack
+NdisUnchainBufferAtFront
+NdisUnicodeStringToAnsiString
+NdisUnmapFile
+NdisUpcaseUnicodeString
+NdisUpdateSharedMemory
+NdisWaitEvent
+NdisWriteConfiguration
+;NdisWriteErrorLogEntry
+NdisWriteEventLogEntry
+NdisWritePciSlotInformation
+NdisWritePcmciaAttributeMemory
+TrChangeFunctionalAddress
+TrChangeGroupAddress
+TrCreateFilter
+TrDeleteFilter
+TrDeleteFilterOpenAdapter
+TrFilterAdjust
+;TrFilterDprIndicateReceive
+;TrFilterDprIndicateReceiveComplete
+TrFilterIndicateReceive
+TrFilterIndicateReceiveComplete
+TrNoteFilterOpenAdapter
+TrShouldAddressLoopBack
+
+; EOF
diff --git a/reactos/drivers/net/ndis/ndis/RESOURCE.RC b/reactos/drivers/net/ndis/ndis/RESOURCE.RC
new file mode 100644 (file)
index 0000000..3a8ee55
--- /dev/null
@@ -0,0 +1,10 @@
+#include <windows.h>
+#include <ntverp.h>
+
+#define        VER_FILETYPE                VFT_DRV
+#define        VER_FILESUBTYPE             VFT2_DRV_NETWORK
+#define VER_FILEDESCRIPTION_STR     "NDIS library"
+#define VER_INTERNALNAME_STR        "NDIS.SYS"
+#define VER_ORIGINALFILENAME_STR    "NDIS.SYS"
+
+#include "common.ver"
diff --git a/reactos/drivers/net/ndis/ndis/SOURCES b/reactos/drivers/net/ndis/ndis/SOURCES
new file mode 100644 (file)
index 0000000..692b996
--- /dev/null
@@ -0,0 +1,29 @@
+TARGETNAME=ndis
+TARGETPATH=..\objects
+TARGETTYPE=EXPORT_DRIVER
+
+TARGETLIBS=
+
+C_DEFINES=$(C_DEFINES) -DUNICODE -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1
+
+INCLUDES=..\include;..\..\..\..\include\net;$(BASEDIR)\INC
+
+SOURCES= 40gone.c \
+         50gone.c \
+         buffer.c \
+         cl.c \
+         cm.c \
+         co.c \
+                control.c \
+                hardware.c \
+                io.c \
+         main.c \
+                memory.c \
+         miniport.c \
+                protocol.c \
+                string.c \
+         stubs.c \
+                time.c \
+         RESOURCE.RC
+
+MSC_WARNING_LEVEL=/W3 /WX
diff --git a/reactos/drivers/net/ndis/ndis/buffer.c b/reactos/drivers/net/ndis/ndis/buffer.c
new file mode 100644 (file)
index 0000000..b989ab8
--- /dev/null
@@ -0,0 +1,772 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/buffer.c
+ * PURPOSE:     Buffer management routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <buffer.h>
+
+
+VOID
+EXPORT
+NdisAdjustBufferLength(
+    IN PNDIS_BUFFER Buffer,
+    IN UINT         Length)
+/*
+ * FUNCTION: Modifies the length of an NDIS buffer
+ * ARGUMENTS:
+ *     Buffer = Pointer to NDIS buffer descriptor
+ *     Length = New size of buffer
+ */
+{
+    Buffer->ByteCount = Length;
+}
+
+
+ULONG
+EXPORT
+NDIS_BUFFER_TO_SPAN_PAGES(
+    IN  PNDIS_BUFFER    Buffer)
+/*
+ * FUNCTION: Determines how many physical pages a buffer is made of
+ * ARGUMENTS:
+ *     Buffer = Pointer to NDIS buffer descriptor
+ */
+{
+    if (MmGetMdlByteCount(Buffer) == 0)
+        return 1;
+    
+    return ADDRESS_AND_SIZE_TO_SPAN_PAGES(
+            MmGetMdlVirtualAddress(Buffer),
+            MmGetMdlByteCount(Buffer));
+}
+
+
+VOID
+EXPORT
+NdisAllocateBuffer(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_BUFFER    * Buffer,
+    IN  NDIS_HANDLE     PoolHandle,
+    IN  PVOID           VirtualAddress,
+    IN  UINT            Length)
+/*
+ * FUNCTION: Allocates an NDIS buffer descriptor
+ * ARGUMENTS:
+ *     Status         = Address of buffer for status
+ *     Buffer         = Address of buffer for NDIS buffer descriptor
+ *     PoolHandle     = Handle returned by NdisAllocateBufferPool
+ *     VirtualAddress = Pointer to virtual address of data buffer
+ *     Length         = Number of bytes in data buffer
+ */
+{
+    KIRQL OldIrql;
+    PNETWORK_HEADER Temp;
+    PNDIS_BUFFER_POOL Pool = (PNDIS_BUFFER_POOL)PoolHandle;
+
+    NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X)  Buffer (0x%X)  PoolHandle (0x%X)  "
+        "VirtualAddress (0x%X)  Length (%d)\n",
+        Status, Buffer, PoolHandle, VirtualAddress, Length));
+
+    KeAcquireSpinLock(&Pool->SpinLock, &OldIrql);
+
+    if (Pool->FreeList) {
+        Temp           = Pool->FreeList;
+        Pool->FreeList = Temp->Next;
+
+        KeReleaseSpinLock(&Pool->SpinLock, OldIrql);
+
+        Temp->Next = NULL;
+
+#ifdef _MSC_VER
+        MmInitializeMdl(&Temp->Mdl, VirtualAddress, Length);
+        Temp->Mdl.MdlFlags      |= (MDL_SOURCE_IS_NONPAGED_POOL | MDL_ALLOCATED_FIXED_SIZE);
+        Temp->Mdl.MappedSystemVa = VirtualAddress;
+#else
+           Temp->Mdl.Next = (PMDL)NULL;
+           Temp->Mdl.Size = (CSHORT)(sizeof(MDL) +
+            (ADDRESS_AND_SIZE_TO_SPAN_PAGES(VirtualAddress, Length) * sizeof(ULONG)));
+           Temp->Mdl.MdlFlags   = (MDL_SOURCE_IS_NONPAGED_POOL | MDL_ALLOCATED_FIXED_SIZE);
+;          Temp->Mdl.StartVa    = (PVOID)PAGE_ROUND_DOWN(VirtualAddress);
+           Temp->Mdl.ByteOffset = (ULONG_PTR)(VirtualAddress - PAGE_ROUND_DOWN(VirtualAddress));
+           Temp->Mdl.ByteCount  = Length;
+        Temp->Mdl.MappedSystemVa = VirtualAddress;
+#if 0
+           //Temp->Mdl.Process    = PsGetCurrentProcess();
+#else
+        Temp->Mdl.Process    = NULL;
+#endif
+#endif
+        
+        Temp->BufferPool = Pool;
+
+        *Buffer = (PNDIS_BUFFER)Temp;
+        *Status = NDIS_STATUS_SUCCESS;
+    } else {
+        KeReleaseSpinLock(&Pool->SpinLock, OldIrql);
+        *Status = NDIS_STATUS_FAILURE;
+    }
+}
+
+
+VOID
+EXPORT
+NdisAllocateBufferPool(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_HANDLE    PoolHandle,
+    IN  UINT            NumberOfDescriptors)
+/*
+ * FUNCTION: Allocates storage for an NDIS buffer pool
+ * ARGUMENTS:
+ *     Status              = Address of buffer for status
+ *     PoolHandle          = Address of buffer for pool handle
+ *     NumberOfDescriptors = Size of buffer pool in number of descriptors
+ */
+{
+    UINT i;
+    PNDIS_BUFFER_POOL Pool;
+    PNETWORK_HEADER Buffer;
+
+    NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X)  PoolHandle (0x%X)  NumberOfDescriptors (%d).\n",
+        Status, PoolHandle, NumberOfDescriptors));
+
+    Pool = ExAllocatePool(NonPagedPool,
+                          sizeof(NDIS_BUFFER_POOL) +
+                          sizeof(NETWORK_HEADER)   *
+                          NumberOfDescriptors);
+    if (Pool) {
+        KeInitializeSpinLock(&Pool->SpinLock);
+
+        if (NumberOfDescriptors > 0) {
+            Buffer             = &Pool->Buffers[0];
+            Pool->FreeList     = Buffer;
+            for (i = 1; i < NumberOfDescriptors; i++) {
+                Buffer->Next = &Pool->Buffers[i];
+                Buffer       = Buffer->Next;
+            }
+            Buffer->Next = NULL;
+        } else
+            Pool->FreeList = NULL;
+
+        *Status     = NDIS_STATUS_SUCCESS;
+        *PoolHandle = (PNDIS_HANDLE)Pool;
+    } else
+        *Status = NDIS_STATUS_RESOURCES;
+}
+
+
+VOID
+EXPORT
+NdisAllocatePacket(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_PACKET    * Packet,
+    IN  NDIS_HANDLE     PoolHandle)
+/*
+ * FUNCTION: Allocates an NDIS packet descriptor
+ * ARGUMENTS:
+ *     Status     = Address of buffer for status
+ *     Packet     = Address of buffer for packet descriptor
+ *     PoolHandle = Handle returned by NdisAllocatePacketPool
+ */
+{
+    KIRQL OldIrql;
+    PNDIS_PACKET Temp;
+    PNDIS_PACKET_POOL Pool = (PNDIS_PACKET_POOL)PoolHandle;
+
+    NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X)  Packet (0x%X)  PoolHandle (0x%X).\n",
+        Status, Packet, PoolHandle));
+
+    KeAcquireSpinLock(&Pool->SpinLock.SpinLock, &OldIrql);
+
+    if (Pool->FreeList) {
+        Temp           = Pool->FreeList;
+        Pool->FreeList = (PNDIS_PACKET)Temp->Private.Head;
+
+        KeReleaseSpinLock(&Pool->SpinLock.SpinLock, OldIrql);
+
+        RtlZeroMemory(&Temp->Private, sizeof(NDIS_PACKET_PRIVATE));
+        Temp->Private.Pool = Pool;
+
+        *Packet = Temp;
+        *Status = NDIS_STATUS_SUCCESS;
+    } else {
+        *Status = NDIS_STATUS_RESOURCES;
+        KeReleaseSpinLock(&Pool->SpinLock.SpinLock, OldIrql);
+    }
+}
+
+
+VOID
+EXPORT
+NdisAllocatePacketPool(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_HANDLE    PoolHandle,
+    IN  UINT            NumberOfDescriptors,
+    IN  UINT            ProtocolReservedLength)
+/*
+ * FUNCTION: Allocates storage for an NDIS packet pool
+ * ARGUMENTS:
+ *     Status                 = Address of buffer for status
+ *     PoolHandle             = Address of buffer for pool handle
+ *     NumberOfDescriptors    = Size of packet pool in number of descriptors
+ *     ProtocolReservedLength = Size of protocol reserved area in bytes
+ */
+{
+    PNDIS_PACKET_POOL Pool;
+    UINT Size, Length, i;
+    PNDIS_PACKET Packet, NextPacket;
+
+    NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X)  PoolHandle (0x%X)  "
+        "NumberOfDescriptors (%d)  ProtocolReservedLength (%d).\n",
+        Status, PoolHandle, NumberOfDescriptors, ProtocolReservedLength));
+
+    Length = sizeof(NDIS_PACKET) + ProtocolReservedLength;
+    Size   = sizeof(NDIS_PACKET_POOL) + Length * NumberOfDescriptors;
+
+    Pool   = ExAllocatePool(NonPagedPool, Size);
+    if (Pool) {
+        KeInitializeSpinLock(&Pool->SpinLock.SpinLock);
+        Pool->PacketLength = Length;
+
+        if (NumberOfDescriptors > 0) {
+            Packet         = (PNDIS_PACKET)&Pool->Buffer;
+            Pool->FreeList = Packet;
+
+            NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length);
+            for (i = 1; i < NumberOfDescriptors; i++) {
+                Packet->Private.Head = (PNDIS_BUFFER)NextPacket;
+                Packet               = NextPacket;
+                NextPacket           = (PNDIS_PACKET)((ULONG_PTR)Packet + Length);
+            }
+            Packet->Private.Head = NULL;
+        } else
+            Pool->FreeList = NULL;
+
+        *Status     = NDIS_STATUS_SUCCESS;
+        *PoolHandle = (PNDIS_HANDLE)Pool;
+    } else
+        *Status = NDIS_STATUS_RESOURCES;
+}
+
+
+VOID
+EXPORT
+NdisAllocatePacketPoolEx(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_HANDLE    PoolHandle,
+    IN  UINT            NumberOfDescriptors,
+    IN  UINT            NumberOfOverflowDescriptors,
+    IN  UINT            ProtocolReservedLength)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+ULONG
+EXPORT
+NdisBufferLength(
+    IN  PNDIS_BUFFER    Buffer)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return 0;
+}
+
+
+PVOID
+EXPORT
+NdisBufferVirtualAddress(
+    IN  PNDIS_BUFFER    Buffer)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NULL;
+}
+
+
+VOID
+EXPORT
+NdisCopyBuffer(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_BUFFER    *Buffer,
+    IN  NDIS_HANDLE     PoolHandle,
+    IN  PVOID           MemoryDescriptor,
+    IN  UINT            Offset,
+    IN  UINT            Length)
+/*
+ * FUNCTION: Returns a new buffer descriptor for a (partial) buffer
+ * ARGUMENTS:
+ *     Status           = Address of a buffer to place status of operation
+ *     Buffer           = Address of a buffer to place new buffer descriptor
+ *     PoolHandle       = Handle returned by NdisAllocateBufferPool
+ *     MemoryDescriptor = Pointer to a memory descriptor (possibly NDIS_BUFFER)
+ *     Offset           = Offset in buffer to start copying
+ *     Length           = Number of bytes to copy
+ */
+{
+    *Status = NDIS_STATUS_FAILURE;
+}
+
+
+__inline ULONG SkipToOffset(
+    PNDIS_BUFFER Buffer,
+    UINT Offset,
+    PVOID *Data,
+    PUINT Size)
+/*
+ * FUNCTION: Skips Offset bytes into a buffer chain
+ * ARGUMENTS:
+ *     Buffer = Pointer to NDIS buffer
+ *     Offset = Number of bytes to skip
+ *     Data   = Address of a pointer that on return will contain the
+ *              address of the offset in the buffer
+ *     Size   = Address of a pointer that on return will contain the
+ *              size of the destination buffer
+ * RETURNS:
+ *     Offset into buffer, -1 if buffer chain was smaller than Offset bytes
+ * NOTES:
+ *     Buffer may be NULL
+ */
+{
+    ULONG Address = 0;
+
+    for (;;) {
+
+        if (!Buffer)
+            return -1;
+
+        NdisQueryBuffer(Buffer, Data, Size);
+
+        if (Offset < *Size) {
+            Address += Offset;
+            *Size   -= Offset;
+            break;
+        }
+
+        Offset -= *Size;
+
+        NdisGetNextBuffer(Buffer, &Buffer);
+    }
+
+    *Data = (PVOID)Address;
+
+    return Offset;
+}
+
+
+VOID
+EXPORT
+NdisCopyFromPacketToPacket(
+    IN  PNDIS_PACKET    Destination,
+    IN  UINT            DestinationOffset,
+    IN  UINT            BytesToCopy,
+    IN  PNDIS_PACKET    Source,
+    IN  UINT            SourceOffset,
+    OUT PUINT           BytesCopied)
+/*
+ * FUNCTION: Copies data from one packet to another
+ * ARGUMENTS:
+ *     Destination       = Pointer to packet to copy data to
+ *     DestinationOffset = Offset in destination packet to copy data to
+ *     BytesToCopy       = Number of bytes to copy
+ *     Source            = Pointer to packet descriptor to copy from
+ *     SourceOffset      = Offset in source packet to start copying from
+ *     BytesCopied       = Address of buffer to place number of bytes copied
+ */
+{
+    PNDIS_BUFFER SrcBuffer;
+    PNDIS_BUFFER DstBuffer;
+    PVOID DstData, SrcData;
+    UINT DstSize, SrcSize;
+    UINT Count, Total;
+
+    *BytesCopied = 0;
+
+    /* Skip DestinationOffset bytes in the destination packet */
+    NdisGetFirstBufferFromPacket(Destination, &DstBuffer, &DstData, &DstSize, &Total);
+    if (SkipToOffset(DstBuffer, DestinationOffset, &DstData, &DstSize) == -1)
+        return;
+
+    /* Skip SourceOffset bytes in the source packet */
+    NdisGetFirstBufferFromPacket(Source, &SrcBuffer, &SrcData, &SrcSize, &Total);
+    if (SkipToOffset(SrcBuffer, SourceOffset, &SrcData, &SrcSize) == -1)
+        return;
+
+    /* Copy the data */
+    for (Total = 0;;) {
+        /* Find out how many bytes we can copy at one time */
+        if (BytesToCopy < SrcSize)
+            Count = BytesToCopy;
+        else
+            Count = SrcSize;
+        if (DstSize < Count)
+            Count = DstSize;
+
+        RtlCopyMemory(DstData, SrcData, Count);
+
+        Total       += Count;
+        BytesToCopy -= Count;
+        if (BytesToCopy == 0)
+            break;
+
+        DstSize -= Count;
+        if (DstSize == 0) {
+            /* No more bytes in destination buffer. Proceed to
+               the next buffer in the destination buffer chain */
+            NdisGetNextBuffer(DstBuffer, &DstBuffer);
+            if (!DstBuffer)
+                break;
+
+            NdisQueryBuffer(DstBuffer, &DstData, &DstSize);
+        }
+
+        SrcSize -= Count;
+        if (SrcSize == 0) {
+            /* No more bytes in source buffer. Proceed to
+               the next buffer in the source buffer chain */
+            NdisGetNextBuffer(SrcBuffer, &SrcBuffer);
+            if (!SrcBuffer)
+                break;
+
+            NdisQueryBuffer(SrcBuffer, &SrcData, &SrcSize);
+        }
+    }
+
+    *BytesCopied = Total;
+}
+
+
+VOID
+EXPORT
+NdisDprAllocatePacket(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_PACKET    *Packet,
+    IN  NDIS_HANDLE     PoolHandle)
+/*
+ * FUNCTION: Allocates a packet at IRQL DISPATCH_LEVEL
+ * ARGUMENTS:
+ *     Status     = Address of buffer to place status of operation
+ *     Packet     = Address of buffer to place a pointer to a packet descriptor
+ *     PoolHandle = Handle returned by NdisAllocatePacketPool
+ */
+{
+}
+
+
+VOID
+EXPORT
+NdisDprAllocatePacketNonInterlocked(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_PACKET    *Packet,
+    IN NDIS_HANDLE      PoolHandle)
+/*
+ * FUNCTION: Allocates a packet at IRQL DISPATCH_LEVEL (w/o synchronization)
+ * ARGUMENTS:
+ *     Status     = Address of buffer to place status of operation
+ *     Packet     = Address of buffer to place a pointer to a packet descriptor
+ *     PoolHandle = Handle returned by NdisAllocatePacketPool
+ */
+{
+    *Status = NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisDprFreePacket(
+    IN  PNDIS_PACKET    Packet)
+/*
+ * FUNCTION: Frees a packet at IRQL DISPATCH_LEVEL
+ * ARGUMENTS:
+ *     Packet = Pointer to packet to free
+ */
+{
+}
+
+
+VOID
+EXPORT
+NdisDprFreePacketNonInterlocked(
+    IN  PNDIS_PACKET    Packet)
+/*
+ * FUNCTION: Frees a packet at IRQL DISPATCH_LEVEL (w/o synchronization)
+ * ARGUMENTS:
+ *     Packet = Pointer to packet to free
+ */
+{
+}
+
+
+VOID
+EXPORT
+NdisFreeBufferPool(
+    IN  NDIS_HANDLE PoolHandle)
+/*
+ * FUNCTION: Frees storage allocated for an NDIS buffer pool
+ * ARGUMENTS:
+ *     PoolHandle = Handle returned by NdisAllocateBufferPool
+ */
+{
+    ExFreePool((PVOID)PoolHandle);
+}
+
+
+VOID
+EXPORT
+NdisFreePacketPool(
+    IN  NDIS_HANDLE PoolHandle)
+/*
+ * FUNCTION: Frees storage allocated for an NDIS packet pool
+ * ARGUMENTS:
+ *     PoolHandle = Handle returned by NdisAllocatePacketPool
+ */
+{
+    ExFreePool((PVOID)PoolHandle);
+}
+
+
+VOID
+EXPORT
+NdisFreeBuffer(
+    IN   PNDIS_BUFFER   Buffer)
+/*
+ * FUNCTION: Puts an NDIS buffer descriptor back in it's pool
+ * ARGUMENTS:
+ *     Buffer = Pointer to buffer descriptor
+ */
+{
+    KIRQL OldIrql;
+    PNDIS_BUFFER_POOL Pool;
+    PNETWORK_HEADER Temp = (PNETWORK_HEADER)Buffer;
+
+    NDIS_DbgPrint(MAX_TRACE, ("Buffer (0x%X).\n", Buffer));
+
+    Pool = Temp->BufferPool;
+
+    KeAcquireSpinLock(&Pool->SpinLock, &OldIrql);
+    Buffer->Next   = (PMDL)Pool->FreeList;
+    Pool->FreeList = (PNETWORK_HEADER)Buffer;
+    KeReleaseSpinLock(&Pool->SpinLock, OldIrql);
+}
+
+
+VOID
+EXPORT
+NdisFreePacket(
+    IN   PNDIS_PACKET   Packet)
+/*
+ * FUNCTION: Puts an NDIS packet descriptor back in it's pool
+ * ARGUMENTS:
+ *     Packet = Pointer to packet descriptor
+ */
+{
+    KIRQL OldIrql;
+
+    NDIS_DbgPrint(MAX_TRACE, ("Packet (0x%X).\n", Packet));
+
+    KeAcquireSpinLock(&Packet->Private.Pool->SpinLock.SpinLock, &OldIrql);
+    Packet->Private.Head           = (PNDIS_BUFFER)Packet->Private.Pool->FreeList;
+    Packet->Private.Pool->FreeList = Packet;
+    KeReleaseSpinLock(&Packet->Private.Pool->SpinLock.SpinLock, OldIrql);
+}
+
+
+VOID
+EXPORT
+NdisGetBufferPhysicalArraySize(
+    IN  PNDIS_BUFFER    Buffer,
+    OUT PUINT           ArraySize)
+/*
+ * FUNCTION: Returns number of discontiguous physical blocks backing a buffer
+ * ARGUMENTS:
+ *     Buffer    = Pointer to buffer descriptor
+ *     ArraySize = Address of buffer to place number of physical blocks
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisGetFirstBufferFromPacket(
+    IN  PNDIS_PACKET    _Packet,
+    OUT PNDIS_BUFFER    *_FirstBuffer,
+    OUT PVOID           *_FirstBufferVA,
+    OUT PUINT           _FirstBufferLength,
+    OUT PUINT           _TotalBufferLength)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisReturnPackets(
+    IN  PNDIS_PACKET    *PacketsToReturn,
+    IN  UINT            NumberOfPackets)
+/*
+ * FUNCTION: Releases ownership of one or more packets
+ * ARGUMENTS:
+ *     PacketsToReturn = Pointer to an array of pointers to packet descriptors
+ *     NumberOfPackets = Number of pointers in descriptor pointer array
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+UINT
+EXPORT
+NdisPacketPoolUsage(
+    IN  NDIS_HANDLE PoolHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return 0;
+}
+
+
+VOID
+EXPORT
+NdisQueryBuffer(
+    IN  PNDIS_BUFFER    Buffer,
+    OUT PVOID           *VirtualAddress OPTIONAL,
+    OUT PUINT           Length)
+/*
+ * FUNCTION:
+ *     Queries an NDIS buffer for information
+ * ARGUMENTS:
+ *     Buffer         = Pointer to NDIS buffer to query
+ *     VirtualAddress = Address of buffer to place virtual address
+ *     Length         = Address of buffer to place length of buffer
+ */
+{
+       if (VirtualAddress != NULL)
+               *(PVOID*)VirtualAddress = MmGetSystemAddressForMdl(Buffer);
+
+       *Length = MmGetMdlByteCount(Buffer);
+}
+
+
+VOID
+EXPORT
+NdisQueryBufferOffset(
+    IN  PNDIS_BUFFER    Buffer,
+    OUT PUINT           Offset,
+    OUT PUINT           Length)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisUnchainBufferAtBack(
+    IN OUT  PNDIS_PACKET    Packet,
+    OUT     PNDIS_BUFFER    *Buffer)
+/*
+ * FUNCTION:
+ *     Removes the last buffer in a packet
+ * ARGUMENTS:
+ *     Packet = Pointer to NDIS packet
+ *     Buffer = Address of buffer to place pointer to removed NDIS buffer
+ */
+{
+       PNDIS_BUFFER NdisBuffer, Previous;
+
+    NdisQueryPacket(Packet,
+                    NULL,
+                    NULL,
+                    &NdisBuffer,
+                    NULL);
+    if (!NdisBuffer) {
+        *Buffer = NULL;
+        return;
+    }
+
+    Previous = NULL;
+    while (NdisBuffer->Next) {
+        Previous   = NdisBuffer;
+        NdisBuffer = NdisBuffer->Next;
+    }
+
+    if (Previous) {
+        Previous->Next       = NULL;
+        Packet->Private.Tail = Previous;
+    } else {
+        Packet->Private.Head = NULL;
+        Packet->Private.Tail = NULL;
+    }
+
+    Packet->Private.ValidCounts = FALSE;
+
+    *Buffer = NdisBuffer;
+}
+
+
+VOID
+EXPORT
+NdisUnchainBufferAtFront(
+    IN OUT  PNDIS_PACKET    Packet,
+    OUT     PNDIS_BUFFER    *Buffer)
+/*
+ * FUNCTION:
+ *     Removes the first buffer in a packet
+ * ARGUMENTS:
+ *     Packet = Pointer to NDIS packet
+ *     Buffer = Address of buffer to place pointer to removed NDIS buffer
+ */
+{
+       PNDIS_BUFFER NdisBuffer;
+
+    NdisQueryPacket(Packet,
+                    NULL,
+                    NULL,
+                    &NdisBuffer,
+                    NULL);
+    if (!NdisBuffer) {
+        *Buffer = NULL;
+        return;
+    }
+
+    Packet->Private.Head = NdisBuffer->Next;
+
+    if (!NdisBuffer->Next)
+        Packet->Private.Tail = NULL;
+
+    NdisBuffer->Next = NULL;
+
+    Packet->Private.ValidCounts = FALSE;
+
+    *Buffer = NdisBuffer;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/cl.c b/reactos/drivers/net/ndis/ndis/cl.c
new file mode 100644 (file)
index 0000000..7a24f74
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/cl.c
+ * PURPOSE:     Services for connectionless NDIS drivers
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+NDIS_STATUS
+EXPIMP
+NdisClAddParty(
+    IN      NDIS_HANDLE         NdisVcHandle,
+    IN      NDIS_HANDLE         ProtocolPartyContext,
+    IN OUT  PCO_CALL_PARAMETERS CallParameters,
+    OUT     PNDIS_HANDLE        NdisPartyHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClCloseAddressFamily(
+    IN  NDIS_HANDLE NdisAfHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClCloseCall(
+    IN  NDIS_HANDLE NdisVcHandle,
+    IN  NDIS_HANDLE NdisPartyHandle OPTIONAL,
+    IN  PVOID       Buffer          OPTIONAL,
+    IN  UINT        Size)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClDeregisterSap(
+    IN  NDIS_HANDLE NdisSapHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClDropParty(
+    IN  NDIS_HANDLE NdisPartyHandle,
+    IN  PVOID       Buffer  OPTIONAL,
+    IN  UINT        Size)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPIMP
+NdisClIncomingCallComplete(
+    IN  NDIS_STATUS         Status,
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClMakeCall(
+    IN      NDIS_HANDLE         NdisVcHandle,
+    IN OUT  PCO_CALL_PARAMETERS CallParameters,
+    IN      NDIS_HANDLE         ProtocolPartyContext    OPTIONAL,
+    OUT     PNDIS_HANDLE        NdisPartyHandle         OPTIONAL)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS 
+EXPIMP
+NdisClModifyCallQoS(
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClOpenAddressFamily(
+    IN  NDIS_HANDLE                     NdisBindingHandle,
+    IN  PCO_ADDRESS_FAMILY              AddressFamily,
+    IN  NDIS_HANDLE                     ProtocolAfContext,
+    IN  PNDIS_CLIENT_CHARACTERISTICS    ClCharacteristics,
+    IN  UINT                            SizeOfClCharacteristics,
+    OUT PNDIS_HANDLE                    NdisAfHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPIMP
+NdisClRegisterSap(
+    IN  NDIS_HANDLE     NdisAfHandle,
+    IN  NDIS_HANDLE     ProtocolSapContext,
+    IN  PCO_SAP         Sap,
+    OUT PNDIS_HANDLE    NdisSapHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/cm.c b/reactos/drivers/net/ndis/ndis/cm.c
new file mode 100644 (file)
index 0000000..d6e0ca9
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/cm.c
+ * PURPOSE:     Call Manager services
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+NDIS_STATUS
+EXPORT
+NdisCmActivateVc(
+    IN      NDIS_HANDLE         NdisVcHandle,
+    IN OUT  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisCmAddPartyComplete(
+    IN  NDIS_STATUS         Status,
+    IN  NDIS_HANDLE         NdisPartyHandle,
+    IN  NDIS_HANDLE         CallMgrPartyContext OPTIONAL,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmCloseAddressFamilyComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisAfHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmCloseCallComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisVcHandle,
+    IN  NDIS_HANDLE NdisPartyHandle OPTIONAL)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisCmDeactivateVc(
+    IN  NDIS_HANDLE NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisCmDeregisterSapComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisSapHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmDispatchCallConnected(
+    IN  NDIS_HANDLE NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisCmDispatchIncomingCall(
+    IN  NDIS_HANDLE         NdisSapHandle,
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisCmDispatchIncomingCallQoSChange(
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmDispatchIncomingCloseCall(
+    IN  NDIS_STATUS CloseStatus,
+    IN  NDIS_HANDLE NdisVcHandle,
+    IN  PVOID       Buffer  OPTIONAL,
+    IN  UINT        Size)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmDispatchIncomingDropParty(
+    IN  NDIS_STATUS DropStatus,
+    IN  NDIS_HANDLE NdisPartyHandle,
+    IN  PVOID       Buffer  OPTIONAL,
+    IN  UINT        Size)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmDropPartyComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisPartyHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmMakeCallComplete(
+    IN  NDIS_STATUS         Status,
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  NDIS_HANDLE         NdisPartyHandle     OPTIONAL,
+    IN  NDIS_HANDLE         CallMgrPartyContext OPTIONAL,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmModifyCallQoSComplete(
+    IN  NDIS_STATUS         Status,
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCmOpenAddressFamilyComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisAfHandle,
+    IN  NDIS_HANDLE CallMgrAfContext)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisCmRegisterAddressFamily(
+    IN  NDIS_HANDLE                         NdisBindingHandle,
+    IN  PCO_ADDRESS_FAMILY                  AddressFamily,
+    IN  PNDIS_CALL_MANAGER_CHARACTERISTICS  CmCharacteristics,
+    IN  UINT                                SizeOfCmCharacteristics)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisCmRegisterSapComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisSapHandle,
+    IN  NDIS_HANDLE CallMgrSapContext)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+
+NDIS_STATUS
+EXPORT
+NdisMCmActivateVc(
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMCmCreateVc(
+    IN  NDIS_HANDLE     MiniportAdapterHandle,
+    IN  NDIS_HANDLE     NdisAfHandle,
+    IN  NDIS_HANDLE     MiniportVcContext,
+    OUT PNDIS_HANDLE    NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMCmDeactivateVc(
+    IN  NDIS_HANDLE NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMCmDeleteVc(
+    IN  NDIS_HANDLE NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMCmRegisterAddressFamily(
+    IN  NDIS_HANDLE                         MiniportAdapterHandle,
+    IN  PCO_ADDRESS_FAMILY                  AddressFamily,
+    IN  PNDIS_CALL_MANAGER_CHARACTERISTICS  CmCharacteristics,
+    IN  UINT                                SizeOfCmCharacteristics)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+NDIS_STATUS
+EXPORT
+NdisMCmRequest(
+    IN      NDIS_HANDLE     NdisAfHandle,
+    IN      NDIS_HANDLE     NdisVcHandle    OPTIONAL,
+    IN      NDIS_HANDLE     NdisPartyHandle OPTIONAL,
+    IN OUT  PNDIS_REQUEST   NdisRequest)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/co.c b/reactos/drivers/net/ndis/ndis/co.c
new file mode 100644 (file)
index 0000000..c560cc4
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/co.c
+ * PURPOSE:     Services for connection-oriented NDIS drivers
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+NDIS_STATUS
+EXPORT
+NdisCoCreateVc(
+    IN  NDIS_HANDLE         NdisBindingHandle,
+    IN  NDIS_HANDLE         NdisAfHandle  OPTIONAL,
+    IN  NDIS_HANDLE         ProtocolVcContext,
+    IN  OUT PNDIS_HANDLE    NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisCoDeleteVc(
+    IN  NDIS_HANDLE NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisCoRequest(
+    IN      NDIS_HANDLE     NdisBindingHandle,
+    IN      NDIS_HANDLE     NdisAfHandle    OPTIONAL,
+    IN      NDIS_HANDLE     NdisVcHandle    OPTIONAL,
+    IN      NDIS_HANDLE     NdisPartyHandle OPTIONAL,
+    IN OUT  PNDIS_REQUEST   NdisRequest)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisCoRequestComplete(
+    IN  NDIS_STATUS     Status,
+    IN  NDIS_HANDLE     NdisAfHandle,
+    IN  NDIS_HANDLE     NdisVcHandle    OPTIONAL,
+    IN  NDIS_HANDLE     NdisPartyHandle OPTIONAL,
+    IN  PNDIS_REQUEST   NdisRequest)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisCoSendPackets(
+    IN  NDIS_HANDLE     NdisVcHandle,
+    IN  PPNDIS_PACKET   PacketArray,
+    IN  UINT            NumberOfPackets)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+
+VOID
+EXPORT
+NdisMCoActivateVcComplete(
+    IN  NDIS_STATUS         Status,
+    IN  NDIS_HANDLE         NdisVcHandle,
+    IN  PCO_CALL_PARAMETERS CallParameters)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMCoDeactivateVcComplete(
+    IN  NDIS_STATUS Status,
+    IN  NDIS_HANDLE NdisVcHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMCoIndicateReceivePacket(
+    IN  NDIS_HANDLE     NdisVcHandle,
+    IN  PPNDIS_PACKET   PacketArray,
+    IN  UINT            NumberOfPackets)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMCoIndicateStatus(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  NDIS_HANDLE NdisVcHandle    OPTIONAL,
+    IN  NDIS_STATUS GeneralStatus,
+    IN  PVOID       StatusBuffer    OPTIONAL,
+    IN  ULONG       StatusBufferSize)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMCoReceiveComplete(
+    IN  NDIS_HANDLE MiniportAdapterHandle)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMCoRequestComplete(
+    IN  NDIS_STATUS     Status,
+    IN  NDIS_HANDLE     MiniportAdapterHandle,
+    IN  PNDIS_REQUEST   Request)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID 
+EXPORT
+NdisMCoSendComplete(
+    IN  NDIS_STATUS     Status,
+    IN  NDIS_HANDLE     NdisVcHandle,
+    IN  PNDIS_PACKET    Packet)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/control.c b/reactos/drivers/net/ndis/ndis/control.c
new file mode 100644 (file)
index 0000000..0f12bac
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/control.c
+ * PURPOSE:     Program control routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+VOID
+EXPORT
+NdisAcquireReadWriteLock(
+    IN  PNDIS_RW_LOCK   Lock,
+    IN  BOOLEAN         fWrite,
+    IN  PLOCK_STATE     LockState)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisAcquireSpinLock(
+    IN  PNDIS_SPIN_LOCK SpinLock)
+/*
+ * FUNCTION: Acquires a spin lock for exclusive access to a resource
+ * ARGUMENTS:
+ *     SpinLock = Pointer to the initialized NDIS spin lock to be acquired
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisAllocateSpinLock(
+    IN  PNDIS_SPIN_LOCK SpinLock)
+/*
+ * FUNCTION: Initializes for an NDIS spin lock
+ * ARGUMENTS:
+ *     SpinLock = Pointer to an NDIS spin lock structure
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisDprAcquireSpinLock(
+    IN  PNDIS_SPIN_LOCK SpinLock)
+/*
+ * FUNCTION: Acquires a spin lock from IRQL DISPATCH_LEVEL
+ * ARGUMENTS:
+ *     SpinLock = Pointer to the initialized NDIS spin lock to be acquired
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisDprReleaseSpinLock(
+    IN  PNDIS_SPIN_LOCK SpinLock)
+/*
+ * FUNCTION: Releases an acquired spin lock from IRQL DISPATCH_LEVEL
+ * ARGUMENTS:
+ *     SpinLock = Pointer to the acquired NDIS spin lock to be released
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisFreeSpinLock(
+    IN  PNDIS_SPIN_LOCK SpinLock)
+/*
+ * FUNCTION: Releases a spin lock initialized with NdisAllocateSpinLock
+ * ARGUMENTS:
+ *     SpinLock = Pointer to an initialized NDIS spin lock
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisGetCurrentProcessorCpuUsage(
+    PULONG  pCpuUsage)
+/*
+ * FUNCTION: Returns how busy the current processor is as a percentage
+ * ARGUMENTS:
+ *     pCpuUsage = Pointer to a buffer to place CPU usage
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisInitializeEvent(
+    IN  PNDIS_EVENT Event)
+/*
+ * FUNCTION: Initializes an event to be used for synchronization
+ * ARGUMENTS:
+ *     Event = Pointer to an NDIS event structure to be initialized
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisReleaseSpinLock(
+    IN  PNDIS_SPIN_LOCK SpinLock)
+/*
+ * FUNCTION: Releases a spin lock previously acquired with NdisAcquireSpinLock
+ * ARGUMENTS:
+ *     SpinLock = Pointer to the acquired NDIS spin lock to be released
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisResetEvent(
+    IN  PNDIS_EVENT Event)
+/*
+ * FUNCTION: Clears the signaled state of an event
+ * ARGUMENTS:
+ *     Event = Pointer to the initialized event object to be reset
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisSetEvent(
+    IN  PNDIS_EVENT Event)
+/*
+ * FUNCTION: Sets an event to a signaled state if not already signaled
+ * ARGUMENTS:
+ *     Event = Pointer to the initialized event object to be set
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+NdisWaitEvent(
+    IN  PNDIS_EVENT Event,
+    IN  UINT        MsToWait)
+/*
+ * FUNCTION: Waits for an event to become signaled
+ * ARGUMENTS:
+ *     Event    = Pointer to the initialized event object to wait for
+ *     MsToWait = Maximum milliseconds to wait for the event to become signaled
+ * RETURNS:
+ *     TRUE if the event is in the signaled state
+ */
+{
+    UNIMPLEMENTED
+
+    return FALSE;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/hardware.c b/reactos/drivers/net/ndis/ndis/hardware.c
new file mode 100644 (file)
index 0000000..8fcbb80
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/hardware.c
+ * PURPOSE:     Hardware related routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+ULONG
+EXPORT
+NdisImmediateReadPciSlotInformation(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       SlotNumber,
+    IN  ULONG       Offset,
+    IN  PVOID       Buffer,
+    IN  ULONG       Length)
+{
+    UNIMPLEMENTED
+
+    return 0;
+}
+
+
+ULONG 
+EXPORT
+NdisImmediateWritePciSlotInformation(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       SlotNumber,
+    IN  ULONG       Offset,
+    IN  PVOID       Buffer,
+    IN  ULONG       Length)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMPciAssignResources(
+    IN  NDIS_HANDLE             MiniportHandle,
+    IN  ULONG                   SlotNumber,
+    OUT PNDIS_RESOURCE_LIST     *AssignedResources)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisMQueryAdapterResources(
+    OUT     PNDIS_STATUS        Status,
+    IN      NDIS_HANDLE         WrapperConfigurationContext,
+    OUT     PNDIS_RESOURCE_LIST ResourceList,
+    IN OUT  PUINT               BufferSize)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisQueryMapRegisterCount(
+    IN  NDIS_INTERFACE_TYPE BusType,
+    OUT PUINT               MapRegisterCount)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisReadEisaSlotInformation(
+    OUT PNDIS_STATUS                    Status,
+    IN  NDIS_HANDLE                                WrapperConfigurationContext,
+    OUT PUINT                           SlotNumber,
+    OUT PNDIS_EISA_FUNCTION_INFORMATION EisaData)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisReadEisaSlotInformationEx(
+    OUT PNDIS_STATUS                    Status,
+    IN  NDIS_HANDLE                     WrapperConfigurationContext,
+    OUT PUINT                           SlotNumber,
+    OUT PNDIS_EISA_FUNCTION_INFORMATION *EisaData,
+    OUT PUINT                           NumberOfFunctions)
+{
+    UNIMPLEMENTED
+}
+
+
+ULONG
+EXPORT
+NdisReadPciSlotInformation(
+    IN  NDIS_HANDLE NdisAdapterHandle,
+    IN  ULONG       SlotNumber,
+    IN  ULONG       Offset,
+    IN  PVOID       Buffer,
+    IN  ULONG       Length)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+ULONG
+EXPORT
+NdisWritePciSlotInformation(
+    IN  NDIS_HANDLE NdisAdapterHandle,
+    IN  ULONG       SlotNumber,
+    IN  ULONG       Offset,
+    IN  PVOID       Buffer,
+    IN  ULONG       Length)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/io.c b/reactos/drivers/net/ndis/ndis/io.c
new file mode 100644 (file)
index 0000000..dcdc154
--- /dev/null
@@ -0,0 +1,440 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/io.c
+ * PURPOSE:     I/O related routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+#include <miniport.h>
+
+
+VOID HandleDeferredProcessing(
+    IN  PKDPC   Dpc,
+    IN  PVOID   DeferredContext,
+    IN  PVOID   SystemArgument1,
+    IN  PVOID   SystemArgument2)
+/*
+ * FUNCTION: Deferred interrupt processing routine
+ * ARGUMENTS:
+ *     Dpc             = Pointer to DPC object
+ *     DeferredContext = Pointer to context information (LOGICAL_ADAPTER)
+ *     SystemArgument1 = Unused
+ *     SystemArgument2 = Unused
+ */
+{
+    PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(DeferredContext);
+
+    /* Call the deferred interrupt service handler for this adapter */
+    (*Adapter->Miniport->Chars.HandleInterruptHandler)(Adapter);
+}
+
+
+BOOLEAN ServiceRoutine(
+    IN  PKINTERRUPT Interrupt,
+    IN  PVOID       ServiceContext)
+/*
+ * FUNCTION: Interrupt service routine
+ * ARGUMENTS:
+ *     Interrupt      = Pointer to interrupt object
+ *     ServiceContext = Pointer to context information (LOGICAL_ADAPTER)
+ * RETURNS
+ *     TRUE if our device generated the interrupt
+ */
+{
+    BOOLEAN InterruptRecognized;
+    BOOLEAN QueueMiniportHandleInterrupt;
+    PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(ServiceContext);
+
+    /* FIXME: Support shared interrupts */
+
+    (*Adapter->Miniport->Chars.ISRHandler)(&InterruptRecognized,
+        &QueueMiniportHandleInterrupt, Adapter);
+
+    if (QueueMiniportHandleInterrupt) {
+        KeInsertQueueDpc(&Adapter->InterruptObject->InterruptDpc, NULL, NULL);
+    }
+
+    return TRUE;
+}
+
+
+VOID
+EXPORT
+NdisCompleteDmaTransfer(
+    OUT PNDIS_STATUS    Status,
+    IN  PNDIS_HANDLE    NdisDmaHandle,
+    IN  PNDIS_BUFFER    Buffer,
+    IN  ULONG           Offset,
+    IN  ULONG           Length,
+    IN  BOOLEAN         WriteToDevice)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisFlushBuffer(
+    IN  PNDIS_BUFFER    Buffer,
+    IN  BOOLEAN         WriteToDevice)
+{
+    UNIMPLEMENTED
+}
+
+
+ULONG
+EXPORT
+NdisGetCacheFillSize(
+    VOID)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+VOID
+EXPORT
+NdisImmediateReadPortUchar(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       Port,
+    OUT PUCHAR      Data)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisImmediateReadPortUlong(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       Port,
+    OUT PULONG      Data)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisImmediateReadPortUshort(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       Port,
+    OUT PUSHORT     Data)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisImmediateWritePortUchar(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       Port,
+    IN  UCHAR       Data)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisImmediateWritePortUlong(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       Port,
+    IN  ULONG       Data)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisImmediateWritePortUshort(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       Port,
+    IN  USHORT      Data)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMAllocateMapRegisters(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  UINT        DmaChannel,
+    IN  BOOLEAN     Dma32BitAddresses,
+    IN  ULONG       PhysicalMapRegistersNeeded,
+    IN  ULONG       MaximumPhysicalMapping)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisMCompleteDmaTransfer(
+    OUT PNDIS_STATUS    Status,
+    IN  PNDIS_HANDLE    MiniportDmaHandle,
+    IN  PNDIS_BUFFER    Buffer,
+    IN  ULONG           Offset,
+    IN  ULONG           Length,
+    IN  BOOLEAN         WriteToDevice)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMDeregisterDmaChannel(
+    IN  PNDIS_HANDLE    MiniportDmaHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMDeregisterInterrupt(
+    IN  PNDIS_MINIPORT_INTERRUPT    Interrupt)
+/*
+ * FUNCTION: Releases an interrupt vector
+ * ARGUMENTS:
+ *     Interrupt = Pointer to interrupt object
+ */
+{
+    IoDisconnectInterrupt(Interrupt->InterruptObject);
+}
+
+
+VOID
+EXPORT
+NdisMDeregisterIoPortRange(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  UINT        InitialPort,
+    IN  UINT        NumberOfPorts,
+    IN  PVOID       PortOffset)
+/*
+ * FUNCTION: Releases a register mapping to I/O ports
+ * ARGUMENTS:
+ *     MiniportAdapterHandle = Specifies handle input to MiniportInitialize
+ *     InitialPort           = Bus-relative base port address of a range to be mapped
+ *     NumberOfPorts         = Specifies number of ports to be mapped
+ *     PortOffset            = Pointer to mapped base port address
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMFreeMapRegisters(
+    IN  NDIS_HANDLE MiniportAdapterHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMMapIoSpace(
+    OUT PVOID                   *VirtualAddress,
+    IN  NDIS_HANDLE             MiniportAdapterHandle,
+    IN  NDIS_PHYSICAL_ADDRESS   PhysicalAddress,
+    IN  UINT                    Length)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisMQueryInformationComplete(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  NDIS_STATUS Status)
+{
+    UNIMPLEMENTED
+}
+
+
+ULONG
+EXPORT
+NdisMReadDmaCounter(
+    IN  NDIS_HANDLE MiniportDmaHandle)
+{
+    UNIMPLEMENTED
+
+       return 0;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMRegisterDmaChannel(
+    OUT PNDIS_HANDLE            MiniportDmaHandle,
+    IN  NDIS_HANDLE             MiniportAdapterHandle,
+    IN  UINT                    DmaChannel,
+    IN  BOOLEAN                 Dma32BitAddresses,
+    IN  PNDIS_DMA_DESCRIPTION   DmaDescription,
+    IN  ULONG                   MaximumLength)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMRegisterInterrupt(
+    OUT PNDIS_MINIPORT_INTERRUPT    Interrupt,
+    IN  NDIS_HANDLE                 MiniportAdapterHandle,
+    IN  UINT                        InterruptVector,
+    IN  UINT                        InterruptLevel,
+    IN  BOOLEAN                            RequestIsr,
+    IN  BOOLEAN                     SharedInterrupt,
+    IN  NDIS_INTERRUPT_MODE         InterruptMode)
+/*
+ * FUNCTION: Claims access to an interrupt vector
+ * ARGUMENTS:
+ *     Interrupt             = Address of interrupt object to initialize
+ *     MiniportAdapterHandle = Specifies handle input to MiniportInitialize
+ *     InterruptVector       = Specifies bus-relative vector to register
+ *     InterruptLevel        = Specifies bus-relative DIRQL vector for interrupt
+ *     RequestIsr            = TRUE if MiniportISR should always be called
+ *     SharedInterrupt       = TRUE if other devices may use tha same interrupt
+ *     InterruptMode         = Specifies type of interrupt
+ * RETURNS:
+ *     Status of operation
+ */
+{
+    NTSTATUS NtStatus;
+    ULONG MappedIRQ;
+    KIRQL DIrql;
+    KAFFINITY Affinity = 0xFFFFFFFF;
+    PLOGICAL_ADAPTER Adapter  = GET_LOGICAL_ADAPTER(MiniportAdapterHandle);
+
+    RtlZeroMemory(Interrupt, sizeof(NDIS_MINIPORT_INTERRUPT));
+
+    KeInitializeSpinLock(&Interrupt->DpcCountLock);
+
+    KeInitializeDpc(&Interrupt->InterruptDpc, HandleDeferredProcessing, Adapter);
+
+    KeInitializeEvent(&Interrupt->DpcsCompletedEvent,
+        NotificationEvent, FALSE);
+
+    Interrupt->SharedInterrupt = SharedInterrupt;
+
+    Adapter->InterruptObject = Interrupt;
+
+    MappedIRQ = HalGetInterruptVector(Adapter->AdapterType, 0,
+        InterruptLevel, InterruptVector, &DIrql, &Affinity);
+
+    NtStatus = IoConnectInterrupt(&Interrupt->InterruptObject, ServiceRoutine, Adapter,
+        &Interrupt->DpcCountLock, MappedIRQ, DIrql, DIrql, InterruptMode,
+        SharedInterrupt, Affinity, FALSE);
+
+       return NDIS_STATUS_SUCCESS;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMRegisterIoPortRange(
+    OUT PVOID       *PortOffset,
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  UINT        InitialPort,
+    IN  UINT        NumberOfPorts)
+/*
+ * FUNCTION: Sets up driver access to device I/O ports
+ * ARGUMENTS:
+ *     PortOffset            = Address of buffer to place mapped base port address
+ *     MiniportAdapterHandle = Specifies handle input to MiniportInitialize
+ *     InitialPort           = Bus-relative base port address of a range to be mapped
+ *     NumberOfPorts         = Specifies number of ports to be mapped
+ * RETURNS:
+ *     Status of operation
+ */
+{
+#if 0
+    NTSTATUS NtStatus;
+    BOOLEAN ConflictDetected;
+    PLOGICAL_ADAPTER Adapter  = GET_LOGICAL_ADAPTER(MiniportAdapterHandle);
+    PMINIPORT_DRIVER Miniport = Adapter->Miniport;
+
+    /* Non-PnP hardware. NT5 function */
+    NtStatus = IoReportResourceForDetection(
+        Miniport->DriverObject,
+        NULL,
+        0,
+        NULL,
+        NULL,
+        0,
+        &ConflictDetected);
+    return NDIS_STATUS_FAILURE;
+#else
+    /* It's yours! */
+    *PortOffset = (PVOID)InitialPort;
+
+    return NDIS_STATUS_SUCCESS;
+#endif
+}
+
+
+VOID
+EXPORT
+NdisMSetInformationComplete(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  NDIS_STATUS Status)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMSetupDmaTransfer(
+    OUT        PNDIS_STATUS    Status,
+    IN PNDIS_HANDLE    MiniportDmaHandle,
+    IN PNDIS_BUFFER    Buffer,
+    IN ULONG           Offset,
+    IN ULONG           Length,
+    IN BOOLEAN         WriteToDevice)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMTransferDataComplete(
+    IN  NDIS_HANDLE     MiniportAdapterHandle,
+    IN  PNDIS_PACKET    Packet,
+    IN  NDIS_STATUS     Status,
+    IN  UINT            BytesTransferred)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMUnmapIoSpace(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  PVOID       VirtualAddress,
+    IN  UINT        Length)
+{
+    UNIMPLEMENTED
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/main.c b/reactos/drivers/net/ndis/ndis/main.c
new file mode 100644 (file)
index 0000000..11bbf05
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/main.c
+ * PURPOSE:     Driver entry point
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+#ifdef DBG
+/* See debug.h for debug/trace constants */
+DWORD DebugTraceLevel = MIN_TRACE;
+#endif /* DBG */
+
+
+VOID MainUnload(
+    PDRIVER_OBJECT DriverObject)
+/*
+ * FUNCTION: Unloads the driver
+ * ARGUMENTS:
+ *     DriverObject = Pointer to driver object created by the system
+ */
+{
+    NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
+}
+
+
+NTSTATUS
+#ifndef _MSC_VER
+STDCALL
+#endif
+DriverEntry(
+    PDRIVER_OBJECT DriverObject,
+    PUNICODE_STRING RegistryPath)
+/*
+ * FUNCTION: Main driver entry point
+ * ARGUMENTS:
+ *     DriverObject = Pointer to a driver object for this driver
+ *     RegistryPath = Registry node for configuration parameters
+ * RETURNS:
+ *     Status of driver initialization
+ */
+{
+    NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
+
+#ifdef _MSC_VER
+    DriverObject->DriverUnload = MainUnload;
+#else
+    DriverObject->DriverUnload = (PDRIVER_UNLOAD)MainUnload;
+#endif
+
+    return STATUS_SUCCESS;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/memory.c b/reactos/drivers/net/ndis/ndis/memory.c
new file mode 100644 (file)
index 0000000..0c6f586
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/memory.c
+ * PURPOSE:     Memory management routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+NDIS_STATUS
+EXPORT
+NdisAllocateMemoryWithTag(
+    OUT PVOID   *VirtualAddress,
+    IN  UINT    Length,
+    IN  ULONG   Tag)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisCreateLookaheadBufferFromSharedMemory(
+    IN  PVOID   pSharedMemory,
+    IN  UINT    LookaheadLength,
+    OUT PVOID   *pLookaheadBuffer)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisDestroyLookaheadBufferFromSharedMemory(
+    IN  PVOID   pLookaheadBuffer)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMoveFromMappedMemory(
+    OUT PVOID   Destination,
+    IN  PVOID   Source,
+    IN  ULONG   Length)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMoveMappedMemory(
+    OUT PVOID   Destination,
+    IN  PVOID   Source,
+    IN  ULONG   Length)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMoveToMappedMemory(
+    OUT PVOID   Destination,
+    IN  PVOID   Source,
+    IN  ULONG   Length)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMUpdateSharedMemory(
+    IN  NDIS_HANDLE             MiniportAdapterHandle,
+    IN  ULONG                   Length,
+    IN  PVOID                   VirtualAddress,
+    IN  NDIS_PHYSICAL_ADDRESS   PhysicalAddress)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisAllocateMemory(
+    OUT PVOID                   *VirtualAddress,
+    IN  UINT                    Length,
+    IN  UINT                    MemoryFlags,
+    IN  NDIS_PHYSICAL_ADDRESS   HighestAcceptableAddress)
+/*
+ * FUNCTION: Allocates a block of memory
+ * ARGUMENTS:
+ *     VirtualAddress           = Address of buffer to place virtual
+ *                                address of the allocated memory
+ *     Length                   = Size of the memory block to allocate
+ *     MemoryFlags              = Flags to specify special restrictions
+ *     HighestAcceptableAddress = Specifies -1
+ */
+{
+    PVOID Block;
+
+    if (MemoryFlags & NDIS_MEMORY_CONTIGUOUS) {
+        /* FIXME */
+        *VirtualAddress = NULL;
+        return NDIS_STATUS_FAILURE;
+    }
+
+    if (MemoryFlags & NDIS_MEMORY_NONCACHED) {
+        /* FIXME */
+        *VirtualAddress = NULL;
+        return NDIS_STATUS_FAILURE;
+    }
+
+    /* Plain nonpaged memory */
+    Block           = ExAllocatePool(NonPagedPool, Length);
+    *VirtualAddress = Block;
+    if (!Block)
+        return NDIS_STATUS_FAILURE;
+
+       return NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+EXPORT
+NdisFreeMemory(
+    IN  PVOID   VirtualAddress,
+    IN  UINT    Length,
+    IN  UINT    MemoryFlags)
+/*
+ * FUNCTION: Frees a memory block allocated with NdisAllocateMemory
+ * ARGUMENTS:
+ *     VirtualAddress = Pointer to the base virtual address of the allocated memory
+ *     Length         = Size of the allocated memory block as passed to NdisAllocateMemory
+ *     MemoryFlags    = Memory flags passed to NdisAllocateMemory
+ */
+{
+    if (MemoryFlags & NDIS_MEMORY_CONTIGUOUS) {
+        /* FIXME */
+        return;
+    }
+
+    if (MemoryFlags & NDIS_MEMORY_NONCACHED) {
+        /* FIXME */
+        return;
+    }
+
+    /* Plain nonpaged memory */
+    ExFreePool(VirtualAddress);
+}
+
+
+VOID
+EXPORT
+NdisImmediateReadSharedMemory(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       SharedMemoryAddress,
+    OUT PUCHAR      Buffer,
+    IN  ULONG       Length)
+{
+}
+
+
+VOID
+EXPORT
+NdisImmediateWriteSharedMemory(
+    IN  NDIS_HANDLE WrapperConfigurationContext,
+    IN  ULONG       SharedMemoryAddress,
+    IN  PUCHAR      Buffer,
+    IN  ULONG       Length)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMAllocateSharedMemory(
+    IN NDIS_HANDLE             MiniportAdapterHandle,
+    IN ULONG                   Length,
+    IN BOOLEAN                 Cached,
+    OUT        PVOID                   *VirtualAddress,
+    OUT        PNDIS_PHYSICAL_ADDRESS  PhysicalAddress)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMAllocateSharedMemoryAsync(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  ULONG       Length,
+    IN  BOOLEAN     Cached,
+    IN  PVOID       Context)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisMFreeSharedMemory(
+    IN  NDIS_HANDLE             MiniportAdapterHandle,
+    IN  ULONG                   Length,
+    IN  BOOLEAN                 Cached,
+    IN  PVOID                   VirtualAddress,
+    IN  NDIS_PHYSICAL_ADDRESS   PhysicalAddress)
+{
+    UNIMPLEMENTED
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/miniport.c b/reactos/drivers/net/ndis/ndis/miniport.c
new file mode 100644 (file)
index 0000000..dc470d3
--- /dev/null
@@ -0,0 +1,532 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/miniport.c
+ * PURPOSE:     Routines used by NDIS miniport drivers
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <miniport.h>
+
+
+/* Number of medias we know */
+#define MEDIA_ARRAY_SIZE    15
+
+static NDIS_MEDIUM MediaArray[MEDIA_ARRAY_SIZE] = {
+    NdisMedium802_3,
+    NdisMedium802_5,
+    NdisMediumFddi,
+    NdisMediumWan,
+    NdisMediumLocalTalk,
+    NdisMediumDix,
+    NdisMediumArcnetRaw,
+    NdisMediumArcnet878_2,
+    NdisMediumAtm,
+    NdisMediumWirelessWan,
+    NdisMediumIrda,
+    NdisMediumBpc,
+    NdisMediumCoWan,
+    NdisMedium1394,
+    NdisMediumMax
+};
+
+
+LIST_ENTRY MiniportListHead;
+KSPIN_LOCK MiniportListLock;
+LIST_ENTRY AdapterListHead;
+KSPIN_LOCK AdapterListLock;
+
+
+VOID MiniportWorker(
+    PVOID Context)
+/*
+ * FUNCTION: Worker function for MiniportXxx functions
+ * ARGUMENTS:
+ *     Context = Pointer to context information (MINIPORT_DRIVER)
+ */
+{
+}
+
+
+PLOGICAL_ADAPTER MiniLocateDevice(
+    PNDIS_STRING AdapterName)
+/*
+ * FUNCTION: Returns the logical adapter object for a specific adapter
+ * ARGUMENTS:
+ *     AdapterName = Pointer to name of adapter
+ * RETURNS:
+ *     Pointer to logical adapter object, or NULL if none was found.
+ *     If found, the adapter is referenced for the caller. The caller
+ *     is responsible for dereferencing after use
+ */
+{
+    KIRQL OldIrql1;
+    KIRQL OldIrql2;
+    PLIST_ENTRY CurrentMEntry;
+    PLIST_ENTRY CurrentAEntry;
+    PMINIPORT_DRIVER Miniport;
+    PLOGICAL_ADAPTER Adapter;
+
+    NDIS_DbgPrint(DEBUG_MINIPORT, ("Called. AdapterName (0x%X).\n", AdapterName));
+
+    KeAcquireSpinLock(&MiniportListLock, &OldIrql1);
+    CurrentMEntry = MiniportListHead.Flink;
+    while (CurrentMEntry != &MiniportListHead) {
+           Miniport = CONTAINING_RECORD(CurrentMEntry, MINIPORT_DRIVER, ListEntry);
+
+        KeAcquireSpinLock(&AdapterListLock, &OldIrql2);
+        CurrentAEntry = AdapterListHead.Flink;
+        while (CurrentAEntry != &AdapterListHead) {
+               Adapter = CONTAINING_RECORD(CurrentAEntry, LOGICAL_ADAPTER, ListEntry);
+
+            if (RtlCompareUnicodeString(AdapterName, &Adapter->DeviceName, TRUE) == 0) {
+                ReferenceObject(Adapter);
+                KeReleaseSpinLock(&AdapterListLock, OldIrql2);
+                KeReleaseSpinLock(&MiniportListLock, OldIrql1);
+                return Adapter;
+            }
+
+            CurrentAEntry = CurrentAEntry->Flink;
+        }
+        KeReleaseSpinLock(&AdapterListLock, OldIrql2);
+
+        CurrentMEntry = CurrentMEntry->Flink;
+    }
+    KeReleaseSpinLock(&MiniportListLock, OldIrql1);
+
+    return NULL;
+}
+
+
+NDIS_STATUS
+MiniQueryInformation(
+    PLOGICAL_ADAPTER    Adapter,
+    NDIS_OID            Oid,
+    ULONG               Size,
+    PULONG              BytesWritten)
+/*
+ * FUNCTION: Queries a logical adapter for properties
+ * ARGUMENTS:
+ *     Adapter      = Pointer to the logical adapter object to query
+ *     Oid          = Specifies the oid to query for
+ *     Size         = If non-zero overrides the length in the adapter object
+ *     BytesWritten = Address of buffer to place number of bytes written
+ * RETURNS:
+ *     Status of operation
+ * NOTES:
+ *     If the specified buffer is too small, a new buffer is allocated,
+ *     and the query is attempted again
+ */
+{
+    NDIS_STATUS NdisStatus;
+    ULONG BytesNeeded;
+
+    if (Adapter->QueryBufferLength == 0) {
+        Adapter->QueryBuffer = ExAllocatePool(NonPagedPool, 32);
+
+        if (!Adapter->QueryBuffer) {
+            NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+            return NDIS_STATUS_RESOURCES;
+        }
+
+        Adapter->QueryBufferLength = 32;
+    }
+
+    BytesNeeded = (Size = 0)? Adapter->QueryBufferLength : Size;
+
+    NdisStatus = (*Adapter->Miniport->Chars.QueryInformationHandler)(
+        Adapter, Oid, &BytesNeeded,
+        Adapter->QueryBufferLength,
+        BytesWritten, &BytesNeeded);
+
+    if ((NT_SUCCESS(NdisStatus)) || (NdisStatus == NDIS_STATUS_PENDING)) {
+        NDIS_DbgPrint(DEBUG_MINIPORT, ("Miniport returned status (0x%X).\n", NdisStatus));
+        return NdisStatus;
+    }
+
+    if (NdisStatus == NDIS_STATUS_INVALID_LENGTH) {
+        ExFreePool(Adapter->QueryBuffer);
+
+        Adapter->QueryBufferLength += BytesNeeded;
+        Adapter->QueryBuffer = ExAllocatePool(
+            NonPagedPool, Adapter->QueryBufferLength);
+
+        if (!Adapter->QueryBuffer) {
+            NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+            return NDIS_STATUS_RESOURCES;
+        }
+
+        NdisStatus = (*Adapter->Miniport->Chars.QueryInformationHandler)(
+            Adapter, Oid, Adapter->QueryBuffer, Size, BytesWritten, &BytesNeeded);
+    }
+
+    return NdisStatus;
+}
+
+
+VOID
+EXPORT
+NdisMCloseLog(
+    IN  NDIS_HANDLE LogHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMCreateLog(
+    IN  NDIS_HANDLE     MiniportAdapterHandle,
+    IN  UINT            Size,
+    OUT PNDIS_HANDLE    LogHandle)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisMDeregisterAdapterShutdownHandler(
+    IN  NDIS_HANDLE MiniportHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMFlushLog(
+    IN  NDIS_HANDLE LogHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMIndicateStatus(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  NDIS_STATUS GeneralStatus,
+    IN  PVOID       StatusBuffer,
+    IN  UINT        StatusBufferSize)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMIndicateStatusComplete(
+    IN  NDIS_HANDLE MiniportAdapterHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisInitializeWrapper(
+    OUT PNDIS_HANDLE    NdisWrapperHandle,
+    IN  PVOID           SystemSpecific1,
+    IN  PVOID           SystemSpecific2,
+    IN  PVOID           SystemSpecific3)
+/*
+ * FUNCTION: Notifies the NDIS library that a new miniport is initializing
+ * ARGUMENTS:
+ *     NdisWrapperHandle = Address of buffer to place NDIS wrapper handle
+ *     SystemSpecific1   = Pointer to the driver's driver object
+ *     SystemSpecific2   = Pointer to the driver's registry path
+ *     SystemSpecific3   = Always NULL
+ */
+{
+    PMINIPORT_DRIVER Miniport;
+
+    Miniport = ExAllocatePool(NonPagedPool, sizeof(MINIPORT_DRIVER));
+    if (!Miniport) {
+        NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+        *NdisWrapperHandle = NULL;
+        return;
+    }
+
+    RtlZeroMemory(Miniport, sizeof(MINIPORT_DRIVER));
+
+    KeInitializeSpinLock(&Miniport->Lock);
+
+    Miniport->RefCount = 1;
+
+    ExInitializeWorkItem(&Miniport->WorkItem, MiniportWorker, Miniport);
+
+    Miniport->DriverObject = (PDRIVER_OBJECT)SystemSpecific1;
+    /* FIXME: Copy RegistryPath */
+    //Miniport->RegistryPath = SystemSpecific2;
+
+    /* Put miniport in global miniport list */
+    ExInterlockedInsertTailList(&MiniportListHead,
+                                &Miniport->ListEntry,
+                                &MiniportListLock);
+
+    *NdisWrapperHandle = Miniport;
+}
+
+
+VOID
+EXPORT
+NdisMRegisterAdapterShutdownHandler(
+    IN  NDIS_HANDLE                 MiniportHandle,
+    IN  PVOID                       ShutdownContext,
+    IN  ADAPTER_SHUTDOWN_HANDLER    ShutdownHandler)
+{
+    UNIMPLEMENTED
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMRegisterMiniport(
+    IN  NDIS_HANDLE                     NdisWrapperHandle,
+    IN  PNDIS_MINIPORT_CHARACTERISTICS  MiniportCharacteristics,
+    IN  UINT                            CharacteristicsLength)
+/*
+ * FUNCTION: Registers a miniport's MiniportXxx entry points with the NDIS library
+ * ARGUMENTS:
+ *     NdisWrapperHandle       = Pointer to handle returned by NdisMInitializeWrapper
+ *     MiniportCharacteristics = Pointer to a buffer with miniport characteristics
+ *     CharacteristicsLength   = Number of bytes in characteristics buffer
+ * RETURNS:
+ *     Status of operation
+ */
+{
+    UINT MinSize;
+    NTSTATUS Status;
+    NDIS_STATUS NdisStatus;
+    UINT SelectedMediumIndex;
+    PLOGICAL_ADAPTER Adapter;
+    PMINIPORT_DRIVER Miniport = GET_MINIPORT_DRIVER(NdisWrapperHandle);
+
+    switch (MiniportCharacteristics->MajorNdisVersion) {
+    case 0x03:
+        MinSize = sizeof(NDIS30_MINIPORT_CHARACTERISTICS);
+        break;
+
+    case 0x04:
+        MinSize = sizeof(NDIS40_MINIPORT_CHARACTERISTICS);
+        break;
+
+    case 0x05:
+        MinSize = sizeof(NDIS50_MINIPORT_CHARACTERISTICS);
+        break;
+
+    default:
+        NDIS_DbgPrint(DEBUG_MINIPORT, ("Bad miniport characteristics version.\n"));
+        return NDIS_STATUS_BAD_VERSION;
+    }
+
+    if (CharacteristicsLength < MinSize) {
+        NDIS_DbgPrint(DEBUG_MINIPORT, ("Bad miniport characteristics.\n"));
+        return NDIS_STATUS_BAD_CHARACTERISTICS;
+    }
+
+    /* Check if mandatory MiniportXxx functions are specified */
+    if ((!MiniportCharacteristics->HaltHandler) ||
+        (!MiniportCharacteristics->InitializeHandler)||
+        (!MiniportCharacteristics->QueryInformationHandler) ||
+        (!MiniportCharacteristics->ResetHandler) ||
+        (!MiniportCharacteristics->SetInformationHandler)) {
+        NDIS_DbgPrint(DEBUG_MINIPORT, ("Bad miniport characteristics.\n"));
+        return NDIS_STATUS_BAD_CHARACTERISTICS;
+    }
+
+    if (MiniportCharacteristics->MajorNdisVersion == 0x03) {
+        if (!MiniportCharacteristics->SendHandler) {
+            NDIS_DbgPrint(DEBUG_MINIPORT, ("Bad miniport characteristics.\n"));
+            return NDIS_STATUS_BAD_CHARACTERISTICS;
+        }
+    } else if (MiniportCharacteristics->MajorNdisVersion >= 0x04) {
+        /* NDIS 4.0+ */
+        if ((!MiniportCharacteristics->SendHandler) &&
+            (!MiniportCharacteristics->SendPacketsHandler)) {
+            NDIS_DbgPrint(DEBUG_MINIPORT, ("Bad miniport characteristics.\n"));
+            return NDIS_STATUS_BAD_CHARACTERISTICS;
+        }
+    }
+
+    RtlCopyMemory(&Miniport->Chars, MiniportCharacteristics, MinSize);
+
+    Adapter = ExAllocatePool(NonPagedPool, sizeof(LOGICAL_ADAPTER));
+    if (!Adapter) {
+        NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+        return NDIS_STATUS_RESOURCES;
+    }
+
+    RtlZeroMemory(Adapter, sizeof(LOGICAL_ADAPTER));
+    KeInitializeSpinLock(&Adapter->Lock);
+    Adapter->RefCount = 1;
+    Adapter->Miniport = Miniport;
+
+    /* Create the device object for this adapter */
+    /* FIXME: Use GUIDs */
+    RtlInitUnicodeString(&Adapter->DeviceName, L"\\Device\\ne2000");
+    Status = IoCreateDevice(Miniport->DriverObject, 0, &Adapter->DeviceName,
+        FILE_DEVICE_PHYSICAL_NETCARD, 0, FALSE, &Adapter->DeviceObject);
+    if (!NT_SUCCESS(Status)) {
+        NDIS_DbgPrint(MIN_TRACE, ("Could not create device object.\n"));
+        ExFreePool(Adapter);
+        return NDIS_STATUS_FAILURE;
+    }
+
+    /* Put adapter in adapter list for this miniport */
+    ExInterlockedInsertTailList(&Miniport->AdapterListHead,
+                                &Adapter->MiniportListEntry,
+                                &Miniport->Lock);
+
+    /* Put adapter in global adapter list */
+    ExInterlockedInsertTailList(&AdapterListHead,
+                                &Adapter->ListEntry,
+                                &AdapterListLock);
+
+    /* Call MiniportInitialize */
+    (*Miniport->Chars.InitializeHandler)(
+        &NdisStatus,
+        &SelectedMediumIndex,
+        &MediaArray[0],
+        MEDIA_ARRAY_SIZE,
+        Adapter,
+        NULL /* FIXME: WrapperConfigurationContext */);
+
+    return NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+EXPORT
+NdisMResetComplete(
+    IN  NDIS_HANDLE MiniportAdapterHandle,
+    IN  NDIS_STATUS Status,
+    IN  BOOLEAN     AddressingReset)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMSendComplete(
+    IN  NDIS_HANDLE     MiniportAdapterHandle,
+    IN  PNDIS_PACKET    Packet,
+    IN  NDIS_STATUS     Status)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMSendResourcesAvailable(
+    IN  NDIS_HANDLE MiniportAdapterHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMSetAttributes(
+    IN  NDIS_HANDLE         MiniportAdapterHandle,
+    IN  NDIS_HANDLE         MiniportAdapterContext,
+    IN  BOOLEAN             BusMaster,
+    IN  NDIS_INTERFACE_TYPE AdapterType)
+/*
+ * FUNCTION: Informs the NDIS library of significant features of the caller's NIC
+ * ARGUMENTS:
+ *     MiniportAdapterHandle  = Handle input to MiniportInitialize
+ *     MiniportAdapterContext = Pointer to context information
+ *     BusMaster              = Specifies TRUE if the caller's NIC is a busmaster DMA device
+ *     AdapterType            = Specifies the I/O bus interface of the caller's NIC
+ */
+{
+    PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(MiniportAdapterHandle);
+
+    Adapter->MiniportAdapterContext = MiniportAdapterHandle;
+    Adapter->Attributes    = BusMaster? NDIS_ATTRIBUTE_BUS_MASTER : 0;
+    Adapter->AdapterType   = AdapterType;
+    Adapter->AttributesSet = TRUE;
+}
+
+
+VOID
+EXPORT
+NdisMSetAttributesEx(
+    IN  NDIS_HANDLE         MiniportAdapterHandle,
+    IN  NDIS_HANDLE         MiniportAdapterContext,
+    IN  UINT                CheckForHangTimeInSeconds   OPTIONAL,
+    IN  ULONG               AttributeFlags,
+    IN  NDIS_INTERFACE_TYPE    AdapterType)
+/*
+ * FUNCTION: Informs the NDIS library of significant features of the caller's NIC
+ * ARGUMENTS:
+ *     MiniportAdapterHandle     = Handle input to MiniportInitialize
+ *     MiniportAdapterContext    = Pointer to context information
+ *     CheckForHangTimeInSeconds = Specifies interval in seconds at which
+ *                                 MiniportCheckForHang should be called
+ *     AttributeFlags            = Bitmask that indicates specific attributes
+ *     AdapterType               = Specifies the I/O bus interface of the caller's NIC
+ */
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisMSleep(
+    IN  ULONG   MicrosecondsToSleep)
+{
+    UNIMPLEMENTED
+}
+
+
+BOOLEAN
+EXPORT
+NdisMSynchronizeWithInterrupt(
+    IN  PNDIS_MINIPORT_INTERRUPT    Interrupt,
+    IN  PVOID                       SynchronizeFunction,
+    IN  PVOID                       SynchronizeContext)
+{
+    UNIMPLEMENTED
+
+    return FALSE;
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisMWriteLogData(
+    IN  NDIS_HANDLE LogHandle,
+    IN  PVOID       LogBuffer,
+    IN  UINT        LogBufferSize)
+{
+    UNIMPLEMENTED
+
+       return NDIS_STATUS_FAILURE;
+}
+
+
+VOID
+EXPORT
+NdisTerminateWrapper(
+    IN  NDIS_HANDLE NdisWrapperHandle,
+    IN  PVOID       SystemSpecific)
+/*
+ * FUNCTION: Releases resources allocated by a call to NdisMInitializeWrapper
+ * ARGUMENTS:
+ *     NdisWrapperHandle = Handle returned by NdisMInitializeWrapper
+ *     SystemSpecific    = Always NULL
+ */
+{
+    ExFreePool(NdisWrapperHandle);
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/protocol.c b/reactos/drivers/net/ndis/ndis/protocol.c
new file mode 100644 (file)
index 0000000..7704738
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/protocol.c
+ * PURPOSE:     Routines used by NDIS protocol drivers
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+#include <miniport.h>
+#include <protocol.h>
+
+LIST_ENTRY ProtocolListHead;
+KSPIN_LOCK ProtocolListLock;
+
+
+VOID ProtocolWorker(
+    PVOID Context)
+/*
+ * FUNCTION: Worker function for ProtocolXxx functions
+ * ARGUMENTS:
+ *     Context = Pointer to context information (PROTOCOL_BINDING)
+ */
+{
+}
+
+
+VOID
+EXPORT
+NdisCloseAdapter(
+    OUT PNDIS_STATUS    Status,
+    IN  NDIS_HANDLE     NdisBindingHandle)
+/*
+ * FUNCTION: Closes an adapter opened with NdisOpenAdapter
+ * ARGUMENTS:
+ *     Status            = Address of buffer for status information
+ *     NdisBindingHandle = Handle returned by NdisOpenAdapter
+ */
+{
+    PADAPTER_BINDING AdapterBinding = GET_ADAPTER_BINDING(NdisBindingHandle);
+
+    ExFreePool(AdapterBinding);
+
+    *Status = NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+EXPORT
+NdisDeregisterProtocol(
+    OUT PNDIS_STATUS    Status,
+    IN NDIS_HANDLE      NdisProtocolHandle)
+/*
+ * FUNCTION: Releases the resources allocated by NdisRegisterProtocol
+ * ARGUMENTS:
+ *     Status             = Address of buffer for status information
+ *     NdisProtocolHandle = Handle returned by NdisRegisterProtocol
+ */
+{
+    ExFreePool(NdisProtocolHandle);
+    *Status = NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+EXPORT
+NdisOpenAdapter(
+    OUT PNDIS_STATUS    Status,
+    OUT PNDIS_STATUS    OpenErrorStatus,
+    OUT PNDIS_HANDLE    NdisBindingHandle,
+    OUT PUINT           SelectedMediumIndex,
+    IN  PNDIS_MEDIUM    MediumArray,
+    IN  UINT            MediumArraySize,
+    IN  NDIS_HANDLE     NdisProtocolHandle,
+    IN  NDIS_HANDLE     ProtocolBindingContext,
+    IN  PNDIS_STRING    AdapterName,
+    IN  UINT            OpenOptions,
+    IN  PSTRING         AddressingInformation   OPTIONAL)
+/*
+ * FUNCTION: Opens an adapter for communication
+ * ARGUMENTS:
+ *     Status                 = Address of buffer for status information
+ *     OpenErrorStatus        = Address of buffer for secondary error code
+ *     NdisBindingHandle      = Address of buffer for adapter binding handle
+ *     SelectedMediumIndex    = Address of buffer for selected medium
+ *     MediumArray            = Pointer to an array of NDIS_MEDIUMs called can support
+ *     MediumArraySize        = Number of elements in MediumArray
+ *     NdisProtocolHandle     = Handle returned by NdisRegisterProtocol
+ *     ProtocolBindingContext = Pointer to caller suplied context area
+ *     AdapterName            = Pointer to buffer with name of adapter
+ *     OpenOptions            = Bitmask with flags passed to next-lower driver
+ *     AddressingInformation  = Optional pointer to buffer with NIC specific information
+ */
+{
+    PADAPTER_BINDING AdapterBinding;
+    PLOGICAL_ADAPTER Adapter;
+    NDIS_STATUS NdisStatus;
+    PNDIS_MEDIUM Medium1;
+    PNDIS_MEDIUM Medium2;
+    ULONG BytesWritten;
+    BOOLEAN Found;
+    UINT i, j;
+    PPROTOCOL_BINDING Protocol = GET_PROTOCOL_BINDING(ProtocolBindingContext);
+
+    Adapter = MiniLocateDevice(AdapterName);
+
+    if (!Adapter) {
+        NDIS_DbgPrint(MIN_TRACE, ("Adapter not found.\n"));
+        *Status = NDIS_STATUS_ADAPTER_NOT_FOUND;
+        return;
+    }
+
+    /* Query the miniport driver for it's supported medias and search the list
+       to find the first medium also supported by the protocol driver */
+
+    NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MEDIA_SUPPORTED, 0, &BytesWritten);
+
+    /* FIXME: Handle this */
+    if (NdisStatus == NDIS_STATUS_PENDING) {
+        NDIS_DbgPrint(MIN_TRACE, ("NDIS_STATUS_PENDING returned!\n"));
+    }
+
+    if (!NT_SUCCESS(NdisStatus))
+        *Status = NdisStatus;
+
+    Medium1 = Adapter->QueryBuffer;
+    Medium2 = MediumArray;
+    Found   = FALSE;
+    for (i = 0; i < BytesWritten / sizeof(NDIS_MEDIUM); i++) {
+        for (j = 0; j < MediumArraySize; j++) {
+            if (Medium2[j] == Medium1[i]) {
+                *SelectedMediumIndex = j;
+                Found = TRUE;
+                break;
+            }
+        }
+        if (Found)
+            break;
+    }
+
+    if (!Found) {
+        NDIS_DbgPrint(MIN_TRACE, ("Media is not supported.\n"));
+        *Status = NDIS_STATUS_UNSUPPORTED_MEDIA;
+        return;
+    }
+
+    AdapterBinding = ExAllocatePool(NonPagedPool, sizeof(ADAPTER_BINDING));
+
+    if (!AdapterBinding) {
+        NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+        *Status = NDIS_STATUS_RESOURCES;
+        return;
+    }
+
+    RtlZeroMemory(AdapterBinding, sizeof(ADAPTER_BINDING));
+
+    /* Put on protocol binding adapter list */
+    ExInterlockedInsertTailList(&Protocol->AdapterListHead,
+                                &AdapterBinding->ProtocolListEntry,
+                                &Protocol->Lock);
+
+    *NdisBindingHandle = AdapterBinding;
+
+    *Status = NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+EXPORT
+NdisRegisterProtocol(
+    OUT PNDIS_STATUS                    Status,
+    OUT PNDIS_HANDLE                    NdisProtocolHandle,
+    IN  PNDIS_PROTOCOL_CHARACTERISTICS  ProtocolCharacteristics,
+    IN  UINT                            CharacteristicsLength)
+/*
+ * FUNCTION: Registers an NDIS driver's ProtocolXxx entry points
+ * ARGUMENTS:
+ *     Status                  = Address of buffer for status information
+ *     NdisProtocolHandle      = Address of buffer for handle used to identify the driver
+ *     ProtocolCharacteristics = Pointer to NDIS_PROTOCOL_CHARACTERISTICS structure
+ *     CharacteristicsLength   = Size of structure which ProtocolCharacteristics targets
+ */
+{
+    PPROTOCOL_BINDING Protocol;
+    NTSTATUS NtStatus;
+    UINT MinSize;
+
+    switch (ProtocolCharacteristics->MajorNdisVersion) {
+    case 0x03:
+        MinSize = sizeof(NDIS30_PROTOCOL_CHARACTERISTICS);
+        break;
+
+    case 0x04:
+        MinSize = sizeof(NDIS40_PROTOCOL_CHARACTERISTICS);
+        break;
+
+    case 0x05:
+        MinSize = sizeof(NDIS50_PROTOCOL_CHARACTERISTICS);
+        break;
+
+    default:
+        *Status = NDIS_STATUS_BAD_VERSION;
+        return;
+    }
+
+    if (CharacteristicsLength < MinSize) {
+        NDIS_DbgPrint(DEBUG_PROTOCOL, ("Bad protocol characteristics.\n"));
+        *Status = NDIS_STATUS_BAD_CHARACTERISTICS;
+        return;
+    }
+
+    Protocol = ExAllocatePool(NonPagedPool, sizeof(PROTOCOL_BINDING));
+    if (!Protocol) {
+        NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+        *Status = NDIS_STATUS_RESOURCES;
+        return;
+    }
+
+    RtlZeroMemory(Protocol, sizeof(PROTOCOL_BINDING));
+    RtlCopyMemory(&Protocol->Chars, ProtocolCharacteristics, MinSize);
+
+    NtStatus = RtlUpcaseUnicodeString(
+        &Protocol->Chars.Name,
+        &ProtocolCharacteristics->Name,
+        TRUE);
+    if (!NT_SUCCESS(NtStatus)) {
+        NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+        ExFreePool(Protocol);
+        *Status = NDIS_STATUS_RESOURCES;
+        return;
+    }
+
+    KeInitializeSpinLock(&Protocol->Lock);
+
+    Protocol->RefCount = 1;
+
+    ExInitializeWorkItem(&Protocol->WorkItem, ProtocolWorker, Protocol);
+
+    InitializeListHead(&Protocol->AdapterListHead);
+
+    *NdisProtocolHandle = Protocol;
+    *Status             = NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+EXPORT
+NdisRequest(
+    OUT PNDIS_STATUS    Status,
+    IN  NDIS_HANDLE     NdisBindingHandle,
+    IN  PNDIS_REQUEST   NdisRequest)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisReset(
+    OUT PNDIS_STATUS    Status,
+    IN  NDIS_HANDLE     NdisBindingHandle)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisSend(
+    OUT PNDIS_STATUS    Status,
+    IN  NDIS_HANDLE     NdisBindingHandle,
+    IN  PNDIS_PACKET    Packet)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisSendPackets(
+    IN  NDIS_HANDLE     NdisBindingHandle,
+    IN  PPNDIS_PACKET   PacketArray,
+    IN  UINT            NumberOfPackets)
+{
+    UNIMPLEMENTED
+}
+
+
+VOID
+EXPORT
+NdisTransferData(
+    OUT PNDIS_STATUS        Status,
+    IN  NDIS_HANDLE         NdisBindingHandle,
+    IN  NDIS_HANDLE         MacReceiveContext,
+    IN  UINT                ByteOffset,
+    IN  UINT                BytesToTransfer,
+    IN  OUT    PNDIS_PACKET    Packet,
+    OUT PUINT               BytesTransferred)
+{
+    UNIMPLEMENTED
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/string.c b/reactos/drivers/net/ndis/ndis/string.c
new file mode 100644 (file)
index 0000000..bd9fbb8
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/string.c
+ * PURPOSE:     String management routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+NDIS_STATUS
+EXPORT
+NdisAnsiStringToUnicodeString(
+    IN OUT  PNDIS_STRING        DestinationString,
+    IN      PNDIS_ANSI_STRING   SourceString)
+/*
+ * FUNCTION: Converts an ANSI string to an NDIS (unicode) string
+ * ARGUMENTS:
+ *     DestinationString = Address of buffer to place converted string in
+ *     SourceString      = Pointer to ANSI string to be converted
+ */
+{
+       return (NDIS_STATUS)RtlAnsiStringToUnicodeString(
+        (PUNICODE_STRING)DestinationString,
+        (PANSI_STRING)SourceString, FALSE);
+}
+
+
+BOOLEAN
+EXPORT
+NdisEqualString(
+    IN  PNDIS_STRING    String1,
+    IN  PNDIS_STRING    String2,
+    IN  BOOLEAN         CaseInsensitive)
+/*
+ * FUNCTION: Tests two strings for equality
+ * ARGUMENTS:
+ *     String1         = Pointer to first string
+ *     String2         = Pointer to second string
+ *     CaseInsensitive = TRUE if the compare should be case insensitive
+ */
+{
+    return RtlEqualUnicodeString(
+        (PUNICODE_STRING)String1,
+        (PUNICODE_STRING)String2,
+        CaseInsensitive);
+}
+
+
+VOID
+EXPORT
+NdisInitAnsiString(
+    IN OUT  PNDIS_ANSI_STRING   DestinationString,
+    IN      PCSTR               SourceString)
+/*
+ * FUNCTION: Initializes an ANSI string
+ * ARGUMENTS:
+ *     DestinationString = Address of buffer to place string in
+ *     SourceString      = Pointer to null terminated ANSI string
+ */
+{
+    RtlInitString(
+        (PANSI_STRING)DestinationString,
+        (PCSZ)SourceString);
+}
+
+
+VOID
+EXPORT
+NdisInitializeString(
+    IN OUT  PNDIS_STRING    DestinationString,
+    IN      PUCHAR          SourceString)
+/*
+ * FUNCTION: Initializes an NDIS (unicode) string
+ * ARGUMENTS:
+ *     DestinationString = Address of buffer to place string in
+ *     SourceString      = Pointer to null terminated ANSI string
+ */
+{
+    ANSI_STRING AnsiString;
+
+    RtlInitAnsiString(
+        &AnsiString,
+        (PCSZ)SourceString);
+
+    RtlAnsiStringToUnicodeString(
+        (PUNICODE_STRING)DestinationString,
+        &AnsiString,
+        TRUE);
+}
+
+
+VOID
+EXPORT
+NdisInitUnicodeString(
+    IN OUT  PNDIS_STRING    DestinationString,
+    IN      PCWSTR          SourceString)
+/*
+ * FUNCTION: Initializes an unicode string
+ * ARGUMENTS:
+ *     DestinationString = Address of buffer to place string in
+ *     SourceString      = Pointer to null terminated unicode string
+ */
+{
+    RtlInitUnicodeString(
+        (PUNICODE_STRING)DestinationString,
+        SourceString);
+}
+
+
+NDIS_STATUS
+EXPORT
+NdisUnicodeStringToAnsiString(
+    IN OUT  PNDIS_ANSI_STRING   DestinationString,
+    IN      PNDIS_STRING        SourceString)
+/*
+ * FUNCTION: Converts an NDIS (unicode) string to an ANSI string
+ * ARGUMENTS:
+ *     DestinationString = Address of buffer to place converted string in
+ *     SourceString      = Pointer to unicode string to be converted
+ */
+{
+       return (NDIS_STATUS)RtlUnicodeStringToAnsiString(
+        (PANSI_STRING)DestinationString,
+        (PUNICODE_STRING)SourceString,
+        FALSE);
+}
+
+
+NTSTATUS
+EXPORT
+NdisUpcaseUnicodeString(
+    OUT PUNICODE_STRING DestinationString,  
+    IN  PUNICODE_STRING SourceString)
+/*
+ * FUNCTION:
+ * ARGUMENTS:
+ * NOTES:
+ *    NDIS 5.0
+ */
+{
+    UNIMPLEMENTED
+
+    return STATUS_NOT_IMPLEMENTED;
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/ndis/time.c b/reactos/drivers/net/ndis/ndis/time.c
new file mode 100644 (file)
index 0000000..95b0416
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * COPYRIGHT:   See COPYING in the top level directory
+ * PROJECT:     ReactOS NDIS library
+ * FILE:        ndis/time.c
+ * PURPOSE:     Time related routines
+ * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * REVISIONS:
+ *   CSH 01/08-2000 Created
+ */
+#include <ndissys.h>
+
+
+VOID
+EXPORT
+NdisCancelTimer(
+    IN  PNDIS_TIMER Timer,
+    OUT PBOOLEAN    TimerCancelled)
+{
+} 
+
+
+VOID
+EXPORT
+NdisGetCurrentSystemTime (
+    IN  OUT PLONGLONG   pSystemTime)
+{
+}
+
+
+VOID
+EXPORT
+NdisInitializeTimer(
+    IN OUT  PNDIS_TIMER             Timer,
+    IN      PNDIS_TIMER_FUNCTION    TimerFunction,
+    IN      PVOID                   FunctionContext)
+{
+}
+
+
+VOID
+EXPORT
+NdisMCancelTimer(
+    IN  PNDIS_MINIPORT_TIMER    Timer,
+    OUT PBOOLEAN                TimerCancelled)
+{
+}
+
+
+VOID
+EXPORT
+NdisMInitializeTimer(
+    IN OUT  PNDIS_MINIPORT_TIMER    Timer,
+    IN      NDIS_HANDLE             MiniportAdapterHandle,
+    IN      PNDIS_TIMER_FUNCTION    TimerFunction,
+    IN      PVOID                   FunctionContext)
+{
+}
+
+
+VOID
+EXPORT
+NdisMSetPeriodicTimer(
+    IN PNDIS_MINIPORT_TIMER    Timer,
+    IN UINT                    MillisecondsPeriod)
+{
+}
+
+
+VOID
+EXPORT
+NdisMSetTimer(
+    IN  PNDIS_MINIPORT_TIMER    Timer,
+    IN  UINT                    MillisecondsToDelay)
+{
+}
+
+
+VOID
+EXPORT
+NdisSetTimer(
+    IN  PNDIS_TIMER Timer,
+    IN  UINT        MillisecondsToDelay)
+{
+}
+
+/* EOF */
diff --git a/reactos/drivers/net/ndis/readme.txt b/reactos/drivers/net/ndis/readme.txt
new file mode 100644 (file)
index 0000000..aeaa136
--- /dev/null
@@ -0,0 +1,18 @@
+Build instructions for NDIS library
+-----------------------------------
+
+Building with Visual C++ and Windows NT DDK:
+
+Variables:
+%BASEDIR%     = path to NT4 DDK (e.g. c:\ntddk)
+%DDKBUILDENV% = DDK build environment (free or checked)
+
+DDK environment variables must be set! (run setenv.bat)
+
+    - Create the directory objects/i386/%DDKBUILDENV%
+    - Run "build" to build the library
+
+
+Building with Mingw32 and ReactOS include files:
+
+    - Run "make ndis" FROM THE ReactOS ROOT DIRECTORY to build the library