if (ci_ep->desc)
num = ci_ep->desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
- if (num == 0 && controller.ep0_req)
+ if (num == 0 && controller.ep0_req) {
+ DBG("%s: already got controller.ep0_req = %p\n", __func__, controller.ep0_req);
return &controller.ep0_req->req;
+ }
ci_req = calloc(1, sizeof(*ci_req));
if (!ci_req)
if (ci_ep->desc)
num = ci_ep->desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+ else
+ DBG("%s: no endpoint %p descriptor\n", __func__, ci_ep);
if (num == 0) {
if (!controller.ep0_req)
break;
}
- if (&ci_req->req != _req)
+ if (&ci_req->req != _req) {
+ DBG("%s: ci_req not found in the queue\n", __func__);
return -EINVAL;
+ }
list_del_init(&ci_req->queue);