8e72597f2b741a0bebcaffa5973f53ab1b65f83b
[linux-flexiantxendom0-3.2.10.git] / include / linux / istallion.h
1 /*****************************************************************************/
2
3 /*
4  *      istallion.h  -- stallion intelligent multiport serial driver.
5  *
6  *      Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
7  *      Copyright (C) 1994-1996  Greg Ungerer.
8  *
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.
13  *
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.
18  *
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.
22  */
23
24 #include <linux/version.h>
25
26 /*****************************************************************************/
27 #ifndef _ISTALLION_H
28 #define _ISTALLION_H
29 /*****************************************************************************/
30
31 /*
32  *      Define important driver constants here.
33  */
34 #define STL_MAXBRDS             4
35 #define STL_MAXPANELS           4
36 #define STL_MAXPORTS            64
37 #define STL_MAXCHANS            (STL_MAXPORTS + 1)
38 #define STL_MAXDEVS             (STL_MAXBRDS * STL_MAXPORTS)
39
40
41 /*
42  *      Define a set of structures to hold all the board/panel/port info
43  *      for our ports. These will be dynamically allocated as required at
44  *      driver initialization time.
45  */
46
47 /*
48  *      Port and board structures to hold status info about each object.
49  *      The board structure contains pointers to structures for each port
50  *      connected to it. Panels are not distinguished here, since
51  *      communication with the slave board will always be on a per port
52  *      basis.
53  */
54 typedef struct {
55         unsigned long           magic;
56         int                     portnr;
57         int                     panelnr;
58         int                     brdnr;
59         unsigned long           state;
60         int                     devnr;
61         int                     flags;
62         int                     baud_base;
63         int                     custom_divisor;
64         int                     close_delay;
65         int                     closing_wait;
66         int                     refcount;
67         int                     openwaitcnt;
68         int                     rc;
69         int                     argsize;
70         void                    *argp;
71         unsigned int            rxmarkmsk;
72         struct tty_struct       *tty;
73 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
74         struct wait_queue       *open_wait;
75         struct wait_queue       *close_wait;
76         struct wait_queue       *raw_wait;
77 #else
78         wait_queue_head_t       open_wait;
79         wait_queue_head_t       close_wait;
80         wait_queue_head_t       raw_wait;
81 #endif
82         struct work_struct      tqhangup;
83         asysigs_t               asig;
84         unsigned long           addr;
85         unsigned long           rxoffset;
86         unsigned long           txoffset;
87         unsigned long           sigs;
88         unsigned long           pflag;
89         unsigned int            rxsize;
90         unsigned int            txsize;
91         unsigned char           reqbit;
92         unsigned char           portidx;
93         unsigned char           portbit;
94 } stliport_t;
95
96 /*
97  *      Use a structure of function pointers to do board level operations.
98  *      These include, enable/disable, paging shared memory, interrupting, etc.
99  */
100 typedef struct stlibrd {
101         unsigned long   magic;
102         int             brdnr;
103         int             brdtype;
104         int             state;
105         int             nrpanels;
106         int             nrports;
107         int             nrdevs;
108         unsigned int    iobase;
109         int             iosize;
110         unsigned long   memaddr;
111         void            *membase;
112         int             memsize;
113         int             pagesize;
114         int             hostoffset;
115         int             slaveoffset;
116         int             bitsize;
117         int             enabval;
118         int             panels[STL_MAXPANELS];
119         int             panelids[STL_MAXPANELS];
120         void            (*init)(struct stlibrd *brdp);
121         void            (*enable)(struct stlibrd *brdp);
122         void            (*reenable)(struct stlibrd *brdp);
123         void            (*disable)(struct stlibrd *brdp);
124         char            *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
125         void            (*intr)(struct stlibrd *brdp);
126         void            (*reset)(struct stlibrd *brdp);
127         stliport_t      *ports[STL_MAXPORTS];
128 } stlibrd_t;
129
130
131 /*
132  *      Define MAGIC numbers used for above structures.
133  */
134 #define STLI_PORTMAGIC  0xe671c7a1
135 #define STLI_BOARDMAGIC 0x4bc6c825
136
137 /*****************************************************************************/
138 #endif