diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2009-12-07 09:37:35 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2009-12-07 09:37:35 +0000 |
commit | af936f6e7df568eff7ab6f3b565c3b1e8549a9cc (patch) | |
tree | 99437a7908e0e42e06551777879c98829fa2a09e /sys/dev/ic | |
parent | 5814dd9af65d229298f6bd22bc2aa3dc2977d3bf (diff) |
get rid of the return codes from command submission, ata_cmd handlers
now return void. all state about a command is now represented within
the ata_xfer structure, and all layers using it (both hba and
atascsi) now check only ata_xfer.
this relies on my scsi midlayer changes. it was written just before
the second last backout of the midlayer.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/sili.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c index 818dec6fcf3..867396f7778 100644 --- a/sys/dev/ic/sili.c +++ b/sys/dev/ic/sili.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili.c,v 1.43 2009/06/05 03:57:32 ray Exp $ */ +/* $OpenBSD: sili.c,v 1.44 2009/12/07 09:37:33 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -164,7 +164,7 @@ int sili_ata_probe(void *, int); void sili_ata_free(void *, int); struct ata_xfer *sili_ata_get_xfer(void *, int); void sili_ata_put_xfer(struct ata_xfer *); -int sili_ata_cmd(struct ata_xfer *); +void sili_ata_cmd(struct ata_xfer *); struct atascsi_methods sili_atascsi_methods = { sili_ata_probe, @@ -381,7 +381,7 @@ fatal: KASSERT(ccb->ccb_xa.state == ATA_S_COMPLETE || ccb->ccb_xa.state == ATA_S_ERROR || ccb->ccb_xa.state == ATA_S_TIMEOUT); - ccb->ccb_xa.complete(&ccb->ccb_xa); + ata_complete(&ccb->ccb_xa); } } @@ -815,7 +815,7 @@ sili_ata_free(void *xsc, int port) /* XXX we should do more here */ } -int +void sili_ata_cmd(struct ata_xfer *xa) { struct sili_ccb *ccb = (struct sili_ccb *)xa; @@ -858,24 +858,22 @@ sili_ata_cmd(struct ata_xfer *xa) xa->state = ATA_S_PENDING; - if (xa->flags & ATA_F_POLL) { + if (xa->flags & ATA_F_POLL) sili_poll(ccb, xa->timeout, sili_ata_cmd_timeout); - return (ATA_COMPLETE); + else { + timeout_add_msec(&xa->stimeout, xa->timeout); + s = splbio(); + sili_start(sp, ccb); + splx(s); } - timeout_add_msec(&xa->stimeout, xa->timeout); - - s = splbio(); - sili_start(sp, ccb); - splx(s); - return (ATA_QUEUED); + return; failcmd: s = splbio(); xa->state = ATA_S_ERROR; - xa->complete(xa); + ata_complete(xa); splx(s); - return (ATA_ERROR); } void @@ -907,7 +905,7 @@ sili_ata_cmd_done(struct sili_ccb *ccb, int defer_completion) if (defer_completion) TAILQ_INSERT_TAIL(&sp->sp_deferred_ccbs, ccb, ccb_entry); else if (xa->state == ATA_S_COMPLETE) - xa->complete(xa); + ata_complete(xa); #ifdef DIAGNOSTIC else printf("%s: completion not deferred, but xa->state is %02x?\n", |