Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Fix last change: assign siop_cmd->tag in callers ...



details:   https://anonhg.NetBSD.org/src/rev/cc112542c5a9
branches:  trunk
changeset: 525961:cc112542c5a9
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Apr 22 15:48:55 2002 +0000

description:
Fix last change: assign siop_cmd->tag in callers instead of siop_setuptables(),
and use siop_cmd->tag instead of xs->xs_tag_id. This way siop can use
xs->xs_tag_id + 1 without interferences with esiop.

diffstat:

 sys/dev/ic/siop.c        |  15 ++++++++-------
 sys/dev/ic/siop_common.c |  11 +++++++----
 2 files changed, 15 insertions(+), 11 deletions(-)

diffs (71 lines):

diff -r 910358a6fc6f -r cc112542c5a9 sys/dev/ic/siop.c
--- a/sys/dev/ic/siop.c Mon Apr 22 15:45:19 2002 +0000
+++ b/sys/dev/ic/siop.c Mon Apr 22 15:48:55 2002 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -1371,12 +1371,13 @@
                    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 -r 910358a6fc6f -r cc112542c5a9 sys/dev/ic/siop_common.c
--- a/sys/dev/ic/siop_common.c  Mon Apr 22 15:45:19 2002 +0000
+++ b/sys/dev/ic/siop_common.c  Mon Apr 22 15:48:55 2002 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -158,10 +158,13 @@
                }
                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) {



Home | Main Index | Thread Index | Old Index