Author: cgutman
Date: Thu Mar 12 01:15:12 2009
New Revision: 39964
URL:
http://svn.reactos.org/svn/reactos?rev=39964&view=rev
Log:
- Merge aicom-network-fixes up to r39943
Removed:
trunk/reactos/drivers/network/tcpip/include/bug.h
trunk/reactos/drivers/network/tcpip/tcpip/bug.c
trunk/reactos/drivers/network/tcpip/tcpip/mockbug.c
Modified:
trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c
trunk/reactos/drivers/network/ndis/ndis/config.c
trunk/reactos/drivers/network/tcpip/include/precomp.h
trunk/reactos/drivers/network/tcpip/tcpip.rbuild
trunk/reactos/lib/drivers/ip/network/memtrack.c
trunk/reactos/lib/drivers/ip/transport/tcp/event.c
Modified: trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/ne2000/…
==============================================================================
--- trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/dd/ne2000/ne2000/main.c [iso-8859-1] Thu Mar 12 01:15:12
2009
@@ -235,6 +235,9 @@
UINT i;
NDIS_STATUS Status;
PNIC_ADAPTER Adapter;
+ NDIS_HANDLE ConfigurationHandle;
+ UINT *RegNetworkAddress = 0;
+ UINT RegNetworkAddressLength = 0;
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
@@ -281,10 +284,7 @@
if (Status != NDIS_STATUS_SUCCESS)
{
PNDIS_CONFIGURATION_PARAMETER ConfigurationParameter;
- NDIS_HANDLE ConfigurationHandle;
UNICODE_STRING Keyword;
- UINT *RegNetworkAddress = 0;
- UINT RegNetworkAddressLength = 0;
NdisOpenConfiguration(&Status, &ConfigurationHandle,
WrapperConfigurationContext);
if (Status == NDIS_STATUS_SUCCESS)
@@ -308,18 +308,6 @@
Adapter->IoBaseAddress =
ConfigurationParameter->ParameterData.IntegerData;
}
- /* the returned copy of the data is owned by NDIS and will be released on
NdisCloseConfiguration */
- NdisReadNetworkAddress(&Status, (PVOID *)&RegNetworkAddress,
&RegNetworkAddressLength, ConfigurationHandle);
- if(Status == NDIS_STATUS_SUCCESS && RegNetworkAddressLength ==
DRIVER_LENGTH_OF_ADDRESS)
- {
- int i;
- NDIS_DbgPrint(MID_TRACE,("NdisReadNetworkAddress returned
successfully, address %x:%x:%x:%x:%x:%x\n",
- RegNetworkAddress[0], RegNetworkAddress[1], RegNetworkAddress[2],
RegNetworkAddress[3],
- RegNetworkAddress[4], RegNetworkAddress[5]));
- for(i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
- Adapter->StationAddress[i] = RegNetworkAddress[i];
- }
-
NdisCloseConfiguration(ConfigurationHandle);
}
else
@@ -366,6 +354,30 @@
NDIS_DbgPrint(MID_TRACE, ("Status (0x%X).\n", Status));
MiniportHalt((NDIS_HANDLE)Adapter);
return Status;
+ }
+
+ NdisOpenConfiguration(&Status, &ConfigurationHandle,
WrapperConfigurationContext);
+ if (Status == NDIS_STATUS_SUCCESS)
+ {
+ NdisReadNetworkAddress(&Status, (PVOID *)&RegNetworkAddress,
&RegNetworkAddressLength, ConfigurationHandle);
+ if(Status == NDIS_STATUS_SUCCESS && RegNetworkAddressLength ==
DRIVER_LENGTH_OF_ADDRESS)
+ {
+ int i;
+ NDIS_DbgPrint(MID_TRACE,("NdisReadNetworkAddress returned successfully,
address %x:%x:%x:%x:%x:%x\n",
+ RegNetworkAddress[0], RegNetworkAddress[1], RegNetworkAddress[2],
RegNetworkAddress[3],
+ RegNetworkAddress[4], RegNetworkAddress[5]));
+ for(i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
+ Adapter->StationAddress[i] = RegNetworkAddress[i];
+ }
+
+ NdisCloseConfiguration(ConfigurationHandle);
+ }
+
+ if (Status != NDIS_STATUS_SUCCESS)
+ {
+ int i;
+ for (i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
+ Adapter->StationAddress[i] = Adapter->PermanentAddress[i];
}
NDIS_DbgPrint(MID_TRACE, ("BOARDDATA:\n"));
@@ -659,11 +671,19 @@
* Status of operation
*/
{
+ NDIS_STATUS NdisStatus = NDIS_STATUS_SUCCESS;
+
ASSERT_IRQL_EQUAL(DISPATCH_LEVEL);
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
- return NDIS_STATUS_FAILURE;
+#ifndef NOCARD
+ NdisStatus = NICReset((PNIC_ADAPTER)MiniportAdapterContext);
+#endif
+
+ *AddressingReset = TRUE;
+
+ return NdisStatus;
}
Modified: trunk/reactos/drivers/network/ndis/ndis/config.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] Thu Mar 12 01:15:12
2009
@@ -699,16 +699,7 @@
PNDIS_CONFIGURATION_PARAMETER ParameterValue = NULL;
NDIS_STRING Keyword;
UINT *IntArray = 0;
- int i;
-
- /* FIXME - We don't quite support this yet due to buggy code below */
- {
- *Status = NDIS_STATUS_FAILURE;
- return;
- }
-
- *NetworkAddress = NULL;
- *NetworkAddressLength = 6;/* XXX magic constant */
+ UINT i,j = 0;
NdisInitUnicodeString(&Keyword, L"NetworkAddress");
NdisReadConfiguration(Status, &ParameterValue, ConfigurationHandle, &Keyword,
NdisParameterString);
@@ -718,8 +709,11 @@
return;
}
- /* 6 bytes for ethernet, tokenring, fddi, everything else? */
- IntArray = ExAllocatePool(PagedPool, 6*sizeof(UINT));
+ while (ParameterValue->ParameterData.StringData.Buffer[j] != '\0') j++;
+
+ *NetworkAddressLength = (UINT)((j/2)+0.5);
+
+ IntArray = ExAllocatePool(PagedPool, (*NetworkAddressLength)*sizeof(UINT));
if(!IntArray)
{
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
@@ -742,7 +736,7 @@
ExInterlockedInsertTailList(&ConfigurationContext->ResourceListHead,
&MiniportResource->ListEntry, &ConfigurationContext->ResourceLock);
/* convert from string to bytes */
- for(i=0; i<6; i++)
+ for(i=0; i<(*NetworkAddressLength); i++)
{
IntArray[i] =
(UnicodeToHexByte((ParameterValue->ParameterData.StringData.Buffer)[2*i]) << 4)
+
UnicodeToHexByte((ParameterValue->ParameterData.StringData.Buffer)[2*i+1]);
Removed: trunk/reactos/drivers/network/tcpip/include/bug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/bug.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/bug.h (removed)
@@ -1,6 +1,0 @@
-#ifndef _TCPIP_BUG_H
-#define _TCPIP_BUG_H
-
-VOID TcpipBugCheck( ULONG BugCode );
-
-#endif/*_TCPIP_BUG_H*/
Modified: trunk/reactos/drivers/network/tcpip/include/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/precomp.h [iso-8859-1] Thu Mar 12 01:15:12
2009
@@ -30,7 +30,6 @@
#include <fileobjs.h>
#include <lock.h>
#include <wait.h>
-#include <bug.h>
#include <memtrack.h>
#include <oskittcp.h>
#include <interface.h>
Modified: trunk/reactos/drivers/network/tcpip/tcpip.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip.rbuild [iso-8859-1] Thu Mar 12 01:15:12
2009
@@ -26,7 +26,6 @@
</directory>
<directory name="tcpip">
<file>buffer.c</file>
- <file>bug.c</file>
<file>dispatch.c</file>
<file>fileobjs.c</file>
<file>iinfo.c</file>
Removed: trunk/reactos/drivers/network/tcpip/tcpip/bug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/bug.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/bug.c (removed)
@@ -1,11 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS TCP/IP protocol driver
- * FILE: tcpip/bug.c
- * PURPOSE: Bugcheck
- * PROGRAMMERS: Art Yerkes
- * REVISIONS:
- */
-#include "precomp.h"
-
-VOID TcpipBugCheck( ULONG BugCode ) { KeBugCheck( BugCode ); }
Removed: trunk/reactos/drivers/network/tcpip/tcpip/mockbug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/mockbug.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/mockbug.c (removed)
@@ -1,14 +1,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS TCP/IP protocol driver
- * FILE: tcpip/bug.c
- * PURPOSE: Bugcheck
- * PROGRAMMERS: Art Yerkes
- * REVISIONS:
- */
-#include "precomp.h"
-
-VOID TcpipBugCheck( ULONG BugCode ) {
- DbgPrint("BugCheck called: %x\n", BugCode);
- ASSERT(0);
-}
Modified: trunk/reactos/lib/drivers/ip/network/memtrack.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/mem…
==============================================================================
--- trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/network/memtrack.c [iso-8859-1] Thu Mar 12 01:15:12 2009
@@ -124,7 +124,7 @@
if ( ThingInList->Tag != Tag ) {
DbgPrint("UNTRACK: TAG DOES NOT MATCH (%x)\n", Thing);
ShowTrackedThing("Tag Mismatch (Item in list)", ThingInList,
TRUE);
- TcpipBugCheck( 0 );
+ ASSERT( FALSE );
}
ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList,
@@ -139,7 +139,7 @@
}
TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql );
DbgPrint("UNTRACK: SPECIFIED ALREADY FREE ITEM %x\n", Thing);
- TcpipBugCheck( 0 );
+ ASSERT( FALSE );
}
VOID TrackDumpFL( PCHAR File, ULONG Line ) {
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Thu Mar 12 01:15:12
2009
@@ -76,8 +76,6 @@
OskitDumpBuffer( data, len );
return OSK_EINVAL;
}
-
- RemoteAddress.Type = LocalAddress.Type = IP_ADDRESS_V4;
if(!(NCE = RouteGetRouteToDestination( &RemoteAddress ))) {
TI_DbgPrint(MIN_TRACE,("No route to %s\n", A2S(&RemoteAddress)));