[dahdi-commits] kmoore: linux/trunk r9049 - /linux/trunk/drivers/dahdi/wct4xxp/base.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Thu Jul 29 16:51:55 CDT 2010
Author: kmoore
Date: Thu Jul 29 16:51:50 2010
New Revision: 9049
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9049
Log:
wct4xxp: increase consistency and decrease verbosity of kernel logging
Modified:
linux/trunk/drivers/dahdi/wct4xxp/base.c
Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9049&r1=9048&r2=9049
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Thu Jul 29 16:51:50 2010
@@ -537,13 +537,15 @@
if (pedanticpci) {
tmp = __t4_pci_in(wc, WC_VERSION);
if ((tmp & 0xffff0000) != 0xc01a0000)
- printk(KERN_NOTICE "TE4XXP: Version Synchronization Error!\n");
+ dev_notice(&wc->dev->dev,
+ "Version Synchronization Error!\n");
}
#if 0
tmp = __t4_pci_in(wc, addr);
if ((value != tmp) && (addr != WC_LEDS) && (addr != WC_LDATA) &&
(addr != WC_GPIO) && (addr != WC_INTR))
- printk(KERN_DEBUG "Tried to load %08x into %08x, but got %08x instead\n", value, addr, tmp);
+ dev_info(&wc->dev->dev, "Tried to load %08x into %08x, "
+ "but got %08x instead\n", value, addr, tmp);
#endif
}
@@ -636,7 +638,8 @@
__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff));
if (unlikely(debug & DEBUG_REGS))
- printk(KERN_INFO "Reading unit %d address %02x is %02x\n", unit, addr, ret & 0xff);
+ dev_info(&wc->dev->dev, "Reading unit %d address %02x is "
+ "%02x\n", unit, addr, ret & 0xff);
if (!pedanticpci)
__t4_pci_in(wc, WC_VERSION);
@@ -659,7 +662,8 @@
{
unit &= 0x3;
if (unlikely(debug & DEBUG_REGS))
- printk(KERN_INFO "Writing %02x to address %02x of unit %d\n", value, addr, unit);
+ dev_info(&wc->dev->dev, "Writing %02x to address %02x of "
+ "unit %d\n", value, addr, unit);
__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff));
__t4_pci_out(wc, WC_LDATA, value);
if (!pedanticpci)
@@ -670,13 +674,16 @@
__t4_pci_out(wc, WC_LADDR, (unit << 8) | (addr & 0xff));
if (!pedanticpci)
__t4_pci_in(wc, WC_VERSION);
- if (unlikely(debug & DEBUG_REGS)) printk(KERN_INFO "Write complete\n");
+ if (unlikely(debug & DEBUG_REGS))
+ dev_info(&wc->dev->dev, "Write complete\n");
#if 0
if ((addr != FRMR_TXFIFO) && (addr != FRMR_CMDR) && (addr != 0xbc))
{ unsigned int tmp;
tmp = __t4_framer_in(wc, unit, addr);
if (tmp != value) {
- printk(KERN_DEBUG "Expected %d from unit %d register %d but got %d instead\n", value, unit, addr, tmp);
+ dev_notice(&wc->dev->dev, "Expected %d from unit %d "
+ "register %d but got %d instead\n",
+ value, unit, addr, tmp);
} }
#endif
}
@@ -781,9 +788,9 @@
#ifdef PEDANTIC_OCTASIC_CHECKING
while((__t4_raw_oct_in(wc, 0x0000) & (1 << 8)) && --count);
if (count != 1000)
- printk(KERN_DEBUG "Yah, read can be slow...\n");
+ dev_notice(&wc->dev->dev, "Yah, read can be slow...\n");
if (!count)
- printk(KERN_NOTICE "Read timed out!\n");
+ dev_notice(&wc->dev->dev, "Read timed out!\n");
#endif
return __t4_raw_oct_in(wc, 0x0004);
}
@@ -813,7 +820,8 @@
{
unit &= 0x7;
if (debug & DEBUG_REGS)
- printk(KERN_DEBUG "Writing %02x to address %02x of ec unit %d\n", value, addr, unit);
+ dev_notice(&wc->dev->dev, "Writing %02x to address %02x of "
+ "ec unit %d\n", value, addr, unit);
__t4_pci_out(wc, WC_LADDR, (addr & 0xff));
__t4_pci_out(wc, WC_LDATA, value);
__t4_pci_out(wc, WC_LADDR, (unit << 12) | (addr & 0x1ff) | (1 << 11));
@@ -821,14 +829,17 @@
__t4_pci_out(wc, WC_LADDR, (unit << 12) | (addr & 0x1ff) | (1 << 11));
__t4_pci_out(wc, WC_LADDR, (unit << 12) | (addr & 0x1ff));
__t4_pci_out(wc, WC_LADDR, 0);
- if (debug & DEBUG_REGS) printk(KERN_DEBUG "Write complete\n");
+ if (debug & DEBUG_REGS)
+ dev_notice(&wc->dev->dev, "Write complete\n");
#if 0
{ unsigned int tmp;
tmp = t4_vpm_in(wc, unit, addr);
if (tmp != value) {
- printk(KERN_DEBUG "Expected %d from unit %d echo register %d but got %d instead\n", value, unit, addr, tmp);
+ dev_notice(&wc->dev->dev, "Expected %d from unit %d echo "
+ "register %d but got %d instead\n",
+ value, unit, addr, tmp);
} }
#endif
}
@@ -845,9 +856,9 @@
#ifdef PEDANTIC_OCTASIC_CHECKING
while((__t4_raw_oct_in(wc, 0x0000) & (1 << 8)) && --count);
if (count != 1000)
- printk(KERN_DEBUG "Yah, write can be slow\n");
+ dev_notice(&wc->dev->dev, "Yah, write can be slow\n");
if (!count)
- printk(KERN_NOTICE "Write timed out!\n");
+ dev_notice(&wc->dev->dev, "Write timed out!\n");
#endif
}
@@ -883,8 +894,10 @@
else
channel -= 1;
if (unlikely(debug))
- printk(KERN_INFO "Got tone %s of '%c' on channel %d of span %d\n",
- (start ? "START" : "STOP"), tone, channel, span + 1);
+ dev_info(&wc->dev->dev, "Got tone %s of '%c' "
+ "on channel %d of span %d\n",
+ (start ? "START" : "STOP"),
+ tone, channel, span + 1);
if (test_bit(channel, &wc->tspans[span]->dtmfmask) && (tone != 'u')) {
if (start) {
/* The octasic is supposed to mute us, but... Yah, you
@@ -921,7 +934,8 @@
struct t4_span *ts;
if (debug && (newio != lastio))
- printk(KERN_DEBUG "Last was %08x, new is %08x\n", lastio, newio);
+ dev_notice(&wc->dev->dev, "Last was %08x, new is %08x\n",
+ lastio, newio);
lastio = newio;
@@ -972,7 +986,11 @@
spin_unlock_irqrestore(&chan->lock, flags);
}
if (debug)
- printk(KERN_DEBUG "Digit Seen: %d, Span: %d, channel: %d, energy: %02x, 'channel %d' chip %d\n", digit, x % 4, base + 1, energy, channel, x);
+ dev_notice(&wc->dev->dev, "Digit "
+ "Seen: %d, Span: %d, channel:"
+ " %d, energy: %02x, 'channel "
+ "%d' chip %d\n", digit, x % 4,
+ base + 1, energy, channel, x);
}
regval = regval >> 1;
@@ -1003,7 +1021,11 @@
digit = ts->dtmfdigit[base];
ts->dtmfdigit[base] = 0;
if (debug)
- printk(KERN_DEBUG "Digit Gone: %d, Span: %d, channel: %d, energy: %02x, 'channel %d' chip %d\n", digit, x % 4, base + 1, energy, channel, x);
+ dev_notice(&wc->dev->dev, "Digit "
+ "Gone: %d, Span: %d, channel:"
+ " %d, energy: %02x, 'channel "
+ "%d' chip %d\n", digit, x % 4,
+ base + 1, energy, channel, x);
}
regval = regval >> 1;
@@ -1019,7 +1041,9 @@
unsigned char imr0, imr1, mode;
int i = 0;
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Stopping HDLC controller on span %d\n", span+1);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Stopping HDLC controller on span "
+ "%d\n", span+1);
/* Clear receive and transmit timeslots */
for (i = 0; i < 4; i++) {
@@ -1060,11 +1084,12 @@
if (!(sis & 0x04))
break;
if (!loops++ && (debug & DEBUG_FRAMER)) {
- printk(KERN_NOTICE "!!!SIS Waiting before cmd %02x\n", cmd);
+ dev_notice(&wc->dev->dev, "!!!SIS Waiting before cmd "
+ "%02x\n", cmd);
}
}
if (loops && (debug & DEBUG_FRAMER))
- printk(KERN_NOTICE "!!!SIS waited %d loops\n", loops);
+ dev_notice(&wc->dev->dev, "!!!SIS waited %d loops\n", loops);
t4_framer_out(wc, span, FRMR_CMDR, cmd);
}
@@ -1076,7 +1101,9 @@
int offset = chan->chanpos;
unsigned long flags;
- if (debug & DEBUG_FRAMER) printk(KERN_INFO "Starting HDLC controller for channel %d span %d\n", offset, span+1);
+ if (debug & DEBUG_FRAMER)
+ dev_info(&wc->dev->dev, "Starting HDLC controller for channel "
+ "%d span %d\n", offset, span+1);
if (mode != FRMR_MODE_NO_ADDR_CMP)
return -1;
@@ -1137,8 +1164,9 @@
ts->notclear |= (1 << i);
if ((i % 8)==7) {
if (debug)
- printk(KERN_DEBUG "Putting %d in register %02x on span %d\n",
- val, 0x2f + j, span + 1);
+ dev_notice(&wc->dev->dev, "Putting %d "
+ "in register %02x on span %d"
+ "\n", val, 0x2f + j, span + 1);
__t4_framer_out(wc, span, 0x2f + j, val);
val = 0;
}
@@ -1185,19 +1213,25 @@
if (ts->spanflags & FLAG_2NDGEN)
t4_tsi_unassign(wc, src->span->offset, src->chanpos);
if (debug)
- printk(KERN_DEBUG "Unassigning %d/%d by default and...\n", src->span->offset, src->chanpos);
+ dev_notice(&wc->dev->dev, "Unassigning %d/%d by "
+ "default and...\n", src->span->offset,
+ src->chanpos);
if (debug)
- printk(KERN_DEBUG "Unassigning %d/%d by default\n", dst->span->offset, dst->chanpos);
+ dev_notice(&wc->dev->dev, "Unassigning %d/%d by "
+ "default\n", dst->span->offset, dst->chanpos);
return -1;
}
if (src) {
t4_tsi_assign(wc, src->span->offset, src->chanpos, dst->span->offset, dst->chanpos);
if (debug)
- printk(KERN_DEBUG "Assigning channel %d/%d -> %d/%d!\n", src->span->offset, src->chanpos, dst->span->offset, dst->chanpos);
+ dev_notice(&wc->dev->dev, "Assigning channel %d/%d -> "
+ "%d/%d!\n", src->span->offset, src->chanpos,
+ dst->span->offset, dst->chanpos);
} else {
t4_tsi_unassign(wc, dst->span->offset, dst->chanpos);
if (debug)
- printk(KERN_DEBUG "Unassigning channel %d/%d!\n", dst->span->offset, dst->chanpos);
+ dev_notice(&wc->dev->dev, "Unassigning channel %d/%d!"
+ "\n", dst->span->offset, dst->chanpos);
}
return 0;
}
@@ -1263,7 +1297,8 @@
}
if (ecp->param_count > 0) {
- printk(KERN_WARNING "%s echo canceller does not support parameters; failing request\n", ops->name);
+ dev_warn(&wc->dev->dev, "%s echo canceller does not support "
+ "parameters; failing request\n", ops->name);
return -EINVAL;
}
@@ -1277,15 +1312,20 @@
channel = channel << 2;
channel |= chan->span->offset;
if (debug & DEBUG_ECHOCAN)
- printk(KERN_DEBUG "echocan: Card is %d, Channel is %d, Span is %d, offset is %d length %d\n",
- wc->num, chan->chanpos, chan->span->offset, channel, ecp->tap_length);
+ dev_notice(&wc->dev->dev, "echocan: Card is %d, "
+ "Channel is %d, Span is %d, offset is %d "
+ "length %d\n", wc->num, chan->chanpos,
+ chan->span->offset, channel, ecp->tap_length);
vpm450m_setec(wc->vpm450m, channel, ecp->tap_length);
} else {
int unit = t4_vpm_unit(chan->span->offset, channel);
if (debug & DEBUG_ECHOCAN)
- printk(KERN_DEBUG "echocan: Card is %d, Channel is %d, Span is %d, unit is %d, unit offset is %d length %d\n",
- wc->num, chan->chanpos, chan->span->offset, unit, channel, ecp->tap_length);
+ dev_notice(&wc->dev->dev, "echocan: Card is %d, "
+ "Channel is %d, Span is %d, unit is %d, "
+ "unit offset is %d length %d\n", wc->num,
+ chan->chanpos, chan->span->offset, unit,
+ channel, ecp->tap_length);
t4_vpm_out(wc, unit, channel, 0x3e);
}
@@ -1305,15 +1345,20 @@
channel = channel << 2;
channel |= chan->span->offset;
if (debug & DEBUG_ECHOCAN)
- printk(KERN_DEBUG "echocan: Card is %d, Channel is %d, Span is %d, offset is %d length 0\n",
- wc->num, chan->chanpos, chan->span->offset, channel);
+ dev_notice(&wc->dev->dev, "echocan: Card is %d, "
+ "Channel is %d, Span is %d, offset is %d "
+ "length 0\n", wc->num, chan->chanpos,
+ chan->span->offset, channel);
vpm450m_setec(wc->vpm450m, channel, 0);
} else {
int unit = t4_vpm_unit(chan->span->offset, channel);
if (debug & DEBUG_ECHOCAN)
- printk(KERN_DEBUG "echocan: Card is %d, Channel is %d, Span is %d, unit is %d, unit offset is %d length 0\n",
- wc->num, chan->chanpos, chan->span->offset, unit, channel);
+ dev_notice(&wc->dev->dev, "echocan: Card is %d, "
+ "Channel is %d, Span is %d, unit is %d, "
+ "unit offset is %d length 0\n", wc->num,
+ chan->chanpos, chan->span->offset, unit,
+ channel);
t4_vpm_out(wc, unit, channel, 0x01);
}
}
@@ -1386,31 +1431,39 @@
unsigned char buf[32];
res = dahdi_hdlc_getbuf(ts->sigchan, buf, &size);
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Got buffer sized %d and res %d for %d\n", size, res, span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Got buffer sized %d and res %d "
+ "for %d\n", size, res, span);
if (size > 0) {
ts->sigactive = 1;
if (debug & DEBUG_FRAMER) {
- printk(KERN_DEBUG "TX(");
+ dev_notice(&wc->dev->dev, "TX(");
for (i = 0; i < size; i++)
- printk(KERN_DEBUG "%s%02x", i ? " " : "", buf[i]);
- printk(KERN_DEBUG ")\n");
+ dev_notice(&wc->dev->dev, "%s%02x",
+ (i ? " " : ""), buf[i]);
+ dev_notice(&wc->dev->dev, ")\n");
}
for (i = 0; i < size; i++)
t4_framer_out(wc, span, FRMR_TXFIFO, buf[i]);
if (res) /* End of message */ {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "transmiting XHF|XME\n");
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev,
+ "transmiting XHF|XME\n");
t4_framer_cmd_wait(wc, span, FRMR_CMDR_XHF | FRMR_CMDR_XME);
#if 0
ts->sigactive = (__t4_framer_in(wc, span, FRMR_SIS) & FRMR_SIS_XFW) ? 0 : 1;
#endif
++ts->frames_out;
if ((debug & DEBUG_FRAMER) && !(ts->frames_out & 0x0f))
- printk(KERN_DEBUG "Transmitted %d frames on span %d\n", ts->frames_out, span);
+ dev_notice(&wc->dev->dev, "Transmitted %d "
+ "frames on span %d\n", ts->frames_out,
+ span);
} else { /* Still more to transmit */
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "transmiting XHF\n");
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "transmiting XHF\n");
t4_framer_cmd_wait(wc, span, FRMR_CMDR_XHF);
}
}
@@ -1427,13 +1480,17 @@
spin_lock_irqsave(&wc->reglock, flags);
if (!ts->sigchan) {
- printk(KERN_NOTICE "t4_hdlc_hard_xmit: Invalid (NULL) signalling channel\n");
+ dev_notice(&wc->dev->dev, "t4_hdlc_hard_xmit: Invalid (NULL) "
+ "signalling channel\n");
spin_unlock_irqrestore(&wc->reglock, flags);
return;
}
spin_unlock_irqrestore(&wc->reglock, flags);
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "t4_hdlc_hard_xmit on channel %s (sigchan %s), sigactive=%d\n", chan->name, ts->sigchan->name, ts->sigactive);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "t4_hdlc_hard_xmit on channel %s "
+ "(sigchan %s), sigactive=%d\n", chan->name,
+ ts->sigchan->name, ts->sigactive);
if ((ts->sigchan == chan) && !ts->sigactive)
t4_hdlc_xmit_fifo(wc, span, ts);
@@ -1573,7 +1630,7 @@
case DAHDI_MAINT_PRBS:
dev_info(&wc->dev->dev, "PRBS not supported\n");
#if 0
- printk(KERN_NOTICE "Enabling PRBS!\n");
+ dev_notice(&wc->dev->dev, "Enabling PRBS!\n");
span->mainttimer = 1;
/* Enable PRBS monitor */
reg = t4_framer_in(wc, span->offset, LCR1_T);
@@ -1666,7 +1723,9 @@
struct t4_span *ts = wc->tspans[chan->span->offset];
unsigned long flags;
- if(debug & DEBUG_RBS) printk(KERN_DEBUG "Setting bits to %d on channel %s\n", bits, chan->name);
+ if (debug & DEBUG_RBS)
+ dev_notice(&wc->dev->dev, "Setting bits to %d on channel %s\n",
+ bits, chan->name);
spin_lock_irqsave(&wc->reglock, flags);
k = chan->span->offset;
if (ts->spantype == TYPE_E1) { /* do it E1 way */
@@ -1708,7 +1767,7 @@
}
spin_unlock_irqrestore(&wc->reglock, flags);
if (debug & DEBUG_RBS)
- printk(KERN_DEBUG "Finished setting RBS bits\n");
+ dev_notice(&wc->dev->dev, "Finished setting RBS bits\n");
return 0;
}
@@ -1722,11 +1781,14 @@
tspan = span->offset + 1;
if (tspan < 0) {
- printk(KERN_NOTICE "T%dXXP: Span '%d' isn't us?\n", wc->numspans, span->spanno);
+ dev_notice(&wc->dev->dev, "T%dXXP: Span '%d' isn't us?\n",
+ wc->numspans, span->spanno);
return -1;
}
- if (debug & DEBUG_MAIN) printk(KERN_DEBUG "Shutting down span %d (%s)\n", span->spanno, span->name);
+ if (debug & DEBUG_MAIN)
+ dev_notice(&wc->dev->dev, "Shutting down span %d (%s)\n",
+ span->spanno, span->name);
/* Stop HDLC controller if runned */
if (ts->sigchan)
@@ -1747,7 +1809,8 @@
(!(wc->tspans[0]->span.flags & DAHDI_FLAG_RUNNING)) &&
(!(wc->tspans[1]->span.flags & DAHDI_FLAG_RUNNING)))) {
/* No longer in use, disable interrupts */
- printk(KERN_INFO "TE%dXXP: Disabling interrupts since there are no active spans\n", wc->numspans);
+ dev_info(&wc->dev->dev, "TE%dXXP: Disabling interrupts since "
+ "there are no active spans\n", wc->numspans);
set_bit(T4_STOP_DMA, &wc->checkflag);
} else
set_bit(T4_CHECK_TIMING, &wc->checkflag);
@@ -1760,7 +1823,8 @@
wc->spansstarted--;
if (debug & DEBUG_MAIN)
- printk(KERN_DEBUG "Span %d (%s) shutdown\n", span->spanno, span->name);
+ dev_notice(&wc->dev->dev, "Span %d (%s) shutdown\n",
+ span->spanno, span->name);
return 0;
}
@@ -1770,9 +1834,11 @@
struct t4_span *ts = container_of(span, struct t4_span, span);
struct t4 *wc = ts->owner;
- printk(KERN_INFO "About to enter spanconfig!\n");
+ if (debug)
+ dev_info(&wc->dev->dev, "About to enter spanconfig!\n");
if (debug & DEBUG_MAIN)
- printk(KERN_DEBUG "TE%dXXP: Configuring span %d\n", wc->numspans, span->spanno);
+ dev_notice(&wc->dev->dev, "TE%dXXP: Configuring span %d\n",
+ wc->numspans, span->spanno);
if (lc->sync < 0)
lc->sync = 0;
@@ -1802,7 +1868,8 @@
if (span->flags & DAHDI_FLAG_RUNNING)
return t4_startup(span);
- printk(KERN_INFO "Done with spanconfig!\n");
+ if (debug)
+ dev_info(&wc->dev->dev, "Done with spanconfig!\n");
return 0;
}
@@ -1816,9 +1883,13 @@
alreadyrunning = ts->span.flags & DAHDI_FLAG_RUNNING;
if (debug & DEBUG_MAIN) {
if (alreadyrunning)
- printk(KERN_DEBUG "TE%dXXP: Reconfigured channel %d (%s) sigtype %d\n", wc->numspans, chan->channo, chan->name, sigtype);
+ dev_notice(&wc->dev->dev, "TE%dXXP: Reconfigured "
+ "channel %d (%s) sigtype %d\n", wc->numspans,
+ chan->channo, chan->name, sigtype);
else
- printk(KERN_DEBUG "TE%dXXP: Configured channel %d (%s) sigtype %d\n", wc->numspans, chan->channo, chan->name, sigtype);
+ dev_notice(&wc->dev->dev, "TE%dXXP: Configured channel"
+ " %d (%s) sigtype %d\n", wc->numspans,
+ chan->channo, chan->name, sigtype);
}
spin_lock_irqsave(&wc->reglock, flags);
@@ -1831,13 +1902,18 @@
/* (re)configure signalling channel */
if ((sigtype == DAHDI_SIG_HARDHDLC) || (ts->sigchan == chan)) {
if (debug & DEBUG_FRAMER)
- printk(KERN_DEBUG "%sonfiguring hardware HDLC on %s\n", ((sigtype == DAHDI_SIG_HARDHDLC) ? "C" : "Unc"), chan->name);
+ dev_notice(&wc->dev->dev, "%sonfiguring hardware HDLC "
+ "on %s\n",
+ ((sigtype == DAHDI_SIG_HARDHDLC) ? "C" : "Unc"),
+ chan->name);
if (alreadyrunning) {
if (ts->sigchan)
hdlc_stop(wc, ts->sigchan->span->offset);
if (sigtype == DAHDI_SIG_HARDHDLC) {
if (hdlc_start(wc, chan->span->offset, chan, ts->sigmode)) {
- printk(KERN_NOTICE "Error initializing signalling controller\n");
+ dev_notice(&wc->dev->dev, "Error "
+ "initializing signalling "
+ "controller\n");
return -1;
}
} else {
@@ -2039,7 +2115,9 @@
{
if (!wc->globalconfig) {
wc->globalconfig = 1;
- printk(KERN_INFO "TE%dXXP: Setting up global serial parameters\n", wc->numspans);
+ if (debug)
+ dev_info(&wc->dev->dev, "TE%dXXP: Setting up global "
+ "serial parameters\n", wc->numspans);
t4_framer_out(wc, 0, 0x85, 0xe0); /* GPC1: Multiplex mode enabled, FSC is output, active low, RCLK from channel 0 */
t4_framer_out(wc, 0, 0x08, 0x01); /* IPC: Interrupt push/pull active low */
@@ -2090,7 +2168,8 @@
}
t4_framer_out(wc, unit, 0x84, 0x01); /* PC5: XMFS active low, SCLKR is input, RCLK is output */
if (debug & DEBUG_MAIN)
- printk(KERN_DEBUG "Successfully initialized serial bus for unit %d\n", unit);
+ dev_notice(&wc->dev->dev, "Successfully initialized serial "
+ "bus for unit %d\n", unit);
}
static int syncsrc = 0;
@@ -2143,7 +2222,8 @@
int i;
/* update sync src info */
if (wc->syncsrc != syncsrc) {
- printk(KERN_INFO "Swapping card %d from %d to %d\n", wc->num, wc->syncsrc, syncsrc);
+ dev_info(&wc->dev->dev, "Swapping card %d from %d to %d\n",
+ wc->num, wc->syncsrc, syncsrc);
wc->syncsrc = syncsrc;
/* Update sync sources */
for (i = 0; i < wc->numspans; i++) {
@@ -2152,10 +2232,14 @@
if (syncnum == wc->num) {
__t4_set_rclk_src(wc, syncspan-1);
__t4_set_sclk_src(wc, WC_RECOVER, 1, 0);
- if (debug) printk(KERN_DEBUG "Card %d, using sync span %d, master\n", wc->num, syncspan);
+ if (debug)
+ dev_notice(&wc->dev->dev, "Card %d, using sync "
+ "span %d, master\n", wc->num, syncspan);
} else {
__t4_set_sclk_src(wc, WC_RECOVER, 0, 1);
- if (debug) printk(KERN_DEBUG "Card %d, using Timing Bus, NOT master\n", wc->num);
+ if (debug)
+ dev_notice(&wc->dev->dev, "Card %d, using "
+ "Timing Bus, NOT master\n", wc->num);
}
}
}
@@ -2202,7 +2286,12 @@
}
found:
if ((syncnum != newsyncnum) || (syncsrc != newsyncsrc) || (newsyncspan != syncspan)) {
- if (debug) printk(KERN_DEBUG "New syncnum: %d (was %d), syncsrc: %d (was %d), syncspan: %d (was %d)\n", newsyncnum, syncnum, newsyncsrc, syncsrc, newsyncspan, syncspan);
+ if (debug)
+ dev_notice(&wc->dev->dev, "New syncnum: %d "
+ "(was %d), syncsrc: %d (was %d), "
+ "syncspan: %d (was %d)\n", newsyncnum,
+ syncnum, newsyncsrc, syncsrc,
+ newsyncspan, syncspan);
syncnum = newsyncnum;
syncsrc = newsyncsrc;
syncspan = newsyncspan;
@@ -2223,19 +2312,23 @@
int firstprio, secondprio;
firstprio = secondprio = 4;
- dev_info(&wc->dev->dev, "timing source auto\n");
+ if (debug)
+ dev_info(&wc->dev->dev, "timing source auto\n");
clear_bit(T4_CHECK_TIMING, &wc->checkflag);
if (timingcable) {
__t4_findsync(wc);
} else {
- dev_info(&wc->dev->dev, "Evaluating spans for timing source\n");
+ if (debug)
+ dev_info(&wc->dev->dev, "Evaluating spans for timing "
+ "source\n");
for (x=0;x<wc->numspans;x++) {
if ((wc->tspans[x]->span.flags & DAHDI_FLAG_RUNNING) &&
!(wc->tspans[x]->span.alarms & (DAHDI_ALARM_RED |
DAHDI_ALARM_BLUE))) {
- dev_info(&wc->dev->dev, "span %d is green : "\
- "syncpos %d\n",
- x+1, wc->tspans[x]->syncpos);
+ if (debug)
+ dev_info(&wc->dev->dev, "span %d is "
+ "green : syncpos %d\n", x+1,
+ wc->tspans[x]->syncpos);
if (wc->tspans[x]->syncpos) {
/* Valid rsync source in recovered
timing mode */
@@ -2324,7 +2417,8 @@
if (wc->falc31) {
if (debug)
- printk(KERN_INFO "card %d span %d: setting Rtx to 0ohm for T1\n", wc->num, unit);
+ dev_info(&wc->dev->dev, "card %d span %d: setting Rtx "
+ "to 0ohm for T1\n", wc->num, unit);
__t4_framer_out(wc, unit, 0x86, 0x00); /* PC6: set Rtx to 0ohm for T1 */
// Hitting the bugfix register to fix errata #3
@@ -2367,7 +2461,8 @@
__t4_framer_out(wc, unit, 0x17, 0x34); /* IMR3: AIS and friends */
__t4_framer_out(wc, unit, 0x18, 0x3f); /* IMR4: Slips on transmit */
- printk(KERN_INFO "TE%dXXP: Span %d configured for %s/%s\n", wc->numspans, unit + 1, framing, line);
+ dev_info(&wc->dev->dev, "Span %d configured for %s/%s\n", unit + 1,
+ framing, line);
}
static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
@@ -2415,7 +2510,8 @@
if (wc->falc31) {
if (debug)
- printk(KERN_INFO "setting Rtx to 7.5ohm for E1\n");
+ dev_info(&wc->dev->dev,
+ "setting Rtx to 7.5ohm for E1\n");
__t4_framer_out(wc, unit, 0x86, 0x40); /* PC6: turn on 7.5ohm Rtx for E1 */
}
@@ -2453,7 +2549,8 @@
__t4_framer_out(wc, unit, 0x17, 0x04 | imr3extra); /* IMR3: AIS */
__t4_framer_out(wc, unit, 0x18, 0x3f); /* IMR4: We care about slips on transmit */
- printk(KERN_INFO "TE%dXXP: Span %d configured for %s/%s%s\n", wc->numspans, unit + 1, framing, line, crc4);
+ dev_info(&wc->dev->dev, "TE%dXXP: Span %d configured for %s/%s%s\n",
+ wc->numspans, unit + 1, framing, line, crc4);
}
static int t4_startup(struct dahdi_span *span)
@@ -2468,10 +2565,12 @@
struct t4 *wc = ts->owner;
set_bit(T4_IGNORE_LATENCY, &wc->checkflag);
- printk(KERN_INFO "About to enter startup!\n");
+ if (debug)
+ dev_info(&wc->dev->dev, "About to enter startup!\n");
tspan = span->offset + 1;
if (tspan < 0) {
- printk(KERN_INFO "TE%dXXP: Span '%d' isn't us?\n", wc->numspans, span->spanno);
+ dev_info(&wc->dev->dev, "TE%dXXP: Span '%d' isn't us?\n",
+ wc->numspans, span->spanno);
return -1;
}
@@ -2533,7 +2632,8 @@
spin_unlock_irqrestore(&wc->reglock, flags);
if (hdlc_start(wc, span->offset, sigchan, ts->sigmode)) {
- printk(KERN_NOTICE "Error initializing signalling controller\n");
+ dev_notice(&wc->dev->dev, "Error initializing "
+ "signalling controller\n");
return -1;
}
spin_lock_irqsave(&wc->reglock, flags);
@@ -2544,11 +2644,19 @@
t4_check_alarms(wc, span->offset);
t4_check_sigbits(wc, span->offset);
- if (wc->tspans[0]->sync == span->spanno) printk(KERN_INFO "SPAN %d: Primary Sync Source\n",span->spanno);
- if (wc->tspans[1]->sync == span->spanno) printk(KERN_INFO "SPAN %d: Secondary Sync Source\n",span->spanno);
+ if (wc->tspans[0]->sync == span->spanno)
+ dev_info(&wc->dev->dev, "SPAN %d: Primary Sync Source\n",
+ span->spanno);
+ if (wc->tspans[1]->sync == span->spanno)
+ dev_info(&wc->dev->dev, "SPAN %d: Secondary Sync Source\n",
+ span->spanno);
if (wc->numspans == 4) {
- if (wc->tspans[2]->sync == span->spanno) printk(KERN_INFO "SPAN %d: Tertiary Sync Source\n",span->spanno);
- if (wc->tspans[3]->sync == span->spanno) printk(KERN_INFO "SPAN %d: Quaternary Sync Source\n",span->spanno);
+ if (wc->tspans[2]->sync == span->spanno)
+ dev_info(&wc->dev->dev, "SPAN %d: Tertiary Sync Source"
+ "\n", span->spanno);
+ if (wc->tspans[3]->sync == span->spanno)
+ dev_info(&wc->dev->dev, "SPAN %d: Quaternary Sync "
+ "Source\n", span->spanno);
}
#ifdef VPM_SUPPORT
if (!alreadyrunning && !wc->vpm) {
@@ -2562,7 +2670,8 @@
set_span_devicetype(wc);
}
#endif
- printk(KERN_INFO "Completed startup!\n");
+ if (debug)
+ dev_info(&wc->dev->dev, "Completed startup!\n");
clear_bit(T4_IGNORE_LATENCY, &wc->checkflag);
return 0;
}
@@ -2586,7 +2695,8 @@
if (wc->numspans == 4)
wc->tspans[2]->e1check = wc->tspans[3]->e1check = 0;
if (debug & DEBUG_MAIN)
- printk(KERN_DEBUG "Detected loss of E1 alignment on span %d!\n", span);
+ dev_notice(&wc->dev->dev, "Detected loss of "
+ "E1 alignment on span %d!\n", span);
t4_reset_dma(wc);
}
}
@@ -2617,7 +2727,8 @@
for (x=0;x<wc->numspans;x++)
wc->tspans[x]->irqmisses++;
if (debug & DEBUG_MAIN)
- printk(KERN_DEBUG "TE%dXXP: Double/missed interrupt detected\n", wc->numspans);
+ dev_notice(&wc->dev->dev, "TE%dXXP: Double/missed "
+ "interrupt detected\n", wc->numspans);
}
for (x=0;x<DAHDI_CHUNKSIZE;x++) {
for (z=0;z<24;z++) {
@@ -2810,7 +2921,8 @@
struct t4_span *ts = wc->tspans[span];
if (debug & DEBUG_RBS)
- printk(KERN_DEBUG "Checking sigbits on span %d\n", span + 1);
+ dev_notice(&wc->dev->dev, "Checking sigbits on span %d\n",
+ span + 1);
if (!(ts->span.flags & DAHDI_FLAG_RUNNING))
return;
@@ -2906,7 +3018,8 @@
if (!(ts->spanflags & FLAG_NMF)) {
__t4_framer_out(wc, span, 0x20, 0x9f | 0x20); /* LIM0: Force RAI High */
ts->spanflags |= FLAG_NMF;
- printk(KERN_DEBUG "NMF workaround on!\n");
+ dev_notice(&wc->dev->dev,
+ "NMF workaround on!\n");
}
__t4_framer_out(wc, span, 0x1e, 0xc3); /* Reset to CRC4 mode */
__t4_framer_out(wc, span, 0x1c, 0xf2); /* Force Resync */
@@ -2915,7 +3028,8 @@
if ((ts->spanflags & FLAG_NMF)) {
__t4_framer_out(wc, span, 0x20, 0x9f); /* LIM0: Clear forced RAI */
ts->spanflags &= ~FLAG_NMF;
- printk(KERN_DEBUG "NMF workaround off!\n");
+ dev_notice(&wc->dev->dev,
+ "NMF workaround off!\n");
}
}
} else {
@@ -2962,9 +3076,10 @@
} else {
if (unlikely(debug && !ts->alarmcount)) {
/* starting to debounce LOF/LFA */
- printk(KERN_INFO "wct%dxxp: LOF/LFA detected "
- "on span %d but debouncing for %d ms\n",
- wc->numspans, span + 1, alarmdebounce);
+ dev_info(&wc->dev->dev, "wct%dxxp: LOF/LFA "
+ "detected on span %d but debouncing "
+ "for %d ms\n", wc->numspans, span + 1,
+ alarmdebounce);
}
ts->alarmcount++;
}
@@ -2982,9 +3097,10 @@
} else {
if (unlikely(debug && !ts->losalarmcount)) {
/* starting to debounce LOS */
- printk(KERN_INFO "wct%dxxp: LOS detected on "
- "span %d but debouncing for %d ms\n",
- wc->numspans, span + 1, losalarmdebounce);
+ dev_info(&wc->dev->dev, "wct%dxxp: LOS "
+ "detected on span %d but debouncing "
+ "for %d ms\n", wc->numspans,
+ span + 1, losalarmdebounce);
}
ts->losalarmcount++;
}
@@ -2998,9 +3114,10 @@
else {
if (unlikely(debug && !ts->aisalarmcount)) {
/* starting to debounce AIS */
- printk(KERN_INFO "wct%dxxp: AIS detected on "
- "span %d but debouncing for %d ms\n",
- wc->numspans, span + 1, aisalarmdebounce);
+ dev_info(&wc->dev->dev, "wct%dxxp: AIS "
+ "detected on span %d but debouncing "
+ "for %d ms\n", wc->numspans,
+ span + 1, aisalarmdebounce);
}
ts->aisalarmcount++;
}
@@ -3067,9 +3184,9 @@
else {
if (unlikely(debug && !ts->yelalarmcount)) {
/* starting to debounce AIS */
- printk(KERN_INFO "wct%dxxp: yelllow (RAI) "
- "detected on span %d but debouncing "
- "for %d ms\n",
+ dev_info(&wc->dev->dev, "wct%dxxp: yellow "
+ "(RAI) detected on span %d but "
+ "debouncing for %d ms\n",
wc->numspans, span + 1,
yelalarmdebounce);
}
@@ -3215,7 +3332,7 @@
if (isr3 & 0x08) {
reg = t4_framer_in(wc, span, FRS1_T);
- printk(KERN_INFO "FRS1: %d\n", reg);
+ dev_info(&wc->dev->dev, "FRS1: %d\n", reg);
if (reg & LLBDD) {
dev_info(&wc->dev->dev, "Line loop-back activation "\
"signal detected with status: %01d "\
@@ -3232,14 +3349,8 @@
t4_check_alarms(wc, span);
} else {
/* T1 checks */
- if (isr2 || (isr3 & 0x08)) {
- if (debug & DEBUG_MAIN) {
- dev_info(&wc->dev->dev,
- "span %d: isr2=%x isr3=%x\n",
- span, isr2, isr3);
- }
- t4_check_alarms(wc, span);
- }
+ if (isr2 || (isr3 & 0x08))
+ t4_check_alarms(wc, span);
}
if (!ts->span.alarms) {
if ((isr3 & 0x3) || (isr4 & 0xc0))
@@ -3247,13 +3358,21 @@
if (debug & DEBUG_MAIN) {
if (isr3 & 0x02)
- printk(KERN_DEBUG "TE%d10P: RECEIVE slip NEGATIVE on span %d\n", wc->numspans, span + 1);
+ dev_notice(&wc->dev->dev, "TE%d10P: RECEIVE "
+ "slip NEGATIVE on span %d\n",
+ wc->numspans, span + 1);
if (isr3 & 0x01)
- printk(KERN_DEBUG "TE%d10P: RECEIVE slip POSITIVE on span %d\n", wc->numspans, span + 1);
+ dev_notice(&wc->dev->dev, "TE%d10P: RECEIVE "
+ "slip POSITIVE on span %d\n",
+ wc->numspans, span + 1);
if (isr4 & 0x80)
- printk(KERN_DEBUG "TE%dXXP: TRANSMIT slip POSITIVE on span %d\n", wc->numspans, span + 1);
+ dev_notice(&wc->dev->dev, "TE%dXXP: TRANSMIT "
+ "slip POSITIVE on span %d\n",
+ wc->numspans, span + 1);
if (isr4 & 0x40)
- printk(KERN_DEBUG "TE%d10P: TRANSMIT slip NEGATIVE on span %d\n", wc->numspans, span + 1);
+ dev_notice(&wc->dev->dev, "TE%d10P: TRANSMIT "
+ "slip NEGATIVE on span %d\n",
+ wc->numspans, span + 1);
}
} else
ts->span.timingslips = 0;
@@ -3270,7 +3389,10 @@
if (isr0 & FRMR_ISR0_RME) {
readsize = (t4_framer_in(wc, span, FRMR_RBCH) << 8) | t4_framer_in(wc, span, FRMR_RBCL);
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Received data length is %d (%d)\n", readsize, readsize & FRMR_RBCL_MAX_SIZE);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Received data length is %d "
+ "(%d)\n", readsize,
+ readsize & FRMR_RBCL_MAX_SIZE);
/* RPF isn't set on last part of frame */
if ((readsize > 0) && ((readsize &= FRMR_RBCL_MAX_SIZE) == 0))
readsize = FRMR_RBCL_MAX_SIZE + 1;
@@ -3281,7 +3403,10 @@
int i;
unsigned char readbuf[FRMR_RBCL_MAX_SIZE + 1];
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Framer %d: Got RPF/RME! readsize is %d\n", sigchan->span->offset, readsize);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Framer %d: Got RPF/RME! "
+ "readsize is %d\n", sigchan->span->offset,
+ readsize);
for (i = 0; i < readsize; i++)
readbuf[i] = t4_framer_in(wc, span, FRMR_RXFIFO);
@@ -3290,10 +3415,11 @@
t4_framer_cmd_wait(wc, span, FRMR_CMDR_RMC);
if (debug & DEBUG_FRAMER) {
- printk(KERN_DEBUG "RX(");
+ dev_notice(&wc->dev->dev, "RX(");
for (i = 0; i < readsize; i++)
- printk(KERN_DEBUG "%s%02x", i ? " " : "", readbuf[i]);
- printk(KERN_DEBUG ")\n");
+ dev_notice(&wc->dev->dev, "%s%02x",
+ (i ? " " : ""), readbuf[i]);
+ dev_notice(&wc->dev->dev, ")\n");
}
if (isr0 & FRMR_ISR0_RME) {
@@ -3311,24 +3437,42 @@
++ts->frames_in;
if ((debug & DEBUG_FRAMER) && !(ts->frames_in & 0x0f))
- printk(KERN_DEBUG "Received %d frames on span %d\n", ts->frames_in, span);
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Received HDLC frame %d. RSIS = 0x%x (%x)\n", ts->frames_in, rsis, rsis_reg);
+ dev_notice(&wc->dev->dev, "Received %d frames "
+ "on span %d\n", ts->frames_in, span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Received HDLC frame"
+ " %d. RSIS = 0x%x (%x)\n",
+ ts->frames_in, rsis, rsis_reg);
if (!(rsis & FRMR_RSIS_CRC16)) {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "CRC check failed %d\n", span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "CRC check "
+ "failed %d\n", span);
dahdi_hdlc_abort(sigchan, DAHDI_EVENT_BADFCS);
} else if (rsis & FRMR_RSIS_RAB) {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "ABORT of current frame due to overflow %d\n", span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "ABORT of "
+ "current frame due to "
+ "overflow %d\n", span);
dahdi_hdlc_abort(sigchan, DAHDI_EVENT_ABORT);
} else if (rsis & FRMR_RSIS_RDO) {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "HDLC overflow occured %d\n", span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "HDLC "
+ "overflow occured %d\n",
+ span);
dahdi_hdlc_abort(sigchan, DAHDI_EVENT_OVERRUN);
} else if (!(rsis & FRMR_RSIS_VFR)) {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Valid Frame check failed on span %d\n", span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Valid Frame"
+ " check failed on span %d\n",
+ span);
dahdi_hdlc_abort(sigchan, DAHDI_EVENT_ABORT);
} else {
dahdi_hdlc_putbuf(sigchan, readbuf, readsize - 1);
dahdi_hdlc_finish(sigchan);
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Received valid HDLC frame on span %d\n", span);
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Received "
+ "valid HDLC frame on span %d"
+ "\n", span);
}
#if 0
debug = olddebug;
@@ -3339,18 +3483,24 @@
/* Transmit side */
if (isr1 & FRMR_ISR1_XDU) {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "XDU: Resetting signal controler!\n");
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "XDU: Resetting signal "
+ "controller!\n");
t4_framer_cmd_wait(wc, span, FRMR_CMDR_SRES);
} else if (isr1 & FRMR_ISR1_XPR) {
if (debug & DEBUG_FRAMER)
- printk(KERN_DEBUG "Sigchan %d is %p\n", sigchan->chanpos, sigchan);
-
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "Framer %d: Got XPR!\n", sigchan->span->offset);
+ dev_notice(&wc->dev->dev, "Sigchan %d is %p\n",
+ sigchan->chanpos, sigchan);
+
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "Framer %d: Got XPR!\n",
+ sigchan->span->offset);
t4_hdlc_xmit_fifo(wc, span, ts);
}
if (isr1 & FRMR_ISR1_ALLS) {
- if (debug & DEBUG_FRAMER) printk(KERN_DEBUG "ALLS received\n");
+ if (debug & DEBUG_FRAMER)
+ dev_notice(&wc->dev->dev, "ALLS received\n");
}
}
@@ -3366,7 +3516,7 @@
#if 0
if (wc->intcount < 20)
- printk(KERN_DEBUG "Pre-interrupt\n");
+ dev_notice(&wc->dev->dev, "Pre-interrupt\n");
#endif
/* Make sure it's really for us */
@@ -3388,14 +3538,15 @@
__t4_pci_out(wc, WC_INTR, 0);
if (!wc->spansstarted) {
- printk(KERN_NOTICE "Not prepped yet!\n");
+ dev_notice(&wc->dev->dev, "Not prepped yet!\n");
return IRQ_NONE;
}
wc->intcount++;
#if 0
if (wc->intcount < 20)
- printk(KERN_DEBUG "Got interrupt, status = %08x\n", status);
+ dev_notice(&wc->dev->dev, "Got interrupt, status = %08x\n",
+ status);
#endif
if (status & 0x3) {
@@ -3406,10 +3557,11 @@
#if 0
if ((wc->intcount < 10) || !(wc->intcount % 1000)) {
status2 = t4_framer_in(wc, 0, FRMR_CIS);
- printk(KERN_DEBUG "Status2: %04x\n", status2);
+ dev_notice(&wc->dev->dev, "Status2: %04x\n", status2);
for (x = 0;x<wc->numspans;x++) {
status2 = t4_framer_in(wc, x, FRMR_FRS0);
- printk(KERN_DEBUG "FRS0/%d: %04x\n", x, status2);
+ dev_notice(&wc->dev->dev, "FRS0/%d: %04x\n", x,
+ status2);
}
}
#endif
@@ -3454,7 +3606,8 @@
(unsigned int *)pci_alloc_consistent(wc->dev, numbufs * T4_BASE_SIZE * 2, &writedma);
if (!alloc) {
- printk(KERN_NOTICE "wct%dxxp: Unable to allocate DMA-able memory\n", wc->numspans);
+ dev_notice(&wc->dev->dev, "wct%dxxp: Unable to allocate "
+ "DMA-able memory\n", wc->numspans);
return -ENOMEM;
}
@@ -3478,7 +3631,9 @@
memset((void *)wc->writechunk,0x00, T4_BASE_SIZE * numbufs);
memset((void *)wc->readchunk,0xff, T4_BASE_SIZE * numbufs);
- printk(KERN_NOTICE "DMA memory base of size %d at %p. Read: %p and Write %p\n", numbufs * T4_BASE_SIZE * 2, wc->writechunk, wc->readchunk, wc->writechunk);
+ dev_notice(&wc->dev->dev, "DMA memory base of size %d at %p. Read: "
+ "%p and Write %p\n", numbufs * T4_BASE_SIZE * 2,
+ wc->writechunk, wc->readchunk, wc->writechunk);
return 0;
}
@@ -3501,7 +3656,8 @@
oldbufs = wc->numbufs;
if (t4_allocate_buffers(wc, newlatency, &oldalloc, &oldaddr)) {
- printk("Error allocating latency buffers for latency of %d\n", newlatency);
+ dev_info(&wc->dev->dev, "Error allocating latency buffers for "
+ "latency of %d\n", newlatency);
__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
spin_unlock_irqrestore(&wc->reglock, flags);
return;
@@ -3524,7 +3680,7 @@
pci_free_consistent(wc->dev, T4_BASE_SIZE * oldbufs * 2, (void *)oldalloc, oldaddr);
- printk("Increased latency to %d\n", newlatency);
+ dev_info(&wc->dev->dev, "Increased latency to %d\n", newlatency);
}
@@ -3591,7 +3747,7 @@
#endif
if (unlikely(!wc->spansstarted)) {
- printk(KERN_INFO "Not prepped yet!\n");
+ dev_info(&wc->dev->dev, "Not prepped yet!\n");
return IRQ_NONE;
}
@@ -3605,10 +3761,13 @@
int smallest_max;
if (debug & DEBUG_MAIN)
- printk("!!! Missed interrupt. Expected ident of %d and got ident of %d\n", expected, rxident);
+ dev_warn(&wc->dev->dev, "Missed interrupt. "
+ "Expected ident of %d and got ident "
+ "of %d\n", expected, rxident);
if (test_bit(T4_IGNORE_LATENCY, &wc->checkflag)) {
- printk("Should have ignored latency\n");
+ dev_info(&wc->dev->dev,
+ "Should have ignored latency\n");
}
if (rxident > wc->rxident) {
needed_latency = rxident - wc->rxident;
@@ -3621,14 +3780,18 @@
smallest_max = (max_latency >= GEN5_MAX_LATENCY) ? GEN5_MAX_LATENCY : max_latency;
if (needed_latency > smallest_max) {
- printk("Truncating latency request to %d instead of %d\n", smallest_max, needed_latency);
+ dev_info(&wc->dev->dev, "Truncating latency "
+ "request to %d instead of %d\n",
+ smallest_max, needed_latency);
needed_latency = smallest_max;
}
if (needed_latency > wc->numbufs) {
int x;
- printk("Need to increase latency. Estimated latency should be %d\n", needed_latency);
+ dev_info(&wc->dev->dev, "Need to increase "
+ "latency. Estimated latency should "
+ "be %d\n", needed_latency);
for (x = 0; x < wc->numspans; x++)
wc->tspans[x]->span.irqmisses++;
wc->needed_latency = needed_latency;
@@ -3643,7 +3806,8 @@
if (unlikely((wc->intcount < 20)))
- printk(KERN_INFO "2G: Got interrupt, status = %08x, CIS = %04x\n", status, t4_framer_in(wc, 0, FRMR_CIS));
[... 391 lines stripped ...]
More information about the dahdi-commits
mailing list