Lines Matching refs:req
156 static void dnload_request_complete(struct usb_ep *ep, struct usb_request *req) in dnload_request_complete() argument
158 struct f_dfu *f_dfu = req->context; in dnload_request_complete()
161 ret = dfu_write(dfu_get_entity(f_dfu->altsetting), req->buf, in dnload_request_complete()
162 req->actual, f_dfu->blk_seq_num); in dnload_request_complete()
169 static void dnload_request_flush(struct usb_ep *ep, struct usb_request *req) in dnload_request_flush() argument
171 struct f_dfu *f_dfu = req->context; in dnload_request_flush()
181 static int handle_getstatus(struct usb_request *req) in handle_getstatus() argument
183 struct dfu_status *dstat = (struct dfu_status *)req->buf; in handle_getstatus()
184 struct f_dfu *f_dfu = req->context; in handle_getstatus()
217 static int handle_getstate(struct usb_request *req) in handle_getstate() argument
219 struct f_dfu *f_dfu = req->context; in handle_getstate()
221 ((u8 *)req->buf)[0] = f_dfu->dfu_state; in handle_getstate()
240 static int handle_upload(struct usb_request *req, u16 len) in handle_upload() argument
242 struct f_dfu *f_dfu = req->context; in handle_upload()
244 return dfu_read(dfu_get_entity(f_dfu->altsetting), req->buf, in handle_upload()
245 req->length, f_dfu->blk_seq_num); in handle_upload()
251 struct usb_request *req = cdev->req; in handle_dnload() local
252 struct f_dfu *f_dfu = req->context; in handle_dnload()
257 req->complete = dnload_request_complete; in handle_dnload()
267 struct usb_request *req) in state_app_idle() argument
273 value = handle_getstatus(req); in state_app_idle()
276 value = handle_getstate(req); in state_app_idle()
294 struct usb_request *req) in state_app_detach() argument
300 value = handle_getstatus(req); in state_app_detach()
303 value = handle_getstate(req); in state_app_detach()
317 struct usb_request *req) in state_dfu_idle() argument
337 value = handle_upload(req, len); in state_dfu_idle()
344 value = handle_getstatus(req); in state_dfu_idle()
347 value = handle_getstate(req); in state_dfu_idle()
377 struct usb_request *req) in state_dfu_dnload_sync() argument
383 value = handle_getstatus(req); in state_dfu_dnload_sync()
386 value = handle_getstate(req); in state_dfu_dnload_sync()
400 struct usb_request *req) in state_dfu_dnbusy() argument
406 value = handle_getstatus(req); in state_dfu_dnbusy()
420 struct usb_request *req) in state_dfu_dnload_idle() argument
437 value = handle_getstatus(req); in state_dfu_dnload_idle()
440 value = handle_getstate(req); in state_dfu_dnload_idle()
454 struct usb_request *req) in state_dfu_manifest_sync() argument
462 value = handle_getstatus(req); in state_dfu_manifest_sync()
464 req->complete = dnload_request_flush; in state_dfu_manifest_sync()
467 value = handle_getstate(req); in state_dfu_manifest_sync()
481 struct usb_request *req) in state_dfu_manifest() argument
489 value = handle_getstatus(req); in state_dfu_manifest()
494 value = handle_getstate(req); in state_dfu_manifest()
507 struct usb_request *req) in state_dfu_upload_idle() argument
517 value = handle_upload(req, len); in state_dfu_upload_idle()
527 value = handle_getstatus(req); in state_dfu_upload_idle()
530 value = handle_getstate(req); in state_dfu_upload_idle()
544 struct usb_request *req) in state_dfu_error() argument
550 value = handle_getstatus(req); in state_dfu_error()
553 value = handle_getstate(req); in state_dfu_error()
588 struct usb_request *req = f->config->cdev->req; in dfu_handle() local
589 struct f_dfu *f_dfu = f->config->cdev->req->context; in dfu_handle()
603 memcpy(req->buf, &dfu_func, value); in dfu_handle()
606 value = dfu_state[f_dfu->dfu_state] (f_dfu, ctrl, gadget, req); in dfu_handle()
609 req->length = value; in dfu_handle()
610 req->zero = value < len; in dfu_handle()
611 value = usb_ep_queue(gadget->ep0, req, 0); in dfu_handle()
614 req->status = 0; in dfu_handle()
726 cdev->req->context = f_dfu; in dfu_bind()