1/*******************************************************************************
2*
3*   (c) 1998 by Computone Corporation
4*
5********************************************************************************
6*
7*
8*   PACKAGE:     Linux tty Device Driver for IntelliPort II family of multiport
9*                serial I/O controllers.
10*
11*   DESCRIPTION: Driver constants for configuration and tuning
12*
13*   NOTES:
14*
15*******************************************************************************/
16#ifndef IP2_H
17#define IP2_H
18
19#include "ip2types.h"
20#include "i2cmd.h"
21
22/*************/
23/* Constants */
24/*************/
25
26/* Device major numbers
27 * The first set are the major numbers allocated from the Linux Device Registry.
28 * This was expanded from 64 to 128 with version 2.0.26. If this code is built
29 * under earlier versions we use majors from the LOCAL/EXPERIMENTAL range.
30 */
31#if MAX_CHRDEV > 64
32#	define IP2_TTY_MAJOR      71
33#	define IP2_CALLOUT_MAJOR  72
34#	define IP2_IPL_MAJOR      73
35#else
36#	define IP2_TTY_MAJOR      60
37#	define IP2_CALLOUT_MAJOR  61
38#	define IP2_IPL_MAJOR      62
39#endif
40
41
42/* Board configuration array.
43 * This array defines the hardware irq and address for up to IP2_MAX_BOARDS
44 * (4 supported per ip2_types.h) ISA board addresses and irqs MUST be specified,
45 * PCI and EISA boards are probed for and automagicly configed
46 * iff the addresses are set to 1 and 2 respectivily.
47 *    0x0100 - 0x03f0 == ISA
48 *	         1        == PCI
49 *	         2        == EISA
50 *	         0        == (skip this board)
51 * This array defines the hardware addresses for them. Special
52 * addresses are EISA and PCI which go sniffing for boards.
53
54 * In a multiboard system the position in the array determines which port
55 * devices are assigned to each board:
56 *		board 0 is assigned ttyF0.. to ttyF63,
57 *		board 1 is assigned ttyF64  to ttyF127,
58 *		board 2 is assigned ttyF128 to ttyF191,
59 *		board 3 is assigned ttyF192 to ttyF255.
60 *
61 * In PCI and EISA bus systems each range is mapped to card in
62 * monotonically increasing slot number order, ISA position is as specified
63 * here.
64
65 * If the irqs are ALL set to 0,0,0,0 all boards operate in
66 * polled mode. For interrupt operation ISA boards require that the IRQ be
67 * specified, while PCI and EISA boards any nonzero entry
68 * will enable interrupts using the BIOS configured irq for the board.
69 * An invalid irq entry will default to polled mode for that card and print
70 * console warning.
71
72 * When the driver is loaded as a module these setting can be overridden on the
73 * modprobe command line or on an option line in /etc/modules.conf.
74 * If the driver is built-in the configuration must be
75 * set here for ISA cards and address set to 1 and 2 for PCI and EISA.
76 *
77 * Here is an example that shows most if not all possibe combinations:
78
79 *static ip2config_t ip2config =
80 *{
81 *	{11,1,0,0},		// irqs
82 *	{				// Addresses
83 *		0x0308,		// Board 0, ttyF0   - ttyF63// ISA card at io=0x308, irq=11
84 *		0x0001,		// Board 1, ttyF64  - ttyF127//PCI card configured by BIOS
85 *		0x0000,		// Board 2, ttyF128 - ttyF191// Slot skipped
86 *		0x0002		// Board 3, ttyF192 - ttyF255//EISA card configured by BIOS
87 *												 // but polled not irq driven
88 *	}
89 *};
90 */
91
92 /* this structure is zeroed out because the suggested method is to configure
93  * the driver as a module, set up the parameters with an options line in
94  * /etc/modules.conf and load with modprobe, kerneld or kmod, the kernel
95  * module loader
96  */
97
98 /* This structure is NOW always initialized when the driver is initialized.
99  * Compiled in defaults MUST be added to the io and irq arrays in
100  * ip2.c.  Those values are configurable from insmod parameters in the
101  * case of modules or from command line parameters (ip2=io,irq) when
102  * compiled in.
103  */
104
105static ip2config_t ip2config =
106{
107	{0,0,0,0},		// irqs
108	{				// Addresses
109	/* Do NOT set compile time defaults HERE!  Use the arrays in
110		ip2.c!  These WILL be overwritten!  =mhw= */
111		0x0000,		// Board 0, ttyF0   - ttyF63
112		0x0000,		// Board 1, ttyF64  - ttyF127
113		0x0000,		// Board 2, ttyF128 - ttyF191
114		0x0000		// Board 3, ttyF192 - ttyF255
115	}
116};
117
118#endif
119