summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-07-24 13:31:31 +0000
committeradrian <adrian@FreeBSD.org>2013-07-24 13:31:31 +0000
commitb82eecbc574764736faf63174952c96d50fb0f97 (patch)
tree93fbd3841340636e6f3189aca70a7868f03deccd
parent5322272b9c2fb92fdb3e32e2e96529d177a247d4 (diff)
downloadFreeBSD-src-b82eecbc574764736faf63174952c96d50fb0f97.zip
FreeBSD-src-b82eecbc574764736faf63174952c96d50fb0f97.tar.gz
Support setting up the iwn debug flags during probe/attach by
checking "hint.iwn.X.debug". Submitted by: Cedric GROSS <cg@cgross.info>
-rw-r--r--sys/dev/iwn/if_iwn.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index 43af17f..a614f98 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -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
}
OpenPOWER on IntegriCloud