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
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.
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;
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.
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>