Date: Thu, 8 Aug 2019 21:38:53 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350790 - stable/11/sys/cam/scsi Message-ID: <201908082138.x78LcrqS023082@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Aug 8 21:38:53 2019 New Revision: 350790 URL: https://svnweb.freebsd.org/changeset/base/350790 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/11/sys/cam/scsi/scsi_enc.c stable/11/sys/cam/scsi/scsi_enc_internal.h stable/11/sys/cam/scsi/scsi_enc_safte.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:38:13 2019 (r350789) +++ stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:38:53 2019 (r350790) @@ -80,6 +80,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/11/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:38:13 2019 (r350789) +++ stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:38:53 2019 (r350790) @@ -34,6 +34,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 */ @@ -199,6 +201,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 @@ -211,7 +216,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/11/sys/cam/scsi/scsi_enc_safte.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_safte.c Thu Aug 8 21:38:13 2019 (r350789) +++ stable/11/sys/cam/scsi/scsi_enc_safte.c Thu Aug 8 21:38:53 2019 (r350790) @@ -225,7 +225,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?201908082138.x78LcrqS023082>