Author: cgutman
Date: Wed Mar 18 06:06:34 2015
New Revision: 66780
URL:
http://svn.reactos.org/svn/reactos?rev=66780&view=rev
Log:
Merge r66776-r66779 to fix networking issues on the Latitude D531
Modified:
branches/ReactOS-0.3.17-CLT2015/reactos/ (props changed)
branches/ReactOS-0.3.17-CLT2015/reactos/base/applications/network/wlanconf/wlanconf.c
branches/ReactOS-0.3.17-CLT2015/reactos/boot/bootdata/packages/reactos.dff.in
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndis/ndis/miniport.c
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndisuio/ioctl.c
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/include/interface.h
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/tcpip/iinfo.c
branches/ReactOS-0.3.17-CLT2015/reactos/lib/drivers/ip/network/interface.c
Propchange: branches/ReactOS-0.3.17-CLT2015/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 18 06:06:34 2015
@@ -20,4 +20,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:66727-66770
+/trunk/reactos:66727-66770,66776-66779
Modified:
branches/ReactOS-0.3.17-CLT2015/reactos/base/applications/network/wlanconf/wlanconf.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
---
branches/ReactOS-0.3.17-CLT2015/reactos/base/applications/network/wlanconf/wlanconf.c [iso-8859-1]
(original)
+++
branches/ReactOS-0.3.17-CLT2015/reactos/base/applications/network/wlanconf/wlanconf.c [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -271,7 +271,7 @@
bSuccess = DeviceIoControl(hAdapter,
IOCTL_NDISUIO_SET_OID_VALUE,
&SetOid,
- sizeof(SetOid),
+ FIELD_OFFSET(NDISUIO_SET_OID, Data),
NULL,
0,
&dwBytesReturned,
@@ -739,6 +739,7 @@
DWORD QueryOidSize;
PNDIS_802_11_BSSID_LIST BssidList;
DWORD i, j;
+ DWORD dwNetworkCount;
WCHAR szMsgBuf[128];
SetOid.Oid = OID_802_11_BSSID_LIST_SCAN;
@@ -747,7 +748,7 @@
bSuccess = DeviceIoControl(hAdapter,
IOCTL_NDISUIO_SET_OID_VALUE,
&SetOid,
- sizeof(SetOid),
+ FIELD_OFFSET(NDISUIO_SET_OID, Data),
NULL,
0,
&dwBytesReturned,
@@ -755,23 +756,44 @@
if (!bSuccess)
return FALSE;
- /* Allocate space for 15 networks to be returned */
- QueryOidSize = sizeof(NDISUIO_QUERY_OID) + (sizeof(NDIS_WLAN_BSSID) * 15);
- QueryOid = HeapAlloc(GetProcessHeap(), 0, QueryOidSize);
- if (!QueryOid)
- return FALSE;
-
- QueryOid->Oid = OID_802_11_BSSID_LIST;
- BssidList = (PNDIS_802_11_BSSID_LIST)QueryOid->Data;
-
- bSuccess = DeviceIoControl(hAdapter,
- IOCTL_NDISUIO_QUERY_OID_VALUE,
- QueryOid,
- QueryOidSize,
- QueryOid,
- QueryOidSize,
- &dwBytesReturned,
- NULL);
+ /* Wait 2 seconds for the scan to return some results */
+ Sleep(2000);
+
+ /* Allocate space for 10 networks to be returned initially */
+ QueryOid = NULL;
+ dwNetworkCount = 10;
+ for (;;)
+ {
+ if (QueryOid)
+ HeapFree(GetProcessHeap(), 0, QueryOid);
+
+ QueryOidSize = sizeof(NDISUIO_QUERY_OID) + (sizeof(NDIS_WLAN_BSSID) *
dwNetworkCount);
+ QueryOid = HeapAlloc(GetProcessHeap(), 0, QueryOidSize);
+ if (!QueryOid)
+ return FALSE;
+
+ QueryOid->Oid = OID_802_11_BSSID_LIST;
+ BssidList = (PNDIS_802_11_BSSID_LIST)QueryOid->Data;
+
+ bSuccess = DeviceIoControl(hAdapter,
+ IOCTL_NDISUIO_QUERY_OID_VALUE,
+ QueryOid,
+ QueryOidSize,
+ QueryOid,
+ QueryOidSize,
+ &dwBytesReturned,
+ NULL);
+ if (!bSuccess && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+ {
+ /* Try allocating space for 10 more networks */
+ dwNetworkCount += 10;
+ }
+ else
+ {
+ break;
+ }
+ }
+
if (!bSuccess)
{
HeapFree(GetProcessHeap(), 0, QueryOid);
Modified: branches/ReactOS-0.3.17-CLT2015/reactos/boot/bootdata/packages/reactos.dff.in
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
---
branches/ReactOS-0.3.17-CLT2015/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1]
(original)
+++
branches/ReactOS-0.3.17-CLT2015/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -87,6 +87,9 @@
"modules/optional/b57win32.inf" 6 optional
"modules/optional/b57win32.cat" 6 optional
"modules/optional/b57xp32.sys" 2 optional
+"modules/optional/bcmwl5.inf" 6 optional
+"modules/optional/bcm43xx.cat" 6 optional
+"modules/optional/bcmwl5.sys" 2 optional
"modules/optional/alcxwdm.inf" 6 optional
"modules/optional/alcxwdm.sys" 2 optional
"modules/optional/mfc42.dll" 1 optional
Modified: branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
---
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1]
(original)
+++
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -1708,6 +1708,12 @@
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
+ if (Adapter->BugcheckContext != NULL)
+ {
+ NDIS_DbgPrint(MIN_TRACE, ("Attempted to register again for a shutdown
callback\n"));
+ return;
+ }
+
BugcheckContext = ExAllocatePool(NonPagedPool, sizeof(MINIPORT_BUGCHECK_CONTEXT));
if(!BugcheckContext)
{
Modified: branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndisuio/ioctl.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
--- branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndisuio/ioctl.c [iso-8859-1]
(original)
+++ branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/ndisuio/ioctl.c [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -190,7 +190,15 @@
}
/* Return the bytes read */
- if (NT_SUCCESS(Status)) Irp->IoStatus.Information = sizeof(NDIS_OID) +
Request.DATA.SET_INFORMATION.BytesRead;
+ if (Status == NDIS_STATUS_INVALID_LENGTH ||
+ Status == NDIS_STATUS_BUFFER_TOO_SHORT)
+ {
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else if (Status == NDIS_STATUS_SUCCESS)
+ {
+ Irp->IoStatus.Information = sizeof(NDIS_OID) +
Request.DATA.SET_INFORMATION.BytesRead;
+ }
DPRINT("Final request status: 0x%x (%d)\n", Status,
Irp->IoStatus.Information);
}
@@ -256,7 +264,15 @@
}
/* Return the bytes written */
- if (NT_SUCCESS(Status)) Irp->IoStatus.Information = sizeof(NDIS_OID) +
Request.DATA.QUERY_INFORMATION.BytesWritten;
+ if (Status == NDIS_STATUS_INVALID_LENGTH ||
+ Status == NDIS_STATUS_BUFFER_TOO_SHORT)
+ {
+ Status = STATUS_BUFFER_TOO_SMALL;
+ }
+ else if (Status == NDIS_STATUS_SUCCESS)
+ {
+ Irp->IoStatus.Information = sizeof(NDIS_OID) +
Request.DATA.QUERY_INFORMATION.BytesWritten;
+ }
DPRINT("Final request status: 0x%x (%d)\n", Status,
Irp->IoStatus.Information);
}
Modified:
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/include/interface.h
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
---
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/include/interface.h [iso-8859-1]
(original)
+++
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/include/interface.h [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -10,7 +10,6 @@
NTSTATUS GetInterfaceSpeed( PIP_INTERFACE Interface, PUINT Speed );
NTSTATUS GetInterfaceName( PIP_INTERFACE Interface, PCHAR NameBuffer,
UINT NameMaxLen );
-NTSTATUS GetInterfaceConnectionStatus( PIP_INTERFACE Interface,
- PULONG OperStatus );
+VOID GetInterfaceConnectionStatus( PIP_INTERFACE Interface, PULONG OperStatus );
PIP_INTERFACE FindOnLinkInterface(PIP_ADDRESS Address);
PIP_INTERFACE GetDefaultInterface(VOID);
Modified: branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/tcpip/iinfo.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
---
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1]
(original)
+++
branches/ReactOS-0.3.17-CLT2015/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -51,11 +51,7 @@
OutData->if_physaddrlen = Interface->AddressLength;
OutData->if_adminstatus = MIB_IF_ADMIN_STATUS_UP;
/* NDIS_HARDWARE_STATUS -> ROUTER_CONNECTION_STATE */
- Status = GetInterfaceConnectionStatus( Interface, &OutData->if_operstatus );
-
- /* Not sure what to do here, but not ready seems a safe bet on failure */
- if( !NT_SUCCESS(Status) )
- OutData->if_operstatus = NdisHardwareStatusNotReady;
+ GetInterfaceConnectionStatus( Interface, &OutData->if_operstatus );
IFDescr = (PCHAR)&OutData->if_descr[0];
Modified: branches/ReactOS-0.3.17-CLT2015/reactos/lib/drivers/ip/network/interface.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.3.17-CLT2015/reactos/…
==============================================================================
---
branches/ReactOS-0.3.17-CLT2015/reactos/lib/drivers/ip/network/interface.c [iso-8859-1]
(original)
+++
branches/ReactOS-0.3.17-CLT2015/reactos/lib/drivers/ip/network/interface.c [iso-8859-1]
Wed Mar 18 06:06:34 2015
@@ -166,10 +166,12 @@
ForEachInterface(CurrentIF) {
if (CurrentIF->Context && AddrIsUnspecified(&CurrentIF->Unicast))
{
TcpipReleaseSpinLock(&InterfaceListLock, OldIrql);
- if (NT_SUCCESS(GetInterfaceConnectionStatus(CurrentIF, &IfStatus))
&&
- (IfStatus == MIB_IF_OPER_STATUS_OPERATIONAL)) {
+
+ GetInterfaceConnectionStatus(CurrentIF, &IfStatus);
+ if (IfStatus == MIB_IF_OPER_STATUS_OPERATIONAL) {
return CurrentIF;
}
+
TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql);
}
} EndFor(CurrentIF);
@@ -178,11 +180,13 @@
ForEachInterface(CurrentIF) {
if (CurrentIF->Context && (Index++ == NextDefaultAdapter)) {
TcpipReleaseSpinLock(&InterfaceListLock, OldIrql);
- if (NT_SUCCESS(GetInterfaceConnectionStatus(CurrentIF, &IfStatus))
&&
- (IfStatus == MIB_IF_OPER_STATUS_OPERATIONAL)) {
+
+ GetInterfaceConnectionStatus(CurrentIF, &IfStatus);
+ if (IfStatus == MIB_IF_OPER_STATUS_OPERATIONAL) {
NextDefaultAdapter++;
return CurrentIF;
}
+
TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql);
}
} EndFor(CurrentIF);
@@ -193,11 +197,13 @@
if (CurrentIF->Context) {
Index++;
TcpipReleaseSpinLock(&InterfaceListLock, OldIrql);
- if (NT_SUCCESS(GetInterfaceConnectionStatus(CurrentIF, &IfStatus))
&&
- (IfStatus == MIB_IF_OPER_STATUS_OPERATIONAL)) {
+
+ GetInterfaceConnectionStatus(CurrentIF, &IfStatus);
+ if (IfStatus == MIB_IF_OPER_STATUS_OPERATIONAL) {
NextDefaultAdapter = Index;
return CurrentIF;
}
+
TcpipAcquireSpinLock(&InterfaceListLock, &OldIrql);
}
} EndFor(CurrentIF);
@@ -245,26 +251,15 @@
return NULL;
}
-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 */
+VOID GetInterfaceConnectionStatus(PIP_INTERFACE Interface, PULONG Result)
+{
+ PLAN_ADAPTER Adapter = Interface->Context;
+
+ /* Loopback has no adapter context */
+ if (Adapter == NULL || Adapter->State == LAN_STATE_STARTED) {
*Result = MIB_IF_OPER_STATUS_OPERATIONAL;
}
- else
- {
- /* Down */
+ else {
*Result = MIB_IF_OPER_STATUS_DISCONNECTED;
}
-
- return STATUS_SUCCESS;
-}
+}