+/// Enable or disable data scan verification checking.
+void jtag_set_verify(bool enable);
+/// @returns True if data scan verification will be performed.
+bool jtag_will_verify(void);
+
+/// Enable or disable verification of IR scan checking.
+void jtag_set_verify_capture_ir(bool enable);
+/// @returns True if IR scan verification will be performed.
+bool jtag_will_verify_capture_ir(void);
+
+/**
+ * Initialize interface upon startup. Return a successful no-op upon
+ * subsequent invocations.
+ */
+int jtag_interface_init(struct command_context* cmd_ctx);
+
+/// Shutdown the JTAG interface upon program exit.
+int jtag_interface_quit(void);
+
+/**
+ * Initialize JTAG chain using only a RESET reset. If init fails,
+ * try reset + init.
+ */
+int jtag_init(struct command_context* cmd_ctx);
+
+/// reset, then initialize JTAG chain
+int jtag_init_reset(struct command_context* cmd_ctx);
+int jtag_register_commands(struct command_context* cmd_ctx);
+int jtag_init_inner(struct command_context *cmd_ctx);
+
+/**
+ * @file
+ * The JTAG interface can be implemented with a software or hardware fifo.
+ *
+ * TAP_DRSHIFT and TAP_IRSHIFT are illegal end states; however,
+ * TAP_DRSHIFT/IRSHIFT can be emulated as end states, by using longer
+ * scans.
+ *
+ * Code that is relatively insensitive to the path taken through state
+ * machine (as long as it is JTAG compliant) can use @a endstate for
+ * jtag_add_xxx_scan(). Otherwise, the pause state must be specified as
+ * end state and a subsequent jtag_add_pathmove() must be issued.
+ */
+
+/**
+ * Generate an IR SCAN with a list of scan fields with one entry for
+ * each enabled TAP.
+ *
+ * If the input field list contains an instruction value for a TAP then
+ * that is used otherwise the TAP is set to bypass.
+ *
+ * TAPs for which no fields are passed are marked as bypassed for
+ * subsequent DR SCANs.
+ *
+ */
+void jtag_add_ir_scan(int num_fields,
+ struct scan_field* fields, tap_state_t endstate);
+/**
+ * The same as jtag_add_ir_scan except no verification is performed out
+ * the output values.
+ */
+void jtag_add_ir_scan_noverify(int num_fields,
+ const struct scan_field *fields, tap_state_t state);
+/**
+ * Duplicate the scan fields passed into the function into an IR SCAN
+ * command. This function assumes that the caller handles extra fields
+ * for bypassed TAPs.
+ */
+void jtag_add_plain_ir_scan(int num_fields,
+ const struct scan_field* fields, tap_state_t endstate);
+
+
+/**
+ * Set in_value to point to 32 bits of memory to scan into. This
+ * function is a way to handle the case of synchronous and asynchronous
+ * JTAG queues.
+ *
+ * In the event of an asynchronous queue execution the queue buffer
+ * allocation method is used, for the synchronous case the temporary 32
+ * bits come from the input field itself.
+ */
+void jtag_alloc_in_value32(struct scan_field *field);
+
+/**
+ * Generate a DR SCAN using the fields passed to the function.
+ * For connected TAPs, the function checks in_fields and uses fields
+ * specified there. For bypassed TAPs, the function generates a dummy
+ * 1-bit field. The bypass status of TAPs is set by jtag_add_ir_scan().
+ */
+void jtag_add_dr_scan(int num_fields,
+ const struct scan_field* fields, tap_state_t endstate);
+/// A version of jtag_add_dr_scan() that uses the check_value/mask fields
+void jtag_add_dr_scan_check(int num_fields,
+ struct scan_field* fields, tap_state_t endstate);
+/**
+ * Duplicate the scan fields passed into the function into a DR SCAN
+ * command. Unlike jtag_add_dr_scan(), this function assumes that the
+ * caller handles extra fields for bypassed TAPs.
+ */
+void jtag_add_plain_dr_scan(int num_fields,
+ const struct scan_field* fields, tap_state_t endstate);
+
+/**
+ * Defines the type of data passed to the jtag_callback_t interface.
+ * The underlying type must allow storing an @c int or pointer type.
+ */
+typedef intptr_t jtag_callback_data_t;
+
+/**
+ * Defines a simple JTAG callback that can allow conversions on data
+ * scanned in from an interface.
+ *
+ * This callback should only be used for conversion that cannot fail.
+ * For conversion types or checks that can fail, use the more complete
+ * variant: jtag_callback_t.
+ */
+typedef void (*jtag_callback1_t)(jtag_callback_data_t data0);
+
+/// A simpler version of jtag_add_callback4().
+void jtag_add_callback(jtag_callback1_t, jtag_callback_data_t data0);