Commit Graph

25 Commits

Author SHA1 Message Date
Shaun Ruffell
6667f1c8d8 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
2018-09-03 10:27:18 -05:00
Shaun Ruffell
20328895a2 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.
2018-09-03 10:27:18 -05:00
Shaun Ruffell
ff88ccb1cd 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>
2017-06-26 17:48:40 +03:00
Wendell Thompson
4b242c3f84 Raised E1 pulse level for wcte43x targets 2016-02-15 15:45:51 -06:00
John Sloan
ae5fa08abd 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>
2015-03-30 13:18:12 -05:00
Shaun Ruffell
378986841c dahdi: smp_mb_{before,after}_clear_bit -> smp_mb_{before,after}_atomic.
This is needed to compile against upstream Linux 3.18 since commit
"locking: Remove deprecated smp_mb__() barriers" [1].

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

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-10-20 11:26:14 -05:00
Russ Meyerriecks
8428452ad1 wcte43x: Reset span alarm to RED on startup
A fresh modprobe and dahdi_cfg would cause a temporary green alarm state on the
spans for a second while the alarm debounced into RED. New logic keeps the
spans alarm state as NONE during the unconfigured state, but sets the alarm
state to RED after the framer reset in the startup logic.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-08-01 16:16:08 -05:00
Russ Meyerriecks
bce1ecafda wcte43x: Add support for new te436/te236 cards
Adds driver support for Digium's new te436 and te236 quad and dual span T1/E1 cards.

[removed whitespace at end of line]
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-07-17 15:18:10 -05:00
Shaun Ruffell
a951dd5e32 wcte43x: Do not reconfigure framer when span lineconfig is not changed.
If dahdi_span_ops.spanconfig is called multiple times in a row (like when
running dahdi_cfg; dahdi_cfg ) the tx signaling bits would go through a spurious
state that some far side devices would respond to.

Now, if the dahdi_span_ops.spanconfig callback is called, and the configuration
matches the existing configuration, we will not touch the framer.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-07-11 14:14:15 -05:00
Shaun Ruffell
71867c3de7 wcte43x: Do not get stuck in "Not Open" state when DAHDI_CONFIG_NOTOPEN is set.
This is the same change for the wcte13xp driver but applied to the other
xbus-based digital card.

If dahdi_cfg set the DAHDI_CONFIG_NOTOPEN setting on the span, which it does
when the "yellow" flag is added to the span config line, then it was possible
for the span to get stuck with DAHDI_ALARM_NOTOPEN (NOP).

This is because the driver only updates the alarm state when the framer reports
that the span alarm has changed. Therefore, unless the framer goes through an
alarm transition, the fact that channels are opened was never noticed by alarm
handling routine.

Now check the alarm state directly when the first channel is opened, and the
last channel is closed.

Internal-Issue-ID: DAHDI-1103
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-20 13:01:27 -05:00
Shaun Ruffell
61aeaf13ae wcte43x: Change span flags to atomic bitfield.
This will facilitate adding another flag for open channels on a span without
needing to add a lock on the span, or taking the global lock. Currently the span
flags are protected by the global reglock. This is not longer required.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-20 13:01:27 -05:00
Shaun Ruffell
779d62791c Add #include <linux/slab.h> to all files that call kzalloc|kmalloc|kfree.
Some architectures, like arm, do not automatically pull in the definitions for
kzalloc and friends. This allows DAHDI to build on those platforms.

Originally reported to the asterisk-users mailing list here
http://lists.digium.com/pipermail/asterisk-users/2014-February/282338.html

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-05-20 11:36:23 -05:00
Shaun Ruffell
a66db43356 wcte43x: Build against 2.6.18 and CentOS 5.5
This is to support users who are unable to update to the lastest CentOS 5.x.
There is no change for most users on the latest releases of their distribution.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-04-30 13:58:07 -05:00
Shaun Ruffell
6649a3a166 wcte43x: Trivial fix of 'source' in comment.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-04-30 13:58:02 -05:00
Shaun Ruffell
b6eb7ae6d8 wcte43xp: Close potential unbalanced call to enable_irq().
If the memory allocation for the new channel array fails, it would be possible
to call enable_irq() without the corresponding call to disable_irq().

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-04-01 11:53:00 -05:00
Shaun Ruffell
e4fce6849a wcte43x: Update firmware for TE435 / TE235 to e0019.
This firmware image is able to handle system conditions that would result in
spans internmittenly going down and recovering.

Internal-Issue-ID: DAHDI-1087
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-03-17 12:02:47 -05:00
Russ Meyerriecks
3efa9d8cd1 wcte13xp: wcxb: Add delayed reset firmware feature
Allow certain older firmwares to delay the hard reset until a full power cycle.
This way we can "preload" newer firmware images, without requiring the user to
physically power off/on their machine.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-01-24 13:14:14 -06:00
Shaun Ruffell
4cd09feb54 wcte43x, wcte13xp, wcaxx: Bump irqmisses counter when there are DMA underruns.
This makes the behavior of IRQ misses for these drivers behave the same as the
wcte12xp, wctdm24xxp, and wct4xxp drivers.

Previously irqmisses would never increase. The presence of underruns would still
show up in dmesg as latency bumps.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-01-22 18:04:47 -06:00
Shaun Ruffell
0b499d9566 wcte43x: Trivial drop of unnecessary local variables.
These were left over from when the VPM callbacks depended on the different VPM
installed. On the wcte43x this is unnecessary.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-01-22 18:04:47 -06:00
Russ Meyerriecks
438b2a36b3 wcte13xp: wcaxx: wcte43x: Remove VPM_SUPPORT compile option.
This was a legacy compile time option that is no longer necessary with the new
series of cards.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-01-22 13:40:27 -06:00
Shaun Ruffell
47dcc9377c wcte43x, wcte13xp: Use MSI interrupts if possible.
It was an oversight to prevent the wcte43x and wcte13xp drivers from using
Message Signaled interrupts during the switch to the wcxb library.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-01-08 12:21:10 -06:00
Shaun Ruffell
6bcc70a421 wcte43x: Update firmware to version e0017.
This resolves issues where, when using internal timing, the first channel of
span 3 has occassional corrupted data in transmit stream.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2013-12-02 15:46:39 -06:00
Shaun Ruffell
1ab5723b85 wcte43x: Remove 'dcxo' debug attribute.
Removes another bit of debugging instrumentation that I let slip through.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2013-11-20 09:39:12 -06:00
Shaun Ruffell
cbad5a7ae1 wcte43x: Do not grab reglock in handle_transmit/handle_receive.
If the driver is loaded with vpmsupport=0, then it was possible to create a
deadlock situation since the call into __dahdi_ec_chunk might then try to grab
the channel lock while already holding the reglock.

The purpose of grabbing reglock in the DMA routines was to protect the channel
array, which can be changed when linemode is changing. So instead, we'll
completely mask off that interrupt line from all CPUs when potentially changing
the channel array.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2013-11-20 09:33:07 -06:00
Wendell Thompson
466acea7e0 wcte43x: Add driver for TE435/TE235 digital cards.
From: Wendell Thompson <wthompson@digium.com>

These new cards are based on a common architecture with the TE133/TE134 as well
as the new analog cards, A4A/A4B/A8A/A8B.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2013-11-11 14:39:19 -06:00