From 318e6bc3a577e990f0ebc157b8a8fb9b8080ae94 Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Wed, 2 Jul 2003 13:53:41 +0000 Subject: [PATCH] Make the bus_dma_tag_create use NULL for the lock arguments. We are careful to call all map_load calls with BUS_DMA_NOWAIT because we really don't want some PDUs to wait while others go out - ATM guarantees the ordering of cells and also of PDUs (within one VC, that is). With BUS_DMA_NOWAIT bus_dmamap_load should never return EINPROGRESS. Make the tag used for transmission buffers one larger than the maximum AAL5 PDU (65535). This is needed, because all PDU sizes need to be round up to multiple of four for the card and PDUs that are just below the maximum size will be rounded up to 65536 --- sys/dev/fatm/if_fatm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index 27ef48cc8cc..03aed99c540 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -2877,7 +2877,7 @@ fatm_attach(device_t dev) if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, MAXDMASEGS, - BUS_SPACE_MAXSIZE_32BIT, 0, busdma_lock_mutex, &Giant, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->parent_dmat)) { if_printf(ifp, "could not allocate parent DMA tag\n"); error = ENOMEM; @@ -2891,20 +2891,21 @@ fatm_attach(device_t dev) if (bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, - busdma_lock_mutex, &Giant, &sc->rbuf_tag)) { + NULL, NULL, &sc->rbuf_tag)) { if_printf(ifp, "could not allocate rbuf DMA tag\n"); error = ENOMEM; goto fail; } /* - * Allocate the transmission DMA tag. + * Allocate the transmission DMA tag. Must add 1, because + * rounded up PDU will be 65536 bytes long. */ if (bus_dma_tag_create(sc->parent_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - FATM_MAXPDU, TPD_EXTENSIONS + TXD_FIXED, MCLBYTES, 0, - busdma_lock_mutex, &Giant, &sc->tx_tag)) { + FATM_MAXPDU + 1, TPD_EXTENSIONS + TXD_FIXED, MCLBYTES, 0, + NULL, NULL, &sc->tx_tag)) { if_printf(ifp, "could not allocate tx DMA tag\n"); error = ENOMEM; goto fail;