From 352a000d4f9ec3944bf23e0dda56466a10ad595e Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 13 Jul 2010 07:41:45 +0000 Subject: 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. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8873 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/init_card_4_30 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers/dahdi/xpp') diff --git a/drivers/dahdi/xpp/init_card_4_30 b/drivers/dahdi/xpp/init_card_4_30 index 9bf33d1..97f4064 100755 --- a/drivers/dahdi/xpp/init_card_4_30 +++ b/drivers/dahdi/xpp/init_card_4_30 @@ -341,7 +341,18 @@ sub port_setup($) { 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 = ; + close F; + chomp $sysfs_pri_protocol; + } + if($sysfs_pri_protocol eq 'T1') { $ccr1 |= 0x80; # RSCC (Serial CAS Format Selection) } -- cgit v1.2.3