diff options
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 15 | ||||
-rw-r--r-- | drivers/dahdi/voicebus/GpakCust.c | 5 | ||||
-rw-r--r-- | drivers/dahdi/wcb4xxp/base.c | 12 | ||||
-rw-r--r-- | drivers/dahdi/wct4xxp/base.c | 8 | ||||
-rw-r--r-- | drivers/dahdi/wcte11xp.c | 7 |
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; } |