summaryrefslogtreecommitdiff
path: root/wct1xxp.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 /wct1xxp.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 'wct1xxp.c')
-rwxr-xr-xwct1xxp.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/wct1xxp.c b/wct1xxp.c
index 9c7537b..f9e20e3 100755
--- a/wct1xxp.c
+++ b/wct1xxp.c
@@ -212,7 +212,9 @@ static int t1xxp_open(struct zt_chan *chan)
if (wc->dead)
return -ENODEV;
wc->usecount++;
+#ifndef LINUX26
MOD_INC_USE_COUNT;
+#endif
return 0;
}
@@ -242,7 +244,7 @@ static int __control_set_reg(struct t1xxp *wc, int reg, unsigned char val)
static int control_set_reg(struct t1xxp *wc, int reg, unsigned char val)
{
- long flags;
+ unsigned long flags;
int res;
spin_lock_irqsave(&wc->lock, flags);
res = __control_set_reg(wc, reg, val);
@@ -266,7 +268,7 @@ static int __control_get_reg(struct t1xxp *wc, int reg)
static int control_get_reg(struct t1xxp *wc, int reg)
{
- long flags;
+ unsigned long flags;
int res;
spin_lock_irqsave(&wc->lock, flags);
res = __control_get_reg(wc, reg);
@@ -285,7 +287,9 @@ static int t1xxp_close(struct zt_chan *chan)
{
struct t1xxp *wc = chan->pvt;
wc->usecount--;
+#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#endif
/* If we're dead, release us now */
if (!wc->usecount && wc->dead)
t1xxp_release(wc);
@@ -351,7 +355,7 @@ static void t1xxp_t1_framer_start(struct t1xxp *wc)
char *coding, *framing;
unsigned long endjiffies;
int alreadyrunning = wc->span.flags & ZT_FLAG_RUNNING;
- long flags;
+ unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
@@ -409,7 +413,7 @@ static void t1xxp_e1_framer_start(struct t1xxp *wc)
char *coding, *framing;
unsigned long endjiffies;
int alreadyrunning = wc->span.flags & ZT_FLAG_RUNNING;
- long flags;
+ unsigned long flags;
char *crcing = "";
unsigned char ccr1, tcr1, tcr2;
@@ -479,7 +483,7 @@ static int t1xxp_framer_sanity_check(struct t1xxp *wc)
{
int res;
int chipid;
- long flags;
+ unsigned long flags;
int x;
/* Sanity check */
@@ -499,7 +503,7 @@ static int t1xxp_framer_sanity_check(struct t1xxp *wc)
static int t1xxp_framer_hard_reset(struct t1xxp *wc)
{
int x;
- long flags;
+ unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
/* Initialize all registers to 0 */
@@ -552,7 +556,7 @@ static int t1xxp_framer_hard_reset(struct t1xxp *wc)
static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
{
struct t1xxp *wc = chan->pvt;
- long flags;
+ unsigned long flags;
int b,o;
unsigned char mask;
@@ -639,7 +643,7 @@ static int t1xxp_startup(struct zt_span *span)
static int t1xxp_shutdown(struct zt_span *span)
{
struct t1xxp *wc = span->pvt;
- long flags;
+ unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
__t1xxp_stop_dma(wc);
@@ -655,7 +659,7 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
{
struct t1xxp *wc = span->pvt;
int res = 0;
- long flags;
+ unsigned long flags;
spin_lock_irqsave(&wc->lock, flags);
if (wc->ise1) {
switch(cmd) {
@@ -717,7 +721,7 @@ static int t1xxp_maint(struct zt_span *span, int cmd)
static int t1xxp_chanconfig(struct zt_chan *chan, int sigtype)
{
struct t1xxp *wc = chan->pvt;
- int flags;
+ unsigned long flags;
int alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
spin_lock_irqsave(&wc->lock, flags);
@@ -1119,18 +1123,26 @@ static void __t1xxp_do_counters(struct t1xxp *wc)
}
}
+#ifdef LINUX26
+static irqreturn_t t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#else
static void t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#endif
{
struct t1xxp *wc = dev_id;
unsigned char ints;
- long flags;
+ unsigned long flags;
int x;
ints = inb(wc->ioaddr + WC_INTSTAT);
outb(ints, wc->ioaddr + WC_INTSTAT);
if (!ints)
+#ifdef LINUX26
+ return IRQ_NONE;
+#else
return;
+#endif
if (!wc->intcount) {
if (debug) printk("Got interrupt: 0x%04x\n", ints);
@@ -1176,6 +1188,9 @@ static void t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (ints & 0x20)
printk("PCI Target abort\n");
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#endif
}
static int t1xxp_hardware_init(struct t1xxp *wc)