summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoe Rubinstein <nrubinstein@proformatique.com>2010-12-03 10:57:01 +0100
committerNoe Rubinstein <nrubinstein@proformatique.com>2010-12-03 10:57:01 +0100
commitef1eb8ac473b7c160ea96039115473d993fe00d7 (patch)
tree5d4dbae50279d6aca092b724e1e8d92f53e3dade
parente79ecf45114ac7ddee989dac439867a3d3780655 (diff)
Fix spanno/port/port+1 confusion in traces
-rw-r--r--xhfc/xhfc.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/xhfc/xhfc.c b/xhfc/xhfc.c
index 7d9b2ed..f31d94d 100644
--- a/xhfc/xhfc.c
+++ b/xhfc/xhfc.c
@@ -302,12 +302,13 @@ void xhfc_config_data_flow(struct xhfc* x)
static void hdlc_signal_complete(struct xhfc_span *xhfc_span, u8 stat)
{
struct xhfc *xhfc = xhfc_span->xhfc;
+ struct dahdi_span *dahdi_span = &xhfc_span->span;
/* if STAT != 0, indicates bad frame */
if (stat != 0x00) {
if (DBG_HDLC && DBG_SPAN(xhfc_span)) {
xhfc_info(xhfc, "(span %d) STAT=0x%02x indicates "
- "frame problem: %s\n", xhfc_span->port + 1,
+ "frame problem: %s\n", dahdi_span->spanno,
stat,
(0xff == stat) ? "HDLC Abort" : "Bad FCS");
}
@@ -319,8 +320,8 @@ static void hdlc_signal_complete(struct xhfc_span *xhfc_span, u8 stat)
if (DBG_HDLC && DBG_SPAN(xhfc_span)) {
xhfc_info(xhfc,
"(span %d) Frame " /*"%d" */ "is good!\n",
- xhfc_span->port +
- 1 /*, xhfc_span->frames_in */ );
+ dahdi_span->spanno
+ /*, xhfc_span->frames_in */ );
}
dahdi_hdlc_finish(xhfc_span->sigchan);
}
@@ -447,6 +448,7 @@ static uint frames_out;
static int hdlc_tx_frame(struct xhfc_span *xhfc_span)
{
struct xhfc *x = xhfc_span->xhfc;
+ struct dahdi_span *dahdi_span = &xhfc_span->span;
int res, i, fifo;
int zlen;
int flen = -1;
@@ -503,13 +505,13 @@ static int hdlc_tx_frame(struct xhfc_span *xhfc_span)
xhfc_info(xhfc_span->xhfc,
"hdlc_tx_frame(span %d): DAHDI gave %d "
"bytes for FIFO %d (res = %d): %s\n",
- xhfc_span->port + 1,
+ dahdi_span->spanno,
size, fifo, res, debugbuf);
if (size && res != 0)
xhfc_info(xhfc_span->xhfc,
"Transmitted frame %d on span %d\n",
- frames_out - 1, xhfc_span->port);
+ frames_out - 1, dahdi_span->spanno);
}
return !res;
@@ -518,20 +520,16 @@ static int hdlc_tx_frame(struct xhfc_span *xhfc_span)
/* DAHDI calls this when it has data it wants to send to the HDLC controller */
void xhfc_hdlc_hard_xmit(struct dahdi_chan *chan)
{
- struct xhfc_span *xhfc_span;
- struct dahdi_span *dspan;
- struct xhfc *xhfc;
- int span;
+ struct dahdi_span *dahdi_span = chan->span;
+ struct xhfc_span *xhfc_span =
+ container_of(dahdi_span, struct xhfc_span, span);
+ struct xhfc *xhfc = xhfc_span->xhfc;
- dspan = chan->span;
- xhfc_span = container_of(dspan, struct xhfc_span, span);
- xhfc = xhfc_span->xhfc;
- span = xhfc_span->port;
if ((DBG_FOPS || DBG_HDLC) && DBG_SPAN(xhfc_span)) {
xhfc_info(xhfc, "hdlc_hard_xmit on chan %s (%i/%i), " \
"span=%i (sigchan=%p, chan=%p)\n", chan->name,
- chan->channo, chan->chanpos, span + 1,
+ chan->channo, chan->chanpos, dahdi_span->spanno,
xhfc_span->sigchan, chan);
}
@@ -769,7 +767,7 @@ int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
term = (lc->lineconfig & DAHDI_CONFIG_TERM) ? 1 : 0;
xhfc_info(xhfc, "xhfc: Configuring port %d span %d in %s " \
- "mode with termination resistance %s\n", xhfc_span->port,
+ "mode with termination resistance %s\n", xhfc_span->port + 1,
span->spanno, xhfc_span->nt ? "NT" : "TE",
term ? "ENABLED" : "DISABLED");
@@ -778,7 +776,7 @@ int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
xhfc_info(xhfc, "WARNING: This driver can't configure the ports yet, "
"expect problems if port %d isn't configured in %s "
- "mode.\n", xhfc_span->port, xhfc_span->nt ? "NT" : "TE");
+ "mode.\n", xhfc_span->port + 1, xhfc_span->nt ? "NT" : "TE");
if (lc->sync < 0) {
xhfc_info(xhfc, "Span %d has invalid sync priority (%d), " \