From 5b68efc40a339a8ae3d9d137c7b9af809c3f5519 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Thu, 17 May 2007 19:34:32 +0000 Subject: * Tested with zaptel-1.2.17.1 * Add D-Channel TX, RX and BAD frames count in /proc/xpp/XBUS-*/XPD-*/bri_info * Adjust output of xpp_sync script. Pad for 8 port BRI. * Added a debugging module parport_debug (not compiled by default). * Added an optional patch to zaptel: - compiles only if ZAPTEL_SYNC_TICK is defined - Allow interested driver to register for "sync" notification. - Does not affect drivers that do not use this feature. * Added external synchronization feature: - Only if ZAPTEL_SYNC_TICK feature is compiled in - Than XPP may be synchronized by another card (e.g: an Astribank with FXS can be synchronized by a Digium PRI card). - May be enabled/disabled in runtime via the 'sync_tick_active' module parameter to the xpp.ko module. * Fixed a potential bug in D-Channel hexdump printing. * New visual indications in BRI leds: - Constant ON RED/GREEN: Shows the port type -- NT/TE. - Very fast "double blink": Layer1 work, no D-Channel yet. - Steady blinking (1/2 sec): D-Channel trafic detected. * xpp_fxloader moved to /usr/share/zaptel . * adj_clock removed: never really used. * Debugfs code now disabled by default. * Now we have Zaptel::Hardware and a sample zaptel_hardware script (not (installed by default). * We also have a sample perl zapconf (not installed by default) which aims at replacing genzaptelconf (sans the modules detection). git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2529 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- xpp/utils/zaptel_hardware | 91 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 xpp/utils/zaptel_hardware (limited to 'xpp/utils/zaptel_hardware') diff --git a/xpp/utils/zaptel_hardware b/xpp/utils/zaptel_hardware new file mode 100755 index 0000000..26aa839 --- /dev/null +++ b/xpp/utils/zaptel_hardware @@ -0,0 +1,91 @@ +#! /usr/bin/perl -w +# +# Written by Oron Peled +# Copyright (C) 2007, Xorcom +# This program is free software; you can redistribute and/or +# modify it under the same terms as Perl itself. +# +# $Id:$ +# +use strict; +BEGIN { my $dir = $0; $dir =~ s:/[^/]+$::; unshift(@INC, "$dir", "$dir/zconf"); } + +use Zaptel; +use Zaptel::Span; +use Zaptel::Xpp; +use Zaptel::Xpp::Xbus; +use Zaptel::Hardware; + +sub usage { + die "Usage: $0\n"; +} + +@ARGV == 0 or usage; + +my @hardware = Zaptel::Hardware->devices; +my @spans = Zaptel::spans; + +sub show_xbus($) { + my $xbus = shift or die; + my @xpds = $xbus->xpds; + my $connector = ($xbus->status eq 'CONNECTED') ? $xbus->connector : "MISSING"; + $connector = "(" . $connector . ")"; + printf "%-20s\n", $connector; + foreach my $xpd (sort { $a->num <=> $b->num } @xpds) { + my $reg = $xpd->zt_registration; + my $span; + my $spanstr; + if($reg && @spans) { + ($span) = grep { $_->name eq $xpd->fqn } @spans; + $spanstr = ($span) ? ("Span " . $span->num) : ""; + } else { + $spanstr = "Unregistered"; + } + 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; + } +} + +my %seen; +my $format = "%-20s\t%4s:%4s %-12s "; + +foreach my $dev (@hardware) { + my $xbus = $dev->xbus; + my $driver = $dev->driver || ""; + $driver = "[$driver]"; + printf $format, $dev->hardware_name, $dev->vendor, $dev->product, $driver; + if(!$xbus) { + printf "\n"; + next; + } + $seen{$xbus->name} = 1; + show_xbus($xbus); +} + +my $notified_lost = 0; +foreach my $xbus (Zaptel::Xpp::xbuses('SORT_CONNECTOR')) { + if(!$seen{$xbus->name}) { + print "----------- XPP Spans with disconnected hardware -----------\n" + unless $notified_lost++; + printf $format, $xbus->name, '', '', "NO HARDWARE"; + show_xbus($xbus); + } +} + + +__END__ + +=head1 NAME + +zaptel_hardware - Shows Zaptel hardware devices. + +=head1 SYNOPSIS + +zaptel_hardware + +=head1 DESCRIPTION + +Show all zaptel hardware devices, both used and unused. + -- cgit v1.2.3