mirror of
https://github.com/reactos/reactos.git
synced 2025-06-24 16:39:51 +00:00
- Revert 47139 by cgutman: Don't try to be smarter than usbdriver's author. He especially put registering HCD interface before so that any error handling function would work correctly and free up allocated resources. Fixes one crash in VMWare. A proper solution for the problem which 47139 tried to "fix" will be committed next.
svn path=/trunk/; revision=47167
This commit is contained in:
parent
cdc3b26818
commit
e4dec4c4cb
2 changed files with 15 additions and 17 deletions
|
@ -3530,7 +3530,6 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU
|
|||
CM_PARTIAL_RESOURCE_DESCRIPTOR *pprd;
|
||||
PCI_SLOT_NUMBER slot_num;
|
||||
NTSTATUS status;
|
||||
UCHAR hcd_id;
|
||||
|
||||
|
||||
pdev = ehci_create_device(drvr_obj, dev_mgr);
|
||||
|
@ -3697,13 +3696,6 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU
|
|||
return NULL;
|
||||
}
|
||||
|
||||
//register with dev_mgr
|
||||
ehci_init_hcd_interface(pdev_ext->ehci);
|
||||
hcd_id = dev_mgr_register_hcd(dev_mgr, &pdev_ext->ehci->hcd_interf);
|
||||
|
||||
pdev_ext->ehci->hcd_interf.hcd_set_id(&pdev_ext->ehci->hcd_interf, hcd_id);
|
||||
pdev_ext->ehci->hcd_interf.hcd_set_dev_mgr(&pdev_ext->ehci->hcd_interf, dev_mgr);
|
||||
|
||||
return pdev;
|
||||
}
|
||||
|
||||
|
@ -3719,6 +3711,7 @@ ehci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr)
|
|||
|
||||
STRING string, another_string;
|
||||
CHAR str_dev_name[64], str_symb_name[64];
|
||||
UCHAR hcd_id;
|
||||
|
||||
if (drvr_obj == NULL)
|
||||
return NULL;
|
||||
|
@ -3768,6 +3761,13 @@ ehci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr)
|
|||
RtlFreeUnicodeString(&dev_name);
|
||||
RtlFreeUnicodeString(&symb_name);
|
||||
|
||||
//register with dev_mgr though it is not initilized
|
||||
ehci_init_hcd_interface(pdev_ext->ehci);
|
||||
hcd_id = dev_mgr_register_hcd(dev_mgr, &pdev_ext->ehci->hcd_interf);
|
||||
|
||||
pdev_ext->ehci->hcd_interf.hcd_set_id(&pdev_ext->ehci->hcd_interf, hcd_id);
|
||||
pdev_ext->ehci->hcd_interf.hcd_set_dev_mgr(&pdev_ext->ehci->hcd_interf, dev_mgr);
|
||||
|
||||
return pdev;
|
||||
|
||||
}
|
||||
|
|
|
@ -67,7 +67,6 @@ extern PDEVICE_OBJECT ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_pa
|
|||
|
||||
#define release_adapter( padapTER ) HalPutDmaAdapter(padapTER)
|
||||
|
||||
|
||||
#define get_int_idx( _urb, _idx ) \
|
||||
{\
|
||||
UCHAR interVAL;\
|
||||
|
@ -406,6 +405,7 @@ uhci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr)
|
|||
|
||||
STRING string, another_string;
|
||||
CHAR str_dev_name[64], str_symb_name[64];
|
||||
UCHAR hcd_id;
|
||||
|
||||
if (drvr_obj == NULL)
|
||||
return NULL;
|
||||
|
@ -455,6 +455,12 @@ uhci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr)
|
|||
RtlFreeUnicodeString(&dev_name);
|
||||
RtlFreeUnicodeString(&symb_name);
|
||||
|
||||
//register with dev_mgr though it is not initilized
|
||||
uhci_init_hcd_interface(pdev_ext->uhci);
|
||||
hcd_id = dev_mgr_register_hcd(dev_mgr, &pdev_ext->uhci->hcd_interf);
|
||||
|
||||
pdev_ext->uhci->hcd_interf.hcd_set_id(&pdev_ext->uhci->hcd_interf, hcd_id);
|
||||
pdev_ext->uhci->hcd_interf.hcd_set_dev_mgr(&pdev_ext->uhci->hcd_interf, dev_mgr);
|
||||
return pdev;
|
||||
}
|
||||
|
||||
|
@ -681,7 +687,6 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU
|
|||
CM_PARTIAL_RESOURCE_DESCRIPTOR *pprd;
|
||||
PCI_SLOT_NUMBER slot_num;
|
||||
NTSTATUS status;
|
||||
UCHAR hcd_id;
|
||||
|
||||
|
||||
pdev = uhci_create_device(drvr_obj, dev_mgr);
|
||||
|
@ -847,13 +852,6 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU
|
|||
return NULL;
|
||||
}
|
||||
|
||||
//register with dev_mgr
|
||||
uhci_init_hcd_interface(pdev_ext->uhci);
|
||||
hcd_id = dev_mgr_register_hcd(dev_mgr, &pdev_ext->uhci->hcd_interf);
|
||||
|
||||
pdev_ext->uhci->hcd_interf.hcd_set_id(&pdev_ext->uhci->hcd_interf, hcd_id);
|
||||
pdev_ext->uhci->hcd_interf.hcd_set_dev_mgr(&pdev_ext->uhci->hcd_interf, dev_mgr);
|
||||
|
||||
return pdev;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue