summaryrefslogtreecommitdiff
path: root/pciradio.c
diff options
context:
space:
mode:
authorjdixon <jdixon@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-08-01 00:15:57 +0000
committerjdixon <jdixon@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-08-01 00:15:57 +0000
commit3e131c35c93b441b039fd0f1e2cf6277438d41c9 (patch)
treec24a58fe18d1f3c7ae8aca727819c14fb8a45d59 /pciradio.c
parent45e0df08a84367ecb5cb51bb0fcbdf5d058f7b7a (diff)
Merged back in some changes I wasnt aware of
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@2807 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'pciradio.c')
-rw-r--r--pciradio.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/pciradio.c b/pciradio.c
index bb02914..55270c1 100644
--- a/pciradio.c
+++ b/pciradio.c
@@ -2,11 +2,11 @@
* PCI RADIO Card Zapata Telephony PCI Quad Radio Interface driver
*
* Written by Jim Dixon <jim@lambdatel.com>
- * Based on previous work by Mark Spencer <markster@linux-support.net>
+ * Based on previous work by Mark Spencer <markster@digium.com>
* Based on previous works, designs, and archetectures conceived and
* written by Jim Dixon <jim@lambdatel.com>.
*
- * Copyright (C) 2001-2004 Jim Dixon / Zapata Telephony.
+ * Copyright (C) 2001-2007 Jim Dixon / Zapata Telephony.
*
* All rights reserved.
*
@@ -56,7 +56,11 @@ With driver: 303826 (1.5 %)
#ifdef STANDALONE_ZAPATA
#include "zaptel.h"
#else
-#include <linux/zaptel.h>
+#include <zaptel/zaptel.h>
+#endif
+
+#ifdef LINUX26
+#include <linux/moduleparam.h>
#endif
#define RAD_MAX_IFACES 128
@@ -170,8 +174,8 @@ struct pciradio {
volatile unsigned long ioaddr;
dma_addr_t readdma;
dma_addr_t writedma;
- volatile int *writechunk; /* Double-word aligned write memory */
- volatile int *readchunk; /* Double-word aligned read memory */
+ volatile unsigned int *writechunk; /* Double-word aligned write memory */
+ volatile unsigned int *readchunk; /* Double-word aligned read memory */
unsigned char saudio_status[NUM_CHANS];
char gotcor[NUM_CHANS];
char gotct[NUM_CHANS];
@@ -555,7 +559,7 @@ unsigned long flags;
static void _do_encdec(struct pciradio *rad)
{
int i,n;
-unsigned char byte1,byte2;
+unsigned char byte1 = 0,byte2 = 0;
/* return doing nothing if busy */
if ((rad->encdec.lastcmd + 2) > jiffies) return;
@@ -729,11 +733,15 @@ static void pciradio_stop_dma(struct pciradio *rad);
static void pciradio_reset_serial(struct pciradio *rad);
static void pciradio_restart_dma(struct pciradio *rad);
+#ifdef LEAVE_THIS_COMMENTED_OUT
#ifdef LINUX26
static irqreturn_t pciradio_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#else
static void pciradio_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#endif
+#endif
+
+ZAP_IRQ_HANDLER(pciradio_interrupt)
{
struct pciradio *rad = dev_id;
unsigned char ints,byte1,byte2,gotcor,gotctcss,gotslowctcss,ctcss;
@@ -1332,7 +1340,7 @@ static int pciradio_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long
if ((rad->rxindex < stack.p.data) &&
(rad->srxtimer < SRX_TIMEOUT) &&
((rad->remmode[chan->chanpos - 1] == ZT_RADPAR_REM_SERIAL) ||
- (!strchr(rad->rxbuf,'\r'))))
+ (!strchr((char *)rad->rxbuf,'\r'))))
{
spin_unlock_irqrestore(&rad->lock,flags);
interruptible_sleep_on_timeout(&mywait,2);
@@ -1752,7 +1760,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
/* Allocate enough memory for two zt chunks, receive and transmit. Each sample uses
32 bits. Allocate an extra set just for control too */
- rad->writechunk = (int *)pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &rad->writedma);
+ rad->writechunk = pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &rad->writedma);
if (!rad->writechunk) {
printk("pciradio: Unable to allocate DMA-able memory\n");
if (rad->freeregion)
@@ -1807,7 +1815,7 @@ static int __devinit pciradio_init_one(struct pci_dev *pdev, const struct pci_de
}
- if (request_irq(pdev->irq, pciradio_interrupt, SA_SHIRQ, "pciradio", rad)) {
+ if (request_irq(pdev->irq, pciradio_interrupt, ZAP_IRQ_SHARED, "pciradio", rad)) {
printk("pciradio: Unable to request IRQ %d\n", pdev->irq);
if (rad->freeregion)
release_region(rad->ioaddr, 0xff);