diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2006-04-18 00:21:07 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2006-04-18 00:21:07 +0000 |
commit | c3a460720686e0815513be6cfeafca368f05917d (patch) | |
tree | fec014709a3074ef7ef3b701742c588c6b406ee8 /sys/dev | |
parent | e0f983e6f6de454e5bbebe18c72eb64fc6948db7 (diff) |
Actually add ccbs to the queue.
Fix the error path for mfi_init_ccb.
Alter dmamap for io.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/mfi.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index 9bcf41c220f..fc330c1c77d 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.17 2006/04/17 16:46:39 marco Exp $ */ +/* $OpenBSD: mfi.c,v 1.18 2006/04/18 00:21:06 marco Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * @@ -148,19 +148,29 @@ mfi_init_ccb(struct mfi_softc *sc) /* create a dma map for transfer */ error = bus_dmamap_create(sc->sc_dmat, - sc->sc_max_sgl * PAGE_SIZE, - sc->sc_max_sgl, sc->sc_max_sgl * PAGE_SIZE, 0, + MAXPHYS, sc->sc_max_sgl, MAXPHYS, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &ccb->ccb_dmamap); if (error) { printf("%s: cannot create ccb dmamap (%d)\n", DEVNAME(sc), error); goto destroy; } + + /* add ccb to queue */ + mfi_put_ccb(ccb); } return (0); destroy: - /* XXX free dma maps */ + /* free dma maps and ccb memory */ + while (i) { + ccb = &sc->sc_ccb[i]; + bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); + i--; + } + + free(sc->sc_ccb, M_DEVBUF); + return (1); } @@ -413,7 +423,7 @@ mfi_intr(void *arg) printf("%s: invalid context, p: %d c: %d\n", DEVNAME(sc), producer, consumer); else { - /* remove from queue and call scsi_done */ + /* XXX remove from queue and call scsi_done */ claimed = 1; } consumer++; |