diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c index a85cac217..099c2bb0e 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c @@ -861,6 +861,21 @@ int usbh_get_xhci_devaddr(usbh_pipe_t *pipe) int xhci_usbh_pipe_free(usbh_pipe_t pipe){ + int ret = 0; + struct xhci_endpoint *ppipe = (struct xhci_endpoint *)pipe; + + if (!ppipe) { + return -EINVAL; + } + + struct usbh_urb *urb = ppipe->urb; + if (urb) { + usbh_kill_urb(urb); + } + + size_t flags = usb_osal_enter_critical_section(); + xhci_endpoint_close(ppipe); + usb_osal_leave_critical_section(flags); return 0; }