From 65aa515215af59e21ca893d2774fb5d656862adc Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Tue, 20 Oct 2009 09:17:09 +0000 Subject: [PATCH] ehci_alloc, ohci_alloc, uhci_alloc: Initialize DPC before connecting interrupt as the driver has to already be prepared to handle interrupts when calling IoConnectInterrupt. svn path=/trunk/; revision=43639 --- reactos/drivers/usb/nt4compat/usbdriver/ehci.c | 4 ++-- reactos/drivers/usb/nt4compat/usbdriver/ohci.c | 4 ++-- reactos/drivers/usb/nt4compat/usbdriver/uhci.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/usb/nt4compat/usbdriver/ehci.c b/reactos/drivers/usb/nt4compat/usbdriver/ehci.c index 5fbabe6ee43..02257052378 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/ehci.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/ehci.c @@ -3682,6 +3682,8 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU pdev_ext->res_interrupt.level, pdev_ext->res_interrupt.vector, &irql, &affinity); + KeInitializeDpc(&pdev_ext->ehci_dpc, ehci_dpc_callback, (PVOID) pdev_ext->ehci); + //connect the interrupt DbgPrint("ehci_alloc(): the int=0x%x\n", vector); if (IoConnectInterrupt(&pdev_ext->ehci_int, ehci_isr, pdev_ext->ehci, NULL, //&pdev_ext->ehci->frame_list_lock, @@ -3693,8 +3695,6 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU return NULL; } - KeInitializeDpc(&pdev_ext->ehci_dpc, ehci_dpc_callback, (PVOID) pdev_ext->ehci); - return pdev; } diff --git a/reactos/drivers/usb/nt4compat/usbdriver/ohci.c b/reactos/drivers/usb/nt4compat/usbdriver/ohci.c index 4ae033752fa..c4b2f213cd1 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/ohci.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/ohci.c @@ -479,6 +479,8 @@ ohci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU pdev_ext->res_interrupt.level, pdev_ext->res_interrupt.vector, &irql, &affinity); + KeInitializeDpc(&pdev_ext->ehci_dpc, ehci_dpc_callback, (PVOID) pdev_ext->ehci); + //connect the interrupt DbgPrint("ehci_alloc(): the int=0x%x\n", vector); if ((status = IoConnectInterrupt(&pdev_ext->ehci_int, ehci_isr, pdev_ext->ehci, NULL, //&pdev_ext->ehci->frame_list_lock, @@ -490,8 +492,6 @@ ohci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU ehci_release(pdev); return NULL; } - - KeInitializeDpc(&pdev_ext->ehci_dpc, ehci_dpc_callback, (PVOID) pdev_ext->ehci); #endif return pdev; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/uhci.c b/reactos/drivers/usb/nt4compat/usbdriver/uhci.c index 9d54e6f777f..c113ada6610 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/uhci.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/uhci.c @@ -840,6 +840,8 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU &irql, &affinity); + KeInitializeDpc(&pdev_ext->uhci_dpc, uhci_dpc_callback, (PVOID) pdev_ext->uhci); + //connect the interrupt DbgPrint("uhci_alloc(): the int=0x%x\n", vector); if (IoConnectInterrupt(&pdev_ext->uhci_int, @@ -859,8 +861,6 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU return NULL; } - KeInitializeDpc(&pdev_ext->uhci_dpc, uhci_dpc_callback, (PVOID) pdev_ext->uhci); - return pdev; }