Author: rgampa
Date: Fri Jul 7 09:06:09 2017
New Revision: 75296
URL:
http://svn.reactos.org/svn/reactos?rev=75296&view=rev
Log:
[USBXHCI]
- few changes to stably load the driver onto windows 2003 server edition.
CORE-13344
Modified:
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/roothub.c
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.c
branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.h
Modified: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/roothub.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/roothub.c [iso-8859-1]
(original)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/roothub.c [iso-8859-1] Fri Jul
7 09:06:09 2017
@@ -42,6 +42,7 @@
IN PUSHORT Status)
{
DPRINT1("XHCI_RH_GetStatus: function initiated\n");
+ *Status = 1;
return 0;
}
@@ -61,7 +62,7 @@
XhciExtension = (PXHCI_EXTENSION)xhciExtension;
PortStatusReg = (XhciExtension->OperationalRegs) + (XHCI_PORTSC + (Port - 1)*4);
PortStatusRegister.AsULONG = READ_REGISTER_ULONG(PortStatusReg) ;
-
+ PortStatusRegister.AsULONG = 0;
*PortStatus = PortStatusRegister.AsULONG;
return MP_STATUS_SUCCESS;
@@ -73,6 +74,7 @@
IN PULONG HubStatus)
{
DPRINT1("XHCI_RH_GetHubStatus: function initiated\n");
+ *HubStatus = 0;
return 0;
}
@@ -214,7 +216,7 @@
XHCI_RH_DisableIrq(IN PVOID xhciExtension)
{
DPRINT1("XHCI_RH_DisableIrq: function initiated\n");
- PXHCI_EXTENSION XhciExtension;
+ /*PXHCI_EXTENSION XhciExtension;
PULONG OperationalRegs;
XHCI_USB_COMMAND usbCommand;
@@ -225,7 +227,7 @@
usbCommand.InterrupterEnable = 0;
WRITE_REGISTER_ULONG(OperationalRegs + XHCI_USBCMD,usbCommand.AsULONG );
- DPRINT1("XHCI_RH_DisableIrq: Disable Interupts succesfull\n");
+ DPRINT1("XHCI_RH_DisableIrq: Disable Interupts succesfull\n");*/
}
VOID
Modified: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.c [iso-8859-1]
(original)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.c [iso-8859-1] Fri Jul
7 09:06:09 2017
@@ -205,10 +205,7 @@
ASSERT(Command.RunStop==0); //required before setting max device slots enabled.
Config.MaxDeviceSlotsEnabled = 1; // max possible value is number of slots
HCSPARAMS1
WRITE_REGISTER_ULONG(OperationalRegs + XHCI_CONFIG, Config.AsULONG);
- // Device Context base aaddress array to be defined
- // Commnad ring deque pointer to be defined in CRCR
-
- //DbgBreakPoint();
+
return MP_STATUS_SUCCESS;
}
@@ -282,8 +279,8 @@
return MPStatus;
}
- //Command.RunStop =1;
- //WRITE_REGISTER_ULONG (OperationalRegs + XHCI_USBCMD, Command.AsULONG );
+ Command.RunStop =1;
+ WRITE_REGISTER_ULONG (OperationalRegs + XHCI_USBCMD, Command.AsULONG );
//DPRINT1("XHCI_StartController: UNIMPLEMENTED. FIXME\n");
return MP_STATUS_SUCCESS;
}
@@ -300,6 +297,10 @@
NTAPI
XHCI_SuspendController(IN PVOID xhciExtension)
{
+ PXHCI_EXTENSION XhciExtension;
+ XhciExtension = (PXHCI_EXTENSION)xhciExtension;
+
+ XhciExtension->Flags |= XHCI_FLAGS_CONTROLLER_SUSPEND;
DPRINT1("XHCI_SuspendController: function initiated\n");
}
@@ -308,6 +309,10 @@
XHCI_ResumeController(IN PVOID xhciExtension)
{
DPRINT1("XHCI_ResumeController: function initiated\n");
+ PXHCI_EXTENSION XhciExtension;
+ XhciExtension = (PXHCI_EXTENSION)xhciExtension;
+
+ XhciExtension->Flags &= ~XHCI_FLAGS_CONTROLLER_SUSPEND;
return MP_STATUS_SUCCESS;
}
@@ -335,13 +340,16 @@
RunTimeRegisterBase = XhciExtension-> RunTimeRegisterBase;
Iman.AsULONG = READ_REGISTER_ULONG(RunTimeRegisterBase + XHCI_IMAN);
-
- Iman.InterruptPending =0;
+ if (Iman.InterruptPending == 0)
+ {
+ return FALSE;
+ }
+ Iman.InterruptPending =1;
WRITE_REGISTER_ULONG(RunTimeRegisterBase + XHCI_IMAN, Iman.AsULONG);
DPRINT1("XHCI_InterruptService: Succesful Interupt\n");
// changing the enque pointer
- erstdp.AsULONGLONG = READ_REGISTER_ULONG(RunTimeRegisterBase + XHCI_ERSTDP +
1)||READ_REGISTER_ULONG(RunTimeRegisterBase + XHCI_ERSTDP);
+ erstdp.AsULONGLONG = READ_REGISTER_ULONG(RunTimeRegisterBase + XHCI_ERSTDP +
1)|READ_REGISTER_ULONG(RunTimeRegisterBase + XHCI_ERSTDP);
erstdp.AsULONGLONG = erstdp.AsULONGLONG +2;
erstdp.DequeueERSTIndex =0;
WRITE_REGISTER_ULONG (RunTimeRegisterBase + XHCI_ERSTDP, erstdp.AsULONGLONG);
@@ -440,6 +448,7 @@
NTAPI
XHCI_CheckController(IN PVOID xhciExtension)
{
+ //RegPacket.UsbPortInvalidateController(xhciExtension, 2);
DPRINT1("XHCI_CheckController: function initiated\n");
}
@@ -489,6 +498,22 @@
XHCI_PollController(IN PVOID xhciExtension)
{
DPRINT1("XHCI_PollController: function initiated\n");
+ PXHCI_EXTENSION XhciExtension;
+ PULONG OperationalRegs;
+ //ULONG Port;
+ //XHCI_PORT_STATUS_CONTROL PortSC;
+
+
+ XhciExtension = (PXHCI_EXTENSION)xhciExtension;
+ OperationalRegs = XhciExtension->OperationalRegs;
+
+ if (!(XhciExtension->Flags & XHCI_FLAGS_CONTROLLER_SUSPEND))
+ {
+ RegPacket.UsbPortInvalidateRootHub(XhciExtension);
+ return;
+ }
+ //RegPacket.UsbPortInvalidateRootHub(xhciExtension);
+
}
VOID
Modified: branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/usbxhci/reactos/drive…
==============================================================================
--- branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/usbxhci/reactos/drivers/usb/usbxhci/usbxhci.h [iso-8859-1] Fri Jul
7 09:06:09 2017
@@ -12,7 +12,7 @@
extern USBPORT_REGISTRATION_PACKET RegPacket;
-
+#define XHCI_FLAGS_CONTROLLER_SUSPEND 0x01
//Data structures
typedef struct _XHCI_DEVICE_CONTEXT_BASE_ADD_ARRAY {
PHYSICAL_ADDRESS ContextBaseAddr [256];
@@ -222,109 +222,109 @@
VOID
NTAPI
XHCI_RH_GetRootHubData(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN PVOID rootHubData);
MPSTATUS
NTAPI
XHCI_RH_GetStatus(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN PUSHORT Status);
MPSTATUS
NTAPI
XHCI_RH_GetPortStatus(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port,
IN PULONG PortStatus);
MPSTATUS
NTAPI
XHCI_RH_GetHubStatus(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN PULONG HubStatus);
MPSTATUS
NTAPI
XHCI_RH_SetFeaturePortReset(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_SetFeaturePortPower(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_SetFeaturePortEnable(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_SetFeaturePortSuspend(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortEnable(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortPower(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortSuspend(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortEnableChange(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortConnectChange(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortResetChange(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortSuspendChange(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
MPSTATUS
NTAPI
XHCI_RH_ClearFeaturePortOvercurrentChange(
- IN PVOID ohciExtension,
+ IN PVOID xhciExtension,
IN USHORT Port);
VOID
NTAPI
XHCI_RH_DisableIrq(
- IN PVOID ohciExtension);
+ IN PVOID xhciExtension);
VOID
NTAPI
XHCI_RH_EnableIrq(
- IN PVOID ohciExtension);
+ IN PVOID xhciExtension);
#endif /* USBXHCI_H__ */