diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-07-13 07:41:45 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-07-13 07:41:45 +0000 |
commit | 352a000d4f9ec3944bf23e0dda56466a10ad595e (patch) | |
tree | 84c6102fb9b8067735869cc1ef0861f3003f945b /drivers/dahdi/xpp | |
parent | ae46cd5bf15561cfe70625b4853e45bf8b955d9e (diff) |
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
Diffstat (limited to 'drivers/dahdi/xpp')
-rwxr-xr-x | drivers/dahdi/xpp/init_card_4_30 | 13 |
1 files changed, 12 insertions, 1 deletions
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 = <F>; + close F; + chomp $sysfs_pri_protocol; + } + if($sysfs_pri_protocol eq 'T1') { $ccr1 |= 0x80; # RSCC (Serial CAS Format Selection) } |