dahdi/tools.git
5 years agoChange span-type.conf generation policy
Oron Peled [Mon, 20 Jan 2014 18:10:56 +0000 (20:10 +0200)]
Change span-type.conf generation policy

* Add '--line-mode=<E1|T1|J1>' option to dahdi_span_types:
  - Will first generate a wildcard entry (* *:<type>)
  - All later entries will be commented-out.
  - Manually uncommenting any of them will create an "override"
    (e.g: mixed system with all spans T1, but some E1)

* Now dahdi_genconf does not generate span-types.conf by default:
  - Added '--line-mode=<E1|T1|J1>' option to trigger generation
  - This parameter will be passed to "dahdi_span_types dumpconfig"
  - Also explicit specification of 'spantypes' as an argument will
    trigger a similar generation (with a default of 'E1').
  - The line-mode may also be passed to the generator directly
    with identical results. Example:
          dahdi_genconf spantypes=line-mode=T1

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_types: allow defaults + overrides
Oron Peled [Mon, 20 Jan 2014 18:10:55 +0000 (20:10 +0200)]
dahdi_span_types: allow defaults + overrides

* Allow wildcards for both device and span number (as before).
  Example:
     *        *:T1

* But now we are carefull to follow strict order in the configuration
  file. This means, if there are multiple matches -- last one wins.

* So we can use specialisation:
     *        *:T1 # Everything is T1
     FOO      [34]:T1 # Except spans 3,4 on the FOO device

* Added --dry-run and --verbose options.

* Updated the man-page:
  - Fixed "registered" => "assigned".
  - Use "line mode" for E1/J1/T1.
  - Document current changes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_assignments.8: s/register/assign/
Tzafrir Cohen [Thu, 23 Jan 2014 13:07:31 +0000 (15:07 +0200)]
dahdi_span_assignments.8: s/register/assign/

* Use the term "assignment" instead of "registration" (for spans).
* Further fixes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-By: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agonew "dahdi_waitfor_span_assignments" tool
Oron Peled [Thu, 16 Jan 2014 13:03:22 +0000 (08:03 -0500)]
new "dahdi_waitfor_span_assignments" tool

* Allows waiting until all spans are "assigned" or "unassigned"
* Current implementation use a polling loop with sleep
* Future implementation may block on sysfs attribute
  (like waitfor_xpds is blocking on sysfs Astribanks attribute)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug modularization: split logic to scriptlets
Oron Peled [Thu, 16 Jan 2014 10:31:17 +0000 (12:31 +0200)]
hotplug modularization: split logic to scriptlets

* Device related operations are ordered in /usr/share/dahdi/handle_device.d/
* Span related operations are ordered in /usr/share/dahdi/span_config.d/
* In the future, span_config.d/50-asterisk should be moved to Asterisk.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug modularization: move sources to a subdir
Oron Peled [Thu, 16 Jan 2014 10:29:04 +0000 (12:29 +0200)]
hotplug modularization: move sources to a subdir

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agowcte13xp: Teach tools about te131 te132 products
Russ Meyerriecks [Wed, 18 Dec 2013 21:57:44 +0000 (15:57 -0600)]
wcte13xp: Teach tools about te131 te132 products

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: Allow dynamic spans to handle udev based span assignment.
Shaun Ruffell [Wed, 8 Jan 2014 20:11:03 +0000 (14:11 -0600)]
dahdi_cfg: Allow dynamic spans to handle udev based span assignment.

Prior to this commit, if auto_assign_spans was set to 0, it was possible to
get in an endless loop creating and destroying spans. The primary reason was
that all dynamic spans are destroyed and recreated each time dahdi_cfg runs, BUT
dahdi_cfg was run each time a new span showed up in udev when auto_assign_spans
was set to 0.

Now dahdi_cfg will only destroy and recreate dynamic spans if dahdi_cfg is run
without a specifc span number. Also, while creating dynamic spans, dahdi_cfg
will pause for up to one second for the span to be assigned in order to ensure
that the spans are numbered consistently when auto span assignment is
configured.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: Add semaphore to prevent parallel execution.
Shaun Ruffell [Thu, 2 Jan 2014 23:31:19 +0000 (17:31 -0600)]
dahdi_cfg: Add semaphore to prevent parallel execution.

When dahdi is configured for fully dynamic configuration on a device and
span basis via sysfs and udev it is possible for multiple instances of
dahdi_cfg to be run in parallel on different spans. If this happens it
is possible to see errors on the console that tone zones are already
registered since the check for the existence of a tone zone and the
re-registering needs to be atomic.

dahdi_cfg will now prevent itself from running in parallel.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_handle_device: Auto assign only the device being added.
Shaun Ruffell [Thu, 9 Jan 2014 00:14:05 +0000 (18:14 -0600)]
dahdi_handle_device: Auto assign only the device being added.

Eliminates trying to add spans multiple times as seen below:

    'dahdi_handle_device'[21993]: add: /devices/dynamic:loc:1
    'dahdi_handle_device'[21991]: add: /devices/dynamic:loc:0
    'dahdi_handle_device'[22001]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:0
    'dahdi_handle_device'[22001]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:1
    'dahdi_handle_device'[21999]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:0
    'dahdi_handle_device'[21999]: auto-assign /sys/bus/dahdi_devices/devices/dynamic:loc:1
    kernel: [ 3348.312534] dahdi_devices dynamic:loc:0: local span 1 is already assigned span 1
    kernel: [ 3348.312552] dahdi_devices dynamic:loc:1: local span 1 is already assigned span 2

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_span_types: Show location of configuration file in help message.
Shaun Ruffell [Thu, 9 Jan 2014 00:14:04 +0000 (18:14 -0600)]
dahdi_span_types: Show location of configuration file in help message.

Makes similar in for the dahdi_span_assignments in that the location of the
default configuration file is shown in the help screen.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_genconf: Add 'modules', 'spantypes', and 'assignedspans' to list of available...
Shaun Ruffell [Thu, 9 Jan 2014 00:14:03 +0000 (18:14 -0600)]
dahdi_genconf: Add 'modules', 'spantypes', and 'assignedspans' to list of available generators.

This is a documentation change, that hopefully will help until I can remember
the names of the new generators.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_genconf: don't generate spantypes by default
Tzafrir Cohen [Mon, 20 Jan 2014 13:23:43 +0000 (15:23 +0200)]
dahdi_genconf: don't generate spantypes by default

A sane value for span-types.conf is either "all E1" or "all T1". Either
way it is not hardware-dependent, and hence no point in regenerating on
when the hardware changes.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agospan_types/assignments: no * in device list
Tzafrir Cohen [Thu, 2 Jan 2014 09:14:38 +0000 (11:14 +0200)]
span_types/assignments: no * in device list

If there are no dahdi devices, $devbase/* expans to have a literal '*',
which leads to warnings such as:
/usr/sbin/dahdi_span_types: 1: cd: can't cd to /sys/bus/dahdi_devices/devices/*

Let's just avoid those.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_handle_device, dahdi_span_config: Check for auto_assign_spans only when ACTION...
Shaun Ruffell [Sat, 21 Dec 2013 06:17:01 +0000 (00:17 -0600)]
dahdi_handle_device, dahdi_span_config: Check for auto_assign_spans only when ACTION is add.

When dahdi.ko is unloaded, it may be possible for the driver to be removed from
the kernel before the udev scripts are run.  When this happens, you'll see
messages like the following which are not accurate:

    'dahdi_handle_device'[24567]: Old driver (no auto_assign_spans parameter). Skip /devices/pci0000:00/0000:00:1e.0/0000:11:01.0/pci:0000:11:01.0

Now instead you will see:

    'dahdi_handle_device'[28008]: remove: /devices/pci0000:00/0000:00:1e.0/0000:11:01.0/pci:0000:11:01.0

Also, all the udev events will be logged in the system log even when they are
ignored because of legacy auto span assignment. This will help show what is
going on during the transition period to full udev configuration of spans.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agoREADME: Update the install targets
Tzafrir Cohen [Mon, 30 Dec 2013 17:24:23 +0000 (19:24 +0200)]
README: Update the install targets

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoREADME: document initialization
Tzafrir Cohen [Mon, 30 Dec 2013 12:38:49 +0000 (14:38 +0200)]
README: document initialization

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoREADME: indentation level for config samples
Tzafrir Cohen [Sun, 29 Dec 2013 11:43:05 +0000 (13:43 +0200)]
README: indentation level for config samples

Indent the configuration samples one level deeper

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years ago.gitignore: more generated files
Tzafrir Cohen [Sun, 29 Dec 2013 11:51:28 +0000 (13:51 +0200)]
.gitignore: more generated files

Ignore test binaries and files generated by 'make docs'

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_span_config: Do not run auto span configuration if spans are auto assigned.
Shaun Ruffell [Thu, 19 Dec 2013 22:37:15 +0000 (16:37 -0600)]
dahdi_span_config: Do not run auto span configuration if spans are auto assigned.

I have seen cases were users run:

  # modprobe <driver>; dahdi_cfg -c <custom config file>

and the spans end up misconfigured because dahdi_span_assignments ends up
running, via udev, after the user configured the span the way it wanted.

dahdi_span_assignments now looks at auto_assign_spans module parameter on
dahdi.ko, like dahdi_handle_device already does, to determine if legacy or udev
based configuration is being done.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agodahdi.rules: use += for RUN
Tzafrir Cohen [Thu, 12 Dec 2013 13:45:14 +0000 (15:45 +0200)]
dahdi.rules: use += for RUN

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: Replace SYSFS with ATTRS
Tzafrir Cohen [Wed, 11 Dec 2013 10:35:49 +0000 (12:35 +0200)]
dahdi.rules: Replace SYSFS with ATTRS

SYSFS has been deprecated. Use ATTRS.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_cfg: Wait for all spans to be assigned.
Shaun Ruffell [Mon, 9 Dec 2013 23:19:23 +0000 (17:19 -0600)]
dahdi_cfg: Wait for all spans to be assigned.

When auto span assignment is disabled, it's possible that simply running

  # /etc/init.d/dahdi restart

Will fail since dahdi_cfg can run in parallel with udev scripts that are
assigning spans, which results in /etc/dahdi/system.conf describing spans that
do not exist in the system.

This change sets up dahdi_cfg, when run without the -C or -S options, to look in
sysfs and make sure all spans for each device are assigned.  dahdi_cfg will wait
5 seconds for span assignment to happen before proceeding normally.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoMakefile: do install all man-pages
Oron Peled [Sun, 8 Dec 2013 13:52:26 +0000 (15:52 +0200)]
Makefile: do install all man-pages

Fixes a regression in 2.8 (ffced0ca) in the main Makefile:
MAN_PAGES gets assigned twice and thus most man pages will not get
installed.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoMakefile: new 'make-dist' target v2.8.0 v2.8.0-rc5
Oron Peled [Mon, 25 Nov 2013 21:37:38 +0000 (23:37 +0200)]
Makefile: new 'make-dist' target

Creates a tar.gz:
* Identical results to Digium's distributed tarballs
* Named "dahdi-tools-<version>.tar.gz"
* Only from committed files (uses git-archive)
* Adds a .version file

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_span_assignments, dahdi_span_types: Allow conf file to be overridden.
Shaun Ruffell [Tue, 26 Nov 2013 18:55:09 +0000 (12:55 -0600)]
dahdi_span_assignments, dahdi_span_types: Allow conf file to be overridden.

The environment variables that specified the full path the the configuration
files for dahdi_span_types and dahdi_span_assignments was documented, but they
were not actually set from the environment.

Also, the case of the variable was changed to match the one for the directory
where the rest of the config files are located.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agoAdd dahdi_ prefix to handle_device, span_types, span_assignments, and span_config.
Shaun Ruffell [Tue, 26 Nov 2013 15:15:13 +0000 (09:15 -0600)]
Add dahdi_ prefix to handle_device, span_types, span_assignments, and span_config.

All new dahdi tools and utilities will be prefixed with "dahdi_" in order to
avoid any future conflicts with other packages.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agospan_types: Fix bug that would prevent matching on devpath.
Shaun Ruffell [Tue, 26 Nov 2013 02:21:14 +0000 (20:21 -0600)]
span_types: Fix bug that would prevent matching on devpath.

If a configuration file was specified that used the devpath, like:

  # Device: [] @Board_ID_Switch_0 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 1:E1
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 2:E1
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 3:E1
  /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 4:E1

Then the span_types script would silently fail to match the configuration lines
for the device and silently fail to change the linemodes.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

5 years agoconfigure: regenerate for 6d10525
Tzafrir Cohen [Sun, 24 Nov 2013 16:09:16 +0000 (18:09 +0200)]
configure: regenerate for 6d10525

Regenerate configure script following changes in commit
6d10525863d91335cd09b0400ddfb85433e107ed.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi.init: Remove spurious "Missing '/sys/bus/astribanks/drivers/xppdrv/sync'".
Shaun Ruffell [Fri, 22 Nov 2013 21:08:29 +0000 (15:08 -0600)]
dahdi.init: Remove spurious "Missing '/sys/bus/astribanks/drivers/xppdrv/sync'".

The xpp_sync will fail if there are not any Astribank devices loaded. Check for
existence of the tools before trying to sync.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoREADME: include pinned spans config files
Tzafrir Cohen [Fri, 18 Oct 2013 06:27:30 +0000 (09:27 +0300)]
README: include pinned spans config files

Include pinned-spans.conf and span-types.conf in the generated
README.html. Reformat them to render properly.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoTerminology rename: "pinned" -> "assigned"
Oron Peled [Mon, 18 Nov 2013 16:14:34 +0000 (11:14 -0500)]
Terminology rename: "pinned" -> "assigned"

* File names fixed
* File contents fixed

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: add persistent channel names as well
Oron Peled [Mon, 21 Oct 2013 15:04:39 +0000 (18:04 +0300)]
dahdi.rules: add persistent channel names as well

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: don't process "add" events unless needed
Oron Peled [Mon, 21 Oct 2013 15:03:26 +0000 (18:03 +0300)]
dahdi.rules: don't process "add" events unless needed

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agohotplug: run fxotune from span_config:
Oron Peled [Mon, 21 Oct 2013 10:06:18 +0000 (12:06 +0200)]
hotplug: run fxotune from span_config:

* Use fxotune -b/-e options to run on wanted channel range

5 years agofxotune: Now options '-b/-e' also apply with '-s'
Oron Peled [Mon, 21 Oct 2013 10:54:58 +0000 (12:54 +0200)]
fxotune: Now options '-b/-e' also apply with '-s'

* Now we can limit fxotune "set" mode to specific channel range.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi.rules: use tools_rootdir from driver
Oron Peled [Mon, 21 Oct 2013 15:02:04 +0000 (18:02 +0300)]
dahdi.rules: use tools_rootdir from driver

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agospan_types: fix for white-space in hardware_id
Oron Peled [Mon, 4 Nov 2013 15:25:25 +0000 (10:25 -0500)]
span_types: fix for white-space in hardware_id

* Sanitize hardware_id/location attributes, just like span_assignments
* Allow control of keys via SPAN_ASSIGNMENTS_KEY or '-k <key>' option
* In general, import most features/options from span_assignments

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoudev scripts now read /etc/dahdi/init.conf
Oron Peled [Tue, 15 Oct 2013 17:09:30 +0000 (20:09 +0300)]
udev scripts now read /etc/dahdi/init.conf

Added two override variables in init.conf:
* DAHDI_UDEV_DISABLE_DEVICES
* DAHDI_UDEV_DISABLE_SPANS

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agosysfs: restored legacy names /etc/dahdi/<channo>:
Oron Peled [Tue, 15 Oct 2013 18:01:01 +0000 (21:01 +0300)]
sysfs: restored legacy names /etc/dahdi/<channo>:

Update dahdi.rules to create again the old fashioned device files
(/dev/dahdi/<channo>), but as symlinks to modern names.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoadded udev rules and their install target:
Oron Peled [Tue, 15 Oct 2013 18:00:17 +0000 (21:00 +0300)]
added udev rules and their install target:

* Added missing Makefile install rule for dahdi.rules
* Pulled xpp.rules from dahdi-linux and added install rules for it

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agopinned-spans: remove '--enable-pinned' from configure
Oron Peled [Tue, 15 Oct 2013 14:45:38 +0000 (17:45 +0300)]
pinned-spans: remove '--enable-pinned' from configure

pinned-spans utilities are now essential:
* Called by udev rules
* Called by dahdi_genconf

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agopinned-spans: fix examples in configuration files
Oron Peled [Tue, 15 Oct 2013 17:56:31 +0000 (20:56 +0300)]
pinned-spans: fix examples in configuration files

* Correctly use the new "location" attribute
* Document the possibility to match against sysfs devpath
  (used to be the "location")

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agopinned-spans: fix configuration file names
Oron Peled [Tue, 15 Oct 2013 17:54:54 +0000 (20:54 +0300)]
pinned-spans: fix configuration file names

* Install them as *.conf.sample -- that's what they are
* Correctly rename spantype.conf to span-types.conf (new name)

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi_genconf: Do not fail if pinned/assigned span utilities were not installed. v2.8.0-rc2 v2.8.0-rc3 v2.8.0-rc4
Shaun Ruffell [Thu, 14 Nov 2013 18:19:45 +0000 (12:19 -0600)]
dahdi_genconf: Do not fail if pinned/assigned span utilities were not installed.

If you installed dahdi tools and did not specify DAHDI_PINNED=yes on the
makefile, when you run dahdi_genconf you would get an error like the following:

  # dahdi_genconf
  sh: span_types: command not found
  Command failed (status=32512): 'span_types dumpconfig > /etc/dahdi/span-types.conf' at ...

This change allows the generator for span-types.conf and span-assignements.conf
check for the existence of the utilities before attempting to call them.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agowcte43x: Teach tools about the wcte43x driver. v2.8.0-rc1
Shaun Ruffell [Mon, 11 Nov 2013 21:39:20 +0000 (15:39 -0600)]
wcte43x: Teach tools about the wcte43x driver.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agowcaxx: Teach tools about the wcaxx driver.
Shaun Ruffell [Mon, 11 Nov 2013 21:35:56 +0000 (15:35 -0600)]
wcaxx: Teach tools about the wcaxx driver.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agoxpp_fxloader: support loading AB with ID > 201
Tzafrir Cohen [Mon, 21 Oct 2013 12:16:14 +0000 (15:16 +0300)]
xpp_fxloader: support loading AB with ID > 201

Support loading firmware for Astribanks with bcdDevice > 2.01, as we'll
have 2.02 soon.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agofix typos in man-page
Oron Peled [Mon, 14 Oct 2013 09:15:49 +0000 (11:15 +0200)]
fix typos in man-page

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoMan pages for span_types and span_assignments
Tzafrir Cohen [Sun, 13 Oct 2013 20:28:29 +0000 (23:28 +0300)]
Man pages for span_types and span_assignments

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoRemove dahdi_map, obsoleted by span_assignments
Tzafrir Cohen [Wed, 2 Oct 2013 18:54:58 +0000 (21:54 +0300)]
Remove dahdi_map, obsoleted by span_assignments

dahdi_map can be replaced by span_assignments list / dumpconfig

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_registration: adapt to pinned-spans
Oron Peled [Sun, 29 Sep 2013 16:24:08 +0000 (18:24 +0200)]
dahdi_registration: adapt to pinned-spans

* If xpp.dahdi_autoreg parameter is 'Y' -- Skip actuall registration.
* If dahdi.auto_assign_spans is '0' and there's no /etc/dahdi/pinned-spans.conf
  Than use 'span_assignments auto ...' to assign device spans.
* Since dahdi_registration iterate in correct xpp_order, the span
  assignment logic provides migration path for users who did not
  generate their pinned-spans.conf configuration yet.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agospan_assignments: -k / --keys and more
Oron Peled [Sun, 29 Sep 2013 08:09:56 +0000 (10:09 +0200)]
span_assignments: -k / --keys and more

* New functionality (documented in the script header):
  - Alternative "keys" for device matching
  - Added new command line options: --help, --dry-run, --verbose, --key

* Clean sysfs attribute contents from special characters in every use-case.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoDo the Right Thing when there's no config
Tzafrir Cohen [Tue, 1 Oct 2013 19:13:43 +0000 (22:13 +0300)]
Do the Right Thing when there's no config

Do the "right thing" (hopefully. At least for a system with a single
device) if there is are no configuration files:

* No span-types.conf: just ignore it as before. It is optional.
* No pinned-spans.conf: use span_assignments auto (same as having
  dahdi.auto_assign_spans=1).
* No system.conf: generate a temporary one with dahdi_genconf.

This will hopefully allow having a partially-working system, and help
making ut usable with 'span_assignments dumpconfig'. Or maybe just work
as-is.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agodahdi_cfg: can optionally read config from stdin
Oron Peled [Sun, 6 Oct 2013 13:10:48 +0000 (16:10 +0300)]
dahdi_cfg: can optionally read config from stdin

Allow for the convention of '-' marking stdin:

  dahdi_cfg -c -

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoAugment dahdi_genconf default generators list
Oron Peled [Mon, 23 Sep 2013 15:11:36 +0000 (17:11 +0200)]
Augment dahdi_genconf default generators list

Run Add spantypes and pinnedspans generators by default.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoadd new dahdi_genconf generators
Oron Peled [Mon, 23 Sep 2013 15:08:49 +0000 (17:08 +0200)]
add new dahdi_genconf generators

* pinnedspas: For /etc/dahdi/pinned-spans.conf
* spantypes: For /etc/dahdi/span-types.conf

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoremove unused dahdi_cfg_device_args
Oron Peled [Mon, 23 Sep 2013 15:19:03 +0000 (17:19 +0200)]
remove unused dahdi_cfg_device_args

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agohandle_device: don't fail if no config files
Tzafrir Cohen [Mon, 23 Sep 2013 17:43:25 +0000 (20:43 +0300)]
handle_device: don't fail if no config files

Allow the udev rule to work well even if there's no span-types.conf

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agoNewer version of DAHDI hotplug scripts
Oron Peled [Mon, 23 Sep 2013 11:59:14 +0000 (13:59 +0200)]
Newer version of DAHDI hotplug scripts

A newer version of the scripts fully adapted to pinned spans:
* handle_device does not run dahdi_cfg.
* A separate UDEV rule script for that: span_config. Should also work
  for the non-pinned case.
* span_assignments, span_types: add actions 'auto' (manually enable all)
  and 'dumpconfig' (dump current status in the format of configuration
  file).
* Fixed name of span_types and span_assignments (no '-').
* spantype.conf renamed span-types.conf: configuration files do have a
  dash.
* Those two are useful programs, insstalled to /usr/sbin.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

5 years agobuild_tools/make_version: Teach version string about git. v2.7.0.1 v2.7.0.2
Shaun Ruffell [Wed, 12 Jun 2013 17:03:55 +0000 (12:03 -0500)]
build_tools/make_version: Teach version string about git.

This copies in the make_version script from DAHDI-Linux to allow the version to
be properly reported from builds in git checkouts.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agoAdd support for Digium's new te13x line of cards v2.7.0 v2.7.0-rc1
Russ Meyerriecks [Tue, 28 May 2013 22:06:10 +0000 (17:06 -0500)]
Add support for Digium's new te13x line of cards

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agofxotune: Use DAHDI_SPECIFY when opening by integer channel number.
Shaun Ruffell [Thu, 9 May 2013 15:34:20 +0000 (10:34 -0500)]
fxotune: Use DAHDI_SPECIFY when opening by integer channel number.

In DAHDI-Linux 2.7 the layout of the /dev/dahdi files changes so that they are
grouped by span. When opening channels by number all utilities need to use
DAHDI_SPECIFY now.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agodahdi_cfg: Make -S option based on spannumber instead of order in config file.
Shaun Ruffell [Thu, 9 May 2013 19:03:46 +0000 (14:03 -0500)]
dahdi_cfg: Make -S option based on spannumber instead of order in config file.

If the config file has two spans defined:

  span=1,1,0,esf,b8zs
  bchan=1-23
  dchan=24
  echocanceller=mg2,1-23
  span=2,2,0,esf,b8zs
  bchan=25-47
  dchan=48

And you only want to configure span-2, you would need to pass -S 1 to
dahdi_cfg. Now make the -S option take the span number as assigned in the
config file.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agofxstest: Use DAHDI_SPECIFY when opening by integer channel number.
Shaun Ruffell [Thu, 9 May 2013 15:34:20 +0000 (10:34 -0500)]
fxstest: Use DAHDI_SPECIFY when opening by integer channel number.

In DAHDI-Linux 2.7 the layout of the /dev/dahdi files changes so that they are
grouped by span. When opening channels by number all utilities need to use
DAHDI_SPECIFY now.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agoUpdate the configure script as well.
Tzafrir Cohen [Thu, 23 May 2013 23:06:29 +0000 (02:06 +0300)]
Update the configure script as well.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agooptionally install pinned files: --enable-pinned
Tzafrir Cohen [Thu, 23 May 2013 22:52:43 +0000 (01:52 +0300)]
optionally install pinned files: --enable-pinned

Add installation of the pinned-spans support to the Makefile. For the
moment, however, they are not installed unless you use ./configure
--enable-pinned or build with 'make DAHDI_PINNED=yes'

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agoMake udev run dahdi_cfg on each device:
Oron Peled [Thu, 6 Oct 2011 19:03:03 +0000 (21:03 +0200)]
Make udev run dahdi_cfg on each device:

 * New script: dahdi_cfg_device_args:
   - Just like span_assignments, span_types: may be given
     one or more sysfs devpath's
   - Output the required options for dahdi_cfg. E.g:
       "-S 8 -C 15-28"
   - This may be passed (with any other wanted options)
     to the new dahdi_cfg (which supports '-S' and '-C')

 * Use dahdi_cfg_device_args in handle_device so we configure
   each span from udev.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agobasic user-space for pinned-spans
Oron Peled [Thu, 6 Oct 2011 19:03:00 +0000 (21:03 +0200)]
basic user-space for pinned-spans

handle_device is the basic script intended to be called from udev.

It will call span_types on the span to apply optional
/etc/dahdi/spantype.conf onfiguration settings that need to be applied
before assignment (currently "pri" port types: E1/T1/J1).

Next it assigns span numbers to spans: if configured in
/etc/dahdi/pinned-spans.conf - use those settings. If not: by the order
of loading.

span_types and span_assignments can also be used to report the settings
they are used to configure.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agoDon't fail init script if no modules
Tzafrir Cohen [Thu, 23 May 2013 16:49:57 +0000 (19:49 +0300)]
Don't fail init script if no modules

No point in loading the modules if nobody built them yet. It is a common
case for one to install the userspace tools package but not (yet?) build
the modules. See, e.g.  http://bugs.debian.org/706046 .

With this changeset, we exit gracefully in such a case.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agoIgnore generated files
Tzafrir Cohen [Thu, 23 May 2013 16:49:56 +0000 (19:49 +0300)]
Ignore generated files

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agodahdi_scan: Support gaps in channel numbering.
Shaun Ruffell [Wed, 17 Apr 2013 02:33:05 +0000 (21:33 -0500)]
dahdi_scan: Support gaps in channel numbering.

If, via the sysfs attributed introduced in DAHDI-Linux 2.5.0, a user has
configured spans that do not have contiguous channel numbers, dahdi_scan will
not print several of the span attributes in addition to a bad basechan number.

This patch allows dahdi_scan to try and get the basechan for a span from sysfs
as opposed to calculating based on the number of channels in the previous span
scanned.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

6 years agoxpp: Fix compile error with fedora 17
Russ Meyerriecks [Wed, 13 Mar 2013 19:28:48 +0000 (14:28 -0500)]
xpp: Fix compile error with fedora 17

One line change to re-include a missing header

Reported-By: Anthony Messina
Internal-Issue-ID: DAHTOOL-60
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

6 years agomenuselect: Remove last bits completely from the repo
Russ Meyerriecks [Fri, 21 Sep 2012 19:43:49 +0000 (19:43 +0000)]
menuselect: Remove last bits completely from the repo

menuselect has not been used in dahdi-tools since r10411 (7 months ago). This
patch removes menuselect from the repository completely.

Reported-by: Sean Bright
Internal-Issue-ID: DAHTOOL-61
Patches: kill-menuselect.patch by Sean Bright (license #5060)

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10721 17933a7a-c749-41c5-a318-cba88f637d49

6 years agodahdi-monitor: Fix broken control-C behavior and -F output option
Russ Meyerriecks [Fri, 21 Sep 2012 17:25:48 +0000 (17:25 +0000)]
dahdi-monitor: Fix broken control-C behavior and -F output option

After hitting control-C when writing a wav file, dahdi_monitor reports
"Failed to read in a full wav header. Expect bad things."

Also when using the -F output option, the wav header is not written.

Reported-by: Richard Miller
Internal-Issue-ID: DAHTOOL-59
Patch: dahdi_monitor.diff by Richard Miller (license #5685)
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10717 17933a7a-c749-41c5-a318-cba88f637d49

6 years agoxpp: add missing include
Tzafrir Cohen [Thu, 20 Sep 2012 13:46:23 +0000 (13:46 +0000)]
xpp: add missing include

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10715 17933a7a-c749-41c5-a318-cba88f637d49

6 years agodahdi-tools: xpp: cleanup dead code in xtalk
Oron Peled [Thu, 20 Sep 2012 13:45:06 +0000 (13:45 +0000)]
dahdi-tools: xpp: cleanup dead code in xtalk

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10714 17933a7a-c749-41c5-a318-cba88f637d49

6 years agoxtalk: checkpatch clean (almost)
Oron Peled [Thu, 20 Sep 2012 13:43:41 +0000 (13:43 +0000)]
xtalk: checkpatch clean (almost)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: Xorcom xtalk (r10638)

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10713 17933a7a-c749-41c5-a318-cba88f637d49

6 years agoxtalk: Demote one ERR() to DBG()
Oron Peled [Thu, 20 Sep 2012 13:41:00 +0000 (13:41 +0000)]
xtalk: Demote one ERR() to DBG()

(caller should decide on policy)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: Xorcom xtalk (r9304)

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10712 17933a7a-c749-41c5-a318-cba88f637d49

6 years agoxtalk: Caller passes xusb_spec to xusb_find_iface()
Oron Peled [Thu, 20 Sep 2012 13:40:40 +0000 (13:40 +0000)]
xtalk: Caller passes xusb_spec to xusb_find_iface()

* This xusb_spec:
  - Is a dummy struct used for this xusb instance only.
  - Is now passed by reference from caller.
  - So caller now manage the life cycle of this struct
* Also, demote one INFO() to DBG() (library should not print
  on its own)
* Also minor fix to DBG() output of spec initialization (leading 0)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: Xorcom xtalk (r9303)

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10711 17933a7a-c749-41c5-a318-cba88f637d49

6 years agoxtalk: allow dump_packet() without debug flags
Oron Peled [Thu, 20 Sep 2012 13:38:39 +0000 (13:38 +0000)]
xtalk: allow dump_packet() without debug flags

xtalk: dump_packet() may now be used without debug flags by passing
mask == 0.

Origin: Xorcom xtalk (r9302)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10710 17933a7a-c749-41c5-a318-cba88f637d49

6 years agoREADME.Astribank: load module => module load
Tzafrir Cohen [Sun, 29 Jul 2012 11:31:39 +0000 (11:31 +0000)]
README.Astribank: load module => module load

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10701 17933a7a-c749-41c5-a318-cba88f637d49

7 years agodahdi_hardware: Detect the Digium TE820 card.
Shaun Ruffell [Mon, 14 May 2012 16:11:06 +0000 (16:11 +0000)]
dahdi_hardware: Detect the Digium TE820 card.

Adding the TE820 vendor and device ID into PCI.pm allows dahdi_hardware to
recognize the card.

Reported-by: Xavier Hienne
Internal-Issue-ID: DAHTOOL-58
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10680 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoblacklist: Add hfcmulti, hfcpci, and netjet.
Shaun Ruffell [Wed, 28 Mar 2012 16:35:23 +0000 (16:35 +0000)]
blacklist: Add hfcmulti, hfcpci, and netjet.

If DAHDI is installed the vast majority of users will most likely not want
hfcmulti, hfcpci, or netjet loaded since they may conflict with DAHDI drivers
for the TDM400, B410P, and TE11XP cards.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10601 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: astribank_hook: wait for udev to settle
Oron Peled [Thu, 22 Mar 2012 17:38:57 +0000 (17:38 +0000)]
xpp: astribank_hook: wait for udev to settle

When running the astribank_hook (only on Astribanks, in XPP_HOTPLUG_DAHDI
mode), wait for all other Astribanks to create all the required device
files.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10585 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: astribank_allow: useless debug on write
Tzafrir Cohen [Tue, 20 Mar 2012 10:43:00 +0000 (10:43 +0000)]
xpp: astribank_allow: useless debug on write

Remove a useless debug message in the "write" operation.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10549 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: fix build warnings
Tzafrir Cohen [Mon, 19 Mar 2012 16:57:24 +0000 (16:57 +0000)]
xpp: fix build warnings

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10543 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: oct612x: fix build warnings
Tzafrir Cohen [Mon, 19 Mar 2012 16:45:40 +0000 (16:45 +0000)]
xpp: oct612x: fix build warnings

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10542 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: add forgotten include
Oron Peled [Thu, 15 Mar 2012 20:46:48 +0000 (20:46 +0000)]
xpp: add forgotten include

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10506 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: Update product ID's in Dahdi::Hardware::USB
Oron Peled [Thu, 15 Mar 2012 20:46:27 +0000 (20:46 +0000)]
xpp: Update product ID's in Dahdi::Hardware::USB

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10505 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: clobber fpga_load
Oron Peled [Thu, 15 Mar 2012 20:45:57 +0000 (20:45 +0000)]
xpp: clobber fpga_load

* It was replaced long ago by astribank_hexload/astribank_tool/astribank_allow
* It hasn't been used for several releases now, nor updated.
* Time to move into the eternal bit-bucket.
* Left (very) few strings as a tribute...

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10504 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: fix manpage of astribank_hexload
Oron Peled [Thu, 15 Mar 2012 20:45:36 +0000 (20:45 +0000)]
xpp: fix manpage of astribank_hexload

* Fixed 'astribanks_tool' string

Signed-off-by: Oron Peled <oron.peled@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10503 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: Customizable license markers
Oron Peled [Thu, 15 Mar 2012 20:43:57 +0000 (20:43 +0000)]
xpp: Customizable license markers

* License strings markers (BEGIN.../END...) can be customized
* By default, generate a "generic" license markers
* We accept any (paired) markers from the valid list

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10502 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: Add info to astribank_tool -Q
Oron Peled [Thu, 15 Mar 2012 20:43:18 +0000 (20:43 +0000)]
xpp: Add info to astribank_tool -Q

* In MPP serial protocol add support for SER_STAT_GET command
* Use it to query firmware for:
  - FPGA build configuration number (1 - old main, 2 - new main)
  - Watchdog timer state bit (ready/expired)
  - XPD Alive timer state bit (yes/no)
* Also cleanup the code in mpps_card_info():
  - In all MPP serial commands the send/recive buffers must
    have identical size
  - No need to alias struct pointers to byte-buffers, just use
    the structs themselves as buffers.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10501 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: echo_loader: whitespace cleanup
Oron Peled [Thu, 15 Mar 2012 20:42:56 +0000 (20:42 +0000)]
xpp: echo_loader: whitespace cleanup

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10500 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: bugfix: handle echo_loader errors
Oron Peled [Thu, 15 Mar 2012 20:42:33 +0000 (20:42 +0000)]
xpp: bugfix: handle echo_loader errors

* I/O errors of the device were not propagated up by echo_loader
* As a result, Octasic load failure did not prevented USB renumeration
* Make consistent return values:
  - In our functions: ret < 0 is error
  - In Octasic functions (UINT32): return Octasic error codes
* All error paths prints error messages (so we see how the error propagates)
* Also changed error order testing in init_octasic():
  Return status should be tested before the values of by-reference parameters

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10499 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: echo_loader.c: add AB id to messages
Oron Peled [Thu, 15 Mar 2012 20:42:10 +0000 (20:42 +0000)]
xpp: echo_loader.c: add AB id to messages

* Define new macros AB_INFO(), AB_ERR() that prefix their message
  with the astribank information (usb device + serial number)
* Replace all INFO()/ERR() messages in echo_loader.c with the new macros

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10498 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoimprove build_tools/dump_sys_state
Oron Peled [Thu, 15 Mar 2012 20:41:49 +0000 (20:41 +0000)]
improve build_tools/dump_sys_state

* Use the new dahdi_sysfs_copy script
* Clean old/unused code
* Add notification output
* Now always creates a tarball - the gzipped copy is many times smaller.
* Without arguments, tarball name is:
    sys_dump.<hostname>_<date>_<time>.tar.gz

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10497 17933a7a-c749-41c5-a318-cba88f637d49

7 years agonew build_tools/dahdi_sysfs_copy
Oron Peled [Thu, 15 Mar 2012 20:40:52 +0000 (20:40 +0000)]
new build_tools/dahdi_sysfs_copy

Short perl script to copy dahdi related sysfs trees
into a designated directory.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10496 17933a7a-c749-41c5-a318-cba88f637d49

7 years agoxpp: xpp_fxloader: improve output
Oron Peled [Thu, 15 Mar 2012 20:36:33 +0000 (20:36 +0000)]
xpp: xpp_fxloader: improve output

* Replaced (almost) all $LOGGER to echo:
  - In interactive use -- that what we want anyway
  - When called from UDEV, the subprocess stdout/stderr is piped to
    $LOGGER anyway (at the end of the script)
  - No need for many $LOGGER instances (each with its own pid)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10495 17933a7a-c749-41c5-a318-cba88f637d49