summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2009-12-07 09:37:35 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2009-12-07 09:37:35 +0000
commitaf936f6e7df568eff7ab6f3b565c3b1e8549a9cc (patch)
tree99437a7908e0e42e06551777879c98829fa2a09e /sys/dev/pci
parent5814dd9af65d229298f6bd22bc2aa3dc2977d3bf (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/pci')
-rw-r--r--sys/dev/pci/ahci.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c
index 8f43b9bf63e..4d56e1a72d0 100644
--- a/sys/dev/pci/ahci.c
+++ b/sys/dev/pci/ahci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci.c,v 1.153 2009/11/01 01:50:15 dlg Exp $ */
+/* $OpenBSD: ahci.c,v 1.154 2009/12/07 09:37:34 dlg Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -541,7 +541,7 @@ int ahci_ata_probe(void *, int);
void ahci_ata_free(void *, int);
struct ata_xfer * ahci_ata_get_xfer(void *, int);
void ahci_ata_put_xfer(struct ata_xfer *);
-int ahci_ata_cmd(struct ata_xfer *);
+void ahci_ata_cmd(struct ata_xfer *);
struct atascsi_methods ahci_atascsi_methods = {
ahci_ata_probe,
@@ -2326,7 +2326,7 @@ ahci_ata_put_xfer(struct ata_xfer *xa)
ahci_put_ccb(ccb);
}
-int
+void
ahci_ata_cmd(struct ata_xfer *xa)
{
struct ahci_ccb *ccb = (struct ahci_ccb *)xa;
@@ -2356,24 +2356,23 @@ ahci_ata_cmd(struct ata_xfer *xa)
xa->state = ATA_S_PENDING;
- if (xa->flags & ATA_F_POLL) {
+ if (xa->flags & ATA_F_POLL)
ahci_poll(ccb, xa->timeout, ahci_ata_cmd_timeout);
- return (ATA_COMPLETE);
- }
+ else {
+ timeout_add_msec(&xa->stimeout, xa->timeout);
- timeout_add_msec(&xa->stimeout, xa->timeout);
+ s = splbio();
+ ahci_start(ccb);
+ splx(s);
+ }
- s = splbio();
- ahci_start(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
@@ -2398,7 +2397,7 @@ ahci_ata_cmd_done(struct ahci_ccb *ccb)
ccb->ccb_slot);
#endif
if (xa->state != ATA_S_TIMEOUT)
- xa->complete(xa);
+ ata_complete(xa);
}
void
@@ -2483,7 +2482,7 @@ ahci_ata_cmd_timeout(void *arg)
/* Complete the timed out ata_xfer I/O (may generate new I/O). */
DPRINTF(AHCI_D_TIMEOUT, "%s: run completion (2)\n", PORTNAME(ap));
- xa->complete(xa);
+ ata_complete(xa);
DPRINTF(AHCI_D_TIMEOUT, "%s: splx\n", PORTNAME(ap));
ret: