[svn-commits] tzafrir: linux/trunk r8873 - /linux/trunk/drivers/dahdi/xpp/init_card_4_30

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 13 02:41:48 CDT 2010


Author: tzafrir
Date: Tue Jul 13 02:41:45 2010
New Revision: 8873

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8873
Log:
Don't assume hardwired pri_protocol is E1

When initializing registers for the "PRI" (E1/T1) module, in the case the
user has not explicitly asked for E1/T1 settings in xpp.conf (pri_protocol)
fall back to the current value, which is the build-time fall-back.

The value is read from sysfs.

Previously we implicitly assumed this value is E1.

Modified:
    linux/trunk/drivers/dahdi/xpp/init_card_4_30

Modified: linux/trunk/drivers/dahdi/xpp/init_card_4_30
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/init_card_4_30?view=diff&rev=8873&r1=8872&r2=8873
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/init_card_4_30 (original)
+++ linux/trunk/drivers/dahdi/xpp/init_card_4_30 Tue Jul 13 02:41:45 2010
@@ -341,7 +341,18 @@
 	my $ccr1 = 0x18;		# CCR1 (Common Configuration Register1)
 					#      EITS (Enable Internal Time Slot 0 to 31 Signalling)
 					#      ITF  (Interframe Time Fill)
-	if ( $pri_protocol eq 'T1' ) {
+	my $sysfs_pri_protocol;
+	if (defined $pri_protocol) {
+		$sysfs_pri_protocol = $pri_protocol;
+	} else {
+		my $file = sprintf "/sys/bus/xpds/devices/%02d:%1d:%1d/pri_protocol",
+				$ENV{XBUS_NUMBER}, $ENV{UNIT_NUMBER}, $portno;
+		open(F, $file) || die "$0: Failed opening '$file'";
+		$sysfs_pri_protocol = <F>;
+		close F;
+		chomp $sysfs_pri_protocol;
+	}
+	if($sysfs_pri_protocol eq 'T1') {
 		$ccr1 |= 0x80;		#      RSCC (Serial CAS Format Selection)
 	}
 




More information about the svn-commits mailing list