Author: cgutman
Date: Tue Jan 10 00:44:16 2012
New Revision: 54895
URL:
http://svn.reactos.org/svn/reactos?rev=54895&view=rev
Log:
[PCNET]
- Apply the same hack for OID_GEN_MEDIA_CONNECT_STATUS as we did for
OID_GEN_HARDWARE_STATUS (since media state detection is broken for certain adapters)
[DHCPCSVC]
- Keep the adapter thread running to handle media state changes
[TCPIP]
- Fix media state detection which was totally broken because it was using the wrong OID
Modified:
branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c
branches/wlan-bringup/drivers/network/dd/pcnet/requests.c
branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c
branches/wlan-bringup/lib/drivers/ip/network/interface.c
Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc…
==============================================================================
--- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] (original)
+++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] Tue Jan 10
00:44:16 2012
@@ -345,15 +345,12 @@
DH_DbgPrint(MID_TRACE,("Adapter %d was rejected\n",
Table->table[i].dwIndex));
}
+#if 0
Error = NotifyAddrChange(NULL, NULL);
-#if 0
if (Error != NO_ERROR)
break;
#else
- if (AdapterCount)
- break;
- else
- Sleep(3000);
+ Sleep(3000);
#endif
} while (TRUE);
Modified: branches/wlan-bringup/drivers/network/dd/pcnet/requests.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/dd…
==============================================================================
--- branches/wlan-bringup/drivers/network/dd/pcnet/requests.c [iso-8859-1] (original)
+++ branches/wlan-bringup/drivers/network/dd/pcnet/requests.c [iso-8859-1] Tue Jan 10
00:44:16 2012
@@ -266,7 +266,7 @@
case OID_GEN_MEDIA_CONNECT_STATUS:
{
- GenericULONG = Adapter->MediaState;
+ GenericULONG = (ULONG)NdisMediaStateConnected; /* Adapter->MediaState */
break;
}
Modified: branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/tc…
==============================================================================
--- branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ branches/wlan-bringup/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Tue Jan 10
00:44:16 2012
@@ -185,7 +185,9 @@
case OID_GEN_HARDWARE_STATUS:
*Result = NdisHardwareStatusReady;
return STATUS_SUCCESS;
-
+ case OID_GEN_MEDIA_CONNECT_STATUS:
+ *Result = NdisMediaStateConnected;
+ return STATUS_SUCCESS;
default:
return STATUS_INVALID_PARAMETER;
}
Modified: branches/wlan-bringup/lib/drivers/ip/network/interface.c
URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/lib/drivers/ip/net…
==============================================================================
--- branches/wlan-bringup/lib/drivers/ip/network/interface.c [iso-8859-1] (original)
+++ branches/wlan-bringup/lib/drivers/ip/network/interface.c [iso-8859-1] Tue Jan 10
00:44:16 2012
@@ -196,27 +196,26 @@
return NULL;
}
-NTSTATUS GetInterfaceConnectionStatus
-( PIP_INTERFACE Interface, PULONG Result ) {
- NTSTATUS Status = TcpipLanGetDwordOid
- ( Interface, OID_GEN_HARDWARE_STATUS, Result );
- if( NT_SUCCESS(Status) ) switch( *Result ) {
- case NdisHardwareStatusReady:
+NTSTATUS GetInterfaceConnectionStatus(PIP_INTERFACE Interface, PULONG Result)
+{
+ NTSTATUS Status;
+
+ /* Query OID_GEN_MEDIA_CONNECT_STATUS for connection status information */
+ Status = TcpipLanGetDwordOid(Interface, OID_GEN_MEDIA_CONNECT_STATUS, Result);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ /* Translate the result into MIB_IF_OPER_STATUS_XXX */
+ if (*Result == NdisMediaStateConnected)
+ {
+ /* Up and running */
*Result = MIB_IF_OPER_STATUS_OPERATIONAL;
- break;
- case NdisHardwareStatusInitializing:
- *Result = MIB_IF_OPER_STATUS_CONNECTING;
- break;
- case NdisHardwareStatusReset:
+ }
+ else
+ {
+ /* Down */
*Result = MIB_IF_OPER_STATUS_DISCONNECTED;
- break;
- case NdisHardwareStatusNotReady:
- *Result = MIB_IF_OPER_STATUS_DISCONNECTED;
- break;
- case NdisHardwareStatusClosing:
- default:
- *Result = MIB_IF_OPER_STATUS_NON_OPERATIONAL;
- break;
- }
- return Status;
-}
+ }
+
+ return STATUS_SUCCESS;
+}