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
This commit is contained in:
Hartmut Brandt 2003-07-02 13:53:41 +00:00
parent a5d7d2028e
commit 318e6bc3a5

View File

@ -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;