| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /*****************************************************************************/ | 
|  | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | /*****************************************************************************/ | 
|  | 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 Slaby | 1f8ec43 | 2006-12-08 02:39:18 -0800 | [diff] [blame] | 52 | struct stliport { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | unsigned long		magic; | 
| Alan Cox | b02f5ad | 2008-07-16 21:55:53 +0100 | [diff] [blame] | 54 | struct tty_port		port; | 
| Jiri Slaby | 1328d73 | 2006-12-08 02:39:19 -0800 | [diff] [blame] | 55 | unsigned int		portnr; | 
|  | 56 | unsigned int		panelnr; | 
|  | 57 | unsigned int		brdnr; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | unsigned long		state; | 
| Jiri Slaby | 1328d73 | 2006-12-08 02:39:19 -0800 | [diff] [blame] | 59 | unsigned int		devnr; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | int			baud_base; | 
|  | 61 | int			custom_divisor; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | int			closing_wait; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | int			rc; | 
|  | 64 | int			argsize; | 
|  | 65 | void			*argp; | 
|  | 66 | unsigned int		rxmarkmsk; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | wait_queue_head_t	raw_wait; | 
| Jiri Slaby | 1f8ec43 | 2006-12-08 02:39:18 -0800 | [diff] [blame] | 68 | struct asysigs		asig; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | unsigned long		addr; | 
|  | 70 | unsigned long		rxoffset; | 
|  | 71 | unsigned long		txoffset; | 
|  | 72 | unsigned long		sigs; | 
|  | 73 | unsigned long		pflag; | 
|  | 74 | unsigned int		rxsize; | 
|  | 75 | unsigned int		txsize; | 
|  | 76 | unsigned char		reqbit; | 
|  | 77 | unsigned char		portidx; | 
|  | 78 | unsigned char		portbit; | 
| Jiri Slaby | 1f8ec43 | 2006-12-08 02:39:18 -0800 | [diff] [blame] | 79 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 |  | 
|  | 81 | /* | 
|  | 82 | *	Use a structure of function pointers to do board level operations. | 
|  | 83 | *	These include, enable/disable, paging shared memory, interrupting, etc. | 
|  | 84 | */ | 
| Jiri Slaby | 1f8ec43 | 2006-12-08 02:39:18 -0800 | [diff] [blame] | 85 | struct stlibrd { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | unsigned long	magic; | 
| Jiri Slaby | 1328d73 | 2006-12-08 02:39:19 -0800 | [diff] [blame] | 87 | unsigned int	brdnr; | 
|  | 88 | unsigned int	brdtype; | 
| Alan Cox | 8a1e803 | 2010-06-01 22:52:42 +0200 | [diff] [blame] | 89 | unsigned long	state; | 
| Jiri Slaby | 1328d73 | 2006-12-08 02:39:19 -0800 | [diff] [blame] | 90 | unsigned int	nrpanels; | 
|  | 91 | unsigned int	nrports; | 
|  | 92 | unsigned int	nrdevs; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | unsigned int	iobase; | 
|  | 94 | int		iosize; | 
|  | 95 | unsigned long	memaddr; | 
| Al Viro | 29756fa | 2006-10-10 22:47:27 +0100 | [diff] [blame] | 96 | void		__iomem *membase; | 
| Jiri Slaby | 1328d73 | 2006-12-08 02:39:19 -0800 | [diff] [blame] | 97 | unsigned long	memsize; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | int		pagesize; | 
|  | 99 | int		hostoffset; | 
|  | 100 | int		slaveoffset; | 
|  | 101 | int		bitsize; | 
|  | 102 | int		enabval; | 
| Jiri Slaby | 1328d73 | 2006-12-08 02:39:19 -0800 | [diff] [blame] | 103 | unsigned int	panels[STL_MAXPANELS]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | int		panelids[STL_MAXPANELS]; | 
|  | 105 | void		(*init)(struct stlibrd *brdp); | 
|  | 106 | void		(*enable)(struct stlibrd *brdp); | 
|  | 107 | void		(*reenable)(struct stlibrd *brdp); | 
|  | 108 | void		(*disable)(struct stlibrd *brdp); | 
| Al Viro | 29756fa | 2006-10-10 22:47:27 +0100 | [diff] [blame] | 109 | void		__iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | void		(*intr)(struct stlibrd *brdp); | 
|  | 111 | void		(*reset)(struct stlibrd *brdp); | 
| Jiri Slaby | 1f8ec43 | 2006-12-08 02:39:18 -0800 | [diff] [blame] | 112 | struct stliport	*ports[STL_MAXPORTS]; | 
|  | 113 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 |  | 
|  | 115 |  | 
|  | 116 | /* | 
|  | 117 | *	Define MAGIC numbers used for above structures. | 
|  | 118 | */ | 
|  | 119 | #define	STLI_PORTMAGIC	0xe671c7a1 | 
|  | 120 | #define	STLI_BOARDMAGIC	0x4bc6c825 | 
|  | 121 |  | 
|  | 122 | /*****************************************************************************/ | 
|  | 123 | #endif |