[svn-commits] mspiceland: branch mspiceland/zaptel-1.4-adtapiupdatefor117 r4415 - in /team/...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Jul 17 16:55:56 CDT 2008
Author: mspiceland
Date: Thu Jul 17 16:55:56 2008
New Revision: 4415
URL: http://svn.digium.com/view/zaptel?view=rev&rev=4415
Log:
Update the ADT API for firmware revision 1.17.
Modified:
team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.c
team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.h
team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/base.c
team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.c
team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.h
team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/vpmadt032.c
Modified: team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.c
URL: http://svn.digium.com/view/zaptel/team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.c?view=diff&rev=4415&r1=4414&r2=4415
==============================================================================
--- team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.c (original)
+++ team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.c Thu Jul 17 16:55:56 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>
@@ -563,7 +563,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) |
@@ -736,7 +736,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;
@@ -949,9 +964,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,
@@ -964,18 +976,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: team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.h
URL: http://svn.digium.com/view/zaptel/team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.h?view=diff&rev=4415&r1=4414&r2=4415
==============================================================================
--- team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.h (original)
+++ team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/GpakApi.h Thu Jul 17 16:55:56 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: team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/base.c?view=diff&rev=4415&r1=4414&r2=4415
==============================================================================
--- team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/base.c (original)
+++ team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wctdm24xxp/base.c Thu Jul 17 16:55:56 2008
@@ -2943,6 +2943,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;
@@ -2951,13 +2952,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;
@@ -2966,7 +2969,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)
@@ -3288,6 +3292,7 @@
VPMADT032_NOT_FOUND,
VPMADT032_FAILED,
VPMADT032_DISABLED,
+ VPMADT032_APIMISMATCH,
};
static enum vpmadt032_init_result wctdm_vpm150m_init(struct wctdm *wc)
@@ -3448,6 +3453,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: team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.c
URL: http://svn.digium.com/view/zaptel/team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.c?view=diff&rev=4415&r1=4414&r2=4415
==============================================================================
--- team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.c (original)
+++ team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.c Thu Jul 17 16:55:56 2008
@@ -30,8 +30,11 @@
*
* 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>
+#include <asm/semaphore.h>
#include "zaptel.h"
@@ -39,8 +42,6 @@
#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 */
@@ -562,7 +563,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) |
@@ -674,7 +675,7 @@
((pChanConfig->SoftwareCompand & 3) << 2) |
(pChanConfig->EcanEnableB << 1) |
(pChanConfig->EcanEnableA & 1)
- );
+ );
MsgBuffer[7] = (DSP_WORD)
pChanConfig->EcanParametersA.EcanTapLength;
@@ -735,7 +736,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;
@@ -1614,4 +1630,3 @@
/* Return with an indication that System Parameters info was obtained. */
return (RspSuccess);
}
-#endif
Modified: team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.h
URL: http://svn.digium.com/view/zaptel/team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.h?view=diff&rev=4415&r1=4414&r2=4415
==============================================================================
--- team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.h (original)
+++ team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/GpakApi.h Thu Jul 17 16:55:56 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: team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/vpmadt032.c
URL: http://svn.digium.com/view/zaptel/team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/vpmadt032.c?view=diff&rev=4415&r1=4414&r2=4415
==============================================================================
--- team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/vpmadt032.c (original)
+++ team/mspiceland/zaptel-1.4-adtapiupdatefor117/kernel/wcte12xp/vpmadt032.c Thu Jul 17 16:55:56 2008
@@ -881,6 +881,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");
@@ -1244,6 +1249,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;
@@ -1252,13 +1258,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;
@@ -1268,6 +1276,8 @@
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