+static int
+kwboot_debugmsg(int tty, void *msg)
+{
+ int rc;
+
+ kwboot_printv("Sending debug message. Please reboot the target...");
+
+ do {
+ char buf[16];
+
+ rc = tcflush(tty, TCIOFLUSH);
+ if (rc)
+ break;
+
+ rc = kwboot_tty_send(tty, msg, 8);
+ if (rc) {
+ usleep(msg_req_delay * 1000);
+ continue;
+ }
+
+ rc = kwboot_tty_recv(tty, buf, 16, msg_rsp_timeo);
+
+ kwboot_spinner();
+
+ } while (rc);
+
+ kwboot_printv("\n");
+
+ return rc;
+}
+