aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2023-11-29 01:50:39 +0000
committerWarner Losh <imp@FreeBSD.org>2023-11-29 01:52:23 +0000
commit489eee0d41dce317678adb0dae8d509a5f1d6d93 (patch)
treea1843dc1b876a6f89bf54231a90e5ae03c10465b
parent39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a (diff)
downloadsrc-489eee0d41dce317678adb0dae8d509a5f1d6d93.tar.gz
src-489eee0d41dce317678adb0dae8d509a5f1d6d93.zip
mpi3mr: Use template for main busdma tag.
Use the simpler template code for the parent busdma tag for all I/O to this card. Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebsd.org/D42607
-rw-r--r--sys/dev/mpi3mr/mpi3mr_pci.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/dev/mpi3mr/mpi3mr_pci.c b/sys/dev/mpi3mr/mpi3mr_pci.c
index d07463366943..c1c0211aab4e 100644
--- a/sys/dev/mpi3mr/mpi3mr_pci.c
+++ b/sys/dev/mpi3mr/mpi3mr_pci.c
@@ -256,6 +256,7 @@ mpi3mr_release_resources(struct mpi3mr_softc *sc)
static int mpi3mr_setup_resources(struct mpi3mr_softc *sc)
{
+ bus_dma_template_t t;
int i;
device_t dev = sc->mpi3mr_dev;
@@ -288,20 +289,11 @@ static int mpi3mr_setup_resources(struct mpi3mr_softc *sc)
* dma_mask on the device.
*/
/* Allocate the parent DMA tag */
- if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
- 1, 0, /* algnmnt, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- BUS_SPACE_MAXSIZE_32BIT,/* maxsize */
- BUS_SPACE_UNRESTRICTED, /* nsegments */
- BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */
- 0, /* flags */
- NULL, NULL, /* lockfunc, lockarg */
- &sc->mpi3mr_parent_dmat)) {
+ bus_dma_template_init(&t, bus_get_dma_tag(dev));
+ if (bus_dma_template_tag(&t, &sc->mpi3mr_parent_dmat)) {
mpi3mr_dprint(sc, MPI3MR_ERROR, "Cannot allocate parent DMA tag\n");
return (ENOMEM);
- }
+ }
sc->max_msix_vectors = pci_msix_count(dev);