summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-07-02 13:53:41 +0000
committerharti <harti@FreeBSD.org>2003-07-02 13:53:41 +0000
commit70fd43e13428fba16f5bf004904c4f131f842c57 (patch)
treebea788101f093675be38f050d421e515f9c4d446
parentf36e9650562f41dfbb1f89ea678e5f536f36ab7a (diff)
downloadFreeBSD-src-70fd43e13428fba16f5bf004904c4f131f842c57.zip
FreeBSD-src-70fd43e13428fba16f5bf004904c4f131f842c57.tar.gz
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
-rw-r--r--sys/dev/fatm/if_fatm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c
index 27ef48c..03aed99 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;
OpenPOWER on IntegriCloud