From owner-svn-src-head@FreeBSD.ORG Wed Jul 24 13:31:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAC248D1; Wed, 24 Jul 2013 13:31:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC9A52FE5; Wed, 24 Jul 2013 13:31:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6ODVV8U072685; Wed, 24 Jul 2013 13:31:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6ODVVDQ072684; Wed, 24 Jul 2013 13:31:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307241331.r6ODVVDQ072684@svn.freebsd.org> From: Adrian Chadd Date: Wed, 24 Jul 2013 13:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253612 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 13:31:31 -0000 Author: adrian Date: Wed Jul 24 13:31:31 2013 New Revision: 253612 URL: http://svnweb.freebsd.org/changeset/base/253612 Log: Support setting up the iwn debug flags during probe/attach by checking "hint.iwn.X.debug". Submitted by: Cedric GROSS Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:20:45 2013 (r253611) +++ head/sys/dev/iwn/if_iwn.c Wed Jul 24 13:31:31 2013 (r253612) @@ -447,6 +447,15 @@ iwn_attach(device_t dev) sc->sc_dev = dev; +#ifdef IWN_DEBUG + error = resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "debug", &(sc->sc_debug)); + if (error != 0) + sc->sc_debug = 0; +#else + sc->sc_debug = 0; +#endif + /* * Get the offset of the PCI Express Capability Structure in PCI * Configuration Space. @@ -846,13 +855,13 @@ iwn_radiotap_attach(struct iwn_softc *sc static void iwn_sysctlattach(struct iwn_softc *sc) { +#ifdef IWN_DEBUG struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); -#ifdef IWN_DEBUG - sc->sc_debug = 0; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs"); + "debug", CTLFLAG_RW, &sc->sc_debug, sc->sc_debug, + "control debugging printfs"); #endif }