Created
November 9, 2022 14:21
-
-
Save sultanqasim/29416f61af312221ed0dcb48547d1596 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int | |
dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl) | |
{ | |
struct usb_gadget *gadget = f->config->cdev->gadget; | |
struct usb_request *req = f->config->cdev->req; | |
struct f_dfu *f_dfu = f->config->cdev->req->context; | |
… | |
if (req_type == USB_TYPE_STANDARD) { | |
… | |
} else /* DFU specific request */ | |
value = dfu_state[f_dfu->dfu_state] (f_dfu, ctrl, gadget, req); | |
if (value >= 0) { | |
req->length = value; | |
req->zero = value < len; | |
value = usb_ep_queue(gadget->ep0, req, 0); | |
if (value < 0) { | |
debug("ep_queue --> %d\n", value); | |
req->status = 0; | |
} | |
} | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment