use static urb for ep0

This commit is contained in:
sakumisu
2023-11-17 21:05:07 +08:00
parent 5bbe2a97f2
commit a08097c90e
3 changed files with 8 additions and 10 deletions

View File

@@ -672,16 +672,13 @@ int usbh_control_transfer(struct usbh_hubport *hport, struct usb_setup_packet *s
struct usbh_urb *urb;
int ret;
urb = usb_malloc(sizeof(struct usbh_urb));
memset(urb, 0, sizeof(struct usbh_urb));
urb = &hport->ep0_urb;
usbh_control_urb_fill(urb, hport, setup, buffer, setup->wLength, CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT, NULL, NULL);
ret = usbh_submit_urb(urb);
if (ret == 0) {
ret = urb->actual_length;
}
usb_free(urb);
return ret;
}