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