Commit in reactos on MAIN
drivers/net/ndis/ndis/main.c+1-11.14 -> 1.15
                     /miniport.c+30-121.29 -> 1.30
drivers/net/dd/ne2000/ne2000/8390.c+21-31.5 -> 1.6
                            /main.c+3-11.5 -> 1.6
include/net/ndis.h+2-21.28 -> 1.29
+57-19
5 modified files
According to this osr page:
http://www.osr.com/ddk/network/103ndisx_51pu.htm

NdisMEthIndicateReceive passes an NDIS_HANDLE (Specifically, 
MiniportAdapterHandle), rather than the ETH_FILTER structure.  God knows why
this wasn't caught before but it did awfully strange stuff including the
occasional crash, and more importantly, seemingly randomly corrupting the
LAN_ADAPTER and IP_INTERFACE structures in tcpip.sys when we landed in
packet receiving in datalink/lan.c.  Fixed now.

reactos/drivers/net/ndis/ndis
main.c 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- main.c	7 Jul 2004 08:39:54 -0000	1.14
+++ main.c	24 Jul 2004 04:48:00 -0000	1.15
@@ -18,7 +18,7 @@
 #ifdef DBG
 
 /* See debug.h for debug/trace constants */
-DWORD DebugTraceLevel = 0;
+DWORD DebugTraceLevel = MIN_TRACE;
 
 #endif /* DBG */
 

reactos/drivers/net/ndis/ndis
miniport.c 1.29 -> 1.30
diff -u -r1.29 -r1.30
--- miniport.c	22 Jul 2004 18:54:36 -0000	1.29
+++ miniport.c	24 Jul 2004 04:48:00 -0000	1.30
@@ -162,7 +162,8 @@
   /* KIRQL OldIrql; */
   PLIST_ENTRY CurrentEntry;
   PADAPTER_BINDING AdapterBinding;
-
+  static PVOID ReceiveHandler = 0;
+  
   NDIS_DbgPrint(DEBUG_MINIPORT, ("Called. Adapter (0x%X)  HeaderBuffer (0x%X)  "
       "HeaderBufferSize (0x%X)  LookaheadBuffer (0x%X)  LookaheadBufferSize (0x%X).\n",
       Adapter, HeaderBuffer, HeaderBufferSize, LookaheadBuffer, LookaheadBufferSize));
@@ -225,6 +226,25 @@
             }
 #endif
 
+	  if( !ReceiveHandler ) 
+	      ReceiveHandler = 
+		  *AdapterBinding->ProtocolBinding->Chars.u4.ReceiveHandler;
+	  ASSERT( ReceiveHandler ==
+		  *AdapterBinding->ProtocolBinding->Chars.u4.ReceiveHandler );
+	      
+
+	  NDIS_DbgPrint
+	      (MID_TRACE, 
+	       ("XXX (%x) %x %x %x %x %x %x %x XXX\n",
+		*AdapterBinding->ProtocolBinding->Chars.u4.ReceiveHandler,
+		AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
+		MacReceiveContext,
+		HeaderBuffer,
+		HeaderBufferSize,
+		LookaheadBuffer,
+		LookaheadBufferSize,
+		PacketSize));
+
           /* call the receive handler */
           (*AdapterBinding->ProtocolBinding->Chars.u4.ReceiveHandler)(
               AdapterBinding->NdisOpenBlock.ProtocolBindingContext,
@@ -353,7 +373,7 @@
 
 VOID STDCALL
 MiniEthReceiveIndication(
-    IN  PETH_FILTER Filter,     /* shouldn't be NDIS_HANDLE? */
+    IN  NDIS_HANDLE MiniportAdapter,
     IN  NDIS_HANDLE MacReceiveContext,
     IN  PCHAR       Address,
     IN  PVOID       HeaderBuffer,
@@ -364,7 +384,7 @@
 /*
  * FUNCTION: Receive indication function for Ethernet devices
  * ARGUMENTS:
- *     Filter              = Pointer to Ethernet filter
+ *     MiniportAdapter     = Miniport Adapter Handle (PLOGICAL_ADAPTER)
  *     MacReceiveContext   = MAC receive context handle
  *     Address             = Pointer to destination Ethernet address
  *     HeaderBuffer        = Pointer to Ethernet header buffer
@@ -374,15 +394,13 @@
  *     PacketSize          = Total size of received packet
  */
 {
-    if( Filter ) {
-	MiniIndicateData((PLOGICAL_ADAPTER)Filter->Miniport,
-			 MacReceiveContext,
-			 HeaderBuffer,
-			 HeaderBufferSize,
-			 LookaheadBuffer,
-			 LookaheadBufferSize,
-			 PacketSize);
-    }
+    MiniIndicateData(MiniportAdapter,
+		     MacReceiveContext,
+		     HeaderBuffer,
+		     HeaderBufferSize,
+		     LookaheadBuffer,
+		     LookaheadBufferSize,
+		     PacketSize);
 }
 
 

reactos/drivers/net/dd/ne2000/ne2000
8390.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- 8390.c	11 May 2004 20:52:09 -0000	1.5
+++ 8390.c	24 Jul 2004 04:48:01 -0000	1.6
@@ -7,7 +7,9 @@
  * REVISIONS:
  *   CSH 27/08-2000 Created
  */
+#include <roscfg.h>
 #include <ne2000.h>
+#include <debug.h>
 
 /* Null-terminated array of ports to probe. This is "semi-risky" (Don Becker).  */
 ULONG ProbeAddressList[] = { 0x280, 0x300, 0x320, 0x340, 0x360, 0x380, 0 };
@@ -921,6 +923,8 @@
 #endif
 
     if (IndicateLength >= DRIVER_HEADER_SIZE) {
+	NDIS_DbgPrint(MAX_TRACE,("Adapter->MiniportAdapterHandle: %x\n",
+				 Adapter->MiniportAdapterHandle));
         NdisMEthIndicateReceive(Adapter->MiniportAdapterHandle,
                                 NULL,
                                 (PVOID)&Adapter->Lookahead,
@@ -974,6 +978,8 @@
         /* Skip packet */
         Adapter->NextPacket = Adapter->CurrentPage;
     } else {
+	NDIS_DbgPrint(MAX_TRACE,("Adapter->MiniportAdapterHandle: %x\n",
+				 Adapter->MiniportAdapterHandle));
         NICIndicatePacket(Adapter);
 
         /* Go to the next free buffer in receive ring */
@@ -1221,6 +1227,8 @@
         } else {
             NDIS_DbgPrint(MID_TRACE, ("Got a packet in the receive ring.\n"));
 
+	    NDIS_DbgPrint(MAX_TRACE,("Adapter->MiniportAdapterHandle: %x\n",
+				     Adapter->MiniportAdapterHandle));
             /* Read packet from receive buffer ring */
             NICReadPacket(Adapter);
 
@@ -1334,7 +1342,12 @@
             /* Overflow. Handled almost the same way as a receive interrupt */
             Adapter->BufferOverflow = TRUE;
 
-            HandleReceive(Adapter);
+	    NDIS_DbgPrint(MAX_TRACE,("Adapter->MiniportAdapterHandle: %x\n",
+				     Adapter->MiniportAdapterHandle));
+	    if(Adapter->MiniportAdapterHandle)
+		HandleReceive(Adapter);
+	    else
+		NDIS_DbgPrint(MAX_TRACE,("No miniport adapter yet\n"));
 
             Adapter->InterruptStatus &= ~ISR_OVW;
             break;
@@ -1348,8 +1361,13 @@
         case ISR_PRX:
             NDIS_DbgPrint(MID_TRACE, ("Receive interrupt.\n"));
 
-            HandleReceive(Adapter);
-
+	    NDIS_DbgPrint(MAX_TRACE,("Adapter->MiniportAdapterHandle: %x\n",
+				     Adapter->MiniportAdapterHandle));
+	    if(Adapter->MiniportAdapterHandle)
+		HandleReceive(Adapter);
+	    else
+		NDIS_DbgPrint(MAX_TRACE,("No miniport adapter yet\n"));
+	    
             Adapter->InterruptStatus &= ~(ISR_PRX | ISR_RXE);
             break;  
 

reactos/drivers/net/dd/ne2000/ne2000
main.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- main.c	11 May 2004 20:52:09 -0000	1.5
+++ main.c	24 Jul 2004 04:48:01 -0000	1.6
@@ -7,7 +7,9 @@
  * REVISIONS:
  *   CSH 27/08-2000 Created
  */
+#include <roscfg.h>
 #include <ne2000.h>
+#include <debug.h>
 
 
 #ifdef DBG
@@ -163,7 +165,7 @@
     NDIS_STATUS Status;
     PNIC_ADAPTER Adapter;
 
-    NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
+    NDIS_DbgPrint(MAX_TRACE, ("Called (Adapter %X).\n", MiniportAdapterHandle));
 
     /* Search for 802.3 media which is the only one we support */
     for (i = 0; i < MediumArraySize; i++) {

reactos/include/net
ndis.h 1.28 -> 1.29
diff -u -r1.28 -r1.29
--- ndis.h	11 May 2004 20:52:10 -0000	1.28
+++ ndis.h	24 Jul 2004 04:48:01 -0000	1.29
@@ -4452,7 +4452,7 @@
 
 typedef VOID
 (STDCALL *ETH_RCV_INDICATE_HANDLER)(
-    IN  PETH_FILTER Filter,
+    IN  NDIS_HANDLE MiniportAdapter,
     IN  NDIS_HANDLE MacReceiveContext,
     IN  PCHAR       Address,
     IN  PVOID       HeaderBuffer,
@@ -4986,7 +4986,7 @@
                                 PacketSize)             \
 {                                                       \
     (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxIndicateHandler)( \
-        (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.u.EthDB), \
+		(MiniportAdapterHandle),  \
 		(MiniportReceiveContext), \
 		(HeaderBuffer),           \
 		(HeaderBuffer),           \
CVSspam 0.2.8