- 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.

svn path=/trunk/; revision=39786
This commit is contained in:
Aleksey Bragin 2009-02-27 15:29:54 +00:00
parent f717c34ae1
commit a96493a8eb
3 changed files with 10 additions and 2 deletions

View file

@ -202,6 +202,7 @@ dev_mgr_strobe(PUSB_DEV_MANAGER dev_mgr)
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 @@ dev_mgr_event_init(PUSB_DEV pdev, //always null. we do not use this param
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 @@ dev_mgr_event_init(PUSB_DEV pdev, //always null. we do not use this param
KeCancelTimer(&dev_mgr->dev_mgr_timer);
KeRemoveQueueDpc(&dev_mgr->dev_mgr_timer_dpc);
KeSetEvent(&dev_mgr->drivers_inited, 0, FALSE);
return FALSE;
}

View file

@ -98,6 +98,7 @@ typedef struct _USB_DEV_MANAGER
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;

View file

@ -3752,7 +3752,6 @@ uhci_init_hcd_interface(PUHCI_DEV uhci)
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 @@ NTSTATUS
NTAPI
DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
#if DBG
NTSTATUS ntStatus = STATUS_SUCCESS;
#if DBG
// 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 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
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;
}