summaryrefslogtreecommitdiff
path: root/sys/dev/atapiscsi/atapiscsi.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-01-18 20:50:25 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-01-18 20:50:25 +0000
commitdd2678d72cfd9050e3d7664da058e00f962dde2e (patch)
tree41430856d8645c04cdcbe7530091889d5719641a /sys/dev/atapiscsi/atapiscsi.c
parent5b993b0f6927dbf33e76996899b9bc588892961b (diff)
move atapiscsi to iopools by making the entire ata layer use them too.
this would have been difficult before because the ata completion paths try to be helfpul by freeing xfers on the adapters behalf, whch doesn't work in the new world scsi model where the layer that allocated the thing is responsible for freeing it, and expects to get it back and maybe use it again. however, deraadt@ added magic flags for hibernate that im now using to keep ata xfers for the scsi layers. committing this now so itll be tested. i cant think of a better time to handle fallout from diffs like this than hackathons. discussed with deraadt@
Diffstat (limited to 'sys/dev/atapiscsi/atapiscsi.c')
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 90ed8073600..d9a58c1ee17 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.100 2012/08/08 02:32:11 matthew Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.101 2014/01/18 20:50:24 dlg Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -213,6 +213,8 @@ atapiscsi_attach(struct device *parent, struct device *self, void *aux)
struct ataparams *id = &drvp->id;
struct device *child;
+ extern struct scsi_iopool wdc_xfer_iopool;
+
printf("\n");
/* Initialize shared data. */
@@ -232,6 +234,7 @@ atapiscsi_attach(struct device *parent, struct device *self, void *aux)
as->sc_adapterlink.luns = 1;
as->sc_adapterlink.openings = 1;
as->sc_adapterlink.flags = SDEV_ATAPI;
+ as->sc_adapterlink.pool = &wdc_xfer_iopool;
strlcpy(drvp->drive_name, as->sc_dev.dv_xname,
sizeof(drvp->drive_name));
@@ -340,13 +343,7 @@ wdc_atapi_send_cmd(struct scsi_xfer *sc_xfer)
return;
}
- xfer = wdc_get_xfer(sc_xfer->flags & SCSI_NOSLEEP
- ? WDC_NOSLEEP : WDC_CANSLEEP);
- if (xfer == NULL) {
- sc_xfer->error = XS_NO_CCB;
- scsi_done(sc_xfer);
- return;
- }
+ xfer = sc_xfer->io;
if (sc_xfer->flags & SCSI_POLL)
xfer->c_flags |= C_POLL;
xfer->drive = as->drive;