From owner-svn-src-stable-11@freebsd.org Thu Aug 8 21:38:54 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CB2EB3E79; Thu, 8 Aug 2019 21:38:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MFV1B8mz4vpw; Thu, 8 Aug 2019 21:38:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E448F387A; Thu, 8 Aug 2019 21:38:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78LcrEv023084; Thu, 8 Aug 2019 21:38:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LcrqS023082; Thu, 8 Aug 2019 21:38:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082138.x78LcrqS023082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:38:53 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 350790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 21:38:54 -0000 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 + 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");