+ 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();
+ }