Author: cgutman
Date: Fri Mar 13 02:29:23 2009
New Revision: 39995
URL:
http://svn.reactos.org/svn/reactos?rev=39995&view=rev
Log:
- Add support for manually setting the adapter's network address
Modified:
branches/aicom-network-fixes/drivers/network/dd/pcnet/pcnet.c
Modified: branches/aicom-network-fixes/drivers/network/dd/pcnet/pcnet.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/dd/pcnet/pcnet.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/dd/pcnet/pcnet.c [iso-8859-1] Fri Mar 13
02:29:23 2009
@@ -830,6 +830,9 @@
PADAPTER Adapter = 0;
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
BOOLEAN InterruptRegistered = FALSE;
+ NDIS_HANDLE ConfigurationHandle;
+ UINT *RegNetworkAddress = 0;
+ UINT RegNetworkAddressLength = 0;
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
@@ -923,6 +926,25 @@
/* set up the initialization block */
MiPrepareInitializationBlock(Adapter);
+
+ /* see if someone set a network address manually */
+ NdisOpenConfiguration(&Status, &ConfigurationHandle,
WrapperConfigurationContext);
+ if (Status == NDIS_STATUS_SUCCESS)
+ {
+ NdisReadNetworkAddress(&Status, (PVOID *)&RegNetworkAddress,
&RegNetworkAddressLength, ConfigurationHandle);
+ if(Status == NDIS_STATUS_SUCCESS && RegNetworkAddressLength == 6)
+ {
+ int i;
+ DPRINT("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 < 6; i++)
+ Adapter->InitializationBlockVirt->PADR[i] = RegNetworkAddress[i];
+ }
+
+ NdisCloseConfiguration(ConfigurationHandle);
+ }
DPRINT("Interrupt registered successfully\n");