Lines Matching refs:cs

58 ReadISAC(struct IsdnCardState *cs, u_char offset)  in ReadISAC()  argument
60 return (readreg(cs->hw.avm.isac, offset)); in ReadISAC()
64 WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC() argument
66 writereg(cs->hw.avm.isac, offset, value); in WriteISAC()
70 ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) in ReadISACfifo() argument
72 read_fifo(cs->hw.avm.isacfifo, data, size); in ReadISACfifo()
76 WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) in WriteISACfifo() argument
78 write_fifo(cs->hw.avm.isacfifo, data, size); in WriteISACfifo()
82 ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) in ReadHSCX() argument
84 return (readreg(cs->hw.avm.hscx[hscx], offset)); in ReadHSCX()
88 WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) in WriteHSCX() argument
90 writereg(cs->hw.avm.hscx[hscx], offset, value); in WriteHSCX()
97 #define READHSCX(cs, nr, reg) readreg(cs->hw.avm.hscx[nr], reg) argument
98 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.avm.hscx[nr], reg, data) argument
99 #define READHSCXFIFO(cs, nr, ptr, cnt) read_fifo(cs->hw.avm.hscxfifo[nr], ptr, cnt) argument
100 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) write_fifo(cs->hw.avm.hscxfifo[nr], ptr, cnt) argument
107 struct IsdnCardState *cs = dev_id; in avm_a1_interrupt() local
110 if (!cs) { in avm_a1_interrupt()
114 while (((sval = bytein(cs->hw.avm.cfg_reg)) & 0xf) != 0x7) { in avm_a1_interrupt()
116 byteout(cs->hw.avm.cfg_reg, 0x1E); in avm_a1_interrupt()
117 sval = bytein(cs->hw.avm.cfg_reg); in avm_a1_interrupt()
118 } else if (cs->debug & L1_DEB_INTSTAT) in avm_a1_interrupt()
119 debugl1(cs, "avm IntStatus %x", sval); in avm_a1_interrupt()
121 val = readreg(cs->hw.avm.hscx[1], HSCX_ISTA); in avm_a1_interrupt()
123 hscx_int_main(cs, val); in avm_a1_interrupt()
126 val = readreg(cs->hw.avm.isac, ISAC_ISTA); in avm_a1_interrupt()
128 isac_interrupt(cs, val); in avm_a1_interrupt()
131 writereg(cs->hw.avm.hscx[0], HSCX_MASK, 0xFF); in avm_a1_interrupt()
132 writereg(cs->hw.avm.hscx[1], HSCX_MASK, 0xFF); in avm_a1_interrupt()
133 writereg(cs->hw.avm.isac, ISAC_MASK, 0xFF); in avm_a1_interrupt()
134 writereg(cs->hw.avm.isac, ISAC_MASK, 0x0); in avm_a1_interrupt()
135 writereg(cs->hw.avm.hscx[0], HSCX_MASK, 0x0); in avm_a1_interrupt()
136 writereg(cs->hw.avm.hscx[1], HSCX_MASK, 0x0); in avm_a1_interrupt()
140 release_ioregs(struct IsdnCardState *cs, int mask) in release_ioregs() argument
142 release_region(cs->hw.avm.cfg_reg, 8); in release_ioregs()
144 release_region(cs->hw.avm.isac + 32, 32); in release_ioregs()
146 release_region(cs->hw.avm.isacfifo, 1); in release_ioregs()
148 release_region(cs->hw.avm.hscx[0] + 32, 32); in release_ioregs()
150 release_region(cs->hw.avm.hscxfifo[0], 1); in release_ioregs()
152 release_region(cs->hw.avm.hscx[1] + 32, 32); in release_ioregs()
154 release_region(cs->hw.avm.hscxfifo[1], 1); in release_ioregs()
158 AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) in AVM_card_msg() argument
164 release_ioregs(cs, 0x3f); in AVM_card_msg()
167 inithscxisac(cs, 1); in AVM_card_msg()
168 byteout(cs->hw.avm.cfg_reg, 0x16); in AVM_card_msg()
169 byteout(cs->hw.avm.cfg_reg, 0x1E); in AVM_card_msg()
170 inithscxisac(cs, 2); in AVM_card_msg()
182 struct IsdnCardState *cs = card->cs; in setup_avm_a1() local
188 if (cs->typ != ISDN_CTYPE_A1) in setup_avm_a1()
191 cs->hw.avm.cfg_reg = card->para[1] + 0x1800; in setup_avm_a1()
192 cs->hw.avm.isac = card->para[1] + 0x1400 - 0x20; in setup_avm_a1()
193 cs->hw.avm.hscx[0] = card->para[1] + 0x400 - 0x20; in setup_avm_a1()
194 cs->hw.avm.hscx[1] = card->para[1] + 0xc00 - 0x20; in setup_avm_a1()
195 cs->hw.avm.isacfifo = card->para[1] + 0x1000; in setup_avm_a1()
196 cs->hw.avm.hscxfifo[0] = card->para[1]; in setup_avm_a1()
197 cs->hw.avm.hscxfifo[1] = card->para[1] + 0x800; in setup_avm_a1()
198 cs->irq = card->para[0]; in setup_avm_a1()
199 if (check_region((cs->hw.avm.cfg_reg), 8)) { in setup_avm_a1()
203 cs->hw.avm.cfg_reg, in setup_avm_a1()
204 cs->hw.avm.cfg_reg + 8); in setup_avm_a1()
207 request_region(cs->hw.avm.cfg_reg, 8, "avm cfg"); in setup_avm_a1()
209 if (check_region((cs->hw.avm.isac + 32), 32)) { in setup_avm_a1()
212 CardType[cs->typ], in setup_avm_a1()
213 cs->hw.avm.isac + 32, in setup_avm_a1()
214 cs->hw.avm.isac + 64); in setup_avm_a1()
215 release_ioregs(cs, 0); in setup_avm_a1()
218 request_region(cs->hw.avm.isac + 32, 32, "HiSax isac"); in setup_avm_a1()
220 if (check_region((cs->hw.avm.isacfifo), 1)) { in setup_avm_a1()
223 CardType[cs->typ], in setup_avm_a1()
224 cs->hw.avm.isacfifo); in setup_avm_a1()
225 release_ioregs(cs, 1); in setup_avm_a1()
228 request_region(cs->hw.avm.isacfifo, 1, "HiSax isac fifo"); in setup_avm_a1()
230 if (check_region((cs->hw.avm.hscx[0]) + 32, 32)) { in setup_avm_a1()
233 CardType[cs->typ], in setup_avm_a1()
234 cs->hw.avm.hscx[0] + 32, in setup_avm_a1()
235 cs->hw.avm.hscx[0] + 64); in setup_avm_a1()
236 release_ioregs(cs, 3); in setup_avm_a1()
239 request_region(cs->hw.avm.hscx[0] + 32, 32, "HiSax hscx A"); in setup_avm_a1()
241 if (check_region(cs->hw.avm.hscxfifo[0], 1)) { in setup_avm_a1()
244 CardType[cs->typ], in setup_avm_a1()
245 cs->hw.avm.hscxfifo[0]); in setup_avm_a1()
246 release_ioregs(cs, 7); in setup_avm_a1()
249 request_region(cs->hw.avm.hscxfifo[0], 1, "HiSax hscx A fifo"); in setup_avm_a1()
251 if (check_region(cs->hw.avm.hscx[1] + 32, 32)) { in setup_avm_a1()
254 CardType[cs->typ], in setup_avm_a1()
255 cs->hw.avm.hscx[1] + 32, in setup_avm_a1()
256 cs->hw.avm.hscx[1] + 64); in setup_avm_a1()
257 release_ioregs(cs, 0xf); in setup_avm_a1()
260 request_region(cs->hw.avm.hscx[1] + 32, 32, "HiSax hscx B"); in setup_avm_a1()
262 if (check_region(cs->hw.avm.hscxfifo[1], 1)) { in setup_avm_a1()
265 CardType[cs->typ], in setup_avm_a1()
266 cs->hw.avm.hscxfifo[1]); in setup_avm_a1()
267 release_ioregs(cs, 0x1f); in setup_avm_a1()
270 request_region(cs->hw.avm.hscxfifo[1], 1, "HiSax hscx B fifo"); in setup_avm_a1()
273 byteout(cs->hw.avm.cfg_reg, 0x0); in setup_avm_a1()
276 byteout(cs->hw.avm.cfg_reg, 0x1); in setup_avm_a1()
278 byteout(cs->hw.avm.cfg_reg, 0x0); in setup_avm_a1()
280 val = cs->irq; in setup_avm_a1()
283 byteout(cs->hw.avm.cfg_reg + 1, val); in setup_avm_a1()
285 byteout(cs->hw.avm.cfg_reg, 0x0); in setup_avm_a1()
289 val = bytein(cs->hw.avm.cfg_reg); in setup_avm_a1()
291 cs->hw.avm.cfg_reg, val); in setup_avm_a1()
292 val = bytein(cs->hw.avm.cfg_reg + 3); in setup_avm_a1()
294 cs->hw.avm.cfg_reg + 3, val); in setup_avm_a1()
295 val = bytein(cs->hw.avm.cfg_reg + 2); in setup_avm_a1()
297 cs->hw.avm.cfg_reg + 2, val); in setup_avm_a1()
298 val = bytein(cs->hw.avm.cfg_reg); in setup_avm_a1()
300 cs->hw.avm.cfg_reg, val); in setup_avm_a1()
304 CardType[cs->typ], cs->irq, in setup_avm_a1()
305 cs->hw.avm.cfg_reg); in setup_avm_a1()
308 cs->hw.avm.isac + 32, cs->hw.avm.isacfifo); in setup_avm_a1()
311 cs->hw.avm.hscx[0] + 32, cs->hw.avm.hscxfifo[0], in setup_avm_a1()
312 cs->hw.avm.hscx[1] + 32, cs->hw.avm.hscxfifo[1]); in setup_avm_a1()
314 cs->readisac = &ReadISAC; in setup_avm_a1()
315 cs->writeisac = &WriteISAC; in setup_avm_a1()
316 cs->readisacfifo = &ReadISACfifo; in setup_avm_a1()
317 cs->writeisacfifo = &WriteISACfifo; in setup_avm_a1()
318 cs->BC_Read_Reg = &ReadHSCX; in setup_avm_a1()
319 cs->BC_Write_Reg = &WriteHSCX; in setup_avm_a1()
320 cs->BC_Send_Data = &hscx_fill_fifo; in setup_avm_a1()
321 cs->cardmsg = &AVM_card_msg; in setup_avm_a1()
322 cs->irq_func = &avm_a1_interrupt; in setup_avm_a1()
323 ISACVersion(cs, "AVM A1:"); in setup_avm_a1()
324 if (HscxVersion(cs, "AVM A1:")) { in setup_avm_a1()
327 release_ioregs(cs, 0x3f); in setup_avm_a1()