Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi Add a chan_name to struct scsipi_channel, hol...



details:   https://anonhg.NetBSD.org/src/rev/38b9c4b66590
branches:  trunk
changeset: 524898:38b9c4b66590
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Apr 01 20:37:41 2002 +0000

description:
Add a chan_name to struct scsipi_channel, holding the channel's name.
Set this to dv_xname for scsibus and atapibus.
Set the name of the kernel thread to chan_name instead of controller's
name:channel number (so that we can use this name for controller-specific
threads).

diffstat:

 sys/dev/scsipi/atapiconf.c   |  6 ++++--
 sys/dev/scsipi/scsiconf.c    |  5 +++--
 sys/dev/scsipi/scsipi_base.c |  7 +++----
 sys/dev/scsipi/scsipiconf.h  |  3 ++-
 4 files changed, 12 insertions(+), 9 deletions(-)

diffs (98 lines):

diff -r 91209c1353f6 -r 38b9c4b66590 sys/dev/scsipi/atapiconf.c
--- a/sys/dev/scsipi/atapiconf.c        Mon Apr 01 20:34:36 2002 +0000
+++ b/sys/dev/scsipi/atapiconf.c        Mon Apr 01 20:37:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atapiconf.c,v 1.47 2001/12/22 13:29:50 gehenna Exp $   */
+/*     $NetBSD: atapiconf.c,v 1.48 2002/04/01 20:37:41 bouyer Exp $    */
 
 /*
  * Copyright (c) 1996, 2001 Manuel Bouyer.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.47 2001/12/22 13:29:50 gehenna Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.48 2002/04/01 20:37:41 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -179,6 +179,8 @@
 
        sc->sc_channel = chan;
 
+       chan->chan_name = sc->sc_dev.dv_xname;
+
        /* ATAPI has no LUNs. */
        chan->chan_nluns = 1;
        printf(": %d targets\n", chan->chan_ntargets);
diff -r 91209c1353f6 -r 38b9c4b66590 sys/dev/scsipi/scsiconf.c
--- a/sys/dev/scsipi/scsiconf.c Mon Apr 01 20:34:36 2002 +0000
+++ b/sys/dev/scsipi/scsiconf.c Mon Apr 01 20:37:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsiconf.c,v 1.178 2002/03/16 23:26:34 chs Exp $       */
+/*     $NetBSD: scsiconf.c,v 1.179 2002/04/01 20:37:41 bouyer Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.178 2002/03/16 23:26:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.179 2002/04/01 20:37:41 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -156,6 +156,7 @@
        struct scsipi_channel *chan = aux;
 
        sc->sc_channel = chan;
+       chan->chan_name = sc->sc_dev.dv_xname;
 
        /* Initialize the channel structure first */
        if (scsipi_channel_init(chan)) {
diff -r 91209c1353f6 -r 38b9c4b66590 sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Mon Apr 01 20:34:36 2002 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Mon Apr 01 20:37:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.70 2002/03/28 22:01:22 christos Exp $        */
+/*     $NetBSD: scsipi_base.c,v 1.71 2002/04/01 20:37:42 bouyer Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.70 2002/03/28 22:01:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.71 2002/04/01 20:37:42 bouyer Exp $");
 
 #include "opt_scsi.h"
 
@@ -2139,8 +2139,7 @@
        struct scsipi_adapter *adapt = chan->chan_adapter;
 
        if (kthread_create1(scsipi_completion_thread, chan,
-           &chan->chan_thread, "%s:%d", adapt->adapt_dev->dv_xname,
-           chan->chan_channel)) {
+           &chan->chan_thread, "%s", chan->chan_name)) {
                printf("%s: unable to create completion thread for "
                    "channel %d\n", adapt->adapt_dev->dv_xname,
                    chan->chan_channel);
diff -r 91209c1353f6 -r 38b9c4b66590 sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h       Mon Apr 01 20:34:36 2002 +0000
+++ b/sys/dev/scsipi/scsipiconf.h       Mon Apr 01 20:37:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipiconf.h,v 1.65 2001/12/02 22:44:34 bouyer Exp $   */
+/*     $NetBSD: scsipiconf.h,v 1.66 2002/04/01 20:37:42 bouyer Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -262,6 +262,7 @@
  */
 struct scsipi_channel {
        const struct scsipi_bustype *chan_bustype; /* channel's bus type */
+       const char *chan_name;  /* this channel's name */
 
        struct scsipi_adapter *chan_adapter; /* pointer to our adapter */
 



Home | Main Index | Thread Index | Old Index