Lines Matching refs:cs
82 ReadISAC(struct IsdnCardState *cs, u_char offset) in ReadISAC() argument
84 return (readreg(cs->hw.saphir.ale, cs->hw.saphir.isac, offset)); in ReadISAC()
88 WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) in WriteISAC() argument
90 writereg(cs->hw.saphir.ale, cs->hw.saphir.isac, offset, value); in WriteISAC()
94 ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) in ReadISACfifo() argument
96 readfifo(cs->hw.saphir.ale, cs->hw.saphir.isac, 0, data, size); in ReadISACfifo()
100 WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) in WriteISACfifo() argument
102 writefifo(cs->hw.saphir.ale, cs->hw.saphir.isac, 0, data, size); in WriteISACfifo()
106 ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) in ReadHSCX() argument
108 return (readreg(cs->hw.saphir.ale, cs->hw.saphir.hscx, in ReadHSCX()
113 WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) in WriteHSCX() argument
115 writereg(cs->hw.saphir.ale, cs->hw.saphir.hscx, in WriteHSCX()
119 #define READHSCX(cs, nr, reg) readreg(cs->hw.saphir.ale, \ argument
120 cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0))
121 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.saphir.ale, \ argument
122 cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0), data)
124 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.saphir.ale, \ argument
125 cs->hw.saphir.hscx, (nr ? 0x40 : 0), ptr, cnt)
127 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.saphir.ale, \ argument
128 cs->hw.saphir.hscx, (nr ? 0x40 : 0), ptr, cnt)
135 struct IsdnCardState *cs = dev_id; in saphir_interrupt() local
138 if (!cs) { in saphir_interrupt()
142 val = readreg(cs->hw.saphir.ale, cs->hw.saphir.hscx, HSCX_ISTA + 0x40); in saphir_interrupt()
145 hscx_int_main(cs, val); in saphir_interrupt()
146 val = readreg(cs->hw.saphir.ale, cs->hw.saphir.isac, ISAC_ISTA); in saphir_interrupt()
149 isac_interrupt(cs, val); in saphir_interrupt()
150 val = readreg(cs->hw.saphir.ale, cs->hw.saphir.hscx, HSCX_ISTA + 0x40); in saphir_interrupt()
152 if (cs->debug & L1_DEB_HSCX) in saphir_interrupt()
153 debugl1(cs, "HSCX IntStat after IntRoutine"); in saphir_interrupt()
156 val = readreg(cs->hw.saphir.ale, cs->hw.saphir.isac, ISAC_ISTA); in saphir_interrupt()
158 if (cs->debug & L1_DEB_ISAC) in saphir_interrupt()
159 debugl1(cs, "ISAC IntStat after IntRoutine"); in saphir_interrupt()
163 if (cs->hw.saphir.timer.function) in saphir_interrupt()
164 mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); in saphir_interrupt()
167 writereg(cs->hw.saphir.ale, cs->hw.saphir.hscx, HSCX_MASK, 0xFF); in saphir_interrupt()
168 writereg(cs->hw.saphir.ale, cs->hw.saphir.hscx, HSCX_MASK + 0x40, 0xFF); in saphir_interrupt()
169 writereg(cs->hw.saphir.ale, cs->hw.saphir.isac, ISAC_MASK, 0xFF); in saphir_interrupt()
170 writereg(cs->hw.saphir.ale, cs->hw.saphir.isac, ISAC_MASK, 0); in saphir_interrupt()
171 writereg(cs->hw.saphir.ale, cs->hw.saphir.hscx, HSCX_MASK, 0); in saphir_interrupt()
172 writereg(cs->hw.saphir.ale, cs->hw.saphir.hscx, HSCX_MASK + 0x40, 0); in saphir_interrupt()
176 SaphirWatchDog(struct IsdnCardState *cs) in SaphirWatchDog() argument
179 cs->readisac(cs, ISAC_RBCH); in SaphirWatchDog()
180 mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ); in SaphirWatchDog()
184 release_io_saphir(struct IsdnCardState *cs) in release_io_saphir() argument
190 byteout(cs->hw.saphir.cfg_reg + IRQ_REG, 0xff); in release_io_saphir()
191 del_timer(&cs->hw.saphir.timer); in release_io_saphir()
192 cs->hw.saphir.timer.function = NULL; in release_io_saphir()
194 if (cs->hw.saphir.cfg_reg) in release_io_saphir()
195 release_region(cs->hw.saphir.cfg_reg, 6); in release_io_saphir()
199 saphir_reset(struct IsdnCardState *cs) in saphir_reset() argument
204 switch(cs->irq) { in saphir_reset()
220 cs->irq); in saphir_reset()
223 byteout(cs->hw.saphir.cfg_reg + IRQ_REG, irq_val); in saphir_reset()
226 byteout(cs->hw.saphir.cfg_reg + RESET_REG, 1); in saphir_reset()
229 byteout(cs->hw.saphir.cfg_reg + RESET_REG, 0); in saphir_reset()
233 byteout(cs->hw.saphir.cfg_reg + IRQ_REG, irq_val); in saphir_reset()
234 byteout(cs->hw.saphir.cfg_reg + SPARE_REG, 0x02); in saphir_reset()
239 saphir_card_msg(struct IsdnCardState *cs, int mt, void *arg) in saphir_card_msg() argument
243 saphir_reset(cs); in saphir_card_msg()
246 release_io_saphir(cs); in saphir_card_msg()
249 inithscxisac(cs, 3); in saphir_card_msg()
261 struct IsdnCardState *cs = card->cs; in setup_saphir() local
266 if (cs->typ != ISDN_CTYPE_HSTSAPHIR) in setup_saphir()
270 cs->hw.saphir.cfg_reg = card->para[1]; in setup_saphir()
271 cs->hw.saphir.isac = card->para[1] + ISAC_DATA; in setup_saphir()
272 cs->hw.saphir.hscx = card->para[1] + HSCX_DATA; in setup_saphir()
273 cs->hw.saphir.ale = card->para[1] + ADDRESS_REG; in setup_saphir()
274 cs->irq = card->para[0]; in setup_saphir()
275 if (check_region((cs->hw.saphir.cfg_reg), 6)) { in setup_saphir()
279 cs->hw.saphir.cfg_reg, in setup_saphir()
280 cs->hw.saphir.cfg_reg + 5); in setup_saphir()
283 request_region(cs->hw.saphir.cfg_reg,6, "saphir"); in setup_saphir()
287 CardType[cs->typ], cs->irq, in setup_saphir()
288 cs->hw.saphir.cfg_reg); in setup_saphir()
290 cs->hw.saphir.timer.function = (void *) SaphirWatchDog; in setup_saphir()
291 cs->hw.saphir.timer.data = (long) cs; in setup_saphir()
292 init_timer(&cs->hw.saphir.timer); in setup_saphir()
293 cs->hw.saphir.timer.expires = jiffies + 4*HZ; in setup_saphir()
294 add_timer(&cs->hw.saphir.timer); in setup_saphir()
295 if (saphir_reset(cs)) { in setup_saphir()
296 release_io_saphir(cs); in setup_saphir()
299 cs->readisac = &ReadISAC; in setup_saphir()
300 cs->writeisac = &WriteISAC; in setup_saphir()
301 cs->readisacfifo = &ReadISACfifo; in setup_saphir()
302 cs->writeisacfifo = &WriteISACfifo; in setup_saphir()
303 cs->BC_Read_Reg = &ReadHSCX; in setup_saphir()
304 cs->BC_Write_Reg = &WriteHSCX; in setup_saphir()
305 cs->BC_Send_Data = &hscx_fill_fifo; in setup_saphir()
306 cs->cardmsg = &saphir_card_msg; in setup_saphir()
307 cs->irq_func = &saphir_interrupt; in setup_saphir()
308 ISACVersion(cs, "saphir:"); in setup_saphir()
309 if (HscxVersion(cs, "saphir:")) { in setup_saphir()
312 release_io_saphir(cs); in setup_saphir()