1 /*****************************************************************************/ 2
3 /* 4 * istallion.h -- stallion intelligent multiport serial driver. 5 * 6 * Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 */ 22
23 /*****************************************************************************/ 24 #ifndef_ISTALLION_H 25 #define_ISTALLION_H 26 /*****************************************************************************/ 27
28 /* 29 * Define important driver constants here. 30 */ 31 #defineSTL_MAXBRDS 4
32 #defineSTL_MAXPANELS 4
33 #defineSTL_MAXPORTS 64
34 #defineSTL_MAXCHANS (STL_MAXPORTS + 1)
35 #defineSTL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
36
37
38 /* 39 * Define a set of structures to hold all the board/panel/port info 40 * for our ports. These will be dynamically allocated as required at 41 * driver initialization time. 42 */ 43
44 /* 45 * Port and board structures to hold status info about each object. 46 * The board structure contains pointers to structures for each port 47 * connected to it. Panels are not distinguished here, since 48 * communication with the slave board will always be on a per port 49 * basis. 50 */ 51 typedefstruct{ 52 unsignedlongmagic;
53 intportnr;
54 intpanelnr;
55 intbrdnr;
56 unsignedlongstate;
57 intdevnr;
58 intflags;
59 intbaud_base;
60 intcustom_divisor;
61 intclose_delay;
62 intclosing_wait;
63 intrefcount;
64 intopenwaitcnt;
65 intrc;
66 intargsize;
67 void *argp;
68 longsession;
69 longpgrp;
70 unsignedintrxmarkmsk;
71 structtty_struct *tty;
72 structwait_queue *open_wait;
73 structwait_queue *close_wait;
74 structwait_queue *raw_wait;
75 structtq_structtqhangup;
76 structtermiosnormaltermios;
77 structtermioscallouttermios;
78 asysigs_tasig;
79 unsignedlongaddr;
80 unsignedlongrxoffset;
81 unsignedlongtxoffset;
82 unsignedlongsigs;
83 unsignedlongpflag;
84 unsignedintrxsize;
85 unsignedinttxsize;
86 unsignedcharreqbit;
87 unsignedcharportidx;
88 unsignedcharportbit;
89 }stliport_t;
90
91 /* 92 * Use a structure of function pointers to do board level operations. 93 * These include, enable/disable, paging shared memory, interrupting, etc. 94 */ 95 typedefstructstlibrd{ 96 unsignedlongmagic;
97 intbrdnr;
98 intbrdtype;
99 intstate;
100 intnrpanels;
101 intnrports;
102 intnrdevs;
103 unsignedintiobase;
104 unsignedlongmemaddr;
105 void *membase;
106 intmemsize;
107 intpagesize;
108 inthostoffset;
109 intslaveoffset;
110 intbitsize;
111 intenabval;
112 intpanels[STL_MAXPANELS];
113 intpanelids[STL_MAXPANELS];
114 void (*init)(structstlibrd *brdp);
115 void (*enable)(structstlibrd *brdp);
116 void (*reenable)(structstlibrd *brdp);
117 void (*disable)(structstlibrd *brdp);
118 char *(*getmemptr)(structstlibrd *brdp, unsignedlongoffset, intline);
119 void (*intr)(structstlibrd *brdp);
120 void (*reset)(structstlibrd *brdp);
121 stliport_t *ports[STL_MAXPORTS];
122 }stlibrd_t;
123
124
125 /* 126 * Define MAGIC numbers used for above structures. 127 */ 128 #defineSTLI_PORTMAGIC 0xe671c7a1
129 #defineSTLI_BOARDMAGIC 0x4bc6c825
130
131 /*****************************************************************************/ 132 #endif