From: "Maciej W. Rozycki" <macro@mips.com>
To: gdb-patches@sourceware.org
Cc: Chris Dearman <chris@mips.com>,
"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: ser-unix.c: Add hardware flow control support
Date: Fri, 30 Mar 2007 11:55:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.61.0703301233210.3670@perivale.mips.com> (raw)
Hello,
This is a set of changes to add hardware flow control support to the
serial interface.
2007-03-30 Chris Dearman <chris@mips.com>
Maciej W. Rozycki <macro@mips.com>
* ser-unix.c (show_serial_hwflow): New function.
(hardwire_raw): Add hardware flow control support.
(_initialize_ser_hardwire): Add set/show remoteflow.
OK to apply?
Maciej
12226-0.diff
Index: binutils-quilt/src/gdb/ser-unix.c
===================================================================
--- binutils-quilt.orig/src/gdb/ser-unix.c 2007-03-30 12:36:15.000000000 +0100
+++ binutils-quilt/src/gdb/ser-unix.c 2007-03-30 12:42:31.000000000 +0100
@@ -33,6 +33,7 @@
#include "gdb_select.h"
#include "gdb_string.h"
+#include "gdbcmd.h"
#ifdef HAVE_TERMIOS
@@ -40,6 +41,18 @@
{
struct termios termios;
};
+
+#ifdef CRTSCTS
+/* Boolean to explicitly enable or disable h/w flow control. */
+static int serial_hwflow;
+static void
+show_serial_hwflow (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("Hardware flow control is %s.\n"), value);
+}
+#endif
+
#endif /* termios */
#ifdef HAVE_TERMIO
@@ -387,6 +400,19 @@
state.termios.c_lflag = 0;
state.termios.c_cflag &= ~(CSIZE | PARENB);
state.termios.c_cflag |= CLOCAL | CS8;
+#ifdef CRTSCTS
+ /* h/w flow control. */
+ if (serial_hwflow)
+ state.termios.c_cflag |= CRTSCTS;
+ else
+ state.termios.c_cflag &= ~CRTSCTS;
+#ifdef CRTS_IFLOW
+ if (serial_hwflow)
+ state.termios.c_cflag |= CRTS_IFLOW;
+ else
+ state.termios.c_cflag &= ~CRTS_IFLOW;
+#endif
+#endif
state.termios.c_cc[VMIN] = 0;
state.termios.c_cc[VTIME] = 0;
#endif
@@ -892,6 +918,20 @@
ops->read_prim = ser_unix_read_prim;
ops->write_prim = ser_unix_write_prim;
serial_add_interface (ops);
+
+#ifdef HAVE_TERMIOS
+#ifdef CRTSCTS
+ add_setshow_boolean_cmd ("remoteflow", no_class,
+ &serial_hwflow, _("\
+Set use of hardware flow control for remote serial I/O."), _("\
+Show use of hardware flow control for remote serial I/O."), _("\
+This value is used to enable or disable hardware flow control (RTS/CTS) on\n\
+the serial port when debugging using remote targets."),
+ NULL,
+ show_serial_hwflow,
+ &setlist, &showlist);
+#endif
+#endif
}
int
next reply other threads:[~2007-03-30 11:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-30 11:55 Maciej W. Rozycki [this message]
2007-03-30 12:08 ` Daniel Jacobowitz
2007-05-02 14:11 ` Maciej W. Rozycki
2007-05-21 12:22 ` Maciej W. Rozycki
2007-05-21 12:50 ` Daniel Jacobowitz
2007-05-21 20:08 ` Eli Zaretskii
2007-05-22 10:57 ` Maciej W. Rozycki
2007-03-30 12:26 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0703301233210.3670@perivale.mips.com \
--to=macro@mips.com \
--cc=chris@mips.com \
--cc=gdb-patches@sourceware.org \
--cc=macro@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox