[dahdi-commits] sruffell: branch linux/sruffell/dahdi-linux-2.1.0.4-adtapiupdate r5868 - in /...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Jan 27 22:21:19 CST 2009
Author: sruffell
Date: Tue Jan 27 22:21:19 2009
New Revision: 5868
URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=5868
Log:
Merging the changes between dahdi/linux/trunk and
dahdi/linux/team/mspiceland/dahdi-trunk-adtapiupdatefor117.
Modified:
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.c
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.h
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/base.c
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.c
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.h
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/base.c
linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/vpmadt032.c
Modified: linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.c?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.c (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.c Tue Jan 27 22:21:19 2009
@@ -566,7 +566,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) |
@@ -739,7 +739,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;
@@ -952,9 +967,6 @@
if (EventDataLength > WORD_BUFFER_SIZE)
{
gpakUnlockAccess(DspId);
-#if 0
- printk(KERN_DEBUG "EventDataLength > WORD_BUFFER_SIZE (%d)\n", EventDataLength);
-#endif
return (RefInvalidEvent);
}
ReadCircBuffer(DspId, BufrBaseAddress, BufrLastAddress, &TakeAddress,
Modified: linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.h
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.h?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.h (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/GpakApi.h Tue Jan 27 22:21:19 2009
@@ -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.
*
@@ -67,6 +67,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
@@ -76,6 +77,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/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wctdm24xxp/base.c Tue Jan 27 22:21:19 2009
@@ -218,7 +218,7 @@
* 4 : Suppression NLP - In order to use this, you must set the vpmnlpmaxsupp parameter to
* some value in order to give the amount of dB to suppress to the suppressor
*/
-static int vpmnlptype = 1;
+static int vpmnlptype = 3; /* Hoth noise */
/* This is the threshold (in dB) for enabling and disabling of the NLP */
static int vpmnlpthresh = 24;
/* See vpmnlptype = 4 for more info */
@@ -3026,30 +3026,38 @@
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;
+ chanconfig->EcanParametersA.EcanNlpUnConv = 12;
chanconfig->EcanParametersA.EcanNlpMaxSuppress = parms->nlp_max_suppress;
chanconfig->EcanParametersA.EcanCngThreshold = 43;
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->EcanParametersA.EcanTandemOperationEnable = 1;
+ chanconfig->EcanParametersA.EcanMixedFourWireMode = 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;
+ chanconfig->EcanParametersB.EcanNlpUnConv = 12;
chanconfig->EcanParametersB.EcanNlpMaxSuppress = parms->nlp_max_suppress;
chanconfig->EcanParametersB.EcanCngThreshold = 43;
chanconfig->EcanParametersB.EcanAdaptLimit = 50;
chanconfig->EcanParametersB.EcanCrossCorrLimit = 15;
chanconfig->EcanParametersB.EcanNumFirSegments = 3;
- chanconfig->EcanParametersB.EcanFirSegmentLen = 64;
+ chanconfig->EcanParametersB.EcanFirSegmentLen = 48;
+ chanconfig->EcanParametersB.EcanReconvergenceCheckEnable = 1;
+ chanconfig->EcanParametersB.EcanTandemOperationEnable = 1;
+ chanconfig->EcanParametersB.EcanMixedFourWireMode = 1;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
@@ -3372,6 +3380,7 @@
VPMADT032_NOT_FOUND,
VPMADT032_FAILED,
VPMADT032_DISABLED,
+ VPMADT032_APIMISMATCH,
};
static enum vpmadt032_init_result wctdm_vpm150m_init(struct wctdm *wc)
@@ -3381,6 +3390,7 @@
unsigned short reg;
unsigned long flags;
enum vpmadt032_init_result res = VPMADT032_FAILED;
+ const int EXPECTED_VPMADT032_VERSION = 0x117;
#ifdef VPM150M_SUPPORT
struct wctdm_firmware fw;
@@ -3532,6 +3542,16 @@
printk(KERN_DEBUG "Version of DSP is %x\n", vpm150m->version);
} else {
printk(KERN_NOTICE "VPMADT032 Failed! Unable to ping the DSP (%d)!\n", pingstatus);
+ goto failed_exit;
+ }
+
+ /* ADT does not handle mismatches in API and firmware */
+ if (EXPECTED_VPMADT032_VERSION != vpm150m->version) {
+ printk(KERN_ERR "%s: VPMADT032 firmware version 0x%x does " \
+ "not match expected version 0x%x. VPM is disabled.\n",
+ THIS_MODULE->name, vpm150m->version,
+ EXPECTED_VPMADT032_VERSION);
+ res = VPMADT032_APIMISMATCH;
goto failed_exit;
}
Modified: linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.c?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.c (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.c Tue Jan 27 22:21:19 2009
@@ -33,12 +33,13 @@
#include <dahdi/kernel.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 */
@@ -560,7 +561,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) |
@@ -672,7 +673,7 @@
((pChanConfig->SoftwareCompand & 3) << 2) |
(pChanConfig->EcanEnableB << 1) |
(pChanConfig->EcanEnableA & 1)
- );
+ );
MsgBuffer[7] = (DSP_WORD)
pChanConfig->EcanParametersA.EcanTapLength;
@@ -733,7 +734,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;
@@ -1612,4 +1628,3 @@
/* Return with an indication that System Parameters info was obtained. */
return (RspSuccess);
}
-#endif
Modified: linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.h
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.h?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.h (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/GpakApi.h Tue Jan 27 22:21:19 2009
@@ -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.
*
@@ -67,6 +67,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
@@ -76,6 +77,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/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/base.c?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/base.c Tue Jan 27 22:21:19 2009
@@ -91,7 +91,7 @@
int vpmsupport = 1;
int vpmdtmfsupport = 0;
static int vpmtsisupport = 0;
-int vpmnlptype = 1;
+int vpmnlptype = 3; /* Hoth noise */
int vpmnlpthresh = 24;
int vpmnlpmaxsupp = 0;
#endif
Modified: linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/vpmadt032.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/vpmadt032.c?view=diff&rev=5868&r1=5867&r2=5868
==============================================================================
--- linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/vpmadt032.c (original)
+++ linux/team/sruffell/dahdi-linux-2.1.0.4-adtapiupdate/drivers/dahdi/wcte12xp/vpmadt032.c Tue Jan 27 22:21:19 2009
@@ -693,6 +693,7 @@
struct t1_firmware fw;
struct firmware embedded_firmware;
const struct firmware *firmware = &embedded_firmware;
+ const int EXPECTED_VPMADT032_VERSION = 0x117;
#if !defined(HOTPLUG_FIRMWARE)
extern void _binary_dahdi_fw_vpmadt032_bin_size;
extern u8 _binary_dahdi_fw_vpmadt032_bin_start[];
@@ -888,6 +889,15 @@
goto failed_exit;
}
+ /* ADT does not handle mismatches in API and firmware */
+ if (EXPECTED_VPMADT032_VERSION != vpm150m->version) {
+ printk(KERN_ERR "%s: VPMADT032 firmware version 0x%x does " \
+ "not match expected version 0x%x. VPM is disabled.\n",
+ THIS_MODULE->name, vpm150m->version,
+ EXPECTED_VPMADT032_VERSION);
+ goto failed_exit;
+ }
+
/* workqueue for DTMF and wc->span functions that cannot sleep */
spin_lock_init(&vpm150m->lock);
vpm150m->wq = create_singlethread_workqueue("wcte12xp");
@@ -1253,30 +1263,38 @@
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;
+ chanconfig.EcanParametersA.EcanNlpUnConv = 12;
chanconfig.EcanParametersA.EcanNlpMaxSuppress = vpmnlpmaxsupp;
chanconfig.EcanParametersA.EcanCngThreshold = 43;
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.EcanParametersA.EcanTandemOperationEnable = 1;
+ chanconfig.EcanParametersA.EcanMixedFourWireMode = 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;
+ chanconfig.EcanParametersB.EcanNlpUnConv = 12;
chanconfig.EcanParametersB.EcanNlpMaxSuppress = vpmnlpmaxsupp;
chanconfig.EcanParametersB.EcanCngThreshold = 43;
chanconfig.EcanParametersB.EcanAdaptLimit = 50;
chanconfig.EcanParametersB.EcanCrossCorrLimit = 15;
chanconfig.EcanParametersB.EcanNumFirSegments = 3;
- chanconfig.EcanParametersB.EcanFirSegmentLen = 64;
+ chanconfig.EcanParametersB.EcanFirSegmentLen = 48;
+ chanconfig.EcanParametersB.EcanReconvergenceCheckEnable = 1;
+ chanconfig.EcanParametersB.EcanTandemOperationEnable = 1;
+ chanconfig.EcanParametersB.EcanMixedFourWireMode = 1;
if ((res = gpakConfigureChannel(vpm150m->dspid, i, tdmToTdm, &chanconfig, &cstatus))) {
module_printk("Unable to configure channel (%d)\n", res);
More information about the dahdi-commits
mailing list