From 36b4f0072fd8f20a7b3f46f917b7d5af86fceb7b Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 25 Feb 2010 17:33:58 +0000 Subject: wctdm24xxp, wcte12xp: Buffer handling improvements. This patch moves the majority of the buffer processing for the voicebus based cards out of the interrupt handler and into a tasklet. When multiple cards are running on the same CPU, and there was a latency condition that would cause them to get behind, this now allows the tasklet to limit how many buffers are processed on each card before giving the other card a chance to start working on it's backlog. Additionally, when the card detects a hard under run, instead of trying to fix it up in the handling routine, it will now reschedule a work item that will completely reset the descriptor rings. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8095 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wcte12xp/base.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'drivers/dahdi/wcte12xp/base.c') diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 9f6352f..7d0a8c7 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -1742,20 +1742,25 @@ static inline void t1_receiveprep(struct t1 *wc, unsigned char* readchunk) } } -static void t1_handle_transmit(struct voicebus *vb, void *vbb) +static void t1_handle_transmit(struct voicebus *vb, struct list_head *buffers) { struct t1 *wc = container_of(vb, struct t1, vb); - memset(vbb, 0, SFRAME_SIZE); - atomic_inc(&wc->txints); - t1_transmitprep(wc, vbb); - voicebus_transmit(&wc->vb, vbb); - handle_leds(wc); + struct vbb *vbb; + + list_for_each_entry(vbb, buffers, entry) { + memset(vbb, 0, SFRAME_SIZE); + atomic_inc(&wc->txints); + t1_transmitprep(wc, vbb->data); + handle_leds(wc); + } } -static void t1_handle_receive(struct voicebus *vb, void* vbb) +static void t1_handle_receive(struct voicebus *vb, struct list_head *buffers) { struct t1 *wc = container_of(vb, struct t1, vb); - t1_receiveprep(wc, vbb); + struct vbb *vbb; + list_for_each_entry(vbb, buffers, entry) + t1_receiveprep(wc, vbb->data); } #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -- cgit v1.2.3