mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 04:37:15 +00:00
[USBDRIVER]
- Register the device with the device manager only after it has been successfully allocated to avoid a crash - A device that failed in xhci_alloc would never get deregistered from the device manager so it would crash when it entered xhci_start with a partially set up device extension - Define release_adapter to HalPutDmaAdapter to fix a DMA adapter leak [HAL] - Export HalPutDmaAdapter svn path=/trunk/; revision=47139
This commit is contained in:
parent
428dff1a79
commit
e47ef16223
3 changed files with 20 additions and 33 deletions
|
@ -58,15 +58,7 @@
|
|||
|
||||
#define endp_mult_count( endp ) ( ( ( endp->pusb_endp_desc->wMaxPacketSize & 0x1800 ) >> 11 ) + 1 )
|
||||
|
||||
#if 0
|
||||
/* WTF?! */
|
||||
#define release_adapter( padapTER ) \
|
||||
{\
|
||||
( ( padapTER ) ); \
|
||||
}
|
||||
#else
|
||||
#define release_adapter( padapTER ) (void)(padapTER)
|
||||
#endif
|
||||
#define release_adapter( padapTER ) HalPutDmaAdapter(padapTER)
|
||||
|
||||
#define get_int_idx( _urb, _idx ) \
|
||||
{\
|
||||
|
@ -3538,6 +3530,7 @@ 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);
|
||||
|
@ -3704,6 +3697,13 @@ 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,7 +3719,6 @@ 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;
|
||||
|
@ -3769,13 +3768,6 @@ 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;
|
||||
|
||||
}
|
||||
|
|
|
@ -65,15 +65,8 @@ extern PDEVICE_OBJECT ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_pa
|
|||
: enDP->pusb_endp_desc->wMaxPacketSize )
|
||||
|
||||
|
||||
#if 0
|
||||
/* WTF?! */
|
||||
#define release_adapter( padapTER ) \
|
||||
{\
|
||||
( ( padapTER ) ); \
|
||||
}
|
||||
#else
|
||||
#define release_adapter( padapTER ) (void)(padapTER)
|
||||
#endif
|
||||
#define release_adapter( padapTER ) HalPutDmaAdapter(padapTER)
|
||||
|
||||
|
||||
#define get_int_idx( _urb, _idx ) \
|
||||
{\
|
||||
|
@ -413,7 +406,6 @@ 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;
|
||||
|
@ -463,12 +455,6 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -695,6 +681,7 @@ 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);
|
||||
|
@ -860,6 +847,13 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
@ stdcall HalInitializeProcessor(long ptr)
|
||||
@ stdcall HalMakeBeep(long)
|
||||
@ stdcall HalProcessorIdle()
|
||||
@ stdcall HalPutDmaAdapter(ptr)
|
||||
@ stdcall HalQueryDisplayParameters(ptr ptr ptr ptr)
|
||||
@ stdcall HalQueryRealTimeClock(ptr)
|
||||
@ stdcall HalReadDmaCounter(ptr)
|
||||
|
|
Loading…
Reference in a new issue