From owner-svn-src-stable@freebsd.org Sun Jul 7 18:33:23 2019 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D234E15EAD29; Sun, 7 Jul 2019 18:33:22 +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 6B60A6C5FD; Sun, 7 Jul 2019 18:33:22 +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 183A0506D; Sun, 7 Jul 2019 18:33:22 +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 x67IXL8s069511; Sun, 7 Jul 2019 18:33:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x67IXLTW069508; Sun, 7 Jul 2019 18:33:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907071833.x67IXLTW069508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 7 Jul 2019 18:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349817 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 349817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B60A6C5FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:12874, ipnet:2000::/3, country:IT]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2019 18:33:23 -0000 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 + 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");