+extern void serial_raw (struct serial *scb);
+
+/* Return a pointer to a newly malloc'd ttystate containing the state
+ of the tty. */
+
+extern serial_ttystate serial_get_tty_state (struct serial *scb);
+
+/* Return a pointer to a newly malloc'd ttystate containing a copy
+ of the state in TTYSTATE. */
+
+extern serial_ttystate serial_copy_tty_state (struct serial *scb,
+ serial_ttystate ttystate);
+
+/* Set the state of the tty to TTYSTATE. The change is immediate.
+ When changing to or from raw mode, input might be discarded.
+ Returns 0 for success, negative value for error (in which case
+ errno contains the error). */
+
+extern int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate);
+
+/* printf_filtered a user-comprehensible description of ttystate on
+ the specified STREAM. FIXME: At present this sends output to the
+ default stream - GDB_STDOUT. */
+
+extern void serial_print_tty_state (struct serial *scb,
+ serial_ttystate ttystate,
+ struct ui_file *);
+
+/* Set the baudrate to the decimal value supplied. Returns 0 for
+ success, -1 for failure. */
+
+extern int serial_setbaudrate (struct serial *scb, int rate);
+
+/* Set the number of stop bits to the value specified. Returns 0 for
+ success, -1 for failure. */
+
+#define SERIAL_1_STOPBITS 1
+#define SERIAL_1_AND_A_HALF_STOPBITS 2 /* 1.5 bits, snicker... */
+#define SERIAL_2_STOPBITS 3
+
+extern int serial_setstopbits (struct serial *scb, int num);
+
+#define GDBPARITY_NONE 0
+#define GDBPARITY_ODD 1
+#define GDBPARITY_EVEN 2
+
+/* Set parity for serial port. Returns 0 for success, -1 for failure. */
+
+extern int serial_setparity (struct serial *scb, int parity);
+
+/* Asynchronous serial interface: */
+
+/* Can the serial device support asynchronous mode? */
+
+extern int serial_can_async_p (struct serial *scb);
+
+/* Has the serial device been put in asynchronous mode? */
+
+extern int serial_is_async_p (struct serial *scb);
+
+/* For ASYNC enabled devices, register a callback and enable
+ asynchronous mode. To disable asynchronous mode, register a NULL
+ callback. */
+
+typedef void (serial_event_ftype) (struct serial *scb, void *context);
+extern void serial_async (struct serial *scb,
+ serial_event_ftype *handler, void *context);
+
+/* Trace/debug mechanism.
+
+ serial_debug() enables/disables internal debugging.
+ serial_debug_p() indicates the current debug state. */
+
+extern void serial_debug (struct serial *scb, int debug_p);
+
+extern int serial_debug_p (struct serial *scb);
+
+
+/* Details of an instance of a serial object. */