summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mfi.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-03-23 01:57:21 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-03-23 01:57:21 +0000
commitcd948c1fd3a45bb8ee18483b4f8df6ce849f8140 (patch)
tree2748525ad92550d0ad2b46b5619c24e5bcda0e13 /sys/dev/ic/mfi.c
parente88d321d148e115dbbf6fea61f7c0dcb67021421 (diff)
Change the scsi_cmd function member of scsi_adapter from int to
void. Use XS_NO_CCB error in the scsi command (xs) to report the NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE confusion and untangles the midlayer from the adapter a bit more. Eyes and some fixes by miod@ There may be some compile issues on little used (i.e. I don't have any) drivers but the change is mechanical and thus easy to remedy. ok dlg@
Diffstat (limited to 'sys/dev/ic/mfi.c')
-rw-r--r--sys/dev/ic/mfi.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 37357603a19..3697effd41b 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.99 2010/01/09 23:15:06 krw Exp $ */
+/* $OpenBSD: mfi.c,v 1.100 2010/03/23 01:57:19 krw Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -55,7 +55,7 @@ struct cfdriver mfi_cd = {
NULL, "mfi", DV_DULL
};
-int mfi_scsi_cmd(struct scsi_xfer *);
+void mfi_scsi_cmd(struct scsi_xfer *);
int mfi_scsi_ioctl(struct scsi_link *, u_long, caddr_t, int, struct proc *);
void mfiminphys(struct buf *bp, struct scsi_link *sl);
@@ -974,7 +974,7 @@ mfi_scsi_ld(struct mfi_ccb *ccb, struct scsi_xfer *xs)
return (0);
}
-int
+void
mfi_scsi_cmd(struct scsi_xfer *xs)
{
struct scsi_link *link = xs->sc_link;
@@ -1002,7 +1002,11 @@ mfi_scsi_cmd(struct scsi_xfer *xs)
if ((ccb = mfi_get_ccb(sc)) == NULL) {
DNPRINTF(MFI_D_CMD, "%s: mfi_scsi_cmd no ccb\n", DEVNAME(sc));
- return (NO_CCB);
+ xs->error = XS_NO_CCB;
+ s = splbio();
+ scsi_done(xs);
+ splx(s);
+ return;
}
xs->error = XS_NOERROR;
@@ -1088,7 +1092,7 @@ mfi_scsi_cmd(struct scsi_xfer *xs)
s = splbio();
scsi_done(xs);
splx(s);
- return (COMPLETE);
+ return;
}
mfi_post(sc, ccb);
@@ -1096,7 +1100,7 @@ mfi_scsi_cmd(struct scsi_xfer *xs)
DNPRINTF(MFI_D_DMA, "%s: mfi_scsi_cmd queued %d\n", DEVNAME(sc),
ccb->ccb_dmamap->dm_nsegs);
- return (SUCCESSFULLY_QUEUED);
+ return;
stuffup:
xs->error = XS_DRIVER_STUFFUP;
@@ -1104,7 +1108,6 @@ complete:
s = splbio();
scsi_done(xs);
splx(s);
- return (COMPLETE);
}
int