summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-11-20 22:32:49 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-11-20 22:32:49 +0000
commit06efaa9e82041caaa29c02b9d8e2ee5a53537e5c (patch)
tree4b7b09a35b3b0d80ed519e5d058e107b24e8ba7e /sys/dev
parent6617c88d5a71f28493c9343dac127de5f000bc74 (diff)
Un-revert backout to 20051009 and add patches from Martin Bouyer to
close NetBSD PR#31990. Fixes interaction with some problematic drives found by miod@, martin@, otto@. Tested martin@ otto@ miod@ ok miod@ mickey@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/siop.c123
-rw-r--r--sys/dev/ic/siop_common.c177
-rw-r--r--sys/dev/ic/siopvar.h5
-rw-r--r--sys/dev/ic/siopvar_common.h14
-rw-r--r--sys/dev/microcode/siop/siop.out179
5 files changed, 351 insertions, 147 deletions
diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c
index 9bad2466ee6..c0dc9a6ed84 100644
--- a/sys/dev/ic/siop.c
+++ b/sys/dev/ic/siop.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: siop.c,v 1.41 2005/11/03 11:00:36 martin Exp $ */
-/* $NetBSD: siop.c,v 1.65 2002/11/08 22:04:41 bouyer Exp $ */
+/* $OpenBSD: siop.c,v 1.42 2005/11/20 22:32:48 krw Exp $ */
+/* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */
/*
* Copyright (c) 2000 Manuel Bouyer.
@@ -115,6 +115,7 @@ struct scsi_device siop_dev = {
static int siop_stat_intr = 0;
static int siop_stat_intr_shortxfer = 0;
static int siop_stat_intr_sdp = 0;
+static int siop_stat_intr_saveoffset = 0;
static int siop_stat_intr_done = 0;
static int siop_stat_intr_xferdisc = 0;
static int siop_stat_intr_lunresel = 0;
@@ -343,7 +344,7 @@ siop_intr(v)
struct siop_cmd *siop_cmd;
struct siop_lun *siop_lun;
struct scsi_xfer *xs;
- int istat, sist, sstat1, dstat;
+ int istat, sist, sstat1, dstat = 0;
u_int32_t irqcode;
int need_reset = 0;
int offset, target, lun, tag;
@@ -518,31 +519,31 @@ siop_intr(v)
/*
* previous phase may be aborted for any reason
* ( for example, the target has less data to
- * transfer than requested). Just go to status
- * and the command should terminate.
+ * transfer than requested). Compute resid and
+ * just go to status, the command should
+ * terminate.
*/
INCSTAT(siop_stat_intr_shortxfer);
- if ((dstat & DSTAT_DFE) == 0)
+ if (scratcha0 & A_flag_data)
+ siop_ma(&siop_cmd->cmd_c);
+ else if ((dstat & DSTAT_DFE) == 0)
siop_clearfifo(&sc->sc_c);
- /* no table to flush here */
CALL_SCRIPT(Ent_status);
return 1;
case SSTAT1_PHASE_MSGIN:
- /*
- * target may be ready to disconnect
- * Save data pointers just in case.
- */
+ /*
+ * target may be ready to disconnect
+ * Compute resid which would be used later
+ * if a save data pointer is needed.
+ */
INCSTAT(siop_stat_intr_xferdisc);
if (scratcha0 & A_flag_data)
- siop_sdp(&siop_cmd->cmd_c);
+ siop_ma(&siop_cmd->cmd_c);
else if ((dstat & DSTAT_DFE) == 0)
siop_clearfifo(&sc->sc_c);
bus_space_write_1(sc->sc_c.sc_rt,
sc->sc_c.sc_rh, SIOP_SCRATCHA,
scratcha0 & ~A_flag_data);
- siop_table_sync(siop_cmd,
- BUS_DMASYNC_PREREAD |
- BUS_DMASYNC_PREWRITE);
CALL_SCRIPT(Ent_msgin);
return 1;
}
@@ -816,6 +817,15 @@ scintr:
CALL_SCRIPT(Ent_msgin_ack);
return 1;
}
+ if (msgin == MSG_IGN_WIDE_RESIDUE) {
+ /* use the extmsgdata table to get the second byte */
+ siop_cmd->cmd_tables->t_extmsgdata.count =
+ htole32(1);
+ siop_table_sync(siop_cmd,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+ CALL_SCRIPT(Ent_get_extmsgdata);
+ return 1;
+ }
if (xs)
sc_print_addr(xs->sc_link);
else
@@ -859,6 +869,29 @@ scintr:
printf("\n");
}
#endif
+ if (siop_cmd->cmd_tables->msg_in[0] ==
+ MSG_IGN_WIDE_RESIDUE) {
+ /* we got the second byte of MSG_IGN_WIDE_RESIDUE */
+ if (siop_cmd->cmd_tables->msg_in[3] != 1)
+ printf("MSG_IGN_WIDE_RESIDUE: "
+ "bad len %d\n",
+ siop_cmd->cmd_tables->msg_in[3]);
+ switch (siop_iwr(&siop_cmd->cmd_c)) {
+ case SIOP_NEG_MSGOUT:
+ siop_table_sync(siop_cmd,
+ BUS_DMASYNC_PREREAD |
+ BUS_DMASYNC_PREWRITE);
+ CALL_SCRIPT(Ent_send_msgout);
+ return(1);
+ case SIOP_NEG_ACK:
+ CALL_SCRIPT(Ent_msgin_ack);
+ return(1);
+ default:
+ panic("invalid retval from "
+ "siop_iwr()");
+ }
+ return(1);
+ }
if (siop_cmd->cmd_tables->msg_in[2] == MSG_EXT_WDTR) {
switch (siop_wdtr_neg(&siop_cmd->cmd_c)) {
case SIOP_NEG_MSGOUT:
@@ -936,25 +969,21 @@ scintr:
#ifdef SIOP_DEBUG_DR
printf("disconnect offset %d\n", offset);
#endif
- if (offset > SIOP_NSG) {
- printf("%s: bad offset for disconnect (%d)\n",
- sc->sc_c.sc_dev.dv_xname, offset);
- goto reset;
- }
- /*
- * offset == SIOP_NSG may be a valid condition if
- * we get a sdp when the xfer is done.
- * Don't call bcopy in this case.
- */
- if (offset < SIOP_NSG) {
- bcopy(&siop_cmd->cmd_tables->data[offset],
- &siop_cmd->cmd_tables->data[0],
- (SIOP_NSG - offset) * sizeof(scr_table_t));
- siop_table_sync(siop_cmd,
- BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
- }
- /* check if we can put some command in scheduler */
- siop_start(sc);
+ siop_sdp(&siop_cmd->cmd_c, offset);
+ /* we start again with no offset */
+ siop_cmd->saved_offset = SIOP_NOOFFSET;
+ siop_table_sync(siop_cmd,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+ CALL_SCRIPT(Ent_script_sched);
+ return 1;
+ case A_int_saveoffset:
+ INCSTAT(siop_stat_intr_saveoffset);
+ offset = bus_space_read_1(sc->sc_c.sc_rt,
+ sc->sc_c.sc_rh, SIOP_SCRATCHA + 1);
+#ifdef SIOP_DEBUG_DR
+ printf("saveoffset offset %d\n", offset);
+#endif
+ siop_cmd->saved_offset = offset;
CALL_SCRIPT(Ent_script_sched);
return 1;
case A_int_resfail:
@@ -981,6 +1010,19 @@ scintr:
letoh32(siop_cmd->cmd_tables->status));
#endif
INCSTAT(siop_stat_intr_done);
+ /* update resid. */
+ offset = bus_space_read_1(sc->sc_c.sc_rt,
+ sc->sc_c.sc_rh, SIOP_SCRATCHA + 1);
+ /*
+ * if we got a disconnect between the last data phase
+ * and the status phase, offset will be 0. In this
+ * case, siop_cmd->saved_offset will have the proper
+ * value if it got updated by the controller
+ */
+ if (offset == 0 &&
+ siop_cmd->saved_offset != SIOP_NOOFFSET)
+ offset = siop_cmd->saved_offset;
+ siop_update_resid(&siop_cmd->cmd_c, offset);
if (siop_cmd->cmd_c.status == CMDST_SENSE_ACTIVE)
siop_cmd->cmd_c.status = CMDST_SENSE_DONE;
else
@@ -1145,7 +1187,10 @@ out:
xs->flags |= ITSDONE;
siop_cmd->cmd_c.status = CMDST_FREE;
TAILQ_INSERT_TAIL(&sc->free_list, siop_cmd, next);
- xs->resid = 0;
+#if 0
+ if (xs->resid != 0)
+ printf("resid %d datalen %d\n", xs->resid, xs->datalen);
+#endif
scsi_done(xs);
}
@@ -1410,6 +1455,7 @@ siop_scsicmd(xs)
}
siop_setuptables(&siop_cmd->cmd_c);
+ siop_cmd->saved_offset = SIOP_NOOFFSET;
siop_table_sync(siop_cmd,
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
@@ -1850,10 +1896,12 @@ siop_morecbd(sc)
TAILQ_INSERT_TAIL(&sc->free_list, &newcbd->cmds[i], next);
splx(s);
#ifdef SIOP_DEBUG
- printf("tables[%d]: in=0x%x out=0x%x status=0x%x\n", i,
+ printf("tables[%d]: in=0x%x out=0x%x status=0x%x "
+ "offset=0x%x\n", i,
letoh32(newcbd->cmds[i].cmd_tables->t_msgin.addr),
letoh32(newcbd->cmds[i].cmd_tables->t_msgout.addr),
- letoh32(newcbd->cmds[i].cmd_tables->t_status.addr));
+ letoh32(newcbd->cmds[i].cmd_tables->t_status.addr),
+ letoh32(newcbd->cmds[i].cmd_tables->t_offset.addr));
#endif
}
s = splbio();
@@ -2135,6 +2183,7 @@ siop_printstats()
printf("siop_stat_intr_shortxfer %d\n", siop_stat_intr_shortxfer);
printf("siop_stat_intr_xferdisc %d\n", siop_stat_intr_xferdisc);
printf("siop_stat_intr_sdp %d\n", siop_stat_intr_sdp);
+ printf("siop_stat_intr_saveoffset %d\n", siop_stat_intr_saveoffset);
printf("siop_stat_intr_done %d\n", siop_stat_intr_done);
printf("siop_stat_intr_lunresel %d\n", siop_stat_intr_lunresel);
printf("siop_stat_intr_qfull %d\n", siop_stat_intr_qfull);
diff --git a/sys/dev/ic/siop_common.c b/sys/dev/ic/siop_common.c
index 73a6dccb34f..167b1a7196f 100644
--- a/sys/dev/ic/siop_common.c
+++ b/sys/dev/ic/siop_common.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: siop_common.c,v 1.26 2005/11/03 11:00:36 martin Exp $ */
-/* $NetBSD: siop_common.c,v 1.31 2002/09/27 15:37:18 provos Exp $ */
+/* $OpenBSD: siop_common.c,v 1.27 2005/11/20 22:32:48 krw Exp $ */
+/* $NetBSD: siop_common.c,v 1.37 2005/02/27 00:27:02 perry Exp $ */
/*
* Copyright (c) 2000, 2002 Manuel Bouyer.
@@ -21,7 +21,7 @@
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@@ -68,7 +68,7 @@ siop_common_attach(sc)
* Allocate DMA-safe memory for the script and map it.
*/
if ((sc->features & SF_CHIP_RAM) == 0) {
- error = bus_dmamem_alloc(sc->sc_dmat, PAGE_SIZE,
+ error = bus_dmamem_alloc(sc->sc_dmat, PAGE_SIZE,
PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT);
if (error) {
printf("%s: unable to allocate script DMA memory, "
@@ -441,7 +441,7 @@ siop_ppr_neg(siop_cmd)
siop_target->period = 0;
goto reject;
}
-
+
if (offset > sc->maxoff || sync < sc->dt_minsync ||
sync > sc->dt_maxsync) {
printf("%s: ppr negotiation for target %d: "
@@ -714,17 +714,21 @@ siop_minphys(bp)
}
void
-siop_sdp(siop_cmd)
+siop_ma(siop_cmd)
struct siop_common_cmd *siop_cmd;
{
- /* save data pointer. Handle async only for now */
int offset, dbc, sstat;
struct siop_common_softc *sc = siop_cmd->siop_sc;
- scr_table_t *table; /* table to patch */
+ scr_table_t *table; /* table with partial xfer */
+ /*
+ * compute how much of the current table didn't get handled when
+ * a phase mismatch occurs
+ */
if ((siop_cmd->xs->flags & (SCSI_DATA_OUT | SCSI_DATA_IN))
== 0)
- return; /* no data pointers to save */
+ return; /* no valid data transfer */
+
offset = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_SCRATCHA + 1);
if (offset >= SIOP_NSG) {
printf("%s: bad offset in siop_sdp (%d)\n",
@@ -733,8 +737,8 @@ siop_sdp(siop_cmd)
}
table = &siop_cmd->siop_tables->data[offset];
#ifdef DEBUG_DR
- printf("sdp: offset %d count=%d addr=0x%x ", offset,
- letoh32(table->count), letoh32(table->addr));
+ printf("siop_ma: offset %d count=%d addr=0x%x ", offset,
+ table->count, table->addr);
#endif
dbc = bus_space_read_4(sc->sc_rt, sc->sc_rh, SIOP_DBC) & 0x00ffffff;
if (siop_cmd->xs->flags & SCSI_DATA_OUT) {
@@ -772,13 +776,152 @@ siop_sdp(siop_cmd)
bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST3) |
CTEST3_CLF);
}
- table->addr =
- htole32(letoh32(table->addr) + letoh32(table->count) - dbc);
- table->count = htole32(dbc);
-#ifdef DEBUG_DR
- printf("now count=%d addr=0x%x\n",
- letoh32(table->count), letoh32(table->addr));
+ siop_cmd->flags |= CMDFL_RESID;
+ siop_cmd->resid = dbc;
+}
+
+void
+siop_sdp(siop_cmd, offset)
+ struct siop_common_cmd *siop_cmd;
+ int offset;
+{
+ scr_table_t *table;
+
+ if ((siop_cmd->xs->flags & (SCSI_DATA_OUT | SCSI_DATA_IN))
+ == 0)
+ return; /* no data pointers to save */
+
+ /*
+ * offset == SIOP_NSG may be a valid condition if we get a Save data
+ * pointer when the xfer is done. Just ignore the Save data pointer
+ * in this case
+ */
+ if (offset == SIOP_NSG)
+ return;
+#ifdef DIAGNOSTIC
+ if (offset > SIOP_NSG) {
+ sc_print_addr(siop_cmd->xs->sc_link);
+ printf(": offset %d > %d\n", offset, SIOP_NSG);
+ panic("siop_sdp: offset");
+ }
#endif
+ /*
+ * Save data pointer. We do this by adjusting the tables to point
+ * at the begginning of the data not yet transfered.
+ * offset points to the first table with untransfered data.
+ */
+
+ /*
+ * before doing that we decrease resid from the amount of data which
+ * has been transfered.
+ */
+ siop_update_resid(siop_cmd, offset);
+
+ /*
+ * First let see if we have a resid from a phase mismatch. If so,
+ * we have to adjst the table at offset to remove transfered data.
+ */
+ if (siop_cmd->flags & CMDFL_RESID) {
+ siop_cmd->flags &= ~CMDFL_RESID;
+ table = &siop_cmd->siop_tables->data[offset];
+ /* "cut" already transfered data from this table */
+ table->addr =
+ htole32(letoh32(table->addr) +
+ letoh32(table->count) - siop_cmd->resid);
+ table->count = htole32(siop_cmd->resid);
+ }
+
+ /*
+ * now we can remove entries which have been transfered.
+ * We just move the entries with data left at the beggining of the
+ * tables
+ */
+ bcopy(&siop_cmd->siop_tables->data[offset],
+ &siop_cmd->siop_tables->data[0],
+ (SIOP_NSG - offset) * sizeof(scr_table_t));
+}
+
+void
+siop_update_resid(siop_cmd, offset)
+ struct siop_common_cmd *siop_cmd;
+ int offset;
+{
+ scr_table_t *table;
+ int i;
+
+ if ((siop_cmd->xs->flags & (SCSI_DATA_OUT | SCSI_DATA_IN))
+ == 0)
+ return; /* no data to transfer */
+
+ /*
+ * update resid. First account for the table entries which have
+ * been fully completed.
+ */
+ for (i = 0; i < offset; i++)
+ siop_cmd->xs->resid -=
+ letoh32(siop_cmd->siop_tables->data[i].count);
+ /*
+ * if CMDFL_RESID is set, the last table (pointed by offset) is a
+ * partial transfers. If not, offset points to the entry folloing
+ * the last full transfer.
+ */
+ if (siop_cmd->flags & CMDFL_RESID) {
+ table = &siop_cmd->siop_tables->data[offset];
+ siop_cmd->xs->resid -= letoh32(table->count) - siop_cmd->resid;
+ }
+}
+
+int
+siop_iwr(siop_cmd)
+ struct siop_common_cmd *siop_cmd;
+{
+ int offset;
+ scr_table_t *table; /* table with IWR */
+ struct siop_common_softc *sc = siop_cmd->siop_sc;
+ /* handle ignore wide residue messages */
+
+ /* if target isn't wide, reject */
+ if ((siop_cmd->siop_target->flags & TARF_ISWIDE) == 0) {
+ siop_cmd->siop_tables->t_msgout.count= htole32(1);
+ siop_cmd->siop_tables->msg_out[0] = MSG_MESSAGE_REJECT;
+ return SIOP_NEG_MSGOUT;
+ }
+ /* get index of current command in table */
+ offset = bus_space_read_1(sc->sc_rt, sc->sc_rh, SIOP_SCRATCHA + 1);
+ /*
+ * if the current table did complete, we're now pointing at the
+ * next one. Go back one if we didn't see a phase mismatch.
+ */
+ if ((siop_cmd->flags & CMDFL_RESID) == 0)
+ offset--;
+ table = &siop_cmd->siop_tables->data[offset];
+
+ if ((siop_cmd->flags & CMDFL_RESID) == 0) {
+ if (letoh32(table->count) & 1) {
+ /* we really got the number of bytes we expected */
+ return SIOP_NEG_ACK;
+ } else {
+ /*
+ * now we really had a short xfer, by one byte.
+ * handle it just as if we had a phase mistmatch
+ * (there is a resid of one for this table).
+ * Update scratcha1 to reflect the fact that
+ * this xfer isn't complete.
+ */
+ siop_cmd->flags |= CMDFL_RESID;
+ siop_cmd->resid = 1;
+ bus_space_write_1(sc->sc_rt, sc->sc_rh,
+ SIOP_SCRATCHA + 1, offset);
+ return SIOP_NEG_ACK;
+ }
+ } else {
+ /*
+ * we already have a short xfer for this table; it's
+ * just one byte less than we though it was
+ */
+ siop_cmd->resid--;
+ return SIOP_NEG_ACK;
+ }
}
void
diff --git a/sys/dev/ic/siopvar.h b/sys/dev/ic/siopvar.h
index adafcdd49c3..4fa86f57087 100644
--- a/sys/dev/ic/siopvar.h
+++ b/sys/dev/ic/siopvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: siopvar.h,v 1.12 2005/10/08 16:52:38 krw Exp $ */
-/* $NetBSD: siopvar.h,v 1.21 2005/02/27 00:27:02 perry Exp $ */
+/* $OpenBSD: siopvar.h,v 1.13 2005/11/20 22:32:48 krw Exp $ */
+/* $NetBSD: siopvar.h,v 1.22 2005/11/18 23:10:32 bouyer Exp $ */
/*
* Copyright (c) 2000 Manuel Bouyer.
@@ -58,6 +58,7 @@ struct siop_cmd {
struct siop_common_cmd cmd_c;
struct siop_cbd *siop_cbdp; /* pointer to our siop_cbd */
int reselslot;
+ u_int32_t saved_offset; /* offset in table after disc without sdp */
};
#define cmd_tables cmd_c.siop_tables
diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h
index efe32a8e41b..d89ce6534c2 100644
--- a/sys/dev/ic/siopvar_common.h
+++ b/sys/dev/ic/siopvar_common.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: siopvar_common.h,v 1.22 2005/11/03 11:00:37 martin Exp $ */
-/* $NetBSD: siopvar_common.h,v 1.32 2005/02/27 00:27:02 perry Exp $ */
+/* $OpenBSD: siopvar_common.h,v 1.23 2005/11/20 22:32:48 krw Exp $ */
+/* $NetBSD: siopvar_common.h,v 1.33 2005/11/18 23:10:32 bouyer Exp $ */
/*
* Copyright (c) 2000 Manuel Bouyer.
@@ -73,6 +73,9 @@ struct siop_common_xfer {
#define SCSI_SIOP_NOCHECK 0xfe /* don't check the scsi status */
#define SCSI_SIOP_NOSTATUS 0xff /* device didn't report status */
+/* offset is initialised to SIOP_NOOFFSET, used to check if it was updated */
+#define SIOP_NOOFFSET 0xffffffff
+
/*
* This describes a command handled by the SCSI controller
*/
@@ -86,6 +89,7 @@ struct siop_common_cmd {
int status;
int flags;
int tag; /* tag used for tagged command queuing */
+ int resid; /* valid when CMDFL_RESID is set */
};
/* status defs */
@@ -99,6 +103,7 @@ struct siop_common_cmd {
/* flags defs */
#define CMDFL_TIMEOUT 0x0001 /* cmd timed out */
#define CMDFL_TAG 0x0002 /* tagged cmd */
+#define CMDFL_RESID 0x0004 /* current offset in table is partial */
/* per-target struct */
struct siop_common_target {
@@ -192,12 +197,15 @@ void siop_sdtr_msg(struct siop_common_cmd *, int, int, int);
void siop_wdtr_msg(struct siop_common_cmd *, int, int);
void siop_ppr_msg(struct siop_common_cmd *, int, int, int);
void siop_update_xfer_mode(struct siop_common_softc *, int);
+int siop_iwr(struct siop_common_cmd *);
/* actions to take at return of siop_wdtr_neg() and siop_sdtr_neg() */
#define SIOP_NEG_NOP 0x0
#define SIOP_NEG_MSGOUT 0x1
#define SIOP_NEG_ACK 0x2
void siop_minphys(struct buf *);
-void siop_sdp(struct siop_common_cmd *);
+void siop_ma(struct siop_common_cmd *);
+void siop_sdp(struct siop_common_cmd *, int);
+void siop_update_resid(struct siop_common_cmd *, int);
void siop_clearfifo(struct siop_common_softc *);
void siop_resetbus(struct siop_common_softc *);
diff --git a/sys/dev/microcode/siop/siop.out b/sys/dev/microcode/siop/siop.out
index bae025cb8da..998a0d141fa 100644
--- a/sys/dev/microcode/siop/siop.out
+++ b/sys/dev/microcode/siop/siop.out
@@ -1,19 +1,19 @@
-/* $OpenBSD: siop.out,v 1.7 2005/10/10 16:27:24 krw Exp $ */
+/* $OpenBSD: siop.out,v 1.8 2005/11/20 22:32:48 krw Exp $ */
/*
* DO NOT EDIT - this file is automatically generated.
- * created from siop.ss on Mon Oct 10 12:15:59 2005
+ * created from siop.ss on Sun Nov 20 17:26:10 2005
*/
const u_int32_t siop_script[] = {
0x78340000, 0x00000000, /* 000 - 0 */
0x78350000, 0x00000000, /* 008 - 8 */
0x72370000, 0x00000000, /* 010 - 16 */
0x80840020, 0x00000318, /* 018 - 24 */
- 0x868b0000, 0x00000370, /* 020 - 32 */
+ 0x868b0000, 0x00000380, /* 020 - 32 */
0x878b0000, 0x000002f8, /* 028 - 40 */
- 0x808b0000, 0x000003f8, /* 030 - 48 */
- 0x818b0000, 0x00000390, /* 038 - 56 */
- 0x828b0000, 0x00000368, /* 040 - 64 */
- 0x838b0000, 0x00000370, /* 048 - 72 */
+ 0x808b0000, 0x00000408, /* 030 - 48 */
+ 0x818b0000, 0x000003a0, /* 038 - 56 */
+ 0x828b0000, 0x00000378, /* 040 - 64 */
+ 0x838b0000, 0x00000380, /* 048 - 72 */
0x98080000, 0x0000ffff, /* 050 - 80 */
0x741a4000, 0x00000000, /* 058 - 88 */
0x980c0000, 0x0000ff83, /* 060 - 96 */
@@ -107,81 +107,83 @@ const u_int32_t siop_script[] = {
0x7a340100, 0x00000000, /* 320 - 800 */
0x60000008, 0x00000000, /* 328 - 808 */
0x1f000038, 0x00000038, /* 330 - 816 */
- 0x808c0000, 0x00000208, /* 338 - 824 */
+ 0x808c0000, 0x00000218, /* 338 - 824 */
0x808c0002, 0xffffffd0, /* 340 - 832 */
- 0x808c0001, 0x00000208, /* 348 - 840 */
+ 0x808c0001, 0x00000218, /* 348 - 840 */
0x98040004, 0x0000ff01, /* 350 - 848 */
- 0x88880000, 0x000001c0, /* 358 - 856 */
+ 0x88880000, 0x000001d0, /* 358 - 856 */
0x74340100, 0x00000000, /* 360 - 864 */
- 0x808c0000, 0xfffffd00, /* 368 - 872 */
- 0x98080000, 0x0000ff04, /* 370 - 880 */
- 0x60000040, 0x00000000, /* 378 - 888 */
- 0x80880000, 0xfffffc98, /* 380 - 896 */
- 0x58000008, 0x00000000, /* 388 - 904 */
- 0x60000040, 0x00000000, /* 390 - 912 */
- 0x1e000050, 0x00000050, /* 398 - 920 */
- 0x60000008, 0x00000000, /* 3a0 - 928 */
- 0x80880000, 0xfffffc70, /* 3a8 - 936 */
- 0x1a000058, 0x00000058, /* 3b0 - 944 */
+ 0x98040000, 0x0000ff04, /* 368 - 872 */
+ 0x72350000, 0x00000000, /* 370 - 880 */
+ 0x808c0000, 0xfffffcf0, /* 378 - 888 */
+ 0x98080000, 0x0000ff05, /* 380 - 896 */
+ 0x60000040, 0x00000000, /* 388 - 904 */
+ 0x80880000, 0xfffffc88, /* 390 - 912 */
+ 0x58000008, 0x00000000, /* 398 - 920 */
+ 0x60000040, 0x00000000, /* 3a0 - 928 */
+ 0x1e000050, 0x00000050, /* 3a8 - 936 */
+ 0x60000008, 0x00000000, /* 3b0 - 944 */
0x80880000, 0xfffffc60, /* 3b8 - 952 */
- 0x1b000060, 0x00000060, /* 3c0 - 960 */
+ 0x1a000058, 0x00000058, /* 3c0 - 960 */
0x80880000, 0xfffffc50, /* 3c8 - 968 */
- 0x88880000, 0x000000b8, /* 3d0 - 976 */
- 0x7a340200, 0x00000000, /* 3d8 - 984 */
- 0x19000068, 0x00000068, /* 3e0 - 992 */
- 0x7e350100, 0x00000000, /* 3e8 - 1000 */
- 0x7e100800, 0x00000000, /* 3f0 - 1008 */
- 0x7f110000, 0x00000000, /* 3f8 - 1016 */
- 0x7f120000, 0x00000000, /* 400 - 1024 */
- 0x7f130000, 0x00000000, /* 408 - 1032 */
- 0x818b0000, 0xffffffc8, /* 410 - 1040 */
- 0x88880000, 0x000000b8, /* 418 - 1048 */
- 0x7c34fd00, 0x00000000, /* 420 - 1056 */
- 0x80880000, 0xfffffbf0, /* 428 - 1064 */
- 0x88880000, 0x00000058, /* 430 - 1072 */
- 0x7a340200, 0x00000000, /* 438 - 1080 */
- 0x18000068, 0x00000068, /* 440 - 1088 */
- 0x7e350100, 0x00000000, /* 448 - 1096 */
- 0x7e100800, 0x00000000, /* 450 - 1104 */
- 0x7f110000, 0x00000000, /* 458 - 1112 */
- 0x7f120000, 0x00000000, /* 460 - 1120 */
- 0x7f130000, 0x00000000, /* 468 - 1128 */
- 0x808b0000, 0xffffffc8, /* 470 - 1136 */
- 0x88880000, 0x00000058, /* 478 - 1144 */
- 0x7c34fd00, 0x00000000, /* 480 - 1152 */
- 0x80880000, 0xfffffb90, /* 488 - 1160 */
- 0x72100000, 0x00000000, /* 490 - 1168 */
- 0x6a5c0000, 0x00000000, /* 498 - 1176 */
- 0x72110000, 0x00000000, /* 4a0 - 1184 */
- 0x6a5d0000, 0x00000000, /* 4a8 - 1192 */
- 0x72120000, 0x00000000, /* 4b0 - 1200 */
- 0x6a5e0000, 0x00000000, /* 4b8 - 1208 */
- 0x72130000, 0x00000000, /* 4c0 - 1216 */
- 0x6a5f0000, 0x00000000, /* 4c8 - 1224 */
- 0x90080000, 0x00000000, /* 4d0 - 1232 */
- 0x725c0000, 0x00000000, /* 4d8 - 1240 */
- 0x6a100000, 0x00000000, /* 4e0 - 1248 */
- 0x725d0000, 0x00000000, /* 4e8 - 1256 */
- 0x6a110000, 0x00000000, /* 4f0 - 1264 */
- 0x725e0000, 0x00000000, /* 4f8 - 1272 */
- 0x6a120000, 0x00000000, /* 500 - 1280 */
- 0x725f0000, 0x00000000, /* 508 - 1288 */
- 0x6a130000, 0x00000000, /* 510 - 1296 */
- 0x90080000, 0x00000000, /* 518 - 1304 */
- 0x7c027f00, 0x00000000, /* 520 - 1312 */
- 0x60000008, 0x00000000, /* 528 - 1320 */
- 0x60000040, 0x00000000, /* 530 - 1328 */
- 0x48000000, 0x00000000, /* 538 - 1336 */
- 0x90080000, 0x00000000, /* 540 - 1344 */
- 0x88880000, 0xffffffd0, /* 548 - 1352 */
- 0x98080000, 0x0000ff00, /* 550 - 1360 */
- 0x60000040, 0x00000000, /* 558 - 1368 */
- 0x1f000040, 0x00000040, /* 560 - 1376 */
- 0x98080000, 0x0000ff02, /* 568 - 1384 */
- 0x60000040, 0x00000000, /* 570 - 1392 */
- 0x1f000048, 0x00000048, /* 578 - 1400 */
- 0x98080000, 0x0000ff03, /* 580 - 1408 */
- 0x80000000, 0x00000000, /* 588 - 1416 */
+ 0x1b000060, 0x00000060, /* 3d0 - 976 */
+ 0x80880000, 0xfffffc40, /* 3d8 - 984 */
+ 0x88880000, 0x000000b8, /* 3e0 - 992 */
+ 0x7a340200, 0x00000000, /* 3e8 - 1000 */
+ 0x19000068, 0x00000068, /* 3f0 - 1008 */
+ 0x7e350100, 0x00000000, /* 3f8 - 1016 */
+ 0x7e100800, 0x00000000, /* 400 - 1024 */
+ 0x7f110000, 0x00000000, /* 408 - 1032 */
+ 0x7f120000, 0x00000000, /* 410 - 1040 */
+ 0x7f130000, 0x00000000, /* 418 - 1048 */
+ 0x818b0000, 0xffffffc8, /* 420 - 1056 */
+ 0x88880000, 0x000000b8, /* 428 - 1064 */
+ 0x7c34fd00, 0x00000000, /* 430 - 1072 */
+ 0x80880000, 0xfffffbe0, /* 438 - 1080 */
+ 0x88880000, 0x00000058, /* 440 - 1088 */
+ 0x7a340200, 0x00000000, /* 448 - 1096 */
+ 0x18000068, 0x00000068, /* 450 - 1104 */
+ 0x7e350100, 0x00000000, /* 458 - 1112 */
+ 0x7e100800, 0x00000000, /* 460 - 1120 */
+ 0x7f110000, 0x00000000, /* 468 - 1128 */
+ 0x7f120000, 0x00000000, /* 470 - 1136 */
+ 0x7f130000, 0x00000000, /* 478 - 1144 */
+ 0x808b0000, 0xffffffc8, /* 480 - 1152 */
+ 0x88880000, 0x00000058, /* 488 - 1160 */
+ 0x7c34fd00, 0x00000000, /* 490 - 1168 */
+ 0x80880000, 0xfffffb80, /* 498 - 1176 */
+ 0x72100000, 0x00000000, /* 4a0 - 1184 */
+ 0x6a5c0000, 0x00000000, /* 4a8 - 1192 */
+ 0x72110000, 0x00000000, /* 4b0 - 1200 */
+ 0x6a5d0000, 0x00000000, /* 4b8 - 1208 */
+ 0x72120000, 0x00000000, /* 4c0 - 1216 */
+ 0x6a5e0000, 0x00000000, /* 4c8 - 1224 */
+ 0x72130000, 0x00000000, /* 4d0 - 1232 */
+ 0x6a5f0000, 0x00000000, /* 4d8 - 1240 */
+ 0x90080000, 0x00000000, /* 4e0 - 1248 */
+ 0x725c0000, 0x00000000, /* 4e8 - 1256 */
+ 0x6a100000, 0x00000000, /* 4f0 - 1264 */
+ 0x725d0000, 0x00000000, /* 4f8 - 1272 */
+ 0x6a110000, 0x00000000, /* 500 - 1280 */
+ 0x725e0000, 0x00000000, /* 508 - 1288 */
+ 0x6a120000, 0x00000000, /* 510 - 1296 */
+ 0x725f0000, 0x00000000, /* 518 - 1304 */
+ 0x6a130000, 0x00000000, /* 520 - 1312 */
+ 0x90080000, 0x00000000, /* 528 - 1320 */
+ 0x7c027f00, 0x00000000, /* 530 - 1328 */
+ 0x60000008, 0x00000000, /* 538 - 1336 */
+ 0x60000040, 0x00000000, /* 540 - 1344 */
+ 0x48000000, 0x00000000, /* 548 - 1352 */
+ 0x90080000, 0x00000000, /* 550 - 1360 */
+ 0x88880000, 0xffffffd0, /* 558 - 1368 */
+ 0x98080000, 0x0000ff00, /* 560 - 1376 */
+ 0x60000040, 0x00000000, /* 568 - 1384 */
+ 0x1f000040, 0x00000040, /* 570 - 1392 */
+ 0x98080000, 0x0000ff02, /* 578 - 1400 */
+ 0x60000040, 0x00000000, /* 580 - 1408 */
+ 0x1f000048, 0x00000048, /* 588 - 1416 */
+ 0x98080000, 0x0000ff03, /* 590 - 1424 */
+ 0x80000000, 0x00000000, /* 598 - 1432 */
};
const u_int32_t lun_switch[] = {
@@ -250,6 +252,7 @@ const u_int32_t siop_led_off[] = {
#define A_int_extmsgin 0x0000ff02
#define A_int_extmsgdata 0x0000ff03
#define A_int_disc 0x0000ff04
+#define A_int_saveoffset 0x0000ff05
#define A_int_reseltarg 0x0000ff80
#define A_int_resellun 0x0000ff81
#define A_int_reseltag 0x0000ff82
@@ -259,24 +262,24 @@ const u_int32_t siop_led_off[] = {
#define A_flag_data 0x00000002
#define A_flag_data_mask 0x000000fd
#define Ent_waitphase 0x00000020
-#define Ent_send_msgout 0x00000388
-#define Ent_msgout 0x00000398
+#define Ent_send_msgout 0x00000398
+#define Ent_msgout 0x000003a8
#define Ent_msgin 0x00000328
#define Ent_handle_msgin 0x00000338
-#define Ent_msgin_ack 0x00000378
-#define Ent_dataout 0x00000430
-#define Ent_datain 0x000003d0
-#define Ent_cmdout 0x000003b0
-#define Ent_status 0x000003c0
-#define Ent_disconnect 0x00000520
+#define Ent_msgin_ack 0x00000388
+#define Ent_dataout 0x00000440
+#define Ent_datain 0x000003e0
+#define Ent_cmdout 0x000003c0
+#define Ent_status 0x000003d0
+#define Ent_disconnect 0x00000530
#define Ent_reselect 0x000001e0
#define Ent_reselected 0x00000000
-#define Ent_selected 0x00000378
+#define Ent_selected 0x00000388
#define Ent_script_sched 0x00000070
#define Ent_script_sched_slot0 0x000000a0
-#define Ent_get_extmsgdata 0x00000570
+#define Ent_get_extmsgdata 0x00000580
#define Ent_resel_targ0 0x00000238
-#define Ent_msgin_space 0x00000588
+#define Ent_msgin_space 0x00000598
#define Ent_lunsw_return 0x000002b8
#define Ent_led_on1 0x00000068
#define Ent_led_on2 0x00000220