svn commit: r349817 - stable/12/sys/cam/scsi
Alexander Motin
mav at FreeBSD.org
Sun Jul 7 18:33:23 UTC 2019
Author: mav
Date: Sun Jul 7 18:33:21 2019
New Revision: 349817
URL: https://svnweb.freebsd.org/changeset/base/349817
Log:
MFC r349292: 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.
Modified:
stable/12/sys/cam/scsi/scsi_enc.c
stable/12/sys/cam/scsi/scsi_enc_internal.h
stable/12/sys/cam/scsi/scsi_enc_safte.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/cam/scsi/scsi_enc.c
==============================================================================
--- stable/12/sys/cam/scsi/scsi_enc.c Sun Jul 7 18:32:34 2019 (r349816)
+++ stable/12/sys/cam/scsi/scsi_enc.c Sun Jul 7 18:33:21 2019 (r349817)
@@ -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: stable/12/sys/cam/scsi/scsi_enc_internal.h
==============================================================================
--- stable/12/sys/cam/scsi/scsi_enc_internal.h Sun Jul 7 18:32:34 2019 (r349816)
+++ stable/12/sys/cam/scsi/scsi_enc_internal.h Sun Jul 7 18:33:21 2019 (r349817)
@@ -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: stable/12/sys/cam/scsi/scsi_enc_safte.c
==============================================================================
--- stable/12/sys/cam/scsi/scsi_enc_safte.c Sun Jul 7 18:32:34 2019 (r349816)
+++ stable/12/sys/cam/scsi/scsi_enc_safte.c Sun Jul 7 18:33:21 2019 (r349817)
@@ -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");
More information about the svn-src-all
mailing list