- 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

svn path=/branches/wlan-bringup/; revision=54895
This commit is contained in:
Cameron Gutman 2012-01-10 00:44:16 +00:00
parent 82f59adac9
commit 9f0044039b
4 changed files with 26 additions and 28 deletions

View file

@ -345,15 +345,12 @@ DWORD WINAPI AdapterDiscoveryThread(LPVOID Context) {
DH_DbgPrint(MID_TRACE,("Adapter %d was rejected\n",
Table->table[i].dwIndex));
}
Error = NotifyAddrChange(NULL, NULL);
#if 0
Error = NotifyAddrChange(NULL, NULL);
if (Error != NO_ERROR)
break;
#else
if (AdapterCount)
break;
else
Sleep(3000);
Sleep(3000);
#endif
} while (TRUE);

View file

@ -266,7 +266,7 @@ MiniportQueryInformation(
case OID_GEN_MEDIA_CONNECT_STATUS:
{
GenericULONG = Adapter->MediaState;
GenericULONG = (ULONG)NdisMediaStateConnected; /* Adapter->MediaState */
break;
}

View file

@ -185,7 +185,9 @@ NTSTATUS TcpipLanGetDwordOid
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;
}

View file

@ -196,27 +196,26 @@ PIP_INTERFACE FindOnLinkInterface(PIP_ADDRESS Address)
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:
*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;
else
{
/* Down */
*Result = MIB_IF_OPER_STATUS_DISCONNECTED;
}
return STATUS_SUCCESS;
}