* better
[mascara-docs.git] / i386 / linux-2.3.21 / drivers / char / sx.h
blobe046482e473028df090c6fbb06c2db8ae9a9a7bb
2 /*
3 * sx.h
5 * Copyright (C) 1998/1999 R.E.Wolff@BitWizard.nl
7 * SX serial driver.
8 * -- Supports SI, XIO and SX host cards.
9 * -- Supports TAs, MTAs and SXDCs.
11 * Version 1.3 -- March, 1999.
15 #define SX_NBOARDS 4
16 #define SX_PORTSPERBOARD 32
17 #define SX_NPORTS (SX_NBOARDS * SX_PORTSPERBOARD)
19 #ifdef __KERNEL__
21 #define SX_MAGIC 0x12345678
23 struct sx_port {
24 struct gs_port gs;
26 struct tq_struct tqueue;
27 struct tq_struct tqueue_hangup;
29 struct wait_queue *shutdown_wait;
30 int ch_base;
31 int c_dcd;
32 struct sx_board *board;
33 int line;
34 int locks;
37 struct sx_board {
38 int magic;
39 unsigned int base;
40 unsigned int hw_base;
41 int port_base; /* Number of the first port */
42 struct sx_port *ports;
43 int nports;
44 int flags;
45 int irq;
46 int poll;
47 int ta_type;
48 struct timer_list timer;
49 int locks;
52 struct vpd_prom {
53 unsigned short id;
54 char hwrev;
55 char hwass;
56 int uniqid;
57 char myear;
58 char mweek;
59 char hw_feature[5];
60 char oem_id;
61 char identifier[16];
64 #ifndef MOD_RS232DB25MALE
65 #define MOD_RS232DB25MALE 0x0a
66 #endif
69 #define SX_BOARD_PRESENT 0x00000001
70 #define SX_ISA_BOARD 0x00000002
71 #define SX_PCI_BOARD 0x00000004
72 #define SI_ISA_BOARD 0x00000008
73 #define SX_BOARD_INITIALIZED 0x00000010
74 #define SX_IRQ_ALLOCATED 0x00000020
76 #define SX_BOARD_TYPE (SX_ISA_BOARD|SX_PCI_BOARD|SI_ISA_BOARD)
78 #define IS_SX_BOARD(board) (board->flags & (SX_PCI_BOARD | SX_ISA_BOARD))
79 #define IS_SI_BOARD(board) (board->flags & SI_ISA_BOARD)
82 #define SERIAL_TYPE_NORMAL 1
84 /* The SI processor clock is required to calculate the cc_int_count register
85 value for the SI cards. */
86 #define SI_PROCESSOR_CLOCK 25000000
89 /* port flags */
90 /* Make sure these don't clash with gs flags or async flags */
91 #define SX_RX_THROTTLE 0x0000001
95 #define SX_PORT_TRANSMIT_LOCK 0
96 #define SX_BOARD_INTR_LOCK 0
100 /* Debug flags. Add these together to get more debug info. */
102 #define SX_DEBUG_OPEN 0x00000001
103 #define SX_DEBUG_SETTING 0x00000002
104 #define SX_DEBUG_FLOW 0x00000004
105 #define SX_DEBUG_MODEMSIGNALS 0x00000008
106 #define SX_DEBUG_TERMIOS 0x00000010
107 #define SX_DEBUG_TRANSMIT 0x00000020
108 #define SX_DEBUG_RECEIVE 0x00000040
109 #define SX_DEBUG_INTERRUPTS 0x00000080
110 #define SX_DEBUG_PROBE 0x00000100
111 #define SX_DEBUG_INIT 0x00000200
112 #define SX_DEBUG_CLEANUP 0x00000400
113 #define SX_DEBUG_CLOSE 0x00000800
114 #define SX_DEBUG_FIRMWARE 0x00001000
115 #define SX_DEBUG_MEMTEST 0x00002000
117 #define SX_DEBUG_ALL 0xffffffff
120 #define O_OTHER(tty) \
121 ((O_OLCUC(tty)) ||\
122 (O_ONLCR(tty)) ||\
123 (O_OCRNL(tty)) ||\
124 (O_ONOCR(tty)) ||\
125 (O_ONLRET(tty)) ||\
126 (O_OFILL(tty)) ||\
127 (O_OFDEL(tty)) ||\
128 (O_NLDLY(tty)) ||\
129 (O_CRDLY(tty)) ||\
130 (O_TABDLY(tty)) ||\
131 (O_BSDLY(tty)) ||\
132 (O_VTDLY(tty)) ||\
133 (O_FFDLY(tty)))
135 /* Same for input. */
136 #define I_OTHER(tty) \
137 ((I_INLCR(tty)) ||\
138 (I_IGNCR(tty)) ||\
139 (I_ICRNL(tty)) ||\
140 (I_IUCLC(tty)) ||\
141 (L_ISIG(tty)))
143 #define MOD_TA ( TA>>4)
144 #define MOD_MTA (MTA_CD1400>>4)
145 #define MOD_SXDC ( SXDC>>4)
148 /* We copy the download code over to the card in chunks of ... bytes */
149 #define SX_CHUNK_SIZE 128
151 #endif /* __KERNEL__ */
155 /* Specialix document 6210046-11 page 3 */
156 #define SPX(X) (('S'<<24) | ('P' << 16) | (X))
158 /* Specialix-Linux specific IOCTLS. */
159 #define SPXL(X) (SPX(('L' << 8) | (X)))
162 #define SXIO_SET_BOARD SPXL(0x01)
163 #define SXIO_GET_TYPE SPXL(0x02)
164 #define SXIO_DOWNLOAD SPXL(0x03)
165 #define SXIO_INIT SPXL(0x04)
166 #define SXIO_SETDEBUG SPXL(0x05)
167 #define SXIO_GETDEBUG SPXL(0x06)
168 #define SXIO_DO_RAMTEST SPXL(0x07)
169 #define SXIO_SETGSDEBUG SPXL(0x08)
170 #define SXIO_GETGSDEBUG SPXL(0x09)
173 #ifndef SXCTL_MISC_MINOR
174 /* Allow others to gather this into "major.h" or something like that */
175 #define SXCTL_MISC_MINOR 167
176 #endif
178 #define SX_TYPE_SX 0x01
179 #define SX_TYPE_SI 0x02