21 static char *saphir_rev =
"$Revision: 1.10.2.4 $";
23 #define byteout(addr, val) outb(val, addr)
24 #define bytein(addr) inb(addr)
47 insb(adr, data, size);
62 outsb(adr, data, size);
70 return (
readreg(cs->hw.saphir.ale, cs->hw.saphir.isac, offset));
76 writereg(cs->hw.saphir.ale, cs->hw.saphir.isac, offset, value);
82 readfifo(cs->hw.saphir.ale, cs->hw.saphir.isac, 0, data, size);
88 writefifo(cs->hw.saphir.ale, cs->hw.saphir.isac, 0, data, size);
94 return (
readreg(cs->hw.saphir.ale, cs->hw.saphir.hscx,
95 offset + (hscx ? 0x40 : 0)));
101 writereg(cs->hw.saphir.ale, cs->hw.saphir.hscx,
102 offset + (hscx ? 0x40 : 0), value);
105 #define READHSCX(cs, nr, reg) readreg(cs->hw.saphir.ale, \
106 cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0))
107 #define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.saphir.ale, \
108 cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0), data)
110 #define READHSCXFIFO(cs, nr, ptr, cnt) readfifo(cs->hw.saphir.ale, \
111 cs->hw.saphir.hscx, (nr ? 0x40 : 0), ptr, cnt)
113 #define WRITEHSCXFIFO(cs, nr, ptr, cnt) writefifo(cs->hw.saphir.ale, \
114 cs->hw.saphir.hscx, (nr ? 0x40 : 0), ptr, cnt)
119 saphir_interrupt(
int intno,
void *
dev_id)
121 struct IsdnCardState *cs =
dev_id;
129 hscx_int_main(cs, val);
136 if (cs->debug & L1_DEB_HSCX)
137 debugl1(cs,
"HSCX IntStat after IntRoutine");
142 if (cs->debug & L1_DEB_ISAC)
143 debugl1(cs,
"ISAC IntStat after IntRoutine");
147 if (cs->hw.saphir.timer.function)
157 spin_unlock_irqrestore(&cs->lock, flags);
162 SaphirWatchDog(
struct IsdnCardState *cs)
169 spin_unlock_irqrestore(&cs->lock, flags);
174 release_io_saphir(
struct IsdnCardState *cs)
178 cs->hw.saphir.timer.function =
NULL;
179 if (cs->hw.saphir.cfg_reg)
184 saphir_reset(
struct IsdnCardState *cs)
218 saphir_card_msg(
struct IsdnCardState *cs,
int mt,
void *
arg)
226 spin_unlock_irqrestore(&cs->lock, flags);
229 release_io_saphir(cs);
234 spin_unlock_irqrestore(&cs->lock, flags);
246 struct IsdnCardState *cs = card->
cs;
255 cs->hw.saphir.cfg_reg = card->
para[1];
259 cs->irq = card->
para[0];
262 "HiSax: HST Saphir config port %x-%x already in use\n",
263 cs->hw.saphir.cfg_reg,
264 cs->hw.saphir.cfg_reg + 5);
269 cs->irq, cs->hw.saphir.cfg_reg);
272 cs->hw.saphir.timer.function = (
void *) SaphirWatchDog;
273 cs->hw.saphir.timer.data = (
long) cs;
275 cs->hw.saphir.timer.expires =
jiffies + 4 *
HZ;
277 if (saphir_reset(cs)) {
278 release_io_saphir(cs);
283 cs->readisacfifo = &ReadISACfifo;
284 cs->writeisacfifo = &WriteISACfifo;
287 cs->BC_Send_Data = &hscx_fill_fifo;
288 cs->cardmsg = &saphir_card_msg;
289 cs->irq_func = &saphir_interrupt;
293 "saphir: wrong HSCX versions check IO address\n");
294 release_io_saphir(cs);