summaryrefslogtreecommitdiff
path: root/wcfxo.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-01-06 13:26:44 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-01-06 13:26:44 +0000
commit80f25d9ed6ea4af860f3127bad4cf43bbd258b5c (patch)
tree09a511f55802af71ff92d3f846198a03b1dbd534 /wcfxo.c
parentabf800fc845ce8736704cbe769f831b73700fa04 (diff)
Clean build on Linux 2.6, will need lots of testing
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@292 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wcfxo.c')
-rwxr-xr-xwcfxo.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/wcfxo.c b/wcfxo.c
index 372d538..4e3fd79 100755
--- a/wcfxo.c
+++ b/wcfxo.c
@@ -91,7 +91,7 @@
#define PEGCOUNT 5 /* 5 cycles of pegging means RING */
struct reg {
- int flags;
+ unsigned long flags;
unsigned char index;
unsigned char reg;
unsigned char value;
@@ -108,7 +108,7 @@ struct wcfxo {
int usecount;
int dead;
int pos;
- int flags;
+ unsigned long flags;
int freeregion;
int ring;
int offhook;
@@ -162,7 +162,7 @@ struct wcfxo {
struct wcfxo_desc {
char *name;
- int flags;
+ unsigned long flags;
};
@@ -387,7 +387,11 @@ static void wcfxo_tasklet(unsigned long data)
static void wcfxo_stop_dma(struct wcfxo *wc);
static void wcfxo_restart_dma(struct wcfxo *wc);
+#ifdef LINUX26
+static irqreturn_t wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#else
static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#endif
{
struct wcfxo *wc = dev_id;
unsigned char ints;
@@ -402,7 +406,11 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!ints)
+#ifdef LINUX26
+ return IRQ_NONE;
+#else
return;
+#endif
if (ints & 0x0c) { /* if there is a rx interrupt pending */
#ifdef ENABLE_TASKLETS
@@ -425,12 +433,20 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("FXO PCI Master abort\n");
/* Stop DMA andlet the watchdog start it again */
wcfxo_stop_dma(wc);
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#else
return;
+#endif
}
if (ints & 0x20) {
printk("PCI Target abort\n");
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#else
return;
+#endif
}
if (1 /* !(wc->report % 0xf) */) {
/* Check for BATTERY from register and debounce for 8 ms */
@@ -504,6 +520,9 @@ static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#endif
}
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#endif
}
static int wcfxo_setreg(struct wcfxo *wc, unsigned char reg, unsigned char value)
@@ -527,7 +546,9 @@ static int wcfxo_open(struct zt_chan *chan)
if (wc->dead)
return -ENODEV;
wc->usecount++;
+#ifndef LINUX26
MOD_INC_USE_COUNT;
+#endif
return 0;
}
@@ -542,7 +563,9 @@ static int wcfxo_close(struct zt_chan *chan)
{
struct wcfxo *wc = chan->pvt;
wc->usecount--;
+#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#endif
/* If we're dead, release us now */
if (!wc->usecount && wc->dead)
wcfxo_release(wc);