Lines Matching refs:req
195 static void usb_dfu_detach(struct usb_handle *pdev, struct usb_setup_req *req) in usb_dfu_detach() argument
220 static void usb_dfu_download(struct usb_handle *pdev, struct usb_setup_req *req) in usb_dfu_download() argument
228 if (req->length > 0) { in usb_dfu_download()
238 length = req->length; in usb_dfu_download()
273 static void usb_dfu_upload(struct usb_handle *pdev, struct usb_setup_req *req) in usb_dfu_upload() argument
281 if (req->length == 0) { in usb_dfu_upload()
296 length = req->length; in usb_dfu_upload()
300 hdfu->dev_state = (req->length > length) ? STATE_DFU_IDLE : STATE_DFU_UPLOAD_IDLE; in usb_dfu_upload()
305 ERROR("UPLOAD : bad block %i on alt %i\n", req->value, req->index); in usb_dfu_upload()
408 static uint8_t usb_dfu_setup(struct usb_handle *pdev, struct usb_setup_req *req) in usb_dfu_setup() argument
415 switch (req->bm_request & USB_REQ_TYPE_MASK) { in usb_dfu_setup()
417 switch (req->b_request) { in usb_dfu_setup()
419 usb_dfu_download(pdev, req); in usb_dfu_setup()
423 usb_dfu_upload(pdev, req); in usb_dfu_setup()
443 usb_dfu_detach(pdev, req); in usb_dfu_setup()
448 req->b_request, hdfu->alt_setting); in usb_dfu_setup()
455 switch (req->b_request) { in usb_dfu_setup()
457 if (HIBYTE(req->value) == DFU_DESCRIPTOR_TYPE) { in usb_dfu_setup()
462 len = MIN(len, req->length); in usb_dfu_setup()
476 hdfu->alt_setting = LOBYTE(req->value); in usb_dfu_setup()