[zaptel-commits] mattf: branch 1.2 r2923 - /branches/1.2/wctdm24xxp/

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


Author: mattf
Date: Tue Aug 21 13:40:23 2007
New Revision: 2923

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2923
Log:
Allow wctdm24xxp to compile on a 2.4 based kernel

Modified:
    branches/1.2/wctdm24xxp/GpakCust.c
    branches/1.2/wctdm24xxp/GpakCust.h
    branches/1.2/wctdm24xxp/base.c
    branches/1.2/wctdm24xxp/wctdm24xxp.h

Modified: branches/1.2/wctdm24xxp/GpakCust.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp/GpakCust.c?view=diff&rev=2923&r1=2922&r2=2923
==============================================================================
--- branches/1.2/wctdm24xxp/GpakCust.c (original)
+++ branches/1.2/wctdm24xxp/GpakCust.c Tue Aug 21 13:40:23 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: branches/1.2/wctdm24xxp/GpakCust.h
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp/GpakCust.h?view=diff&rev=2923&r1=2922&r2=2923
==============================================================================
--- branches/1.2/wctdm24xxp/GpakCust.h (original)
+++ branches/1.2/wctdm24xxp/GpakCust.h Tue Aug 21 13:40:23 2007
@@ -21,7 +21,9 @@
 #define _GPAKCUST_H
 
 #include "wctdm24xxp.h"
+#ifdef VPM150M_SUPPORT
 #include <linux/firmware.h>
+#endif
 #include "gpakenum.h"
 
 

Modified: branches/1.2/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp/base.c?view=diff&rev=2923&r1=2922&r2=2923
==============================================================================
--- branches/1.2/wctdm24xxp/base.c (original)
+++ branches/1.2/wctdm24xxp/base.c Tue Aug 21 13:40:23 2007
@@ -32,7 +32,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>
@@ -445,6 +447,7 @@
 		}
 	}
 
+#ifdef VPM150M_SUPPORT
 	/* Add our leds in */
 	for (x = 24; x < 28; x++)
 		writechunk[CMD_BYTE(x, 0, 0)] |= leds;
@@ -452,6 +455,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);
 }
@@ -1387,6 +1391,7 @@
 			wctdm_vpm_out(wc,unit,channel,0x01);
 
 		return 0;
+#ifdef VPM150M_SUPPORT
 	} else if (wc->vpm150m) {
 		struct vpm150m *vpm150m = wc->vpm150m;
 
@@ -1400,6 +1405,7 @@
 				queue_work(vpm150m->wq, &vpm150m->work);
 		}
 		return 0;
+#endif
 	} else
 		return -ENODEV;
 }
@@ -2552,6 +2558,9 @@
 }
 
 #ifdef VPM_SUPPORT
+
+#ifdef VPM150M_SUPPORT
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
 static void vpm150m_bh(void *data)
 {
@@ -2896,16 +2905,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");
@@ -2977,6 +2990,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);
@@ -3035,6 +3054,7 @@
 	}
 
 	return;
+#endif  /* VPM150M_SUPPORT */
 
 failed_exit:
 	spin_lock_irqsave(&wc->reglock, flags);
@@ -3460,11 +3480,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);
@@ -3478,6 +3502,7 @@
 
 			kfree(wc->vpm150m);
 		}
+#endif
 		/* Stop any DMA */
 		wctdm_stop_dma(wc);
 

Modified: branches/1.2/wctdm24xxp/wctdm24xxp.h
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp/wctdm24xxp.h?view=diff&rev=2923&r1=2922&r2=2923
==============================================================================
--- branches/1.2/wctdm24xxp/wctdm24xxp.h (original)
+++ branches/1.2/wctdm24xxp/wctdm24xxp.h Tue Aug 21 13:40:23 2007
@@ -87,6 +87,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 */
@@ -103,8 +107,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