1 /*****************************************************************************/
4 * stallion.h -- stallion multiport serial driver.
6 * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au).
7 * Copyright (C) 1994-1996 Greg Ungerer.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 /*****************************************************************************/
27 /*****************************************************************************/
30 * Define important driver constants here.
33 #define STL_MAXPANELS 4
34 #define STL_MAXBANKS 8
35 #define STL_PORTSPERPANEL 16
36 #define STL_MAXPORTS 64
37 #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
41 * Define a set of structures to hold all the board/panel/port info
42 * for our ports. These will be dynamically allocated as required.
46 * Define a ring queue structure for each port. This will hold the
47 * TX data waiting to be output. Characters are fed into this buffer
48 * from the line discipline (or even direct from user space!) and
49 * then fed into the UARTs during interrupts. Will use a classic ring
50 * queue here for this. The good thing about this type of ring queue
51 * is that the head and tail pointers can be updated without interrupt
52 * protection - since "write" code only needs to change the head, and
53 * interrupt code only needs to change the tail.
62 * Port, panel and board structures to hold status info about each.
63 * The board structure contains pointers to structures for each panel
64 * connected to it, and in turn each panel structure contains pointers
65 * for each port structure for each port on that panel. Note that
66 * the port structure also contains the board and panel number that it
67 * is associated with, this makes it (fairly) easy to get back to the
68 * board/panel info for a port.
70 typedef struct stlport
{
90 unsigned int rxignoremsk
;
91 unsigned int rxmarkmsk
;
93 unsigned int crenable
;
97 struct tty_struct
*tty
;
98 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
99 struct wait_queue
*open_wait
;
100 struct wait_queue
*close_wait
;
102 wait_queue_head_t open_wait
;
103 wait_queue_head_t close_wait
;
105 struct termios normaltermios
;
106 struct termios callouttermios
;
107 struct tq_struct tqueue
;
112 typedef struct stlpanel
{
120 void (*isr
)(struct stlpanel
*panelp
, unsigned int iobase
);
122 unsigned int ackmask
;
123 stlport_t
*ports
[STL_PORTSPERPANEL
];
126 typedef struct stlbrd
{
136 void (*isr
)(struct stlbrd
*brdp
);
137 unsigned int ioaddr1
;
138 unsigned int ioaddr2
;
139 unsigned int iosize1
;
140 unsigned int iosize2
;
141 unsigned int iostatus
;
143 unsigned int ioctrlval
;
146 unsigned int bnkpageaddr
[STL_MAXBANKS
];
147 unsigned int bnkstataddr
[STL_MAXBANKS
];
148 stlpanel_t
*bnk2panel
[STL_MAXBANKS
];
149 stlpanel_t
*panels
[STL_MAXPANELS
];
154 * Define MAGIC numbers used for above structures.
156 #define STL_PORTMAGIC 0x5a7182c9
157 #define STL_PANELMAGIC 0x7ef621a1
158 #define STL_BOARDMAGIC 0xa2267f52
160 /*****************************************************************************/