blob: 5a84fe944b745ba8c27cd81046abb9e622ac148f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*****************************************************************************/
2
3/*
4 * istallion.h -- stallion intelligent multiport serial driver.
5 *
6 * Copyright (C) 1996-1998 Stallion Technologies
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070024/*****************************************************************************/
25#ifndef _ISTALLION_H
26#define _ISTALLION_H
27/*****************************************************************************/
28
29/*
30 * Define important driver constants here.
31 */
32#define STL_MAXBRDS 4
33#define STL_MAXPANELS 4
34#define STL_MAXPORTS 64
35#define STL_MAXCHANS (STL_MAXPORTS + 1)
36#define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS)
37
38
39/*
40 * Define a set of structures to hold all the board/panel/port info
41 * for our ports. These will be dynamically allocated as required at
42 * driver initialization time.
43 */
44
45/*
46 * Port and board structures to hold status info about each object.
47 * The board structure contains pointers to structures for each port
48 * connected to it. Panels are not distinguished here, since
49 * communication with the slave board will always be on a per port
50 * basis.
51 */
Jiri Slaby1f8ec432006-12-08 02:39:18 -080052struct stliport {
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 unsigned long magic;
Jiri Slaby1328d732006-12-08 02:39:19 -080054 unsigned int portnr;
55 unsigned int panelnr;
56 unsigned int brdnr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 unsigned long state;
Jiri Slaby1328d732006-12-08 02:39:19 -080058 unsigned int devnr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 int flags;
60 int baud_base;
61 int custom_divisor;
62 int close_delay;
63 int closing_wait;
64 int refcount;
65 int openwaitcnt;
66 int rc;
67 int argsize;
68 void *argp;
69 unsigned int rxmarkmsk;
70 struct tty_struct *tty;
71 wait_queue_head_t open_wait;
72 wait_queue_head_t close_wait;
73 wait_queue_head_t raw_wait;
Jiri Slaby1f8ec432006-12-08 02:39:18 -080074 struct asysigs asig;
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 unsigned long addr;
76 unsigned long rxoffset;
77 unsigned long txoffset;
78 unsigned long sigs;
79 unsigned long pflag;
80 unsigned int rxsize;
81 unsigned int txsize;
82 unsigned char reqbit;
83 unsigned char portidx;
84 unsigned char portbit;
Jiri Slaby1f8ec432006-12-08 02:39:18 -080085};
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
87/*
88 * Use a structure of function pointers to do board level operations.
89 * These include, enable/disable, paging shared memory, interrupting, etc.
90 */
Jiri Slaby1f8ec432006-12-08 02:39:18 -080091struct stlibrd {
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 unsigned long magic;
Jiri Slaby1328d732006-12-08 02:39:19 -080093 unsigned int brdnr;
94 unsigned int brdtype;
95 unsigned int state;
96 unsigned int nrpanels;
97 unsigned int nrports;
98 unsigned int nrdevs;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 unsigned int iobase;
100 int iosize;
101 unsigned long memaddr;
Al Viro29756fa2006-10-10 22:47:27 +0100102 void __iomem *membase;
Jiri Slaby1328d732006-12-08 02:39:19 -0800103 unsigned long memsize;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 int pagesize;
105 int hostoffset;
106 int slaveoffset;
107 int bitsize;
108 int enabval;
Jiri Slaby1328d732006-12-08 02:39:19 -0800109 unsigned int panels[STL_MAXPANELS];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 int panelids[STL_MAXPANELS];
111 void (*init)(struct stlibrd *brdp);
112 void (*enable)(struct stlibrd *brdp);
113 void (*reenable)(struct stlibrd *brdp);
114 void (*disable)(struct stlibrd *brdp);
Al Viro29756fa2006-10-10 22:47:27 +0100115 void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 void (*intr)(struct stlibrd *brdp);
117 void (*reset)(struct stlibrd *brdp);
Jiri Slaby1f8ec432006-12-08 02:39:18 -0800118 struct stliport *ports[STL_MAXPORTS];
119};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121
122/*
123 * Define MAGIC numbers used for above structures.
124 */
125#define STLI_PORTMAGIC 0xe671c7a1
126#define STLI_BOARDMAGIC 0x4bc6c825
127
128/*****************************************************************************/
129#endif