Commit Graph

945 Commits

Author SHA1 Message Date
Shaun Ruffell
7ab8780c25 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>
2017-06-04 16:24:38 -05:00
Tzafrir Cohen
76ad75fc2a xpp: fxs: demote LED FXS6 messages to debug 2017-04-19 15:51:35 +03:00
Tzafrir Cohen
27b1ad108d xpp: fxs: remove verbose poll_inputs notice
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:51:35 +03:00
Dima Stoliarov
2dc030e61d xpp: bug fix in FPGA firmware: 11551
Update FPGA_1161.201.hex to rev. 11551 to fix the support of module type
6.
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
5b9f520e78 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>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
8e310fd264 xpp: output of parse_hexbyte() may be negative
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
6b119e60f5 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>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
b8b884d205 xpp: correct size for BRI multibyte packets
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
95de230835 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>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
c05ad2200f 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>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
55775ab0d2 xpp: FXS: RAM write support is fully implemented 2017-04-19 15:51:34 +03:00
Tzafrir Cohen
6456a027e5 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>
2017-04-19 15:51:32 +03:00
Tzafrir Cohen
92e4ce9b93 xpp: init_card_6_30: verify patches only on debug
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:50:55 +03:00
Tzafrir Cohen
fa57fed2df 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>
2017-04-19 15:50:14 +03:00
Tzafrir Cohen
c21a98ebe5 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>
2017-03-21 15:42:49 +02:00
Oron Peled
d7e77a3e61 xpp: FXS type 6: ring and neon MWI support
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-21 15:42:48 +02:00
Dima Stoliarov
020735e3a7 xpp: FXS type 6: support digital outputs
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-21 15:42:48 +02:00
Dima Stoliarov
aaa1080a7c xpp: FXS type 6: support digital inputs
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-21 15:42:48 +02:00
Dima Stoliarov
7fcb793cd9 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>
2017-03-21 15:42:48 +02:00
Oron Peled
28a2cd068d xpp: FXS type 6: basic hookstate detection
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-21 15:42:48 +02:00
Oron Peled
a380b84545 xpp: FXS type 6: define registers
Add definitions of REG_TYPE6 for various SI32260 registers.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-21 15:42:48 +02:00
Dima Stoliarov
e47c096b73 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>
2017-03-21 15:42:46 +02:00
Dima Stoliarov
99ccfa35bb 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>
2017-03-21 14:09:11 +02:00
Dima Stoliarov
609114c0a9 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>
2017-03-19 15:31:38 +02:00
Oron Peled
14d9a53162 xpp: support for RAM type register commands
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-16 16:55:35 +02:00
Oron Peled
2dd077cc53 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>
2017-03-16 16:55:29 +02:00
Dima Stoliarov
41279a8dcc xpp: added hwid attribute
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-16 16:11:50 +02:00
Oron Peled
d3a28c50cf 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>
2017-03-16 13:46:15 +02:00
Oron Peled
17ac18d675 xpp: Remove unused "datalen" field from xframe
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-16 13:46:15 +02:00
Oron Peled
3d8d7995d7 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>
2017-03-16 13:44:56 +02:00
Oron Peled
9dfc02a38c 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>
2017-03-16 13:41:20 +02:00
Oron Peled
1c68f2ec73 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>
2017-03-15 12:01:39 +02:00
Oron Peled
d9aa82b025 xpp: rename xpd->type to xpd->xpd_type
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-03-14 20:37:45 +02:00
Oron Peled
a0434a8af5 xpp: remove unused #defines 2017-03-14 14:43:22 +02:00
Tzafrir Cohen
18de17084d 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>
2017-01-05 15:55:43 +02:00
Tzafrir Cohen
ffdfdfb66b 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>
2016-03-16 18:20:44 +02:00
Wendell Thompson
4b242c3f84 Raised E1 pulse level for wcte43x targets 2016-02-15 15:45:51 -06:00
Tzafrir Cohen
8d1f17fc44 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>
2015-11-05 18:11:57 +02:00
Oron Peled
404a67d089 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>
2015-11-02 10:49:42 +02:00
Russ Meyerriecks
fac77101fb 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>
2015-10-27 09:54:43 -05:00
Russ Meyerriecks
80e0426dd6 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>
2015-10-27 09:54:35 -05:00
Russ Meyerriecks
dd3c4ba015 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>
2015-10-23 16:25:59 -05:00
Russ Meyerriecks
92b645786d 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>
2015-10-23 16:25:59 -05:00
Russ Meyerriecks
2cba62718f 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>
2015-10-23 16:25:59 -05:00
Russ Meyerriecks
aa6a56863d octasic: Added slab.h include to fix ARM compile error
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-14 13:37:28 -05:00
Russ Meyerriecks
501222044c readme: Updated supported products section
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2015-10-14 13:30:28 -05:00
Shaun Ruffell
d5f13c5116 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>
2015-06-04 15:04:45 -05:00
Russ Meyerriecks
4df03284a8 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>
2015-05-13 14:47:10 -05:00
Shaun Ruffell
8cd0823978 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>
2015-05-13 14:45:01 -05:00
Shaun Ruffell
64a98af676 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>
2015-05-13 14:45:01 -05:00