Commit 8686ec19 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Share IPAC IRQ handler

All IRQ handlers for IPAC based cards were basically the same (not
a big surprise, since the chip is the same), so we can share
the IRQ handler.
parent b59b6557
......@@ -38,12 +38,12 @@ hisax-objs-$(CONFIG_HISAX_S0BOX) += s0box.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_AVM_A1) += avm_a1.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA) += avm_a1p.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o
hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipacx.o
hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipac.o ipacx.o
hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o
hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o ipac.o isar.o
hisax-objs-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o
......@@ -55,8 +55,8 @@ hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o
hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_BKM_A4T) += bkm_a4t.o isac.o arcofi.o jade.o
hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o
hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o ipac.o
hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o
hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
#hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o
......
......@@ -188,51 +188,6 @@ ipac_writefifo(struct IsdnCardState *cs, u8 off, u8 * data, int size)
BUILD_IPAC_OPS(ipac);
static void
asuscom_ipac_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5;
spin_lock(&cs->lock);
ista = ipac_read(cs, IPAC_ISTA);
Start_IPAC:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = hscx_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val)
hscx_int_main(cs, val);
}
if (ista & 0x20) {
val = ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPAC;
}
if (!icnt)
printk(KERN_WARNING "ASUS IRQ LOOP\n");
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
spin_unlock(&cs->lock);
}
static void
asuscom_release(struct IsdnCardState *cs)
{
......@@ -275,25 +230,18 @@ Asus_card_msg(struct IsdnCardState *cs, int mt, void *arg)
return(0);
}
static void
asuscom_init(struct IsdnCardState *cs)
{
cs->debug |= L1_DEB_IPAC;
inithscxisac(cs);
}
static struct card_ops asuscom_ops = {
.init = asuscom_init,
.init = inithscxisac,
.reset = asuscom_reset,
.release = asuscom_release,
.irq_func = hscxisac_irq,
};
static struct card_ops asuscom_ipac_ops = {
.init = asuscom_init,
.init = ipac_init,
.reset = asuscom_ipac_reset,
.release = asuscom_release,
.irq_func = asuscom_ipac_interrupt,
.irq_func = ipac_irq,
};
#ifdef __ISAPNP__
......@@ -390,7 +338,6 @@ setup_asuscom(struct IsdnCard *card)
cs->card_ops = &asuscom_ipac_ops;
cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_IPAC_DATA;
cs->hw.asus.hscx = cs->hw.asus.cfg_reg + ASUS_IPAC_DATA;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
cs->dc_hw_ops = &ipac_dc_ops;
cs->bc_hw_ops = &ipac_bc_ops;
printk(KERN_INFO "Asus: IPAC version %x\n", val);
......
......@@ -98,57 +98,6 @@ set_ipac_active(struct IsdnCardState *cs, u_int active)
ipac_write(cs, IPAC_MASK, active ? 0xc0 : 0xff);
}
static void
bkm_a8_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5;
spin_lock(&cs->lock);
ista = ipac_read(cs, IPAC_ISTA);
if (!(ista & 0x3f)) /* not this IPAC */
goto unlock;
Start_IPAC:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = ipac_bc_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val) {
hscx_int_main(cs, val);
}
}
if (ista & 0x20) {
val = ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPAC;
}
if (!icnt)
printk(KERN_WARNING "HiSax: %s (%s) IRQ LOOP\n",
CardType[cs->typ],
sct_quadro_subtypes[cs->subtyp]);
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
unlock:
spin_unlock(&cs->lock);
}
void
release_io_sct_quadro(struct IsdnCardState *cs)
{
......@@ -193,7 +142,7 @@ bkm_a8_init(struct IsdnCardState *cs)
{
cs->debug |= L1_DEB_IPAC;
set_ipac_active(cs, 1);
inithscxisac(cs);
ipac_init(cs);
/* Enable ints */
enable_bkm_int(cs, 1);
}
......@@ -220,7 +169,7 @@ static struct card_ops bkm_a8_ops = {
.init = bkm_a8_init,
.reset = bkm_a8_reset,
.release = bkm_a8_release,
.irq_func = bkm_a8_interrupt,
.irq_func = ipac_irq,
};
int __init
......@@ -380,8 +329,6 @@ setup_sct_quadro(struct IsdnCard *card)
cs->hw.ax.data_adr,
cs->irq);
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
cs->dc_hw_ops = &ipac_dc_ops;
cs->bc_hw_ops = &ipac_bc_ops;
cs->cardmsg = &BKM_card_msg;
......
......@@ -333,99 +333,18 @@ diva_interrupt(int intno, void *dev_id, struct pt_regs *regs)
printk(KERN_WARNING "Diva: IRQ LOOP\n");
}
static void
diva_ipac_isa_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista,val;
int icnt=5;
if (!cs) {
printk(KERN_WARNING "Diva: Spurious interrupt!\n");
return;
}
ista = ipac_read(cs, IPAC_ISTA);
Start_IPACISA:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = hscx_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val)
hscx_int_main(cs, val);
}
if (ista & 0x20) {
val = ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPACISA;
}
if (!icnt)
printk(KERN_WARNING "DIVA IPAC IRQ LOOP\n");
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
}
static void
diva_ipac_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista,val;
int icnt=5;
u8 val;
val = readb(cs->hw.diva.pci_cfg);
if (!(val & PITA_INT0_STATUS))
return; /* other shared IRQ */
writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg); /* Reset pending INT0 */
ista = mem_ipac_read(cs, IPAC_ISTA);
Start_IPACPCI:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = mem_ipac_bc_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val)
hscx_int_main(cs, val);
}
if (ista & 0x20) {
val = mem_ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = mem_ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPACPCI;
}
if (!icnt)
printk(KERN_WARNING "DIVA IPAC PCI IRQ LOOP\n");
mem_ipac_write(cs, IPAC_MASK, 0xFF);
mem_ipac_write(cs, IPAC_MASK, 0xC0);
ipac_irq(intno, dev_id, regs);
}
static void
......@@ -629,7 +548,7 @@ static void
diva_ipac_pci_init(struct IsdnCardState *cs)
{
writel(PITA_INT0_ENABLE, cs->hw.diva.pci_cfg);
inithscxisac(cs);
ipac_init(cs);
}
static struct card_ops diva_ops = {
......@@ -640,10 +559,10 @@ static struct card_ops diva_ops = {
};
static struct card_ops diva_ipac_isa_ops = {
.init = inithscxisac,
.init = ipac_init,
.reset = diva_ipac_isa_reset,
.release = diva_ipac_isa_release,
.irq_func = diva_ipac_isa_irq,
.irq_func = ipac_irq,
};
static struct card_ops diva_ipac_pci_ops = {
......@@ -717,7 +636,6 @@ setup_diva(struct IsdnCard *card)
cs->hw.diva.hscx = card->para[1] + DIVA_IPAC_DATA;
cs->hw.diva.isac_adr = card->para[1] + DIVA_IPAC_ADR;
cs->hw.diva.hscx_adr = card->para[1] + DIVA_IPAC_ADR;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
} else {
cs->subtyp = DIVA_ISA;
cs->hw.diva.ctrl = card->para[1] + DIVA_ISA_CTRL;
......@@ -768,7 +686,6 @@ setup_diva(struct IsdnCard *card)
card->para[1] + DIVA_IPAC_ADR;
cs->hw.diva.hscx_adr =
card->para[1] + DIVA_IPAC_ADR;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
} else {
cs->subtyp = DIVA_ISA;
cs->hw.diva.ctrl =
......@@ -854,7 +771,6 @@ setup_diva(struct IsdnCard *card)
cs->hw.diva.hscx = 0;
cs->hw.diva.isac_adr = 0;
cs->hw.diva.hscx_adr = 0;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
bytecnt = 0;
} else {
cs->hw.diva.ctrl = cs->hw.diva.cfg_reg + DIVA_PCI_CTRL;
......
......@@ -358,8 +358,7 @@ static void
elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista,val;
int icnt=5;
u8 val;
if (!cs) {
printk(KERN_WARNING "Elsa: Spurious interrupt!\n");
......@@ -376,44 +375,13 @@ elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
val = serial_inp(cs, UART_IIR);
if (!(val & UART_IIR_NO_INT)) {
debugl1(cs,"IIR %02x", val);
spin_lock(&cs->lock);
rs_interrupt_elsa(intno, cs);
spin_unlock(&cs->lock);
}
}
#endif
ista = ipac_read(cs, IPAC_ISTA);
Start_IPAC:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = hscx_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val)
hscx_int_main(cs, val);
}
if (ista & 0x20) {
val = ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPAC;
}
if (!icnt)
printk(KERN_WARNING "ELSA IRQ LOOP\n");
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
ipac_irq(intno, dev_id, regs);
}
static void
......@@ -708,7 +676,6 @@ elsa_aux_ind(struct IsdnCardState *cs, void *arg)
static void
elsa_init(struct IsdnCardState *cs)
{
cs->debug |= L1_DEB_IPAC;
if (cs->subtyp == ELSA_QS1000 || cs->subtyp == ELSA_QS3000)
byteout(cs->hw.elsa.timer, 0);
......@@ -718,6 +685,15 @@ elsa_init(struct IsdnCardState *cs)
inithscxisac(cs);
}
static void
elsa_ipac_init(struct IsdnCardState *cs)
{
if (cs->hw.elsa.trig)
byteout(cs->hw.elsa.trig, 0xff);
ipac_init(cs);
}
static void
elsa_test(struct IsdnCardState *cs)
{
......@@ -766,7 +742,7 @@ static struct card_ops elsa_ops = {
};
static struct card_ops elsa_ipac_ops = {
.init = elsa_init,
.init = elsa_ipac_init,
.test = elsa_test,
.reset = elsa_reset,
.release = elsa_release,
......@@ -1002,7 +978,6 @@ setup_elsa(struct IsdnCard *card)
cs->subtyp = ELSA_PCMCIA_IPAC;
cs->hw.elsa.isac = cs->hw.elsa.base + 2;
cs->hw.elsa.hscx = cs->hw.elsa.base + 2;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
} else {
cs->subtyp = ELSA_PCMCIA;
cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE_PCM;
......@@ -1062,7 +1037,6 @@ setup_elsa(struct IsdnCard *card)
cs->hw.elsa.ale = cs->hw.elsa.base;
cs->hw.elsa.isac = cs->hw.elsa.base +1;
cs->hw.elsa.hscx = cs->hw.elsa.base +1;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
cs->hw.elsa.timer = 0;
cs->hw.elsa.trig = 0;
cs->irq_flags |= SA_SHIRQ;
......
......@@ -227,52 +227,6 @@ ipac_writefifo(struct IsdnCardState *cs, u8 off, u8 * data, int size)
BUILD_IPAC_OPS(ipac);
#define MAXCOUNT 5
static void
gazel_ipac_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista, val;
int count = 0;
if (!cs) {
printk(KERN_WARNING "Gazel: Spurious interrupt!\n");
return;
}
ista = ipac_read(cs, IPAC_ISTA);
do {
if (ista & 0x0f) {
val = hscx_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val) {
hscx_int_main(cs, val);
}
}
if (ista & 0x20) {
val = isac_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
count++;
}
while ((ista & 0x3f) && (count < MAXCOUNT));
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
}
static void
gazel_release(struct IsdnCardState *cs)
{
......@@ -397,10 +351,10 @@ static struct card_ops gazel_ops = {
};
static struct card_ops gazel_ipac_ops = {
.init = inithscxisac,
.init = ipac_init,
.reset = gazel_ipac_reset,
.release = gazel_ipac_release,
.irq_func = gazel_ipac_interrupt,
.irq_func = ipac_irq,
};
static int
......@@ -499,7 +453,6 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
break;
case R742:
printk(KERN_INFO "Gazel: Card ISA R742 found\n");
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
printk(KERN_INFO
"Gazel: config irq:%d ipac:0x%X\n",
cs->irq, cs->hw.gazel.ipac);
......@@ -588,7 +541,6 @@ setup_gazelpci(struct IsdnCardState *cs)
case PCI_DEVICE_ID_PLX_DJINN_ITOO:
printk(KERN_INFO "Gazel: Card PCI R753 found\n");
cs->subtyp = R753;
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
printk(KERN_INFO
"Gazel: config irq:%d ipac:0x%X cfg:0x%X\n",
cs->irq, cs->hw.gazel.ipac, cs->hw.gazel.cfg_reg);
......
#include "hisax.h"
#include "isdnl1.h"
#include "ipac.h"
#include "hscx.h"
#include "isac.h"
static inline u8
ipac_dc_read(struct IsdnCardState *cs, u8 addr)
{
return cs->dc_hw_ops->read_reg(cs, addr);
}
static inline void
ipac_dc_write(struct IsdnCardState *cs, u8 addr, u8 val)
{
cs->dc_hw_ops->write_reg(cs, addr, val);
}
static inline u8
ipac_bc_read(struct IsdnCardState *cs, int hscx, u8 addr)
{
return cs->bc_hw_ops->read_reg(cs, hscx, addr);
}
static inline void
ipac_bc_write(struct IsdnCardState *cs, int hscx, u8 addr, u8 val)
{
cs->bc_hw_ops->write_reg(cs, hscx, addr, val);
}
static inline u8
ipac_read(struct IsdnCardState *cs, u8 offset)
{
return ipac_dc_read(cs, offset - 0x80);
}
static inline void
ipac_write(struct IsdnCardState *cs, u8 offset, u8 value)
{
ipac_dc_write(cs, offset - 0x80, value);
}
void
ipac_init(struct IsdnCardState *cs)
{
set_bit(HW_IPAC, &cs->HW_Flags);
inithscxisac(cs);
}
void
ipac_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5;
spin_lock(&cs->lock);
ista = ipac_read(cs, IPAC_ISTA);
Start_IPAC:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = ipac_bc_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val)
hscx_int_main(cs, val);
}
if (ista & 0x20) {
val = ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPAC;
}
if (!icnt)
printk(KERN_WARNING "IRQ LOOP\n");
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
spin_unlock(&cs->lock);
}
......@@ -28,6 +28,9 @@
#define IPAC_SCFG 0xCB
#define IPAC_TIMR2 0xCC
void ipac_init(struct IsdnCardState *cs);
void ipac_irq(int intno, void *dev_id, struct pt_regs *regs);
/* Macro to build the needed D- and B-Channel access routines given
* access functions for the IPAC */
......
......@@ -298,51 +298,6 @@ sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs)
hscxisac_irq(intno, dev_id, regs);
}
static void
sedlbauer_ipac_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5;
spin_lock(&cs->lock);
ista = ipac_read(cs, IPAC_ISTA);
Start_IPAC:
if (cs->debug & L1_DEB_IPAC)
debugl1(cs, "IPAC ISTA %02X", ista);
if (ista & 0x0f) {
val = hscx_read(cs, 1, HSCX_ISTA);
if (ista & 0x01)
val |= 0x01;
if (ista & 0x04)
val |= 0x02;
if (ista & 0x08)
val |= 0x04;
if (val)
hscx_int_main(cs, val);
}
if (ista & 0x20) {
val = ipac_dc_read(cs, ISAC_ISTA) & 0xfe;
if (val) {
isac_interrupt(cs, val);
}
}
if (ista & 0x10) {
val = 0x01;
isac_interrupt(cs, val);
}
ista = ipac_read(cs, IPAC_ISTA);
if ((ista & 0x3f) && icnt) {
icnt--;
goto Start_IPAC;
}
if (!icnt)
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "Sedlbauer IRQ LOOP");
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
spin_unlock(&cs->lock);
}
static void
sedlbauer_isar_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
......@@ -502,10 +457,10 @@ static struct card_ops sedlbauer_ops = {
};
static struct card_ops sedlbauer_ipac_ops = {
.init = inithscxisac,
.init = ipac_init,
.reset = sedlbauer_reset,
.release = sedlbauer_release,
.irq_func = sedlbauer_ipac_interrupt,
.irq_func = ipac_irq,
};
static struct card_ops sedlbauer_isar_ops = {
......@@ -744,7 +699,6 @@ setup_sedlbauer(struct IsdnCard *card)
cs->hw.sedl.isac = cs->hw.sedl.cfg_reg + SEDL_IPAC_ANY_IPAC;
cs->hw.sedl.hscx = cs->hw.sedl.cfg_reg + SEDL_IPAC_ANY_IPAC;
}
test_and_set_bit(HW_IPAC, &cs->HW_Flags);
cs->dc_hw_ops = &ipac_dc_ops;
cs->bc_hw_ops = &ipac_bc_ops;
cs->card_ops = &sedlbauer_ipac_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment