Create a branch for 2.5


git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10108 17933a7a-c749-41c5-a318-cba88f637d49
Extra README fixes: 'th' and ztcfg

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10185 17933a7a-c749-41c5-a318-cba88f637d49
xpp: pri_termtype: match complete SPAN patterns

Match complete span patterns, to avoid pattern 'SPAN/1' from matching
e.g. span 12 (SPAN/12).

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10186 17933a7a-c749-41c5-a318-cba88f637d49
README.Astribank: HWEC and build instructions

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10187 17933a7a-c749-41c5-a318-cba88f637d49
xpp: waitfor_xpds: higher and configurable timeout

On several pathological cases we may need to wait more than 40 seconds.
Make that timeout configurable.

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10188 17933a7a-c749-41c5-a318-cba88f637d49
dahdi_genconf: Assume spans with unknown term types are software selectable.

Resolves a regression on the 2.5 branch that would result in:

  $ dahdi_genconf
  dahdi_genconf: missing default group (termtype=UNKNOWN)

E1 / T1 spans use software configuration to set CPE / NET mode. This
patch will just assume that a termtype is software selectable if it was
"UNKNOWN" when first scanning the span.

Internal-Issue-ID: DAHTOOL-55
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Tested-by: David Purdue <support@noojee.com.au>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10213

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10255 17933a7a-c749-41c5-a318-cba88f637d49
dahdi_genconf: Use 'dahdi_scan' to determine span_type for B410P cards.

The wcb4xxp driver does not put enough information in the proc filesystem to
determine if the ports are in TE or NT mode.  Previously the ports would
always just setup the dahdi-channels.conf file in TE mode. After this change
the dahdi_scan utility is used to detect if the ports are in TE or NT mode and
setup dahdi-channels.conf appropriately.

Internal-Issue-ID: DAHTOOL-54
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10214

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10256 17933a7a-c749-41c5-a318-cba88f637d49
xpp: astribank_hexload: we need more lines

* Newer firmwares may have more lines.
* While we're at it, add better debug printing.
* Remove some unused debugging code.

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10354 17933a7a-c749-41c5-a318-cba88f637d49
xpp: Serialized Parallel load; E-Main-3 firmware

This introduces support for loading multiple firmwares in parallel also
for the case of a manual load. This is anyway the case for an automatic
load from udev.

* libusb needs to scan the bus all too often. This causes occasional
  failures for opening devices.
* Thus introduce a semaphore to serialize uses of libusb.

E-Main-3 firmware differs by a different value of bcdDevice:

* Read this from the sysfs devices tree.
* Fall back to lsusb -v (much slower) is sysfs not available.

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10355 17933a7a-c749-41c5-a318-cba88f637d49
xpp: recovery firmware in xpp_fxloader

USB_RECOV.hex is an extra firmware that may be useful for recovering
from certain Astribank hardware faults in some scenarios. This adds
support for either loading it manually
('/usr/share/dahdi/xpp_fxloader recover-sb') or through udev, *if*
the required udev rules were set on the system.

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10356 17933a7a-c749-41c5-a318-cba88f637d49
Fix GCC 4.6 "set but not used" warnings

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10357 17933a7a-c749-41c5-a318-cba88f637d49
xpp: xpp_fxloader: regressions from r10355

* Avoid a duplicated run of udev on some systems.
* Fix usage of astribank_tool's output.

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10370 17933a7a-c749-41c5-a318-cba88f637d49
xpp: two extra product IDs: 1112, 1164

Two extra USB product IDs used in some odd maintenance scenarios.

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

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10371 17933a7a-c749-41c5-a318-cba88f637d49
xpp: improved waitfor_xpds

* Fix an issue due to long firmware load time:
  - When one Astribank has an echo canceler (long firmware loading) and
    and another one does not.
  - The EC-less Astribank finishes initialization before the Astribank
    with EC is detected.
  - Thus waitfor_xpds terminates too early.

* We now iteratively build two sets of serial numbers:
  - One from wha we see in all Xorcom (e4e4:11[3456]x) USB devices.
  - The other is those that were detected in the driver.
  - Only when the two sets are equal (and > 0) we know we are done.
  - This is resilient to many problems (e.g: disconnect/reconnect of
    same device during initialization).

* The progress output was also improved: Now each detected AB
  show the total number so far.

* The timeout was also increased to 100sec

* Woraround for an Astribank with no serial (but just a single one on
  the system).

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10465

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10467 17933a7a-c749-41c5-a318-cba88f637d49
xpp: clean 'Extrainfo' EEPROM field

* Extrainfo field contains junk data
* Caused by:
  - The field is initialized to 0xFF values
  - There was no null termination (and no room to add it)
* New code:
  - Ensure that show_extrainfo() have null termination even if EEPROM
    field is full.
  - Replace trailing 0xFF characters with '\0' when reading this field
  - Since our default burned EEPROM contain Extrainfo field full of
    0xFF characters, this would make them look as null filled.

Internal Issue-Id: #1341
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10491

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10507 17933a7a-c749-41c5-a318-cba88f637d49
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>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10495

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10508 17933a7a-c749-41c5-a318-cba88f637d49
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>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10498

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10509 17933a7a-c749-41c5-a318-cba88f637d49
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>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10499

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10510 17933a7a-c749-41c5-a318-cba88f637d49
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>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10502

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/branches/2.5@10512 17933a7a-c749-41c5-a318-cba88f637d49
xpp: fix manpage of astribank_hexload

* Fixed 'astribanks_tool' string

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10503

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