diff options
author | Michael Knudsen <mk@cvs.openbsd.org> | 2010-07-02 20:54:37 +0000 |
---|---|---|
committer | Michael Knudsen <mk@cvs.openbsd.org> | 2010-07-02 20:54:37 +0000 |
commit | be799bb62dea227a3af3336623e9b89eec3dc9c7 (patch) | |
tree | 15a358c8ffd64896cafebe66aea31780b6aa36b8 /sys/dev/pci | |
parent | 2e96e3e41e1707b96ebeb962647e09e0e5eccd46 (diff) |
Provide an iopool in arc(4).
ok dlg matthew
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/arc.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index 948d7cf1139..c6723892e97 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.88 2010/07/02 20:52:14 mk Exp $ */ +/* $OpenBSD: arc.c,v 1.89 2010/07/02 20:54:36 mk Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -378,6 +378,7 @@ struct arc_softc { struct arc_ccb_list sc_ccb_free; struct mutex sc_ccb_mtx; + struct scsi_iopool sc_iopool; struct scsibus_softc *sc_scsibus; struct rwlock sc_lock; @@ -598,6 +599,7 @@ arc_attach(struct device *parent, struct device *self, void *aux) sc->sc_link.adapter_target = ARC_MAX_TARGET; sc->sc_link.adapter_buswidth = ARC_MAX_TARGET; sc->sc_link.openings = sc->sc_req_count / ARC_MAX_TARGET; + sc->sc_link.pool = &sc->sc_iopool; bzero(&saa, sizeof(saa)); saa.saa_sc_link = &sc->sc_link; @@ -725,18 +727,11 @@ arc_scsi_cmd(struct scsi_xfer *xs) return; } - ccb = arc_get_ccb(sc); - if (ccb == NULL) { - xs->error = XS_DRIVER_STUFFUP; - scsi_done(xs); - return; - } - + ccb = xs->io; ccb->ccb_xs = xs; if (arc_load_xs(ccb) != 0) { xs->error = XS_DRIVER_STUFFUP; - arc_put_ccb(sc, ccb); scsi_done(xs); return; } @@ -862,7 +857,6 @@ arc_scsi_cmd_done(struct arc_softc *sc, struct arc_ccb *ccb, u_int32_t reg) xs->resid = 0; } - arc_put_ccb(sc, ccb); scsi_done(xs); } @@ -1932,6 +1926,10 @@ arc_alloc_ccbs(struct arc_softc *sc) arc_put_ccb(sc, ccb); } + scsi_iopool_init(&sc->sc_iopool, sc, + (void *(*)(void *))arc_get_ccb, + (void (*)(void *, void *))arc_put_ccb); + return (0); free_maps: |