diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index 8d5d5abf33d8..f7c804920314 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $NetBSD: siop.c,v 1.54 2002/04/22 09:43:44 bouyer Exp $ */ +/* $NetBSD: siop.c,v 1.55 2002/04/22 15:48:55 bouyer Exp $ */ /* * Copyright (c) 2000 Manuel Bouyer. @@ -33,7 +33,7 @@ /* SYM53c7/8xx PCI-SCSI I/O Processors driver */ #include -__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.54 2002/04/22 09:43:44 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.55 2002/04/22 15:48:55 bouyer Exp $"); #include #include @@ -1371,12 +1371,13 @@ siop_scsipi_request(chan, req, arg) siop_cmd->cmd_c.dmamap_cmd->dm_mapsize, BUS_DMASYNC_PREWRITE); + if (xs->xs_tag_type) { + /* use tag_id + 1, tag 0 is reserved for untagged cmds*/ + siop_cmd->cmd_c.tag = xs->xs_tag_id + 1; + } else { + siop_cmd->cmd_c.tag = 0; + } siop_setuptables(&siop_cmd->cmd_c); - /* we want tag to start at 1 for tagged commands (0 reserved - * for untagged - */ - if (siop_cmd->cmd_c.flags & CMDFL_TAG) - siop_cmd->cmd_c.tag++; siop_table_sync(siop_cmd, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); siop_start(sc, siop_cmd); diff --git a/sys/dev/ic/siop_common.c b/sys/dev/ic/siop_common.c index 34732eb15865..fa023c921a28 100644 --- a/sys/dev/ic/siop_common.c +++ b/sys/dev/ic/siop_common.c @@ -1,4 +1,4 @@ -/* $NetBSD: siop_common.c,v 1.18 2002/04/22 09:43:44 bouyer Exp $ */ +/* $NetBSD: siop_common.c,v 1.19 2002/04/22 15:48:56 bouyer Exp $ */ /* * Copyright (c) 2000 Manuel Bouyer. @@ -33,7 +33,7 @@ /* SYM53c7/8xx PCI-SCSI I/O Processors driver */ #include -__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.18 2002/04/22 09:43:44 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siop_common.c,v 1.19 2002/04/22 15:48:56 bouyer Exp $"); #include #include @@ -158,10 +158,13 @@ siop_setuptables(siop_cmd) } siop_cmd->flags |= CMDFL_TAG; siop_cmd->siop_tables->msg_out[1] = siop_cmd->xs->xs_tag_type; - siop_cmd->siop_tables->msg_out[2] = siop_cmd->xs->xs_tag_id + 1; + /* + * use siop_cmd->tag not xs->xs_tag_id, caller may want a + * different one + */ + siop_cmd->siop_tables->msg_out[2] = siop_cmd->tag; siop_cmd->siop_tables->t_msgout.count = htole32(3); msgoffset = 3; - siop_cmd->tag = siop_cmd->xs->xs_tag_id; } else siop_cmd->tag = 0; if (sc->targets[target]->status == TARST_ASYNC) {