[svn-commits] mspiceland: branch linux/mspiceland/dahdi-trunk-adtapiupdatefor117 r4614 - in...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 17 17:21:36 CDT 2008


Author: mspiceland
Date: Thu Jul 17 17:21:35 2008
New Revision: 4614

URL: http://svn.digium.com/view/dahdi?view=rev&rev=4614
Log:
Updating ADT API for firmware revision 1.17.

Modified:
    linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.c
    linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.h
    linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/base.c
    linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.c
    linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.h
    linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/vpmadt032.c

Modified: linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.c
URL: http://svn.digium.com/view/dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.c?view=diff&rev=4614&r1=4613&r2=4614
==============================================================================
--- linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.c (original)
+++ linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.c Thu Jul 17 17:21:35 2008
@@ -30,7 +30,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <linux/version.h>
@@ -564,7 +564,7 @@
                     ((pPortConfig->RxFrameSyncPolarity2 << 4) & 0x0010) |
                     ((pPortConfig->TxFrameSyncPolarity2 << 3) & 0x0008) |
                     ((pPortConfig->CompandingMode2 << 1) & 0x0006) |
-                    (pPortConfig->SerialWordSize1 & 0x0001));
+                    (pPortConfig->SerialWordSize2 & 0x0001));
 
     MsgBuffer[12] = (DSP_WORD)
                    (((pPortConfig->DxDelay3 << 11) & 0x0800) |
@@ -737,7 +737,22 @@
         MsgBuffer[34]  = (DSP_WORD)
                          pChanConfig->EcanParametersB.EcanFirSegmentLen;   
 
-        MsgLength = 70; // byte number == 35*2 
+        MsgBuffer[35] = (DSP_WORD)
+                       (
+                       ((pChanConfig->EcanParametersB.EcanReconvergenceCheckEnable <<5) & 0x20)  |
+                       ((pChanConfig->EcanParametersA.EcanReconvergenceCheckEnable <<4) & 0x10)  |
+                       ((pChanConfig->EcanParametersB.EcanTandemOperationEnable <<3) & 0x8)  |
+                       ((pChanConfig->EcanParametersA.EcanTandemOperationEnable <<2) & 0x4)  |
+                       ((pChanConfig->EcanParametersB.EcanMixedFourWireMode << 1) & 0x2) | 
+                        (pChanConfig->EcanParametersA.EcanMixedFourWireMode & 1)
+                        );
+        MsgBuffer[36]  = (DSP_WORD)
+                         pChanConfig->EcanParametersA.EcanMaxDoubleTalkThres;   
+
+        MsgBuffer[37]  = (DSP_WORD)
+                         pChanConfig->EcanParametersB.EcanMaxDoubleTalkThres;   
+
+        MsgLength = 76; // byte number == 38*2 
         break;
 
 
@@ -950,9 +965,6 @@
             if (EventDataLength > WORD_BUFFER_SIZE)
             {
                 gpakUnlockAccess(DspId);
-#if 0
-		printk("EventDataLength > WORD_BUFFER_SIZE (%d)\n", EventDataLength);
-#endif
                 return (RefInvalidEvent);
             }
             ReadCircBuffer(DspId, BufrBaseAddress, BufrLastAddress, &TakeAddress,
@@ -965,18 +977,11 @@
             TakeIndex += EventDataLength;
             if (TakeIndex >= BufrSize)
                 TakeIndex -= BufrSize;
-            if (EventDataLength != 4) {
-#if 0
-		    printk("EventDataLength != 4 it's %d\n", EventDataLength);
-#endif
+            if (EventDataLength != 4)
                 EventError = 1;
-	    }
             break;
 
         default:
-#if 0
-	    printk("Event Code not in switch\n");
-#endif
             EventError = 1;
             break;
     };

Modified: linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.h
URL: http://svn.digium.com/view/dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.h?view=diff&rev=4614&r1=4613&r2=4614
==============================================================================
--- linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.h (original)
+++ linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/GpakApi.h Thu Jul 17 17:21:35 2008
@@ -14,7 +14,7 @@
  * Revision History:
  *   06/15/05 - Initial release.
  *   11/15/2006  - 24 TDM-TDM Channels EC release
- *
+ * 
  * This program has been released under the terms of the GPL version 2 by
  * permission of Adaptive Digital Technologies, Inc.  The standard
  * GPL disclaimer is given inline below for your convenience.
@@ -31,7 +31,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #ifndef _GPAKAPI_H  /* prevent multiple inclusion */
@@ -68,6 +68,7 @@
     short int EcanAdaptEnable;     // Echo Can Adapt Enable flag 
     short int EcanG165DetEnable;   // Echo Can G165 Detect Enable flag 
     short int EcanDblTalkThresh;   // Echo Can Double Talk threshold 
+    short int EcanMaxDoubleTalkThres; // Maximum double-talk threshold
     short int EcanNlpThreshold;    // Echo Can NLP threshold 
     short int EcanNlpConv;  // Dynamic NLP control, NLP limit when EC about to converged
     short int EcanNlpUnConv;// Dynamic NLP control, NLP limit when EC not converged yet
@@ -77,6 +78,9 @@
     short int EcanCrossCorrLimit;  // Echo Can Cross Correlation limit 
     short int EcanNumFirSegments;  // Echo Can Num FIR Segments 
     short int EcanFirSegmentLen;   // Echo Can FIR Segment Length 
+    short int EcanTandemOperationEnable;   //Enable tandem operation 
+    short int EcanMixedFourWireMode; 	// Handle possible 4-wire (echo-free) lines
+	short int EcanReconvergenceCheckEnable; 	// Handle possible 4-wire (echo-free) lines
 } GpakEcanParms_t;
 
 /* Definition of a Channel Configuration information structure. */

Modified: linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.digium.com/view/dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=4614&r1=4613&r2=4614
==============================================================================
--- linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wctdm24xxp/base.c Thu Jul 17 17:21:35 2008
@@ -2934,6 +2934,7 @@
 	chanconfig->EcanParametersA.EcanAdaptEnable = 1;
 	chanconfig->EcanParametersA.EcanG165DetEnable = 1;
 	chanconfig->EcanParametersA.EcanDblTalkThresh = 6;
+	chanconfig->EcanParametersA.EcanMaxDoubleTalkThres = 40;
 	chanconfig->EcanParametersA.EcanNlpThreshold = parms->nlp_threshold;
 	chanconfig->EcanParametersA.EcanNlpConv = 0;
 	chanconfig->EcanParametersA.EcanNlpUnConv = 0;
@@ -2942,13 +2943,15 @@
 	chanconfig->EcanParametersA.EcanAdaptLimit = 50;
 	chanconfig->EcanParametersA.EcanCrossCorrLimit = 15;
 	chanconfig->EcanParametersA.EcanNumFirSegments = 3;
-	chanconfig->EcanParametersA.EcanFirSegmentLen = 64;
+	chanconfig->EcanParametersA.EcanFirSegmentLen = 48;
+	chanconfig->EcanParametersA.EcanReconvergenceCheckEnable = 1;
 
 	chanconfig->EcanParametersB.EcanTapLength = 1024;
 	chanconfig->EcanParametersB.EcanNlpType = parms->nlp_type;
 	chanconfig->EcanParametersB.EcanAdaptEnable = 1;
 	chanconfig->EcanParametersB.EcanG165DetEnable = 1;
 	chanconfig->EcanParametersB.EcanDblTalkThresh = 6;
+	chanconfig->EcanParametersB.EcanMaxDoubleTalkThres = 40;
 	chanconfig->EcanParametersB.EcanNlpThreshold = parms->nlp_threshold;
 	chanconfig->EcanParametersB.EcanNlpConv = 0;
 	chanconfig->EcanParametersB.EcanNlpUnConv = 0;
@@ -2957,7 +2960,8 @@
 	chanconfig->EcanParametersB.EcanAdaptLimit = 50;
 	chanconfig->EcanParametersB.EcanCrossCorrLimit = 15;
 	chanconfig->EcanParametersB.EcanNumFirSegments = 3;
-	chanconfig->EcanParametersB.EcanFirSegmentLen = 64;
+	chanconfig->EcanParametersB.EcanFirSegmentLen = 48;
+	chanconfig->EcanParametersB.EcanReconvergenceCheckEnable = 1;
 }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
@@ -3279,6 +3283,7 @@
 	VPMADT032_NOT_FOUND,
 	VPMADT032_FAILED,
 	VPMADT032_DISABLED,
+	VPMADT032_APIMISMATCH,
 };
 
 static enum vpmadt032_init_result wctdm_vpm150m_init(struct wctdm *wc)
@@ -3439,6 +3444,12 @@
 			printk("Version of DSP is %x\n", vpm150m->version);
 	} else {
 		printk("VPMADT032 Failed! Unable to ping the DSP (%d)!\n", pingstatus);
+		goto failed_exit;
+	}
+
+	/* ADT does not handle mismatches in API and firmware */
+	if (vpm150m->version != 117) {
+		res = VPMADT032_APIMISMATCH;
 		goto failed_exit;
 	}
 

Modified: linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.c
URL: http://svn.digium.com/view/dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.c?view=diff&rev=4614&r1=4613&r2=4614
==============================================================================
--- linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.c (original)
+++ linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.c Thu Jul 17 17:21:35 2008
@@ -30,18 +30,19 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
- */
-
-#include <dahdi/kernel.h>
-#include <dahdi/user.h>
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/version.h>
+#include <asm/semaphore.h>
+
+#include "dahdi/kernel.h"
+#include "dahdi/user.h"
 
 #include "GpakHpi.h"
 #include "vpmadt032.h"
 #include "GpakApi.h"
 #include "gpakenum.h"
-
-#ifdef VPM_SUPPORT
 
 /* DSP to Host interface block offsets. */
 #define REPLY_MSG_PNTR_OFFSET 0     /* I/F blk offset to Reply Msg Pointer */
@@ -563,7 +564,7 @@
                     ((pPortConfig->RxFrameSyncPolarity2 << 4) & 0x0010) |
                     ((pPortConfig->TxFrameSyncPolarity2 << 3) & 0x0008) |
                     ((pPortConfig->CompandingMode2 << 1) & 0x0006) |
-                    (pPortConfig->SerialWordSize1 & 0x0001));
+                    (pPortConfig->SerialWordSize2 & 0x0001));
 
     MsgBuffer[12] = (DSP_WORD)
                    (((pPortConfig->DxDelay3 << 11) & 0x0800) |
@@ -675,7 +676,7 @@
                        ((pChanConfig->SoftwareCompand & 3) << 2) |
                         (pChanConfig->EcanEnableB << 1) | 
                         (pChanConfig->EcanEnableA & 1)
-						);
+                        );
                         
         MsgBuffer[7]   = (DSP_WORD)
                          pChanConfig->EcanParametersA.EcanTapLength;       
@@ -736,7 +737,22 @@
         MsgBuffer[34]  = (DSP_WORD)
                          pChanConfig->EcanParametersB.EcanFirSegmentLen;   
 
-        MsgLength = 70; // byte number == 35*2 
+        MsgBuffer[35] = (DSP_WORD)
+                       (
+                       ((pChanConfig->EcanParametersB.EcanReconvergenceCheckEnable <<5) & 0x20)  |
+                       ((pChanConfig->EcanParametersA.EcanReconvergenceCheckEnable <<4) & 0x10)  |
+                       ((pChanConfig->EcanParametersB.EcanTandemOperationEnable <<3) & 0x8)  |
+                       ((pChanConfig->EcanParametersA.EcanTandemOperationEnable <<2) & 0x4)  |
+                       ((pChanConfig->EcanParametersB.EcanMixedFourWireMode << 1) & 0x2) | 
+                        (pChanConfig->EcanParametersA.EcanMixedFourWireMode & 1)
+                        );
+        MsgBuffer[36]  = (DSP_WORD)
+                         pChanConfig->EcanParametersA.EcanMaxDoubleTalkThres;   
+
+        MsgBuffer[37]  = (DSP_WORD)
+                         pChanConfig->EcanParametersB.EcanMaxDoubleTalkThres;   
+
+        MsgLength = 76; // byte number == 38*2 
         break;
 
 
@@ -1615,4 +1631,3 @@
     /* Return with an indication that System Parameters info was obtained. */
     return (RspSuccess);
 }
-#endif

Modified: linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.h
URL: http://svn.digium.com/view/dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.h?view=diff&rev=4614&r1=4613&r2=4614
==============================================================================
--- linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.h (original)
+++ linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/GpakApi.h Thu Jul 17 17:21:35 2008
@@ -14,7 +14,7 @@
  * Revision History:
  *   06/15/05 - Initial release.
  *   11/15/2006  - 24 TDM-TDM Channels EC release
- *
+ * 
  * This program has been released under the terms of the GPL version 2 by
  * permission of Adaptive Digital Technologies, Inc.  The standard
  * GPL disclaimer is given inline below for your convenience.
@@ -31,7 +31,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #ifndef _GPAKAPI_H  /* prevent multiple inclusion */
@@ -68,6 +68,7 @@
     short int EcanAdaptEnable;     // Echo Can Adapt Enable flag 
     short int EcanG165DetEnable;   // Echo Can G165 Detect Enable flag 
     short int EcanDblTalkThresh;   // Echo Can Double Talk threshold 
+    short int EcanMaxDoubleTalkThres; // Maximum double-talk threshold
     short int EcanNlpThreshold;    // Echo Can NLP threshold 
     short int EcanNlpConv;  // Dynamic NLP control, NLP limit when EC about to converged
     short int EcanNlpUnConv;// Dynamic NLP control, NLP limit when EC not converged yet
@@ -77,6 +78,9 @@
     short int EcanCrossCorrLimit;  // Echo Can Cross Correlation limit 
     short int EcanNumFirSegments;  // Echo Can Num FIR Segments 
     short int EcanFirSegmentLen;   // Echo Can FIR Segment Length 
+    short int EcanTandemOperationEnable;   //Enable tandem operation 
+    short int EcanMixedFourWireMode; 	// Handle possible 4-wire (echo-free) lines
+	short int EcanReconvergenceCheckEnable; 	// Handle possible 4-wire (echo-free) lines
 } GpakEcanParms_t;
 
 /* Definition of a Channel Configuration information structure. */

Modified: linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/vpmadt032.c
URL: http://svn.digium.com/view/dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/vpmadt032.c?view=diff&rev=4614&r1=4613&r2=4614
==============================================================================
--- linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/vpmadt032.c (original)
+++ linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117/drivers/dahdi/wcte12xp/vpmadt032.c Thu Jul 17 17:21:35 2008
@@ -883,6 +883,11 @@
 		goto failed_exit;
 	}
 
+	/* ADT does not handle mismatches in API and firmware */
+	if (vpm150m->version != 117) {
+		goto failed_exit;
+	}
+
 	/* workqueue for DTMF and wc->span functions that cannot sleep */
 	spin_lock_init(&vpm150m->lock);
 	vpm150m->wq = create_singlethread_workqueue("wcte12xp");
@@ -1246,6 +1251,7 @@
 		chanconfig.EcanParametersA.EcanAdaptEnable = 1;
 		chanconfig.EcanParametersA.EcanG165DetEnable = 1;
 		chanconfig.EcanParametersA.EcanDblTalkThresh = 6;
+		chanconfig.EcanParametersA.EcanMaxDoubleTalkThres = 40;
 		chanconfig.EcanParametersA.EcanNlpThreshold = vpmnlpthresh;
 		chanconfig.EcanParametersA.EcanNlpConv = 0;
 		chanconfig.EcanParametersA.EcanNlpUnConv = 0;
@@ -1254,13 +1260,15 @@
 		chanconfig.EcanParametersA.EcanAdaptLimit = 50;
 		chanconfig.EcanParametersA.EcanCrossCorrLimit = 15;
 		chanconfig.EcanParametersA.EcanNumFirSegments = 3;
-		chanconfig.EcanParametersA.EcanFirSegmentLen = 64;
+		chanconfig.EcanParametersA.EcanFirSegmentLen = 48;
+		chanconfig.EcanParametersA.EcanReconvergenceCheckEnable = 1;
 	
 		chanconfig.EcanParametersB.EcanTapLength = 1024;
 		chanconfig.EcanParametersB.EcanNlpType = vpmnlptype;
 		chanconfig.EcanParametersB.EcanAdaptEnable = 1;
 		chanconfig.EcanParametersB.EcanG165DetEnable = 1;
 		chanconfig.EcanParametersB.EcanDblTalkThresh = 6;
+		chanconfig.EcanParametersB.EcanMaxDoubleTalkThres = 40;
 		chanconfig.EcanParametersB.EcanNlpThreshold = vpmnlpthresh;
 		chanconfig.EcanParametersB.EcanNlpConv = 0;
 		chanconfig.EcanParametersB.EcanNlpUnConv = 0;
@@ -1269,7 +1277,8 @@
 		chanconfig.EcanParametersB.EcanAdaptLimit = 50;
 		chanconfig.EcanParametersB.EcanCrossCorrLimit = 15;
 		chanconfig.EcanParametersB.EcanNumFirSegments = 3;
-		chanconfig.EcanParametersB.EcanFirSegmentLen = 64;
+		chanconfig.EcanParametersB.EcanFirSegmentLen = 48;
+		chanconfig.EcanParametersB.EcanReconvergenceCheckEnable = 1;
 	
 		if ((res = gpakConfigureChannel(vpm150m->dspid, i, tdmToTdm, &chanconfig, &cstatus))) {
 			module_printk("Unable to configure channel (%d)\n", res);




More information about the svn-commits mailing list