From 6ab7988dbd6f5cf378688fb388ddc92db42696d5 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Sat, 3 Apr 2010 00:03:58 +0000 Subject: wcte12xp: Resend both framer and VPM commands when reads may have been lost. Latency conditions could cause the driver to misconfigure the VPM which would result in one way audio. DAHDI-572. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8454 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/voicebus/GpakCust.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'drivers/dahdi/voicebus/GpakCust.h') diff --git a/drivers/dahdi/voicebus/GpakCust.h b/drivers/dahdi/voicebus/GpakCust.h index 70704b0..549922e 100644 --- a/drivers/dahdi/voicebus/GpakCust.h +++ b/drivers/dahdi/voicebus/GpakCust.h @@ -161,11 +161,32 @@ static inline struct vpmadt032_cmd *vpmadt032_get_ready_cmd(struct vpmadt032 *vp return NULL; } cmd = list_entry(vpm->pending_cmds.next, struct vpmadt032_cmd, node); - list_move_tail(&cmd->node, &vpm->active_cmds); + if (cmd->desc & __VPM150M_WR) + list_move_tail(&cmd->node, &vpm->active_cmds); + else + list_del_init(&cmd->node); spin_unlock_irqrestore(&vpm->list_lock, flags); return cmd; } +static inline void vpmadt032_resend(struct vpmadt032 *vpm) +{ + unsigned long flags; + struct vpmadt032_cmd *cmd, *temp; + + BUG_ON(!vpm); + + /* By moving the commands back to the pending list, they will be + * transmitted when room is available */ + spin_lock_irqsave(&vpm->list_lock, flags); + list_for_each_entry_safe(cmd, temp, &vpm->active_cmds, node) { + cmd->desc &= ~(__VPM150M_TX); + list_move_tail(&cmd->node, &vpm->pending_cmds); + } + spin_unlock_irqrestore(&vpm->list_lock, flags); +} + + int vpmadt032_module_init(void); typedef __u16 DSP_WORD; /* 16 bit DSP word */ -- cgit v1.2.3