From 0e130bb977986dca79b4fad787e640525e7283eb Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Mon, 7 Nov 2011 17:48:00 +0000 Subject: Extra debugging aids and messages * Added dahdi_dev_dbg() macro to print when we don't (yet) have a span number. * Added a new debug category: DAHDI_DBG_ASSIGN * Made sure error return code paths prints helpfull messages * Promote error messages from INFO to NOTICE * Change some errno values from EINVAL to EFAULT (internal errors not caused by user input) Signed-off-by: Oron Peled Acked-by Tzafrir Cohen Acked-by: Shaun Ruffell git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10328 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- include/dahdi/kernel.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index d3c97c8..1e580fd 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -1567,6 +1567,7 @@ struct mutex { * be of the form DAHDI_DBG_* */ #define DAHDI_DBG_GENERAL BIT(0) +#define DAHDI_DBG_ASSIGN BIT(1) #define DAHDI_DBG_DEVICES BIT(7) /* instantiation/destruction etc. */ #define dahdi_dbg(bits, fmt, ...) \ ((void)((debug & (DAHDI_DBG_ ## bits)) && DAHDI_PRINTK(DEBUG, \ @@ -1579,6 +1580,10 @@ struct mutex { ((void)((debug & (DAHDI_DBG_ ## bits)) && \ chan_printk(DEBUG, "-" #bits, chan, \ "%s: " fmt, __func__, ## __VA_ARGS__))) +#define dahdi_dev_dbg(bits, dev, fmt, ...) \ + ((void)((debug & (DAHDI_DBG_ ## bits)) && \ + dev_printk(KERN_DEBUG, dev, \ + "DBG-%s(%s): " fmt, #bits, __func__, ## __VA_ARGS__))) #endif /* DAHDI_PRINK_MACROS_USE_debug */ #endif /* _DAHDI_KERNEL_H */ -- cgit v1.2.3