[dahdi-commits] rmeyerriecks: branch linux/rmeyerriecks/dahdi-linux-alarms r8839 - in /linux/...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Jun 29 16:10:37 CDT 2010
Author: rmeyerriecks
Date: Tue Jun 29 16:10:26 2010
New Revision: 8839
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8839
Log:
checkpatch formatting
Modified:
linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c
linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c
linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h
Modified: linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c?view=diff&rev=8839&r1=8838&r2=8839
==============================================================================
--- linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c Tue Jun 29 16:10:26 2010
@@ -3474,24 +3474,43 @@
for (x=1; x<maxspans; x++) {
if (spans[x] && !spans[x]->alarms && (spans[x]->flags & DAHDI_FLAG_RUNNING)) {
if (master != spans[x]) {
- module_printk(KERN_NOTICE, "Master changed to %s\n", spans[x]->name);
+ module_printk(KERN_NOTICE,
+ "Master changed to %s\n",
+ spans[x]->name);
}
master = spans[x];
break;
}
}
- /* XXX: Remove - Report more detailed alarms */
- if (span->alarms & DAHDI_ALARM_LOS)
- module_printk(KERN_NOTICE, "Span %d: Loss of signal\n", span->spanno);
- if (span->alarms & DAHDI_ALARM_LFA)
- module_printk(KERN_NOTICE, "Span %d: Loss of Frame Alignment\n", span->spanno);
- if (span->alarms & DAHDI_ALARM_LMFA)
- module_printk(KERN_NOTICE, "Span %d: Loss of Multi-Frame Alignment\n", span->spanno);
- if (span->alarms & DAHDI_ALARM_XLS)
- module_printk(KERN_NOTICE, "Span %d: Transmit Line Short\n", span->spanno);
- if (span->alarms & DAHDI_ALARM_XLO)
- module_printk(KERN_NOTICE, "Span %d: Transmit Line Open\n", span->spanno);
+ /* Report more detailed alarms */
+ if (debug) {
+ if (span->alarms & DAHDI_ALARM_LOS) {
+ module_printk(KERN_NOTICE,
+ "Span %d: Loss of signal\n",
+ span->spanno);
+ }
+ if (span->alarms & DAHDI_ALARM_LFA) {
+ module_printk(KERN_NOTICE,
+ "Span %d: Loss of Frame Alignment\n",
+ span->spanno);
+ }
+ if (span->alarms & DAHDI_ALARM_LMFA) {
+ module_printk(KERN_NOTICE,
+ "Span %d: Loss of Multi-Frame "\
+ "Alignment\n", span->spanno);
+ }
+ if (span->alarms & DAHDI_ALARM_XLS) {
+ module_printk(KERN_NOTICE,
+ "Span %d: Transmit Line Short\n",
+ span->spanno);
+ }
+ if (span->alarms & DAHDI_ALARM_XLO) {
+ module_printk(KERN_NOTICE,
+ "Span %d: Transmit Line Open\n",
+ span->spanno);
+ }
+ }
}
}
Modified: linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c?view=diff&rev=8839&r1=8838&r2=8839
==============================================================================
--- linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c Tue Jun 29 16:10:26 2010
@@ -1550,23 +1550,29 @@
t4_reset_counters(span);
break;
case DAHDI_MAINT_ALARM_SIM:
-// dev_info(&wc->dev->dev, "Invoking alarm state\n");
reg = t4_framer_in(wc, span->offset, FMR0);
- //dev_info(&wc->dev->dev, "FMR0: %X\n", reg);
-
- // The alarm simulation state machine requires us to bring this bit
- // up and down for at least 1 clock cycle
- // lock register writes to ensure nobody else tries to write to FMR0, while we delay
- spin_lock_irqsave(&wc->reglock, flags);
- __t4_framer_out(wc, span->offset, FMR0, (reg|FMR0_SIM));
+
+ /*
+ * The alarm simulation state machine requires us to
+ * bring this bit up and down for at least 1 clock cycle
+ * lock register writes to ensure nobody else tries to
+ * write to FMR0, while we delay
+ */
+ spin_lock_irqsave(&wc->reglock, flags);
+ __t4_framer_out(wc, span->offset,
+ FMR0, (reg | FMR0_SIM));
udelay(1);
- __t4_framer_out(wc, span->offset, FMR0, (reg&~FMR0_SIM));
+ __t4_framer_out(wc, span->offset,
+ FMR0, (reg & ~FMR0_SIM));
udelay(1);
spin_unlock_irqrestore(&wc->reglock, flags);
- //dev_info(&wc->dev->dev, "FMR0: %X\n", reg|FMR0_SIM);
reg = t4_framer_in(wc, span->offset, 0x4e);
- dev_info(&wc->dev->dev, "FRS2(alarm state): %d\n", ((reg&0xe0)>> 5));
+ if (debug & DEBUG_MAIN) {
+ dev_info(&wc->dev->dev,
+ "FRS2(alarm state): %d\n",
+ ((reg & 0xe0) >> 5));
+ }
break;
default:
dev_info(&wc->dev->dev, "Unknown T1 maint command:%d\n",
@@ -2039,7 +2045,7 @@
cmr1 |= (span << 6);
__t4_framer_out(wc, 0, 0x44, cmr1);
-
+
t4_card_event(wc, DAHDI_EVENT_SYNC);
dev_info(&wc->dev->dev, "RCLK source set to span %d\n", span+1);
@@ -2075,7 +2081,8 @@
* order to create a global event, we send that event to
* every channel on the card
*/
-void t4_card_event(struct t4 *wc, int event) {
+void t4_card_event(struct t4 *wc, int event)
+{
unsigned long flags;
struct dahdi_span *span;
struct dahdi_chan *chan;
@@ -2965,13 +2972,13 @@
/* Add detailed alarm status information to a red alarm state */
if (alarms & DAHDI_ALARM_RED) {
if (c & FRS0_LOS)
- alarms |= DAHDI_ALARM_LOS;
+ alarms |= DAHDI_ALARM_LOS;
if (c & FRS0_LFA)
- alarms |= DAHDI_ALARM_LFA;
+ alarms |= DAHDI_ALARM_LFA;
if (c & FRS0_LMFA)
- alarms |= DAHDI_ALARM_LMFA;
+ alarms |= DAHDI_ALARM_LMFA;
if (d & FRS1_XLS)
- alarms |= DAHDI_ALARM_XLS;
+ alarms |= DAHDI_ALARM_XLS;
if (d & FRS1_XLO)
alarms |= DAHDI_ALARM_XLO;
}
@@ -3186,8 +3193,9 @@
/* T1 checks */
if (isr2 || (isr3 & 0x08)) {
if (debug & DEBUG_MAIN) {
- printk("card %d span %d: isr2=%x isr3=%x\n",
- wc->num, span, isr2, isr3);
+ dev_info(&wc->dev->dev,
+ "span %d: isr2=%x isr3=%x\n",
+ span, isr2, isr3);
}
t4_check_alarms(wc, span);
}
Modified: linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h?view=diff&rev=8839&r1=8838&r2=8839
==============================================================================
--- linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h (original)
+++ linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h Tue Jun 29 16:10:26 2010
@@ -314,19 +314,19 @@
#define DAHDI_CONF_PSEUDO_TALKER 0x800 /* pseudo is a talker on the conference */
/* Alarm Condition bits */
-#define DAHDI_ALARM_NONE 0 /* No alarms */
-#define DAHDI_ALARM_RECOVER (1 << 0) /* Recovering from alarm */
-#define DAHDI_ALARM_LOOPBACK (1 << 1) /* In loopback */
-#define DAHDI_ALARM_YELLOW (1 << 2) /* Yellow Alarm */
-#define DAHDI_ALARM_RED (1 << 3) /* Red Alarm */
-#define DAHDI_ALARM_BLUE (1 << 4) /* Blue Alarm */
-#define DAHDI_ALARM_NOTOPEN (1 << 5)
+#define DAHDI_ALARM_NONE 0 /* No alarms */
+#define DAHDI_ALARM_RECOVER (1 << 0) /* Recovering from alarm */
+#define DAHDI_ALARM_LOOPBACK (1 << 1) /* In loopback */
+#define DAHDI_ALARM_YELLOW (1 << 2) /* Yellow Alarm */
+#define DAHDI_ALARM_RED (1 << 3) /* Red Alarm */
+#define DAHDI_ALARM_BLUE (1 << 4) /* Blue Alarm */
+#define DAHDI_ALARM_NOTOPEN (1 << 5)
/* Verbose alarm states (upper byte) */
-#define DAHDI_ALARM_LOS (1 << 8) /* Loss of Signal */
-#define DAHDI_ALARM_LFA (1 << 9) /* Loss of Frame Alignment */
-#define DAHDI_ALARM_LMFA (1 << 10) /* Loss of Multi-Frame Alignment */
-#define DAHDI_ALARM_XLS (1 << 11) /* Transmit line Short */
-#define DAHDI_ALARM_XLO (1 << 12) /* Transmit line Open */
+#define DAHDI_ALARM_LOS (1 << 8) /* Loss of Signal */
+#define DAHDI_ALARM_LFA (1 << 9) /* Loss of Frame Alignment */
+#define DAHDI_ALARM_LMFA (1 << 10)/* Loss of Multi-Frame Align */
+#define DAHDI_ALARM_XLS (1 << 11)/* Transmit line Short */
+#define DAHDI_ALARM_XLO (1 << 12)/* Transmit line Open */
/* Maintenance modes */
#define DAHDI_MAINT_NONE 0 /* Normal Mode */
More information about the dahdi-commits
mailing list