Author: fireball
Date: Fri Feb 27 18:29:54 2009
New Revision: 39786
URL:
http://svn.reactos.org/svn/reactos?rev=39786&view=rev
Log:
- Wait untill all usb embedded drivers are initialized before returning from DriverEntry.
This allows usb mouse driver to have a chance to register itself before mouclass is
loaded.
Modified:
trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c
trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h
trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c [iso-8859-1] Fri Feb 27
18:29:54 2009
@@ -202,6 +202,7 @@
pevent->context = (ULONG) dev_mgr;
KeInitializeEvent(&dev_mgr->wake_up_event, SynchronizationEvent, FALSE);
+ KeInitializeEvent(&dev_mgr->drivers_inited, NotificationEvent, FALSE);
InsertTailList(&dev_mgr->event_list, &pevent->event_link);
@@ -273,6 +274,9 @@
KeSetTimerEx(&dev_mgr->dev_mgr_timer,
due_time, DEV_MGR_TIMER_INTERVAL_MS,
&dev_mgr->dev_mgr_timer_dpc);
+ /* Signal we're done initing */
+ KeSetEvent(&dev_mgr->drivers_inited, 0, FALSE);
+
return TRUE;
}
@@ -286,6 +290,7 @@
KeCancelTimer(&dev_mgr->dev_mgr_timer);
KeRemoveQueueDpc(&dev_mgr->dev_mgr_timer_dpc);
+ KeSetEvent(&dev_mgr->drivers_inited, 0, FALSE);
return FALSE;
}
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h [iso-8859-1] Fri Feb 27
18:29:54 2009
@@ -98,6 +98,7 @@
LIST_HEAD event_list;
USB_EVENT_POOL event_pool;
+ KEVENT drivers_inited;
KTIMER dev_mgr_timer;
KDPC dev_mgr_timer_dpc;
KSPIN_LOCK timer_svc_list_lock;
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c [iso-8859-1] Fri Feb 27 18:29:54
2009
@@ -3752,7 +3752,6 @@
uhci->hcd_interf.flags = HCD_TYPE_UHCI; //hcd types | hcd id
}
-
NTSTATUS NTAPI
generic_dispatch_irp(IN PDEVICE_OBJECT dev_obj, IN PIRP irp)
{
@@ -3807,9 +3806,9 @@
NTAPI
DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
+ NTSTATUS ntStatus = STATUS_SUCCESS;
+
#if DBG
- NTSTATUS ntStatus = STATUS_SUCCESS;
-
// should be done before any debug output is done.
// read our debug verbosity level from the registry
//NetacOD_GetRegistryDword( NetacOD_REGISTRY_PARAMETERS_PATH, //absolute registry
path
@@ -3867,6 +3866,9 @@
dev_mgr_start_hcd(&g_dev_mgr);
+ /* Wait till all drivers are initialized */
+ ntStatus = KeWaitForSingleObject(&g_dev_mgr.drivers_inited, Executive,
KernelMode, TRUE, NULL);
+
uhci_dbg_print_cond(DBGLVL_DEFAULT, DEBUG_UHCI, ("DriverEntry(): exiting...
(%x)\n", ntStatus));
return STATUS_SUCCESS;
}