summaryrefslogtreecommitdiff
path: root/drivers/staging/tty/riscom8.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 15:11:04 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 15:11:04 -0700
commite6bee325e49f17c65c1fd66e9e8b348c85788341 (patch)
treebcc9e5d8e82efa9009edd481a837cc3626360091 /drivers/staging/tty/riscom8.h
parenta5e6b135bdff649e4330f98e2e80dbb1984f7e77 (diff)
parent6ae705b23be8da52d3163be9d81e9b767876aaf9 (diff)
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (76 commits) pch_uart: reference clock on CM-iTC pch_phub: add new device ML7213 n_gsm: fix UIH control byte : P bit should be 0 n_gsm: add a documentation serial: msm_serial_hs: Add MSM high speed UART driver tty_audit: fix tty_audit_add_data live lock on audit disabled tty: move cd1865.h to drivers/staging/tty/ Staging: tty: fix build with epca.c driver pcmcia: synclink_cs: fix prototype for mgslpc_ioctl() Staging: generic_serial: fix double locking bug nozomi: don't use flush_scheduled_work() tty/serial: Relax the device_type restriction from of_serial MAINTAINERS: Update HVC file patterns tty: phase out of ioctl file pointer for tty3270 as well tty: forgot to remove ipwireless from drivers/char/pcmcia/Makefile pch_uart: Fix DMA channel miss-setting issue. pch_uart: fix exclusive access issue pch_uart: fix auto flow control miss-setting issue pch_uart: fix uart clock setting issue pch_uart : Use dev_xxx not pr_xxx ... Fix up trivial conflicts in drivers/misc/pch_phub.c (same patch applied twice, then changes to the same area in one branch)
Diffstat (limited to 'drivers/staging/tty/riscom8.h')
-rw-r--r--drivers/staging/tty/riscom8.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/drivers/staging/tty/riscom8.h b/drivers/staging/tty/riscom8.h
new file mode 100644
index 000000000000..c9876b3f9714
--- /dev/null
+++ b/drivers/staging/tty/riscom8.h
@@ -0,0 +1,91 @@
+/*
+ * linux/drivers/char/riscom8.h -- RISCom/8 multiport serial driver.
+ *
+ * Copyright (C) 1994-1996 Dmitry Gorodchanin (pgmdsg@ibi.com)
+ *
+ * This code is loosely based on the Linux serial driver, written by
+ * Linus Torvalds, Theodore T'so and others. The RISCom/8 card
+ * programming info was obtained from various drivers for other OSes
+ * (FreeBSD, ISC, etc), but no source code from those drivers were
+ * directly included in this driver.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __LINUX_RISCOM8_H
+#define __LINUX_RISCOM8_H
+
+#include <linux/serial.h>
+
+#ifdef __KERNEL__
+
+#define RC_NBOARD 4
+/* NOTE: RISCom decoder recognizes 16 addresses... */
+#define RC_NPORT 8
+#define RC_BOARD(line) (((line) >> 3) & 0x07)
+#define RC_PORT(line) ((line) & (RC_NPORT - 1))
+
+/* Ticks per sec. Used for setting receiver timeout and break length */
+#define RISCOM_TPS 4000
+
+/* Yeah, after heavy testing I decided it must be 6.
+ * Sure, You can change it if needed.
+ */
+#define RISCOM_RXFIFO 6 /* Max. receiver FIFO size (1-8) */
+
+#define RISCOM8_MAGIC 0x0907
+
+#define RC_IOBASE1 0x220
+#define RC_IOBASE2 0x240
+#define RC_IOBASE3 0x250
+#define RC_IOBASE4 0x260
+
+struct riscom_board {
+ unsigned long flags;
+ unsigned short base;
+ unsigned char irq;
+ signed char count;
+ unsigned char DTR;
+};
+
+#define RC_BOARD_PRESENT 0x00000001
+#define RC_BOARD_ACTIVE 0x00000002
+
+struct riscom_port {
+ int magic;
+ struct tty_port port;
+ int baud_base;
+ int timeout;
+ int custom_divisor;
+ int xmit_head;
+ int xmit_tail;
+ int xmit_cnt;
+ short wakeup_chars;
+ short break_length;
+ unsigned char mark_mask;
+ unsigned char IER;
+ unsigned char MSVR;
+ unsigned char COR2;
+#ifdef RC_REPORT_OVERRUN
+ unsigned long overrun;
+#endif
+#ifdef RC_REPORT_FIFO
+ unsigned long hits[10];
+#endif
+};
+
+#endif /* __KERNEL__ */
+#endif /* __LINUX_RISCOM8_H */