From 588920f14efb90f43207ef8b0a8b0d6f1465c957 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sat, 9 Aug 2003 15:16:45 +0000 Subject: [PATCH] Call bus_dmamap_create() to create the per-SRB buffer maps. Note that none of the SRB resources are freed when the driver unloads; maybe that will be tackled another day. --- sys/dev/trm/trm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 385d220141f2..acc33a4c5215 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -2999,6 +2999,7 @@ trm_initSRB(PACB pACB) { u_int16_t i; PSRB pSRB; + int error; for (i = 0; i < TRM_MAX_SRB_CNT; i++) { pSRB = (PSRB)&pACB->pFreeSRB[i]; @@ -3040,6 +3041,17 @@ trm_initSRB(PACB pACB) pSRB->pNextSRB = NULL; } pSRB->TagNumber = i; + + /* + * Create the dmamap. This is no longer optional! + * + * XXX This is not freed on unload! None of the other + * allocations in this function are either! + */ + if ((error = bus_dmamap_create(pACB->buffer_dmat, 0, + &pSRB->dmamap)) != 0) + return (error); + } return (0); }