Author: tfaber
Date: Thu Jun 29 15:01:47 2017
New Revision: 75234
URL:
http://svn.reactos.org/svn/reactos?rev=75234&view=rev
Log:
[USBPORT]
- Correctly distinguish between current hub status and status change in
USBPORT_RootHubSCE. Patch by Vadim Galyant.
Modified:
trunk/reactos/drivers/usb/usbport/roothub.c
trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h
Modified: trunk/reactos/drivers/usb/usbport/roothub.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbport/roothu…
==============================================================================
--- trunk/reactos/drivers/usb/usbport/roothub.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbport/roothub.c [iso-8859-1] Thu Jun 29 15:01:47 2017
@@ -137,7 +137,7 @@
{
return RHStatus;
}
-
+
KeAcquireSpinLock(&FdoExtension->MiniportSpinLock, &OldIrql);
MPStatus = Packet->RH_GetPortStatus(FdoExtension->MiniPortExt,
@@ -170,7 +170,7 @@
RHStatus = RH_STATUS_SUCCESS;
return RHStatus;
}
-
+
if (Feature == FEATURE_C_HUB_OVER_CURRENT)
{
MPStatus =
Packet->RH_ClearFeaturePortOvercurrentChange(FdoExtension->MiniPortExt,
@@ -178,7 +178,7 @@
RHStatus = USBPORT_MPStatusToRHStatus(MPStatus);
return RHStatus;
}
-
+
DbgBreakPoint();
return RHStatus;
}
@@ -436,7 +436,7 @@
!(SetupPacket->bmRequestType.Dir == BMREQUEST_DEVICE_TO_HOST))
{
if (SetupPacket->wValue.W == 0 ||
- SetupPacket->wValue.W ==
+ SetupPacket->wValue.W ==
PdoExtension->RootHubDescriptors->ConfigDescriptor.bConfigurationValue)
{
PdoExtension->ConfigurationValue = SetupPacket->wValue.LowByte;
@@ -535,7 +535,7 @@
PUSBPORT_REGISTRATION_PACKET Packet;
ULONG TransferLength;
USBHUB_PORT_STATUS PortStatus;
- USB_HUB_STATUS HubStatus;
+ USB_HUB_STATUS_AND_CHANGE HubStatus;
PVOID Buffer;
PULONG AddressBitMap;
ULONG Port;
@@ -556,7 +556,7 @@
NumberOfPorts = HubDescriptor->bNumberOfPorts;
PortStatus.AsULONG = 0;
- HubStatus.AsUshort16 = 0;
+ HubStatus.AsUlong32 = 0;
Urb = Transfer->Urb;
TransferLength = Transfer->TransferParameters.TransferBufferLength;
@@ -603,7 +603,7 @@
Port,
&PortStatus))
{
- /* Miniport returned an error */
+ /* Miniport returned an error */
DPRINT1("USBPORT_RootHubSCE: RH_GetPortStatus failed\n");
return RH_STATUS_UNSUCCESSFUL;
}
@@ -623,8 +623,8 @@
/* Request the hub status from miniport */
if (!Packet->RH_GetHubStatus(FdoExtension->MiniPortExt, &HubStatus))
{
- if (HubStatus.AsUshort16 & (HUB_STATUS_CHANGE_LOCAL_POWER |
- HUB_STATUS_CHANGE_OVERCURRENT))
+ if (HubStatus.HubChange.LocalPowerChange == 1 ||
+ HubStatus.HubChange.OverCurrentChange == 1)
{
/* At the hub status there is a change */
AddressBitMap[0] |= 1;
@@ -647,7 +647,7 @@
return RHStatus;
}
- /* Miniport returned an error */
+ /* Miniport returned an error */
DPRINT1("USBPORT_RootHubSCE: RH_GetHubStatus failed\n");
return RH_STATUS_UNSUCCESSFUL;
}
@@ -904,7 +904,7 @@
FdoDevice = FdoExtension->CommonExtension.SelfDevice;
- if (FdoExtension->Flags & USBPORT_FLAG_HC_SUSPEND &&
+ if (FdoExtension->Flags & USBPORT_FLAG_HC_SUSPEND &&
FdoExtension->Flags & USBPORT_FLAG_HC_WAKE_SUPPORT &&
FdoExtension->MiniPortFlags & USBPORT_MPFLAG_SUSPENDED &&
FdoExtension->TimerFlags & USBPORT_TMFLAG_WAKE)
@@ -912,7 +912,7 @@
USBPORT_HcQueueWakeDpc(FdoDevice);
return 0;
}
-
+
FdoExtension->MiniPortInterface->Packet.RH_DisableIrq(FdoExtension->MiniPortExt);
PdoDevice = FdoExtension->RootHubPdo;
Modified: trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/driver…
==============================================================================
--- trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/reactos/drivers/usbport/usbmport.h [iso-8859-1] Thu Jun 29
15:01:47 2017
@@ -76,11 +76,6 @@
ULONG AsULONG;
} USBHUB_PORT_STATUS, *PUSBHUB_PORT_STATUS;
-/* Hub status & hub status change bits.
- See USB 2.0 spec Table 11-19 and Table 11-20. */
-#define HUB_STATUS_CHANGE_LOCAL_POWER 0x00010000
-#define HUB_STATUS_CHANGE_OVERCURRENT 0x00020000
-
/* Additional USB Class Codes from
USB.org */
#define USBC_DEVICE_CLASS_AUDIO_VIDEO 0x10
#define USBC_DEVICE_CLASS_BILLBOARD 0x11
@@ -232,7 +227,7 @@
typedef MPSTATUS
(NTAPI *PHCI_RH_GET_HUB_STATUS)(
PVOID,
- PUSB_HUB_STATUS);
+ PUSB_HUB_STATUS_AND_CHANGE);
typedef MPSTATUS
(NTAPI *PHCI_RH_SET_FEATURE_PORT_RESET)(
@@ -420,12 +415,12 @@
typedef NTSTATUS
(NTAPI *PUSBPORT_WAIT)(
PVOID,
- ULONG);
+ ULONG);
typedef ULONG
(NTAPI *PUSBPORT_INVALIDATE_CONTROLLER)(
PVOID,
- ULONG);
+ ULONG);
typedef VOID
(NTAPI *PUSBPORT_BUG_CHECK)(PVOID);