summaryrefslogtreecommitdiff
path: root/wcfxs.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 /wcfxs.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 'wcfxs.c')
-rwxr-xr-xwcfxs.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/wcfxs.c b/wcfxs.c
index caa2666..3ade91a 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -340,7 +340,7 @@ static void __wcfxs_setreg(struct wcfxs *wc, int card, unsigned char reg, unsign
static void wcfxs_setreg(struct wcfxs *wc, int card, unsigned char reg, unsigned char value)
{
- long flags;
+ unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
__wcfxs_setreg(wc, card, reg, value);
spin_unlock_irqrestore(&wc->lock, flags);
@@ -355,7 +355,7 @@ static unsigned char __wcfxs_getreg(struct wcfxs *wc, int card, unsigned char re
static unsigned char wcfxs_getreg(struct wcfxs *wc, int card, unsigned char reg)
{
- long flags;
+ unsigned long flags;
unsigned char res;
spin_lock_irqsave(&wc->lock, flags);
res = __wcfxs_getreg(wc, card, reg);
@@ -390,7 +390,7 @@ static int __wait_access(struct wcfxs *wc, int card)
static int wcfxs_setreg_indirect(struct wcfxs *wc, int card, unsigned char address, unsigned short data)
{
- long flags;
+ unsigned long flags;
int res = -1;
spin_lock_irqsave(&wc->lock, flags);
if(!__wait_access(wc, card)) {
@@ -405,7 +405,7 @@ static int wcfxs_setreg_indirect(struct wcfxs *wc, int card, unsigned char addre
static int wcfxs_getreg_indirect(struct wcfxs *wc, int card, unsigned char address)
{
- long flags;
+ unsigned long flags;
int res = -1;
char *p=NULL;
spin_lock_irqsave(&wc->lock, flags);
@@ -470,8 +470,11 @@ static int wcfxs_verify_indirect_regs(struct wcfxs *wc, int card)
}
return 0;
}
-
+#ifdef LINUX26
+static irqreturn_t wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#else
static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#endif
{
struct wcfxs *wc = dev_id;
unsigned char ints;
@@ -481,18 +484,30 @@ static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outb(ints, wc->ioaddr + WC_INTSTAT);
if (!ints)
+#ifdef LINUX26
+ return IRQ_NONE;
+#else
return;
+#endif
if (ints & 0x10) {
/* Stop DMA, wait for watchdog */
printk("FXS PCI Master abort\n");
wcfxs_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
}
for (x=0;x<4;x++) {
@@ -534,7 +549,9 @@ static void wcfxs_interrupt(int irq, void *dev_id, struct pt_regs *regs)
wcfxs_receiveprep(wc, ints);
wcfxs_transmitprep(wc, ints);
}
-
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#endif
}
@@ -1073,7 +1090,9 @@ static int wcfxs_open(struct zt_chan *chan)
if (wc->dead)
return -ENODEV;
wc->usecount++;
+#ifndef LINUX26
MOD_INC_USE_COUNT;
+#endif
return 0;
}
@@ -1089,7 +1108,9 @@ static int wcfxs_close(struct zt_chan *chan)
struct wcfxs *wc = chan->pvt;
int x;
wc->usecount--;
+#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#endif
for (x=0;x<wc->cards;x++)
wc->idletxhookstate[x] = 1;
/* If we're dead, release us now */