summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/dahdi/voicebus/GpakApi.h2
-rw-r--r--drivers/dahdi/voicebus/GpakCust.c27
-rw-r--r--drivers/dahdi/voicebus/GpakCust.h10
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c24
-rw-r--r--drivers/dahdi/wcte12xp/base.c28
5 files changed, 52 insertions, 39 deletions
diff --git a/drivers/dahdi/voicebus/GpakApi.h b/drivers/dahdi/voicebus/GpakApi.h
index 91aade0..ef16d63 100644
--- a/drivers/dahdi/voicebus/GpakApi.h
+++ b/drivers/dahdi/voicebus/GpakApi.h
@@ -43,7 +43,7 @@ typedef union
} GpakAsyncEventData_t;
/* Definition of an Echo Canceller Parameters information structure. */
-typedef struct
+typedef struct GpakEcanParms
{
short int EcanTapLength; // Echo Can Num Taps (tail length)
short int EcanNlpType; // Echo Can NLP Type
diff --git a/drivers/dahdi/voicebus/GpakCust.c b/drivers/dahdi/voicebus/GpakCust.c
index d5bbadd..72319c8 100644
--- a/drivers/dahdi/voicebus/GpakCust.c
+++ b/drivers/dahdi/voicebus/GpakCust.c
@@ -395,9 +395,8 @@ vpmadt032_alloc(struct vpmadt032_options *options, const char *board_name)
/* Add a little extra to store the wq_name. */
vpm = kzalloc(sizeof(*vpm) + length, GFP_KERNEL);
- if (!vpm) {
+ if (!vpm)
return NULL;
- }
strcpy(vpm->wq_name, board_name);
strcat(vpm->wq_name, suffix);
@@ -545,6 +544,30 @@ failed_exit:
}
EXPORT_SYMBOL(vpmadt032_init);
+void vpmadt032_get_default_parameters(struct GpakEcanParms *p)
+{
+ memset(p, 0, sizeof(*p));
+
+ p->EcanTapLength = 1024;
+ p->EcanNlpType = DEFAULT_NLPTYPE;
+ p->EcanAdaptEnable = 1;
+ p->EcanG165DetEnable = 1;
+ p->EcanDblTalkThresh = 6;
+ p->EcanMaxDoubleTalkThres = 40;
+ p->EcanNlpThreshold = DEFAULT_NLPTHRESH;
+ p->EcanNlpConv = 0;
+ p->EcanNlpUnConv = 12;
+ p->EcanNlpMaxSuppress = DEFAULT_NLPMAXSUPP;
+ p->EcanCngThreshold = 43;
+ p->EcanAdaptLimit = 50;
+ p->EcanCrossCorrLimit = 15;
+ p->EcanNumFirSegments = 3;
+ p->EcanFirSegmentLen = 48;
+ p->EcanReconvergenceCheckEnable = 2;
+ p->EcanTandemOperationEnable = 0;
+ p->EcanMixedFourWireMode = 0;
+}
+EXPORT_SYMBOL(vpmadt032_get_default_parameters);
void vpmadt032_free(struct vpmadt032 *vpm)
{
diff --git a/drivers/dahdi/voicebus/GpakCust.h b/drivers/dahdi/voicebus/GpakCust.h
index bdb9cfb..9b4f6a8 100644
--- a/drivers/dahdi/voicebus/GpakCust.h
+++ b/drivers/dahdi/voicebus/GpakCust.h
@@ -77,10 +77,13 @@
#define NLPTYPE_RANDOM_NOISE 2
#define HOTH_NOISE_NLPTYPE 3
#define NLPTYPE_SUPPRESS 4
-#define DEFAULT_NLPTYPE NLPTYPE_SUPPRESS
+#define NLPTYPE_RESERVED 5
+#define NLPTYPE_AUTOSUPPRESS 6
+#define DEFAULT_NLPTYPE NLPTYPE_AUTOSUPPRESS
/* This is the threshold (in dB) for enabling and disabling of the NLP */
-#define DEFAULT_NLPTHRESH 24
+#define DEFAULT_NLPTHRESH 22
+#define DEFAULT_NLPMAXSUPP 10
struct vpmadt032_cmd {
struct list_head node;
@@ -145,6 +148,9 @@ int vpmadt032_echocan_create(struct vpmadt032 *vpm, int channo,
void vpmadt032_echocan_free(struct vpmadt032 *vpm, struct dahdi_chan *chan,
struct dahdi_echocan_state *ec);
+struct GpakEcanParms;
+void vpmadt032_get_default_parameters(struct GpakEcanParms *p);
+
/* If there is a command ready to go to the VPMADT032, return it, otherwise NULL */
static inline struct vpmadt032_cmd *vpmadt032_get_ready_cmd(struct vpmadt032 *vpm)
{
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index abe800c..c4d6b12 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -215,7 +215,7 @@ static int vpmsupport = 1;
static int vpmnlptype = DEFAULT_NLPTYPE;
static int vpmnlpthresh = DEFAULT_NLPTHRESH;
-static int vpmnlpmaxsupp = DEFAULT_NLPTHRESH;
+static int vpmnlpmaxsupp = DEFAULT_NLPMAXSUPP;
static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
@@ -288,6 +288,7 @@ static inline int empty_slot(struct wctdm *wc, int card)
void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelConfig_t *chanconfig)
{
const struct vpmadt032_options *options;
+ GpakEcanParms_t *p;
BUG_ON(!vpm);
@@ -323,20 +324,13 @@ void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelCon
}
chanconfig->FrameRate = rate2ms;
- chanconfig->EcanParametersA.EcanTapLength = 1024;
- chanconfig->EcanParametersA.EcanNlpType = vpm->curecstate[channel].nlp_type;
- chanconfig->EcanParametersA.EcanAdaptEnable = 1;
- chanconfig->EcanParametersA.EcanG165DetEnable = 1;
- chanconfig->EcanParametersA.EcanDblTalkThresh = 6;
- chanconfig->EcanParametersA.EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
- chanconfig->EcanParametersA.EcanNlpConv = 0;
- chanconfig->EcanParametersA.EcanNlpUnConv = 0;
- chanconfig->EcanParametersA.EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
- chanconfig->EcanParametersA.EcanCngThreshold = 43;
- chanconfig->EcanParametersA.EcanAdaptLimit = 50;
- chanconfig->EcanParametersA.EcanCrossCorrLimit = 15;
- chanconfig->EcanParametersA.EcanNumFirSegments = 3;
- chanconfig->EcanParametersA.EcanFirSegmentLen = 48;
+ p = &chanconfig->EcanParametersA;
+
+ vpmadt032_get_default_parameters(p);
+
+ p->EcanNlpType = vpm->curecstate[channel].nlp_type;
+ p->EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
+ p->EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
memcpy(&chanconfig->EcanParametersB,
&chanconfig->EcanParametersA,
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index ec1d7ec..1380168 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -63,7 +63,7 @@ static int vpmtsisupport = 0;
int vpmnlptype = DEFAULT_NLPTYPE;
int vpmnlpthresh = DEFAULT_NLPTHRESH;
-int vpmnlpmaxsupp = DEFAULT_NLPTHRESH;
+int vpmnlpmaxsupp = DEFAULT_NLPMAXSUPP;
static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
@@ -1291,6 +1291,7 @@ static inline unsigned char t1_vpm_out(struct t1 *wc, int unit, const unsigned i
static void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakChannelConfig_t *chanconfig)
{
const struct vpmadt032_options *options;
+ GpakEcanParms_t *p;
BUG_ON(!vpm);
@@ -1316,25 +1317,14 @@ static void setchanconfig_from_state(struct vpmadt032 *vpm, int channel, GpakCha
chanconfig->SoftwareCompand = cmpPCMU;
chanconfig->FrameRate = rate10ms;
- chanconfig->EcanParametersA.EcanTapLength = 1024;
- chanconfig->EcanParametersA.EcanNlpType = vpm->curecstate[channel].nlp_type;
- chanconfig->EcanParametersA.EcanAdaptEnable = 1;
- chanconfig->EcanParametersA.EcanG165DetEnable = 1;
- chanconfig->EcanParametersA.EcanDblTalkThresh = 6;
- chanconfig->EcanParametersA.EcanMaxDoubleTalkThres = 40;
- chanconfig->EcanParametersA.EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
- chanconfig->EcanParametersA.EcanNlpConv = 0;
- chanconfig->EcanParametersA.EcanNlpUnConv = 12;
- chanconfig->EcanParametersA.EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
- chanconfig->EcanParametersA.EcanCngThreshold = 43;
- chanconfig->EcanParametersA.EcanAdaptLimit = 50;
- chanconfig->EcanParametersA.EcanCrossCorrLimit = 15;
- chanconfig->EcanParametersA.EcanNumFirSegments = 3;
- chanconfig->EcanParametersA.EcanFirSegmentLen = 48;
- chanconfig->EcanParametersA.EcanReconvergenceCheckEnable = 1;
- chanconfig->EcanParametersA.EcanTandemOperationEnable = 1;
- chanconfig->EcanParametersA.EcanMixedFourWireMode = 1;
+ p = &chanconfig->EcanParametersA;
+
+ vpmadt032_get_default_parameters(p);
+
+ p->EcanNlpType = vpm->curecstate[channel].nlp_type;
+ p->EcanNlpThreshold = vpm->curecstate[channel].nlp_threshold;
+ p->EcanNlpMaxSuppress = vpm->curecstate[channel].nlp_max_suppress;
memcpy(&chanconfig->EcanParametersB,
&chanconfig->EcanParametersA,