summaryrefslogtreecommitdiffstats
path: root/sys/sys/serial.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-24 10:05:58 +0000
committerphk <phk@FreeBSD.org>2004-06-24 10:05:58 +0000
commit4972a55ba2d80d24a12bae08ca6baf93d22f4b28 (patch)
tree80be8285018c8c4fc98be97d1157a7874dab5596 /sys/sys/serial.h
parent1cc5f2552d2ce551fabede839e45fd49dbbe69f1 (diff)
downloadFreeBSD-src-4972a55ba2d80d24a12bae08ca6baf93d22f4b28.zip
FreeBSD-src-4972a55ba2d80d24a12bae08ca6baf93d22f4b28.tar.gz
Add a tty-independent include file for definitions pertaining to serial
ports. Define the most commonly used modem signals, and delta-bit definitions for them.
Diffstat (limited to 'sys/sys/serial.h')
-rw-r--r--sys/sys/serial.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/sys/sys/serial.h b/sys/sys/serial.h
new file mode 100644
index 0000000..2e1411b
--- /dev/null
+++ b/sys/sys/serial.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2004 Poul-Henning Kamp
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * This file contains definitions which pertain to serial ports as such,
+ * (both async and sync), but which do not necessarily have anything to
+ * do with tty processing.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_SERIAL_H_
+#define _SYS_SERIAL_H_
+
+
+/*
+ * Indentification of modem control signals. These definitions match
+ * the TIOCMGET definitions in <sys/ttycom.h> shifted a bit down, and
+ * that identity is enforced with CTASSERT at the bottom of kern/tty.c
+ * Both the modem bits and delta bits must fit in 16 bit!
+ */
+#define SER_DTR 0x0001 /* data terminal ready */
+#define SER_RTS 0x0002 /* request to send */
+#define SER_STX 0x0004 /* secondary transmit */
+#define SER_SRX 0x0008 /* secondary receive */
+#define SER_CTS 0x0010 /* clear to send */
+#define SER_DCD 0x0020 /* data carrier detect */
+#define SER_RI 0x0040 /* ring indicate */
+#define SER_DSR 0x0080 /* data set ready */
+
+/* Delta bits, used to indicate which signals should/was affected */
+#define SER_DDTR (SER_DTR << 8)
+#define SER_DRTS (SER_RTS << 8)
+#define SER_DSTX (SER_STX << 8)
+#define SER_DSRX (SER_SRX << 8)
+#define SER_DCTS (SER_CTS << 8)
+#define SER_DDCD (SER_DCD << 8)
+#define SER_DRI (SER_RI << 8)
+#define SER_DDSR (SER_DSR << 8)
+
+#endif /* !_SYS_SERIAL_H_ */
OpenPOWER on IntegriCloud