20 static const char *ISurf_revision =
"$Revision: 1.12.2.4 $";
22 #define byteout(addr, val) outb(val, addr)
23 #define bytein(addr) inb(addr)
25 #define ISURF_ISAR_RESET 1
26 #define ISURF_ISAC_RESET 2
27 #define ISURF_ISAR_EA 4
28 #define ISURF_ARCOFI_RESET 8
29 #define ISURF_RESET (ISURF_ISAR_RESET | ISURF_ISAC_RESET | ISURF_ARCOFI_RESET)
31 #define ISURF_ISAR_OFFSET 0
32 #define ISURF_ISAC_OFFSET 0x100
33 #define ISURF_IOMEM_SIZE 0x400
39 return (
readb(cs->hw.isurf.isac + offset));
45 writeb(value, cs->hw.isurf.isac + offset);
mb();
52 for (i = 0; i <
size; i++)
53 data[i] =
readb(cs->hw.isurf.isac);
57 WriteISACfifo(
struct IsdnCardState *cs,
u_char *data,
int size)
60 for (i = 0; i <
size; i++) {
61 writeb(data[i], cs->hw.isurf.isac);
mb();
74 return (
readb(cs->hw.isurf.isar + offset));
80 writeb(value, cs->hw.isurf.isar + offset);
mb();
84 isurf_interrupt(
int intno,
void *
dev_id)
86 struct IsdnCardState *cs =
dev_id;
101 if ((val & ISAR_IRQSTA) && --cnt) {
102 if (cs->debug & L1_DEB_HSCX)
103 debugl1(cs,
"ISAR IntStat after IntRoutine");
108 if (cs->debug & L1_DEB_ISAC)
109 debugl1(cs,
"ISAC IntStat after IntRoutine");
119 spin_unlock_irqrestore(&cs->lock, flags);
124 release_io_isurf(
struct IsdnCardState *cs)
132 reset_isurf(
struct IsdnCardState *cs,
u_char chips)
136 byteout(cs->hw.isurf.reset, chips);
143 ISurf_card_msg(
struct IsdnCardState *cs,
int mt,
void *
arg)
151 spin_unlock_irqrestore(&cs->lock, flags);
154 release_io_isurf(cs);
167 spin_unlock_irqrestore(&cs->lock, flags);
176 isurf_auxcmd(
struct IsdnCardState *cs,
isdn_ctrl *ic) {
190 spin_unlock_irqrestore(&cs->lock, flags);
204 struct IsdnCardState *cs = card->
cs;
207 strcpy(tmp, ISurf_revision);
212 if (card->
para[1] && card->
para[2]) {
213 cs->hw.isurf.reset = card->
para[1];
214 cs->hw.isurf.phymem = card->
para[2];
215 cs->irq = card->
para[0];
235 pr_warn(
"%s: pnp_activate_dev ret=%d\n",
239 cs->hw.isurf.reset = pnp_port_start(pnp_d, 0);
240 cs->hw.isurf.phymem = pnp_mem_start(pnp_d, 1);
242 if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
243 printk(
KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
244 cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
263 "HiSax: Siemens I-Surf config port %x already in use\n",
269 "%lx-%lx already in use\n",
278 "ISurf: defined at 0x%x 0x%lx IRQ %d\n",
284 cs->cardmsg = &ISurf_card_msg;
285 cs->irq_func = &isurf_interrupt;
286 cs->auxcmd = &isurf_auxcmd;
289 cs->readisacfifo = &ReadISACfifo;
290 cs->writeisacfifo = &WriteISACfifo;
291 cs->bcs[0].hw.isar.reg = &cs->hw.isurf.isar_r;
292 cs->bcs[1].hw.isar.reg = &cs->hw.isurf.isar_r;
295 cs->BC_Read_Reg = &ReadISAR;
296 cs->BC_Write_Reg = &WriteISAR;
301 "ISurf: wrong ISAR version (ret = %d)\n", ver);
302 release_io_isurf(cs);