From e502090edb1afbf157ab5a195f23b62ac65279e1 Mon Sep 17 00:00:00 2001 From: scottl Date: Tue, 26 Sep 2006 23:14:42 +0000 Subject: The need to run a filter also implies that bouncing could be possible, so just use the COULD_BOUNCE flag for both and retire the USE_FILTER flag. This fixes the problem that rev 1.81 introduced with the if_bfe driver (and possibly others). --- sys/i386/i386/busdma_machdep.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/i386') diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index bfabce9..9cb4b7e 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #define MAX_BPAGES 512 -#define BUS_DMA_USE_FILTER BUS_DMA_BUS2 #define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 @@ -269,8 +268,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, newtag->boundary = MIN(parent->boundary, newtag->boundary); if ((newtag->filter != NULL) || - ((parent->flags & BUS_DMA_USE_FILTER) != 0)) - newtag->flags |= BUS_DMA_USE_FILTER; + ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) + newtag->flags |= BUS_DMA_COULD_BOUNCE; if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly @@ -583,7 +582,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, while (vaddr < vendaddr) { paddr = pmap_kextract(vaddr); - if (((dmat->flags & BUS_DMA_USE_FILTER) != 0) && + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && run_filter(dmat, paddr) != 0) { needbounce = 1; map->pagesneeded++; @@ -682,7 +681,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, sgsize = (baddr - curaddr); } - if (((dmat->flags & BUS_DMA_USE_FILTER) != 0) && + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && run_filter(dmat, curaddr)) curaddr = add_bounce_page(dmat, map, vaddr, sgsize); -- cgit v1.1