Author: tfaber
Date: Sat Jul 1 06:06:12 2017
New Revision: 75253
URL:
http://svn.reactos.org/svn/reactos?rev=75253&view=rev
Log:
[USBPORT]
Patch by Vadim Galyant:
- Add USBPORT_HUB_CHARACTERISTICS structure
- Indicate the USB3 hub descriptor type when the miniport is an XHCI controller
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] Sat Jul 1 06:06:12 2017
@@ -853,9 +853,27 @@
RH_HubDescriptor = &PdoExtension->RootHubDescriptors->Descriptor;
RH_HubDescriptor->bDescriptorLength = sizeof(USB_HUB_DESCRIPTOR) + 2 *
NumMaskByte;
- RH_HubDescriptor->bDescriptorType = 0x29; // USB_20_HUB_DESCRIPTOR_TYPE - need
add in .h file
+
+ if (Packet->MiniPortVersion == USB_MINIPORT_VERSION_OHCI ||
+ Packet->MiniPortVersion == USB_MINIPORT_VERSION_UHCI ||
+ Packet->MiniPortVersion == USB_MINIPORT_VERSION_EHCI)
+ {
+ RH_HubDescriptor->bDescriptorType = 0x29; // #define
USB_20_HUB_DESCRIPTOR_TYPE 0x29 - need add in .h file
+ }
+ else if (Packet->MiniPortVersion == USB_MINIPORT_VERSION_XHCI)
+ {
+ RH_HubDescriptor->bDescriptorType = 0x2A; // #define
USB_30_HUB_DESCRIPTOR_TYPE 0x2A - need add in .h file
+ }
+ else
+ {
+ DPRINT1("USBPORT_RootHubCreateDevice: Unknown MiniPortVersion -
%x\n",
+ Packet->MiniPortVersion);
+
+ DbgBreakPoint();
+ }
+
RH_HubDescriptor->bNumberOfPorts = RootHubData.NumberOfPorts;
- RH_HubDescriptor->wHubCharacteristics = RootHubData.HubCharacteristics;
+ RH_HubDescriptor->wHubCharacteristics =
RootHubData.HubCharacteristics.AsUSHORT;
RH_HubDescriptor->bPowerOnToPowerGood = RootHubData.PowerOnToPowerGood;
RH_HubDescriptor->bHubControlCurrent = RootHubData.HubControlCurrent;
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] Sat Jul 1
06:06:12 2017
@@ -453,6 +453,7 @@
#define USB_MINIPORT_VERSION_OHCI 0x01
#define USB_MINIPORT_VERSION_UHCI 0x02
#define USB_MINIPORT_VERSION_EHCI 0x03
+#define USB_MINIPORT_VERSION_XHCI 0x04
#define USB_MINIPORT_FLAGS_INTERRUPT 0x0001
#define USB_MINIPORT_FLAGS_PORT_IO 0x0002
@@ -625,9 +626,53 @@
C_ASSERT(sizeof(USBPORT_TRANSFER_PARAMETERS) == 28);
+/* For USB1.1 or USB3 Hub Descriptors */
+typedef union _USBPORT_HUB_11_CHARACTERISTICS {
+ struct {
+ USHORT PowerControlMode :1;
+ USHORT NoPowerSwitching :1; // Reserved. Used only on 1.0 compliant hubs that
implement no power switching.
+ USHORT PartOfCompoundDevice :1;
+ USHORT OverCurrentProtectionMode :1;
+ USHORT NoOverCurrentProtection :1;
+ USHORT Reserved1 :11;
+ };
+ USHORT AsUSHORT;
+} USBPORT_HUB_11_CHARACTERISTICS;
+
+C_ASSERT(sizeof(USBPORT_HUB_11_CHARACTERISTICS) == sizeof(USHORT));
+
+/* For USB2.0 Hub Descriptors */
+typedef union _USBPORT_HUB_20_CHARACTERISTICS {
+ struct {
+ USHORT PowerControlMode :1;
+ USHORT NoPowerSwitching :1; // Reserved. Used only on 1.0 compliant hubs that
implement no power switching.
+ USHORT PartOfCompoundDevice :1;
+ USHORT OverCurrentProtectionMode :1;
+ USHORT NoOverCurrentProtection :1;
+ USHORT TtThinkTime :2;
+ USHORT PortIndicatorsSupported :1;
+ USHORT Reserved1 :8;
+ };
+ USHORT AsUSHORT;
+} USBPORT_HUB_20_CHARACTERISTICS;
+
+C_ASSERT(sizeof(USBPORT_HUB_20_CHARACTERISTICS) == sizeof(USHORT));
+
+typedef USBPORT_HUB_11_CHARACTERISTICS USBPORT_HUB_30_CHARACTERISTICS;
+
+typedef union _USBPORT_HUB_CHARACTERISTICS {
+ USHORT AsUSHORT;
+ USBPORT_HUB_11_CHARACTERISTICS Usb11HubCharacteristics;
+ USBPORT_HUB_20_CHARACTERISTICS Usb20HubCharacteristics;
+ USBPORT_HUB_30_CHARACTERISTICS Usb30HubCharacteristics;
+} USBPORT_HUB_CHARACTERISTICS;
+
+C_ASSERT(sizeof(USBPORT_HUB_CHARACTERISTICS) == sizeof(USHORT));
+
typedef struct _USBPORT_ROOT_HUB_DATA {
ULONG NumberOfPorts;
- ULONG HubCharacteristics;
+ USBPORT_HUB_CHARACTERISTICS HubCharacteristics;
+ USHORT Padded1;
ULONG PowerOnToPowerGood;
ULONG HubControlCurrent;
} USBPORT_ROOT_HUB_DATA, *PUSBPORT_ROOT_HUB_DATA;