summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2009-07-21 14:56:49 +0000
committerShaun Ruffell <sruffell@digium.com>2009-07-21 14:56:49 +0000
commit131eae4b7f1087e2a739ef799985875d6fdc2354 (patch)
tree56ba885bd6a50e1af77c4051db8bc69ac1610063
parent83ea6ab4c20c3b10815b2121d48d4251e762a733 (diff)
Merged revisions 6712,6776,6799,6801,6803 via svnmerge from
https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r6712 | sruffell | 2009-06-24 14:13:35 -0500 (Wed, 24 Jun 2009) | 4 lines wct4xxp, wcte11xp: Use the default configuration by default at startup. This change allows hardware to provide timing to asterisk before normal configuration. DAHDI-275. ........ r6776 | sruffell | 2009-06-26 16:24:34 -0500 (Fri, 26 Jun 2009) | 4 lines voicebus: Limit the string length of the vpm workqueue name. On older kernels, it is possible to cause a kernel panic if the lenght of the workqueue name is greater than 10. DAHDI-276. ........ r6799 | sruffell | 2009-06-30 10:45:06 -0500 (Tue, 30 Jun 2009) | 5 lines wcb4xxp: Start the first span with default settings on load. One of the spans of the B410P is now started at driver load time in order to allow it to provide early timing to asterisk, before the card has been properly configured. ........ r6801 | sruffell | 2009-06-30 12:17:09 -0500 (Tue, 30 Jun 2009) | 5 lines echocan: Do not call through NULL 'echocan_traintap' pointer. This resolves an issue with a kernel panic if echotraining is enabled in the Asterisk configuration file, but the echocan on the channel (which may be a hardware echocanceller) has not defined that operation. DAHDI-272. ........ r6803 | sruffell | 2009-06-30 12:27:34 -0500 (Tue, 30 Jun 2009) | 1 line echocan: Do not go into PRETRAINING mode if not supported by the echocan. ........ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.2@6860 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c15
-rw-r--r--drivers/dahdi/voicebus/GpakCust.c5
-rw-r--r--drivers/dahdi/wcb4xxp/base.c12
-rw-r--r--drivers/dahdi/wct4xxp/base.c8
-rw-r--r--drivers/dahdi/wcte11xp.c7
5 files changed, 39 insertions, 8 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 632d0d2..4916657 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -5225,14 +5225,18 @@ static int dahdi_chan_ioctl(struct inode *inode, struct file *file, unsigned int
if ((j < 0) || (j >= DAHDI_MAX_PRETRAINING))
return -EINVAL;
j <<= 3;
+ spin_lock_irqsave(&chan->lock, flags);
if (chan->ec_state) {
/* Start pretraining stage */
- spin_lock_irqsave(&chan->lock, flags);
- chan->ec_state->status.mode = ECHO_MODE_PRETRAINING;
- chan->ec_state->status.pretrain_timer = j;
+ if (chan->ec_state->ops->echocan_traintap) {
+ chan->ec_state->status.mode = ECHO_MODE_PRETRAINING;
+ chan->ec_state->status.pretrain_timer = j;
+ }
+ spin_unlock_irqrestore(&chan->lock, flags);
+ } else {
spin_unlock_irqrestore(&chan->lock, flags);
- } else
return -EINVAL;
+ }
break;
case DAHDI_ECHOCANCEL_FAX_MODE:
if (!chan->ec_state) {
@@ -6639,7 +6643,8 @@ static inline void __dahdi_ec_chunk(struct dahdi_chan *ss, unsigned char *rxchun
ss->ec_state->status.last_train_tap = 0;
ss->ec_state->status.mode = ECHO_MODE_TRAINING;
}
- if (ss->ec_state->status.mode == ECHO_MODE_TRAINING) {
+ if ((ss->ec_state->status.mode == ECHO_MODE_TRAINING) &&
+ (ss->ec_state->ops->echocan_traintap)) {
if (ss->ec_state->ops->echocan_traintap(ss->ec_state, ss->ec_state->status.last_train_tap++, rxlin)) {
#if 0
module_printk(KERN_NOTICE, "Finished training (%d taps trained)!\n", ss->ec_state->status.last_train_tap);
diff --git a/drivers/dahdi/voicebus/GpakCust.c b/drivers/dahdi/voicebus/GpakCust.c
index dbce49b..b3228df 100644
--- a/drivers/dahdi/voicebus/GpakCust.c
+++ b/drivers/dahdi/voicebus/GpakCust.c
@@ -403,8 +403,13 @@ vpmadt032_alloc(struct vpmadt032_options *options, const char *board_name)
if (!vpm)
return NULL;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
+ /* There is a limit on the length of the name of the workqueue. */
+ strcpy(vpm->wq_name, "vpmadt032");
+#else
strcpy(vpm->wq_name, board_name);
strcat(vpm->wq_name, suffix);
+#endif
/* Init our vpmadt032 struct */
memcpy(&vpm->options, options, sizeof(*options));
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index f5db389..1e05309 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -2,7 +2,7 @@
* WCB410P Quad-BRI PCI Driver
* Written by Andrew Kohlsmith <akohlsmith@mixdown.ca>
*
- * Copyright (C) 2008 Digium, Inc.
+ * Copyright (C) 2009 Digium, Inc.
* All rights reserved.
*
*/
@@ -2486,6 +2486,11 @@ static int b4xxp_proc_read(char *buf, char **start, off_t offset, int count, int
}
#endif /* CREATE_WCB4XXP_PROCFS_ENTRY */
+static int b4xxp_startdefaultspan(struct b4xxp *b4)
+{
+ struct dahdi_lineconfig lc = {0,};
+ return b4xxp_spanconfig(&b4->spans[0].span, &lc);
+}
static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
@@ -2599,6 +2604,7 @@ static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id
}
+
#if 0
/* Launch cards as appropriate */
for (;;) {
@@ -2621,6 +2627,10 @@ static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id
dev_info(b4->dev, "Did not do the highestorder stuff\n");
#endif
+ ret = b4xxp_startdefaultspan(b4);
+ if (ret)
+ goto err_out_unreg_spans;
+
ret = 0;
return ret;
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index 96fabde..6558de8 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -6,7 +6,7 @@
* written by Jim Dixon <jim@lambdatel.com>.
*
* Copyright (C) 2001 Jim Dixon / Zapata Telephony.
- * Copyright (C) 2001-2005, Digium, Inc.
+ * Copyright (C) 2001-2009, Digium, Inc.
*
* All rights reserved.
*
@@ -3547,6 +3547,12 @@ static int __devinit t4_launch(struct t4 *wc)
__t4_set_timing_source(wc,4, 0, 0);
spin_unlock_irqrestore(&wc->reglock, flags);
tasklet_init(&wc->t4_tlet, t4_isr_bh, (unsigned long)wc);
+
+ /* Start the first span on the card with the default configuration so
+ * that it may provide timing to Asterisk before being properly
+ * configured. */
+ t4_startup(&wc->tspans[0]->span);
+
return 0;
}
diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c
index 390c834..26f47fa 100644
--- a/drivers/dahdi/wcte11xp.c
+++ b/drivers/dahdi/wcte11xp.c
@@ -5,7 +5,7 @@
* Matthew Fredrickson <creslin@digium.com>
* William Meadows <wmeadows@digium.com>
*
- * Copyright (C) 2004, Digium, Inc.
+ * Copyright (C) 2004-2009, Digium, Inc.
*
* All rights reserved.
*/
@@ -1013,6 +1013,11 @@ static int t1xxp_software_init(struct t1 *wc)
printk(KERN_NOTICE "Unable to register span with DAHDI\n");
return -1;
}
+
+ /* Start off with the defaults so this card can provide timing to
+ * Asterisk before being properly configured. */
+ t1xxp_startup(&wc->span);
+
return 0;
}