diff options
-rw-r--r-- | drivers/dahdi/dahdi_transcode.c | 10 | ||||
-rw-r--r-- | drivers/dahdi/wctc4xxp/base.c | 20 | ||||
-rw-r--r-- | include/dahdi/kernel.h | 1 |
3 files changed, 16 insertions, 15 deletions
diff --git a/drivers/dahdi/dahdi_transcode.c b/drivers/dahdi/dahdi_transcode.c index 24e6c35..92120a3 100644 --- a/drivers/dahdi/dahdi_transcode.c +++ b/drivers/dahdi/dahdi_transcode.c @@ -59,10 +59,10 @@ struct dahdi_transcoder *dahdi_transcoder_alloc(int numchans) memset(tc, 0, size); strcpy(tc->name, "<unspecified>"); + INIT_LIST_HEAD(&tc->node); tc->numchannels = numchans; - for (x=0;x<tc->numchannels;x++) { + for (x=0; x < tc->numchannels; x++) { init_waitqueue_head(&tc->channels[x].ready); - INIT_LIST_HEAD(&tc->node); tc->channels[x].parent = tc; } @@ -93,6 +93,8 @@ static int is_on_list(struct list_head *entry, struct list_head *head) /* Register a transcoder */ int dahdi_transcoder_register(struct dahdi_transcoder *tc) { + static int count = 0; + tc->pos = count++; spin_lock(&translock); BUG_ON(is_on_list(&tc->node, &trans)); list_add_tail(&tc->node, &trans); @@ -287,7 +289,6 @@ static long dahdi_tc_allocate(struct file *file, unsigned long data) static long dahdi_tc_getinfo(unsigned long data) { struct dahdi_transcoder_info info; - unsigned int x; struct dahdi_transcoder *cur; struct dahdi_transcoder *tc = NULL; @@ -295,10 +296,9 @@ static long dahdi_tc_getinfo(unsigned long data) return -EFAULT; } - x = 0; spin_lock(&translock); list_for_each_entry(cur, &trans, node) { - if (x++ == info.tcnum) { + if (cur->pos == info.tcnum) { tc = cur; break; } diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index 6995973..2e1e376 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -441,7 +441,6 @@ struct wcdte { char board_name[40]; const char *variety; int pos; - int cards; struct list_head node; spinlock_t reglock; wait_queue_head_t waitq; @@ -1744,6 +1743,10 @@ wctc4xxp_write(struct file *file, const char __user *frame, size_t count, loff_t "%d bytes.\n", count, G723_5K_BYTES); return -EINVAL; } + cpvt->timestamp = G723_SAMPLES; + } else { + /* Same for ulaw and alaw */ + cpvt->timestamp = G729_SAMPLES; } if (!(cmd = wctc4xxp_create_rtp_cmd(wc, dtc, count))) { @@ -2854,7 +2857,7 @@ wctc4xxp_watchdog(unsigned long data) } /** - * Insert an struct wcdte on the global list in sorted order + * Insert an struct wcdte on the global list in sorted order * */ static int __devinit @@ -2867,13 +2870,17 @@ wctc4xxp_add_to_device_list(struct wcdte *wc) list_for_each_entry(cur, &wctc4xxp_list, node) { if (cur->pos != pos) { /* Add the new entry before the one here */ - list_add_tail(&wc->node, &wctc4xxp_list); + list_add_tail(&wc->node, &cur->node); break; } else { ++pos; } } + /* If we didn't already add the new entry to the list, add it now */ + if (list_empty(&wc->node)) { + list_add_tail(&wc->node, &wctc4xxp_list); + } spin_unlock(&wctc4xxp_list_lock); return pos; } @@ -3237,13 +3244,6 @@ static struct pci_driver wctc4xxp_driver = { int __init wctc4xxp_init(void) { int res; -# ifndef CONFIG_WCDTE_NETWORK_IF - if (debug & (DTE_DEBUG_NETWORK_IF|DTE_DEBUG_NETWORK_EARLY)) { - printk(KERN_WARNING "%s: The Network interface was not compiled into the driver.\n", THIS_MODULE->name); - debug &= ~(DTE_DEBUG_NETWORK_IF|DTE_DEBUG_NETWORK_EARLY); - } -# endif - # if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index ec6a7a2..1b165f9 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -667,6 +667,7 @@ dahdi_tc_clear_data_waiting(struct dahdi_transcoder_channel *dtc) { struct dahdi_transcoder { struct list_head node; + int pos; char name[80]; int numchannels; unsigned int srcfmts; |