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>
* 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
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
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
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
* 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
* 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
* 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
* 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
* 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
* 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
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Ⓜ️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.astersk.org/svn/dahdi/tools/trunk@10494 17933a7a-c749-41c5-a318-cba88f637d49
* 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.astersk.org/svn/dahdi/tools/trunk@10492 17933a7a-c749-41c5-a318-cba88f637d49
* 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.astersk.org/svn/dahdi/tools/trunk@10491 17933a7a-c749-41c5-a318-cba88f637d49
* 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>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10465 17933a7a-c749-41c5-a318-cba88f637d49
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/trunk@10368 17933a7a-c749-41c5-a318-cba88f637d49
* 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/trunk@10366 17933a7a-c749-41c5-a318-cba88f637d49
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/trunk@10349 17933a7a-c749-41c5-a318-cba88f637d49
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/trunk@10348 17933a7a-c749-41c5-a318-cba88f637d49
* Newer firmwares may have more lines.
* While we're at it, add better debug printing.
* Remove some unused debugging code.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10343 17933a7a-c749-41c5-a318-cba88f637d49
The xpp_order configuration generator should only loop over telephony
devices, not all spans.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10266 17933a7a-c749-41c5-a318-cba88f637d49
Don't force extens we generate to have exactly 4 digits (simple
formatting limitation).
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10265 17933a7a-c749-41c5-a318-cba88f637d49
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>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10214 17933a7a-c749-41c5-a318-cba88f637d49
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>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10213 17933a7a-c749-41c5-a318-cba88f637d49
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/trunk@10177 17933a7a-c749-41c5-a318-cba88f637d49
Use 'dahdi_genconf freepbxdb' to generate the required astdb entries
for Asterisk to use the extensions generated by dahdi_genconf. Requires
asterisk to be running.
This module is intended for testing as it bypasses standard FreePBX
functions only and hence may not work properly with Freepbx.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10142 17933a7a-c749-41c5-a318-cba88f637d49
* Silently exit right away if user did not set XPP_HOTPLUG_DAHDI.
* Only one Astribank should be allowed to run the startup script:
- Protect that section with a "lock" (symlinking a file).
- Sadly we can't rely on /run and may have to wait for a r/w file-system.
- And thus even this waiting needs to be run in the background
as to not hold udev.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10068 17933a7a-c749-41c5-a318-cba88f637d49
It is possible that the contents of the proc files can change while the
perl modules are in the processing of processing them.
Specifically, if lsdahdi is called on boot before the channels are
configured, the channel will be "probed" to determine if it's an FXO or
FXS channel and that can result in the output of proc changing. When the
size of proc changes, the script can get confused about where the
beginning of the next line is.
This patch reads in the proc file completely into memory first, and then
starts processing each of the lines.
This resolves the "Unrecognized garbage 'INACTIVE)' in -" that is
displayed on boot with the recent trunk of DAHDI.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10040 17933a7a-c749-41c5-a318-cba88f637d49
Echo Cancellation firmware is loaded by xpp/stribank_hexload
(Using the oct612x code).
* astribank_hexload: options -O/-o/-A for handling the Octasic echo
cancellation firmware.
* astribank_tool: report that.
* xpp_fxloader: Run astribank_hexload, if needed.
* dahdi_perl: The EC module is an extra XPD, but not a "telephony device"
and hence not a span. Deal with that.
* waitfor_xpds: may need to wait a bit longer for firmware loading.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10032 17933a7a-c749-41c5-a318-cba88f637d49