[asterisk-bugs] [DAHDI-linux 0013897]: [patch] Support for generic HFC-4S cards

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Mar 16 11:08:26 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13897 
====================================================================== 
Reported By:                tzafrir
Assigned To:                tzafrir
====================================================================== 
Project:                    DAHDI-linux
Issue ID:                   13897
Category:                   wcb4xxp
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     confirmed
====================================================================== 
Date Submitted:             2008-11-13 16:17 CST
Last Modified:              2009-03-16 11:08 CDT
====================================================================== 
Summary:                    [patch] Support for generic HFC-4S cards
Description: 
A patch to add some basic support of other HFC-4S -based PCI cards (such as
the ones made by Junghanns). 

Status: gets rid of the echo canceller messages when not needed, but still
needs work.

Specifically:
* It adds too broad a range of cards (which also include bero.net cards) 
* The range may include some 2-ports cards, which will probably not work.

Not yet tested to work, though it it is at least configured.

====================================================================== 

---------------------------------------------------------------------- 
 (0101802) Odicha (reporter) - 2009-03-16 11:08
 http://bugs.digium.com/view.php?id=13897#c101802 
---------------------------------------------------------------------- 
Hi, Tzafrir!

Some minor fixes on led signalling section.

I wrote comments here on code changes. Comments are not in diff file.
(Poor english & poor skills. If I write on code you surelly must change
it)
Now looking at code I understand BIT_SET & BIT_CLR... (sorry)
svn diff is based on Revision 6168

HFC-8S

+		if ((bspan->span.flags & DAHDI_FLAG_RUNNING) && (bspan->span.alarms)){ 
     /* Here I changed conditions. It  was always on "continue" ....  */
+			    BIT_SET(lled, (j-1));         /* j - 1 because leds are from 7 to
0. "j" goes from 8 to 1 */ 
+			    continue;  /* Led OFF */    
+		}
+
+		if (bspan->span.mainttimer || bspan->span.maintstat) {
+			/* Led Blinking in maint state */
+			if (b4->blinktimer >= 0x7f)
+				BIT_SET(lled, (j-1));
+		}
+

Tested succesfully on OpenVox B800P



HFC-4S

+	int i, leds = 0;   /* Changed green_led & red_led => leds */
+	struct b4xxp_span *bspan;
+
+	b4->blinktimer++;
+	for (i=0; i < b4->numspans; i++) {
+		bspan = &b4->spans[i];
+
+		if (!(bspan->span.flags & DAHDI_FLAG_RUNNING))
+			continue; /* Leds are off */
+
+		if (bspan->span.alarms) {
+			/* Red blinking -> Alarm */
+			if (b4->blinktimer >= 0x7f)
+				BIT_SET(leds, i); 
+		} else if (bspan->span.mainttimer || bspan->span.maintstat) {
+			/* Green blinking -> Maint status */
+			if (b4->blinktimer >= 0x7f){
+				BIT_SET(leds, i);
+				BIT_SET(leds, (i+4));  /*Led green needs two bits enabled (one for
"ON" state and one for "Green" colour so
							Green Led for span 0  enables bit 0 and bit 4 
							Red Led enables only bit 0 */
+			}	
+		} else {
+			/* No Alarm - Green */
+			BIT_SET(leds, i);
+			BIT_SET(leds, (i+4));
+		}
+	}
+	b4xxp_setreg8(b4, R_GPIO_EN1, leds & 0x0f);
+	b4xxp_setreg8(b4, R_GPIO_OUT1, leds >> 4);
+
+	if (b4->blinktimer == 0xff)
+		b4->blinktimer = -1; 

Tested OK on OpenVox B200P. Untested on B400P. It might work. I'll test it
ASAP 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-16 11:08 Odicha         Note Added: 0101802                          
======================================================================




More information about the asterisk-bugs mailing list