1 /* 2 * linux/drivers/char/riscom8.h -- RISCom/8 multiport serial driver. 3 * 4 * Copyright (C) 1994-1996 Dmitry Gorodchanin (begemot@bgm.rosprint.net) 5 * 6 * This code is loosely based on the Linux serial driver, written by 7 * Linus Torvalds, Theodore T'so and others. The RISCom/8 card 8 * programming info was obtained from various drivers for other OSes 9 * (FreeBSD, ISC, etc), but no source code from those drivers were 10 * directly included in this driver. 11 * 12 * 13 * This program is free software; you can redistribute it and/or modify 14 * it under the terms of the GNU General Public License as published by 15 * the Free Software Foundation; either version 2 of the License, or 16 * (at your option) any later version. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU General Public License for more details. 22 * 23 * You should have received a copy of the GNU General Public License 24 * along with this program; if not, write to the Free Software 25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 */ 27
28 #ifndef__LINUX_RISCOM8_H 29 #define__LINUX_RISCOM8_H 30
31 #include <linux/serial.h>
32
33 #ifdef__KERNEL__ 34
35 #defineRC_NBOARD 4
36 /* NOTE: RISCom decoder recognizes 16 addresses... */ 37 #defineRC_NPORT 8
38 #defineRC_BOARD(line) (((line) >> 3) & 0x07)
39 #defineRC_PORT(line) ((line) & (RC_NPORT - 1))
40
41 /* Ticks per sec. Used for setting receiver timeout and break length */ 42 #defineRISCOM_TPS 4000
43
44 /* Yeah, after heavy testing I decided it must be 6. 45 * Sure, You can change it if needed. 46 */ 47 #defineRISCOM_RXFIFO 6 /* Max. receiver FIFO size (1-8) */ 48
49 #defineRISCOM8_MAGIC 0x0907
50
51 #defineRC_IOBASE1 0x220
52 #defineRC_IOBASE2 0x240
53 #defineRC_IOBASE3 0x250
54 #defineRC_IOBASE4 0x260
55
56 structriscom_board{ 57 unsignedlongflags;
58 unsignedshortbase;
59 unsignedcharirq;
60 signedcharcount;
61 unsignedcharDTR;
62 };
63
64 #defineRC_BOARD_PRESENT 0x00000001
65 #defineRC_BOARD_ACTIVE 0x00000002
66
67 structriscom_port{ 68 intmagic;
69 intbaud_base;
70 intflags;
71 structtty_struct * tty;
72 intcount;
73 intblocked_open;
74 intevent;
75 inttimeout;
76 intclose_delay;
77 longsession;
78 longpgrp;
79 unsignedchar * xmit_buf;
80 intcustom_divisor;
81 intxmit_head;
82 intxmit_tail;
83 intxmit_cnt;
84 structtermiosnormal_termios;
85 structtermioscallout_termios;
86 structwait_queue *open_wait;
87 structwait_queue *close_wait;
88 structtq_structtqueue;
89 structtq_structtqueue_hangup;
90 shortwakeup_chars;
91 shortbreak_length;
92 unsignedshortclosing_wait;
93 unsignedcharmark_mask;
94 unsignedcharIER;
95 unsignedcharMSVR;
96 unsignedcharCOR2;
97 #ifdefRC_REPORT_OVERRUN 98 unsignedlongoverrun;
99 #endif 100 #ifdefRC_REPORT_FIFO 101 unsignedlonghits[10];
102 #endif 103 };
104
105 #endif/* __KERNEL__ */ 106 #endif/* __LINUX_RISCOM8_H */