[zaptel-commits] mattf: trunk r2925 - in /trunk: ./ wctdm24xxp/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Tue Aug 21 13:43:07 CDT 2007


Author: mattf
Date: Tue Aug 21 13:43:06 2007
New Revision: 2925

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2925
Log:
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
........

................

Modified:
    trunk/   (props changed)
    trunk/wctdm24xxp/GpakCust.c
    trunk/wctdm24xxp/GpakCust.h
    trunk/wctdm24xxp/base.c
    trunk/wctdm24xxp/wctdm24xxp.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/wctdm24xxp/GpakCust.c
URL: http://svn.digium.com/view/zaptel/trunk/wctdm24xxp/GpakCust.c?view=diff&rev=2925&r1=2924&r2=2925
==============================================================================
--- trunk/wctdm24xxp/GpakCust.c (original)
+++ trunk/wctdm24xxp/GpakCust.c Tue Aug 21 13:43:06 2007
@@ -368,6 +368,7 @@
     unsigned int NumBytes       /* number of bytes to read */
     )
 {
+#ifdef VPM150M_SUPPORT
 	struct wctdm_firmware *fw = FileId;
 	unsigned int i, count;
 
@@ -385,4 +386,5 @@
 	fw->offset += count;
 
 	return count;
-}
+#endif
+}

Modified: trunk/wctdm24xxp/GpakCust.h
URL: http://svn.digium.com/view/zaptel/trunk/wctdm24xxp/GpakCust.h?view=diff&rev=2925&r1=2924&r2=2925
==============================================================================
--- trunk/wctdm24xxp/GpakCust.h (original)
+++ trunk/wctdm24xxp/GpakCust.h Tue Aug 21 13:43:06 2007
@@ -21,7 +21,9 @@
 #define _GPAKCUST_H
 
 #include "wctdm24xxp.h"
+#ifdef VPM150M_SUPPORT
 #include <linux/firmware.h>
+#endif
 #include "gpakenum.h"
 
 

Modified: trunk/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/trunk/wctdm24xxp/base.c?view=diff&rev=2925&r1=2924&r2=2925
==============================================================================
--- trunk/wctdm24xxp/base.c (original)
+++ trunk/wctdm24xxp/base.c Tue Aug 21 13:43:06 2007
@@ -42,7 +42,9 @@
 #include <linux/errno.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
+#ifdef VPM150M_SUPPORT
 #include <linux/firmware.h>
+#endif
 #include <linux/workqueue.h>
 #include <linux/delay.h>
 #include <asm/semaphore.h>
@@ -460,6 +462,7 @@
 		}
 	}
 
+#ifdef VPM150M_SUPPORT
 	/* Add our leds in */
 	for (x = 24; x < 28; x++)
 		writechunk[CMD_BYTE(x, 0, 0)] |= leds;
@@ -467,6 +470,7 @@
 	/* 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 @@
 			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 @@
 				queue_work(vpm150m->wq, &vpm150m->work);
 		}
 		return 0;
+#endif
 	} else
 		return -ENODEV;
 }
@@ -3150,6 +3156,9 @@
 }
 
 #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 @@
 
 	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 @@
 	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 @@
 	}
 
 	return;
+#endif  /* VPM150M_SUPPORT */
 
 failed_exit:
 	spin_lock_irqsave(&wc->reglock, flags);
@@ -4063,11 +4083,15 @@
 
 static void __devexit wctdm_remove_one(struct pci_dev *pdev)
 {
+	struct wctdm *wc = pci_get_drvdata(pdev);
+
+#ifdef VPM150M_SUPPORT
 	unsigned long flags;
-	struct wctdm *wc = pci_get_drvdata(pdev);
 	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 @@
 
 			kfree(wc->vpm150m);
 		}
+#endif
 		/* Stop any DMA */
 		wctdm_stop_dma(wc);
 

Modified: trunk/wctdm24xxp/wctdm24xxp.h
URL: http://svn.digium.com/view/zaptel/trunk/wctdm24xxp/wctdm24xxp.h?view=diff&rev=2925&r1=2924&r2=2925
==============================================================================
--- trunk/wctdm24xxp/wctdm24xxp.h (original)
+++ trunk/wctdm24xxp/wctdm24xxp.h Tue Aug 21 13:43:06 2007
@@ -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 {
+#ifdef VPM150M_SUPPORT
 	struct workqueue_struct *wq;
 	struct work_struct work;
+#endif
 	struct wctdm *wc;
 
 	int dspid;




More information about the zaptel-commits mailing list