Commit Graph

93 Commits

Author SHA1 Message Date
Oron Peled 412c3f0fe3 xpp: support per-port E1/T1 EC
* 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.
2014-06-29 16:34:21 +03:00
Oron Peled fc459c374c xpp: set EC firmware according to PRI settings:
* 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>
2014-06-29 16:34:17 +03:00
Oron Peled ca09f327ed xpp: better dahdi_registration
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>
2014-06-29 16:30:34 +03:00
Tzafrir Cohen b1d55683ae xpp: Don't generate .depends if there's no libusb
Creating the The .depends file requires libusb support.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-10 12:41:43 +03:00
Oron Peled 9285e86492 xpp: better error checking (echo_loader)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-05-11 19:07:40 +03:00
Oron Peled ca7c04e9cb xpp: fix usb "clear_halt" problem
* 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".
2014-05-11 18:03:11 +03:00
Oron Peled ae02edacb4 xpp: safer compilation
* 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>
2014-05-11 18:03:11 +03:00
Oron Peled 1e6b2741db dahdi_genconf: remove hard-coded E1 default
* 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>
2014-04-30 22:51:58 +03:00
Oron Peled 794c8eb048 xpp: waitfor_xpds: handle missing serial numbers
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>
2014-04-30 22:48:06 +03:00
Oron Peled ffe36c63e0 xpp: dahdi_registration: force re-assignment
* The system state causing the bug:
  - DAHDI has auto_assign_spans==1
  - No /etc/dahdi/assigned-spans.conf

* The bug scenario:
  - During initial device detection, they are assigned by
    DAHDI driver.
  - Later we run "dahdi_span_assignment remove"
  - Then, a "dahdi_registration on" would not assign any span.

* The fix:
  - Using the '-R' option, force "dahdi_registration on" to also
    do "dahdi_span_assignment auto" on relevant devices.
  - This is the way it's called by /usr/share/dahdi/dahdi_auto_assign_compat

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-04-30 22:46:41 +03:00
Aslan Laoz bce5afacf1 waitfor_xpds: handle the case of a failing AB
If an Astribank failed initialization, don't keep waiting for it.
2014-02-07 14:23:19 +02:00
Tzafrir Cohen dd752529f0 auto_assign_spans may be true even if not '1'
auto_assign_spans is an int and may have legal values other than 1. It
is legal (though pointless) to use: modprobe dahdi auto_assign_spans=3.
Any value != 0 is true.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-02-07 14:22:49 +02:00
Tzafrir Cohen b8d1e467e4 dahdi_perl: fix regression with an AB with no modules
Fixes a regression introduced in
3572bb5a13 (before 2.7.0) - most of the
dahdi_perl tools will fail for an Astribank with no modules claiming
"No XPDs for '/sys/bus/astribanks/devices/xbus-00'"

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2014-01-23 22:32:45 +02:00
Oron Peled b621c02b7f 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>
2014-01-23 21:32:14 +02:00
Russ Meyerriecks a6203e151f wcte13xp: Teach tools about te131 te132 products
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-01-22 17:45:58 -06:00
Shaun Ruffell 15875924f0 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>
2014-01-20 19:22:57 +02:00
Tzafrir Cohen a5bf1d3a2e 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>
2014-01-20 19:22:57 +02:00
Shaun Ruffell ffced0cad2 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>
2013-11-26 13:50:02 -06:00
Oron Peled 2a84216fe4 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>
2013-11-24 16:42:15 +02:00
Oron Peled fb1a2b5572 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>
2013-11-24 16:16:33 +02:00
Shaun Ruffell 8d9a6bdd80 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>
2013-11-22 11:12:12 -06:00
Shaun Ruffell bb19620c52 wcte43x: Teach tools about the wcte43x driver.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2013-11-11 15:40:11 -06:00
Shaun Ruffell 11310bde53 wcaxx: Teach tools about the wcaxx driver.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2013-11-11 15:39:51 -06:00
Tzafrir Cohen b123bc87dd 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>
2013-10-21 16:55:18 +03:00
Tzafrir Cohen 5e30a1401f Man pages for span_types and span_assignments
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2013-10-13 23:28:46 +03:00
Oron Peled 680f3e1d1d 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>
2013-10-13 11:02:47 -04:00
Oron Peled 1e81ed14cf Augment dahdi_genconf default generators list
Run Add spantypes and pinnedspans generators by default.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2013-10-01 22:01:35 +03:00
Oron Peled 44a5285454 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>
2013-10-01 21:58:04 +03:00
Russ Meyerriecks 2380c99c5f Add support for Digium's new te13x line of cards
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2013-05-28 17:06:10 -05:00
Russ Meyerriecks eacc071afe 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>
2013-03-13 14:36:42 -05:00
Tzafrir Cohen 3114b89905 xpp: add missing include
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10715 17933a7a-c749-41c5-a318-cba88f637d49
2012-09-20 13:46:23 +00:00
Oron Peled 44eb7cbb2a 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
2012-09-20 13:45:06 +00:00
Oron Peled 8b7c731fb6 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
2012-09-20 13:43:41 +00:00
Oron Peled b440b2da8c 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
2012-09-20 13:41:00 +00:00
Oron Peled ec71fef275 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
2012-09-20 13:40:40 +00:00
Oron Peled 99ebb2a94c 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
2012-09-20 13:38:39 +00:00
Tzafrir Cohen 241e5e0144 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
2012-07-29 11:31:39 +00:00
Shaun Ruffell 6e3da02523 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
2012-05-14 16:11:06 +00:00
Oron Peled 4c7786a696 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
2012-03-22 17:38:57 +00:00
Tzafrir Cohen 88818f66cb 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
2012-03-20 10:43:00 +00:00
Tzafrir Cohen 617f45c795 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
2012-03-19 16:57:24 +00:00
Tzafrir Cohen 3d32d63163 xpp: oct612x: fix build warnings
git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10542 17933a7a-c749-41c5-a318-cba88f637d49
2012-03-19 16:45:40 +00:00
Oron Peled cb4eae0e42 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
2012-03-15 20:46:48 +00:00
Oron Peled eff70f98dc 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
2012-03-15 20:46:27 +00:00
Oron Peled 65066704be 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
2012-03-15 20:45:57 +00:00
Oron Peled be70b5b347 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
2012-03-15 20:45:36 +00:00
Oron Peled 5a123a50e5 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
2012-03-15 20:43:57 +00:00
Oron Peled d8213d2adf 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
2012-03-15 20:43:18 +00:00
Oron Peled 273230b044 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
2012-03-15 20:42:56 +00:00
Oron Peled bccb264100 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
2012-03-15 20:42:33 +00:00