Commit 2efd7260 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] irqs: ISDN

Update ISDN for the new IRQ API.
parent a37352e1
......@@ -69,7 +69,7 @@ act2000_isa_detect(unsigned short portbase)
return ret;
}
static void
static irqreturn_t
act2000_isa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
act2000_card *card = irq2card_map[irq];
......@@ -78,7 +78,7 @@ act2000_isa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!card) {
printk(KERN_WARNING
"act2000: Spurious interrupt!\n");
return;
return IRQ_NONE;
}
istatus = (inb(ISA_PORT_ISR) & 0x07);
if (istatus & ISA_ISR_OUT) {
......@@ -95,6 +95,7 @@ act2000_isa_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
if (istatus)
printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus);
return IRQ_HANDLED;
}
static void
......
......@@ -14,6 +14,8 @@
#ifndef eicon_h
#define eicon_h
#include <linux/interrupt.h>
#define EICON_IOCTL_SETMMIO 0
#define EICON_IOCTL_GETMMIO 1
#define EICON_IOCTL_SETIRQ 2
......@@ -364,7 +366,7 @@ extern __inline__ void eicon_schedule_ack(eicon_card *card)
extern int eicon_addcard(int, int, int, char *, int);
extern void eicon_io_transmit(eicon_card *card);
extern void eicon_irq(int irq, void *dev_id, struct pt_regs *regs);
extern irqreturn_t eicon_irq(int irq, void *dev_id, struct pt_regs *regs);
extern void eicon_io_rcv_dispatch(eicon_card *ccard);
extern void eicon_io_ack_dispatch(eicon_card *ccard);
#ifdef CONFIG_MCA
......
......@@ -3097,7 +3097,7 @@ eicon_idi_manage(eicon_card *card, eicon_manifbuf *mb)
{
int l = 0;
int ret = 0;
int timeout;
unsigned long timeout;
int i;
struct sk_buff *skb;
struct sk_buff *skb2;
......
......@@ -501,7 +501,7 @@ eicon_io_transmit(eicon_card *ccard) {
/*
* IRQ handler
*/
void
irqreturn_t
eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
eicon_card *ccard = (eicon_card *)dev_id;
eicon_isa_card *isa_card;
......@@ -521,7 +521,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
if (!ccard) {
eicon_log(ccard, 1, "eicon_irq: spurious interrupt %d\n", irq);
return;
return IRQ_NONE;
}
if (ccard->type == EICON_CTYPE_QUADRO) {
......@@ -554,7 +554,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
break;
default:
eicon_log(ccard, 1, "eicon_irq: unsupported card-type!\n");
return;
return IRQ_NONE;
}
if (*irqprobe) {
......@@ -577,7 +577,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
(*irqprobe)++;
break;
}
return;
return IRQ_HANDLED;
}
switch(ccard->type) {
......@@ -588,7 +588,7 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
case EICON_CTYPE_S2M:
if (!(readb(isa_card->intack))) { /* card did not interrupt */
eicon_log(ccard, 1, "eicon: IRQ: card reports no interrupt!\n");
return;
return IRQ_NONE;
}
break;
}
......@@ -744,6 +744,6 @@ eicon_irq(int irq, void *dev_id, struct pt_regs *regs) {
break;
}
return;
return IRQ_HANDLED;
}
#endif
......@@ -36,7 +36,7 @@ ux_diva_card_t card_pool[MAX_CARDS];
void UxPause(long int ms)
{
int timeout = jiffies + ((ms * HZ) / 1000);
unsigned long timeout = jiffies + ((ms * HZ) / 1000);
while (time_before(jiffies, timeout));
}
......@@ -577,7 +577,7 @@ void UxCardIoOutBuffer(ux_diva_card_t *card, void *AttachedDivasIOBase, void *ad
return;
}
void Divasintr(int arg, void *unused, struct pt_regs *unused_regs)
irqreturn_t Divasintr(int arg, void *unused, struct pt_regs *unused_regs)
{
int i;
card_t *card = NULL;
......@@ -602,7 +602,7 @@ void Divasintr(int arg, void *unused, struct pt_regs *unused_regs)
}
}
return;
return IRQ_HANDLED;
}
......@@ -680,7 +680,7 @@ long UxCardLock(ux_diva_card_t *card)
return flags;
}
void UxCardUnlock(ux_diva_card_t *card, long ipl)
void UxCardUnlock(ux_diva_card_t *card, unsigned long ipl)
{
spin_unlock_irqrestore(&diva_lock, ipl);
}
......
......@@ -59,7 +59,7 @@ void UxCardHandleFree(ux_diva_card_t *card);
*/
long UxCardLock(ux_diva_card_t *card);
void UxCardUnlock(ux_diva_card_t *card, long ipl);
void UxCardUnlock(ux_diva_card_t *card, unsigned long ipl);
/*
* Set the mapping address for PCI cards
......
......@@ -12,6 +12,7 @@
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#define AVMB1_PORTLEN 0x1f
#define AVM_MAXVERSION 8
......@@ -555,7 +556,7 @@ void b1_register_appl(struct capi_ctr *ctrl, u16 appl,
void b1_release_appl(struct capi_ctr *ctrl, u16 appl);
u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
void b1_parse_version(avmctrl_info *card);
void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
int b1ctl_read_proc(char *page, char **start, off_t off,
int count, int *eof, struct capi_ctr *ctrl);
......@@ -568,7 +569,7 @@ void avmcard_dma_free(avmcard_dmainfo *);
int b1pciv4_detect(avmcard *card);
int t1pci_detect(avmcard *card);
void b1dma_reset(avmcard *card);
void b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs);
int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
void b1dma_reset_ctr(struct capi_ctr *ctrl);
......
......@@ -491,7 +491,7 @@ void b1_parse_version(avmctrl_info *cinfo)
/* ------------------------------------------------------------- */
void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
{
avmcard *card = devptr;
avmctrl_info *cinfo = &card->ctrlinfo[0];
......@@ -506,7 +506,7 @@ void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
unsigned WindowSize;
if (!b1_rx_full(card->port))
return;
return IRQ_NONE;
b1cmd = b1_get_byte(card->port);
......@@ -619,12 +619,13 @@ void b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
case 0xff:
printk(KERN_ERR "%s: card removed ?\n", card->name);
return;
return IRQ_NONE;
default:
printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
card->name, b1cmd);
return;
return IRQ_HANDLED;
}
return IRQ_HANDLED;
}
/* ------------------------------------------------------------- */
......
......@@ -618,11 +618,12 @@ static void b1dma_handle_interrupt(avmcard *card)
spin_unlock(&card->lock);
}
void b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
{
avmcard *card = devptr;
b1dma_handle_interrupt(card);
return IRQ_HANDLED;
}
/* ------------------------------------------------------------- */
......
......@@ -659,7 +659,7 @@ static void c4_handle_rx(avmcard *card)
/* ------------------------------------------------------------- */
static void c4_handle_interrupt(avmcard *card)
static irqreturn_t c4_handle_interrupt(avmcard *card)
{
u32 status = c4inmeml(card->mbase+DOORBELL);
......@@ -667,7 +667,7 @@ static void c4_handle_interrupt(avmcard *card)
int i;
c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c);
if (card->nlogcontr == 0)
return;
return IRQ_HANDLED;
printk(KERN_ERR "%s: unexpected reset\n", card->name);
for (i=0; i < card->nr_controllers; i++) {
avmctrl_info *cinfo = &card->ctrlinfo[i];
......@@ -676,12 +676,12 @@ static void c4_handle_interrupt(avmcard *card)
capi_ctr_reseted(&cinfo->capi_ctrl);
}
card->nlogcontr = 0;
return;
return IRQ_HANDLED;
}
status &= (DBELL_UP_HOST | DBELL_DOWN_HOST);
if (!status)
return;
return IRQ_HANDLED;
c4outmeml(card->mbase+DOORBELL, status);
if ((status & DBELL_UP_HOST) != 0) {
......@@ -702,13 +702,14 @@ static void c4_handle_interrupt(avmcard *card)
c4_dispatch_tx(card);
}
}
return IRQ_HANDLED;
}
static void c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
static irqreturn_t c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
{
avmcard *card = devptr;
c4_handle_interrupt(card);
return c4_handle_interrupt(card);
}
/* ------------------------------------------------------------- */
......
......@@ -124,7 +124,7 @@ static int t1_detectandinit(unsigned int base, unsigned irq, int cardnr)
return 0;
}
static void t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
static irqreturn_t t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
{
avmcard *card = devptr;
avmctrl_info *cinfo = &card->ctrlinfo[0];
......@@ -252,13 +252,14 @@ static void t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs)
case 0xff:
printk(KERN_ERR "%s: card reseted ?\n", card->name);
return;
return IRQ_HANDLED;
default:
printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
card->name, b1cmd);
return;
return IRQ_NONE;
}
}
return IRQ_HANDLED;
}
/* ------------------------------------------------------------- */
......
......@@ -113,14 +113,16 @@ static struct bc_hw_ops hscx_ops = {
.write_fifo = hscx_write_fifo,
};
static void
static irqreturn_t
avm_a1_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 val, sval;
int handled = 0;
spin_lock(&cs->lock);
while (((sval = bytein(cs->hw.avm.cfg_reg)) & 0xf) != 0x7) {
handled = 1;
if (!(sval & AVM_A1_STAT_TIMER)) {
byteout(cs->hw.avm.cfg_reg, 0x1E);
sval = bytein(cs->hw.avm.cfg_reg);
......@@ -144,6 +146,7 @@ avm_a1_interrupt(int intno, void *dev_id, struct pt_regs *regs)
hscx_write(cs, 0, HSCX_MASK, 0x0);
hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock);
return IRQ_RETVAL(handled);
}
static void
......
......@@ -159,7 +159,7 @@ static struct bc_hw_ops hscx_ops = {
.write_fifo = hscx_write_fifo,
};
static void
static irqreturn_t
avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -187,6 +187,7 @@ avm_a1p_interrupt(int intno, void *dev_id, struct pt_regs *regs)
hscx_write(cs, 0, HSCX_MASK, 0x0);
hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static void
......
......@@ -137,18 +137,20 @@ static struct bc_hw_ops jade_ops = {
.write_fifo = jade_write_fifo,
};
static void
static irqreturn_t
bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 val = 0;
I20_REGISTER_FILE *pI20_Regs;
int handled = 0;
spin_lock(&cs->lock);
pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
/* ISDN interrupt pending? */
if (pI20_Regs->i20IntStatus & intISDN) {
handled = 1;
/* Reset the ISDN interrupt */
pI20_Regs->i20IntStatus = intISDN;
/* Disable ISDN interrupt */
......@@ -172,6 +174,7 @@ bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs)
pI20_Regs->i20IntCtrl |= intISDN;
}
spin_unlock(&cs->lock);
return IRQ_RETVAL(handled);
}
static void
......
......@@ -319,7 +319,7 @@ static struct bc_hw_ops ipacx_bc_ops = {
.read_fifo = ipacx_bc_read_fifo,
};
static void
static irqreturn_t
diva_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -331,9 +331,10 @@ diva_interrupt(int intno, void *dev_id, struct pt_regs *regs)
}
if (!cnt)
printk(KERN_WARNING "Diva: IRQ LOOP\n");
return IRQ_HANDLED;
}
static void
static irqreturn_t
diva_ipac_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -341,22 +342,24 @@ diva_ipac_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
val = readb(cs->hw.diva.pci_cfg);
if (!(val & PITA_INT0_STATUS))
return; /* other shared IRQ */
return IRQ_NONE; /* other shared IRQ */
writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg); /* Reset pending INT0 */
ipac_irq(intno, dev_id, regs);
return ipac_irq(intno, dev_id, regs);
}
static void
static irqreturn_t
diva_ipacx_pci_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 val;
val = readb(cs->hw.diva.pci_cfg);
if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ
if (!(val &PITA_INT0_STATUS))
return IRQ_NONE; // other shared IRQ
interrupt_ipacx(cs); // handler for chip
writeb(PITA_INT0_STATUS, cs->hw.diva.pci_cfg); // Reset PLX interrupt
return IRQ_HANDLED;
}
static void
......
......@@ -307,7 +307,7 @@ TimerRun(struct IsdnCardState *cs)
return (v & ELSA_TIMER_RUN);
}
static void
static irqreturn_t
elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -317,7 +317,7 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
/* The card tends to generate interrupts while being removed
causing us to just crash the kernel. bad. */
printk(KERN_WARNING "Elsa: card not available!\n");
return;
return IRQ_NONE;
}
#if ARCOFI_USE
if (cs->hw.elsa.MFlag) {
......@@ -351,9 +351,10 @@ elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
#endif
if (cs->hw.elsa.trig)
byteout(cs->hw.elsa.trig, 0x00);
return IRQ_HANDLED;
}
static void
static irqreturn_t
elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -361,13 +362,13 @@ elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
if (!cs) {
printk(KERN_WARNING "Elsa: Spurious interrupt!\n");
return;
return IRQ_NONE;
}
if (cs->subtyp == ELSA_QS1000PCI || cs->subtyp == ELSA_QS3000PCI) {
val = bytein(cs->hw.elsa.cfg + 0x4c); /* PCI IRQ */
if (!test_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags) &&
!(val & ELSA_PCI_IRQ_MASK))
return;
return IRQ_NONE;
}
#if ARCOFI_USE
if (cs->hw.elsa.MFlag) {
......@@ -380,7 +381,7 @@ elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs)
}
}
#endif
ipac_irq(intno, dev_id, regs);
return ipac_irq(intno, dev_id, regs);
}
static void
......
......@@ -208,7 +208,7 @@ enpci_reset(struct IsdnCardState *cs)
return 0;
}
static void
static irqreturn_t
enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -253,6 +253,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
write_tiger(cs);
}
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static struct card_ops enpci_ops = {
......
......@@ -869,7 +869,7 @@ receive_emsg(struct IsdnCardState *cs)
/*********************/
/* Interrupt handler */
/*********************/
static void
static irqreturn_t
hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -880,17 +880,17 @@ hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (!cs) {
printk(KERN_WARNING "HFC-PCI: Spurious interrupt!\n");
return;
return IRQ_NONE;
}
if (!(cs->hw.hfcpci.int_m2 & 0x08))
return; /* not initialised */
return IRQ_NONE; /* not initialised */
if (HFCPCI_ANYINT & (stat = Read_hfc(cs, HFCPCI_STATUS))) {
val = Read_hfc(cs, HFCPCI_INT_S1);
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "HFC-PCI: stat(%02x) s1(%02x)", stat, val);
} else
return;
return IRQ_NONE;
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "HFC-PCI irq %x", val);
......@@ -964,6 +964,7 @@ hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
} else
val = 0;
}
return IRQ_HANDLED;
}
/********************************************************************/
......
......@@ -661,7 +661,7 @@ receive_emsg(struct IsdnCardState *cs)
/*********************/
/* Interrupt handler */
/*********************/
static void
static irqreturn_t
hfcsx_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -672,17 +672,17 @@ hfcsx_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (!cs) {
printk(KERN_WARNING "HFC-SX: Spurious interrupt!\n");
return;
return IRQ_NONE;
}
if (!(cs->hw.hfcsx.int_m2 & 0x08))
return; /* not initialised */
return IRQ_NONE; /* not initialised */
if (HFCSX_ANYINT & (stat = Read_hfc(cs, HFCSX_STATUS))) {
val = Read_hfc(cs, HFCSX_INT_S1);
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "HFC-SX: stat(%02x) s1(%02x)", stat, val);
} else
return;
return IRQ_NONE;
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "HFC-SX irq %x", val);
......@@ -756,6 +756,7 @@ hfcsx_interrupt(int intno, void *dev_id, struct pt_regs *regs)
} else
val = 0;
}
return IRQ_HANDLED;
}
/********************************************************************/
......
......@@ -32,7 +32,7 @@ hfcs_write_reg(struct IsdnCardState *cs, int data, u8 reg, u8 val)
cs->bc_hw_ops->write_reg(cs, data, reg, val);
}
static void
static irqreturn_t
hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -40,7 +40,7 @@ hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (!cs) {
printk(KERN_WARNING "HFCS: Spurious interrupt!\n");
return;
return IRQ_NONE;
}
if ((HFCD_ANYINT | HFCD_BUSY_NBUSY) &
(stat = hfcs_read_reg(cs, HFCD_DATA, HFCD_STAT))) {
......@@ -52,6 +52,7 @@ hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "HFCS: irq_no_irq stat(%02x)", stat);
}
return IRQ_HANDLED;
}
static void
......
......@@ -28,6 +28,7 @@
#include <linux/tty.h>
#include <linux/serial_reg.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
#define ERROR_STATISTIC
......@@ -886,7 +887,7 @@ struct card_ops {
void (*release) (struct IsdnCardState *);
void (*aux_ind) (struct IsdnCardState *, void *);
void (*led_handler)(struct IsdnCardState *);
void (*irq_func) (int, void *, struct pt_regs *);
irqreturn_t (*irq_func) (int, void *, struct pt_regs *);
};
/* Card specific drivers provide methods to access the
......
......@@ -120,7 +120,7 @@ fcclassic_write_hscx_fifo(struct hscx *hscx, unsigned char * data, int size)
// ----------------------------------------------------------------------
static void
static irqreturn_t
fcclassic_irq(int intno, void *dev, struct pt_regs *regs)
{
struct fritz_adapter *adapter = dev;
......@@ -139,6 +139,7 @@ fcclassic_irq(int intno, void *dev, struct pt_regs *regs)
isac_irq(&adapter->isac);
}
}
return IRQ_HANDLED;
}
// ----------------------------------------------------------------------
......
......@@ -629,7 +629,7 @@ static void fritz_b_l2l1(struct hisax_if *ifc, int pr, void *arg)
// ----------------------------------------------------------------------
static void fcpci2_irq(int intno, void *dev, struct pt_regs *regs)
static irqreturn_t fcpci2_irq(int intno, void *dev, struct pt_regs *regs)
{
struct fritz_adapter *adapter = dev;
unsigned char val;
......@@ -637,16 +637,17 @@ static void fcpci2_irq(int intno, void *dev, struct pt_regs *regs)
val = inb(adapter->io + AVM_STATUS0);
if (!(val & AVM_STATUS0_IRQ_MASK))
/* hopefully a shared IRQ reqest */
return;
return IRQ_NONE;
DBG(2, "STATUS0 %#x", val);
if (val & AVM_STATUS0_IRQ_ISAC)
isacsx_irq(&adapter->isac);
if (val & AVM_STATUS0_IRQ_HDLC)
hdlc_irq(adapter);
return IRQ_HANDLED;
}
static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
static irqreturn_t fcpci_irq(int intno, void *dev, struct pt_regs *regs)
{
struct fritz_adapter *adapter = dev;
unsigned char sval;
......@@ -654,13 +655,14 @@ static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
sval = inb(adapter->io + 2);
if ((sval & AVM_STATUS0_IRQ_MASK) == AVM_STATUS0_IRQ_MASK)
/* possibly a shared IRQ reqest */
return;
return IRQ_NONE;
DBG(2, "sval %#x", sval);
if (!(sval & AVM_STATUS0_IRQ_ISAC))
isac_irq(&adapter->isac);
if (!(sval & AVM_STATUS0_IRQ_HDLC))
hdlc_irq(adapter);
return IRQ_HANDLED;
}
// ----------------------------------------------------------------------
......
......@@ -1321,7 +1321,7 @@ hfcpci_timer_irq(struct hfcpci_adapter *adapter)
// ----------------------------------------------------------------------
// IRQ handler
static void
static irqreturn_t
hfcpci_irq(int intno, void *dev, struct pt_regs *regs)
{
struct hfcpci_adapter *adapter = dev;
......@@ -1329,11 +1329,11 @@ hfcpci_irq(int intno, void *dev, struct pt_regs *regs)
u8 val, stat;
if (!(adapter->int_m2 & 0x08))
return; /* not initialised */ // XX
return IRQ_NONE; /* not initialised */ // XX
stat = hfcpci_readb(adapter, HFCPCI_STATUS);
if (!(stat & HFCPCI_ANYINT))
return;
return IRQ_NONE;
spin_lock(&adapter->hw_lock);
while (loop-- > 0) {
......@@ -1369,6 +1369,7 @@ hfcpci_irq(int intno, void *dev, struct pt_regs *regs)
hfcpci_timer_irq(adapter);
}
spin_unlock(&adapter->hw_lock);
return IRQ_HANDLED;
}
// ----------------------------------------------------------------------
......
......@@ -10,6 +10,8 @@
*
*/
#include <linux/interrupt.h>
/* All Registers original Siemens Spec */
#define HSCX_ISTA 0x20
......@@ -37,7 +39,7 @@
extern void modehscx(struct BCState *bcs, int mode, int bc);
extern void inithscxisac(struct IsdnCardState *cs);
extern void hscx_int_main(struct IsdnCardState *cs, u8 val);
extern void hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs);
extern irqreturn_t hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs);
extern int hscxisac_setup(struct IsdnCardState *cs,
struct dc_hw_ops *isac_ops,
struct bc_hw_ops *hscx_ops);
......@@ -185,7 +185,7 @@ isac_write(struct IsdnCardState *cs, u8 addr, u8 val)
cs->dc_hw_ops->write_reg(cs, addr, val);
}
void
irqreturn_t
hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -221,5 +221,6 @@ hscxisac_irq(int intno, void *dev_id, struct pt_regs *regs)
hscx_write(&cs->bcs[0], HSCX_MASK, 0x0);
hscx_write(&cs->bcs[1], HSCX_MASK, 0x0);
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
......@@ -47,7 +47,7 @@ ipac_init(struct IsdnCardState *cs)
inithscxisac(cs);
}
void
irqreturn_t
ipac_irq(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -90,6 +90,7 @@ ipac_irq(int intno, void *dev_id, struct pt_regs *regs)
ipac_write(cs, IPAC_MASK, 0xFF);
ipac_write(cs, IPAC_MASK, 0xC0);
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
int
......@@ -102,4 +103,5 @@ ipac_setup(struct IsdnCardState *cs, struct dc_hw_ops *ipac_dc_ops,
cs->bc_hw_ops = ipac_bc_ops;
val = ipac_read(cs, IPAC_ID);
printk(KERN_INFO "HiSax: IPAC version %#x\n", val);
return 0;
}
......@@ -10,6 +10,8 @@
*
*/
#include <linux/interrupt.h>
/* All Registers original Siemens Spec */
#define IPAC_CONF 0xC0
......@@ -29,7 +31,7 @@
#define IPAC_TIMR2 0xCC
void ipac_init(struct IsdnCardState *cs);
void ipac_irq(int intno, void *dev_id, struct pt_regs *regs);
irqreturn_t ipac_irq(int intno, void *dev_id, struct pt_regs *regs);
int ipac_setup(struct IsdnCardState *cs, struct dc_hw_ops *ipac_dc_ops,
struct bc_hw_ops *ipac_bc_ops);
......
......@@ -151,7 +151,7 @@ static struct bc_hw_ops hscx_ops = {
.write_fifo = hscx_write_fifo,
};
static void
static irqreturn_t
niccy_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -160,10 +160,10 @@ niccy_interrupt(int intno, void *dev_id, struct pt_regs *regs)
int ival;
ival = inl(cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG);
if (!(ival & PCI_IRQ_ASSERT)) /* IRQ not for us (shared) */
return;
return IRQ_NONE;
outl(ival, cs->hw.niccy.cfg_reg + PCI_IRQ_CTRL_REG);
}
hscxisac_irq(intno, dev_id, regs);
return hscxisac_irq(intno, dev_id, regs);
}
void
......
......@@ -17,7 +17,7 @@
const char *NETjet_S_revision = "$Revision: 2.7.6.6 $";
static void
static irqreturn_t
nj_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -70,6 +70,7 @@ nj_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
}
*/
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static int
......
......@@ -17,7 +17,7 @@
const char *NETjet_U_revision = "$Revision: 2.8.6.6 $";
static void
static irqreturn_t
nj_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -70,6 +70,7 @@ nj_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
}
*/
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static int
......
......@@ -132,13 +132,15 @@ static struct bc_hw_ops hscx_ops = {
.write_fifo = hscx_write_fifo,
};
static void
static irqreturn_t
saphir_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
irqreturn_t ret;
hscxisac_irq(intno, dev_id, regs);
ret = hscxisac_irq(intno, dev_id, regs);
mod_timer(&cs->hw.saphir.timer, jiffies+1*HZ);
return ret;
}
static void
......
......@@ -283,7 +283,7 @@ static struct bc_hw_ops isar_ops = {
.write_reg = isar_write,
};
static void
static irqreturn_t
sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -292,12 +292,12 @@ sedlbauer_interrupt(int intno, void *dev_id, struct pt_regs *regs)
/* The card tends to generate interrupts while being removed
causing us to just crash the kernel. bad. */
printk(KERN_WARNING "Sedlbauer: card not available!\n");
return;
return IRQ_NONE;
}
hscxisac_irq(intno, dev_id, regs);
return hscxisac_irq(intno, dev_id, regs);
}
static void
static irqreturn_t
sedlbauer_isar_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -334,6 +334,7 @@ sedlbauer_isar_interrupt(int intno, void *dev_id, struct pt_regs *regs)
isac_write(cs, ISAC_MASK, 0x0);
isar_write(cs, 0, ISAR_IRQBIT, ISAR_IRQMSK);
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static int
......
......@@ -111,13 +111,14 @@ static struct bc_hw_ops hscx_ops = {
.write_fifo = hscx_write_fifo,
};
static void
static irqreturn_t
sportster_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
hscxisac_irq(intno, dev_id, regs);
bytein(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ +1);
return IRQ_HANDLED;
}
static void
......
......@@ -178,7 +178,7 @@ static struct bc_hw_ops hfc_ops = {
.write_reg = WriteHFC,
};
static void
static irqreturn_t
teleint_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -198,6 +198,7 @@ teleint_interrupt(int intno, void *dev_id, struct pt_regs *regs)
writereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0xFF);
writereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0x0);
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static void
......
......@@ -199,7 +199,7 @@ static struct bc_hw_ops hscx_ops = {
.write_fifo = hscx_write_fifo,
};
static void
static irqreturn_t
telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
#define MAXCOUNT 20
......@@ -223,6 +223,7 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
hscx_write(cs, 0, HSCX_MASK, 0x0);
hscx_write(cs, 1, HSCX_MASK, 0x0);
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static struct card_ops telespci_ops = {
......
......@@ -287,7 +287,7 @@ W6692B_interrupt(struct IsdnCardState *cs, u8 bchan)
}
}
static void
static irqreturn_t
w6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
......@@ -395,6 +395,7 @@ w6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
w6692_write_reg(cs, W_IMASK, 0xff);
}
spin_unlock(&cs->lock);
return IRQ_HANDLED;
}
static void
......
......@@ -32,7 +32,7 @@
/***************************************************/
/* The cards interrupt handler. Called from system */
/***************************************************/
static void
static irqreturn_t
ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
hysdn_card *card = dev_id; /* parameter from irq */
......@@ -41,16 +41,16 @@ ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs)
uchar volatile b;
if (!card)
return; /* error -> spurious interrupt */
return IRQ_NONE; /* error -> spurious interrupt */
if (!card->irq_enabled)
return; /* other device interrupting or irq switched off */
return IRQ_NONE; /* other device interrupting or irq switched off */
save_flags(flags);
cli(); /* no further irqs allowed */
if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
restore_flags(flags); /* restore old state */
return; /* no interrupt requested by E1 */
return IRQ_NONE; /* no interrupt requested by E1 */
}
/* clear any pending ints on the board */
dpr = card->dpram;
......@@ -62,6 +62,7 @@ ergo_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if (!card->hw_lock)
schedule_work(&card->irq_queue);
restore_flags(flags);
return IRQ_HANDLED;
} /* ergo_interrupt */
/******************************************************************************/
......
......@@ -524,7 +524,7 @@ pcbit_firmware_bug(struct pcbit_dev *dev)
}
}
void
irqreturn_t
pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs)
{
struct pcbit_dev *dev;
......@@ -536,11 +536,11 @@ pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs)
if (!dev) {
printk(KERN_WARNING "pcbit_irq_handler: wrong device\n");
return;
return IRQ_NONE;
}
if (dev->interrupt) {
printk(KERN_DEBUG "pcbit: reentering interrupt hander\n");
return;
return IRQ_HANDLED;
}
dev->interrupt = 1;
......@@ -549,7 +549,7 @@ pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs)
if (dev->l2_state == L2_STARTING || dev->l2_state == L2_ERROR) {
pcbit_l2_active_conf(dev, info);
dev->interrupt = 0;
return;
return IRQ_HANDLED;
}
if (info & 0x40U) { /* E bit set */
#ifdef DEBUG
......@@ -557,11 +557,11 @@ pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs)
#endif
pcbit_l2_error(dev);
dev->interrupt = 0;
return;
return IRQ_HANDLED;
}
if (dev->l2_state != L2_RUNNING && dev->l2_state != L2_LOADING) {
dev->interrupt = 0;
return;
return IRQ_HANDLED;
}
ack_seq = (info >> 3) & 0x07U;
read_seq = (info & 0x07U);
......@@ -582,6 +582,7 @@ pcbit_irq_handler(int interrupt, void *devptr, struct pt_regs *regs)
info |= dev->send_seq;
writeb(info, dev->sh_mem + BANK4);
return IRQ_HANDLED;
}
......
......@@ -17,6 +17,8 @@
#ifndef LAYER2_H
#define LAYER2_H
#include <linux/interrupt.h>
#include <asm/byteorder.h>
#define BANK1 0x0000U /* PC -> Board */
......@@ -122,7 +124,7 @@ struct frame_buf {
extern int pcbit_l2_write(struct pcbit_dev * dev, ulong msg, ushort refnum,
struct sk_buff *skb, unsigned short hdr_len);
extern void pcbit_irq_handler(int interrupt, void *, struct pt_regs *regs);
extern irqreturn_t pcbit_irq_handler(int interrupt, void *, struct pt_regs *regs);
extern struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS];
......
......@@ -36,7 +36,7 @@ static int do_reset = 0;
static int sup_irq[] = { 11, 10, 9, 5, 12, 14, 7, 3, 4, 6 };
#define MAX_IRQS 10
extern void interrupt_handler(int, void *, struct pt_regs *);
extern irqreturn_t interrupt_handler(int, void *, struct pt_regs *);
extern int sndpkt(int, int, int, struct sk_buff *);
extern int command(isdn_ctrl *);
extern int indicate_status(int, int, ulong, char*);
......
......@@ -19,6 +19,7 @@
#include "hardware.h"
#include "message.h"
#include "card.h"
#include <linux/interrupt.h>
extern int indicate_status(int, int, ulong, char *);
extern void check_phystat(unsigned long);
......@@ -44,7 +45,8 @@ int get_card_from_irq(int irq)
/*
*
*/
void interrupt_handler(int interrupt, void * cardptr, struct pt_regs *regs ) {
irqreturn_t interrupt_handler(int interrupt, void *cardptr, struct pt_regs *regs)
{
RspMessage rcvmsg;
int channel;
......@@ -54,7 +56,7 @@ void interrupt_handler(int interrupt, void * cardptr, struct pt_regs *regs ) {
if(!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return;
return IRQ_NONE;
}
pr_debug("%s: Entered Interrupt handler\n", adapter[card]->devicename);
......@@ -242,4 +244,5 @@ void interrupt_handler(int interrupt, void * cardptr, struct pt_regs *regs ) {
} /* while */
pr_debug("%s: Exiting Interrupt Handler\n", adapter[card]->devicename);
return IRQ_HANDLED;
}
......@@ -17,6 +17,7 @@
#include <linux/isdnif.h>
#include <linux/init.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
/* Maximum number of channels for this board */
#define TPAM_NBCHANNEL 30
......@@ -197,7 +198,7 @@ extern int parse_U3DataInd(struct sk_buff *, u32 *, u8 **, u16 *);
/* Function prototypes from tpam_queues.c */
extern void tpam_enqueue(tpam_card *, struct sk_buff *);
extern void tpam_enqueue_data(tpam_channel *, struct sk_buff *);
extern void tpam_irq(int, void *, struct pt_regs *);
extern irqreturn_t tpam_irq(int, void *, struct pt_regs *);
extern void tpam_recv_tq(tpam_card *);
extern void tpam_send_tq(tpam_card *);
......
......@@ -173,7 +173,8 @@ static int tpam_command_ioctl_dspsave(tpam_card *card, u32 arg) {
* Return: 0 if OK, <0 on errors.
*/
static int tpam_command_ioctl_dsprun(tpam_card *card) {
u32 signature = 0, timeout, i;
u32 signature = 0, i;
unsigned long timeout;
isdn_ctrl ctrl;
struct sk_buff *skb;
......
......@@ -74,7 +74,8 @@ void tpam_enqueue_data(tpam_channel *channel, struct sk_buff *skb) {
* dev_id: the registered board to the irq
* regs: not used.
*/
void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) {
irqreturn_t tpam_irq(int irq, void *dev_id, struct pt_regs *regs)
{
tpam_card *card = (tpam_card *)dev_id;
u32 ackupload, uploadptr;
u32 waiting_too_long;
......@@ -115,7 +116,7 @@ void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) {
printk(KERN_ERR "TurboPAM(tpam_irq): "
"alloc_skb failed\n");
spin_unlock(&card->lock);
return;
return IRQ_HANDLED;
}
/* build the skb_header */
......@@ -147,7 +148,7 @@ void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) {
spin_unlock(&card->lock);
printk(KERN_ERR "TurboPAM(tpam_irq): "
"waiting too long...\n");
return;
return IRQ_HANDLED;
}
} while (hpic & 0x00000002);
......@@ -169,7 +170,7 @@ void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) {
skb_queue_tail(&card->recvq, skb);
schedule_work(&card->recv_tq);
}
return;
return IRQ_HANDLED;
}
else {
/* it is a ack from the board */
......@@ -185,10 +186,8 @@ void tpam_irq(int irq, void *dev_id, struct pt_regs *regs) {
/* schedule the send queue for execution */
schedule_work(&card->send_tq);
return;
}
/* not reached */
return IRQ_HANDLED;
}
/*
......
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