summaryrefslogtreecommitdiff
path: root/xhfc
diff options
context:
space:
mode:
authorNoe Rubinstein <nrubinstein@proformatique.com>2011-01-21 16:03:23 +0100
committerNoe Rubinstein <nrubinstein@proformatique.com>2011-01-21 16:03:23 +0100
commit0eacb244d257646740014a45522d3d6cc0720b27 (patch)
tree2d0061f4236961d791904118d78899c7434273a6 /xhfc
parent13bc63167a1e61cf459e2ae929baa7de5c110259 (diff)
cosmetic
Diffstat (limited to 'xhfc')
-rw-r--r--xhfc/base.c68
-rw-r--r--xhfc/xhfc_st_state.c4
2 files changed, 46 insertions, 26 deletions
diff --git a/xhfc/base.c b/xhfc/base.c
index 7bb3538..42fb14b 100644
--- a/xhfc/base.c
+++ b/xhfc/base.c
@@ -70,8 +70,10 @@ MODULE_PARM_DESC(debug, "Debug bitfield:\n"
"\t8: timing\n"
"\t9: alarms\n");
MODULE_PARM_DESC(dbg_spanfilter, "bitfield, filter debug info by span.");
-MODULE_PARM_DESC(ntte, "bitfield, configuration of the physical ports. ex: 0x3 = 0 NT, 1 NT, 2 TE, 3 TE.");
-MODULE_PARM_DESC(softconf, "Configure the S/T port line interface in software.");
+MODULE_PARM_DESC(ntte, "bitfield, configuration of the physical ports. "
+ "ex: 0x3 = 0 NT, 1 NT, 2 TE, 3 TE.");
+MODULE_PARM_DESC(softconf,
+ "Configure the S/T port line interface in software.");
#ifdef USE_GPIO
MODULE_PARM_DESC(reset_gpio, "Reset the XHFC using this GPIO");
#endif
@@ -131,8 +133,10 @@ int xhfc_reset(struct xhfc *xhfc)
void xhfc_config_st(struct xhfc *x, int port, int nt)
{
- u8 r_su_sel, a_su_ctrl0, a_su_ctrl1, a_su_ctrl2, a_su_wr_sta, a_su_clk_dly;
- r_su_sel = a_su_ctrl0 = a_su_ctrl1 = a_su_ctrl2 = a_su_wr_sta = a_su_clk_dly = 0x00;
+ u8 r_su_sel, a_su_ctrl0, a_su_ctrl1, a_su_ctrl2, a_su_wr_sta,
+ a_su_clk_dly;
+ r_su_sel = a_su_ctrl0 = a_su_ctrl1 = a_su_ctrl2 = a_su_wr_sta =
+ a_su_clk_dly = 0x00;
SET_V_SU_SEL(r_su_sel, port);
SET_V_SU_MD(a_su_ctrl0, !!nt);
SET_V_B1_TX_EN(a_su_ctrl0, 1);
@@ -265,7 +269,8 @@ void xhfc_config_d_chan_on_fifo(struct xhfc *x, int fifo, int direction)
xhfc_waitbusy(x);
}
-void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot, int direction)
+void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot,
+ int direction)
{
u8 r_fifo, a_con_hdlc, r_slot, a_sl_cfg;
r_fifo = a_con_hdlc = r_slot = a_sl_cfg = 0x00;
@@ -274,7 +279,7 @@ void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot, int directio
SET_V_FIFO_NUM(r_fifo, fifo);
SET_V_REV(r_fifo, 1);
- SET_V_IFF(a_con_hdlc, 0); /* Ox7E as interframe fill -- not really used */
+ SET_V_IFF(a_con_hdlc, 0); /* Ox7E as interframe fill; not really used */
SET_V_HDLC_TRP(a_con_hdlc, 1); /* transparent mode */
SET_V_FIFO_IRQ(a_con_hdlc, 7); /* enable data transmission */
SET_V_DATA_FLOW(a_con_hdlc, 6); /* '110': ST <-> PCM */
@@ -284,7 +289,8 @@ void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot, int directio
SET_V_CH_SDIR(a_sl_cfg, direction);
SET_V_CH_SNUM(a_sl_cfg, fifo);
- SET_V_ROUT(a_sl_cfg, 3); /* '11': receive data from STIO1, output to STIO2 */
+ SET_V_ROUT(a_sl_cfg, 3); /* '11': receive data from STIO1,
+ * output to STIO2 */
write_xhfc(x, R_FIFO, r_fifo);
xhfc_waitbusy(x);
@@ -321,10 +327,11 @@ static void hdlc_signal_complete(struct xhfc_span *xhfc_span, u8 stat)
frames_in++;
if (stat != 0x00) {
if (DBG_HDLC && DBG_SPAN(xhfc_span)) {
- printk(KERN_NOTICE DRIVER_NAME "(port %d): STAT=0x%02x indicates "
- "frame %d problem: %s\n", portno(xhfc_span),
- stat, frames_in,
- (0xff == stat) ? "HDLC Abort" : "Bad FCS");
+ printk(KERN_NOTICE DRIVER_NAME "(port %d): STAT=0x%02x "
+ "indicates frame %d problem: %s\n",
+ portno(xhfc_span), stat, frames_in,
+ (0xff == stat) ?
+ "HDLC Abort" : "Bad FCS");
}
dahdi_hdlc_abort(xhfc_span->sigchan, (0xff == stat) ?
@@ -409,7 +416,8 @@ static int hdlc_rx_frame(struct xhfc_span *xhfc_span)
if (DBG_HDLC && DBG_SPAN(xhfc_span)) {
dbglen = 0;
for (i = 0; i < j; i++)
- dbglen += sprintf(debugbuf+dbglen, "%02x ", buf[i]);
+ dbglen += sprintf(debugbuf+dbglen, "%02x ",
+ buf[i]);
debugbuf[dbglen] = '\0';
printk(KERN_INFO DRIVER_NAME ": %s(fifo %d): "
@@ -546,7 +554,8 @@ void xhfc_hdlc_hard_xmit(struct dahdi_chan *chan)
* scheduled in a tasklet instead *
*****************************************************************************/
-#define fifo_test(reg, fifonum, dir) (reg[fifonum/4] & (1 << (((fifonum % 4) * 2) + dir)))
+#define fifo_test(reg, fifonum, dir) \
+ (reg[fifonum/4] & (1 << (((fifonum % 4) * 2) + dir)))
irqreturn_t xhfc_interrupt(int irq, void *dev_id, struct pt_regs* ptregs)
{
@@ -585,15 +594,18 @@ irqreturn_t xhfc_interrupt(int irq, void *dev_id, struct pt_regs* ptregs)
for (i = 0; i < SPANS_PER_CHIP; i++) {
struct xhfc_span* s = &xhfc->spans[i];
- if ((s->span.flags & DAHDI_FLAG_RUNNING) && s->sigchan &&
+ if ((s->span.flags & DAHDI_FLAG_RUNNING) &&
+ s->sigchan &&
s->span.alarms == DAHDI_ALARM_NONE) {
/* No need to loop, makes no sense to receive
* more than one HDLC frame per second.
*/
- if ( fifo_test(fifo_irq, dchan_fifo(s), RECEIVE) ||
- fifo_test(fifo_fill, dchan_fifo(s), RECEIVE))
-
+ int irq = fifo_test(fifo_irq, dchan_fifo(s),
+ RECEIVE);
+ int fill = fifo_test(fifo_fill, dchan_fifo(s),
+ RECEIVE);
+ if (irq || fill)
hdlc_rx_frame(s);
if (atomic_read(&s->hdlc_pending))
@@ -786,7 +798,8 @@ int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
xhfc_span = container_of(span, struct xhfc_span, span);
xhfc = xhfc_span->xhfc;
- xhfc_span_set_ntte(xhfc_span, lc->lineconfig & DAHDI_CONFIG_NTTE); /* xref2 */
+ /* xref2 */
+ xhfc_span_set_ntte(xhfc_span, lc->lineconfig & DAHDI_CONFIG_NTTE);
term = (lc->lineconfig & DAHDI_CONFIG_TERM) ? 1 : 0;
@@ -829,7 +842,8 @@ int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
int xhfc_chanconfig(struct dahdi_chan *chan, int sigtype)
{
int alreadyrunning;
- struct xhfc_span *xhfc_span = container_of(chan->span, struct xhfc_span, span);
+ struct xhfc_span *xhfc_span = container_of(chan->span, struct xhfc_span,
+ span);
int res;
alreadyrunning = xhfc_span->span.flags & DAHDI_FLAG_RUNNING;
@@ -871,7 +885,8 @@ int xhfc_chanconfig(struct dahdi_chan *chan, int sigtype)
return res;
}
-static int xhfc_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
+static int xhfc_ioctl(struct dahdi_chan *chan, unsigned int cmd,
+ unsigned long data)
{
return -ENOTTY;
}
@@ -919,7 +934,9 @@ void init_spans(struct xhfc* x)
xhfc_span->port = i;
xhfc_span->sigchan = NULL; /* conf'd in chanconfig (xref1) */
- xhfc_span_set_ntte(xhfc_span, ntte & (1 << i)); /* reconf'd in spanconfig (xref2) */
+ xhfc_span_set_ntte(xhfc_span, ntte & (1 << i)); /* reconf'd in
+ * spanconfig
+ * (xref2) */
/* All the timer stuff is done in the timer and state
* functions, not here. */
@@ -947,7 +964,8 @@ void init_spans(struct xhfc* x)
dahdi_span->alarms = DAHDI_ALARM_RED;
- init_waitqueue_head(&dahdi_span->maintq); /* kinda everyone does this */
+ init_waitqueue_head(&dahdi_span->maintq);
+ /* kinda everyone does this */
/* now initialize each channel in the span */
for (j=0; j < CHANS_PER_SPAN; j++) {
@@ -963,8 +981,10 @@ void init_spans(struct xhfc* x)
chan->sigcap = DAHDI_SIG_CLEAR | DAHDI_SIG_DACS;
}
chan->chanpos = j + 1;
- chan->writechunk = (void *)(xhfc_span->writechunk + j * DAHDI_CHUNKSIZE);
- chan->readchunk = (void *)(xhfc_span->readchunk + j * DAHDI_CHUNKSIZE);
+ chan->writechunk = (void*)(xhfc_span->writechunk +
+ j * DAHDI_CHUNKSIZE);
+ chan->readchunk = (void*)(xhfc_span->readchunk +
+ j * DAHDI_CHUNKSIZE);
}
}
}
diff --git a/xhfc/xhfc_st_state.c b/xhfc/xhfc_st_state.c
index 56084e7..358e73b 100644
--- a/xhfc/xhfc_st_state.c
+++ b/xhfc/xhfc_st_state.c
@@ -163,8 +163,8 @@ void deactivate_request(struct xhfc_span* s)
* - on deactivate requests stop the timer
* - T3 is stopped on going to state F7. I don't think it's possible to
* guarantee this; however except F2->F7 which can not happen when T3 is
- * running, every transition to F7 stops the timer, so there is no incoherent
- * behaviour;
+ * running, every transition to F7 stops the timer, so there is no
+ * incoherent behaviour;
* - Changing alarms in DAHDI, which will be done anyway. No point notifying
* something that lasts less that 1ms.
*/