[svn-commits] sruffell: tools/trunk r8125 - in /tools/trunk: ./ xpp/perl_modules/Dahdi/ xpp...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 26 10:45:17 CST 2010


Author: sruffell
Date: Fri Feb 26 10:45:06 2010
New Revision: 8125

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8125
Log:
dahdi_cfg, dahdi_genconf: Add support for Hx8 series cards.

Modified:
    tools/trunk/dahdi_cfg.c
    tools/trunk/xpp/perl_modules/Dahdi/Chans.pm
    tools/trunk/xpp/perl_modules/Dahdi/Config/Gen/System.pm
    tools/trunk/xpp/perl_modules/Dahdi/Span.pm

Modified: tools/trunk/dahdi_cfg.c
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/dahdi_cfg.c?view=diff&rev=8125&r1=8124&r2=8125
==============================================================================
--- tools/trunk/dahdi_cfg.c (original)
+++ tools/trunk/dahdi_cfg.c Fri Feb 26 10:45:06 2010
@@ -310,8 +310,9 @@
 	int argc;
 	int span;
 	int timing;
-	argc = res = parseargs(args, realargs, 7, ',');
-	if ((res < 5) || (res > 7)) {
+	int i;
+	argc = res = parseargs(args, realargs, 9, ',');
+	if ((res < 5) || (res > 9)) {
 		error("Incorrect number of arguments to 'span' (should be <spanno>,<timing>,<lbo>,<framing>,<coding>[, crc4 | yellow [, yellow]])\n");
 		return -1;
 	}
@@ -366,23 +367,22 @@
 		error("Coding must be one of 'ami', 'b8zs' or 'hdb3', not '%s'\n", realargs[4]);
 		return -1;
 	}
-	if (argc > 5) {
-		if (!strcasecmp(realargs[5], "yellow"))
+	for (i = 5; i < argc; i++) {
+		if (!strcasecmp(realargs[i], "yellow"))
 			lc[spans].lineconfig |= DAHDI_CONFIG_NOTOPEN;
-		else if (!strcasecmp(realargs[5], "crc4")) {
+		else if (!strcasecmp(realargs[i], "crc4"))
 			lc[spans].lineconfig |= DAHDI_CONFIG_CRC4;
-		} else {
-			error("Only valid fifth arguments are 'yellow' or 'crc4', not '%s'\n", realargs[5]);
+		else if (!strcasecmp(realargs[i], "nt"))
+			lc[spans].lineconfig |= DAHDI_CONFIG_NTTE;
+		else if (!strcasecmp(realargs[i], "te"))
+			lc[spans].lineconfig &= ~DAHDI_CONFIG_NTTE;
+		else if (!strcasecmp(realargs[i], "term"))
+			lc[spans].lineconfig |= DAHDI_CONFIG_TERM;
+		else {
+			error("Remaining arguments may be any of: 'yellow', 'crc4', 'nt', 'te', 'term', not '%s'\n", realargs[i]);
 			return -1;
 		}
-	}
-	if (argc > 6) {
-		if (!strcasecmp(realargs[6], "yellow"))
-			lc[spans].lineconfig |= DAHDI_CONFIG_NOTOPEN;
-		else {
-			error("Only valid sixth argument is 'yellow', not '%s'\n", realargs[6]);
-			return -1;
-		}
+
 	}
 	lc[spans].span = span;
 	lc[spans].sync = timing;

Modified: tools/trunk/xpp/perl_modules/Dahdi/Chans.pm
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/xpp/perl_modules/Dahdi/Chans.pm?view=diff&rev=8125&r1=8124&r2=8125
==============================================================================
--- tools/trunk/xpp/perl_modules/Dahdi/Chans.pm (original)
+++ tools/trunk/xpp/perl_modules/Dahdi/Chans.pm Fri Feb 26 10:45:06 2010
@@ -151,7 +151,8 @@
 		# cwain: Junghanns E1 card.
 		# R[124]: Rhino r1t1/rxt1 cards
 		$type = "PRI";
-	} elsif ($fqn =~ m{\b(B4|ZTHFC\d*|ztqoz\d*)/.*}) {
+	} elsif ($fqn =~ m{\b(WCBRI|B4|ZTHFC\d*|ztqoz\d*)/.*}) {
+		# WCBRI: The Digium Hx8 series cards with BRI module.
 		# B4: The Digium wcb4xxp DAHDI driver
 		# ZTHFC: HFC-s single-port card (zaphfc/vzaphfc)
 		# ztqoz: qozap (Junghanns) multi-port HFC card

Modified: tools/trunk/xpp/perl_modules/Dahdi/Config/Gen/System.pm
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/xpp/perl_modules/Dahdi/Config/Gen/System.pm?view=diff&rev=8125&r1=8124&r2=8125
==============================================================================
--- tools/trunk/xpp/perl_modules/Dahdi/Config/Gen/System.pm (original)
+++ tools/trunk/xpp/perl_modules/Dahdi/Config/Gen/System.pm Fri Feb 26 10:45:06 2010
@@ -112,6 +112,10 @@
 	$span_crc4 = (defined $span_crc4) ? ",$span_crc4" : '';
 	my $span_yellow = $span->yellow();
 	$span_yellow = (defined $span_yellow) ? ",$span_yellow" : '';
+	my $span_termination = $span->termination();
+	$span_termination = (defined $span_termination) ? ",$span_termination" : '';
+	my $span_softntte = $span->softntte();
+	$span_softntte = (defined $span_softntte) ? ",$span_softntte" : '';
 	# "MFC/R2 does not normally use CRC4"
 	# FIXME: a finer way to override:
 	if ($gconfig->{'pri_connection_type'} eq 'R2') { 
@@ -119,14 +123,16 @@
 		$framing = 'cas';
 	}
 	$timing = ($termtype eq 'NT') ? 0 : $bri_te_last_timing++;
-	printf "span=%d,%d,%d,%s,%s%s%s\n",
+	printf "span=%d,%d,%d,%s,%s%s%s%s%s\n",
 			$num,
 			$timing,
 			$lbo,
 			$framing,
 			$coding,
 			$span_crc4,
-			$span_yellow;
+			$span_yellow,
+			$span_termination,
+			$span_softntte;
 	printf "# termtype: %s\n", lc($termtype);
 	my $dchan_type;
 	if ($span->is_bri()) {

Modified: tools/trunk/xpp/perl_modules/Dahdi/Span.pm
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/xpp/perl_modules/Dahdi/Span.pm?view=diff&rev=8125&r1=8124&r2=8125
==============================================================================
--- tools/trunk/xpp/perl_modules/Dahdi/Span.pm (original)
+++ tools/trunk/xpp/perl_modules/Dahdi/Span.pm Fri Feb 26 10:45:06 2010
@@ -135,6 +135,7 @@
 		'octoBRI \[(NT|TE)\] ',
 		'HFC-S PCI A ISDN.* \[(NT|TE)\] ',
 		'(B4XXP) \(PCI\) Card', # Does not expose NT/TE type
+		'(WCBRI)', # has selectable NT/TE modes via dahdi_cfg
 		);
 
 my @pri_strings = (
@@ -194,7 +195,7 @@
 	foreach my $cardtype (@bri_strings) {
 		if($head =~ m/$cardtype/) {
 			my $termtype = $1;
-			$termtype = 'TE' if ( $1 eq 'B4XXP' );
+			$termtype = 'TE' if ( $1 eq 'B4XXP' or $1 eq 'WCBRI' );
 			$self->{IS_DIGITAL} = 1;
 			$self->{IS_BRI} = 1;
 			$self->{TERMTYPE} = $termtype;
@@ -259,6 +260,8 @@
 	$self->{CHANS} = \@channels;
 	$self->{YELLOW} = undef;
 	$self->{CRC4} = undef;
+	$self->{SOFTNTTE} = undef;
+	$self->{TERMINATION} = undef;
 	if($self->is_bri()) {
 		$self->{CODING} = 'ami';
 		$self->{DCHAN} = ($self->chans())[$self->{DCHAN_IDX}];
@@ -266,7 +269,11 @@
 		# Infer some info from channel name:
 		my $first_chan = ($self->chans())[0] || die "$0: No channels in span #$num\n";
 		my $chan_fqn = $first_chan->fqn();
-		if($chan_fqn =~ m(ZTHFC.*/|ztqoz.*/|XPP_BRI_.*|B4/.*)) {		# BRI
+		if($chan_fqn =~ m(ZTHFC.*/|ztqoz.*/|XPP_BRI_.*|B4/.*|WCBRI/.*)) {		# BRI
+			if($chan_fqn =~ m(WCBRI/.*)) {		# make sure to set termination resistors on hybrid cards
+				$self->{TERMINATION} = 'term';
+				$self->{SOFTNTTE} = 'te';
+			}
 			$self->{FRAMING} = 'ccs';
 			$self->{SWITCHTYPE} = 'euroisdn';
 			$self->{SIGNALLING} = ($self->{TERMTYPE} eq 'NT') ? $DAHDI_BRI_NET : $DAHDI_BRI_CPE ;




More information about the svn-commits mailing list