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>

git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10491 a0bf4364-ded3-4de4-8d8a-66a801d63aff
xpp: perl_modules: Remove /proc/xpp usage

* All references to old /proc/xpp interface were removed.
* Everything is now done via sysfs

Information has been available from /sys/bus/astribanks since before
Dahdi-linux 2.2 .

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10492 a0bf4364-ded3-4de4-8d8a-66a801d63aff
xpp: sysfs access cleanups

With /proc/xpp code removed, some cleanup can be done.

* No need to search alternative attribute names, so xbus_attr_path() is
  redundant.

* Don't compose xbus sysfs directory in multiple code locations.
  Do it once in Xbus->new() and use the result ($xbus->sysfs_dir)

* Pass XPD directory strings directly to Xpd->new()
  - So we parse it for unit/subunit only in Xpd->new()

* Don't parse xbus sysfs name:
  - Toplevel scan, pass it as is to Xbus->new()
  - Xbus->new() deduce the xbus->num from the naming
    of Xpd's inside (nn:m:k) -- this is a hack until
    we add xbus number as an xbus sysfs attribute

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10494 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10495 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10496 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10497 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10498 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10499 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10500 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10501 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10502 a0bf4364-ded3-4de4-8d8a-66a801d63aff
xpp: fix manpage of astribank_hexload

* Fixed 'astribanks_tool' string

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10503 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10504 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10505 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10506 a0bf4364-ded3-4de4-8d8a-66a801d63aff
xpp: oct612x: fix build warnings

git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10542 a0bf4364-ded3-4de4-8d8a-66a801d63aff
xpp: fix build warnings

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@10543 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10549 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10585 a0bf4364-ded3-4de4-8d8a-66a801d63aff
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.asterisk.org/svn/dahdi/tools/trunk@10601 a0bf4364-ded3-4de4-8d8a-66a801d63aff