summaryrefslogtreecommitdiff
path: root/torisa.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 /torisa.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 'torisa.c')
-rwxr-xr-xtorisa.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/torisa.c b/torisa.c
index c9af479..ca395c8 100755
--- a/torisa.c
+++ b/torisa.c
@@ -269,10 +269,19 @@ tor_probe(void)
}
/* Try to get the irq if the user didn't specify one */
if (irq < 1) {
+#ifdef LINUX26
+ unsigned long irqs;
+ unsigned long delay = jiffies + 5;
+ irqs = probe_irq_on();
+ setctlreg(MASTERCLOCK|INTENA);
+ while((long)(jiffies - delay) < 0);
+ irq = probe_irq_off(irqs);
+#else
autoirq_setup(0);
setctlreg(MASTERCLOCK|INTENA);
/* Wait a jiffie -- that's plenty of time */
irq = autoirq_report(5);
+#endif
}
/* disable interrupts having gotten one */
setctlreg(MASTERCLOCK);
@@ -316,7 +325,7 @@ static int torisa_rbsbits(struct zt_chan *chan, int bits)
u_char m,c;
int k,n,b;
struct torisa_pvt *p = chan->pvt;
- unsigned int flags;
+ unsigned long flags;
#if 0
printk("Setting bits to %x hex on channel %s\n", bits, chan->name);
#endif
@@ -393,7 +402,7 @@ static int torisa_shutdown(struct zt_span *span)
int i;
int tspan;
int wasrunning;
- unsigned int flags;
+ unsigned long flags;
tspan = getspan(span);
if (tspan < 0) {
@@ -425,7 +434,7 @@ static int torisa_startup(struct zt_span *span)
unsigned long endjif;
int i;
int tspan;
- unsigned int flags;
+ unsigned long flags;
char *coding;
char *framing;
char *crcing;
@@ -609,7 +618,7 @@ static int torisa_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
static int torisa_chanconfig(struct zt_chan *chan, int sigtype)
{
int alreadyrunning;
- unsigned int flags;
+ unsigned long flags;
alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
if (debug) {
if (alreadyrunning)
@@ -626,13 +635,17 @@ static int torisa_chanconfig(struct zt_chan *chan, int sigtype)
static int torisa_open(struct zt_chan *chan)
{
+#ifndef LINUX26
MOD_INC_USE_COUNT;
+#endif
return 0;
}
static int torisa_close(struct zt_chan *chan)
{
+#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#endif
return 0;
}
@@ -723,7 +736,11 @@ static void torisa_tasklet(unsigned long data)
static int txerrors;
+#ifdef LINUX26
+static irqreturn_t torisa_intr(int irq, void *dev_id, struct pt_regs *regs)
+#else
static void torisa_intr(int irq, void *dev_id, struct pt_regs *regs)
+#endif
{
static unsigned int passno = 0, mysynccnt = 0, lastsyncsrc = -1;
int n, n1, i, j, k, x, mysyncsrc, oldn;
@@ -742,7 +759,11 @@ static void torisa_intr(int irq, void *dev_id, struct pt_regs *regs)
/* make sure its a real interrupt for us */
if (!(getctlreg() & 1)) /* if not, just return */
{
+#ifdef LINUX26
+ return IRQ_NONE;
+#else
return;
+#endif
}
/* set outbit and put int 16 bit bus mode, reset interrupt enable */
@@ -1008,6 +1029,9 @@ static void torisa_intr(int irq, void *dev_id, struct pt_regs *regs)
/* If this is the last pass, then prepare the next set */
/* clear outbit, restore interrupt enable */
setctlreg(clockvals[syncsrc] | INTENA);
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#endif
}