[svn-commits] sruffell: branch linux/sruffell/wctdm24xxp-cmdlist r9836 - /linux/team/sruffe...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 16 16:38:53 CDT 2011


Author: sruffell
Date: Wed Mar 16 16:38:48 2011
New Revision: 9836

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9836
Log:
voicebus: Update the network debug device to use dma_pools.

r9402 switched to dma_pool for the SFRAMES. This updates the network
debug device to use the dma_pools for SFRAME allocation.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.c
    linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.h
    linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus_net.c

Modified: linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=9836&r1=9835&r2=9836
==============================================================================
--- linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.c Wed Mar 16 16:38:48 2011
@@ -979,9 +979,7 @@
 	dl->head = (++head) & DRING_MASK;
 	d->buffer1 = 0;
 	atomic_dec(&dl->count);
-#	ifdef VOICEBUS_NET_DEBUG
 	vb_net_capture_vbb(vb, vbb, 0, d->des0, d->container);
-#	endif
 	*des0 = le32_to_cpu(d->des0);
 	return vbb;
 }

Modified: linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=9836&r1=9835&r2=9836
==============================================================================
--- linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.h (original)
+++ linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus.h Wed Mar 16 16:38:48 2011
@@ -32,11 +32,6 @@
 #include <linux/interrupt.h>
 
 
-#ifdef VOICEBUS_NET_DEBUG
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#endif
-
 #define VOICEBUS_DEFAULT_LATENCY	3U
 #define VOICEBUS_DEFAULT_MAXLATENCY	25U
 #define VOICEBUS_MAXLATENCY_BUMP	6U
@@ -76,6 +71,11 @@
 
 #endif
 
+#ifdef VOICEBUS_NET_DEBUG
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#endif
 
 struct voicebus;
 

Modified: linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus_net.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus_net.c?view=diff&rev=9836&r1=9835&r2=9836
==============================================================================
--- linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus_net.c (original)
+++ linux/team/sruffell/wctdm24xxp-cmdlist/drivers/dahdi/voicebus/voicebus_net.c Wed Mar 16 16:38:48 2011
@@ -3,7 +3,7 @@
  *
  * Written by Shaun Ruffell <sruffell at digium.com>
  *
- * Copyright (C) 2010 Digium, Inc.
+ * Copyright (C) 2010-2011 Digium, Inc.
  *
  * All rights reserved.
 
@@ -57,8 +57,9 @@
 skb_to_vbb(struct voicebus *vb, struct sk_buff *skb)
 {
 	int res;
-	void *vbb;
+	struct vbb *vbb;
 	const int COMMON_HEADER = 30;
+	dma_addr_t dma_addr;
 
 	if (skb->len != (VOICEBUS_SFRAME_SIZE + COMMON_HEADER)) {
 		dev_warn(&vb->pdev->dev, "Packet of length %d is not the "
@@ -67,13 +68,15 @@
 		return NULL;
 	}
 
-	vbb = voicebus_alloc(vb);
+	vbb = dma_pool_alloc(vb->pool, GFP_KERNEL, &dma_addr);
 	if (!vbb)
 		return NULL;
+
+	vbb->dma_addr = dma_addr;
 	res = skb_copy_bits(skb, COMMON_HEADER, vbb, VOICEBUS_SFRAME_SIZE);
 	if (res) {
 		dev_warn(&vb->pdev->dev, "Failed call to skb_copy_bits.\n");
-		voicebus_free(vb, vbb);
+		dma_pool_free(vb->pool, vbb, vbb->dma_addr);
 		return NULL;
 	}
 	return vbb;




More information about the svn-commits mailing list