[zaptel-commits] tzafrir: branch tzafrir/kernelmove_conf r2695 - in /team/tzafrir/kernelmove_c...
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Thu Jul 5 03:44:38 CDT 2007
Author: tzafrir
Date: Thu Jul 5 03:44:37 2007
New Revision: 2695
URL: http://svn.digium.com/view/zaptel?view=rev&rev=2695
Log:
Initial prototype for menuselect replacement:
* data sits in RFC822-like (Debian-config). extracted data is in the
directory build_conf .
* update_config: a script to extract config data from modules. Currently
only for kernel modules.
* config_info: a script to provide information about the files. Currently
only listing of items is implemented.
* configure.ac also uses the --fixdeps commands from the above script that
is not yet implemented.
* Sync with branches/1.4 up to r2691 .
Added:
team/tzafrir/kernelmove_conf/build_conf/ (with props)
team/tzafrir/kernelmove_conf/build_tools/config_info (with props)
team/tzafrir/kernelmove_conf/build_tools/update_config (with props)
team/tzafrir/kernelmove_conf/doc/fxstest.8 (with props)
Removed:
team/tzafrir/kernelmove_conf/genconst.c
team/tzafrir/kernelmove_conf/kernel/wctc4xxp/tc400m-firmware.bin
Modified:
team/tzafrir/kernelmove_conf/ (props changed)
team/tzafrir/kernelmove_conf/Makefile
team/tzafrir/kernelmove_conf/README
team/tzafrir/kernelmove_conf/TODO
team/tzafrir/kernelmove_conf/configure
team/tzafrir/kernelmove_conf/configure.ac
team/tzafrir/kernelmove_conf/doc/fxotune.8
team/tzafrir/kernelmove_conf/doc/ztcfg.8
team/tzafrir/kernelmove_conf/doc/ztmonitor.8
team/tzafrir/kernelmove_conf/doc/zttool.8
team/tzafrir/kernelmove_conf/firmware/Makefile
team/tzafrir/kernelmove_conf/kernel/pciradio.c
team/tzafrir/kernelmove_conf/kernel/tor2.c
team/tzafrir/kernelmove_conf/kernel/torisa.c
team/tzafrir/kernelmove_conf/kernel/wcfxo.c
team/tzafrir/kernelmove_conf/kernel/wct1xxp.c
team/tzafrir/kernelmove_conf/kernel/wct4xxp/base.c
team/tzafrir/kernelmove_conf/kernel/wctc4xxp/ (props changed)
team/tzafrir/kernelmove_conf/kernel/wctc4xxp/Makefile.kernel26
team/tzafrir/kernelmove_conf/kernel/wctc4xxp/base.c
team/tzafrir/kernelmove_conf/kernel/wctdm.c
team/tzafrir/kernelmove_conf/kernel/wctdm24xxp.c
team/tzafrir/kernelmove_conf/kernel/wcte11xp.c
team/tzafrir/kernelmove_conf/kernel/wcte12xp.c
team/tzafrir/kernelmove_conf/kernel/wcusb.c
team/tzafrir/kernelmove_conf/kernel/xpp/utils/ (props changed)
team/tzafrir/kernelmove_conf/kernel/xpp/xpp_zap.c
team/tzafrir/kernelmove_conf/kernel/zaptel-base.c
team/tzafrir/kernelmove_conf/kernel/ztd-eth.c
team/tzafrir/kernelmove_conf/kernel/ztd-loc.c
team/tzafrir/kernelmove_conf/kernel/ztdummy.c
team/tzafrir/kernelmove_conf/kernel/ztdynamic.c
team/tzafrir/kernelmove_conf/kernel/zttranscode.c
team/tzafrir/kernelmove_conf/zaptel.init
Propchange: team/tzafrir/kernelmove_conf/
------------------------------------------------------------------------------
--- svk:merge (added)
+++ svk:merge Thu Jul 5 03:44:37 2007
@@ -1,0 +1,4 @@
+d2125f73-ff75-400f-a6c3-3fbfef2e91b7:/digium/zaptel-me/kernelmove:6034
+f558416c-6c06-0410-9f27-dde2687782d0:/branches/1.4:2536
+f558416c-6c06-0410-9f27-dde2687782d0:/team/tzafrir/kernelmove_14:2651
+f558416c-6c06-0410-9f27-dde2687782d0:/trunk:1469
Modified: team/tzafrir/kernelmove_conf/Makefile
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/Makefile?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/Makefile (original)
+++ team/tzafrir/kernelmove_conf/Makefile Thu Jul 5 03:44:37 2007
@@ -186,11 +186,8 @@
fxotune: LDLIBS+=-lm
fxsdump: LDLIBS+=-lm
-# What does this target mean?
-#devel: tor2ee
-
stackcheck: checkstack modules
- ./checkstack *.o
+ ./checkstack kernel/*.ko */*.ko
data:
$(KMAKE) ZAP_SUBDIRS=datamods MODULES=datamods
Modified: team/tzafrir/kernelmove_conf/README
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/README?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/README (original)
+++ team/tzafrir/kernelmove_conf/README Thu Jul 5 03:44:37 2007
@@ -1,49 +1,172 @@
Zapata Telephony Interface Driver
+=================================
+Asterisk Development Team <asteriskteam at digium.com>
+$Revision$, $Date$
-Note:
-See
-http://www.voip-info.org/tiki-index.php?page=Asterisk%20Zaptel%20Installation
-for more verbose and updated version of this document.
+Zaptel is a short for ZAPata Telephony.
-Requirements:
- Some of the testing programs still require the zapata library
- The zttool program requires libnewt
+Supported Hardware
+------------------
+Digital Cards
+~~~~~~~~~~~~~
+- wct4xxp:
+ - Digium newer quad-span T1/E1/J1 cards: Wildcard TE420P/TE410P/TE405P
+ - Digium newer dual-span T1/E1/J1 cards: Wildcard TE220P/TE210P/TE205P
+- wcte12xp: Digium Wildcard TE120P and the TE122P single-span T1/E1/J1 card
+- wcte11xp: Digium Wildcard TE110P T1/E1/J1
+- wct1xxp:
+ - Wildcard T100P (old single-span T1)
+ - Wildcard E100P (old single-span E1)
+- tor2: Tormenta quad-span T1/E1 card from the Zapata Telephony project
+- torisa: The old dual-span ISA T1 card from Zapata Telephony
-To install:
- check zconfig.h for any specific configuration changes
- make
- make install
-Here is a list of what module to use with what hardware
+Analog Cards
+~~~~~~~~~~~~
+- wctdm24xxp:
+ - Digium TDM2400P card: up to 24 analog ports
+ - Digium TDM800P card: up to 8 analog ports
+- wctdm: Digium TDM400P card: up to 4 analog ports
+- xpp: Xorcom Astribank: a USB connected unit of up to 32 ports
+ (also BRI)
+- wcfxo: X100P, similar and clones. A simple single-port FXO card
+- wcusb: Digium S100U: A simple single-port USB FXS unit
-Module Name Hardware
-tor2 T400P - Quad Span T1 Card
- E400P - Quad Span E1 Card
-wct4xxp TE405P - Quad Span T1/E1 Card (5v version)
- TE410P - Quad Span T1/E1 Card (3.3v version)
+Other Drivers
+~~~~~~~~~~~~~
+- pciradio: Zapata Telephony PCI Quad Radio Interface
+- wctc4xxp: Digium hardware transcoder cards (also need zttranscode)
+- ztd-eth: TDM over Ethernet (TDMoE) driver. Requires ztdynamic
+- ztd-loc: Mirror a local span. Requires ztdynamic
+- ztdummy: A dummy driver that only provides a zaptel timing source.
-wct1xxp T100P - Single Span T1 Card
- E100P - Single Span E1 Card
-wcte11xp TE110P - Single Span T1/E1 Card
+Build Requirements
+------------------
+You will need a matching kernel source tree and a working Linux build
+system. Some of the programs require some additional libraries.
-wcfxo X100P - Single port FXO interface
- X101P - Single port FXO interface
-wctdm or TDM400P - Modular FXS/FXO interface (1-4 ports)
-wcfxs
+Kernel Source / "Headers"
+~~~~~~~~~~~~~~~~~~~~~~~~~
+- Building zaptel requires a kernel build tree.
+- This should basically be at least a partial kernel source tree and
+ most importantly, the exact kernel .config file used for the build as
+ well as several files generated at kernel build time.
+- KERNEL_VERSION is the output of the command `uname -r`
+- If you build your own kernel, you need to point to the exact kernel
+ build tree. Luckily for you, this will typically be pointed by the
+ symbolic link /lib/modules/KERNEL_VERSION/build which is the location
+ zaptel checks by default.
+- If you use a kernel from your distribution you will typically have a
+ package with all the files required to build a kernel modules for your
+ kernel image.
+ * On Debian Etch and above and any Ubuntu this is
+ +++ linux-headers-`uname -r` +++
+ * On Fedora RHEL and compatibles (e.g. CentOS) this is the
+ kernel-devel package. Or if you run kernel-smp or kernel-xen, you
+ need kernel-smp-devel or kernel-xen-devel, respectively.
+ * On SUSE you seem to need the package kernel-source .
+- To point explicitly to a different build tree: set KSRC to the kernel
+ source tree and KVERS to the exact kernel version:
-wcusb or S100U - Single port FXS USB Interface
-wcfxsusb
+ make KVERS=2.6.18.Custom KSRC=/home/tzafrir/kernels/2.6.18
-torisa Old Tormenta1 ISA Card
-ztdummy UHCI USB Zaptel Timing Only Interface
+Kernel Configuration
+~~~~~~~~~~~~~~~~~~~~
+If you build a custom kernel, note the following configuration items:
+- CONFIG_CRC_CCITT must be enabled ('y' or 'm'). On 2.6 kernels this can
+ be selected These can be selected from the "Library Routines" submenu
+ during kernel configuration via "make menuconfig".
+- ztdummy on i386/amd64 and later kernels (>= 2.6.15) can (and should)
+ use the system's RTC (Real Time Clock).
+- Alternatives to that for ztdummy are a UHCI USB controller (USB
+ controllers made by Intel or VIA) or a kernel that has HZ=1000
+ (default on kernels 2.6.0-2.6.12, optional on newer kernels. Not
+ possible on 2.4).
+
+
+A Build System
+~~~~~~~~~~~~~~
+gcc and friends. Generally you will need to install the package gcc.
+There may be cases where you will need a specific version of gcc to build
+kernel modules.
+
+On Debian and similar distributions run:
+
+ apt-get install build-essential
+
+On Centos and Fedora:
+
+ apt-get install gcc
+
+
+Extra Libraries
+~~~~~~~~~~~~~~~
+Some libraries are needed for extra utilities that are provided with
+Zaptel
+
+- libusb is needed for building fpgaload, needed for firmware loading of
+ the Xorcom Astribank.
+- libnewt is needed to build the optional but useful utility zttool.
+- For building usbfxstest you will need the zapata library. TODO:
+ Needed?
+
+Installing the first two on Debian:
+
+ apt-get install libusb-dev libnewt-dev
+
+Installing the first two on Centos/Fedora:
+
+ yum install libusb-devel libnewt-devel
+
+
+Installation
+------------
+
+ ./configure
+ # optional step: select custom configuration:
+ #make menuconfig
+ # optional step: enable zaptel-perl
+ make
+ make install
+ # To install init scripts and config files:
+ #make config
+
+
+Zaptel PERL modules
+-------------------
+The directory xpp/utils has, in addition to helper utilities for the
+Xorcom Astribank, a collection of perl modules to provide information
+related to Zaptel. The perl modules themselves are under xpp/utils/zconf .
+In xpp/utils there are several utilities that use those modules:
+- xpp-specific: zt_registration, xpp_sync, xpp_blink .
+- General: lszaptel, zapconf, zaptel_hardware
+
+Those utilities require the perl modules to be installed, however they
+will also look for them in the directory zconf, and thus can be run
+directly from the zaptel source tree. For example:
+
+ ./xpp/utils/zaptel_hardware
+
+The modules and utilities are not installed by default in this version
+of zaptel . In order to get them installed, you need do the following
+before running 'make install': remove the '#' in the line that sets
+PERLLIBDIR in xpp/utils/Makefile . This can be done by e.g.:
+
+ sed -i -e 's/^#\(PERLLIBDIR\)/\1/' xpp/utils/Makefile
+
+To get usage information on a program, you can also use perldoc
+(sometimes provided in a package separate from perl itself). For
+instalnce:
+
+ perldoc ./xpp/utils/xpp_blink
What is the license for the zaptel driver?
-===================================================
+------------------------------------------
libpri is distributed under the terms of the GNU General Public License,
which permit its use and linking with other GPL'd software only.
The GNU GPL is included in the file LICENSE in this directory.
@@ -54,24 +177,20 @@
at reasonable cost.
-Brief F.A.Q
-===========
-
-Q. Zaptel compiled with no errors but when I try to modprobe zaptel I
-receive "FATAL: Error insering zaptel (/lib/modules/2.6.x.x/misc/zaptel.ko):
-Unknown symol in module or unknown parameter (see dmesg)
-
-A. You need to recompile your kernel with CONFIG_CRC_CCITT=y or
-CONFIG_CRC_CCITT=m. To do this, run 'make menuconfig' and change it under
-'Library Routines -> CRC-CCIT functions'. If you compiled it as a module,
-load it, otherwise reboot.
-
How do I report bugs or contribute?
-===================================
+-----------------------------------
Please report bug and patches to the Asterisk.org bug tracker at
http://bugs.digium.com in the "zaptel" category.
+
Does anything use this library so far?
-======================================
+--------------------------------------
Yes, the Asterisk Open Source PBX does. http://www.asterisk.org
+
+Links
+-----
+- http://asterisk.org/ - The Asterisk PBX
+- http://voip-info.org/
+- http://voip-info.org/wiki/view/Asterisk+Zaptel+Installation
+- http://www.zapatatelephony.org/ - A historical site.
Modified: team/tzafrir/kernelmove_conf/TODO
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/TODO?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/TODO (original)
+++ team/tzafrir/kernelmove_conf/TODO Thu Jul 5 03:44:37 2007
@@ -1,15 +1,18 @@
Working:
* Basic 2.6 build.
* userspace build.
-* autoconf/makefile fix. menuselect out.
+* Integrate kernel configuration into autoconf.
+* Integrate untilities configuration into autoconf (manual list).
+TODO:
+* Add config_info for the utilities as well.
+* But which of them do we build by default? Install by default?
* building of utilities subdirectories (currently: xpp-utils) is broken.
Workaround: exclpicit make -C kernel/xpp/utils [install]
* trim kernel/Makefile
-* build wct4xxp/ and wctc4xxp/ (the octasic API mess)
+* wct{,c}4xxp seems to miss dependencies on octasic.
Workaround: ./configure --with-modules=all,-wct4xxp/,-wctc4xxp/
* kernel 2.4 build
-* 'make clean' may trigger a configure of menuselect
* install
* fix building of datamods
* properly clean all programs
Propchange: team/tzafrir/kernelmove_conf/build_conf/
------------------------------------------------------------------------------
svn:ignore = *
Added: team/tzafrir/kernelmove_conf/build_tools/config_info
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/build_tools/config_info?view=auto&rev=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/build_tools/config_info (added)
+++ team/tzafrir/kernelmove_conf/build_tools/config_info Thu Jul 5 03:44:37 2007
@@ -1,0 +1,122 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use Getopt::Long;
+
+my $conf_dir = 'build_conf';
+
+my $category = '';
+my $command = 'targets_list';
+my $items_param;
+
+sub usage() {
+ print STDERR
+ "$0: get informaition from $conf_dir/ data.\n".
+ "\n".
+ "Usage: $0 --category CAT COMMAND\n".
+ "\n".
+ "Options:\n".
+ " -c |--category CAT Use data from $conf_dir/CAT . Required.\n".
+ " -l | --list Print a space-separated list of items in CAT.\n".
+ " -t | --targets Print a list of targets with their descriptions.\n".
+ " -h | --help This message\n".
+ "";
+}
+
+my $rc = GetOptions(
+ 'list|l' => sub {$command = 'list'},
+ 'fixdeps|f' => sub {$command = 'fixdeps'},
+ 'targets-list|targets|t' => sub {$command = 'targets_list'},
+ 'items|i=s' => \$items_param, # a list of items to fix dependencies for.
+ 'category|c=s' => \$category,
+ 'help|h' => sub {usage; exit 0;}
+);
+
+# Parse a config category (file)
+sub read_conf($) {
+ my $category = shift;
+ my %conf = ();
+
+ local $/ = "\n\n";
+ #$/ = "\n\n"; # read the file in paragraphs
+ open CONF,"$conf_dir/$category" or
+ die "Can't open config file $conf_dir/$category: $!";
+ while (<CONF>){
+ my %item_conf;
+ my @lines = split(/[\n]/);
+ foreach (@lines){
+ chomp;
+ my ($var, $val) = split(/: +/, $_, 2);
+ $item_conf{$var} = $val;
+ }
+ $conf{$item_conf{'Item'}} = \%item_conf;
+ }
+ return \%conf;
+}
+
+# prints a space-separated list of the items in inout category.
+sub run_list($){
+ my $category = shift;
+
+ my $conf = read_conf($category);
+ my @items = sort keys (%$conf);
+
+ print join(' ', @items);
+ print "\n";
+}
+
+# prints a space-separated list of the items in inout category.
+sub run_print_targets($){
+ my $category = shift;
+
+ my $conf = read_conf($category);
+ my @items = sort keys (%$conf);
+
+ for my $item (@items) {
+ next if (exists $conf->{$item}{'PullOnly'});
+
+ printf "%-12s %s\n", $item, $conf->{$item}{'DisplayName'}
+ }
+ print "\n";
+}
+
+
+sub run_fixdeps($$){
+ my ($category, $items_list) = @_;
+
+ my @items = split(' ', $items_list);
+
+ my %deps_map = ();
+
+ my $conf = read_conf($category);
+
+ for (my $item = shift @items; defined $item; $item = shift @items){
+ #print "got item $item\n";
+ if (!exists $conf->{$item}){
+ print STDERR "$0: Warning: item '$item' not found in configuration. Dropping\n";
+ next;
+ }
+ $deps_map{$item} = 1;
+ next unless (exists $conf->{$item}{'Depends'});
+ my @deps = split(/[ ,]+/, $conf->{$item}{'Depends'});
+
+ foreach my $dep (@deps) {
+ #print "got dependency $dep\n";
+ # if we haven't seen it, check it recursively, just in case
+ if (! exists $deps_map{$dep}) {
+ push(@items, ($dep));
+ }
+ }
+ }
+ my @answer = sort keys %deps_map;
+ print "".join(' ', @answer)."\n";
+}
+
+if ($command eq 'fixdeps') {
+ exit run_fixdeps($category, $items_param);
+} elsif ($command eq 'list') {
+ exit run_list($category);
+} elsif ($command eq 'targets_list') {
+ exit run_print_targets($category);
+}
Propchange: team/tzafrir/kernelmove_conf/build_tools/config_info
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove_conf/build_tools/config_info
------------------------------------------------------------------------------
svn:executable = Y
Propchange: team/tzafrir/kernelmove_conf/build_tools/config_info
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove_conf/build_tools/config_info
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/tzafrir/kernelmove_conf/build_tools/update_config
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/build_tools/update_config?view=auto&rev=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/build_tools/update_config (added)
+++ team/tzafrir/kernelmove_conf/build_tools/update_config Thu Jul 5 03:44:37 2007
@@ -1,0 +1,40 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+# extract configuration from kernel modules:
+
+sub extract_kernel() {
+ my $subdir = 'kernel';
+
+ foreach my $src (<$subdir/*.c> , <$subdir/*/*.c>) {
+ open SRC,$src or die "Can't read from source file $src: $!\n";
+
+ $src =~ m|.*/(.*)\.c|;
+ my $mod_name = $1;
+
+ my %data = ('Item' => $mod_name);
+ my $found = 0; # Does this file have a module info section?
+
+ while (<SRC>) {
+ next unless (m|^/\*\*\* MODULEINFO| .. m|^ \*\*\*/|);
+ next unless (m|^[A-Z]|);
+
+ # At this point we can assume we're in the module info section.
+ # Every line must of the format: Variable: its value
+ chomp;
+ $found = 1;
+
+ my ($var,$val) = split(/: +/, $_, 2);
+ $data{$var} = $val;
+ }
+ next unless ($found);
+
+ foreach my $var (sort keys %data) {
+ print $var.": $data{$var}\n";
+ }
+ print "\n";
+ }
+}
+
+extract_kernel;
Propchange: team/tzafrir/kernelmove_conf/build_tools/update_config
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove_conf/build_tools/update_config
------------------------------------------------------------------------------
svn:executable = Y
Propchange: team/tzafrir/kernelmove_conf/build_tools/update_config
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove_conf/build_tools/update_config
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: team/tzafrir/kernelmove_conf/configure
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/configure?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/configure (original)
+++ team/tzafrir/kernelmove_conf/configure Thu Jul 5 03:44:37 2007
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 2610 .
+# From configure.ac Revision: 6016 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61.
#
@@ -1278,7 +1278,7 @@
--with-ncurses=PATH use ncurses files in PATH
--with-newt=PATH use newt files in PATH
--with-usb=PATH use libusb files in PATH
- --with-modules kernel modules to build. all, none, or
+ --with-modules kernel modules to build. all, none, help, or
comma-separated list.
--with-ksrc kernel source path
--with-utils utilities to build. all, none, or comma-separated
@@ -5338,10 +5338,11 @@
-# FIXME: generate list automatically:
-ALL_MODULES="pciradio tor2 torisa wcfxo wct1xxp wctdm wctdm24xxp \
-wcte11xp wcte12xp wcusb zaptel ztd-eth ztd-loc ztdummy ztdynamic \
-zttranscode wct4xxp/ wctc4xxp/ xpp/"
+# Update configuration.
+# FIXME: do this on-demand, and remove hardwiring.
+build_tools/update_config >build_conf/kernel
+
+ALL_MODULES="`build_tools/config_info --list --category kernel`"
# Check whether --with-modules was given.
@@ -5356,6 +5357,17 @@
for val in `echo $use_modules | tr , ' ' `; do
case "$val" in
none) MODS='';;
+ help)
+ # FIXME: Usage of echo? exit 1?
+ echo "By default build all modules."
+ echo "To build just specific modules, provide a comma-separated list."
+ echo "Available modules:"
+ build_tools/config_info --category kernel --targets
+ echo ""
+ echo "all: build all."
+ echo "-MODULE: don't build module"
+ exit 1
+ ;;
all) MODS="$ALL_MODULES";;
-*) # -module: remove util:
remval=`echo $val | sed -e 's|^-||'`;
@@ -5365,31 +5377,8 @@
esac
done
-# verify all target modules are in ALL_MODULES:
-MODS_NEW=''
-echo $ALL_MODULES | tr ' ' '\n' >config.all_mods
-for mod in $MODS; do
- if grep -qF "$mod" config.all_mods; then
- MODS_NEW="$MODS_NEW $mod"
- fi
-done
-MODS="$MODS_NEW"
-rm config.all_mods
-
-# Fix dependencies: We'll get rid of duplicates later.
-# ztd-eth and ztd-loc need ztdynamic:
-if echo $MODS | egrep -q 'ztd-(eth|loc)'; then
- MODS="$MODS ztdynamic"
-fi
-
-# If there is any module: it needs zaptel
-if test "x$MODS" != 'x' && test "x$MODS" != 'x '; then
- MODS="$MODS zaptel"
-fi
-
-
-# Remove duplicates:
-MODS=`echo $MODS | tr ' ' '\n' | sort -u | xargs`
+# Fix dependencies, remove invalids, duplicates, etc.
+MODS="`build_tools/config_info --fixdeps --category kernel --items=\"$MODS\"`"
# Check whether --with-ksrc was given.
Modified: team/tzafrir/kernelmove_conf/configure.ac
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/configure.ac?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/configure.ac (original)
+++ team/tzafrir/kernelmove_conf/configure.ac Thu Jul 5 03:44:37 2007
@@ -60,14 +60,15 @@
AST_EXT_LIB([newt], [newtBell], [newt.h], [NEWT], [newt])
AST_EXT_LIB([usb], [usb_init], [usb.h], [USB], [libusb])
-# FIXME: generate list automatically:
-ALL_MODULES="pciradio tor2 torisa wcfxo wct1xxp wctdm wctdm24xxp \
-wcte11xp wcte12xp wcusb zaptel ztd-eth ztd-loc ztdummy ztdynamic \
-zttranscode wct4xxp/ wctc4xxp/ xpp/"
+# Update configuration.
+# FIXME: do this on-demand, and remove hardwiring.
+build_tools/update_config >build_conf/kernel
+
+ALL_MODULES="`build_tools/config_info --list --category kernel`"
AC_ARG_WITH(modules,
[AS_HELP_STRING([--with-modules],
- [kernel modules to build. all, none, or comma-separated list.])],
+ [kernel modules to build. all, none, help, or comma-separated list.])],
[use_modules="$withval"],
[use_modules="all"]
)
@@ -75,6 +76,17 @@
for val in `echo $use_modules | tr , ' ' `; do
case "$val" in
none) MODS='';;
+ help)
+ # FIXME: Usage of echo? exit 1?
+ echo "By default build all modules."
+ echo "To build just specific modules, provide a comma-separated list."
+ echo "Available modules:"
+ build_tools/config_info --category kernel --targets
+ echo ""
+ echo "all: build all."
+ echo "-MODULE: don't build module"
+ exit 1
+ ;;
all) MODS="$ALL_MODULES";;
-*) # -module: remove util:
remval=`echo $val | sed -e 's|^-||'`;
@@ -84,31 +96,8 @@
esac
done
-# verify all target modules are in ALL_MODULES:
-MODS_NEW=''
-echo $ALL_MODULES | tr ' ' '\n' >config.all_mods
-for mod in $MODS; do
- if grep -qF "$mod" config.all_mods; then
- MODS_NEW="$MODS_NEW $mod"
- fi
-done
-MODS="$MODS_NEW"
-rm config.all_mods
-
-# Fix dependencies: We'll get rid of duplicates later.
-# ztd-eth and ztd-loc need ztdynamic:
-if echo $MODS | egrep -q 'ztd-(eth|loc)'; then
- MODS="$MODS ztdynamic"
-fi
-
-# If there is any module: it needs zaptel
-if test "x$MODS" != 'x' && test "x$MODS" != 'x '; then
- MODS="$MODS zaptel"
-fi
-
-
-# Remove duplicates:
-MODS=`echo $MODS | tr ' ' '\n' | sort -u | xargs`
+# Fix dependencies, remove invalids, duplicates, etc.
+MODS="`build_tools/config_info --fixdeps --category kernel --items=\"$MODS\"`"
AC_ARG_WITH(ksrc,
[AS_HELP_STRING([--with-ksrc],[kernel source path])],
Modified: team/tzafrir/kernelmove_conf/doc/fxotune.8
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/doc/fxotune.8?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/doc/fxotune.8 (original)
+++ team/tzafrir/kernelmove_conf/doc/fxotune.8 Thu Jul 5 03:44:37 2007
@@ -1,50 +1,149 @@
-.TH FXOTUNE 8 "September 10th, 2005" "Xorcom Rapid Asterisk" "Linux Programmer's Manual"
+.TH FXOTUNE "8" "9 June 2007" "asterisk" "System Manager's Manuals: Asterisk"
.SH NAME
-.B fxotune
-\(em automatically tune FXO channels on a Digium TDM400 card
+fxotune \- automatically tune zaptel FXO channels
.SH SYNOPSIS
.B fxotune -i
-.I OPTIONS
-\(em detect
-
-.B fxotune -s
-\(em load settings
-
+.I [options]
+- detect mode
+
+.B fxotune -d
+.I [ options ]
+- dump mode
+
+.B fxotune -s
+- Startup mode
+.SH
.SH DESCRIPTION
.B fxotune
-is a script that fine-tune parameters of the FXO modules of the TDM400
-card. Whene run in
-.I detect
-mode (-i) it detects and tunes all the FXO channels of such cards. It
-needs a dial string after which the line(s) will give dial tone.
-
-It writes settings to a configuration file (/etc/fxotune.conf , name
-is hardwired) from which it can be loaded (e.g: at startup) using -s .
+is a script that fine-tune parameters of the FXO modules of the
+card. It has three modes of operation:
+
+.I Detect mode (-i):
+it detects and tunes all the available FXO channels.
+It writes settings to a configuration file (/etc/fxotune.conf)
+from which it can be loaded (e.g: at startup) using -s .
+
+.I Dump mode (-d):
+Runs detection on a single Zaptel channel, and just dumps waveforms to
+.B fxotune_dump.vals
+is generated in the current directory.
+
+.I Startup mode (-s):
+fxotune just reads the settings from fxotune.conf into the FXO modules.
You are advised to run fxotune on all FXO ports you have that support
it and that are connected. Note that the tunning is affected by e.g.
the physical parameters of the connection, and thus if it has been
radically changed, you may need to re-run fxotune.
+FXOTune only works for the Digium TDM400P/800P/2400P cards and
+compatible and the Xorcom Astribank devices. Other cards (notably X100P
+cards and clones) do not have the hardware to support such tuning.
+
+The tuning process needs a clear line to do the tuning. In order to do
+that, it runs in cycles of the following: sets the line off-hook, dials
+a dial string (which should set the PSTN provider waiting for the next
+digit), and then starts tuning. It has a limited ammount of time for
+tuning before the PSTN gives up and gives a busy tone. So after a while
+it hangs up and starts a new cycle.
+
.B fxotune
has two operation modes: tune (-i) and set (-s). In the tune mode it
generates /etc/fxotune.conf, and in the set mode it merely applies the
parameters from fxotune.conf to device's ports.
.SH OPTIONS
-.B THIS SECTION CURRENTLY DOCUMENTS THE OLD SYNTAX OF FXOTUNE. RUN fxotune
-WITHOUT ANY PARAMETERS TO GET A USAGE MESSAGE.
-
-.B -i
-.RS
-.I dialstr
-Start detecting optimal settings.
-.I dialstr
-Is a number needed to dial to get a dial tone.
-The test can take several minutes, and must be performed when Asterisk
-is not running.
-
-For example:
+The following options below except -v (verbose) affect only the
+detection process and hence apply only to the
+.I detect
+and
+.I dump
+modes.
+
+In addition, to maintain compatibility with older versions of fxotune,
+if in detect or dump mode there is a parameter with option before it, it
+is considered to be the
+.I dialstring
+parameter (-n).
+
+.B -b
+.I startdev
+.RS
+Start tuning from zaptel channel num. \fI startdev\fR: skip all previous
+channels. By default starting from channel 1.
+
+In dump mode (-d) this is the single channel that will be tested.
+.RE
+
+.B -e
+.I stopdev
+.RS
+Tune only up to zaptel channel num. \fI stopdev\fR: skip all previous
+channels. By default stopping at channel 252.
+
+In dump mode (-d) this parameter is ignored.
+.RE
+
+.B -l
+.I delay-to-silence
+.RS
+Time in seconds to wait after dialing the dial-string to get a clear line.
+The default is 0.
+before
+.RE
+
+.B -m
+.I silence-good-for
+.RS
+Time in seconds which states how long the PSTN will wait after we dialed
+the dial-string until it starts giving a busy tone. You can test this by
+connecting an analog phone to the line and dialing.
+
+The default is 18 (18 seconds).
+.RE
+
+.B -n
+.I dial-string
+.RS
+Digits to dial to the PSTN in order to get it stop its dialtone and
+waiting for the next digit.
+
+The default is "4" (sending just the digit 4). It should work in most
+cases. Again, this can be tested by connecting a phone to the PSTN line
+and dialing the dial-string.
+.RE
+
+.B -t
+.I detect-type
+.RS
+This option allows using the older detection method used by fxotune of
+zaptel 1.2. use
+.B -t 1
+for that older method. whereas
+.B -t 2
+(the default) uses the current method.
+
+This option only applies to detect mode (-i).
+.RE
+
+.B -v[vvvv]
+.RS
+Sets debugging on. The more v-s, the higher debug level.
+
+Note that: -vv -v will actually set debug level to 1 instead of 3.
+.RE
+
+.B -w
+.I wave-form
+.RS
+The default: -1, for multitone waveform. Alternatively: a frequency of a
+single tone.
+
+This option only applies to dump mode (-d).
+.RE
+
+
+.SH EXAMPLES
.RS
fxotune -i 9
.RE
@@ -75,7 +174,7 @@
.B fxotune
writes immedietly to
-.B /etc/fxo.conf
+.B /etc/fxotune.conf
so if you stop it half-way, you may get a half-configured system. If you
have already tuned your FXO channels and wish to test-run fxotune again,
you are advised to backup /etc/fxotune.conf .
@@ -83,7 +182,7 @@
The default for -m is 18 seconds. This asusmes that you get a clear line
for at least 18 seconds. It is advised that you test that timeout earlier
by connecting a phone to the FXO line, dialing 4 (or whatever dial string
-you put with ___) and see how much time of silence you have.
+you put with -n) and see how much time of silence you have.
If you connect your device to a PSTN provider that is not in the US, there
is a similar operation you should apply before even getting to fxotune:
@@ -91,6 +190,8 @@
parameters. For the Digium analog cards this is set through the kernel module
parameter 'opermode' . For the Xorcom Astribank this is set through the
variable 'opermode' in /etc/default/zaptel or /etc/sysconfig/zaptel .
+For valid values of this parameter, see
+/usr/share/asterisk/init_fxo_modes .
.SH SEE ALSO
ztcfg(8), zttool(8), ztmonitor(8), asterisk(8).
Added: team/tzafrir/kernelmove_conf/doc/fxstest.8
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/doc/fxstest.8?view=auto&rev=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/doc/fxstest.8 (added)
+++ team/tzafrir/kernelmove_conf/doc/fxstest.8 Thu Jul 5 03:44:37 2007
@@ -1,0 +1,60 @@
+.TH "FXSTEST" "8" "9 June 2007" "asterisk" "System Manager's Manuals: Asterisk"
+
+.SH NAME
+fxstest \- Simple tests for Zaptel FXS adapters
+.SH SYNOPSIS
+
+.B fxstest /dev/zap/\fIN comand\fR
+
+.SH DESCRIPTION
+fxstest can be used to issue one of a number simple tests to FXS
+adapters (analog adapters intended to connect phones).
+
+.SH OPTIONS
+All of those tests operate on a single zaptel channel which has to be an
+FXS port, and must not be in use by Asterisk or any other program.
+
+The command has two mandatory parameters.
+The first parameter is the device file to operate on. It is typically
+/dev/zap/NN , a device file under /dev/zap .
+
+The second parameter is the name of the command to run on that channel:
+
+.I stats
+.RS
+Reports voltages
+.RE
+
+.I regdump
+.RS
+Dumps ProSLIC registers
+.RE
+
+.I tones
+.RS
+Plays a series of tones
+.RE
+
+.I polarity
+.RS
+Requests channel to reverse polarity.
+.RE
+
+.I ring
+.RS
+Rings phone
+.RE
+
+.SH "SEE ALSO"
+.PP
+zttool(8), ztcfg(8), ztmonitor(8), asterisk(8).
+.SH BUGS
+Does not allow testing channels beyond 249. Should support opening
+channels through /dev/zap/channel .
+.SH AUTHOR
+.PP
+This manual page was written by Tzafrir Cohen <tzafrir.cohen at xorcom.com> .
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU General Public License, Version 2 any
+later version published by the Free Software Foundation.
+.PP
Propchange: team/tzafrir/kernelmove_conf/doc/fxstest.8
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/tzafrir/kernelmove_conf/doc/fxstest.8
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/tzafrir/kernelmove_conf/doc/fxstest.8
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: team/tzafrir/kernelmove_conf/doc/ztcfg.8
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/doc/ztcfg.8?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/doc/ztcfg.8 (original)
+++ team/tzafrir/kernelmove_conf/doc/ztcfg.8 Thu Jul 5 03:44:37 2007
@@ -50,7 +50,8 @@
zttool(8), ztmonitor(8), asterisk(8).
.SH "AUTHOR"
.PP
-This manual page was written by Santiago Ruano Rincón <santiago at unicauca.edu.co> for
+This manual page was written by Santiago Ruano Rinc\['o]n
+<santiago at unicauca.edu.co> for
the Debian system (but may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the GNU General Public License, Version 2 any
Modified: team/tzafrir/kernelmove_conf/doc/ztmonitor.8
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/doc/ztmonitor.8?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/doc/ztmonitor.8 (original)
+++ team/tzafrir/kernelmove_conf/doc/ztmonitor.8 Thu Jul 5 03:44:37 2007
@@ -32,7 +32,8 @@
zttool(8), ztcfg(8), asterisk(8).
.SH "AUTHOR"
.PP
-This manual page was written by Santiago Ruano Rincón <santiago at unicauca.edu.co> for
+This manual page was written by Santiago Ruano Rinc\['o]n
+<santiago at unicauca.edu.co> for
the Debian system (but may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the GNU General Public License, Version 2 any
Modified: team/tzafrir/kernelmove_conf/doc/zttool.8
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/doc/zttool.8?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/doc/zttool.8 (original)
+++ team/tzafrir/kernelmove_conf/doc/zttool.8 Thu Jul 5 03:44:37 2007
@@ -23,7 +23,8 @@
ztmonitor(8), asterisk (8).
.SH "AUTHOR"
.PP
-This manual page was written by Santiago Ruano Rincón <santiago at unicauca.edu.co> for
+This manual page was written by Santiago Ruano Rinc\['o]n
+<santiago at unicauca.edu.co> for
the Debian system (but may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the GNU General Public License, Version 2 any
Modified: team/tzafrir/kernelmove_conf/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/firmware/Makefile?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/firmware/Makefile (original)
+++ team/tzafrir/kernelmove_conf/firmware/Makefile Thu Jul 5 03:44:37 2007
@@ -165,4 +165,6 @@
../build_tools/make_firmware_object zaptel-fw-oct6114-128.bin $@
# Build object file of a TC400M firmware image for linking
-zaptel-fw-tc400m.o:
+zaptel-fw-tc400m.o: zaptel-fw-tc400m-$(TC400M_VERSION).tar.gz ../wctc4xxp/base.o zaptel-fw-tc400m.bin
+ @echo Making firmware object file for zaptel-fw-tc400m.bin
+ ../build_tools/make_firmware_object zaptel-fw-tc400m.bin $@ ../wctc4xxp/base.o
Modified: team/tzafrir/kernelmove_conf/kernel/pciradio.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/kernel/pciradio.c?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/kernel/pciradio.c (original)
+++ team/tzafrir/kernelmove_conf/kernel/pciradio.c Thu Jul 5 03:44:37 2007
@@ -25,6 +25,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
+
+/*** MODULEINFO
+Depends: zaptel
+DisplayName: PCI Radio
+ ***/
/*
The PCI Radio Interface card interfaces up to 4 two-way radios (either
Modified: team/tzafrir/kernelmove_conf/kernel/tor2.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/kernel/tor2.c?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/kernel/tor2.c (original)
+++ team/tzafrir/kernelmove_conf/kernel/tor2.c Thu Jul 5 03:44:37 2007
@@ -24,6 +24,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+/*** MODULEINFO
+Depends: zaptel
+DisplayName: Tormenta 2
+ ***/
#include <linux/kernel.h>
#include <linux/errno.h>
Modified: team/tzafrir/kernelmove_conf/kernel/torisa.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_conf/kernel/torisa.c?view=diff&rev=2695&r1=2694&r2=2695
==============================================================================
--- team/tzafrir/kernelmove_conf/kernel/torisa.c (original)
+++ team/tzafrir/kernelmove_conf/kernel/torisa.c Thu Jul 5 03:44:37 2007
@@ -18,6 +18,11 @@
* Modified from original tor.c by Mark Spencer <markster at digium.com>
* original by Jim Dixon <jim at lambdatel.com>
*/
+
+/*** MODULEINFO
[... 1094 lines stripped ...]
More information about the zaptel-commits
mailing list