From 545c240c8d19705b7b591acf6a52049b9fe7c766 Mon Sep 17 00:00:00 2001 From: xj Date: Tue, 18 Jun 2024 23:34:39 -0700 Subject: [PATCH] Modify xhci functions for USB core --- .../usb/components/port/xhci/usb_hc_xhci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; }