summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-07-13 07:41:45 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-07-13 07:41:45 +0000
commite6c4b0915bcd14d1b2d74ef2cd75749dc3ebfd93 (patch)
tree84c6102fb9b8067735869cc1ef0861f3003f945b
parent4e9e4db4e9d281aeefb937d77edfd0f4ad6b8e3a (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
-rwxr-xr-xdrivers/dahdi/xpp/init_card_4_3013
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)
}