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