+ return ERROR_OK;
+}
+static int vsllink_tap_execute_dma(void)
+{
+ int byte_length;
+ int i;
+ int result;
+
+ if (tap_length > 0)
+ {
+ /* Pad last byte so that tap_length is divisible by 8 */
+ while (tap_length % 8 != 0)
+ {
+ /* More of the last TMS value keeps us in the same state,
+ * analogous to free-running JTAG interfaces. */
+ vsllink_tap_append_step(last_tms, 0);
+ }
+ byte_length = tap_length / 8;
+
+ vsllink_usb_out_buffer[0] = VSLLINK_CMD_HW_JTAGRAWCMD;
+ vsllink_usb_out_buffer[1] = ((byte_length * 2 + 3) >> 0) & 0xff; // package size
+ vsllink_usb_out_buffer[2] = ((byte_length * 2 + 3) >> 8) & 0xff;
+
+ memcpy(&vsllink_usb_out_buffer[3], tdi_buffer, byte_length);
+ memcpy(&vsllink_usb_out_buffer[3 + byte_length], tms_buffer, byte_length);
+
+ result = vsllink_usb_message(vsllink_jtag_handle, 3 + 2 * byte_length, byte_length);
+ if (result == byte_length)
+ {
+ for (i = 0; i < pending_scan_results_length; i++)
+ {
+ pending_scan_result_t *pending_scan_result = &pending_scan_results_buffer[i];
+ uint8_t *buffer = pending_scan_result->buffer;
+ int length = pending_scan_result->length;
+ int first = pending_scan_result->offset;
+
+ scan_command_t *command = pending_scan_result->command;
+ buf_set_buf(vsllink_usb_in_buffer, first, buffer, 0, length);
+
+ DEBUG_JTAG_IO("JTAG scan read(%d bits, from %d bits):", length, first);
+#ifdef _DEBUG_JTAG_IO_
+ vsllink_debug_buffer(buffer, (length + 7) >> 3);
+#endif
+
+ if (jtag_read_buffer(buffer, command) != ERROR_OK)
+ {
+ vsllink_tap_init();
+ return ERROR_JTAG_QUEUE_FAILED;
+ }
+
+ if (pending_scan_result->buffer != NULL)
+ {
+ free(pending_scan_result->buffer);
+ }
+ }
+ }
+ else
+ {
+ LOG_ERROR("vsllink_tap_execute, wrong result %d, expected %d", result, byte_length);
+ return ERROR_JTAG_QUEUE_FAILED;
+ }
+
+ vsllink_tap_init();
+ }