Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2019 19:09:10 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349292 - head/sys/cam/scsi
Message-ID:  <201906221909.x5MJ9AQl093403@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Jun 22 19:09:10 2019
New Revision: 349292
URL: https://svnweb.freebsd.org/changeset/base/349292

Log:
  Decouple enc/ses verbosity from bootverbose.
  
  I don't want to be regularly notified that my enclosure violates standards
  until there is some real problem I want to debug.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/scsi/scsi_enc.c
  head/sys/cam/scsi/scsi_enc_internal.h
  head/sys/cam/scsi/scsi_enc_safte.c

Modified: head/sys/cam/scsi/scsi_enc.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc.c	Sat Jun 22 16:54:23 2019	(r349291)
+++ head/sys/cam/scsi/scsi_enc.c	Sat Jun 22 19:09:10 2019	(r349292)
@@ -81,6 +81,14 @@ static enctyp enc_type(struct ccb_getdev *);
 SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD, 0,
             "CAM Enclosure Services driver");
 
+#if defined(DEBUG) || defined(ENC_DEBUG)
+int enc_verbose = 1;
+#else
+int enc_verbose = 0;
+#endif
+SYSCTL_INT(_kern_cam_enc, OID_AUTO, verbose, CTLFLAG_RWTUN,
+           &enc_verbose, 0, "Enable verbose logging");
+
 static struct periph_driver encdriver = {
 	enc_init, "ses",
 	TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0

Modified: head/sys/cam/scsi/scsi_enc_internal.h
==============================================================================
--- head/sys/cam/scsi/scsi_enc_internal.h	Sat Jun 22 16:54:23 2019	(r349291)
+++ head/sys/cam/scsi/scsi_enc_internal.h	Sat Jun 22 19:09:10 2019	(r349292)
@@ -36,6 +36,8 @@
 #ifndef	__SCSI_ENC_INTERNAL_H__
 #define	__SCSI_ENC_INTERNAL_H__
 
+#include <sys/sysctl.h>
+
 typedef struct enc_element {
 	uint32_t
 		 enctype	: 8,	/* enclosure type */
@@ -204,6 +206,9 @@ enc_softc_init_t	ses_softc_init;
 /* SAF-TE interface */
 enc_softc_init_t	safte_softc_init;
 
+SYSCTL_DECL(_kern_cam_enc);
+extern int enc_verbose;
+
 /* Helper macros */
 MALLOC_DECLARE(M_SCSIENC);
 #define	ENC_CFLAGS		CAM_RETRY_SELTO
@@ -216,7 +221,7 @@ MALLOC_DECLARE(M_SCSIENC);
 #else
 #define	ENC_DLOG		if (0) enc_log
 #endif
-#define	ENC_VLOG		if (bootverbose) enc_log
+#define	ENC_VLOG		if (enc_verbose) enc_log
 #define	ENC_MALLOC(amt)		malloc(amt, M_SCSIENC, M_NOWAIT)
 #define	ENC_MALLOCZ(amt)	malloc(amt, M_SCSIENC, M_ZERO|M_NOWAIT)
 /* Cast away const avoiding GCC warnings. */

Modified: head/sys/cam/scsi/scsi_enc_safte.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc_safte.c	Sat Jun 22 16:54:23 2019	(r349291)
+++ head/sys/cam/scsi/scsi_enc_safte.c	Sat Jun 22 19:09:10 2019	(r349292)
@@ -227,7 +227,6 @@ static char *safte_2little = "Too Little Data Returned
 	}
 
 int emulate_array_devices = 1;
-SYSCTL_DECL(_kern_cam_enc);
 SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN,
            &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE");
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906221909.x5MJ9AQl093403>