Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/contrib/sys/dev/ic Attach ath(4) HAL sysctls,



details:   https://anonhg.NetBSD.org/src/rev/1628536f32b9
branches:  trunk
changeset: 558874:1628536f32b9
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Mon Mar 01 01:28:35 2004 +0000

description:
Attach ath(4) HAL sysctls,

ath.hal.debug: enable/disable debugging (only if AH_DEBUG is defined)
ath.hal.version: version string, e.g., 0.9.6.11

diffstat:

 contrib/sys/dev/ic/athhal_osdep.c |  56 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diffs (66 lines):

diff -r 20c9d10ea6d0 -r 1628536f32b9 contrib/sys/dev/ic/athhal_osdep.c
--- a/contrib/sys/dev/ic/athhal_osdep.c Mon Mar 01 01:19:45 2004 +0000
+++ b/contrib/sys/dev/ic/athhal_osdep.c Mon Mar 01 01:28:35 2004 +0000
@@ -109,6 +109,62 @@
 int    ath_hal_sw_beacon_response_time = 10;   /* in TU's */
 int    ath_hal_additional_swba_backoff = 0;    /* in TU's */
 
+#ifdef __NetBSD__
+/*
+ * Setup sysctl(3) MIB, ath.hal.*.
+ *
+ * TBD condition SYSCTL_PERMANENT on being an LKM or not
+ */
+SYSCTL_SETUP(sysctl_ath_hal, "sysctl ath.hal subtree setup")
+{
+       int rc;
+#ifdef AH_DEBUG
+       int debug_nodenum;
+#endif /* AH_DEBUG */
+       int hal_nodenum, root_nodenum, version_nodenum;
+       struct sysctlnode *node = NULL;
+
+       if ((rc = sysctl_createv(SYSCTL_PERMANENT, CTLTYPE_NODE, "ath",
+           &node, NULL, 0, NULL, 0, CTL_CREATE, CTL_EOL)) != 0)
+               goto err;
+
+       root_nodenum = node->sysctl_num;
+       node = NULL;
+
+       if ((rc = sysctl_createv(SYSCTL_PERMANENT, CTLTYPE_NODE, "hal",
+           &node, NULL, 0, NULL, 0, root_nodenum, CTL_CREATE, CTL_EOL)) != 0)
+               goto err;
+
+       hal_nodenum = node->sysctl_num;
+       node = NULL;
+
+       /* HAL version */
+       if ((rc = sysctl_createv(SYSCTL_PERMANENT|SYSCTL_READONLY,
+           CTLTYPE_STRING, "version", &node, NULL, 0, &ath_hal_version, 0,
+           root_nodenum, hal_nodenum, CTL_CREATE, CTL_EOL)) != 0)
+               goto err;
+
+       version_nodenum = node->sysctl_num;
+       node = NULL;
+
+#ifdef AH_DEBUG
+       node = NULL;
+
+       /* control debugging printfs */
+       if ((rc = sysctl_createv(SYSCTL_PERMANENT|SYSCTL_READWRITE, CTLTYPE_INT,
+           "debug", &node, NULL, 0, &ath_hal_debug, 0,
+           root_nodenum, hal_nodenum, CTL_CREATE, CTL_EOL)) != 0)
+               goto err;
+
+       debug_nodenum = node->sysctl_num;
+
+#endif /* AH_DEBUG */
+       return;
+err:
+       printf("%s: sysctl_createv failed (rc = %d)\n", __func__, rc);
+}
+#endif /* __NetBSD__ */
+
 void*
 ath_hal_malloc(size_t size)
 {



Home | Main Index | Thread Index | Old Index