5 * Copyright (C) 1998/1999 R.E.Wolff@BitWizard.nl
8 * -- Supports SI, XIO and SX host cards.
9 * -- Supports TAs, MTAs and SXDCs.
11 * Version 1.3 -- March, 1999.
16 #define SX_PORTSPERBOARD 32
17 #define SX_NPORTS (SX_NBOARDS * SX_PORTSPERBOARD)
21 #define SX_MAGIC 0x12345678
25 struct wait_queue *shutdown_wait;
28 struct sx_board *board;
37 unsigned long hw_base;
38 resource_size_t hw_len;
40 int port_base; /* Number of the first port */
41 struct sx_port *ports;
47 struct timer_list timer;
63 #ifndef MOD_RS232DB25MALE
64 #define MOD_RS232DB25MALE 0x0a
67 #define SI_ISA_BOARD 0x00000001
68 #define SX_ISA_BOARD 0x00000002
69 #define SX_PCI_BOARD 0x00000004
70 #define SX_CFPCI_BOARD 0x00000008
71 #define SX_CFISA_BOARD 0x00000010
72 #define SI_EISA_BOARD 0x00000020
73 #define SI1_ISA_BOARD 0x00000040
75 #define SX_BOARD_PRESENT 0x00001000
76 #define SX_BOARD_INITIALIZED 0x00002000
77 #define SX_IRQ_ALLOCATED 0x00004000
79 #define SX_BOARD_TYPE 0x000000ff
81 #define IS_SX_BOARD(board) (board->flags & (SX_PCI_BOARD | SX_CFPCI_BOARD | \
82 SX_ISA_BOARD | SX_CFISA_BOARD))
84 #define IS_SI_BOARD(board) (board->flags & SI_ISA_BOARD)
85 #define IS_SI1_BOARD(board) (board->flags & SI1_ISA_BOARD)
87 #define IS_EISA_BOARD(board) (board->flags & SI_EISA_BOARD)
89 #define IS_CF_BOARD(board) (board->flags & (SX_CFISA_BOARD | SX_CFPCI_BOARD))
91 #define SERIAL_TYPE_NORMAL 1
93 /* The SI processor clock is required to calculate the cc_int_count register
94 value for the SI cards. */
95 #define SI_PROCESSOR_CLOCK 25000000
99 /* Make sure these don't clash with gs flags or async flags */
100 #define SX_RX_THROTTLE 0x0000001
104 #define SX_PORT_TRANSMIT_LOCK 0
105 #define SX_BOARD_INTR_LOCK 0
109 /* Debug flags. Add these together to get more debug info. */
111 #define SX_DEBUG_OPEN 0x00000001
112 #define SX_DEBUG_SETTING 0x00000002
113 #define SX_DEBUG_FLOW 0x00000004
114 #define SX_DEBUG_MODEMSIGNALS 0x00000008
115 #define SX_DEBUG_TERMIOS 0x00000010
116 #define SX_DEBUG_TRANSMIT 0x00000020
117 #define SX_DEBUG_RECEIVE 0x00000040
118 #define SX_DEBUG_INTERRUPTS 0x00000080
119 #define SX_DEBUG_PROBE 0x00000100
120 #define SX_DEBUG_INIT 0x00000200
121 #define SX_DEBUG_CLEANUP 0x00000400
122 #define SX_DEBUG_CLOSE 0x00000800
123 #define SX_DEBUG_FIRMWARE 0x00001000
124 #define SX_DEBUG_MEMTEST 0x00002000
126 #define SX_DEBUG_ALL 0xffffffff
129 #define O_OTHER(tty) \
144 /* Same for input. */
145 #define I_OTHER(tty) \
152 #define MOD_TA ( TA>>4)
153 #define MOD_MTA (MTA_CD1400>>4)
154 #define MOD_SXDC ( SXDC>>4)
157 /* We copy the download code over to the card in chunks of ... bytes */
158 #define SX_CHUNK_SIZE 128
160 #endif /* __KERNEL__ */
164 /* Specialix document 6210046-11 page 3 */
165 #define SPX(X) (('S'<<24) | ('P' << 16) | (X))
167 /* Specialix-Linux specific IOCTLS. */
168 #define SPXL(X) (SPX(('L' << 8) | (X)))
171 #define SXIO_SET_BOARD SPXL(0x01)
172 #define SXIO_GET_TYPE SPXL(0x02)
173 #define SXIO_DOWNLOAD SPXL(0x03)
174 #define SXIO_INIT SPXL(0x04)
175 #define SXIO_SETDEBUG SPXL(0x05)
176 #define SXIO_GETDEBUG SPXL(0x06)
177 #define SXIO_DO_RAMTEST SPXL(0x07)
178 #define SXIO_SETGSDEBUG SPXL(0x08)
179 #define SXIO_GETGSDEBUG SPXL(0x09)
180 #define SXIO_GETNPORTS SPXL(0x0a)
183 #ifndef SXCTL_MISC_MINOR
184 /* Allow others to gather this into "major.h" or something like that */
185 #define SXCTL_MISC_MINOR 167
188 #ifndef SX_NORMAL_MAJOR
189 /* This allows overriding on the compiler commandline, or in a "major.h"
190 include or something like that */
191 #define SX_NORMAL_MAJOR 32
192 #define SX_CALLOUT_MAJOR 33
196 #define SX_TYPE_SX 0x01
197 #define SX_TYPE_SI 0x02
198 #define SX_TYPE_CF 0x03
201 #define WINDOW_LEN(board) (IS_CF_BOARD(board)?0x20000:SX_WINDOW_LEN)
202 /* Need a #define for ^^^^^^^ !!! */