feat(port): add urb->complete in usbh_kill_urb
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -1139,6 +1139,10 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
dwc2_chan_free(chan);
|
dwc2_chan_free(chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (urb->complete) {
|
||||||
|
urb->complete(urb->arg, urb->errorcode);
|
||||||
|
}
|
||||||
|
|
||||||
usb_osal_leave_critical_section(flags);
|
usb_osal_leave_critical_section(flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1350,7 +1350,8 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
EHCI_HCOR->usbcmd |= EHCI_USBCMD_IAAD;
|
EHCI_HCOR->usbcmd |= EHCI_USBCMD_IAAD;
|
||||||
while (!(EHCI_HCOR->usbsts & EHCI_USBSTS_IAA)) {
|
while (!(EHCI_HCOR->usbsts & EHCI_USBSTS_IAA)) {
|
||||||
timeout++;
|
timeout++;
|
||||||
if (timeout > 20000) {
|
if (timeout > 200000) {
|
||||||
|
USB_LOG_ERR("iaad timeout\r\n");
|
||||||
usb_osal_leave_critical_section(flags);
|
usb_osal_leave_critical_section(flags);
|
||||||
return -USB_ERR_TIMEOUT;
|
return -USB_ERR_TIMEOUT;
|
||||||
}
|
}
|
||||||
@@ -1358,6 +1359,10 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
EHCI_HCOR->usbsts = EHCI_USBSTS_IAA;
|
EHCI_HCOR->usbsts = EHCI_USBSTS_IAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (urb->complete) {
|
||||||
|
urb->complete(urb->arg, urb->errorcode);
|
||||||
|
}
|
||||||
|
|
||||||
usb_osal_leave_critical_section(flags);
|
usb_osal_leave_critical_section(flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -820,6 +820,10 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
musb_pipe_free(pipe);
|
musb_pipe_free(pipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (urb->complete) {
|
||||||
|
urb->complete(urb->arg, urb->errorcode);
|
||||||
|
}
|
||||||
|
|
||||||
usb_osal_leave_critical_section(flags);
|
usb_osal_leave_critical_section(flags);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -605,6 +605,10 @@ int usbh_kill_urb(struct usbh_urb *urb)
|
|||||||
rp2040_pipe_free(pipe);
|
rp2040_pipe_free(pipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (urb->complete) {
|
||||||
|
urb->complete(urb->arg, urb->errorcode);
|
||||||
|
}
|
||||||
|
|
||||||
usb_osal_leave_critical_section(flags);
|
usb_osal_leave_critical_section(flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user