Source-Changes-HG archive

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

[src/trunk]: src/sbin/scsictl Added debug command to support SCIOCDEBUG.



details:   https://anonhg.NetBSD.org/src/rev/f628819bd8b0
branches:  trunk
changeset: 537053:f628819bd8b0
user:      petrov <petrov%NetBSD.org@localhost>
date:      Thu Sep 26 06:15:38 2002 +0000

description:
Added debug command to support SCIOCDEBUG.

diffstat:

 sbin/scsictl/scsictl.c |  28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diffs (56 lines):

diff -r 2b3fd80c3611 -r f628819bd8b0 sbin/scsictl/scsictl.c
--- a/sbin/scsictl/scsictl.c    Thu Sep 26 05:54:07 2002 +0000
+++ b/sbin/scsictl/scsictl.c    Thu Sep 26 06:15:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsictl.c,v 1.18 2002/09/03 16:56:05 thorpej Exp $     */
+/*     $NetBSD: scsictl.c,v 1.19 2002/09/26 06:15:38 petrov Exp $      */
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@
 void   device_release __P((int, char *[]));
 void   device_reserve __P((int, char *[]));
 void   device_reset __P((int, char *[]));
+void   device_debug __P((int, char *[]));
 void   device_start __P((int, char *[]));
 void   device_stop __P((int, char *[]));
 void   device_tur __P((int, char *[]));
@@ -95,6 +96,7 @@
        { "release",    "",                     device_release },
        { "reserve",    "",                     device_reserve },
        { "reset",      "",                     device_reset },
+       { "debug",      "level",                device_debug },
        { "start",      "",                     device_start },
        { "stop",       "",                     device_stop },
        { "tur",        "",                     device_tur },
@@ -578,6 +580,30 @@
 }
 
 /*
+ * device_debug:
+ *
+ *     Set debug level to a SCSI device.
+ *     scsipi will print anything iff SCSIPI_DEBUG set in config.
+ */
+void
+device_debug(argc, argv)
+       int argc;
+       char *argv[];
+{
+       int lvl;
+
+       if (argc < 1)
+               usage();
+
+       lvl = atoi(argv[0]);
+
+       if (ioctl(fd, SCIOCDEBUG, &lvl) != 0)
+               err(1, "SCIOCDEBUG");
+
+       return;
+}
+
+/*
  * device_getcache:
  *
  *     Get the caching parameters for a SCSI disk.



Home | Main Index | Thread Index | Old Index