Author: arty
Date: Mon May 8 06:45:40 2006
New Revision: 21847
URL:
http://svn.reactos.ru/svn/reactos?rev=21847&view=rev
Log:
Fix device registration. The actual reason it didn't work was that we weren't
adding the device to the list until after calling the BindAdapter method.
Modified:
trunk/reactos/drivers/network/ndis/ndis/main.c
trunk/reactos/drivers/network/ndis/ndis/miniport.c
Modified: trunk/reactos/drivers/network/ndis/ndis/main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/m…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/main.c (original)
+++ trunk/reactos/drivers/network/ndis/ndis/main.c Mon May 8 06:45:40 2006
@@ -17,8 +17,8 @@
#ifdef DBG
/* See debug.h for debug/trace constants */
-ULONG DebugTraceLevel = MIN_TRACE;
-//ULONG DebugTraceLevel = DEBUG_ULTRA;
+//ULONG DebugTraceLevel = MIN_TRACE;
+ULONG DebugTraceLevel = (ULONG)-1;
#endif /* DBG */
Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/m…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/miniport.c (original)
+++ trunk/reactos/drivers/network/ndis/ndis/miniport.c Mon May 8 06:45:40 2006
@@ -507,28 +507,26 @@
KeAcquireSpinLock(&AdapterListLock, &OldIrql);
{
- do
+ CurrentEntry = AdapterListHead.Flink;
+
+ while (CurrentEntry != &AdapterListHead)
{
- CurrentEntry = AdapterListHead.Flink;
-
- while (CurrentEntry != &AdapterListHead)
- {
- Adapter = CONTAINING_RECORD(CurrentEntry, LOGICAL_ADAPTER, ListEntry);
-
- ASSERT(Adapter);
-
- NDIS_DbgPrint(DEBUG_MINIPORT, ("AdapterName = %wZ\n",
AdapterName));
- NDIS_DbgPrint(DEBUG_MINIPORT, ("DeviceName = %wZ\n",
&Adapter->NdisMiniportBlock.MiniportName));
-
- if (RtlCompareUnicodeString(AdapterName,
&Adapter->NdisMiniportBlock.MiniportName, TRUE) == 0)
- {
- break;
- }
-
- Adapter = NULL;
- CurrentEntry = CurrentEntry->Flink;
- }
- } while (0);
+ Adapter = CONTAINING_RECORD(CurrentEntry, LOGICAL_ADAPTER, ListEntry);
+
+ ASSERT(Adapter);
+
+ NDIS_DbgPrint(DEBUG_MINIPORT, ("Examining adapter 0x%lx\n", Adapter));
+ NDIS_DbgPrint(DEBUG_MINIPORT, ("AdapterName = %wZ\n", AdapterName));
+ NDIS_DbgPrint(DEBUG_MINIPORT, ("DeviceName = %wZ\n",
&Adapter->NdisMiniportBlock.MiniportName));
+
+ if (RtlCompareUnicodeString(AdapterName,
&Adapter->NdisMiniportBlock.MiniportName, TRUE) == 0)
+ {
+ break;
+ }
+
+ Adapter = NULL;
+ CurrentEntry = CurrentEntry->Flink;
+ }
}
KeReleaseSpinLock(&AdapterListLock, OldIrql);
@@ -1295,6 +1293,13 @@
* Prepare wrapper context used by HW and configuration routines.
*/
+ NDIS_DbgPrint(DEBUG_MINIPORT, ("Start Device %wZ\n",
&Adapter->NdisMiniportBlock.MiniportName));
+
+ NDIS_DbgPrint(MAX_TRACE, ("Inserting adapter 0x%x into adapter list\n",
Adapter));
+
+ /* Put adapter in global adapter list */
+ ExInterlockedInsertTailList(&AdapterListHead, &Adapter->ListEntry,
&AdapterListLock);
+
Status = IoOpenDeviceRegistryKey(
Adapter->NdisMiniportBlock.PhysicalDeviceObject, PLUGPLAY_REGKEY_DRIVER,
KEY_ALL_ACCESS, &WrapperContext.RegistryHandle);
@@ -1476,9 +1481,6 @@
/* Put adapter in adapter list for this miniport */
ExInterlockedInsertTailList(&Adapter->NdisMiniportBlock.DriverHandle->DeviceList,
&Adapter->MiniportListEntry,
&Adapter->NdisMiniportBlock.DriverHandle->Lock);
- /* Put adapter in global adapter list */
- ExInterlockedInsertTailList(&AdapterListHead, &Adapter->ListEntry,
&AdapterListLock);
-
return STATUS_SUCCESS;
}