[dahdi-commits] tzafrir: linux/trunk r10271 - /linux/trunk/drivers/dahdi/dahdi-base.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Wed Oct 26 13:57:11 CDT 2011
Author: tzafrir
Date: Wed Oct 26 13:57:07 2011
New Revision: 10271
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10271
Log:
dahdi: Add error messages in dahdi_ioctl_chanconfig.
Provide more context to trouble shoot failures.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Acked-by: Shaun Ruffell <sruffell at digium.com>
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=10271&r1=10270&r2=10271
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Wed Oct 26 13:57:07 2011
@@ -4466,19 +4466,28 @@
return -EFAULT;
chan = chan_from_num(ch.chan);
- if (!chan)
+ if (!chan) {
+ printk(KERN_NOTICE "%s: No channel for number %d\n",
+ __func__, ch.chan);
return -EINVAL;
+ }
if (ch.sigtype == DAHDI_SIG_SLAVE) {
newmaster = chan_from_num(ch.master);
- if (!newmaster)
+ if (!newmaster) {
+ chan_notice(chan, "%s: slave channel without master.\n",
+ __func__);
return -EINVAL;
+ }
ch.sigtype = newmaster->sig;
} else if ((ch.sigtype & __DAHDI_SIG_DACS) == __DAHDI_SIG_DACS) {
newmaster = chan;
dacs_chan = chan_from_num(ch.idlebits);
- if (!dacs_chan)
+ if (!dacs_chan) {
+ chan_notice(chan, "%s: dacs channel not found: %d.\n",
+ __func__, ch.idlebits);
return -EINVAL;
+ }
} else {
newmaster = chan;
}
@@ -4511,8 +4520,13 @@
if (sigcap & DAHDI_SIG_CLEAR)
sigcap |= (DAHDI_SIG_HDLCRAW | DAHDI_SIG_HDLCFCS | DAHDI_SIG_HDLCNET | DAHDI_SIG_DACS);
- if ((sigcap & ch.sigtype) != ch.sigtype)
+ if ((sigcap & ch.sigtype) != ch.sigtype) {
+ if (debug) {
+ chan_notice(chan, "%s: bad sigtype. sigcap: %x, sigtype: %x.\n",
+ __func__, sigcap, ch.sigtype);
+ }
res = -EINVAL;
+ }
if (chan->master != chan) {
struct dahdi_chan *oldmaster = chan->master;
@@ -4556,6 +4570,8 @@
if ((ch.sigtype & __DAHDI_SIG_DACS) == __DAHDI_SIG_DACS) {
if (unlikely(!dacs_chan)) {
spin_unlock_irqrestore(&chan->lock, flags);
+ chan_notice(chan, "%s: dacs but no dacs_chan\n",
+ __func__);
return -EINVAL;
}
/* Setup conference properly */
More information about the dahdi-commits
mailing list