Author: rgampa
Date: Sun Jun 4 04:43:36 2017
New Revision: 74896
URL:
http://svn.reactos.org/svn/reactos?rev=74896&view=rev
Log:
[USBXHCI]
-Created hardware_xhci header file. Defined Host Controller Capability Registers
(structural_params, capabbility_params etc.,)
-Defined some of the Host controller operational registers. (usb_commad,usb_status etc.,)
-Created usbxhci_new header file with some basic include files.
-Created usbxhci_new c file with a driver entry function to test compilation of driver.
-modified cmake lists to compile with the new files.
-modified usbport.inf file to load newly compiled usbxhci driver onto PCI\CC_0C0330
devices
-modified usbmport header file to define usb miniport version.
-deleted test.txt
CORE-13344
Added:
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/hardware_xhci.h (with props)
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.c (with props)
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.h (with props)
Removed:
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/test.txt
Modified:
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbmport.h
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/CMakeLists.txt
branches/GSoC_2017/usbxhci/reactos/media/inf/usbport.inf
Modified: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbmport.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbmport.h [iso-8859-1] (original)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbmport.h [iso-8859-1] Sun Jun 4
04:43:36 2017
@@ -442,6 +442,7 @@
#define USB_MINIPORT_VERSION_OHCI 0x01
#define USB_MINIPORT_VERSION_UHCI 0x02
#define USB_MINIPORT_VERSION_EHCI 0x03
+#define USB_MINIPORT_VERSION_XHCI 0x03 //miniport version for xhci
#define USB_MINIPORT_FLAGS_INTERRUPT 0x0001
#define USB_MINIPORT_FLAGS_PORT_IO 0x0002
Modified: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/CMakeLists.txt [iso-8859-1] Sun
Jun 4 04:43:36 2017
@@ -1,9 +1,9 @@
list(APPEND SOURCE
debug.c
- roothub.c
- usbxhci.c
- usbxhci.h)
+ #roothub.c
+ usbxhci_new.c
+ usbxhci_new.h)
add_library(usbxhci SHARED
${SOURCE}
@@ -12,5 +12,5 @@
set_module_type(usbxhci kernelmodedriver)
add_importlibs(usbxhci usbport ntoskrnl hal usbd)
-add_pch(usbxhci usbxhci.h SOURCE)
+add_pch(usbxhci usbxhci_new.h SOURCE)
add_cd_file(TARGET usbxhci DESTINATION reactos/system32/drivers NO_CAB FOR all)
Added: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/hardware_xhci.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/hardware_xhci.h (added)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/hardware_xhci.h [iso-8859-1]
Sun Jun 4 04:43:36 2017
@@ -0,0 +1,174 @@
+/* XHCI hardware registers */
+
+typedef union _XHCI_HC_STRUCTURAL_PARAMS_1 {
+ struct {
+ ULONG MaxDeviceSlots : 8;
+ ULONG MaxInterrupters : 11;
+ ULONG Rsvd : 5;
+ ULONG MaxPorts : 8;
+ };
+ ULONG AsULONG;
+} XHCI_HC_STRUCTURAL_PARAMS_1;
+
+typedef union _XHCI_HC_STRUCTURAL_PARAMS_2 {
+ struct {
+ ULONG Ist : 4; // Isochronous Scheduling Treshold
+ ULONG ERSTMax : 4; //Even ring segment table max
+ ULONG Rsvd : 13;
+ ULONG MaxSPBuffersHi : 5; //Max Scratchpad buffers high
+ ULONG SPR : 1; //Scratchpad Restore
+ ULONG MaxSPBuffersLo : 5; //Max Scratchpad buffers Low
+ };
+ ULONG AsULONG;
+} XHCI_HC_STRUCTURAL_PARAMS_2;
+
+typedef union _XHCI_HC_STRUCTURAL_PARAMS_3 {
+ struct {
+ ULONG U1DeviceExitLatecy : 8;
+ ULONG Rsvd : 8;
+ ULONG U2DeviceExitLatecy : 16;
+ };
+ ULONG AsULONG;
+} XHCI_HC_STRUCTURAL_PARAMS_3;
+
+typedef union _XHCI_HC_CAPABILITY_PARAMS_1 { // need to comment full forms, pg 291 in
xHCI documentation
+ struct {
+ ULONG AC64 : 1;
+ ULONG BNC : 1;
+ ULONG CSZ : 1;
+ ULONG PPC : 1;
+ ULONG PIND : 1;
+ ULONG LHRC : 1;
+ ULONG LTC : 1;
+ ULONG NSS : 1;
+ ULONG PAE : 1;
+ ULONG SPC : 1;
+ ULONG SEC : 1;
+ ULONG CFC : 1;
+ ULONG MaxPSASize : 4;
+ ULONG xECP : 16;
+ };
+ ULONG AsULONG;
+} XHCI_HC_CAPABILITY_PARAMS_1;
+
+typedef union _XHCI_DOORBELL_OFFSET {
+ struct {
+ ULONG Rsvd : 2;
+ ULONG DBArrayOffset : 30;
+ };
+ ULONG AsULONG;
+} XHCI_DOORBELL_OFFSET;
+
+typedef union _XHCI_RT_REGISTER_SPACE_OFFSET { //RUNTIME REGISTER SPACE OFFSET
+ struct {
+ ULONG Rsvd : 2;
+ ULONG RTSOffset : 30;
+ };
+ ULONG AsULONG;
+} XHCI_RT_REGISTER_SPACE_OFFSET;
+
+typedef union _XHCI_HC_CAPABILITY_PARAMS_2 {
+ struct {
+ ULONG U3C : 1;
+ ULONG CMC : 1;
+ ULONG FSC : 1;
+ ULONG CTC : 1;
+ ULONG LEC : 1;
+ ULONG CIC : 1;
+ ULONG Rsvd : 26;
+ };
+ ULONG AsULONG;
+} XHCI_HC_CAPABILITY_PARAMS_2;
+
+typedef union _XHCI_USB_COMMAND {
+ struct {
+ ULONG RunStop : 1;
+ ULONG HCReset : 1;
+ ULONG INTEnable : 1;
+ ULONG HSEEnable : 1;
+ ULONG RsvdP1 : 3;
+ ULONG LHCReset : 1;
+ ULONG CSS : 1;
+ ULONG CRS : 1;
+ ULONG EWE : 1;
+ ULONG EU3S : 1;
+ ULONG RsvdP2 : 1;
+ ULONG CME : 1;
+ ULONG RsvdP3 : 18;
+ };
+ ULONG AsULONG;
+} XHCI_USB_COMMAND;
+
+typedef union _XHCI_USB_STATUS {
+ struct {
+ ULONG HCH : 1;
+ ULONG RsvdZ1 : 1;
+ ULONG HSE : 1;
+ ULONG EINT : 1;
+ ULONG PCD : 1;
+ ULONG RsvdZ2 : 3;
+ ULONG SSS : 1;
+ ULONG RSS : 1;
+ ULONG SRE : 1;
+ ULONG CNR : 1;
+ ULONG HCE : 1;
+ ULONG RsvdZ3 : 19;
+ };
+ ULONG AsULONG;
+} XHCI_USB_STATUS;
+
+typedef union _XHCI_PAGE_SIZE {
+ struct {
+ ULONG PageSize : 16;
+ ULONG Rsvd : 16;
+ };
+ ULONG AsULONG;
+} XHCI_PAGE_SIZE;
+
+typedef union _XHCI_DEVICE_NOTIFICATION_CONTROL {
+ struct {
+ ULONG NotificationEnable : 16;
+ ULONG Rsvd : 16;
+ };
+ ULONG AsULONG;
+} XHCI_DEVICE_NOTIFICATION_CONTROL;
+
+typedef union _XHCI_CONFIGURE {
+ struct {
+ ULONG MaxDeviceSlot : 8;
+ ULONG U3E : 1;
+ ULONG CIE : 1;
+ ULONG Rsvd : 21;
+ };
+ ULONG AsULONG;
+} XHCI_CONFIGURE;
+
+typedef union _XHCI_PORT_STATUS_CONTROL {
+ struct {
+ ULONG CCS : 1;
+ ULONG PED : 1;
+ ULONG RsvdZ1 : 1;
+ ULONG OCA : 1;
+ ULONG PR : 1;
+ ULONG PLS : 4;
+ ULONG PP : 1;
+ ULONG PortSpeed : 4;
+ ULONG PIC : 2;
+ ULONG LWS : 1;
+ ULONG CSC : 1;
+ ULONG PEC : 1;
+ ULONG WRC : 1;
+ ULONG OCC : 1;
+ ULONG PRC : 1;
+ ULONG PLC : 1;
+ ULONG CEC : 1;
+ ULONG CAS : 1;
+ ULONG WCE : 1;
+ ULONG WDE : 1;
+ ULONG WOE : 1;
+ ULONG RsvdZ2 : 2;
+ ULONG DR : 1;
+ ULONG WPR : 1;
+ };
+ ULONG AsULONG;
+} XHCI_PORT_STATUS_CONTROL;
Propchange: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/hardware_xhci.h
------------------------------------------------------------------------------
svn:eol-style = native
Removed: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/test.txt
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/test.txt [iso-8859-1]
(original)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/test.txt (removed)
@@ -1 +0,0 @@
-test commit
Added: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.c (added)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.c [iso-8859-1] Sun
Jun 4 04:43:36 2017
@@ -0,0 +1,45 @@
+#include "usbxhci_new.h"
+
+#include <debug.h>
+
+#define NDEBUG_EHCI_TRACE
+#include "dbg_xhci.h"
+
+USBPORT_REGISTRATION_PACKET RegPacket;
+
+
+MPSTATUS
+NTAPI
+XHCI_StartController(IN PVOID ehciExtension,
+ IN PUSBPORT_RESOURCES Resources)
+{
+ DPRINT1("XHCI_StartController: UNIMPLEMENTED. FIXME\n");
+ return MP_STATUS_SUCCESS;
+}
+
+VOID
+NTAPI
+XHCI_Unload(PDRIVER_OBJECT DriverObject)
+{
+ DPRINT1("XHCI_Unload: UNIMPLEMENTED. FIXME\n");
+}
+
+NTSTATUS
+NTAPI
+DriverEntry(IN PDRIVER_OBJECT DriverObject,
+ IN PUNICODE_STRING RegistryPath)
+{
+ DPRINT("DriverEntry: DriverObject - %p, RegistryPath - %wZ\n",
+ DriverObject,
+ RegistryPath);
+ if (USBPORT_GetHciMn() != USBPORT_HCI_MN) // Don't know the purpose
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ RtlZeroMemory(&RegPacket, sizeof(USBPORT_REGISTRATION_PACKET));
+
+ DriverObject->DriverUnload = XHCI_Unload;
+ return STATUS_SUCCESS;
+ //return USBPORT_RegisterUSBPortDriver(DriverObject, 200, &RegPacket); // 200- is
version for usb 2...
+}
Propchange: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.h (added)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.h [iso-8859-1] Sun
Jun 4 04:43:36 2017
@@ -0,0 +1,16 @@
+#ifndef USBXHCI_H__
+#define USBXHCI_H__
+
+#include <ntddk.h>
+#include <windef.h>
+#include <stdio.h>
+#include <wdm.h>
+#include <hubbusif.h>
+#include <usbbusif.h>
+#include <usbdlib.h>
+#include "..\usbmport.h"
+#include "hardware_xhci.h"
+
+extern USBPORT_REGISTRATION_PACKET RegPacket;
+
+#endif /* USBXHCI_H__ */
Propchange: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci_new.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/GSoC_2017/usbxhci/reactos/media/inf/usbport.inf
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/media…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/media/inf/usbport.inf [iso-8859-1] (original)
+++ branches/GSoC_2017/usbxhci/reactos/media/inf/usbport.inf [iso-8859-1] Sun Jun 4
04:43:36 2017
@@ -30,6 +30,7 @@
%PCI\CC_0C0300.DeviceDesc%=UHCI_Inst,PCI\CC_0C0300
%PCI\CC_0C0310.DeviceDesc%=OHCI_Inst,PCI\CC_0C0310
%PCI\CC_0C0320.DeviceDesc%=EHCI_Inst,PCI\CC_0C0320
+%PCI\CC_0C0330.DeviceDesc%=XHCI_Inst,PCI\CC_0C0330
%USB\ROOT_HUB.DeviceDesc%=RootHub_Inst,USB\ROOT_HUB
%USB\ROOT_HUB.DeviceDesc%=RootHub_Inst,USB\ROOT_HUB20
@@ -94,6 +95,24 @@
ServiceBinary = %12%\usbehci.sys
LoadOrderGroup = Base
+;------------------------------ XHCI DRIVER -----------------------------
+
+[XHCI_Inst.NT]
+CopyFiles = XHCI_CopyFiles.NT
+
+[XHCI_CopyFiles.NT]
+usbport.sys
+usbxhci.sys
+
+[XHCI_Inst.NT.Services]
+AddService = usbxhci, 0x00000002, usbxhci_Service_Inst
+
+[usbxhci_Service_Inst]
+ServiceType = 1
+StartType = 0
+ErrorControl = 1
+ServiceBinary = %12%\usbxhci.sys
+LoadOrderGroup = Base
;---------------------------- ROOT HUB DRIVER ---------------------------
[RootHub_Inst.NT]