1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef _LINUX_CYCLADES_H
17 #define _LINUX_CYCLADES_H
18
19 struct cyclades_monitor {
20 unsigned long int_count;
21 unsigned long char_count;
22 unsigned long char_max;
23 unsigned long char_last;
24 };
25
26 #define CYCLADES_MAGIC 0x4359
27
28 #define CYGETMON 0x435901
29 #define CYGETTHRESH 0x435902
30 #define CYSETTHRESH 0x435903
31 #define CYGETDEFTHRESH 0x435904
32 #define CYSETDEFTHRESH 0x435905
33 #define CYGETTIMEOUT 0x435906
34 #define CYSETTIMEOUT 0x435907
35 #define CYGETDEFTIMEOUT 0x435908
36 #define CYSETDEFTIMEOUT 0x435909
37
38 #ifdef __KERNEL__
39
40
41
42 struct cyclades_card {
43 int base_addr;
44 int irq;
45 int num_chips;
46 int first_line;
47 int bus_index;
48 };
49
50 struct cyclades_chip {
51 int filler;
52 };
53
54
55
56
57
58
59
60
61
62
63 struct cyclades_port {
64 int magic;
65 int type;
66 int card;
67 int line;
68 int flags;
69 struct tty_struct *tty;
70 int read_status_mask;
71 int timeout;
72 int xmit_fifo_size;
73 int cor1,cor2,cor3,cor4,cor5;
74 int tbpr,tco,rbpr,rco;
75 int ignore_status_mask;
76 int close_delay;
77 int IER;
78 int event;
79 unsigned long last_active;
80 int count;
81 int x_char;
82 int x_break;
83 int blocked_open;
84 long session;
85 long pgrp;
86 unsigned char *xmit_buf;
87 int xmit_head;
88 int xmit_tail;
89 int xmit_cnt;
90 int default_threshold;
91 int default_timeout;
92 struct tq_struct tqueue;
93 struct termios normal_termios;
94 struct termios callout_termios;
95 struct wait_queue *open_wait;
96 struct wait_queue *close_wait;
97 struct cyclades_monitor mon;
98 };
99
100
101
102
103
104 #define Cy_EVENT_READ_PROCESS 0
105 #define Cy_EVENT_WRITE_WAKEUP 1
106 #define Cy_EVENT_HANGUP 2
107 #define Cy_EVENT_BREAK 3
108 #define Cy_EVENT_OPEN_WAKEUP 4
109
110
111
112 #define CyMaxChipsPerCard 8
113
114
115
116 #define CyRegSize 0x0400
117 #define Cy_HwReset 0x1400
118 #define Cy_ClrIntr 0x1800
119 #define Cy_EpldRev 0x1e00
120
121
122
123 #define CyGFRCR (0x40*2)
124 #define CyRevE (44)
125 #define CyCAR (0x68*2)
126 #define CyCHAN_0 (0x00)
127 #define CyCHAN_1 (0x01)
128 #define CyCHAN_2 (0x02)
129 #define CyCHAN_3 (0x03)
130 #define CyGCR (0x4B*2)
131 #define CyCH0_SERIAL (0x00)
132 #define CyCH0_PARALLEL (0x80)
133 #define CySVRR (0x67*2)
134 #define CySRModem (0x04)
135 #define CySRTransmit (0x02)
136 #define CySRReceive (0x01)
137 #define CyRICR (0x44*2)
138 #define CyTICR (0x45*2)
139 #define CyMICR (0x46*2)
140 #define CyICR0 (0x00)
141 #define CyICR1 (0x01)
142 #define CyICR2 (0x02)
143 #define CyICR3 (0x03)
144 #define CyRIR (0x6B*2)
145 #define CyTIR (0x6A*2)
146 #define CyMIR (0x69*2)
147 #define CyIRDirEq (0x80)
148 #define CyIRBusy (0x40)
149 #define CyIRUnfair (0x20)
150 #define CyIRContext (0x1C)
151 #define CyIRChannel (0x03)
152 #define CyPPR (0x7E*2)
153 #define CyCLOCK_20_1MS (0x27)
154 #define CyCLOCK_25_1MS (0x31)
155
156
157
158 #define CyRIVR (0x43*2)
159 #define CyTIVR (0x42*2)
160 #define CyMIVR (0x41*2)
161 #define CyIVRMask (0x07)
162 #define CyIVRRxEx (0x07)
163 #define CyIVRRxOK (0x03)
164 #define CyIVRTxOK (0x02)
165 #define CyIVRMdmOK (0x01)
166 #define CyTDR (0x63*2)
167 #define CyRDSR (0x62*2)
168 #define CyTIMEOUT (0x80)
169 #define CySPECHAR (0x70)
170 #define CyBREAK (0x08)
171 #define CyPARITY (0x04)
172 #define CyFRAME (0x02)
173 #define CyOVERRUN (0x01)
174 #define CyMISR (0x4C*2)
175
176 #define CyEOSRR (0x60*2)
177
178
179
180 #define CyLIVR (0x18*2)
181 #define CyMscsr (0x01)
182 #define CyTdsr (0x02)
183 #define CyRgdsr (0x03)
184 #define CyRedsr (0x07)
185 #define CyCCR (0x05*2)
186
187 #define CyCHAN_RESET (0x80)
188 #define CyCHIP_RESET (0x81)
189 #define CyFlushTransFIFO (0x82)
190
191 #define CyCOR_CHANGE (0x40)
192 #define CyCOR1ch (0x02)
193 #define CyCOR2ch (0x04)
194 #define CyCOR3ch (0x08)
195
196 #define CySEND_SPEC_1 (0x21)
197 #define CySEND_SPEC_2 (0x22)
198 #define CySEND_SPEC_3 (0x23)
199 #define CySEND_SPEC_4 (0x24)
200
201 #define CyCHAN_CTL (0x10)
202 #define CyDIS_RCVR (0x01)
203 #define CyENB_RCVR (0x02)
204 #define CyDIS_XMTR (0x04)
205 #define CyENB_XMTR (0x08)
206 #define CySRER (0x06*2)
207 #define CyMdmCh (0x80)
208 #define CyRxData (0x10)
209 #define CyTxRdy (0x04)
210 #define CyTxMpty (0x02)
211 #define CyNNDT (0x01)
212 #define CyCOR1 (0x08*2)
213 #define CyPARITY_NONE (0x00)
214 #define CyPARITY_0 (0x20)
215 #define CyPARITY_1 (0xA0)
216 #define CyPARITY_E (0x40)
217 #define CyPARITY_O (0xC0)
218 #define Cy_1_STOP (0x00)
219 #define Cy_1_5_STOP (0x04)
220 #define Cy_2_STOP (0x08)
221 #define Cy_5_BITS (0x00)
222 #define Cy_6_BITS (0x01)
223 #define Cy_7_BITS (0x02)
224 #define Cy_8_BITS (0x03)
225 #define CyCOR2 (0x09*2)
226 #define CyIXM (0x80)
227 #define CyTxIBE (0x40)
228 #define CyETC (0x20)
229 #define CyAUTO_TXFL (0x60)
230 #define CyLLM (0x10)
231 #define CyRLM (0x08)
232 #define CyRtsAO (0x04)
233 #define CyCtsAE (0x02)
234 #define CyDsrAE (0x01)
235 #define CyCOR3 (0x0A*2)
236 #define CySPL_CH_DRANGE (0x80)
237 #define CySPL_CH_DET1 (0x40)
238
239 #define CyFL_CTRL_TRNSP (0x20)
240 #define CySPL_CH_DET2 (0x10)
241
242 #define CyREC_FIFO (0x0F)
243 #define CyCOR4 (0x1E*2)
244 #define CyCOR5 (0x1F*2)
245 #define CyCCSR (0x0B*2)
246 #define CyRxEN (0x80)
247 #define CyRxFloff (0x40)
248 #define CyRxFlon (0x20)
249 #define CyTxEN (0x08)
250 #define CyTxFloff (0x04)
251 #define CyTxFlon (0x02)
252 #define CyRDCR (0x0E*2)
253 #define CySCHR1 (0x1A*2)
254 #define CySCHR2 (0x1B*2)
255 #define CySCHR3 (0x1C*2)
256 #define CySCHR4 (0x1D*2)
257 #define CySCRL (0x22*2)
258 #define CySCRH (0x23*2)
259 #define CyLNC (0x24*2)
260 #define CyMCOR1 (0x15*2)
261 #define CyMCOR2 (0x16*2)
262 #define CyRTPR (0x21*2)
263 #define CyMSVR1 (0x6C*2)
264 #define CyMSVR2 (0x6D*2)
265 #define CyDSR (0x80)
266 #define CyCTS (0x40)
267 #define CyRI (0x20)
268 #define CyDCD (0x10)
269 #define CyDTR (0x02)
270 #define CyRTS (0x01)
271 #define CyPVSR (0x6F*2)
272 #define CyRBPR (0x78*2)
273 #define CyRCOR (0x7C*2)
274 #define CyTBPR (0x72*2)
275 #define CyTCOR (0x76*2)
276
277
278
279 #define CyMAX_CHAR_FIFO 12
280
281
282
283 #endif
284 #endif