summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-04-06 22:36:10 +0000
committerShaun Ruffell <sruffell@digium.com>2010-04-06 22:36:10 +0000
commita88744e50a9db3252f53a1f0d9d1469e773461eb (patch)
tree5a4078bf6970b256289b461d72886120081587c7
parent98cdbdf5434c5fbdc4c5196957b2d70a3ba77bf4 (diff)
wcte12xp: Load the VPM in startup, not spanconfig
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8489 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/wcte12xp/base.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 9020d02..a1a1ca4 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -77,6 +77,7 @@ static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *e
struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
static void echocan_free(struct dahdi_chan *chan, struct dahdi_echocan_state *ec);
static int t1xxp_clear_maint(struct dahdi_span *span);
+static int check_and_load_vpm(struct t1 *wc);
static const struct dahdi_echocan_features vpm150m_ec_features = {
.NLP_automatic = 1,
@@ -930,11 +931,27 @@ static void t1xxp_framer_start(struct t1 *wc, struct dahdi_span *span)
set_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags);
}
+static void set_span_devicetype(struct t1 *wc)
+{
+ strncpy(wc->span.devicetype, wc->variety,
+ sizeof(wc->span.devicetype) - 1);
+
+#if defined(VPM_SUPPORT)
+ if (wc->vpmadt032) {
+ strncat(wc->span.devicetype, " (VPMADT032)",
+ sizeof(wc->span.devicetype) - 1);
+ }
+#endif
+}
+
static int t1xxp_startup(struct dahdi_span *span)
{
struct t1 *wc = span->pvt;
int i;
+ check_and_load_vpm(wc);
+ set_span_devicetype(wc);
+
/* initialize the start value for the entire chunk of last ec buffer */
for (i = 0; i < span->channels; i++) {
memset(wc->ec_chunk1[i], DAHDI_LIN2X(0, span->chans[i]), DAHDI_CHUNKSIZE);
@@ -1327,16 +1344,6 @@ static void echocan_free(struct dahdi_chan *chan, struct dahdi_echocan_state *ec
vpmadt032_echocan_free(wc->vpmadt032, chan->chanpos - 1, ec);
}
-static void set_span_devicetype(struct t1 *wc)
-{
- strncpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype) - 1);
-
-#if defined(VPM_SUPPORT)
- if (wc->vpmadt032)
- strncat(wc->span.devicetype, " (VPMADT032)", sizeof(wc->span.devicetype) - 1);
-#endif
-}
-
static void
setchanconfig_from_state(struct vpmadt032 *vpm, int channel,
GpakChannelConfig_t *chanconfig)
@@ -1466,9 +1473,6 @@ t1xxp_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
struct t1 *wc = span->pvt;
- check_and_load_vpm(wc);
- set_span_devicetype(wc);
-
/* Do we want to SYNC on receive or not */
if (lc->sync) {
set_bit(7, &wc->ctlreg);