[dahdi-commits] tzafrir: linux/trunk r10479 - /linux/trunk/drivers/dahdi/xpp/card_fxs.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Thu Mar 15 07:53:11 CDT 2012
Author: tzafrir
Date: Thu Mar 15 07:53:07 2012
New Revision: 10479
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10479
Log:
xpp: FXS: improve fxs_info output layout
* Rotate the channels table in /proc/xpp/XBUS-*/XPD-*/fxs_info
- This way we don't overflow 80 columns
- Can also add more info items per-channel
* Linearize LED output for easier grep'ping
Signed-off-by: Oron Peled <oron.peled at xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Modified:
linux/trunk/drivers/dahdi/xpp/card_fxs.c
Modified: linux/trunk/drivers/dahdi/xpp/card_fxs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxs.c?view=diff&rev=10479&r1=10478&r2=10479
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxs.c Thu Mar 15 07:53:07 2012
@@ -1687,26 +1687,43 @@
spin_lock_irqsave(&xpd->lock, flags);
priv = xpd->priv;
BUG_ON(!priv);
- len +=
- sprintf(page + len, "%-8s %-10s %-10s %-10s %-10s %-10s\n",
- "Channel", "idletxhookstate", "lasttxhook", "ohttimer",
- "neon_blinking", "search_fsk_pattern");
- for_each_line(xpd, i) {
- char pref;
+ len += sprintf(page + len, "%-12s", "Channel:");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%4d", i);
+ }
+ len += sprintf(page + len, "\n%-12s", "");
+ for_each_line(xpd, i) {
+ char *chan_type;
if (IS_SET(PHONEDEV(xpd).digital_outputs, i))
- pref = 'O';
+ chan_type = "out";
else if (IS_SET(PHONEDEV(xpd).digital_inputs, i))
- pref = 'I';
+ chan_type = "in";
else
- pref = ' ';
- len +=
- sprintf(page + len, "%c%7d %10d %10d %10d %10d %10d\n",
- pref, i, priv->idletxhookstate[i],
- priv->lasttxhook[i], priv->ohttimer[i],
- IS_SET(priv->neon_blinking, i),
- IS_SET(priv->search_fsk_pattern, i)
- );
+ chan_type = "";
+ len += sprintf(page + len, "%4s", chan_type);
+ }
+ len += sprintf(page + len, "\n%-12s", "idletxhook:");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%4d", priv->idletxhookstate[i]);
+ }
+ len += sprintf(page + len, "\n%-12s", "lasttxhook:");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%4d", priv->lasttxhook[i]);
+ }
+ len += sprintf(page + len, "\n%-12s", "ohttimer:");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%4d", priv->ohttimer[i]);
+ }
+ len += sprintf(page + len, "\n%-12s", "neon_blink:");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%4d",
+ IS_SET(priv->neon_blinking, i));
+ }
+ len += sprintf(page + len, "\n%-12s", "search_fsk:");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%4d",
+ IS_SET(priv->search_fsk_pattern, i));
}
len += sprintf(page + len, "\n%-12s", "vbat_h:");
for_each_line(xpd, i) {
@@ -1715,8 +1732,8 @@
}
len += sprintf(page + len, "\n");
for (led = 0; led < NUM_LEDS; led++) {
- len += sprintf(page + len, "LED #%d", led);
- len += sprintf(page + len, "\n\t%-17s: ", "ledstate");
+ len += sprintf(page + len, "\nLED #%d\t%-12s: ",
+ led, "ledstate");
for_each_line(xpd, i) {
if (!IS_SET(PHONEDEV(xpd).digital_outputs, i)
&& !IS_SET(PHONEDEV(xpd).digital_inputs, i))
@@ -1724,7 +1741,8 @@
sprintf(page + len, "%d ",
IS_SET(priv->ledstate[led], i));
}
- len += sprintf(page + len, "\n\t%-17s: ", "ledcontrol");
+ len += sprintf(page + len, "\nLED #%d\t%-12s: ",
+ led, "ledcontrol");
for_each_line(xpd, i) {
if (!IS_SET(PHONEDEV(xpd).digital_outputs, i)
&& !IS_SET(PHONEDEV(xpd).digital_inputs, i))
@@ -1732,7 +1750,8 @@
sprintf(page + len, "%d ",
IS_SET(priv->ledcontrol[led], i));
}
- len += sprintf(page + len, "\n\t%-17s: ", "led_counter");
+ len += sprintf(page + len, "\nLED #%d\t%-12s: ",
+ led, "led_counter");
for_each_line(xpd, i) {
if (!IS_SET(PHONEDEV(xpd).digital_outputs, i)
&& !IS_SET(PHONEDEV(xpd).digital_inputs, i))
@@ -1740,8 +1759,8 @@
sprintf(page + len, "%d ",
LED_COUNTER(priv, i, led));
}
- len += sprintf(page + len, "\n");
- }
+ }
+ len += sprintf(page + len, "\n");
spin_unlock_irqrestore(&xpd->lock, flags);
if (len <= off + count)
*eof = 1;
More information about the dahdi-commits
mailing list