From f53195d29a8fff7695e0e7ba6e882a43ec827056 Mon Sep 17 00:00:00 2001 From: yongari Date: Tue, 29 May 2007 06:30:26 +0000 Subject: Honor maxsegsz of less than a page size in a DMA tag. Previously it used to return PAGE_SIZE without respect to restrictions of a DMA tag. This affected all of the busdma load functions that use _bus_dmamap_loader_buffer() as their back-end. Reviewed by: scottl --- sys/i386/i386/busdma_machdep.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/i386') diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index 813e9ca..5d7c9cd 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -674,6 +674,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, * Compute the segment size, and adjust counts. */ sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); + if (sgsize > dmat->maxsegsz) + sgsize = dmat->maxsegsz; if (buflen < sgsize) sgsize = buflen; -- cgit v1.1