[dahdi-commits] tzafrir: linux/trunk r6135 - /linux/trunk/drivers/dahdi/xpp/
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Thu Mar 12 10:12:53 CDT 2009
Author: tzafrir
Date: Thu Mar 12 10:12:50 2009
New Revision: 6135
URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6135
Log:
xpp init_card_* scripts now less verbose
* Demote some messages to be debug messages.
* Rephrase the message about defaults for the PRI module (the driver's
defaults are used, which is OK)
Modified:
linux/trunk/drivers/dahdi/xpp/init_card_1_30
linux/trunk/drivers/dahdi/xpp/init_card_2_30
linux/trunk/drivers/dahdi/xpp/init_card_3_30
linux/trunk/drivers/dahdi/xpp/init_card_4_30
Modified: linux/trunk/drivers/dahdi/xpp/init_card_1_30
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/xpp/init_card_1_30?view=diff&rev=6135&r1=6134&r2=6135
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/init_card_1_30 (original)
+++ linux/trunk/drivers/dahdi/xpp/init_card_1_30 Thu Mar 12 10:12:50 2009
@@ -70,11 +70,11 @@
# Arrange for error logging
if (-t STDERR) {
$unit_id = 'Interactive';
- main::debug "Interactive startup";
+ debug "Interactive startup";
} else {
$unit_id = "$ENV{XBUS_NAME}/UNIT-$ENV{UNIT_NUMBER}";
open (STDERR, "| logger -t $program -p kern.info") || die;
- main::debug "Non Interactive startup";
+ debug "Non Interactive startup";
foreach my $k (qw(
XBUS_NAME
XBUS_NUMBER
@@ -385,14 +385,14 @@
}
sub calibrate_slics() {
- main::logit "Calibrating '$0'";
+ main::debug "Calibrating '$0'";
auto_calibrate(0x47, 0x1E);
main::debug "after auto_calibrate";
manual_calibrate();
main::debug "after manul_calibrate";
auto_calibrate(0x40, 0x01);
main::debug "after auto_calibrate 2";
- main::logit "Continue '$0'";
+ main::debug "Continue '$0'";
}
sub read_defaults() {
@@ -405,7 +405,7 @@
package main;
-main::logit "Starting '$0'";
+main::debug "Starting '$0'";
FXS::read_defaults;
main::debug "before init_indirect_registers";
@@ -431,7 +431,7 @@
}
close REG;
-main::logit "Ending '$0'";
+main::debug "Ending '$0'";
close STDERR;
exit 0;
Modified: linux/trunk/drivers/dahdi/xpp/init_card_2_30
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/xpp/init_card_2_30?view=diff&rev=6135&r1=6134&r2=6135
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/init_card_2_30 (original)
+++ linux/trunk/drivers/dahdi/xpp/init_card_2_30 Thu Mar 12 10:12:50 2009
@@ -69,11 +69,11 @@
# Arrange for error logging
if (-t STDERR || $opts{v}) {
$unit_id = 'Interactive';
- main::debug "Interactive startup";
+ debug "Interactive startup";
} else {
$unit_id = "$ENV{XBUS_NAME}/UNIT-$ENV{UNIT_NUMBER}";
open (STDERR, "| logger -t $program -p kern.info") || die;
- main::debug "Non Interactive startup";
+ debug "Non Interactive startup";
foreach my $k (qw(
XBUS_NAME
XBUS_NUMBER
@@ -365,7 +365,7 @@
exit 0;
}
-main::logit "Starting";
+main::debug "Starting";
FXO::read_defaults;
die "OPERMODE is undefined" unless $OPERMODE;
@@ -384,7 +384,7 @@
FXO::opermode_setup;
close REG;
-main::logit "Ending '$0'";
+main::debug "Ending '$0'";
close STDERR;
exit 0;
Modified: linux/trunk/drivers/dahdi/xpp/init_card_3_30
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/xpp/init_card_3_30?view=diff&rev=6135&r1=6134&r2=6135
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/init_card_3_30 (original)
+++ linux/trunk/drivers/dahdi/xpp/init_card_3_30 Thu Mar 12 10:12:50 2009
@@ -67,18 +67,24 @@
getopts('o:', \%opts);
+my %settings;
+
sub logit {
print STDERR "$unit_id: @_\n";
+}
+
+sub debug {
+ logit @_ if $settings{debug};
}
# Arrange for error logging
if (-t STDERR) {
$unit_id = 'Interactive';
- logit "Interactive startup";
+ debug "Interactive startup";
} else {
$unit_id = "$ENV{XBUS_NAME}/UNIT-$ENV{UNIT_NUMBER}";
open (STDERR, "| logger -t $program -p kern.info") || die;
- logit "Non Interactive startup";
+ debug "Non Interactive startup";
foreach my $k (qw(
XBUS_NAME
XBUS_NUMBER
@@ -135,6 +141,14 @@
main::select_subunit($subunit);
BRI::gen "$subunit W$active";
+ }
+}
+
+sub read_defaults() {
+ if(XppConfig::read_config(\%settings)) {
+ main::logit "Defaults from $settings{xppconf}";
+ } else {
+ main::logit "No defaults file, use hard-coded defaults.";
}
}
@@ -343,7 +357,7 @@
$port->setup_su($chan); # zap_xhfc_su.c:194
}
- # Zaptel chan 2 used as HDLC D-Channel
+ # Dahdi chan 2 used as HDLC D-Channel
$port->setup_fifo(2, 0, 0x05, 2, 0); # D-TX: zap_xhfc_su.c:205
$port->setup_fifo(2, 1, 0x05, 2, 0); # D-RX: zap_xhfc_su.c:206
# E-chan, Echo channel is ignored
@@ -362,14 +376,16 @@
package main;
-logit "Starting '$0'";
+debug "Starting '$0'";
+
+BRI::read_defaults;
#------------------------------------------- Instance detection
# zap_xhfc_su.c:895
sub init_xhfc($) {
my $portnum = shift;
- main::logit "init_xhfc($portnum)";
+ main::debug "init_xhfc($portnum)";
BRI::gen "#--------------------------- init_xhfc";
BRI::gen "$portnum WD 0D 00"; # r_FIFO_MD: 16 fifos,
# 64 bytes for TX and RX each (FIFO mode config)
@@ -452,7 +468,7 @@
main;
-logit "Ending '$0'";
+debug "Ending '$0'";
close REG;
close STDERR;
Modified: linux/trunk/drivers/dahdi/xpp/init_card_4_30
URL: http://svn.digium.com/svn-view/dahdi/linux/trunk/drivers/dahdi/xpp/init_card_4_30?view=diff&rev=6135&r1=6134&r2=6135
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/init_card_4_30 (original)
+++ linux/trunk/drivers/dahdi/xpp/init_card_4_30 Thu Mar 12 10:12:50 2009
@@ -71,14 +71,18 @@
print STDERR "$unit_id: @_\n";
}
+sub debug {
+ logit @_ if $settings{debug};
+}
+
# Arrange for error logging
if (-t STDERR) {
$unit_id = 'Interactive';
- logit "Interactive startup";
+ debug "Interactive startup";
} else {
$unit_id = "$ENV{XBUS_NAME}/UNIT-$ENV{UNIT_NUMBER}";
open (STDERR, "| logger -t $program -p kern.info") || die;
- logit "Non Interactive startup";
+ debug "Non Interactive startup";
foreach my $k (qw(
XBUS_NAME
XBUS_NUMBER
@@ -226,7 +230,7 @@
print INFO "$pri_protocol\n" || die "Failed writing '$pri_protocol' to '$file': $!\n";
close INFO || die "Failed during close of '$file': $!\n";
} else {
- main::logit "$xpd_name: Skip setting pri protocol -- non given";
+ main::logit "$xpd_name: pri_protocol not given. Driver will use defaults.";
}
}
@@ -359,7 +363,7 @@
package main;
-logit "Starting '$0'";
+main::debug "Starting '$0'";
PRI::read_defaults;
@@ -367,11 +371,11 @@
my @ports;
my $subunit;
- logit "main(): Initializing chip ($ENV{UNIT_SUBUNITS} ports)";
+ main::debug "main(): Initializing chip ($ENV{UNIT_SUBUNITS} ports)";
PRI::init_quad;
# Must initialize all 4 ports, regardless how much there are
for($subunit = 0; $subunit < 4; $subunit++) {
- #logit "main(): Initializing subunit $subunit";
+ #main::debug "main(): Initializing subunit $subunit";
my $p = PRI::Port->new(
'PORT_NUM' => $subunit,
'EXIST' => ($subunit < $ENV{UNIT_SUBUNITS})
@@ -389,7 +393,7 @@
main;
-logit "Ending '$0'";
+main::debug "Ending '$0'";
close REG;
close STDERR;
More information about the dahdi-commits
mailing list