Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/usb/libusbohci
Submodule libusbohci updated 1 files
+2 −5 inc/usbh_lib.h
14 changes: 13 additions & 1 deletion lib/usb/libusbohci_xbox/usbh_xbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@
#include <windows.h>
#include <xboxkrnl/xboxkrnl.h>
#include <hal/debug.h>
#include <usb.h>
#include "usbh_config_xbox.h"

extern void OHCI_IRQHandler(void);
static KINTERRUPT InterruptObject;
static KDPC DpcObject;

static BOOLEAN __stdcall ISR(PKINTERRUPT Interrupt, PVOID ServiceContext)
{
OHCI_IRQHandler();
DISABLE_OHCI_IRQ();
KeInsertQueueDpc(&DpcObject, NULL, NULL);
return TRUE;
}

static VOID NTAPI dpcRoutine(PKDPC dpc, PVOID deferredContext, PVOID arg1, PVOID arg2)
{
OHCI_IRQHandler();
ENABLE_OHCI_IRQ();
}

//Initialise the systems ohci irq and irq handler.
//The USB stacks handler function (OHCI_IRQHandler) should be called
void usbh_ohci_irq_init() {
Expand All @@ -25,11 +35,13 @@ void usbh_ohci_irq_init() {
irql,
LevelSensitive,
FALSE);
KeInitializeDpc(&DpcObject, dpcRoutine, NULL);
KeConnectInterrupt(&InterruptObject);
}

void usbh_ohci_irq_deinit() {
KeDisconnectInterrupt(&InterruptObject);
KeRemoveQueueDpc(&DpcObject);
}

//Allocate a contiguous memory pool that the ohci hardware can access.
Expand Down
Loading