[svn-commits] tzafrir: branch tools/2.4 r9738 - in /tools/branches/2.4: ./ dahdi_scan.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Feb 8 07:09:49 CST 2011
Author: tzafrir
Date: Tue Feb 8 07:09:45 2011
New Revision: 9738
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9738
Log:
Fixed up the loss of crc4-multiframe alignment logic
Loss of crc4-multiframe alignment on an E1 link is not a condition which
brings the span down. The span will continue to run as long as it can
maintain double frame alignment. Because of this, we cannot place the
LMFA alarm in the usual spaninfo.alarms member, due to userspace
programs using this as a catch-all for a span being up or down.
We can detect the alarm by watching the frame error counter (fecount).
If it continuously increments, the span is configured for crc4, and the
span remains OK (alarms = 0), then we are in loss of crc4-multiframe
state.
In order to test this alarm, you'll need to synthesize a loss of crc4
alignment on the span. You can usually do this by configuring the local
span to use crc4 and the remote end to not use crc4. I used the Fireberd
6000 in my lab to do this.
dahdi-743 & dahdi-420
Acked-by: Shaun Ruffell <sruffell at digium.com>
Merged revisions 9458 via svnmerge from
http://svn.digium.com/svn/dahdi/tools/trunk
Modified:
tools/branches/2.4/ (props changed)
tools/branches/2.4/dahdi_scan.c
Propchange: tools/branches/2.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 8 07:09:45 2011
@@ -1,1 +1,1 @@
-/tools/trunk:1-9220,9313,9426,9452
+/tools/trunk:1-9220,9313,9426,9452,9458
Modified: tools/branches/2.4/dahdi_scan.c
URL: http://svnview.digium.com/svn/dahdi/tools/branches/2.4/dahdi_scan.c?view=diff&rev=9738&r1=9737&r2=9738
==============================================================================
--- tools/branches/2.4/dahdi_scan.c (original)
+++ tools/branches/2.4/dahdi_scan.c Tue Feb 8 07:09:45 2011
@@ -95,11 +95,13 @@
strcat(alarms, "YEL/");
if (s.alarms & DAHDI_ALARM_RED) {
strcat(alarms, "RED/");
+
+/* Extended alarm feature test. Allows compilation with
+ * versions of dahdi-linux prior to 2.4
+ */
#ifdef DAHDI_ALARM_LFA
if (s.alarms & DAHDI_ALARM_LFA)
strcat(alarms, "LFA/");
- if (s.alarms & DAHDI_ALARM_LMFA)
- strcat(alarms, "LMFA/");
#endif /* ifdef DAHDI_ALARM_LFA */
}
if (s.alarms & DAHDI_ALARM_LOOPBACK)
@@ -115,10 +117,35 @@
alarms[strlen(alarms)-1]='\0';
}
} else {
- if (s.numchans)
- strcpy(alarms, "OK");
- else
+ if (s.numchans) {
+#ifdef DAHDI_ALARM_LFA
+ /* If we continuously receive framing errors
+ * but our span is still in service, and we
+ * are configured for E1 & crc4. We've lost
+ * crc4-multiframe alignment
+ */
+ if ((s.linecompat & DAHDI_CONFIG_CRC4) &&
+ (s.fecount > 0)) {
+ struct dahdi_spaninfo t;
+ memset(&t, 0, sizeof(t));
+ t.spanno = x;
+ sleep(1);
+ if (ioctl(ctl, DAHDI_SPANSTAT, &t))
+ continue;
+
+ /* Test fecount at two separate time
+ * intervals, if they differ, throw LMFA
+ */
+ if ((t.fecount > s.fecount) &&
+ !t.alarms) {
+ strcat(alarms, "LMFA/");
+ }
+ }
+#endif /* ifdef DAHDI_ALARM_LFA */
+ strcat(alarms, "OK");
+ } else {
strcpy(alarms, "UNCONFIGURED");
+ }
}
fprintf(stdout, "[%d]\n", x);
More information about the svn-commits
mailing list