Modify xhci functions for USB core

This commit is contained in:
xj 2024-06-18 23:34:39 -07:00
parent 5d240f93ae
commit 545c240c8d
1 changed files with 15 additions and 0 deletions

View File

@ -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;
}