summaryrefslogtreecommitdiff
path: root/sys/dev/ic/siopvar_common.h
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2003-07-01 17:15:07 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2003-07-01 17:15:07 +0000
commit93d92df72e7e3af474865f8f2eb06de7ce91b354 (patch)
tree9b50a654f37c03f7bad7035ed46717a0b365c2b9 /sys/dev/ic/siopvar_common.h
parented03395998fad2d4a56d64c53191b035072f191c (diff)
Don't dma map the xs->cmd. Copy it to a safe buffer that is already
mapped and sync'ed appropriately, and is guaranteed to be in one memory page. Eliminate now unused dmamap_cmd and rs_cmd fields. Fix another error message (adding active command to reset list) so that it includes the adapter name. Add missing letoh32() calls to debug code. The evils of directly mapping *xs->cmd were pointed out by Mickey during osiop development. In particular, *xs->cmd may start on one memory page and run into the next. Since the dma logic in most cards/drivers (including siop) only allocates one address/size pair to map *xs->cmd, parts of a command could be lost or corrupted. The large number of 6 byte dma mappings noted long ago by someone (Henric?). This change reduces the dma mapping activity per i/o by 1/3 to 1/2 and may give a performance boost of some kind. Successfully tested on i386, sparc64 (ultra30 - thanks Jolan, blade100), macppc and alpha. Unfortunately these changes don't fix the Blade1000 siop problems. **NOTE** If scsi_generic is ever upped to 16 bytes the offsets in siop.ss must be updated!
Diffstat (limited to 'sys/dev/ic/siopvar_common.h')
-rw-r--r--sys/dev/ic/siopvar_common.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h
index a7dd7da789c..ce5741c15b4 100644
--- a/sys/dev/ic/siopvar_common.h
+++ b/sys/dev/ic/siopvar_common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: siopvar_common.h,v 1.13 2003/02/11 19:20:27 mickey Exp $ */
+/* $OpenBSD: siopvar_common.h,v 1.14 2003/07/01 17:15:06 krw Exp $ */
/* $NetBSD: siopvar_common.h,v 1.22 2002/10/23 02:32:36 christos Exp $ */
/*
@@ -48,23 +48,23 @@ typedef struct scr_table {
/*
* This structure interfaces the SCRIPT with the driver; it describes a full
- * transfer.
- * If you change something here, don't forget to update offsets in {s,es}iop.ss
+ * transfer. If you change something here, don't forget to update offsets in
+ * {s,es}iop.ss
*/
struct siop_common_xfer {
- u_int8_t msg_out[16]; /* 0 */
- u_int8_t msg_in[16]; /* 16 */
- u_int32_t status; /* 32 */
- u_int32_t pad1; /* 36 */
- u_int32_t id; /* 40 */
- u_int32_t pad2; /* 44 */
- scr_table_t t_msgin; /* 48 */
- scr_table_t t_extmsgin; /* 56 */
- scr_table_t t_extmsgdata; /* 64 */
- scr_table_t t_msgout; /* 72 */
- scr_table_t cmd; /* 80 */
- scr_table_t t_status; /* 88 */
- scr_table_t data[SIOP_NSG]; /* 96 */
+ u_int8_t msg_out[16]; /* 0 */
+ u_int8_t msg_in[16]; /* 16 */
+ u_int32_t status; /* 32 */
+ u_int32_t pad1; /* 36 */
+ u_int32_t id; /* 40 */
+ struct scsi_generic xscmd; /* 44 */
+ scr_table_t t_msgin; /* 56 */
+ scr_table_t t_extmsgin; /* 64 */
+ scr_table_t t_extmsgdata; /* 72 */
+ scr_table_t t_msgout; /* 80 */
+ scr_table_t cmd; /* 88 */
+ scr_table_t t_status; /* 96 */
+ scr_table_t data[SIOP_NSG]; /* 104 */
} __attribute__((__packed__));
/* status can hold the SCSI_* status values, and 2 additionnal values: */
@@ -79,9 +79,7 @@ struct siop_common_cmd {
struct siop_common_target *siop_target; /* pointer to our target def */
struct scsi_xfer *xs; /* xfer from the upper level */
struct siop_common_xfer *siop_tables; /* tables for this cmd */
- struct scsi_sense rs_cmd; /* request sense command buffer */
bus_addr_t dsa; /* DSA value to load */
- bus_dmamap_t dmamap_cmd;
bus_dmamap_t dmamap_data;
int status;
int flags;