Commit 02f7568c authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Move interrupt function to per-card struct

Since we now have a per-card ops struct, use it to provide the
irq handler function, too.

Some drivers actually drive more than one specific hardware card,
instead of having "switch (cs->subtyp)" scattered around, we rather
aim at having different card_ops structures which just provide the
right functions for the hardware. Of course, this patch is only the
beginning of that separation, but allows for some cleaning already.
parent 4bffaa97
...@@ -723,7 +723,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) ...@@ -723,7 +723,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
/* Transmitter reset, abort transmit */ /* Transmitter reset, abort transmit */
wByteAMD(cs, 0x21, 0x82); wByteAMD(cs, 0x21, 0x82);
wByteAMD(cs, 0x21, 0x02); wByteAMD(cs, 0x21, 0x02);
cs->irq_func(cs->irq, cs, NULL); cs->card_ops->irq_func(cs->irq, cs, NULL); /* FIXME? */
if (cs->debug & L1_DEB_ISAC) if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "Amd7930: dbusy_timer_handler: Transmitter reset"); debugl1(cs, "Amd7930: dbusy_timer_handler: Transmitter reset");
......
...@@ -212,7 +212,7 @@ asuscom_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -212,7 +212,7 @@ asuscom_interrupt(int intno, void *dev_id, struct pt_regs *regs)
} }
static void static void
asuscom_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) asuscom_ipac_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5; u8 ista, val, icnt = 5;
...@@ -314,7 +314,13 @@ asuscom_init(struct IsdnCardState *cs) ...@@ -314,7 +314,13 @@ asuscom_init(struct IsdnCardState *cs)
} }
static struct card_ops asuscom_ops = { static struct card_ops asuscom_ops = {
.init = asuscom_init, .init = asuscom_init,
.irq_func = asuscom_interrupt,
};
static struct card_ops asuscom_ipac_ops = {
.init = asuscom_init,
.irq_func = asuscom_ipac_interrupt,
}; };
#ifdef __ISAPNP__ #ifdef __ISAPNP__
...@@ -405,26 +411,25 @@ setup_asuscom(struct IsdnCard *card) ...@@ -405,26 +411,25 @@ setup_asuscom(struct IsdnCard *card)
cs->hw.asus.cfg_reg, cs->irq); cs->hw.asus.cfg_reg, cs->irq);
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Asus_card_msg; cs->cardmsg = &Asus_card_msg;
cs->card_ops = &asuscom_ops;
cs->hw.asus.adr = cs->hw.asus.cfg_reg + ASUS_IPAC_ALE; cs->hw.asus.adr = cs->hw.asus.cfg_reg + ASUS_IPAC_ALE;
val = readreg(cs, cs->hw.asus.cfg_reg + ASUS_IPAC_DATA, IPAC_ID); val = readreg(cs, cs->hw.asus.cfg_reg + ASUS_IPAC_DATA, IPAC_ID);
if ((val == 1) || (val == 2)) { if ((val == 1) || (val == 2)) {
cs->subtyp = ASUS_IPAC; cs->subtyp = ASUS_IPAC;
cs->card_ops = &asuscom_ipac_ops;
cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_IPAC_DATA; cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_IPAC_DATA;
cs->hw.asus.hscx = 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); test_and_set_bit(HW_IPAC, &cs->HW_Flags);
cs->dc_hw_ops = &ipac_dc_ops; cs->dc_hw_ops = &ipac_dc_ops;
cs->irq_func = &asuscom_interrupt_ipac;
printk(KERN_INFO "Asus: IPAC version %x\n", val); printk(KERN_INFO "Asus: IPAC version %x\n", val);
} else { } else {
cs->subtyp = ASUS_ISACHSCX; cs->subtyp = ASUS_ISACHSCX;
cs->card_ops = &asuscom_ops;
cs->hw.asus.adr = cs->hw.asus.cfg_reg + ASUS_ADR; cs->hw.asus.adr = cs->hw.asus.cfg_reg + ASUS_ADR;
cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_ISAC; cs->hw.asus.isac = cs->hw.asus.cfg_reg + ASUS_ISAC;
cs->hw.asus.hscx = cs->hw.asus.cfg_reg + ASUS_HSCX; cs->hw.asus.hscx = cs->hw.asus.cfg_reg + ASUS_HSCX;
cs->hw.asus.u7 = cs->hw.asus.cfg_reg + ASUS_CTRL_U7; cs->hw.asus.u7 = cs->hw.asus.cfg_reg + ASUS_CTRL_U7;
cs->hw.asus.pots = cs->hw.asus.cfg_reg + ASUS_CTRL_POTS; cs->hw.asus.pots = cs->hw.asus.cfg_reg + ASUS_CTRL_POTS;
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->irq_func = &asuscom_interrupt;
ISACVersion(cs, "ISDNLink:"); ISACVersion(cs, "ISDNLink:");
if (HscxVersion(cs, "ISDNLink:")) { if (HscxVersion(cs, "ISDNLink:")) {
printk(KERN_WARNING printk(KERN_WARNING
......
...@@ -188,7 +188,8 @@ avm_a1_init(struct IsdnCardState *cs) ...@@ -188,7 +188,8 @@ avm_a1_init(struct IsdnCardState *cs)
} }
static struct card_ops avm_a1_ops = { static struct card_ops avm_a1_ops = {
.init = avm_a1_init, .init = avm_a1_init,
.irq_func = avm_a1_interrupt,
}; };
int __init int __init
...@@ -312,7 +313,6 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -312,7 +313,6 @@ setup_avm_a1(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &AVM_card_msg; cs->cardmsg = &AVM_card_msg;
cs->irq_func = &avm_a1_interrupt;
cs->card_ops = &avm_a1_ops; cs->card_ops = &avm_a1_ops;
ISACVersion(cs, "AVM A1:"); ISACVersion(cs, "AVM A1:");
if (HscxVersion(cs, "AVM A1:")) { if (HscxVersion(cs, "AVM A1:")) {
......
...@@ -226,7 +226,8 @@ avm_a1p_init(struct IsdnCardState *cs) ...@@ -226,7 +226,8 @@ avm_a1p_init(struct IsdnCardState *cs)
} }
static struct card_ops avm_a1p_ops = { static struct card_ops avm_a1p_ops = {
.init = avm_a1p_init, .init = avm_a1p_init,
.irq_func = avm_a1p_interrupt,
}; };
int __devinit int __devinit
...@@ -266,7 +267,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -266,7 +267,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &AVM_card_msg; cs->cardmsg = &AVM_card_msg;
cs->irq_func = &avm_a1p_interrupt;
cs->card_ops = &avm_a1p_ops; cs->card_ops = &avm_a1p_ops;
ISACVersion(cs, "AVM A1 PCMCIA:"); ISACVersion(cs, "AVM A1 PCMCIA:");
......
...@@ -588,7 +588,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -588,7 +588,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static void static void
avm_a1_pci_init(struct IsdnCardState *cs) avm_pci_init(struct IsdnCardState *cs)
{ {
initisac(cs); initisac(cs);
inithdlc(cs); inithdlc(cs);
...@@ -598,8 +598,9 @@ avm_a1_pci_init(struct IsdnCardState *cs) ...@@ -598,8 +598,9 @@ avm_a1_pci_init(struct IsdnCardState *cs)
AVM_STATUS0_ENA_IRQ, cs->hw.avm.cfg_reg + 2); AVM_STATUS0_ENA_IRQ, cs->hw.avm.cfg_reg + 2);
} }
static struct card_ops avm_a1_pci_ops = { static struct card_ops avm_pci_ops = {
.init = avm_a1_pci_init, .init = avm_pci_init,
.irq_func = avm_pcipnp_interrupt,
}; };
static struct pci_dev *dev_avm __initdata = NULL; static struct pci_dev *dev_avm __initdata = NULL;
...@@ -724,8 +725,7 @@ setup_avm_pcipnp(struct IsdnCard *card) ...@@ -724,8 +725,7 @@ setup_avm_pcipnp(struct IsdnCard *card)
cs->bc_hw_ops = &hdlc_hw_ops; cs->bc_hw_ops = &hdlc_hw_ops;
cs->bc_l1_ops = &hdlc_l1_ops; cs->bc_l1_ops = &hdlc_l1_ops;
cs->cardmsg = &AVM_card_msg; cs->cardmsg = &AVM_card_msg;
cs->irq_func = &avm_pcipnp_interrupt; cs->card_ops = &avm_pci_ops;
cs->card_ops = &avm_a1_pci_ops;
ISACVersion(cs, (cs->subtyp == AVM_FRITZ_PCI) ? "AVM PCI:" : "AVM PnP:"); ISACVersion(cs, (cs->subtyp == AVM_FRITZ_PCI) ? "AVM PCI:" : "AVM PnP:");
return (1); return (1);
} }
...@@ -261,7 +261,8 @@ bkm_a4t_init(struct IsdnCardState *cs) ...@@ -261,7 +261,8 @@ bkm_a4t_init(struct IsdnCardState *cs)
} }
static struct card_ops bkm_a4t_ops = { static struct card_ops bkm_a4t_ops = {
.init = bkm_a4t_init, .init = bkm_a4t_init,
.irq_func = bkm_interrupt,
}; };
static struct pci_dev *dev_a4t __initdata = NULL; static struct pci_dev *dev_a4t __initdata = NULL;
...@@ -342,7 +343,6 @@ setup_bkm_a4t(struct IsdnCard *card) ...@@ -342,7 +343,6 @@ setup_bkm_a4t(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &jade_ops; cs->bc_hw_ops = &jade_ops;
cs->cardmsg = &BKM_card_msg; cs->cardmsg = &BKM_card_msg;
cs->irq_func = &bkm_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->card_ops = &bkm_a4t_ops; cs->card_ops = &bkm_a4t_ops;
ISACVersion(cs, "Telekom A4T:"); ISACVersion(cs, "Telekom A4T:");
......
...@@ -155,7 +155,7 @@ set_ipac_active(struct IsdnCardState *cs, u_int active) ...@@ -155,7 +155,7 @@ set_ipac_active(struct IsdnCardState *cs, u_int active)
} }
static void static void
bkm_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) bkm_a8_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5; u8 ista, val, icnt = 5;
...@@ -271,7 +271,8 @@ bkm_a8_init(struct IsdnCardState *cs) ...@@ -271,7 +271,8 @@ bkm_a8_init(struct IsdnCardState *cs)
} }
static struct card_ops bkm_a8_ops = { static struct card_ops bkm_a8_ops = {
.init = bkm_a8_init, .init = bkm_a8_init,
.irq_func = bkm_a8_interrupt,
}; };
int __init int __init
...@@ -436,7 +437,6 @@ setup_sct_quadro(struct IsdnCard *card) ...@@ -436,7 +437,6 @@ setup_sct_quadro(struct IsdnCard *card)
cs->dc_hw_ops = &ipac_dc_ops; cs->dc_hw_ops = &ipac_dc_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &BKM_card_msg; cs->cardmsg = &BKM_card_msg;
cs->irq_func = &bkm_interrupt_ipac;
cs->card_ops = &bkm_a8_ops; cs->card_ops = &bkm_a8_ops;
printk(KERN_INFO "HiSax: %s (%s): IPAC Version %d\n", printk(KERN_INFO "HiSax: %s (%s): IPAC Version %d\n",
......
...@@ -859,7 +859,7 @@ static int __devinit init_card(struct IsdnCardState *cs) ...@@ -859,7 +859,7 @@ static int __devinit init_card(struct IsdnCardState *cs)
irq_cnt = kstat_irqs(cs->irq); irq_cnt = kstat_irqs(cs->irq);
printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ], printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
cs->irq, irq_cnt); cs->irq, irq_cnt);
if (request_irq(cs->irq, cs->irq_func, cs->irq_flags, "HiSax", cs)) { if (request_irq(cs->irq, cs->card_ops->irq_func, cs->irq_flags, "HiSax", cs)) {
printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n", printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
cs->irq); cs->irq);
return 1; return 1;
......
...@@ -389,7 +389,7 @@ diva_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -389,7 +389,7 @@ diva_interrupt(int intno, void *dev_id, struct pt_regs *regs)
} }
static void static void
diva_irq_ipac_isa(int intno, void *dev_id, struct pt_regs *regs) diva_ipac_isa_irq(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 ista,val; u8 ista,val;
...@@ -436,7 +436,7 @@ diva_irq_ipac_isa(int intno, void *dev_id, struct pt_regs *regs) ...@@ -436,7 +436,7 @@ diva_irq_ipac_isa(int intno, void *dev_id, struct pt_regs *regs)
} }
static void static void
diva_irq_ipac_pci(int intno, void *dev_id, struct pt_regs *regs) diva_ipac_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 ista,val; u8 ista,val;
...@@ -489,7 +489,7 @@ diva_irq_ipac_pci(int intno, void *dev_id, struct pt_regs *regs) ...@@ -489,7 +489,7 @@ diva_irq_ipac_pci(int intno, void *dev_id, struct pt_regs *regs)
} }
static void static void
diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs) diva_ipacx_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 val; u8 val;
...@@ -673,25 +673,37 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -673,25 +673,37 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static void static void
diva_init(struct IsdnCardState *cs) diva_ipacx_pci_init(struct IsdnCardState *cs)
{ {
unsigned int *ireg; writel(PITA_INT0_ENABLE, cs->hw.diva.pci_cfg);
init_ipacx(cs, 3); // init chip and enable interrupts
}
if (cs->subtyp == DIVA_IPACX_PCI) { static void
ireg = (unsigned int *)cs->hw.diva.pci_cfg; diva_ipac_pci_init(struct IsdnCardState *cs)
*ireg = PITA_INT0_ENABLE; {
init_ipacx(cs, 3); // init chip and enable interrupts writel(PITA_INT0_ENABLE, cs->hw.diva.pci_cfg);
return;
}
if (cs->subtyp == DIVA_IPAC_PCI) {
ireg = (unsigned int *)cs->hw.diva.pci_cfg;
*ireg = PITA_INT0_ENABLE;
}
inithscxisac(cs); inithscxisac(cs);
} }
static struct card_ops diva_ops = { static struct card_ops diva_ops = {
.init = diva_init, .init = inithscxisac,
.irq_func = diva_interrupt,
};
static struct card_ops diva_ipac_isa_ops = {
.init = inithscxisac,
.irq_func = diva_ipac_isa_irq,
};
static struct card_ops diva_ipac_pci_ops = {
.init = diva_ipac_pci_init,
.irq_func = diva_ipac_pci_irq,
};
static struct card_ops diva_ipacx_pci_ops = {
.init = diva_ipacx_pci_init,
.irq_func = diva_ipacx_pci_irq,
}; };
static struct pci_dev *dev_diva __initdata = NULL; static struct pci_dev *dev_diva __initdata = NULL;
...@@ -930,22 +942,21 @@ setup_diva(struct IsdnCard *card) ...@@ -930,22 +942,21 @@ setup_diva(struct IsdnCard *card)
reset_diva(cs); reset_diva(cs);
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Diva_card_msg; cs->cardmsg = &Diva_card_msg;
cs->card_ops = &diva_ops;
if (cs->subtyp == DIVA_IPAC_ISA) { if (cs->subtyp == DIVA_IPAC_ISA) {
cs->dc_hw_ops = &ipac_dc_ops; cs->dc_hw_ops = &ipac_dc_ops;
cs->irq_func = &diva_irq_ipac_isa; cs->card_ops = &diva_ipac_isa_ops;
val = readreg(cs->hw.diva.isac_adr, cs->hw.diva.isac, IPAC_ID); val = readreg(cs->hw.diva.isac_adr, cs->hw.diva.isac, IPAC_ID);
printk(KERN_INFO "Diva: IPAC version %x\n", val); printk(KERN_INFO "Diva: IPAC version %x\n", val);
} else if (cs->subtyp == DIVA_IPAC_PCI) { } else if (cs->subtyp == DIVA_IPAC_PCI) {
cs->dc_hw_ops = &mem_ipac_dc_ops; cs->dc_hw_ops = &mem_ipac_dc_ops;
cs->bc_hw_ops = &mem_hscx_ops; cs->bc_hw_ops = &mem_hscx_ops;
cs->irq_func = &diva_irq_ipac_pci; cs->card_ops = &diva_ipac_pci_ops;
val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID); val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID);
printk(KERN_INFO "Diva: IPAC version %x\n", val); printk(KERN_INFO "Diva: IPAC version %x\n", val);
} else if (cs->subtyp == DIVA_IPACX_PCI) { } else if (cs->subtyp == DIVA_IPACX_PCI) {
cs->dc_hw_ops = &ipacx_dc_ops; cs->dc_hw_ops = &ipacx_dc_ops;
cs->bc_hw_ops = &ipacx_bc_ops; cs->bc_hw_ops = &ipacx_bc_ops;
cs->irq_func = &diva_irq_ipacx_pci; cs->card_ops = &diva_ipacx_pci_ops;
printk(KERN_INFO "Diva: IPACX Design Id: %x\n", printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
ipacx_dc_read(cs, IPACX_ID) &0x3F); ipacx_dc_read(cs, IPACX_ID) &0x3F);
} else { /* DIVA 2.0 */ } else { /* DIVA 2.0 */
...@@ -953,7 +964,7 @@ setup_diva(struct IsdnCard *card) ...@@ -953,7 +964,7 @@ setup_diva(struct IsdnCard *card)
cs->hw.diva.tl.data = (long) cs; cs->hw.diva.tl.data = (long) cs;
init_timer(&cs->hw.diva.tl); init_timer(&cs->hw.diva.tl);
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->irq_func = &diva_interrupt; cs->card_ops = &diva_ops;
ISACVersion(cs, "Diva:"); ISACVersion(cs, "Diva:");
if (HscxVersion(cs, "Diva:")) { if (HscxVersion(cs, "Diva:")) {
printk(KERN_WARNING printk(KERN_WARNING
......
...@@ -792,6 +792,12 @@ elsa_init(struct IsdnCardState *cs) ...@@ -792,6 +792,12 @@ elsa_init(struct IsdnCardState *cs)
static struct card_ops elsa_ops = { static struct card_ops elsa_ops = {
.init = elsa_init, .init = elsa_init,
.irq_func = elsa_interrupt,
};
static struct card_ops elsa_ipac_ops = {
.init = elsa_init,
.irq_func = elsa_interrupt_ipac,
}; };
static unsigned char static unsigned char
...@@ -1176,16 +1182,15 @@ setup_elsa(struct IsdnCard *card) ...@@ -1176,16 +1182,15 @@ setup_elsa(struct IsdnCard *card)
} }
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Elsa_card_msg; cs->cardmsg = &Elsa_card_msg;
cs->card_ops = &elsa_ops;
reset_elsa(cs); reset_elsa(cs);
if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI) || (cs->subtyp == ELSA_PCMCIA_IPAC)) { if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI) || (cs->subtyp == ELSA_PCMCIA_IPAC)) {
cs->dc_hw_ops = &ipac_dc_ops; cs->dc_hw_ops = &ipac_dc_ops;
cs->irq_func = &elsa_interrupt_ipac; cs->card_ops = &elsa_ipac_ops;
val = readreg(cs, cs->hw.elsa.isac, IPAC_ID); val = readreg(cs, cs->hw.elsa.isac, IPAC_ID);
printk(KERN_INFO "Elsa: IPAC version %x\n", val); printk(KERN_INFO "Elsa: IPAC version %x\n", val);
} else { } else {
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->irq_func = &elsa_interrupt; cs->card_ops = &elsa_ops;
ISACVersion(cs, "Elsa:"); ISACVersion(cs, "Elsa:");
if (HscxVersion(cs, "Elsa:")) { if (HscxVersion(cs, "Elsa:")) {
printk(KERN_WARNING printk(KERN_WARNING
......
...@@ -221,10 +221,6 @@ enpci_init(struct IsdnCardState *cs) ...@@ -221,10 +221,6 @@ enpci_init(struct IsdnCardState *cs)
Amd7930_init(cs); Amd7930_init(cs);
} }
static struct card_ops enpci_ops = {
.init = enpci_init,
};
static void static void
enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
...@@ -272,6 +268,10 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -272,6 +268,10 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
static struct card_ops enpci_ops = {
.init = enpci_init,
.irq_func = enpci_interrupt,
};
static struct pci_dev *dev_netjet __initdata = NULL; static struct pci_dev *dev_netjet __initdata = NULL;
...@@ -377,7 +377,6 @@ setup_enternow_pci(struct IsdnCard *card) ...@@ -377,7 +377,6 @@ setup_enternow_pci(struct IsdnCard *card)
cs->dc.amd7930.setIrqMask = &enpci_setIrqMask; cs->dc.amd7930.setIrqMask = &enpci_setIrqMask;
cs->cardmsg = &enpci_card_msg; cs->cardmsg = &enpci_card_msg;
cs->irq_func = &enpci_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->card_ops = &enpci_ops; cs->card_ops = &enpci_ops;
......
...@@ -282,7 +282,7 @@ gazel_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -282,7 +282,7 @@ gazel_interrupt(int intno, void *dev_id, struct pt_regs *regs)
static void static void
gazel_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) gazel_ipac_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 ista, val; u8 ista, val;
...@@ -430,17 +430,20 @@ gazel_init(struct IsdnCardState *cs) ...@@ -430,17 +430,20 @@ gazel_init(struct IsdnCardState *cs)
{ {
int i; int i;
inithscxisac(cs); for (i = 0; i < 2; i++) {
if (cs->subtyp == R647 || cs->subtyp == R685) { cs->bcs[i].hw.hscx.tsaxr0 = 0x1f;
for (i = 0; i < 2; i++) { cs->bcs[i].hw.hscx.tsaxr1 = 0x23;
cs->bcs[i].hw.hscx.tsaxr0 = 0x1f;
cs->bcs[i].hw.hscx.tsaxr1 = 0x23;
}
} }
} }
static struct card_ops gazel_ops = { static struct card_ops gazel_ops = {
.init = gazel_init, .init = gazel_init,
.irq_func = gazel_interrupt,
};
static struct card_ops gazel_ipac_ops = {
.init = inithscxisac,
.irq_func = gazel_ipac_interrupt,
}; };
static int static int
...@@ -688,12 +691,11 @@ setup_gazel(struct IsdnCard *card) ...@@ -688,12 +691,11 @@ setup_gazel(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Gazel_card_msg; cs->cardmsg = &Gazel_card_msg;
cs->card_ops = &gazel_ops;
switch (cs->subtyp) { switch (cs->subtyp) {
case R647: case R647:
case R685: case R685:
cs->irq_func = &gazel_interrupt; cs->card_ops = &gazel_ops;
ISACVersion(cs, "Gazel:"); ISACVersion(cs, "Gazel:");
if (HscxVersion(cs, "Gazel:")) { if (HscxVersion(cs, "Gazel:")) {
printk(KERN_WARNING printk(KERN_WARNING
...@@ -704,7 +706,7 @@ setup_gazel(struct IsdnCard *card) ...@@ -704,7 +706,7 @@ setup_gazel(struct IsdnCard *card)
break; break;
case R742: case R742:
case R753: case R753:
cs->irq_func = &gazel_interrupt_ipac; cs->card_ops = &gazel_ipac_ops;
val = readreg_ipac(cs, IPAC_ID); val = readreg_ipac(cs, IPAC_ID);
printk(KERN_INFO "Gazel: IPAC version %x\n", val); printk(KERN_INFO "Gazel: IPAC version %x\n", val);
break; break;
......
...@@ -1395,7 +1395,8 @@ hfcpci_init(struct IsdnCardState *cs) ...@@ -1395,7 +1395,8 @@ hfcpci_init(struct IsdnCardState *cs)
} }
static struct card_ops hfcpci_ops = { static struct card_ops hfcpci_ops = {
.init = hfcpci_init, .init = hfcpci_init,
.irq_func = hfcpci_interrupt,
}; };
...@@ -1481,7 +1482,6 @@ setup_hfcpci(struct IsdnCard *card) ...@@ -1481,7 +1482,6 @@ setup_hfcpci(struct IsdnCard *card)
return (0); /* no valid card type */ return (0); /* no valid card type */
cs->irq_func = &hfcpci_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->hw.hfcpci.timer.function = (void *) hfcpci_Timer; cs->hw.hfcpci.timer.function = (void *) hfcpci_Timer;
......
...@@ -1172,7 +1172,8 @@ hfcsx_init(struct IsdnCardState *cs) ...@@ -1172,7 +1172,8 @@ hfcsx_init(struct IsdnCardState *cs)
} }
static struct card_ops hfcsx_ops = { static struct card_ops hfcsx_ops = {
.init = hfcsx_init, .init = hfcsx_init,
.irq_func = hfcsx_interrupt,
}; };
#ifdef __ISAPNP__ #ifdef __ISAPNP__
...@@ -1293,8 +1294,6 @@ setup_hfcsx(struct IsdnCard *card) ...@@ -1293,8 +1294,6 @@ setup_hfcsx(struct IsdnCard *card)
} else } else
return (0); /* no valid card type */ return (0); /* no valid card type */
cs->irq_func = &hfcsx_interrupt;
cs->hw.hfcsx.timer.function = (void *) hfcsx_Timer; cs->hw.hfcsx.timer.function = (void *) hfcsx_Timer;
cs->hw.hfcsx.timer.data = (long) cs; cs->hw.hfcsx.timer.data = (long) cs;
cs->hw.hfcsx.b_fifo_size = 0; /* fifo size still unknown */ cs->hw.hfcsx.b_fifo_size = 0; /* fifo size still unknown */
......
...@@ -145,7 +145,8 @@ hfcs_init(struct IsdnCardState *cs) ...@@ -145,7 +145,8 @@ hfcs_init(struct IsdnCardState *cs)
} }
static struct card_ops hfcs_ops = { static struct card_ops hfcs_ops = {
.init = hfcs_init, .init = hfcs_init,
.irq_func = hfcs_interrupt,
}; };
#ifdef __ISAPNP__ #ifdef __ISAPNP__
...@@ -271,7 +272,6 @@ setup_hfcs(struct IsdnCard *card) ...@@ -271,7 +272,6 @@ setup_hfcs(struct IsdnCard *card)
init_timer(&cs->hw.hfcD.timer); init_timer(&cs->hw.hfcD.timer);
reset_hfcs(cs); reset_hfcs(cs);
cs->cardmsg = &hfcs_card_msg; cs->cardmsg = &hfcs_card_msg;
cs->irq_func = &hfcs_interrupt;
cs->card_ops = &hfcs_ops; cs->card_ops = &hfcs_ops;
return (1); return (1);
} }
...@@ -858,6 +858,7 @@ struct IsdnCardState; ...@@ -858,6 +858,7 @@ struct IsdnCardState;
struct card_ops { struct card_ops {
void (*init) (struct IsdnCardState *); void (*init) (struct IsdnCardState *);
void (*irq_func) (int, void *, struct pt_regs *);
}; };
/* Card specific drivers provide methods to access the /* Card specific drivers provide methods to access the
...@@ -949,7 +950,6 @@ struct IsdnCardState { ...@@ -949,7 +950,6 @@ struct IsdnCardState {
void (*setstack_d) (struct PStack *, struct IsdnCardState *); void (*setstack_d) (struct PStack *, struct IsdnCardState *);
void (*DC_Send_Data) (struct IsdnCardState *); void (*DC_Send_Data) (struct IsdnCardState *);
void (*DC_Close) (struct IsdnCardState *); void (*DC_Close) (struct IsdnCardState *);
void (*irq_func) (int, void *, struct pt_regs *);
int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *); int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
struct Channel channel[2+MAX_WAITING_CALLS]; struct Channel channel[2+MAX_WAITING_CALLS];
struct BCState bcs[2+MAX_WAITING_CALLS]; struct BCState bcs[2+MAX_WAITING_CALLS];
......
...@@ -492,7 +492,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) ...@@ -492,7 +492,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
debugl1(cs, "D-Channel Busy no skb"); debugl1(cs, "D-Channel Busy no skb");
} }
icc_write_reg(cs, ICC_CMDR, 0x01); /* Transmitter reset */ icc_write_reg(cs, ICC_CMDR, 0x01); /* Transmitter reset */
cs->irq_func(cs->irq, cs, NULL); cs->card_ops->irq_func(cs->irq, cs, NULL); /* FIXME? */
} }
} }
} }
......
...@@ -490,7 +490,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) ...@@ -490,7 +490,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
debugl1(cs, "D-Channel Busy no skb"); debugl1(cs, "D-Channel Busy no skb");
} }
isac_write(cs, ISAC_CMDR, 0x01); /* Transmitter reset */ isac_write(cs, ISAC_CMDR, 0x01); /* Transmitter reset */
cs->irq_func(cs->irq, cs, NULL); cs->card_ops->irq_func(cs->irq, cs, NULL);
} }
} }
} }
......
...@@ -194,7 +194,8 @@ isurf_init(struct IsdnCardState *cs) ...@@ -194,7 +194,8 @@ isurf_init(struct IsdnCardState *cs)
} }
static struct card_ops isurf_ops = { static struct card_ops isurf_ops = {
.init = isurf_init, .init = isurf_init,
.irq_func = isurf_interrupt,
}; };
#ifdef __ISAPNP__ #ifdef __ISAPNP__
...@@ -290,7 +291,6 @@ setup_isurf(struct IsdnCard *card) ...@@ -290,7 +291,6 @@ setup_isurf(struct IsdnCard *card)
cs->irq); cs->irq);
cs->cardmsg = &ISurf_card_msg; cs->cardmsg = &ISurf_card_msg;
cs->irq_func = &isurf_interrupt;
cs->auxcmd = &isurf_auxcmd; cs->auxcmd = &isurf_auxcmd;
cs->card_ops = &isurf_ops; cs->card_ops = &isurf_ops;
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
......
...@@ -214,7 +214,8 @@ ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -214,7 +214,8 @@ ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops ix1_ops = { static struct card_ops ix1_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = ix1micro_interrupt,
}; };
#ifdef __ISAPNP__ #ifdef __ISAPNP__
...@@ -308,7 +309,6 @@ setup_ix1micro(struct IsdnCard *card) ...@@ -308,7 +309,6 @@ setup_ix1micro(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &ix1_card_msg; cs->cardmsg = &ix1_card_msg;
cs->irq_func = &ix1micro_interrupt;
cs->card_ops = &ix1_ops; cs->card_ops = &ix1_ops;
ISACVersion(cs, "ix1-Micro:"); ISACVersion(cs, "ix1-Micro:");
if (HscxVersion(cs, "ix1-Micro:")) { if (HscxVersion(cs, "ix1-Micro:")) {
......
...@@ -193,7 +193,8 @@ mic_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -193,7 +193,8 @@ mic_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops mic_ops = { static struct card_ops mic_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = mic_interrupt,
}; };
int __init int __init
...@@ -231,7 +232,6 @@ setup_mic(struct IsdnCard *card) ...@@ -231,7 +232,6 @@ setup_mic(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &mic_card_msg; cs->cardmsg = &mic_card_msg;
cs->irq_func = &mic_interrupt;
cs->card_ops = &mic_ops; cs->card_ops = &mic_ops;
ISACVersion(cs, "mic:"); ISACVersion(cs, "mic:");
if (HscxVersion(cs, "mic:")) { if (HscxVersion(cs, "mic:")) {
......
...@@ -241,7 +241,8 @@ niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -241,7 +241,8 @@ niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops niccy_ops = { static struct card_ops niccy_ops = {
.init = niccy_reset, .init = niccy_reset,
.irq_func = niccy_interrupt,
}; };
static struct pci_dev *niccy_dev __initdata = NULL; static struct pci_dev *niccy_dev __initdata = NULL;
...@@ -385,7 +386,6 @@ setup_niccy(struct IsdnCard *card) ...@@ -385,7 +386,6 @@ setup_niccy(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &niccy_card_msg; cs->cardmsg = &niccy_card_msg;
cs->irq_func = &niccy_interrupt;
cs->card_ops = &niccy_ops; cs->card_ops = &niccy_ops;
ISACVersion(cs, "Niccy:"); ISACVersion(cs, "Niccy:");
if (HscxVersion(cs, "Niccy:")) { if (HscxVersion(cs, "Niccy:")) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
const char *NETjet_S_revision = "$Revision: 2.7.6.6 $"; const char *NETjet_S_revision = "$Revision: 2.7.6.6 $";
static void static void
netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs) nj_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 val, sval; u8 val, sval;
...@@ -115,7 +115,8 @@ nj_s_init(struct IsdnCardState *cs) ...@@ -115,7 +115,8 @@ nj_s_init(struct IsdnCardState *cs)
} }
static struct card_ops nj_s_ops = { static struct card_ops nj_s_ops = {
.init = nj_s_init, .init = nj_s_init,
.irq_func = nj_s_interrupt,
}; };
static struct pci_dev *dev_netjet __initdata = NULL; static struct pci_dev *dev_netjet __initdata = NULL;
...@@ -235,7 +236,6 @@ setup_netjet_s(struct IsdnCard *card) ...@@ -235,7 +236,6 @@ setup_netjet_s(struct IsdnCard *card)
reset_netjet_s(cs); reset_netjet_s(cs);
cs->dc_hw_ops = &netjet_dc_ops; cs->dc_hw_ops = &netjet_dc_ops;
cs->cardmsg = &NETjet_S_card_msg; cs->cardmsg = &NETjet_S_card_msg;
cs->irq_func = &netjet_s_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->card_ops = &nj_s_ops; cs->card_ops = &nj_s_ops;
ISACVersion(cs, "NETjet-S:"); ISACVersion(cs, "NETjet-S:");
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
const char *NETjet_U_revision = "$Revision: 2.8.6.6 $"; const char *NETjet_U_revision = "$Revision: 2.8.6.6 $";
static void static void
netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs) nj_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 val, sval; u8 val, sval;
...@@ -119,7 +119,8 @@ nj_u_init(struct IsdnCardState *cs) ...@@ -119,7 +119,8 @@ nj_u_init(struct IsdnCardState *cs)
} }
static struct card_ops nj_u_ops = { static struct card_ops nj_u_ops = {
.init = nj_u_init, .init = nj_u_init,
.irq_func = nj_u_interrupt,
}; };
static struct pci_dev *dev_netjet __initdata = NULL; static struct pci_dev *dev_netjet __initdata = NULL;
...@@ -231,7 +232,6 @@ setup_netjet_u(struct IsdnCard *card) ...@@ -231,7 +232,6 @@ setup_netjet_u(struct IsdnCard *card)
reset_netjet_u(cs); reset_netjet_u(cs);
cs->dc_hw_ops = &netjet_dc_ops; cs->dc_hw_ops = &netjet_dc_ops;
cs->cardmsg = &NETjet_U_card_msg; cs->cardmsg = &NETjet_U_card_msg;
cs->irq_func = &netjet_u_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->card_ops = &nj_u_ops; cs->card_ops = &nj_u_ops;
ICCVersion(cs, "NETspider-U:"); ICCVersion(cs, "NETspider-U:");
......
...@@ -229,7 +229,8 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -229,7 +229,8 @@ S0Box_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops s0box_ops = { static struct card_ops s0box_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = s0box_interrupt,
}; };
int __init int __init
...@@ -269,7 +270,6 @@ setup_s0box(struct IsdnCard *card) ...@@ -269,7 +270,6 @@ setup_s0box(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &S0Box_card_msg; cs->cardmsg = &S0Box_card_msg;
cs->irq_func = &s0box_interrupt;
cs->card_ops = &s0box_ops; cs->card_ops = &s0box_ops;
ISACVersion(cs, "S0Box:"); ISACVersion(cs, "S0Box:");
if (HscxVersion(cs, "S0Box:")) { if (HscxVersion(cs, "S0Box:")) {
......
...@@ -245,7 +245,8 @@ saphir_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -245,7 +245,8 @@ saphir_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops saphir_ops = { static struct card_ops saphir_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = saphir_interrupt,
}; };
int __init int __init
...@@ -291,7 +292,6 @@ setup_saphir(struct IsdnCard *card) ...@@ -291,7 +292,6 @@ setup_saphir(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &saphir_card_msg; cs->cardmsg = &saphir_card_msg;
cs->irq_func = &saphir_interrupt;
cs->card_ops = &saphir_ops; cs->card_ops = &saphir_ops;
ISACVersion(cs, "saphir:"); ISACVersion(cs, "saphir:");
if (HscxVersion(cs, "saphir:")) { if (HscxVersion(cs, "saphir:")) {
......
...@@ -332,7 +332,7 @@ sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -332,7 +332,7 @@ sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs)
} }
static void static void
sedlbauer_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) sedlbauer_ipac_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 ista, val, icnt = 5; u8 ista, val, icnt = 5;
...@@ -379,7 +379,7 @@ sedlbauer_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) ...@@ -379,7 +379,7 @@ sedlbauer_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
} }
static void static void
sedlbauer_interrupt_isar(int intno, void *dev_id, struct pt_regs *regs) sedlbauer_isar_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 val; u8 val;
...@@ -511,19 +511,26 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -511,19 +511,26 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static void static void
sedlbauer_init(struct IsdnCardState *cs) sedlbauer_isar_init(struct IsdnCardState *cs)
{ {
if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) { isar_write(cs, 0, ISAR_IRQBIT, 0);
isar_write(cs, 0, ISAR_IRQBIT, 0); initisac(cs);
initisac(cs); initisar(cs);
initisar(cs);
} else {
inithscxisac(cs);
}
} }
static struct card_ops sedlbauer_ops = { static struct card_ops sedlbauer_ops = {
.init = sedlbauer_init, .init = inithscxisac,
.irq_func = sedlbauer_interrupt,
};
static struct card_ops sedlbauer_ipac_ops = {
.init = inithscxisac,
.irq_func = sedlbauer_ipac_interrupt,
};
static struct card_ops sedlbauer_isar_ops = {
.init = sedlbauer_isar_init,
.irq_func = sedlbauer_isar_interrupt,
}; };
static struct pci_dev *dev_sedl __devinitdata = NULL; static struct pci_dev *dev_sedl __devinitdata = NULL;
...@@ -713,7 +720,6 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -713,7 +720,6 @@ setup_sedlbauer(struct IsdnCard *card)
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Sedl_card_msg; cs->cardmsg = &Sedl_card_msg;
cs->card_ops = &sedlbauer_ops;
/* /*
* testing ISA and PCMCIA Cards for IPAC, default is ISAC * testing ISA and PCMCIA Cards for IPAC, default is ISAC
...@@ -759,7 +765,7 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -759,7 +765,7 @@ setup_sedlbauer(struct IsdnCard *card)
} }
test_and_set_bit(HW_IPAC, &cs->HW_Flags); test_and_set_bit(HW_IPAC, &cs->HW_Flags);
cs->dc_hw_ops = &ipac_dc_ops; cs->dc_hw_ops = &ipac_dc_ops;
cs->irq_func = &sedlbauer_interrupt_ipac; cs->card_ops = &sedlbauer_ipac_ops;
val = readreg(cs, cs->hw.sedl.isac, IPAC_ID); val = readreg(cs, cs->hw.sedl.isac, IPAC_ID);
printk(KERN_INFO "Sedlbauer: IPAC version %x\n", val); printk(KERN_INFO "Sedlbauer: IPAC version %x\n", val);
...@@ -790,7 +796,7 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -790,7 +796,7 @@ setup_sedlbauer(struct IsdnCard *card)
cs->bcs[0].hw.isar.reg = &cs->hw.sedl.isar; cs->bcs[0].hw.isar.reg = &cs->hw.sedl.isar;
cs->bcs[1].hw.isar.reg = &cs->hw.sedl.isar; cs->bcs[1].hw.isar.reg = &cs->hw.sedl.isar;
test_and_set_bit(HW_ISAR, &cs->HW_Flags); test_and_set_bit(HW_ISAR, &cs->HW_Flags);
cs->irq_func = &sedlbauer_interrupt_isar; cs->card_ops = &sedlbauer_isar_ops;
cs->auxcmd = &isar_auxcmd; cs->auxcmd = &isar_auxcmd;
ISACVersion(cs, "Sedlbauer:"); ISACVersion(cs, "Sedlbauer:");
cs->bc_hw_ops = &isar_ops; cs->bc_hw_ops = &isar_ops;
...@@ -815,7 +821,7 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -815,7 +821,7 @@ setup_sedlbauer(struct IsdnCard *card)
cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_RESET_ON; cs->hw.sedl.reset_on = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_RESET_ON;
cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_RESET_OFF; cs->hw.sedl.reset_off = cs->hw.sedl.cfg_reg + SEDL_HSCX_ISA_RESET_OFF;
} }
cs->irq_func = &sedlbauer_interrupt; cs->card_ops = &sedlbauer_ops;
ISACVersion(cs, "Sedlbauer:"); ISACVersion(cs, "Sedlbauer:");
if (HscxVersion(cs, "Sedlbauer:")) { if (HscxVersion(cs, "Sedlbauer:")) {
......
...@@ -193,7 +193,8 @@ sportster_init(struct IsdnCardState *cs) ...@@ -193,7 +193,8 @@ sportster_init(struct IsdnCardState *cs)
} }
static struct card_ops sportster_ops = { static struct card_ops sportster_ops = {
.init = sportster_init, .init = sportster_init,
.irq_func = sportster_interrupt,
}; };
static int __init static int __init
...@@ -268,7 +269,6 @@ setup_sportster(struct IsdnCard *card) ...@@ -268,7 +269,6 @@ setup_sportster(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Sportster_card_msg; cs->cardmsg = &Sportster_card_msg;
cs->irq_func = &sportster_interrupt;
cs->card_ops = &sportster_ops; cs->card_ops = &sportster_ops;
ISACVersion(cs, "Sportster:"); ISACVersion(cs, "Sportster:");
if (HscxVersion(cs, "Sportster:")) { if (HscxVersion(cs, "Sportster:")) {
......
...@@ -179,7 +179,7 @@ static struct bc_hw_ops hfc_ops = { ...@@ -179,7 +179,7 @@ static struct bc_hw_ops hfc_ops = {
}; };
static void static void
TeleInt_interrupt(int intno, void *dev_id, struct pt_regs *regs) teleint_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 val; u8 val;
...@@ -266,7 +266,8 @@ teleint_init(struct IsdnCardState *cs) ...@@ -266,7 +266,8 @@ teleint_init(struct IsdnCardState *cs)
} }
static struct card_ops teleint_ops = { static struct card_ops teleint_ops = {
.init = teleint_init, .init = teleint_init,
.irq_func = teleint_interrupt,
}; };
int __init int __init
...@@ -341,7 +342,6 @@ setup_TeleInt(struct IsdnCard *card) ...@@ -341,7 +342,6 @@ setup_TeleInt(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hfc_ops; cs->bc_hw_ops = &hfc_ops;
cs->cardmsg = &TeleInt_card_msg; cs->cardmsg = &TeleInt_card_msg;
cs->irq_func = &TeleInt_interrupt;
cs->card_ops = &teleint_ops; cs->card_ops = &teleint_ops;
ISACVersion(cs, "TeleInt:"); ISACVersion(cs, "TeleInt:");
return (1); return (1);
......
...@@ -222,7 +222,8 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -222,7 +222,8 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops teles0_ops = { static struct card_ops teles0_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = teles0_interrupt,
}; };
int __init int __init
...@@ -313,7 +314,6 @@ setup_teles0(struct IsdnCard *card) ...@@ -313,7 +314,6 @@ setup_teles0(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Teles_card_msg; cs->cardmsg = &Teles_card_msg;
cs->irq_func = &teles0_interrupt;
cs->card_ops = &teles0_ops; cs->card_ops = &teles0_ops;
ISACVersion(cs, "Teles0:"); ISACVersion(cs, "Teles0:");
if (HscxVersion(cs, "Teles0:")) { if (HscxVersion(cs, "Teles0:")) {
......
...@@ -255,7 +255,8 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -255,7 +255,8 @@ Teles_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops teles3_ops = { static struct card_ops teles3_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = teles3_interrupt,
}; };
#ifdef __ISAPNP__ #ifdef __ISAPNP__
...@@ -483,7 +484,6 @@ setup_teles3(struct IsdnCard *card) ...@@ -483,7 +484,6 @@ setup_teles3(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &Teles_card_msg; cs->cardmsg = &Teles_card_msg;
cs->irq_func = &teles3_interrupt;
cs->card_ops = &teles3_ops; cs->card_ops = &teles3_ops;
ISACVersion(cs, "Teles3:"); ISACVersion(cs, "Teles3:");
if (HscxVersion(cs, "Teles3:")) { if (HscxVersion(cs, "Teles3:")) {
......
...@@ -247,7 +247,8 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -247,7 +247,8 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops telespci_ops = { static struct card_ops telespci_ops = {
.init = inithscxisac, .init = inithscxisac,
.irq_func = telespci_interrupt,
}; };
static struct pci_dev *dev_tel __initdata = NULL; static struct pci_dev *dev_tel __initdata = NULL;
...@@ -309,7 +310,6 @@ setup_telespci(struct IsdnCard *card) ...@@ -309,7 +310,6 @@ setup_telespci(struct IsdnCard *card)
cs->dc_hw_ops = &isac_ops; cs->dc_hw_ops = &isac_ops;
cs->bc_hw_ops = &hscx_ops; cs->bc_hw_ops = &hscx_ops;
cs->cardmsg = &TelesPCI_card_msg; cs->cardmsg = &TelesPCI_card_msg;
cs->irq_func = &telespci_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->card_ops = &telespci_ops; cs->card_ops = &telespci_ops;
ISACVersion(cs, "TelesPCI:"); ISACVersion(cs, "TelesPCI:");
......
...@@ -288,7 +288,7 @@ W6692B_interrupt(struct IsdnCardState *cs, u8 bchan) ...@@ -288,7 +288,7 @@ W6692B_interrupt(struct IsdnCardState *cs, u8 bchan)
} }
static void static void
W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs) w6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{ {
struct IsdnCardState *cs = dev_id; struct IsdnCardState *cs = dev_id;
u8 val, exval, v1; u8 val, exval, v1;
...@@ -498,7 +498,7 @@ dbusy_timer_handler(struct IsdnCardState *cs) ...@@ -498,7 +498,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
debugl1(cs, "D-Channel Busy no skb"); debugl1(cs, "D-Channel Busy no skb");
} }
w6692_write_reg(cs, W_D_CMDR, W_D_CMDR_XRST); /* Transmitter reset */ w6692_write_reg(cs, W_D_CMDR, W_D_CMDR_XRST); /* Transmitter reset */
cs->irq_func(cs->irq, cs, NULL); cs->card_ops->irq_func(cs->irq, cs, NULL); /* FIXME? */
} }
} }
} }
...@@ -663,7 +663,8 @@ w6692_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -663,7 +663,8 @@ w6692_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} }
static struct card_ops w6692_ops = { static struct card_ops w6692_ops = {
.init = w6692_init, .init = w6692_init,
.irq_func = w6692_interrupt,
}; };
static struct bc_l1_ops w6692_bc_l1_ops = { static struct bc_l1_ops w6692_bc_l1_ops = {
...@@ -765,7 +766,6 @@ setup_w6692(struct IsdnCard *card) ...@@ -765,7 +766,6 @@ setup_w6692(struct IsdnCard *card)
cs->bc_l1_ops = &w6692_bc_l1_ops; cs->bc_l1_ops = &w6692_bc_l1_ops;
cs->DC_Send_Data = &W6692_fill_fifo; cs->DC_Send_Data = &W6692_fill_fifo;
cs->cardmsg = &w6692_card_msg; cs->cardmsg = &w6692_card_msg;
cs->irq_func = &W6692_interrupt;
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
cs->card_ops = &w6692_ops; cs->card_ops = &w6692_ops;
W6692Version(cs, "W6692:"); W6692Version(cs, "W6692:");
......
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