From 18c6813f2c788b603dab363b9138d65d24252167 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Wed, 27 May 2009 10:01:24 +0000 Subject: Big dump of newer xpp code. For finer details and separate commits, you are advised to look into the commit log of dahdi-{linux,tools}. xpp.r7150 * 116x Astribanks: - Support for the TwinStar capability and for FXO and (BRI|PRI) on same device. - New control protocol ("MPP"). - astribank_hextool - a low-level firmware loading tool instead of fpga_load . - astribank_tool - Other MPP activities . - Can still reset (but just that) through older protocol. - astribank_hexload is required for loading FPGA firmware for USB_FW.hex rev > 6885. - USB_FW rev. 7071 . - More modular FPGA firmware (1161 only). - FPGA_1161.hex rev. 7131. PIC_TYPE_* rev. 7107. - software-settings of some capabilities with astribank_allow . * XPP: - init_card_* script are less verbose. - Reduced rate of "Is a DAHDI sync master" message. - Replace member bus_id with dev_name() and set_dev_name() for building with 2.6.30. - Conditionally remove 'owner' property of procfs was dropped in 2.6.30. - astribank_hook now enabled by default. - Has an optional hook for TwinStar. * BRI: - hardhdlc support: The bri_dchan patch is no longer needed. - If bri_dchan patch applied: old code is used, and "dchan" is used. - If not: new code and "hardhdlc" is used. - zapconf will generate the right configuration, depending on the new sysfs driver attribute bri_hardhdlc, but default to "dchan" as before if not explicitly told. - Bugfix: explicitly turn off leds on startup. * FXS: - Initialization and calibration fixes. - Notify the user just one about wrong VMWI config * Dahdi-perl: - Fix detection of empty slots in wctdm. - Fix working with ethmf's extra file in /proc/zaptel - Improved detection of Rhino cards. - dahdi_genconf's generated text better explains files are generated. - /etc/xpp_order - allow specifiying an explicit order for Astribanks to register with Zaptel. - Dahdi::Xpp::Mpp - A wrapper around astribank_tool . * dahdi.init: - A separate waitfor_xpds script. May now have a wait-loop in some cases. - xpp_sync needs to only be called after dahdi_cfg . (for the PRI module). git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4641 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- kernel/xpp/utils/zaptel_hardware | 52 ++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 10 deletions(-) (limited to 'kernel/xpp/utils/zaptel_hardware') diff --git a/kernel/xpp/utils/zaptel_hardware b/kernel/xpp/utils/zaptel_hardware index 004a44b..81823f1 100755 --- a/kernel/xpp/utils/zaptel_hardware +++ b/kernel/xpp/utils/zaptel_hardware @@ -17,16 +17,16 @@ use Zaptel::Span; use Zaptel::Xpp; use Zaptel::Xpp::Xbus; use Zaptel::Hardware; +use Zaptel::Xpp::Mpp; sub usage { - die "Usage: $0 [-v][-x]\n"; + die "Usage: $0 [-v][-x][-t]\n"; } -our ($opt_v, $opt_x); -getopts('vx') || usage; +my %opts; +getopts('vxt', \%opts) || usage; @ARGV == 0 or usage; -my $hardware = Zaptel::Hardware->scan; my @spans = Zaptel::spans; sub show_xbus($) { @@ -37,6 +37,7 @@ sub show_xbus($) { printf " LABEL=%-20s CONNECTOR=%-20s\n", $label, $connector; foreach my $xpd (@xpds) { my $reg = $xpd->zt_registration; + my $channels = '(' . $xpd->channels . ')'; my $span; my $spanstr; if($reg && @spans) { @@ -48,7 +49,7 @@ sub show_xbus($) { my $master = ''; #$master = "XPP-SYNC" if $xpd->is_sync_master; $master .= " ZAPTEL-SYNC" if defined($span) && $span->is_zaptel_sync_master; - printf "\t%-10s: %-8s %s %s\n", $xpd->fqn, $xpd->type, $spanstr, $master; + printf "\t%-10s: %-8s %-5s %s %s\n", $xpd->fqn, $xpd->type, $channels, $spanstr, $master; } } @@ -59,37 +60,68 @@ sub show_disconnected(%) { my %seen = @_; my $notified_lost = 0; - foreach my $xbus (Zaptel::Xpp::xbuses('SORT_CONNECTOR')) { + foreach my $xbus (Zaptel::Xpp::xbuses) { if(!$seen{$xbus->name}) { print "----------- XPP Spans with disconnected hardware -----------\n" unless $notified_lost++; printf($format, $xbus->name, '', '', '', "NO HARDWARE"); - show_xbus($xbus) if $opt_v; + show_xbus($xbus) if $opts{'v'}; } } } -foreach my $dev ($hardware->device_list) { +# FIXME: For verbose display we also need to see the XPP devices. +# If no spans are registered, this won't happen. A brute-force +# methood for making it happe: +Zaptel::Xpp::xbuses if ($opts{'v'}); + +my @devices = Zaptel::Hardware->device_list; +foreach my $dev (@devices) { my $driver = $dev->driver || ""; my $xbus; my $loaded; + my $tws_port; + my $tws_power; + my $tws_watchdog; + my $mppinfo; if($dev->is_astribank) { $xbus = $dev->xbus; + if($opts{'v'} || $opts{'t'}) { + Zaptel::Xpp::Mpp->mpp_addinfo($dev); + $mppinfo = $dev->mppinfo; + if(defined $mppinfo) { + $tws_port = $mppinfo->{TWINSTAR_PORT}; + $tws_power = $mppinfo->{TWINSTAR_POWER}; + $tws_watchdog = $mppinfo->{TWINSTAR_WATCHDOG}; + } + } } $loaded = $dev->loaded; warn "driver should be '$driver' but is actually '$loaded'\n" if defined($loaded) && $driver ne $loaded; $driver = "$driver" . (($loaded) ? "+" : "-"); + if(defined $tws_power && defined $tws_watchdog) { + my $tws_active = $tws_watchdog && $tws_power->[0] && $tws_power->[1]; + $driver .= "[T]" if $tws_active; + } my $description = $dev->description || ""; printf $format, $dev->hardware_name, $driver, $dev->vendor, $dev->product, $description; + if($opts{'v'} && defined $mppinfo && exists $mppinfo->{MPP_TALK}) { + printf " MPP: TWINSTAR_PORT=$tws_port\n" if defined $tws_port; + printf " MPP: TWINSTAR_WATCHDOG=$tws_watchdog\n" if defined $tws_watchdog; + for(my $i = 0; $i < 2; $i++) { + printf " MPP: TWINSTAR_POWER[%d]=%d\n", + $i, $tws_power->[$i] if defined $tws_power; + } + } if(!defined $xbus || !$xbus) { next; } $seen{$xbus->name} = 1; - show_xbus($xbus) if $opt_v; + show_xbus($xbus) if $opts{'v'}; } -show_disconnected(%seen) if $opt_x; +show_disconnected(%seen) if $opts{'x'}; __END__ -- cgit v1.2.3