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