summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/s0box.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/s0box.c')
-rw-r--r--drivers/isdn/hisax/s0box.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/drivers/isdn/hisax/s0box.c b/drivers/isdn/hisax/s0box.c
index 479880bb3..d8dfb2ee3 100644
--- a/drivers/isdn/hisax/s0box.c
+++ b/drivers/isdn/hisax/s0box.c
@@ -1,4 +1,4 @@
-/* $Id: s0box.c,v 2.1 1998/04/15 16:38:24 keil Exp $
+/* $Id: s0box.c,v 2.2 1999/07/12 21:05:25 keil Exp $
* s0box.c low level stuff for Creatix S0BOX
*
@@ -13,7 +13,7 @@
#include "isdnl1.h"
extern const char *CardType[];
-const char *s0box_revision = "$Revision: 2.1 $";
+const char *s0box_revision = "$Revision: 2.2 $";
static inline void
writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
@@ -148,9 +148,9 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
static void
s0box_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
-#define MAXCOUNT 20
+#define MAXCOUNT 5
struct IsdnCardState *cs = dev_id;
- u_char val, stat = 0;
+ u_char val;
int count = 0;
if (!cs) {
@@ -159,16 +159,12 @@ s0box_interrupt(int intno, void *dev_id, struct pt_regs *regs)
}
val = readreg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[1], HSCX_ISTA);
Start_HSCX:
- if (val) {
+ if (val)
hscx_int_main(cs, val);
- stat |= 1;
- }
val = readreg(cs->hw.teles3.cfg_reg, cs->hw.teles3.isac, ISAC_ISTA);
Start_ISAC:
- if (val) {
+ if (val)
isac_interrupt(cs, val);
- stat |= 2;
- }
count++;
val = readreg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[1], HSCX_ISTA);
if (val && count < MAXCOUNT) {
@@ -184,16 +180,12 @@ s0box_interrupt(int intno, void *dev_id, struct pt_regs *regs)
}
if (count >= MAXCOUNT)
printk(KERN_WARNING "S0Box: more than %d loops in s0box_interrupt\n", count);
- if (stat & 1) {
- writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[0], HSCX_MASK, 0xFF);
- writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[1], HSCX_MASK, 0xFF);
- writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[0], HSCX_MASK, 0x0);
- writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[1], HSCX_MASK, 0x0);
- }
- if (stat & 2) {
- writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.isac, ISAC_MASK, 0xFF);
- writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.isac, ISAC_MASK, 0x0);
- }
+ writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[0], HSCX_MASK, 0xFF);
+ writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[1], HSCX_MASK, 0xFF);
+ writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.isac, ISAC_MASK, 0xFF);
+ writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.isac, ISAC_MASK, 0x0);
+ writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[0], HSCX_MASK, 0x0);
+ writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[1], HSCX_MASK, 0x0);
}
void
@@ -211,9 +203,6 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg)
case CARD_RELEASE:
release_io_s0box(cs);
break;
- case CARD_SETIRQ:
- return(request_irq(cs->irq, &s0box_interrupt,
- I4L_IRQ_FLAG, "HiSax", cs));
case CARD_INIT:
inithscxisac(cs, 3);
break;
@@ -223,8 +212,8 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg)
return(0);
}
-__initfunc(int
-setup_s0box(struct IsdnCard *card))
+int __init
+setup_s0box(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
char tmp[64];
@@ -266,6 +255,7 @@ setup_s0box(struct IsdnCard *card))
cs->BC_Write_Reg = &WriteHSCX;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &S0Box_card_msg;
+ cs->irq_func = &s0box_interrupt;
ISACVersion(cs, "S0Box:");
if (HscxVersion(cs, "S0Box:")) {
printk(KERN_WARNING