[svn-commits] fjoe: freebsd/trunk r9141 - in /freebsd/trunk: drivers/dahdi/ drivers/dahdi/v...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 16 03:50:45 CDT 2010


Author: fjoe
Date: Mon Aug 16 03:50:40 2010
New Revision: 9141

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9141
Log:
bus_dma_tag_create(9) on sparc64 requires non-NULL parent.

Modified:
    freebsd/trunk/drivers/dahdi/voicebus/voicebus.c
    freebsd/trunk/drivers/dahdi/voicebus/voicebus.h
    freebsd/trunk/drivers/dahdi/wcfxo.c
    freebsd/trunk/drivers/dahdi/wct4xxp/base.c
    freebsd/trunk/drivers/dahdi/wctdm.c
    freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c
    freebsd/trunk/drivers/dahdi/wcte11xp.c
    freebsd/trunk/freebsd/dahdi/bsd-compat.c
    freebsd/trunk/include/dahdi/compat/bsd.h

Modified: freebsd/trunk/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/voicebus.c Mon Aug 16 03:50:40 2010
@@ -121,16 +121,14 @@
 #define DMA_FROM_DEVICE	0
 #define DMA_TO_DEVICE	1
 
-static bus_dma_tag_t vbb_dma_tag;
-
 struct vbb *
-voicebus_alloc(int malloc_flags)
+voicebus_alloc(struct voicebus *vb, int malloc_flags)
 {
 	struct vbb *vbb;
 	int res;
 	bus_dmamap_t dma_map;
 
-	res = bus_dmamem_alloc(vbb_dma_tag, (void **) &vbb, BUS_DMA_NOWAIT | BUS_DMA_ZERO, &dma_map);
+	res = bus_dmamem_alloc(vb->dma_tag, (void **) &vbb, BUS_DMA_NOWAIT | BUS_DMA_ZERO, &dma_map);
 	if (res)
 		return NULL;
 	vbb->dma_map = dma_map;
@@ -139,20 +137,20 @@
 }
 
 void
-voicebus_free(struct vbb *vbb)
+voicebus_free(struct voicebus *vb, struct vbb *vbb)
 {
 	bus_dmamap_t dma_map = vbb->dma_map;
 
-	bus_dmamem_free(vbb_dma_tag, vbb, dma_map);
-	bus_dmamap_destroy(vbb_dma_tag, dma_map);
+	bus_dmamem_free(vb->dma_tag, vbb, dma_map);
+	bus_dmamap_destroy(vb->dma_tag, dma_map);
 }
 
 static __le32
-voicebus_map(struct vbb *vbb, int direction)
+voicebus_map(struct voicebus *vb, struct vbb *vbb, int direction)
 {
 	int res;
 
-	res = bus_dmamap_load(vbb_dma_tag, vbb->dma_map, vbb->data, sizeof(vbb->data),
+	res = bus_dmamap_load(vb->dma_tag, vbb->dma_map, vbb->data, sizeof(vbb->data),
 	    dahdi_dma_map_addr, &vbb->paddr, 0);
 	if (res) {
 		if (printk_ratelimit())
@@ -163,9 +161,9 @@
 }
 
 static void
-voicebus_unmap(struct vbb *vbb, int direction)
-{
-	bus_dmamap_unload(vbb_dma_tag, vbb->dma_map);
+voicebus_unmap(struct voicebus *vb, struct vbb *vbb, int direction)
+{
+	bus_dmamap_unload(vb->dma_tag, vbb->dma_map);
 }
 #else /* !__FreeBSD__ */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
@@ -175,28 +173,28 @@
 #endif
 
 struct vbb *
-voicebus_alloc(int malloc_flags)
+voicebus_alloc(struct voicebus *vb, int malloc_flags)
 {
 	return kmem_cache_alloc(voicebus_vbb_cache, malloc_flags);
 }
 EXPORT_SYMBOL(voicebus_alloc);
 
 void
-voicebus_free(struct vbb *vbb)
+voicebus_free(struct voicebus *vb, struct vbb *vbb)
 {
 	kmem_cache_free(voicebus_vbb_cache, vbb);
 }
 EXPORT_SYMBOL(voicebus_free);
 
 static __le32
-voicebus_map(struct vbb *vbb, int direction)
+voicebus_map(struct voicebus *vb, struct vbb *vbb, int direction)
 {
 	vbb->paddr = dma_map_single(&vb->pdev->dev, vbb->data, sizeof(vbb->data), direction);
 	return vbb->paddr;
 }
 
 static void
-voicebus_unmap(struct vbb *vbb, int direction)
+voicebus_unmap(struct voicebus *vb, struct vbb *vbb, int direction)
 {
 	dma_unmap_single(&vb->pdev->dev, vbb->paddr, VOICEBUS_SFRAME_SIZE, direction);
 }
@@ -296,7 +294,7 @@
 	}
 
 #if defined(__FreeBSD__)
-	i = dahdi_dma_allocate((sizeof(*d) + dl->padding) * DRING_SIZE,
+	i = dahdi_dma_allocate(vb->pdev->dev, (sizeof(*d) + dl->padding) * DRING_SIZE,
 	    &dl->dma_tag, &dl->dma_map, (void **) &dl->desc, &dl->desc_dma);
 	if (i) {
 		return i;
@@ -365,7 +363,7 @@
 	}
 
 #if defined(__FreeBSD__)
-	i = dahdi_dma_allocate((sizeof(*d) + dl->padding) * DRING_SIZE,
+	i = dahdi_dma_allocate(vb->pdev->dev, (sizeof(*d) + dl->padding) * DRING_SIZE,
 	    &dl->dma_tag, &dl->dma_map, (void **) &dl->desc, &dl->desc_dma);
 	if (i) {
 		return i;
@@ -516,8 +514,8 @@
 		d = vb_descriptor(dl, i);
 		if (d->buffer1 && (d->buffer1 != vb->idle_vbb_dma_addr)) {
 			WARN_ON(!dl->pending[i]);
-			voicebus_unmap(dl->pending[i], DMA_TO_DEVICE);
-			voicebus_free(dl->pending[i]);
+			voicebus_unmap(vb, dl->pending[i], DMA_TO_DEVICE);
+			voicebus_free(vb, dl->pending[i]);
 		}
 		if (!test_bit(VOICEBUS_NORMAL_MODE, &vb->flags)) {
 			d->buffer1 = 0;
@@ -554,10 +552,10 @@
 	for (i = 0; i < DRING_SIZE; ++i) {
 		d = vb_descriptor(dl, i);
 		if (d->buffer1) {
-			voicebus_unmap(dl->pending[i], DMA_FROM_DEVICE);
+			voicebus_unmap(vb, dl->pending[i], DMA_FROM_DEVICE);
 			d->buffer1 = 0;
 			BUG_ON(!dl->pending[i]);
-			voicebus_free(dl->pending[i]);
+			voicebus_free(vb, dl->pending[i]);
 			dl->pending[i] = NULL;
 		}
 		d->des0 &= ~OWN_BIT;
@@ -776,13 +774,13 @@
 	if (unlikely(d->buffer1)) {
 		/* Do not overwrite a buffer that is still in progress. */
 		WARN_ON(1);
-		voicebus_free(vbb);
+		voicebus_free(vb, vbb);
 		return -EBUSY;
 	}
 
 	dl->pending[tail] = vbb;
 	dl->tail = (++tail) & DRING_MASK;
-	d->buffer1 = voicebus_map(vbb, DMA_FROM_DEVICE);
+	d->buffer1 = voicebus_map(vb, vbb, DMA_FROM_DEVICE);
 	SET_OWNED(d); /* That's it until the hardware is done with it. */
 #if defined(__FreeBSD__)
 	bus_dmamap_sync(dl->dma_tag, dl->dma_map, BUS_DMASYNC_PREWRITE);
@@ -804,12 +802,12 @@
 
 #if defined(__FreeBSD__)
 	bus_dmamap_sync(dl->dma_tag, dl->dma_map, BUS_DMASYNC_POSTREAD);
-	bus_dmamap_sync(vbb_dma_tag, vbb->dma_map, BUS_DMASYNC_PREWRITE);
+	bus_dmamap_sync(vb->dma_tag, vbb->dma_map, BUS_DMASYNC_PREWRITE);
 #endif
 	if (unlikely((d->buffer1 != vb->idle_vbb_dma_addr) && d->buffer1)) {
 		if (printk_ratelimit())
 			dev_warn(&vb->pdev->dev, "Dropping tx buffer buffer\n");
-		voicebus_free(vbb);
+		voicebus_free(vb, vbb);
 		/* Schedule the underrun handler to run here, since we'll need
 		 * to cleanup as best we can. */
 		schedule_work(&vb->underrun_work);
@@ -817,7 +815,7 @@
 	}
 
 	dl->pending[dl->tail] = vbb;
-	d->buffer1 = voicebus_map(vbb, DMA_TO_DEVICE);
+	d->buffer1 = voicebus_map(vb, vbb, DMA_TO_DEVICE);
 	dl->tail = (++(dl->tail)) & DRING_MASK;
 	SET_OWNED(d); /* That's it until the hardware is done with it. */
 #if defined(__FreeBSD__)
@@ -857,7 +855,7 @@
 	vb_setctl(vb, 0x0018, (u32)vb->rxd.desc_dma);
 
 	for (i = 0; i < DRING_SIZE; ++i) {
-		vbb = voicebus_alloc(GFP_KERNEL);
+		vbb = voicebus_alloc(vb, GFP_KERNEL);
 		if (unlikely(NULL == vbb))
 			BUG_ON(1);
 		list_add_tail(&vbb->entry, &buffers);
@@ -872,7 +870,7 @@
 
 	if (test_bit(VOICEBUS_NORMAL_MODE, &vb->flags)) {
 		for (i = 0; i < vb->min_tx_buffer_count; ++i) {
-			vbb = voicebus_alloc(GFP_KERNEL);
+			vbb = voicebus_alloc(vb, GFP_KERNEL);
 			if (unlikely(NULL == vbb))
 				BUG_ON(1);
 			else
@@ -996,7 +994,7 @@
 		return NULL;
 
 	vbb = dl->pending[head];
-	voicebus_unmap(vbb, DMA_TO_DEVICE);
+	voicebus_unmap(vb, vbb, DMA_TO_DEVICE);
 	if (test_bit(VOICEBUS_NORMAL_MODE, &vb->flags)) {
 		d->buffer1 = vb->idle_vbb_dma_addr;
 		dl->pending[head] = vb->idle_vbb;
@@ -1031,7 +1029,7 @@
 		return NULL;
 
 	vbb = dl->pending[head];
-	voicebus_unmap(vbb, DMA_FROM_DEVICE);
+	voicebus_unmap(vb, vbb, DMA_FROM_DEVICE);
 	dl->head = (++head) & DRING_MASK;
 	d->buffer1 = 0;
 	atomic_dec(&dl->count);
@@ -1041,7 +1039,7 @@
 	*des0 = le32_to_cpu(d->des0);
 #if defined(__FreeBSD__)
 	bus_dmamap_sync(dl->dma_tag, dl->dma_map, BUS_DMASYNC_PREWRITE);
-	bus_dmamap_sync(vbb_dma_tag, vbb->dma_map, BUS_DMASYNC_POSTREAD);
+	bus_dmamap_sync(vb->dma_tag, vbb->dma_map, BUS_DMASYNC_POSTREAD);
 #endif
 	return vbb;
 }
@@ -1281,6 +1279,11 @@
 		bus_release_resource(vb->pdev->dev, SYS_RES_MEMORY, vb->mem_rid, vb->mem_res);
 		vb->mem_res = NULL;
 	}
+
+	if (vb->dma_tag != NULL) {
+		bus_dma_tag_destroy(vb->dma_tag);
+		vb->dma_tag = NULL;
+	}
 #else /* !__FreeBSD__ */
 	release_mem_region(pci_resource_start(vb->pdev, 1),
 		pci_resource_len(vb->pdev, 1));
@@ -1324,7 +1327,7 @@
 	/* Set the minimum latency in case we're restarted...we don't want to
 	 * wait for the buffer to grow to this depth again in that case. */
 	for (i = 0; i < increase; ++i) {
-		vbb = voicebus_alloc(GFP_ATOMIC);
+		vbb = voicebus_alloc(vb, GFP_ATOMIC);
 		WARN_ON(NULL == vbb);
 		if (likely(NULL != vbb))
 			list_add_tail(&vbb->entry, &local);
@@ -1563,7 +1566,7 @@
 	while (!list_empty(&buffers)) {
 		vbb = list_entry(buffers.next, struct vbb, entry);
 		list_del(&vbb->entry);
-		voicebus_free(vbb);
+		voicebus_free(vb, vbb);
 	}
 	return;
 }
@@ -1754,6 +1757,14 @@
 #endif
 
 #if defined(__FreeBSD__)
+	retval = bus_dma_tag_create(bus_get_dma_tag(vb->pdev->dev), 8, 0,
+	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+	    sizeof(struct vbb), 1, sizeof(struct vbb), BUS_DMA_ALLOCNOW, NULL, NULL, &vb->dma_tag);
+	if (retval) {
+		device_printf(vb->pdev->dev, "Can't allocate DMA tag for voicebus frames\n");
+		goto cleanup;
+	}
+
 	vb->mem_rid = PCIR_BAR(1);
 	vb->mem_res = bus_alloc_resource_any(vb->pdev->dev, SYS_RES_MEMORY, &vb->mem_rid, RF_ACTIVE);
 	if (vb->mem_res == NULL) {
@@ -1794,7 +1805,7 @@
 #endif
 
 #if defined(__FreeBSD__)
-	retval = dahdi_dma_allocate(VOICEBUS_SFRAME_SIZE,
+	retval = dahdi_dma_allocate(vb->pdev->dev, VOICEBUS_SFRAME_SIZE,
 	    &vb->idle_vbb_dma_tag, &vb->idle_vbb_dma_map, (void **) &vb->idle_vbb, &vb->idle_vbb_dma_addr);
 	if (retval) {
 		dev_err(&vb->pdev->dev, "Can't allocate DMA memory\n");
@@ -1901,6 +1912,11 @@
 	if (vb->mem_res != NULL) {
 		bus_release_resource(vb->pdev->dev, SYS_RES_MEMORY, vb->mem_rid, vb->mem_res);
 		vb->mem_res = NULL;
+	}
+
+	if (vb->dma_tag != NULL) {
+		bus_dma_tag_destroy(vb->dma_tag);
+		vb->dma_tag = NULL;
 	}
 #else /* !__FreeBSD__ */
 	dma_free_coherent(&vb->pdev->dev, VOICEBUS_SFRAME_SIZE,
@@ -2017,15 +2033,7 @@
 {
 	int res;
 
-#if defined(__FreeBSD__)
-	res = bus_dma_tag_create(NULL, 8, 0,
-	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
-	    sizeof(struct vbb), 1, sizeof(struct vbb), BUS_DMA_ALLOCNOW, NULL, NULL, &vbb_dma_tag);
-	if (res) {
-		printf("voicebus: Can't allocate DMA tag for voicebus frames\n");
-		return -res;
-	}
-#else /* !__FreeBSD__ */
+#if !defined(__FreeBSD__)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
 	voicebus_vbb_cache = kmem_cache_create(THIS_MODULE->name,
 					 sizeof(struct vbb), 0,
@@ -2071,12 +2079,7 @@
 
 static void __exit voicebus_module_cleanup(void)
 {
-#if defined(__FreeBSD__)
-	if (vbb_dma_tag != NULL) {
-		bus_dma_tag_destroy(vbb_dma_tag);
-		vbb_dma_tag = NULL;
-	}
-#else
+#if !defined(__FreeBSD__)
 	kmem_cache_destroy(voicebus_vbb_cache);
 #endif
 	spin_lock_destroy(&loader_list_lock);

Modified: freebsd/trunk/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/voicebus.h (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/voicebus.h Mon Aug 16 03:50:40 2010
@@ -123,6 +123,8 @@
 
 	struct resource *	mem_res;	/* resource for memory I/O */
 	int			mem_rid;
+
+	bus_dma_tag_t		dma_tag;
 #else
 	void __iomem 		*iobase;
 #endif
@@ -177,8 +179,8 @@
 void voicebus_release(struct voicebus *vb);
 int voicebus_start(struct voicebus *vb);
 int voicebus_stop(struct voicebus *vb);
-struct vbb *voicebus_alloc(int malloc_flags);
-void voicebus_free(struct vbb *vbb);
+struct vbb *voicebus_alloc(struct voicebus *vb, int malloc_flags);
+void voicebus_free(struct voicebus *vb, struct vbb *vbb);
 int voicebus_transmit(struct voicebus *vb, struct vbb *vbb);
 int voicebus_set_minlatency(struct voicebus *vb, unsigned int milliseconds);
 int voicebus_current_latency(struct voicebus *vb);

Modified: freebsd/trunk/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcfxo.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcfxo.c (original)
+++ freebsd/trunk/drivers/dahdi/wcfxo.c Mon Aug 16 03:50:40 2010
@@ -1238,12 +1238,12 @@
 
 	/* allocate enough memory for two zt chunks.  Each sample uses
 	   32 bits.  Allocate an extra set just for control too */
-	res = dahdi_dma_allocate(DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->write_dma_tag, &wc->write_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->write_dma_tag, &wc->write_dma_map,
 	    __DECONST(void **, &wc->writechunk), &wc->writedma);
 	if (res)
 		goto err;
 
-	res = dahdi_dma_allocate(DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->read_dma_tag, &wc->read_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->read_dma_tag, &wc->read_dma_map,
 	    __DECONST(void **, &wc->readchunk), &wc->readdma);
 	if (res)
 		goto err;

Modified: freebsd/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wct4xxp/base.c Mon Aug 16 03:50:40 2010
@@ -3382,12 +3382,12 @@
 	bus_dmamap_t    write_dma_map;
 
 	/* allocate DMA resources */
-	res = dahdi_dma_allocate(numbufs * T4_BASE_SIZE, &write_dma_tag, &write_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, numbufs * T4_BASE_SIZE, &write_dma_tag, &write_dma_map,
 	    &writechunk, &writedma);
 	if (res)
 		return -res;
 
-	res = dahdi_dma_allocate(numbufs * T4_BASE_SIZE, &read_dma_tag, &read_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, numbufs * T4_BASE_SIZE, &read_dma_tag, &read_dma_map,
 	    &readchunk, &readdma);
 	if (res) {
 		dahdi_dma_free(&write_dma_tag, &write_dma_map, &writechunk, &writedma);

Modified: freebsd/trunk/drivers/dahdi/wctdm.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wctdm.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/wctdm.c (original)
+++ freebsd/trunk/drivers/dahdi/wctdm.c Mon Aug 16 03:50:40 2010
@@ -2987,12 +2987,12 @@
 
 	/* allocate enough memory for two zt chunks.  Each sample uses
 	   32 bits.  Allocate an extra set just for control too */
-	res = dahdi_dma_allocate(DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->write_dma_tag, &wc->write_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->write_dma_tag, &wc->write_dma_map,
 	    __DECONST(void **, &wc->writechunk), &wc->writedma);
 	if (res)
 		goto err;
 
-	res = dahdi_dma_allocate(DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->read_dma_tag, &wc->read_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 4, &wc->read_dma_tag, &wc->read_dma_map,
 	    __DECONST(void **, &wc->readchunk), &wc->readdma);
 	if (res)
 		goto err;

Modified: freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c Mon Aug 16 03:50:40 2010
@@ -2083,7 +2083,7 @@
 
 	list_for_each_entry_safe(vbb, n, buffers, entry) {
 		list_del(&vbb->entry);
-		voicebus_free(vbb);
+		voicebus_free(vb, vbb);
 	}
 }
 
@@ -4227,7 +4227,7 @@
 	if (count > MAX_COMMAND_LENGTH)
 		return -EINVAL;
 
-	vbb = voicebus_alloc(GFP_KERNEL);
+	vbb = voicebus_alloc(&wc->vb, GFP_KERNEL);
 	WARN_ON(!vbb);
 	if (!vbb)
 		return -ENOMEM;

Modified: freebsd/trunk/drivers/dahdi/wcte11xp.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcte11xp.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcte11xp.c (original)
+++ freebsd/trunk/drivers/dahdi/wcte11xp.c Mon Aug 16 03:50:40 2010
@@ -1768,12 +1768,12 @@
 	if (res)
 		goto err;
 
-	res = dahdi_dma_allocate(DAHDI_MAX_CHUNKSIZE * 32 * 2, &wc->write_dma_tag, &wc->write_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, DAHDI_MAX_CHUNKSIZE * 32 * 2, &wc->write_dma_tag, &wc->write_dma_map,
 	    __DECONST(void **, &wc->writechunk), &wc->writedma);
 	if (res)
 		goto err;
 
-	res = dahdi_dma_allocate(DAHDI_MAX_CHUNKSIZE * 32 * 2, &wc->read_dma_tag, &wc->read_dma_map,
+	res = dahdi_dma_allocate(wc->dev->dev, DAHDI_MAX_CHUNKSIZE * 32 * 2, &wc->read_dma_tag, &wc->read_dma_map,
 	    __DECONST(void **, &wc->readchunk), &wc->readdma);
 	if (res)
 		goto err;

Modified: freebsd/trunk/freebsd/dahdi/bsd-compat.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/freebsd/dahdi/bsd-compat.c?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/freebsd/dahdi/bsd-compat.c (original)
+++ freebsd/trunk/freebsd/dahdi/bsd-compat.c Mon Aug 16 03:50:40 2010
@@ -452,11 +452,11 @@
 }
 
 int
-dahdi_dma_allocate(int size, bus_dma_tag_t *ptag, bus_dmamap_t *pmap, void **pvaddr, uint32_t *ppaddr)
+dahdi_dma_allocate(device_t dev, int size, bus_dma_tag_t *ptag, bus_dmamap_t *pmap, void **pvaddr, uint32_t *ppaddr)
 {
 	int res;
 
-	res = bus_dma_tag_create(NULL, 8, 0,
+	res = bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0,
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 	    size, 1, size, BUS_DMA_ALLOCNOW, NULL, NULL, ptag);
 	if (res)

Modified: freebsd/trunk/include/dahdi/compat/bsd.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/compat/bsd.h?view=diff&rev=9141&r1=9140&r2=9141
==============================================================================
--- freebsd/trunk/include/dahdi/compat/bsd.h (original)
+++ freebsd/trunk/include/dahdi/compat/bsd.h Mon Aug 16 03:50:40 2010
@@ -526,7 +526,7 @@
 dahdi_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error);
 
 int
-dahdi_dma_allocate(int size, bus_dma_tag_t *ptag, bus_dmamap_t *pmap, void **pvaddr, uint32_t *ppaddr);
+dahdi_dma_allocate(device_t dev, int size, bus_dma_tag_t *ptag, bus_dmamap_t *pmap, void **pvaddr, uint32_t *ppaddr);
 
 void
 dahdi_dma_free(bus_dma_tag_t *ptag, bus_dmamap_t *pmap, void **pvaddr, uint32_t *ppaddr);




More information about the svn-commits mailing list