[svn-commits] fjoe: freebsd/trunk r8352 - in /freebsd/trunk: drivers/dahdi/ drivers/dahdi/w...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 18 09:02:01 CDT 2010


Author: fjoe
Date: Thu Mar 18 09:01:57 2010
New Revision: 8352

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8352
Log:
Module parameters are now visible as sysctl nodes.

Modified:
    freebsd/trunk/drivers/dahdi/dahdi-base.c
    freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c
    freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
    freebsd/trunk/drivers/dahdi/wct4xxp/base.c
    freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c
    freebsd/trunk/freebsd/dahdi/bsd-compat.c
    freebsd/trunk/include/dahdi/compat/bsd.h

Modified: freebsd/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi-base.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi-base.c Thu Mar 18 09:01:57 2010
@@ -59,6 +59,7 @@
 #define FOP_WRITE_ARGS		file, uio, count
 
 #define MODULE_PARAM_PREFIX "dahdi"
+#define MODULE_PARAM_PARENT _dahdi
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic.c Thu Mar 18 09:01:57 2010
@@ -30,9 +30,8 @@
 #include <sys/lock.h>
 #include <sys/module.h>
 #include <sys/mutex.h>
+#include <sys/sysctl.h>
 #include <sys/systm.h>
-
-#define MODULE_PARAM_PREFIX "dahdi.dynamic"
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -841,6 +840,12 @@
 	printk(KERN_INFO "DAHDI Dynamic Span support unloaded\n");
 }
 
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi, OID_AUTO, dynamic, CTLFLAG_RW, 0, "DAHDI dynamic");
+#define MODULE_PARAM_PREFIX "dahdi.dynamic"
+#define MODULE_PARAM_PARENT _dahdi_dynamic
+#endif
+
 module_param(debug, int, 0600);
 
 #if defined(__FreeBSD__)

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c Thu Mar 18 09:01:57 2010
@@ -36,8 +36,6 @@
 
 #define module_printk(level, fmt, args...) printf(fmt, ## args)
 #define debug_printk(level, fmt, args...) if (debug >= level) printf("%s: " fmt, __FUNCTION__, ## args)
-
-#define MODULE_PARAM_PREFIX "dahdi.echocan.jpah"
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -148,6 +146,12 @@
 	dahdi_unregister_echocan_factory(&my_factory);
 }
 
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi_echocan, OID_AUTO, jpah, CTLFLAG_RW, 0, "DAHDI 'JPAH' Echo Canceler");
+#define MODULE_PARAM_PREFIX "dahdi.echocan.jpah"
+#define MODULE_PARAM_PARENT _dahdi_echocan_jpah
+#endif
+
 module_param(debug, int, S_IRUGO | S_IWUSR);
 
 #if defined(__FreeBSD__)

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c Thu Mar 18 09:01:57 2010
@@ -41,8 +41,6 @@
 
 #define module_printk(level, fmt, args...) printf(fmt, ## args)
 #define debug_printk(level, fmt, args...) if (debug >= level) printf("%s: " fmt, __FUNCTION__, ## args)
-
-#define MODULE_PARAM_PREFIX "dahdi.echocan.kb1"
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -747,6 +745,12 @@
 	dahdi_unregister_echocan_factory(&my_factory);
 }
 
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi_echocan, OID_AUTO, kb1, CTLFLAG_RW, 0, "DAHDI 'KB1' Echo Canceler");
+#define MODULE_PARAM_PREFIX "dahdi.echocan.kb1"
+#define MODULE_PARAM_PARENT _dahdi_echocan_kb1
+#endif
+
 module_param(debug, int, S_IRUGO | S_IWUSR);
 module_param(aggressive, int, S_IRUGO | S_IWUSR);
 

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c Thu Mar 18 09:01:57 2010
@@ -41,8 +41,6 @@
 
 #define module_printk(level, fmt, args...) printf(fmt, ## args)
 #define debug_printk(level, fmt, args...) if (debug >= level) printf("%s: " fmt, __FUNCTION__, ## args)
-
-#define MODULE_PARAM_PREFIX "dahdi.echocan.mg2"
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -894,6 +892,12 @@
 	dahdi_unregister_echocan_factory(&my_factory);
 }
 
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi_echocan, OID_AUTO, mg2, CTLFLAG_RW, 0, "DAHDI 'MG2' Echo Canceler");
+#define MODULE_PARAM_PREFIX "dahdi.echocan.mg2"
+#define MODULE_PARAM_PARENT _dahdi_echocan_mg2
+#endif
+
 module_param(debug, int, S_IRUGO | S_IWUSR);
 module_param(aggressive, int, S_IRUGO | S_IWUSR);
 

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c Thu Mar 18 09:01:57 2010
@@ -46,8 +46,6 @@
 
 #define module_printk(level, fmt, args...) printf(fmt, ## args)
 #define debug_printk(level, fmt, args...) if (debug >= level) printf("%s: " fmt, __FUNCTION__, ## args)
-
-#define MODULE_PARAM_PREFIX "dahdi.echocan.sec"
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -360,6 +358,12 @@
 	dahdi_unregister_echocan_factory(&my_factory);
 }
 
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi_echocan, OID_AUTO, sec, CTLFLAG_RW, 0, "DAHDI 'SEC' Echo Canceler");
+#define MODULE_PARAM_PREFIX "dahdi.echocan.sec"
+#define MODULE_PARAM_PARENT _dahdi_echocan_sec
+#endif
+
 module_param(debug, int, S_IRUGO | S_IWUSR);
 
 #if defined(__FreeBSD__)

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c Thu Mar 18 09:01:57 2010
@@ -45,8 +45,6 @@
 
 #define module_printk(level, fmt, args...) printf(fmt, ## args)
 #define debug_printk(level, fmt, args...) if (debug >= level) printf("%s: " fmt, __FUNCTION__, ## args)
-
-#define MODULE_PARAM_PREFIX "dahdi.echocan.sec2"
 #else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -355,6 +353,12 @@
 	dahdi_unregister_echocan_factory(&my_factory);
 }
 
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi_echocan, OID_AUTO, sec2, CTLFLAG_RW, 0, "DAHDI 'SEC2' Echo Canceler");
+#define MODULE_PARAM_PREFIX "dahdi.echocan.sec2"
+#define MODULE_PARAM_PARENT _dahdi_echocan_sec2
+#endif
+
 module_param(debug, int, S_IRUGO | S_IWUSR);
 
 #if defined(__FreeBSD__)

Modified: freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wcb4xxp/base.c Thu Mar 18 09:01:57 2010
@@ -31,8 +31,6 @@
 #include <machine/bus.h>
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
-
-#define MODULE_PARAM_PREFIX "dahdi.wcb4xxp"
 
 #ifdef mb
 #undef mb
@@ -3137,6 +3135,10 @@
 MODULE_DEPEND(wcb4xxp, pci, 1, 1, 1);
 MODULE_DEPEND(wcb4xxp, dahdi, 1, 1, 1);
 
+SYSCTL_NODE(_dahdi, OID_AUTO, wcb4xxp, CTLFLAG_RW, 0, "DAHDI wcb4xxp");
+#define MODULE_PARAM_PREFIX "dahdi.wcb4xxp"
+#define MODULE_PARAM_PARENT _dahdi_wcb4xxp
+
 #else /* !__FreeBSD__ */
 static int b4xxp_setup_intr(struct b4xxp *b4)
 {

Modified: freebsd/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wct4xxp/base.c Thu Mar 18 09:01:57 2010
@@ -40,8 +40,6 @@
 #include <dev/pci/pcivar.h>
 
 #define DPRINTF(dev, fmt, args...)      device_rlprintf(20, dev, fmt, ##args)
-
-#define MODULE_PARAM_PREFIX "dahdi.wct4xxp"
 
 static int
 t4_dma_allocate(int size, bus_dma_tag_t *ptag, bus_dmamap_t *pmap, void **pvaddr, uint32_t *ppaddr);
@@ -4797,6 +4795,11 @@
 MODULE_DEPEND(wct4xxp, pci, 1, 1, 1);
 MODULE_DEPEND(wct4xxp, dahdi, 1, 1, 1);
 MODULE_DEPEND(wct4xxp, firmware, 1, 1, 1);
+
+SYSCTL_NODE(_dahdi, OID_AUTO, wct4xxp, CTLFLAG_RW, 0, "DAHDI wct4xxp");
+#define MODULE_PARAM_PREFIX "dahdi.wct4xxp"
+#define MODULE_PARAM_PARENT _dahdi_wct4xxp
+
 #else /* !__FreeBSD__ */
 static int
 t4_setup_intr(struct t4 *wc, struct devtype *dt)

Modified: freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Mar 18 09:01:57 2010
@@ -48,8 +48,6 @@
 typedef int bool;
 
 #define fatal_signal_pending(c) 0
-
-#define MODULE_PARAM_PREFIX "dahdi.wctdm24xxp"
 
 #define DPRINTF(dev, fmt, args...)      device_rlprintf(20, dev, fmt, ##args)
 #else /* !__FreeBSD__ */
@@ -4998,7 +4996,11 @@
 	{ 0 }
 };
 
-#if !defined(__FreeBSD__)
+#if defined(__FreeBSD__)
+SYSCTL_NODE(_dahdi, OID_AUTO, wctdm24xxp, CTLFLAG_RW, 0, "DAHDI wctdm24xxp");
+#define MODULE_PARAM_PREFIX "dahdi.wctdm24xxp"
+#define MODULE_PARAM_PARENT _dahdi_wctdm24xxp
+#else /* !__FreeBSD__ */
 MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl);
 
 static struct pci_driver wctdm_driver = {

Modified: freebsd/trunk/freebsd/dahdi/bsd-compat.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/freebsd/dahdi/bsd-compat.c?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/freebsd/dahdi/bsd-compat.c (original)
+++ freebsd/trunk/freebsd/dahdi/bsd-compat.c Thu Mar 18 09:01:57 2010
@@ -39,6 +39,9 @@
 
 #include <dahdi/compat/bsd.h>
 
+SYSCTL_NODE(, OID_AUTO, dahdi, CTLFLAG_RW, 0, "DAHDI");
+SYSCTL_NODE(_dahdi, OID_AUTO, echocan, CTLFLAG_RW, 0, "DAHDI Echo Cancelers");
+
 /*
  * Tasklet API
  */

Modified: freebsd/trunk/include/dahdi/compat/bsd.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/compat/bsd.h?view=diff&rev=8352&r1=8351&r2=8352
==============================================================================
--- freebsd/trunk/include/dahdi/compat/bsd.h (original)
+++ freebsd/trunk/include/dahdi/compat/bsd.h Thu Mar 18 09:01:57 2010
@@ -9,6 +9,7 @@
 #include <sys/mutex.h>
 #include <sys/sema.h>
 #include <sys/sx.h>
+#include <sys/sysctl.h>
 #include <sys/taskqueue.h>
 #include <machine/atomic.h>
 
@@ -329,11 +330,38 @@
 
 #define EXPORT_SYMBOL(s)
 
-#define module_param(name, type, mode)	module_param_##type(MODULE_PARAM_PREFIX "." #name, name)
-#define module_param_int(name, var)	TUNABLE_INT((name), &(var))
-#define module_param_uint(name, var)	TUNABLE_INT((name), &(var))
-#define module_param_charp(name, var)	TUNABLE_STR((name), (var), sizeof(var))
+#define _SYSCTL_FLAG(mode)	((mode) & 0200 ? CTLFLAG_RW : CTLFLAG_RD)
+#define module_param(name, type, mode)	module_param_##type(MODULE_PARAM_PREFIX "." #name, name, mode)
+#define module_param_int(name, var, mode)				\
+	TUNABLE_INT((name), &(var));					\
+	SYSCTL_INT(MODULE_PARAM_PARENT, OID_AUTO, var, _SYSCTL_FLAG(mode),\
+		   &(var), 0, MODULE_PARAM_PREFIX "." #name)
+#define module_param_uint(name, var, mode)				\
+	TUNABLE_INT((name), &(var));					\
+	SYSCTL_UINT(MODULE_PARAM_PARENT, OID_AUTO, var, _SYSCTL_FLAG(mode),\
+		   &(var), 0, MODULE_PARAM_PREFIX "." #name)
+#define module_param_charp(name, var, mode)				\
+	TUNABLE_STR((name), (var), sizeof(var));			\
+	SYSCTL_STRING(MODULE_PARAM_PARENT, OID_AUTO, var, _SYSCTL_FLAG(mode),\
+		   var, sizeof(var), MODULE_PARAM_PREFIX "." #name)
 #define MODULE_PARM_DESC(name, desc)
+
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#define S_IRUGO         (S_IRUSR|S_IRGRP|S_IROTH)
+
+SYSCTL_DECL(_dahdi);
+SYSCTL_DECL(_dahdi_echocan);
 
 /*
  * Firmware API




More information about the svn-commits mailing list