Lines Matching refs:xfer
50 usb_handle_request_callback(struct usb_xfer *xfer, usb_error_t error) in usb_handle_request_callback() argument
56 switch (USB_GET_STATE(xfer)) { in usb_handle_request_callback()
61 err = usb_handle_request(xfer); in usb_handle_request_callback()
67 usb_needs_explore(xfer->xroot->bus, 0); in usb_handle_request_callback()
72 usbd_transfer_submit(xfer); in usb_handle_request_callback()
77 if (xfer->flags_int.control_rem != 0xFFFF) { in usb_handle_request_callback()
79 (void)usb_handle_request(xfer); in usb_handle_request_callback()
81 if (xfer->error != USB_ERR_CANCELLED) { in usb_handle_request_callback()
94 usbd_xfer_set_frame_len(xfer, 0, sizeof(struct usb_device_request)); in usb_handle_request_callback()
95 xfer->nframes = 1; in usb_handle_request_callback()
96 xfer->flags.manual_status = 1; in usb_handle_request_callback()
97 xfer->flags.force_short_xfer = 0; in usb_handle_request_callback()
98 usbd_xfer_set_stall(xfer); /* cancel previous transfer, if any */ in usb_handle_request_callback()
99 usbd_transfer_submit(xfer); in usb_handle_request_callback()
110 usb_handle_set_config(struct usb_xfer *xfer, uint8_t conf_no) in usb_handle_set_config() argument
112 struct usb_device *udev = xfer->xroot->udev; in usb_handle_set_config()
120 USB_XFER_UNLOCK(xfer); in usb_handle_set_config()
148 USB_XFER_LOCK(xfer); in usb_handle_set_config()
179 usb_handle_iface_request(struct usb_xfer *xfer, in usb_handle_iface_request() argument
185 struct usb_device *udev = xfer->xroot->udev; in usb_handle_iface_request()
201 USB_XFER_UNLOCK(xfer); in usb_handle_iface_request()
319 USB_XFER_LOCK(xfer); in usb_handle_iface_request()
325 USB_XFER_LOCK(xfer); in usb_handle_iface_request()
331 USB_XFER_LOCK(xfer); in usb_handle_iface_request()
343 usb_handle_set_stall(struct usb_xfer *xfer, uint8_t ep, uint8_t do_stall) in usb_handle_set_stall() argument
345 struct usb_device *udev = xfer->xroot->udev; in usb_handle_set_stall()
348 USB_XFER_UNLOCK(xfer); in usb_handle_set_stall()
351 USB_XFER_LOCK(xfer); in usb_handle_set_stall()
388 usb_handle_remote_wakeup(struct usb_xfer *xfer, uint8_t is_on) in usb_handle_remote_wakeup() argument
393 udev = xfer->xroot->udev; in usb_handle_remote_wakeup()
425 usb_handle_request(struct usb_xfer *xfer) in usb_handle_request() argument
448 switch (USB_GET_STATE(xfer)) { in usb_handle_request()
452 if (!xfer->flags_int.control_act) { in usb_handle_request()
458 if (!xfer->flags_int.control_act) { in usb_handle_request()
471 usbd_xfer_set_frame_len(xfer, 0, 0); in usb_handle_request()
473 usbd_xfer_set_frame_offset(xfer, 0, 0); in usb_handle_request()
474 usbd_xfer_set_frame_offset(xfer, sizeof(req), 1); in usb_handle_request()
478 usbd_copy_out(xfer->frbuffers, 0, &req, sizeof(req)); in usb_handle_request()
480 if (xfer->flags_int.control_rem == 0xFFFF) { in usb_handle_request()
486 rem = xfer->flags_int.control_rem; in usb_handle_request()
495 udev = xfer->xroot->udev; in usb_handle_request()
584 err = usb_handle_iface_request(xfer, in usb_handle_request()
658 if (usb_handle_set_config(xfer, req.wValue[0])) { in usb_handle_request()
666 if (usb_handle_set_stall(xfer, req.wIndex[0], 0)) { in usb_handle_request()
674 if (usb_handle_remote_wakeup(xfer, 0)) { in usb_handle_request()
682 if (usb_handle_set_stall(xfer, req.wIndex[0], 1)) { in usb_handle_request()
690 if (usb_handle_remote_wakeup(xfer, 1)) { in usb_handle_request()
716 if (max_len > xfer->max_data_length) { in usb_handle_request()
717 max_len = usbd_xfer_max_len(xfer); in usb_handle_request()
727 if (rem > xfer->max_data_length) { in usb_handle_request()
728 rem = usbd_xfer_max_len(xfer); in usb_handle_request()
735 xfer->flags.force_short_xfer = 1; in usb_handle_request()
736 xfer->nframes = 2; in usb_handle_request()
741 xfer->flags.force_short_xfer = 0; in usb_handle_request()
742 xfer->nframes = max_len ? 2 : 1; in usb_handle_request()
747 usbd_copy_in(xfer->frbuffers + 1, 0, in usb_handle_request()
749 usbd_xfer_set_frame_len(xfer, 1, max_len); in usb_handle_request()
751 usbd_xfer_set_frame_data(xfer, 1, in usb_handle_request()
756 xfer->flags.manual_status = 0; in usb_handle_request()
757 usbd_xfer_set_frame_len(xfer, 1, 0); in usb_handle_request()