* Otherwise, they pull compilation of xpp tools via implicit rules.
* This breaks build without libusb/libusbx
* To test this scenario:
./configure .... --without-libusb --without-libusbx
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
* So they are always included in 'make dist' even if PBX_USB is false.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* The file is defined as XTALK_OPTIONS_FILE (/etc/dahdi/xpp.conf):
- Lines beginning with '#' are skipped.
- Line beginning with "XTALK_OPTIONS" are used.
- Anything after whitespaces (with optional "=" characters) is part
of the value.
* An environment variable named "XTALK_OPTIONS" may override file contents.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Build new libxtalk as local convenience library
* Have new mpptalk.[ch] and astribank.[ch] wrap the new API
* Modify all tools to use the new API
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Do not remove yet the old ones.
* So new files are built, but not used yet.
* Build as a "noinst_" convenience library.
* Also, compile with '-Wno-unknown-pragmas' because we use some pragmas.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Use pkg-config
* For tight control have: --with-libusbx, --with-libusb
- For now, we choose libusb (AKA libusb-0.1)
- After committing support for libusbx (AKA libusb-1.0)
we'll change the default.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Allow firmware loading to take much longer (up to 180 seconds) before
it is killed. The default timeout is 30 seconds.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Exposed in twinstar setups where dahdi has auto_assign_spans=1:
* We start configuration with an empty /etc/dahdi/xpp_order
* If "XPP_HOTPLUG_DAHDI=yes", the astribank_hook removes
the asterisk_is_starting semaphore too early.
* There's no point in waiting for non-existant or empty /etc/dahdi/xpp_order
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
gcc 5 found this with the new -Werror=logical-not-parenthesis warning. Since we
have -Wall by default, it would also fail the compile.
Internal-Issue-ID: DAHLIN-347
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
* Fix distcheck by having all the targets installed under $prefix
* But by default (no prefix or prefix=/usr), revert to older pathes:
- /etc/dahdi
- udev rules in /etc/udev/rules.d
- perl in perl sitelib
- man pages in /usr/share/man
* Add configure options:
--with-udevrules= (e.g.: /lib/udev/rules.d)
--with-perllib= (e.g.: `perl -V:vendorlib)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Install to $datadir/dahdi and not $datadir/dahdi-tools
* Install to $includedir/dahdi and not $includedir/dahdi-tools
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Fix small compile warnings (which are now errors):
- hdlcgen.c
- hdlcstress.c (remove return value which isn't checked)
- patlooptest.c
* Also added dev-mode to xpp with relevant compile fixes.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Set udev installation directory to $sysconfdir/udev/rules.d
* Add definitions to xpp/Makefile.am and remove them from xpp/Makefile.legacy
* TODO: add "--with-udev-rulesdir=" for packagers (/lib/udev/rules.d)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Now man-pages and perl-script are handled by xpp/Makefile.am
* Removed from xpp/Makefile.legacy
* Detect perl and set perllibdir in configure.ac
* Handle modules in their own xpp/perl_modules/Makefile.am
* Enclose perl-related stuff in conditional
* Updates for "make dist"
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Added xpp/oct612x/Makefile.am:
- Compile octasic sources into a convenience library (static, not installed)
- Set OCTASIC_CFLAGS in configure.ac, as they are used in two
Makefile.am's
- Added relevant Makefile.in and Makefile into build_tools/make_dist
* In xpp/Makefile.am:
- Have USE_OCTASIC conditional (currently configure.ac always set it to true)
* Added PBX_USB automake conditional, so we only build our tools if
configure'd for libusb.
* Create two convenience libraries (libastribank and libecholoader)
Statically link them into our tools.
* Handle man-pages for the tools.
* Remove all new functionality from xpp/Makefile.legacy -- it now
contains:
- All perl related tools and man-pages
- Other misc stuff (udev files, etc.)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Added needed boilerplate to configure.ac
* Wrap original Makefile's with automake:
- Renamed all original Makefile -> Makefile.legacy
- Force automake generated Makefile to call Makefile.legacy:
Currently handle: all, install, clean, distclean, dist, docs, config
- Note: our temporary 'dist' target conflicts with automake 'dist' target.
* Temporarily added extra dist files into build_tools/make_dist
(until we move "make dist" functionality into automake)
* For now, we don't try to compile ppp/ as it wasn't compiled
from the top-level Makefile before.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
If we have /etc/dahdi/span-types.conf but it doesn't have any
line, we should avoid using the option -S to astribank_hexload.
Fix the test for this.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Don't run the final astribank_is_starting if asterisk is hotpluggable.
Likewise, if there's no xpp_order file, waiting is pointless as the hook
can't count Astribanks.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* 'time' was added here for debugging and never actually needed.
* It actually causes a minor bashism issue.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* New asynchronous behavior is used only when two conditions are met:
- Finding new $ASTERISK_SUPPORTS_DAHDI_HOTPLUG=yes in /etc/dahdi/init.conf
This should be set only when Asterisk support hotplug and configured
to use it (no_failed_channels==1).
- DAHDI auto_assign_spans==0
* Adapt /usr/share/dahdi/astribank_hook:
- Refactor old twinstar behavior into functions
- Add new behavior in a function (just enable the Asrribank watchdog)
- Call the correct function.
* Adapt init script:
If asynchronous behavior is on, don't wait for all Astribanks to
finish initialization (it's enough that we saw all/some of them)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Do print a message if no semaphore exists. It means that either there
are no Astribanks, or existing Astribanks were already initialized.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Why:
* Doing "clear_halt" is normally the right thing to do on startup.
* The original observed problem is better fixed via USB bios settings.
* Defaulting to no "clear_halt" cause more problems on other platform
combinations (hardware/kernel).
The change:
* We now reverted to do "clear_halt" by default.
* The XTALK_OPTIONS may now contain either "use-clear-halt" (the default)
or "no-use-clear-halt" to override for debugging/testing.
Original commit: ca7c04e9cb
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
DAHDI 2.9.2 added support for -S (span specs). However if this option
was not specified, it fails to run.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
The variable 'default_law' was the result of a partial renaming of the
original variable 'law'. Let's keep all of them in sync.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Added optional '-S <span-spec>' argument to astribank_hexload:
- Allow passing PRI span specification to EC firmware loader.
- The span specifications is whitespace/comma separate list
of items.
- Each item is: <span>:<type> (Example: 3:T1)
- The <span> may use shell-like globbing (e.g: *:E1 or [12]:T1)
- Any span not matched in the span specification will be set
as without the new '-S' option (i.e: depends on the '-A' option).
* Adapted xpp_fxloader:
- Read specification for both device label and wildcard from
/etc/dahdi/span-types.conf
- If the result is non-empty, pass it as '-S <span-spec>' to
the EC firmware loader.
* Read first from modern configuration files
(/etc/dahdi/span-types.conf)
- Support either exact label match or complete '*' match in the
configuration file.
* Fallback to legacy /etc/dahdi/xpp.conf
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Improvements to the xpp tool dahdi_registration:
* Use the new xpp driver with support for dahdi_registration sysfs
attribute in each device.
* Wait for UDEV to finish handling span assignments (via
dahdi_waitfor_span_assignments).
* Still supports legacy drivers without this, by falling back
to old style iterative "registration" on each xpd.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Don't use "usb_clear_halt" by default anymore
- It caused problems with specific devices in the past
- Now it cause problems with specific servers as well (64 bits, USB3)
* Add an "XTALK_OPTIONS" environment variable to pass options:
- Use it to implement a "use-clear-halt" boolean option that
restore original behavior.
- Also use it for "no-lock" option which replace the legacy
environment variable "XUSB_NOLOCK".
* Compile with "-Wall -Werror"
* Better dependency calculation:
- Explicit listing of sources, don't use wildcards.
- Pass various CFLAGS to dependency calculation as well.
- Make sure a failure is propagated
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* The "spantypes" generator had E1 default if no 'line-mode' parameter
was passed.
* As a result the new logic in "dahdi_span_types dumpconfig" had no
effect when called from dahdi_genconf, as it was always called
with "--line-mode=" argument.
* Now "dahdi_genconf spantype" behaves just like
"dahdi_span_types dumpconfig":
- The "--line-mode=" forces generation of provided line-mode (E1/J1/T1)
- Without this option, the generated config matches the current spans
state according to new dahd_span_types default logic:
- Wildcard rule if all spans have same line-mode.
- Uncommented specific matches if spans have different line-modes.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Fixes a regression since 949ea4ca9f
(2.7.0) - allows using an Astribank with no serial.
* Some of the olderst Astribanks don't have a serial number burned in
them. Thus there is no serial attribute for the sysfs USB device node.
* waitfor_xpds identifies the Astribanks by their serial numbers.
* An lone Astribank without serial number would thus block waitfor_xpds
(until timeout).
* Now we warn about them.
* We also try to handle it gracefully. As long as there's only one
of thease, it would be counted as "NO-SERIAL".
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>