Author: cgutman
Date: Thu Jul 22 19:01:49 2010
New Revision: 48193
URL:
http://svn.reactos.org/svn/reactos?rev=48193&view=rev
Log:
[NDIS]
- Refresh the protocol bindings after a new miniport is added
- Adapters added after boot work now
- One step closer to Live CD networking
Modified:
trunk/reactos/drivers/network/ndis/include/protocol.h
trunk/reactos/drivers/network/ndis/ndis/miniport.c
trunk/reactos/drivers/network/ndis/ndis/protocol.c
Modified: trunk/reactos/drivers/network/ndis/include/protocol.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
==============================================================================
--- trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/include/protocol.h [iso-8859-1] Thu Jul 22 19:01:49
2010
@@ -69,4 +69,8 @@
NDIS_STATUS
proSendPacketToMiniport(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet);
+VOID
+NTAPI
+ndisBindMiniportsToProtocol(OUT PNDIS_STATUS Status, IN PNDIS_PROTOCOL_CHARACTERISTICS
ProtocolCharacteristics);
+
/* EOF */
Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Thu Jul 22 19:01:49
2010
@@ -1778,6 +1778,8 @@
LARGE_INTEGER Timeout;
UINT MaxMulticastAddresses;
ULONG BytesWritten;
+ PLIST_ENTRY CurrentEntry;
+ PPROTOCOL_BINDING ProtocolBinding;
/*
* Prepare wrapper context used by HW and configuration routines.
@@ -2055,6 +2057,17 @@
/* Put adapter in adapter list for this miniport */
ExInterlockedInsertTailList(&Adapter->NdisMiniportBlock.DriverHandle->DeviceList,
&Adapter->MiniportListEntry,
&Adapter->NdisMiniportBlock.DriverHandle->Lock);
+
+ /* Refresh bindings for all protocols */
+ CurrentEntry = ProtocolListHead.Flink;
+ while (CurrentEntry != &ProtocolListHead)
+ {
+ ProtocolBinding = CONTAINING_RECORD(CurrentEntry, PROTOCOL_BINDING, ListEntry);
+
+ ndisBindMiniportsToProtocol(&NdisStatus, &ProtocolBinding->Chars);
+
+ CurrentEntry = CurrentEntry->Flink;
+ }
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Thu Jul 22 19:01:49
2010
@@ -1002,7 +1002,10 @@
{
BIND_HANDLER BindHandler = ProtocolCharacteristics->BindAdapterHandler;
if(BindHandler)
+ {
BindHandler(Status, BindContext, &DeviceName, &RegistryPath, 0);
+ NDIS_DbgPrint(MIN_TRACE, ("%wZ's BindAdapter handler returned 0x%x
for %wZ\n", &ProtocolCharacteristics->Name, *Status, &DeviceName));
+ }
else
NDIS_DbgPrint(MIN_TRACE, ("No protocol bind handler
specified\n"));
}