dahdi/linux.git
7 months agoRemove struct devtype for unsupported drivers. master v3.0.0 v3.0.0-rc1
Keith Morgan [Fri, 5 Oct 2018 19:42:50 +0000 (19:42 +0000)]
Remove struct devtype for unsupported drivers.

7 months agoChanged readme to reflect driver support changes.
Keith Morgan [Thu, 4 Oct 2018 19:03:00 +0000 (19:03 +0000)]
Changed readme to reflect driver support changes.

7 months agoRevert "Remove support for xpp drivers."
Keith Morgan [Thu, 4 Oct 2018 17:51:54 +0000 (17:51 +0000)]
Revert "Remove support for xpp drivers."
add them back.
This reverts commit a36d2662546e56c5be44e610bd5fd9deed57a9bb.

7 months agoRemove support for all but wcb41xp wcb43xp and wcb23xp.
Keith Morgan [Thu, 4 Oct 2018 17:34:21 +0000 (17:34 +0000)]
Remove support for all but wcb41xp wcb43xp and wcb23xp.

7 months agoRemove support for wctdm800, wcaex800, wctdm410, wcaex410.
Keith Morgan [Wed, 3 Oct 2018 17:02:56 +0000 (17:02 +0000)]
Remove support for wctdm800, wcaex800, wctdm410, wcaex410.

7 months agoRemove support for xpp drivers.
Keith Morgan [Wed, 3 Oct 2018 15:31:08 +0000 (15:31 +0000)]
Remove support for xpp drivers.

7 months agoRemove support for driver wcte12xp.
Keith Morgan [Wed, 3 Oct 2018 15:18:39 +0000 (15:18 +0000)]
Remove support for driver wcte12xp.

7 months agoRemove support for driver wcte11xp.
Keith Morgan [Wed, 3 Oct 2018 15:01:04 +0000 (15:01 +0000)]
Remove support for driver wcte11xp.

7 months agoRemove support for driver wctdm.
Keith Morgan [Wed, 3 Oct 2018 14:13:59 +0000 (14:13 +0000)]
Remove support for driver wctdm.

7 months agoRemove support for wct1xxp driver.
Keith Morgan [Wed, 3 Oct 2018 14:09:01 +0000 (14:09 +0000)]
Remove support for wct1xxp driver.

7 months agoRemove support for wcfxo driver.
Keith Morgan [Wed, 3 Oct 2018 14:04:04 +0000 (14:04 +0000)]
Remove support for wcfxo driver.

7 months agoRemove support for tor2 driver.
Keith Morgan [Wed, 3 Oct 2018 13:58:11 +0000 (13:58 +0000)]
Remove support for tor2 driver.

7 months agoRemove support for pciradio driver.
Keith Morgan [Wed, 3 Oct 2018 13:50:39 +0000 (13:50 +0000)]
Remove support for pciradio driver.

7 months agoDescription: Remove a bodus "test" target
Keith Morgan [Mon, 1 Oct 2018 19:33:50 +0000 (19:33 +0000)]
Description: Remove a bodus "test" target
Author: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Bug: https://issues.asterisk.org/jira/browse/DAHLIN-364

8 months agoDAHDI in kernel 4.15: Switch to new timer_setup interface.
Shaun Ruffell [Fri, 10 Aug 2018 05:13:52 +0000 (00:13 -0500)]
DAHDI in kernel 4.15: Switch to new timer_setup interface.

Upstream kernel 4.14, in commit (686fef928bba6b "timer: Prepare to change timer
callback argument type") [1], introduced the timer_setup interface to replace
the init_timer/setup_timer interfaces. The primary change is that the timer
callback functions now follow the standard kernel pattern where the structure
the callback sits in is passed to the callback instead of storing a pointer to
an unassociated data type.

The setup_timer functions were removed in upstream kernel v4.15, and therefore
this change is needed in order to compile DAHDI for kernels >= 4.15.

This change follows the same strategy that was done in the kernel to while the
existing users of setup_timer were migrated to the new interface.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=686fef928bba6b

8 months agoDisable -Wformat-truncation and prevent potential string overflows.
Shaun Ruffell [Fri, 10 Aug 2018 03:27:40 +0000 (22:27 -0500)]
Disable -Wformat-truncation and prevent potential string overflows.

GCC 7.3.0 complained about the potential to overflow the fixed size span and
channel names and descriptions. It also flagged potential truncations of the
strings.

The sprintf calls are now changed to snprintf to prevent the potential
overflows, but the warning about truncations are now disabled globally.

8 months agovoicebus: Initialize stack buffer.
Shaun Ruffell [Fri, 10 Aug 2018 03:26:17 +0000 (22:26 -0500)]
voicebus: Initialize stack buffer.

Quiets the following (valid) warning from gcc 7.3.0:

drivers/dahdi/voicebus/GpakApi.c:1648:22: warning: ‘MsgBuffer[1]’ may be used
   uninitialized in this function [-Wmaybe-uninitialized]
         MsgBuffer[1] |= DTMF_UPDATE_MASK;

8 months agoxpp: fxs: Do not increment boolean.
Shaun Ruffell [Fri, 10 Aug 2018 03:23:57 +0000 (22:23 -0500)]
xpp: fxs: Do not increment boolean.

This quiets the following warning from gcc 7.3.0:

  drivers/dahdi/xpp/card_fxs.c:1344:17: warning: increment of a boolean
   expression [-Wbool-operation]

9 months agoCompletely clear out conference buffers.
Shaun Ruffell [Thu, 9 Aug 2018 14:56:21 +0000 (09:56 -0500)]
Completely clear out conference buffers.

This fixes an error and quiets the following warning pointed out by gcc 7.3.0:

  warning: ‘memset’ used with length equal to number of elements without
    multiplication by element size [-Wmemset-elt-size] memset(chan->conflast, 0,
    DAHDI_MAX_CHUNKSIZE);

Previously only the first half of the conference buffers were cleared out.

12 months agoxpp: Support FXS module with 4 ports and no I/O
Oron Peled [Sun, 11 Feb 2018 17:22:03 +0000 (19:22 +0200)]
xpp: Support FXS module with 4 ports and no I/O

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

15 months agoxpp: init_card: eeprom_release_201 applies to any 20x
Tzafrir Cohen [Tue, 20 Feb 2018 17:07:50 +0000 (19:07 +0200)]
xpp: init_card: eeprom_release_201 applies to any 20x

* The variable eeprom_release_201 was added in the initialization
  script of the FXS module to add a case where it is different from
  101 mains.
* However, it tests for "201" and it should apply for any 20x.
* Remove the variable from the init script of module type 6 (new FXS)
  as it was not used.

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

16 months agoIgnore quilt .pc directory, used in deb packaging
Tzafrir Cohen [Thu, 11 Jan 2018 13:21:41 +0000 (15:21 +0200)]
Ignore quilt .pc directory, used in deb packaging

Debian packaging uses quilt to manage patches. Book-keeping for them is
done using quilt (either directly, or in a compatible format), and
tracked in the directory .pc .

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

16 months agoDAHDI in kernel 4.13: dev_attr to dev_groups
Jean-Denis Girard [Sun, 31 Dec 2017 12:02:28 +0000 (14:02 +0200)]
DAHDI in kernel 4.13: dev_attr to dev_groups

dev_attrs was removed from struct bus_type on kernel 4.13, need to
convert to dev_groups, see
http://lkml.iu.edu/hypermail/linux/kernel/1706.0/04578.html.

DAHLIN-356 #close

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

20 months agoxpp: mark init_card_6_30 as executable
Tzafrir Cohen [Sun, 17 Sep 2017 05:24:53 +0000 (08:24 +0300)]
xpp: mark init_card_6_30 as executable

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

20 months agoxpp: fxs: restore linefeed (for e.g. thermal alarm)
Dima Stoliarov [Mon, 11 Sep 2017 08:22:27 +0000 (11:22 +0300)]
xpp: fxs: restore linefeed (for e.g. thermal alarm)

The si32260 chip may enter a state of thermal alarm to avoid
overheating. This disables the channel.

This commit allows automatic restoring of the channel after a certain
timeout (poll_chan_linefeed, by default 30 seconds).

Adds a per-channel counter ("overheats") in
/proc/xpp/XBUS-<n>/XPD-<m>0/fxs_info to count such events.

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

20 months agoxpp: fxs: reduce loop current to reduce heating
Dima Stoliarov [Mon, 11 Sep 2017 08:30:02 +0000 (11:30 +0300)]
xpp: fxs: reduce loop current to reduce heating

22 months agoxpp: FPGA_1161.202.hex now alias for 201
Tzafrir Cohen [Mon, 17 Jul 2017 11:49:02 +0000 (14:49 +0300)]
xpp: FPGA_1161.202.hex now alias for 201

We no longer need to maintain a separate firmware type 2.2: newer
versions of firmware types 2.1 will do.

22 months agoxpp: card_pri: fix clocking initialization
Tzafrir Cohen [Sun, 21 May 2017 10:16:08 +0000 (13:16 +0300)]
xpp: card_pri: fix clocking initialization

Fix PCM synchronization between PRI module and the main board.

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

22 months agoxpp: fxo: update red alarms on span assignment
Tzafrir Cohen [Tue, 20 Jun 2017 11:41:14 +0000 (14:41 +0300)]
xpp: fxo: update red alarms on span assignment

DAHDI gets notified of changes to battery status and hence to red alarm
on an FXO channel when the status changes. It thus needs to get notified
about it on "startup".

This startup was initially span registration. However following the
separation between device registration and span assignment, the
notification was sent after device registration, whereas it was ignored
if span was not assigned. It happened to work in most cases due to
delays.

This fix moves the startup notifications of battery status to the new
hook that is run on span assignment.

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

22 months agoxpp: add xpd method span_assigned
Tzafrir Cohen [Tue, 20 Jun 2017 11:39:34 +0000 (14:39 +0300)]
xpp: add xpd method span_assigned

Add an phone device XPD method called 'span_assigned' that gets
called when the XPD's span is assigned.

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

22 months agoxpp: bug fix in FPGA firmware: 11553
Tzafrir Cohen [Sun, 11 Jun 2017 14:22:24 +0000 (17:22 +0300)]
xpp: bug fix in FPGA firmware: 11553

Update FPGA_1161.201.hex to rev. 11553 to fix
'category=2 errorbits=0x01' errors.

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

22 months agoxpp: init_card_6_3: parallel calibration
Dima Stoliarov [Thu, 8 Jun 2017 13:09:25 +0000 (16:09 +0300)]
xpp: init_card_6_3: parallel calibration

FXS module type 6: Further reduces time of the initialization by writing
to several ports' chips in parallel.

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

22 months agoxpp: init_card_6_3: broadcasts for faster calibration
Dima Stoliarov [Mon, 27 Feb 2017 15:14:57 +0000 (17:14 +0200)]
xpp: init_card_6_3: broadcasts for faster calibration

FXS module type 6: Use broadcast write for a much faster
calibration at init time.

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

22 months agofail non-blocking I/O in case of span unassignment
Tzafrir Cohen [Mon, 19 Jun 2017 12:13:06 +0000 (15:13 +0300)]
fail non-blocking I/O in case of span unassignment

In case a user has a file descriptor that is used for non-blocking I/O
and the span to which it belongs gets unassigned, its reads and writes
will still yield -EAGAIN.

This commit adds a test for such a case and returns the proper -ENODEV.

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

22 months ago'atomic_read()' -> refcount_read()'
Shaun Ruffell [Thu, 1 Jun 2017 17:16:54 +0000 (12:16 -0500)]
'atomic_read()' -> refcount_read()'

The upstream 4.11 kernel, in commit (10383aea2f445bce9b2a2b308def08134b438c8e
"kref: Implement 'struct kref' using refcount_t"), changed refcount type on kref
objects. We now need to use refcount_read to read them.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

22 months agosignal_pending() is now in linux/sched/signal.h include
Shaun Ruffell [Thu, 1 Jun 2017 17:05:57 +0000 (12:05 -0500)]
signal_pending() is now in linux/sched/signal.h include

Upstream kernel 4.11, in commit (bd0f9b356d00aa241ced36fb075a07041c28d3b8
"sched/headers: fix up header file dependency on <linux/sched/signal.h>"), now
requires users of signal_pending to include the new linux/sched/signal.h file.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

23 months agoGpakApi: Fix misleading indentation.
Shaun Ruffell [Sun, 4 Jun 2017 21:14:39 +0000 (16:14 -0500)]
GpakApi: Fix misleading indentation.

gcc-6.3.1 reports the following error when building the driver suite:

    drivers/dahdi/voicebus/GpakApi.c: In function 'gpakReadDSPMemoryMap':
    drivers/dahdi/voicebus/GpakApi.c:1560:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
         if (DspStatus != 0)
         ^~
    drivers/dahdi/voicebus/GpakApi.c:1563:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      for (i = 0; i < MemoryLength_Word16; i++)
      ^~~

So we'll now update the indentation level (which appears to be a side effect of
mixed tabs and spaces in this file).

NOTE: The GpakAPI files are checkpatch.pl unclean because I did not want to
increase the burden of merging in updates from the original provider, but it may
be time to go ahead and bring the file in compliance with the kernel coding
standards.

Internal-Issue-ID: DAHLIN-354
Reported-by: Sean Darcy
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

2 years agoxpp: fxs: demote LED FXS6 messages to debug
Tzafrir Cohen [Tue, 18 Apr 2017 12:43:16 +0000 (15:43 +0300)]
xpp: fxs: demote LED FXS6 messages to debug

2 years agoxpp: fxs: remove verbose poll_inputs notice
Tzafrir Cohen [Wed, 12 Apr 2017 10:48:15 +0000 (13:48 +0300)]
xpp: fxs: remove verbose poll_inputs notice

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

2 years agoxpp: bug fix in FPGA firmware: 11551
Dima Stoliarov [Mon, 3 Apr 2017 11:28:26 +0000 (14:28 +0300)]
xpp: bug fix in FPGA firmware: 11551

Update FPGA_1161.201.hex to rev. 11551 to fix the support of module type
6.

2 years agoxpp: re-add setting xpd->subunits
Tzafrir Cohen [Sun, 2 Apr 2017 15:03:03 +0000 (18:03 +0300)]
xpp: re-add setting xpd->subunits

The number of subunits per XPD (which is not trivial in BRI) has been
accidentally left out in a previous commit.

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

2 years agoxpp: output of parse_hexbyte() may be negative
Tzafrir Cohen [Sun, 2 Apr 2017 12:03:26 +0000 (15:03 +0300)]
xpp: output of parse_hexbyte() may be negative

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

2 years agoxpp: remove useless sanity check of len field
Tzafrir Cohen [Wed, 29 Mar 2017 08:33:40 +0000 (11:33 +0300)]
xpp: remove useless sanity check of len field

The packet data length field may have other values in some cases (BRI D
channel).  It is also inherently limited to 3 bits.

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

2 years agoxpp: correct size for BRI multibyte packets
Tzafrir Cohen [Mon, 27 Mar 2017 15:48:45 +0000 (18:48 +0300)]
xpp: correct size for BRI multibyte packets

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

2 years agoxpp: remove independent "Unknown" XPP_VERSION
Tzafrir Cohen [Mon, 27 Mar 2017 09:42:56 +0000 (12:42 +0300)]
xpp: remove independent "Unknown" XPP_VERSION

The xpp drivers were originally developed seperately and thus had their
own version number. For quite some time they no longer have this version
number and report 'Revision: Unknown'.

Get rid of this mechanism.

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

2 years agoxpp: fix chip/ports numbers sanity test
Tzafrir Cohen [Mon, 27 Mar 2017 08:32:58 +0000 (11:32 +0300)]
xpp: fix chip/ports numbers sanity test

The test originally did not check any input from the hardware.
Fix it to check the actual (and proper) input from the hardware.

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

2 years agoxpp: FXS: RAM write support is fully implemented
Tzafrir Cohen [Sun, 26 Mar 2017 16:49:56 +0000 (19:49 +0300)]
xpp: FXS: RAM write support is fully implemented

2 years agoxpp: init_card_6_30: Avoid using new perl features
Tzafrir Cohen [Mon, 27 Mar 2017 13:06:15 +0000 (16:06 +0300)]
xpp: init_card_6_30: Avoid using new perl features

Centos 5 has perl 5.8.8 . It does not support the '//' operator that was
added in perl 5.10. So sadly we have to avoid using it.

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

2 years agoxpp: init_card_6_30: verify patches only on debug
Tzafrir Cohen [Wed, 29 Mar 2017 09:06:21 +0000 (12:06 +0300)]
xpp: init_card_6_30: verify patches only on debug

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

2 years agoxpp: init_card_6_30: disable debug
Tzafrir Cohen [Sun, 26 Mar 2017 16:48:45 +0000 (19:48 +0300)]
xpp: init_card_6_30: disable debug

* Don't enable debug by default.
* Demote some logging messages to debug.
* Remove a duplicate message about SLIC numbers.

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

2 years agoxpp: FXS: Metering tone doesn't yet work on type 6
Tzafrir Cohen [Tue, 21 Mar 2017 11:57:34 +0000 (13:57 +0200)]
xpp: FXS: Metering tone doesn't yet work on type 6

Generation of metering tone (a feture normally disabled at build time)
is not yet implemented on the new FXS type 6 module.

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

2 years agoxpp: FXS type 6: ring and neon MWI support
Oron Peled [Mon, 30 Nov 2015 17:07:08 +0000 (19:07 +0200)]
xpp: FXS type 6: ring and neon MWI support

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

2 years agoxpp: FXS type 6: support digital outputs
Dima Stoliarov [Thu, 31 Mar 2016 17:13:32 +0000 (20:13 +0300)]
xpp: FXS type 6: support digital outputs

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

2 years agoxpp: FXS type 6: support digital inputs
Dima Stoliarov [Thu, 31 Mar 2016 17:13:32 +0000 (20:13 +0300)]
xpp: FXS type 6: support digital inputs

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

2 years agoxpp: FXS type 6: hardware DTMF detection
Dima Stoliarov [Mon, 14 Dec 2015 13:23:59 +0000 (15:23 +0200)]
xpp: FXS type 6: hardware DTMF detection

Adapt the hardware DTMF detection for the SI32260 module.

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

2 years agoxpp: FXS type 6: basic hookstate detection
Oron Peled [Mon, 30 Nov 2015 17:07:08 +0000 (19:07 +0200)]
xpp: FXS type 6: basic hookstate detection

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

2 years agoxpp: FXS type 6: define registers
Oron Peled [Mon, 30 Nov 2015 17:07:08 +0000 (19:07 +0200)]
xpp: FXS type 6: define registers

Add definitions of REG_TYPE6 for various SI32260 registers.

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

2 years agoxpp: FXS type 6: firmwares support
Dima Stoliarov [Thu, 16 Feb 2017 11:56:37 +0000 (13:56 +0200)]
xpp: FXS type 6: firmwares support

Firmware support for the type 6 FXS Astribank module.

FPGA_1161.201.hex rev. 11527
PIC_TYPE_6.hex rev. 11526
USB_FW.201.hex rev. 11502

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

2 years agoxpp: FXS type 6: init script (init_card_6_30)
Dima Stoliarov [Wed, 25 Nov 2015 10:07:17 +0000 (12:07 +0200)]
xpp: FXS type 6: init script (init_card_6_30)

Add init_card_6_30: an init script for new FXS based on Si32260 chip.

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

2 years agoxpp: FXS: support of I/O Expander.
Dima Stoliarov [Mon, 25 Jan 2016 14:52:14 +0000 (16:52 +0200)]
xpp: FXS: support of I/O Expander.

Added do_expander field to SPI commands, in order to support an I/O
Expander on FXS.

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

2 years agoxpp: support for RAM type register commands
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: support for RAM type register commands

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

2 years agoxpp: FXS: rename all REG_* macros to REG_TYPE1_*
Oron Peled [Sun, 29 Nov 2015 12:39:08 +0000 (14:39 +0200)]
xpp: FXS: rename all REG_* macros to REG_TYPE1_*

This is preparation for REG_TYPE6_* macros

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

2 years agoxpp: added hwid attribute
Dima Stoliarov [Sun, 10 Apr 2016 12:46:52 +0000 (15:46 +0300)]
xpp: added hwid attribute

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

2 years agoxpp: a separate unit_descriptor
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: a separate unit_descriptor

The new FXS chip supports two ports for each chip and hence we once
again need to look at hardware differently.

Struct unit_description includes information about all chips/port in a
specific module.

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

2 years agoxpp: Remove unused "datalen" field from xframe
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: Remove unused "datalen" field from xframe

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

2 years agoxpp: XFRAME_NEW_REG_CMD
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: XFRAME_NEW_REG_CMD

Prepare for different types of commands: replace XFRAME_NEW_CMD with
XFRAME_NEW_REG_CMD in some places.

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

2 years agoxpp: Check command type by length
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: Check command type by length

Prepare for different types of commands: Don't assume a constant size.

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

2 years agoxpp: refactor struct reg_cmd
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: refactor struct reg_cmd

Currently we only have REG (register) commands. Refactor it to allow
MEM (memory) commands.

* A common header
* Don't assume a constant size.

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

2 years agoxpp: rename xpd->type to xpd->xpd_type
Oron Peled [Mon, 16 Nov 2015 20:42:21 +0000 (15:42 -0500)]
xpp: rename xpd->type to xpd->xpd_type

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

2 years agoxpp: remove unused #defines
Oron Peled [Sun, 29 Nov 2015 12:33:09 +0000 (14:33 +0200)]
xpp: remove unused #defines

2 years agowcfxo, wctdm: set spantype
Tzafrir Cohen [Wed, 21 Sep 2016 08:51:45 +0000 (11:51 +0300)]
wcfxo, wctdm: set spantype

* wctdm: set to SPANTYPE_ANALOG_MIXED. Maybe it could be improved if all
  slots have modules of the same type.
* wcfxo: type FXO.

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

3 years agoxpp_usb: Fix potential corruption on clock rewind
Tzafrir Cohen [Wed, 13 Jan 2016 10:19:04 +0000 (12:19 +0200)]
xpp_usb: Fix potential corruption on clock rewind

The xpp modules use time differences for various statistics. In one case
xpp_usb creates a histogram of the time it took the system to send USB
packets (URBs). The time difference is used (after adjustments) as an
index to that array.

However if the clock happens to go back at that exact point in time, we
get to write to an arbitrary negative index in this array.

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

3 years agoRaised E1 pulse level for wcte43x targets v2.11.1 v2.11.1-rc1
Wendell Thompson [Mon, 15 Feb 2016 21:45:51 +0000 (15:45 -0600)]
Raised E1 pulse level for wcte43x targets

3 years agodahdi-modules: load and unloads the modules v2.11.0
Tzafrir Cohen [Mon, 2 Nov 2015 16:11:09 +0000 (18:11 +0200)]
dahdi-modules: load and unloads the modules

A script that performs the module loading / unloading instead of the
init script.

Other functionality of the init script is performed by udev hooks. But
manual initiation of modules loading or unloading is still needed on
several occasions.

This script should help enable the removal of the init script from the
DAHDI package.

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

3 years agoxpp: improve handling of USB sluggishness
Oron Peled [Mon, 20 Jul 2015 09:11:07 +0000 (09:11 +0000)]
xpp: improve handling of USB sluggishness

* Drop PCM during sluggish events:
  - Drop both rx/tx (was only tx)
  - Drop almost all pcm until sluggishness stops (used to drop only
    single pcm each time).
  - Renamed: "drop_next_pcm" -> "drop_pcm" (to match new semantics)
  - Still allow "keep alive" PCM so Astribank will not reset FXS high-voltage.
    The "sluggish_pcm_keepalive" parameter set the rate (1/50 by default)
  - Added rx/tx drop statistics counters
  - Removed "pcm_tx_drops" (replaced by new statistics counters)

* Also improved format of /proc/xpp/XBUS-*/xpp_usb:
  - Show cummulative number of sluggish events.
  - Clearly show range (in usec) of usb_tx_delay[]

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

3 years agowcb4xxp: Print serial number of gen 2 cards. v2.11.0-rc1
Russ Meyerriecks [Mon, 20 Jul 2015 22:39:33 +0000 (17:39 -0500)]
wcb4xxp: Print serial number of gen 2 cards.

Now prints the serial number of the card to the kernel log for cards which
support this feature. This include the wcb23x and wcb43x series.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agowcb4xxp: Add support for wcb23x series
Russ Meyerriecks [Thu, 11 Jun 2015 19:59:12 +0000 (14:59 -0500)]
wcb4xxp: Add support for wcb23x series

Adds support for Digium's new dual span wcb23x series cards. Also other minor
improvements for the new generation cards including the wcb23x and wcb43x

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agowcb4xxp: Protect indirect register writes with sequence lock
Russ Meyerriecks [Tue, 4 Aug 2015 21:37:22 +0000 (16:37 -0500)]
wcb4xxp: Protect indirect register writes with sequence lock

A few of the indirect register writes to the A_ST_* indirect registers weren't
being protected by any kind of sequence lock. This could lead to potential race
conditions of two spans were configured simultaneously.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agowcb4xxp: minor: Squelch initializing message on shutdown
Russ Meyerriecks [Thu, 16 Jul 2015 20:31:40 +0000 (15:31 -0500)]
wcb4xxp: minor: Squelch initializing message on shutdown

The hw init function gets called on a module remove in order to reset the
hardware before shutdown. This was causing "Initializing zarlink echocan" to
print on shutdown which could be confusing.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agowcb4xxp: Remove "card sync source" logic
Russ Meyerriecks [Thu, 16 Jul 2015 20:19:20 +0000 (15:19 -0500)]
wcb4xxp: Remove "card sync source" logic

This logic was reading and printing the bri chips automatic selection of sync
source. We always use manual sync selection in the driver so this doesn't need
to exist.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agooctasic: Added slab.h include to fix ARM compile error
Russ Meyerriecks [Wed, 14 Oct 2015 18:37:28 +0000 (13:37 -0500)]
octasic: Added slab.h include to fix ARM compile error

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agoreadme: Updated supported products section
Russ Meyerriecks [Wed, 14 Oct 2015 18:30:28 +0000 (13:30 -0500)]
readme: Updated supported products section

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

3 years agowctc4xxp: Clear packet error count when reloading firmware.
Shaun Ruffell [Thu, 4 Jun 2015 14:19:59 +0000 (09:19 -0500)]
wctc4xxp: Clear packet error count when reloading firmware.

When the firmware is reloaded and reset, the packet error count is not.
This can create a condition where the firmware could report an error like
the following if a channel was closed without any new errors:

  wctc4xxp 0000:07:08.0: 18446744073709551597 errored receive packets

wcdte.packet_errors is also renamed to wcdte.reported_packet_errors to not
conflict with the packet_errors member of the descriptor lists.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agowctc4xxp: Fix continuous "errored receive packets" with 2+ transcoders
Russ Meyerriecks [Thu, 16 Apr 2015 17:08:25 +0000 (12:08 -0500)]
wctc4xxp: Fix continuous "errored receive packets" with 2+ transcoders

In the case where two transcoders are loaded in a system and one transcoder
experiences an errored receive packet condition, the logic would ping pong the
error between the two cards, causing a runaway stream of errors in the kernel
log.

This fix moves the global error count var into the wcdte struct to allow for
per-card logic.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>

4 years agodahdi: Remove IRQF_DISABLED.
Shaun Ruffell [Mon, 20 Apr 2015 16:07:11 +0000 (11:07 -0500)]
dahdi: Remove IRQF_DISABLED.

The IRQF_DISABLED flag was removed in 4.1 in commit
"genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag entirely" [1].

By default all interrupt handlers are now run with interrupts disabled and
therefore should all be considered "fast interrupts". Any driver that was still
using the flag will now lock interrupts directly in the handler in case running
on an older kernel that is not disabling interrupts when running the handler.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d8bf368d0631d4bc2612d8bf2e4e8e74e620d0cc

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agoRemove DAHDI_IRQF_[SHARED|DISABLED] flags.
Shaun Ruffell [Mon, 20 Apr 2015 16:17:09 +0000 (11:17 -0500)]
Remove DAHDI_IRQF_[SHARED|DISABLED] flags.

These flags are direct mappings to the IRQF_[SHARED|DISABLED] flags and no
longer need to be kept separate.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agobuild_tools/make_version: Remove support for subversion working copies.
Shaun Ruffell [Thu, 16 Apr 2015 14:37:22 +0000 (09:37 -0500)]
build_tools/make_version: Remove support for subversion working copies.

It has now been years since subversion has been used with this project. We can
go ahead and simplify the version script now.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agowcb4xxp: Add support for zarlink echocan
Russ Meyerriecks [Fri, 19 Dec 2014 19:50:01 +0000 (13:50 -0600)]
wcb4xxp: Add support for zarlink echocan

Introduces support for new series b43x cards which make use of the zarlink echo
canceller. Made as few changes to the b410 operation as possible, but the
critical region had some cleanups, so it may be a bit more performant.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agowcxb: Fix "I/O error reported by firmware" followed by underruns
John Sloan [Fri, 13 Feb 2015 20:46:22 +0000 (14:46 -0600)]
wcxb: Fix "I/O error reported by firmware" followed by underruns

The cards affected include the TE131/3, TE235/435, A4B, and A8B.

Update all PCIe cards' firmware to increase the incoming and outgoing TDM FIFOs
to 16ms. The FIFOs will only be filled to a depth equal to the driver's latency
setting (ie. 3ms default). The total system latency is not effected. The
firmware and driver now also report the maximum DMA transaction time when in
DEBUG mode to aid in determining if the system is experiencing long PCIe
transactions (ie. TLP completion timeouts).

Decreased the maximum latency to from 20 to 12ms

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agoxpp: USB_FW*: fix incorrect chan num with 2FXS6FXO
Tzafrir Cohen [Mon, 30 Mar 2015 12:35:09 +0000 (15:35 +0300)]
xpp: USB_FW*: fix incorrect chan num with 2FXS6FXO

New USB firmware that fix mis-reporting of the number of channels (or
rather: licenses) in the Astribank when a 2FXS6FXO module is used in
conjunction with another module.

USB_FW.hex: rev. 11452
USB_FW.201.hex: rev. 11453

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

4 years agoREADME: use file time for reproducable build
Tzafrir Cohen [Mon, 2 Mar 2015 17:44:02 +0000 (19:44 +0200)]
README: use file time for reproducable build

https://bugs.debian.org/776622 asks to avoid using the build time in the
generated result to help make the build reproducable.

This fix uses the timestamp of README for generating the timestamp in
the footer of README.html.

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

4 years agoxpp: module_refcount is back to int on 3.19
Tzafrir Cohen [Mon, 2 Mar 2015 16:33:35 +0000 (18:33 +0200)]
xpp: module_refcount is back to int on 3.19

Commit d5db139ab3764640e0882a1746e7b9fdee33fd87 "module: make
module_refcount() a signed integer." included in 3.19 makes this
condition slightly more complex.

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

4 years agodahdi: strnicmp() -> strncasecmp()
Shaun Ruffell [Mon, 2 Mar 2015 15:00:14 +0000 (09:00 -0600)]
dahdi: strnicmp() -> strncasecmp()

With commit (af3cd13501 "lib/string.c: remove strnicmp()") [1] dahdi can no
longer call strnicmp directly. strncasecmp was added into lib/string.c in kernel
version 2.6.22 so we'll map calls to strncasecmp to strnicmp for any kernel
before that.

This is necessary to compile against kernels >= 4.0.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=af3cd13501

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agodahdi: Fix "void value not ignored..." error when compiling against kernel 4.0.
Shaun Ruffell [Mon, 2 Mar 2015 15:00:13 +0000 (09:00 -0600)]
dahdi: Fix "void value not ignored..." error when compiling against kernel 4.0.

With commit (d1f1052c52 "device: Change dev_<level> logging functions to return
void") [1] in kernel version 4.0, DAHDI would fail to compile with the following
error:

  .../drivers/dahdi/dahdi-base.c:7150:2: error: void value not ignored as it ought to be
    dahdi_dev_dbg(ASSIGN, span_device(span),
    ^

Now ignore the dev_printk return value.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d1f1052c5204524

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

4 years agodahdi: struct file.f_dentry macro was removed in kernel 3.19 v2.10.1 v2.10.1-rc1 v2.10.1-rc2
Shaun Ruffell [Mon, 22 Dec 2014 17:21:28 +0000 (11:21 -0600)]
dahdi: struct file.f_dentry macro was removed in kernel 3.19

This is necessary to build against kernel version 3.19 since commit
(78d28e651f97866d608d9b41 "kill f_dentry macro") [1]

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=78d28e651

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agodahdi_dynamic: Release reference count on network device when destroying dynamic...
Shaun Ruffell [Wed, 10 Dec 2014 14:39:39 +0000 (08:39 -0600)]
dahdi_dynamic: Release reference count on network device when destroying dynamic spans.

It was reported that for VLAN interfaces, failing to release this reference
count will prevent a system from rebooting properly, resulting in the need to
power cycle.

Reported-by: Assen Totin
Internal-Issue-ID: DAHLIN-343
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

4 years agoxpp: firmware: a stray ^Z in FPGA_1161.201.hex
Tzafrir Cohen [Mon, 17 Nov 2014 16:00:51 +0000 (18:00 +0200)]
xpp: firmware: a stray ^Z in FPGA_1161.201.hex

4 years agoxpp: firmware: 203 as alias to (newer) 201
Tzafrir Cohen [Mon, 17 Nov 2014 15:55:47 +0000 (17:55 +0200)]
xpp: firmware: 203 as alias to (newer) 201

Latest Astribank firmware (as of Rev. 11426 also supports some newer
hardware types, which will have the ID 203. Anyone installing this newer
version will now have 203 as an alias, but older versions will not have
it.

4 years agoxpp: FPGA_1161.201.hex: module types detection
Tzafrir Cohen [Wed, 5 Nov 2014 18:00:58 +0000 (20:00 +0200)]
xpp: FPGA_1161.201.hex: module types detection

New firmware that includes a better way to identify hardware modules
type that does not require multiplexers.

This is firmware file FPGA_1161.201.hex rev. 11426.

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

4 years agobuild_tools/dkms-helper: Use bash to process dkms-helper script.
Shaun Ruffell [Wed, 3 Sep 2014 17:50:06 +0000 (12:50 -0500)]
build_tools/dkms-helper: Use bash to process dkms-helper script.

Looks like there are some bashims in the script. Make this explicit in the
script until they can be taken out.

This fixes failures to run this script on Ubuntu when dash is the default shell.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>