Skip to content

Commit

Permalink
[USBOHCI] Workaround for interrupts problem on Xbox
Browse files Browse the repository at this point in the history
CORE-16352
  • Loading branch information
Simone Lombardo authored and binarymaster committed Sep 28, 2024
1 parent ca7f261 commit 0c8c843
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/usb/usbohci/usbohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,10 @@ OHCI_CheckController(IN PVOID ohciExtension)
ULONG FmNumber;
USHORT FmDiff;
POHCI_HCCA HcHCCA;
PULONG InterruptEnableReg = (PULONG)&OhciExtension->OperationalRegs->HcInterruptEnable;
PULONG InterruptStatusReg = (PULONG)&OhciExtension->OperationalRegs->HcInterruptStatus;
OHCI_REG_INTERRUPT_STATUS IntStatus;
OHCI_REG_INTERRUPT_ENABLE_DISABLE IntEnable;

//DPRINT_OHCI("OHCI_CheckController: ...\n");

Expand All @@ -2132,6 +2136,14 @@ OHCI_CheckController(IN PVOID ohciExtension)
if (!OHCI_HardwarePresent(OhciExtension, TRUE))
return;

/* Clear all bits in HcInterruptStatus register */
IntStatus.AsULONG = 0xFFFFFFFF;
WRITE_REGISTER_ULONG(InterruptStatusReg, IntStatus.AsULONG);
/* Setup HcInterruptEnable register */
IntEnable.AsULONG = 0xFFFFFFFF;
IntEnable.Reserved1 = 0;
WRITE_REGISTER_ULONG(InterruptEnableReg, IntEnable.AsULONG);

HcControlReg = (PULONG)&OperationalRegs->HcControl;
HcControl.AsULONG = READ_REGISTER_ULONG(HcControlReg);

Expand Down

0 comments on commit 0c8c843

Please sign in to comment.