summaryrefslogtreecommitdiff
path: root/sys/dev/ata/atascsi.h
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-02-28 13:25:43 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-02-28 13:25:43 +0000
commit487091106c2df889915a8d9d4cdaac39ae0310b5 (patch)
tree77fe91a9bacb0fe31c628782ed442bf8216c8e98 /sys/dev/ata/atascsi.h
parent631d5075c62ffe32482381854d9d1c1195d852e8 (diff)
stash a pointer to the atascsi instance in ata_port structs. the completion
routine will take a pointer to ata_xfer, not a void *. add some states and flags for the xfers, and some values for the hba to return when processing them.
Diffstat (limited to 'sys/dev/ata/atascsi.h')
-rw-r--r--sys/dev/ata/atascsi.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/ata/atascsi.h b/sys/dev/ata/atascsi.h
index 1731cba5ae6..2b55fe4d68b 100644
--- a/sys/dev/ata/atascsi.h
+++ b/sys/dev/ata/atascsi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.h,v 1.5 2007/02/19 13:18:08 jsg Exp $ */
+/* $OpenBSD: atascsi.h,v 1.6 2007/02/28 13:25:42 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -34,6 +34,7 @@ struct atascsi_attach_args {
};
struct ata_port {
+ struct atascsi *ap_as;
int ap_port;
int ap_type;
#define ATA_PORT_T_NONE 0
@@ -58,18 +59,27 @@ struct ata_xfer {
u_int8_t *data;
size_t datalen;
- void (*complete)(void *);
+ void (*complete)(struct ata_xfer *);
struct ata_port *port;
int flags;
-#define ATA_F_READ (1<<0)
-#define ATA_F_WRITE (1<<1)
-#define ATA_F_NOWAIT (1<<2)
-#define ATA_F_POLL (1<<2)
+#define ATA_F_READ (1<<0)
+#define ATA_F_WRITE (1<<1)
+#define ATA_F_NOWAIT (1<<2)
+#define ATA_F_POLL (1<<3)
+ volatile int state;
+#define ATA_S_SETUP 0
+#define ATA_S_PENDING 1
+#define ATA_S_COMPLETE 2
+#define ATA_S_ERROR 3
void *atascsi_private;
};
+#define ATA_QUEUED 0
+#define ATA_COMPLETE 1
+#define ATA_ERROR 2
+
struct atascsi *atascsi_attach(struct device *, struct atascsi_attach_args *);
int atascsi_detach(struct atascsi *);