Author: cgutman
Date: Wed Mar 11 03:51:27 2009
New Revision: 39943
URL:
http://svn.reactos.org/svn/reactos?rev=39943&view=rev
Log:
- Use the permanent address as the current address if we can't read the current
address from the registry
Modified:
branches/aicom-network-fixes/drivers/network/dd/ne2000/ne2000/main.c
Modified: branches/aicom-network-fixes/drivers/network/dd/ne2000/ne2000/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/dd/ne2000/ne2000/main.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/dd/ne2000/ne2000/main.c [iso-8859-1] Wed
Mar 11 03:51:27 2009
@@ -311,40 +311,11 @@
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
{
NDIS_DbgPrint(MIN_TRACE,("NdisOpenConfiguration returned error
0x%x\n", Status));
- }
- } else {
- 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);
}
}
@@ -386,6 +357,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"));