summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/init_card_2_30
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-06-29 15:05:48 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-06-29 15:05:48 +0000
commitd9e8eab9a3869d54c2ae26c2d7a757762b0e68f7 (patch)
treefdc2fe8c67c52dfb722af879837b069cd629bf63 /drivers/dahdi/xpp/init_card_2_30
parente4de227a9fcedf1a521bd8a885b8bcd8e180101d (diff)
Changes in XPP initialization and configuration:
* The configuration for XPP init_card_* scripts is done now in /etc/dahdi/xpp.conf and uses a simple syntax (example included). For PRI modules, the 'pri_protocol' setting, determines how to configure it (E1/T1). * In Astribank PRI modules, the LED behaviour represent which ports are *CLOCK MASTER* (red color) and which are *CLOCK SLAVE* (green color). Usually (but not always), this corresponds to the NT/TE settings in Asterisk. * dahdi_genconf now replaces zapconf and deprecates genzaptelconf. Relevant configuration settings were removed from the kernel package and are implemented and described in the tools package. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4480 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/init_card_2_30')
-rwxr-xr-xdrivers/dahdi/xpp/init_card_2_3034
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/dahdi/xpp/init_card_2_30 b/drivers/dahdi/xpp/init_card_2_30
index b0a7555..bda0792 100755
--- a/drivers/dahdi/xpp/init_card_2_30
+++ b/drivers/dahdi/xpp/init_card_2_30
@@ -52,7 +52,8 @@ $ENV{XPP_BASE} = '/proc/xpp';
getopts('o:v:', \%opts);
-my $debug;
+my %settings;
+$settings{debug} = 0;
my $xpd_name;
my $chipregs;
@@ -62,7 +63,7 @@ sub logit {
}
sub debug {
- logit @_ if $debug;
+ logit @_ if $settings{debug};
}
# Arrange for error logging
@@ -310,23 +311,22 @@ sub opermode_verify($) {
}
sub read_defaults() {
- # Source default files
- my $var_debug = 'DEBUG_INIT_FXO';
- my $var_opermode = 'opermode';
- my ($default_file, %source_defaults) =
- XppConfig::source_vars($var_debug, $var_opermode);
- $debug = $source_defaults{$var_debug};
- my $tmp_opermode = $source_defaults{$var_opermode};
- if(defined($tmp_opermode) and $tmp_opermode) {
- # Verify
- my $mode = $opermode_table{$tmp_opermode};
- if(! defined $mode) {
- main::logit "Unknown opermode='$tmp_opermode'";
- die;
+ if(XppConfig::read_config(\%settings)) {
+ main::logit "Defaults from $settings{xppconf}";
+ my $o = $settings{opermode};
+ if(defined($o)) {
+ # Verify
+ my $mode = $opermode_table{$o};
+ if(! defined $mode) {
+ main::logit "Unknown opermode='$o'";
+ die;
+ }
+ $OPERMODE = $o;
+ main::logit "Set OPERMODE = $o";
}
- $OPERMODE = $tmp_opermode;
+ } else {
+ main::logit "No defaults file, use hard-coded defaults.";
}
- main::logit "From $default_file: $var_debug=$debug $var_opermode=$tmp_opermode";
}
package main;