summaryrefslogtreecommitdiff
path: root/tor2.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-01-02 23:28:52 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-01-02 23:28:52 +0000
commitabf800fc845ce8736704cbe769f831b73700fa04 (patch)
tree49e2e374460c388f00861d170d97caa6b4d980ba /tor2.c
parent54335c58ad6e5d482d73038bc1894e4e9156afcd (diff)
*Begin* Linux 2.6 build process... not all drivers build, and lots of DEC/INC usecount warnings need to be replaced
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@291 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'tor2.c')
-rwxr-xr-xtor2.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/tor2.c b/tor2.c
index 8392354..de76a82 100755
--- a/tor2.c
+++ b/tor2.c
@@ -181,7 +181,11 @@ static int tor2_shutdown(struct zt_span *span);
static int tor2_rbsbits(struct zt_chan *chan, int bits);
static int tor2_maint(struct zt_span *span, int cmd);
static int tor2_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data);
+#ifdef LINUX26
+static irqreturn_t tor2_intr(int irq, void *dev_id, struct pt_regs *regs);
+#else
static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs);
+#endif
/* translations of data channels for 24 channels in a 32 bit PCM highway */
@@ -228,7 +232,7 @@ static int tor2_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
static int tor2_chanconfig(struct zt_chan *chan, int sigtype)
{
int alreadyrunning;
- unsigned int flags;
+ unsigned long flags;
struct tor2_chan *p = chan->pvt;
alreadyrunning = chan->span->flags & ZT_FLAG_RUNNING;
@@ -564,7 +568,7 @@ err_out_free_tor:
for (x = 0; x < 3; x++) kfree(tor->chans[x]);
kfree(tor);
}
- return -NODEV;
+ return -ENODEV;
}
static struct pci_driver tor2_driver;
@@ -652,7 +656,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
u_char m,c;
int k,n,b;
struct tor2_chan *p = chan->pvt;
- unsigned int flags;
+ unsigned long flags;
#if 0
printk("Setting bits to %d on channel %s\n", bits, chan->name);
#endif
@@ -721,7 +725,7 @@ static int tor2_shutdown(struct zt_span *span)
int i;
int tspan;
int wasrunning;
- unsigned int flags;
+ unsigned long flags;
struct tor2_span *p = span->pvt;
tspan = p->span + 1;
@@ -762,7 +766,7 @@ static int tor2_startup(struct zt_span *span)
unsigned long endjif;
int i;
int tspan;
- unsigned int flags;
+ unsigned long flags;
char *coding;
char *framing;
char *crcing;
@@ -1078,7 +1082,7 @@ static int tor2_findsync(struct tor2 *tor)
{
int i;
int x;
- long flags;
+ unsigned long flags;
int p;
int nonzero;
int newsyncsrc = 0; /* Zaptel span number */
@@ -1150,7 +1154,11 @@ found:
return 0;
}
+#ifdef LINUX26
+static irqreturn_t tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
+#else
static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
+#endif
{
int n, i, j, k, syncsrc;
unsigned long rxword,txword;
@@ -1162,7 +1170,11 @@ static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
/* make sure its a real interrupt for us */
if (!(tor->mem8[STATREG] & INTACTIVE)) /* if not, just return */
{
+#ifdef LINUX26
+ return IRQ_NONE;
+#else
return;
+#endif
}
if (tor->cardtype == TYPE_E1)
@@ -1442,6 +1454,9 @@ static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
else
/* clear OUTBIT and enable interrupts */
tor->mem8[CTLREG] = INTENA | tor->master;
+#ifdef LINUX26
+ return IRQ_RETVAL(1);
+#endif
}