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