From 66df0885c3de39a18d5e01ca463056eaf4df0657 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 19 Feb 2007 12:10:41 +0000 Subject: i think ata_xfers should look more like this. stash the number of the port in the ata_port struct so a hba can find its own info for that port. --- sys/dev/ata/atascsi.h | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'sys/dev/ata') diff --git a/sys/dev/ata/atascsi.h b/sys/dev/ata/atascsi.h index 70b72ffc4a5..ba69ff4916d 100644 --- a/sys/dev/ata/atascsi.h +++ b/sys/dev/ata/atascsi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.h,v 1.3 2007/02/19 11:53:34 dlg Exp $ */ +/* $OpenBSD: atascsi.h,v 1.4 2007/02/19 12:10:40 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -34,23 +34,40 @@ struct atascsi_attach_args { }; struct ata_port { + int ap_port; int ap_type; #define ATA_PORT_T_NONE 0 #define ATA_PORT_T_DISK 1 #define ATA_PORT_T_ATAPI 2 }; +struct ata_cmd { + u_int8_t command; + u_int8_t head; + u_int16_t cyl; + u_int8_t sector; + u_int8_t count; + u_int8_t precomp; + u_int8_t st_bmask; + u_int8_t st_pmask; + u_int8_t error; +}; + struct ata_xfer { - int port; + struct ata_cmd cmd; + u_int8_t *data; + size_t datalen; - int flags; -#define ATA_F_POLL (1<<0) -#define ATA_F_NOSLEEP (1<<1) + void (*complete)(void *); - u_int8_t *cmd; + 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) - u_int8_t *data; - size_t datalen; + void *atascsi_private; }; struct atascsi *atascsi_attach(struct device *, struct atascsi_attach_args *); -- cgit v1.2.3