summaryrefslogtreecommitdiff
path: root/drivers/dahdi/voicebus/GpakCust.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dahdi/voicebus/GpakCust.h')
-rw-r--r--drivers/dahdi/voicebus/GpakCust.h23
1 files changed, 22 insertions, 1 deletions
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 */