From d0eb84715f6af1485af1a07bafe24b5158b9dd68 Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 21 Aug 2007 18:43:06 +0000 Subject: Merged revisions 2924 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.4 ................ r2924 | mattf | 2007-08-21 13:42:19 -0500 (Tue, 21 Aug 2007) | 9 lines Merged revisions 2923 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.2 ........ r2923 | mattf | 2007-08-21 13:40:23 -0500 (Tue, 21 Aug 2007) | 1 line Allow wctdm24xxp to compile on a 2.4 based kernel ........ ................ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2925 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wctdm24xxp/GpakCust.c | 2 ++ wctdm24xxp/GpakCust.h | 2 ++ wctdm24xxp/base.c | 29 +++++++++++++++++++++++++++-- wctdm24xxp/wctdm24xxp.h | 6 ++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/wctdm24xxp/GpakCust.c b/wctdm24xxp/GpakCust.c index bdce428..aefb406 100644 --- a/wctdm24xxp/GpakCust.c +++ b/wctdm24xxp/GpakCust.c @@ -368,6 +368,7 @@ int gpakReadFile( unsigned int NumBytes /* number of bytes to read */ ) { +#ifdef VPM150M_SUPPORT struct wctdm_firmware *fw = FileId; unsigned int i, count; @@ -385,4 +386,5 @@ int gpakReadFile( fw->offset += count; return count; +#endif } diff --git a/wctdm24xxp/GpakCust.h b/wctdm24xxp/GpakCust.h index dfb6103..96fb522 100644 --- a/wctdm24xxp/GpakCust.h +++ b/wctdm24xxp/GpakCust.h @@ -21,7 +21,9 @@ #define _GPAKCUST_H #include "wctdm24xxp.h" +#ifdef VPM150M_SUPPORT #include +#endif #include "gpakenum.h" diff --git a/wctdm24xxp/base.c b/wctdm24xxp/base.c index e7537f1..5a22ac5 100644 --- a/wctdm24xxp/base.c +++ b/wctdm24xxp/base.c @@ -42,7 +42,9 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00 db #include #include #include +#ifdef VPM150M_SUPPORT #include +#endif #include #include #include @@ -460,6 +462,7 @@ static inline void cmd_dequeue_vpm150m(struct wctdm *wc, volatile unsigned char } } +#ifdef VPM150M_SUPPORT /* Add our leds in */ for (x = 24; x < 28; x++) writechunk[CMD_BYTE(x, 0, 0)] |= leds; @@ -467,6 +470,7 @@ static inline void cmd_dequeue_vpm150m(struct wctdm *wc, volatile unsigned char /* Now let's figure out if we need to check for DTMF */ if (test_bit(VPM150M_ACTIVE, &vpm150m->control) && !whichframe && !(wc->intcount % 100)) queue_work(vpm150m->wq, &vpm150m->work); +#endif spin_unlock_irqrestore(&wc->reglock, flags); } @@ -1501,6 +1505,7 @@ static int wctdm_echocan(struct zt_chan *chan, int eclen) wctdm_vpm_out(wc,unit,channel,0x01); return 0; +#ifdef VPM150M_SUPPORT } else if (wc->vpm150m) { struct vpm150m *vpm150m = wc->vpm150m; @@ -1514,6 +1519,7 @@ static int wctdm_echocan(struct zt_chan *chan, int eclen) queue_work(vpm150m->wq, &vpm150m->work); } return 0; +#endif } else return -ENODEV; } @@ -3150,6 +3156,9 @@ static void wctdm_disable_interrupts(struct wctdm *wc) } #ifdef VPM_SUPPORT + +#ifdef VPM150M_SUPPORT + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void vpm150m_bh(void *data) { @@ -3494,16 +3503,20 @@ static int vpm150m_config_hw(struct wctdm *wc) return 0; } +#endif /* VPM150M_SUPPORT */ static void wctdm_vpm150m_init(struct wctdm *wc) { unsigned short i; struct vpm150m *vpm150m; unsigned short reg; + unsigned long flags; + +#ifdef VPM150M_SUPPORT struct wctdm_firmware fw; gpakDownloadStatus_t downloadstatus; gpakPingDspStat_t pingstatus; - unsigned long flags; +#endif if (!vpmsupport) { printk("VPM: Support Disabled\n"); @@ -3575,6 +3588,12 @@ static void wctdm_vpm150m_init(struct wctdm *wc) if (debug & DEBUG_ECHOCAN) printk("Passed\n"); +#ifndef VPM150M_SUPPORT + printk("Found VPMADT032 module but it is not able to function in anything less than a version 2.6 kernel\n"); + printk("Please update your kernel to a 2.6 or later kernel to enable it\n"); + goto failed_exit; +#else + #if 0 /* Load the firmware */ set_bit(VPM150M_SPIRESET, &vpm150m->control); @@ -3633,6 +3652,7 @@ static void wctdm_vpm150m_init(struct wctdm *wc) } return; +#endif /* VPM150M_SUPPORT */ failed_exit: spin_lock_irqsave(&wc->reglock, flags); @@ -4063,11 +4083,15 @@ static void wctdm_release(struct wctdm *wc) static void __devexit wctdm_remove_one(struct pci_dev *pdev) { - unsigned long flags; struct wctdm *wc = pci_get_drvdata(pdev); + +#ifdef VPM150M_SUPPORT + unsigned long flags; struct vpm150m *vpm150m = wc->vpm150m; +#endif if (wc) { +#ifdef VPM150M_SUPPORT if (vpm150m) { clear_bit(VPM150M_DTMFDETECT, &vpm150m->control); clear_bit(VPM150M_ACTIVE, &vpm150m->control); @@ -4081,6 +4105,7 @@ static void __devexit wctdm_remove_one(struct pci_dev *pdev) kfree(wc->vpm150m); } +#endif /* Stop any DMA */ wctdm_stop_dma(wc); diff --git a/wctdm24xxp/wctdm24xxp.h b/wctdm24xxp/wctdm24xxp.h index 1b32103..b7067ca 100644 --- a/wctdm24xxp/wctdm24xxp.h +++ b/wctdm24xxp/wctdm24xxp.h @@ -89,6 +89,10 @@ #define VPM_SUPPORT +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) +#define VPM150M_SUPPORT +#endif + #ifdef VPM_SUPPORT /* Define to get more attention-grabbing but slightly more CPU using echocan status */ @@ -105,8 +109,10 @@ struct vpm150m_cmd { }; struct vpm150m { +#ifdef VPM150M_SUPPORT struct workqueue_struct *wq; struct work_struct work; +#endif struct wctdm *wc; int dspid; -- cgit v1.2.3