Commit Graph

897 Commits

Author SHA1 Message Date
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
Shaun Ruffell
7ca082887a 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>
2015-05-13 14:45:01 -05:00
Russ Meyerriecks
a008cc03b7 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>
2015-03-30 13:18:12 -05: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
Tzafrir Cohen
6287954087 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>
2015-03-30 16:02:48 +03:00
Tzafrir Cohen
b978e35636 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>
2015-03-02 21:11:59 +02:00
Tzafrir Cohen
5c072d5bce 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>
2015-03-02 21:11:57 +02:00
Shaun Ruffell
1559db9d1a 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>
2015-03-02 21:09:19 +02:00
Shaun Ruffell
1cc0ad510a 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>
2015-03-02 21:07:21 +02:00
Shaun Ruffell
4d86a8f3f6 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>
2015-01-20 16:48:33 -06:00
Shaun Ruffell
e005030995 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>
2015-01-20 16:47:55 -06:00
Tzafrir Cohen
ee691c23f4 xpp: firmware: a stray ^Z in FPGA_1161.201.hex 2014-11-17 18:00:51 +02:00
Tzafrir Cohen
9698657f7a 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.
2014-11-17 17:55:47 +02:00
Tzafrir Cohen
79bf41ea8b 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>
2014-11-05 20:08:47 +02:00
Shaun Ruffell
41b5353338 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>
2014-10-20 11:26:14 -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
Shaun Ruffell
b9a8000bbd dahdi: Fix failure to read / write on kernel 3.16+
Kernel version 3.16+, since upstream commit (7f7f25e82d54870d "replace checking
for ->read/->aio_read presence with check in ->f_mode" )[1], does not like it
when dahdi changes the set of allowed file operations on a file descriptor
outside of the context of an open() system call.

DAHDI changes the available file operations when a channel is opened by first
opening /dev/dahdi/channel and then calling the DAHDI_SPECIFY ioctl to bind it
to a particular DAHDI channel. Until DAHDI_SPECIFY is called there weren't any
read()/write() callbacks implemented and therefore after the initial open, the
kernel was setting not setting FMODE_CAN_{WRITE,READ} on the file descriptor
indicating that those operations were not allowed.

Now define empty shell functions on the general dahdi_fops so the vfs layer will
not mark a file descriptor as unwritteable or unreadable on open.

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

Internal-Issue-ID: DAHLIN-340
Reported-and-tested-by: Thomas B. Clark
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-09-17 16:29:16 -05:00
Michael Walton
eedb4bf944 dynamic: Prevent oops due to inverted compile flag
The logic on ENABLE_TASKELETS compiler flag was inverted causing an oops on
normal dahdi_cfg of a dynamic span.

Issue-id: https://issues.asterisk.org/jira/browse/DAHLIN-328

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-08-15 14:58:47 -05:00
Russ Meyerriecks
91bc5a3b57 net: Update dahdi for alloc_netdev() api change in 3.17+
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c835a677331495cf137a7f8a023463afd9f0~

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-08-11 09:53:02 -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
90b6712d01 wcte13xp: Reset span alarm to RED on startup
A fresh modprobe and dahdi_cfg would cause a temporary green alarm state on the
driver 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>
Acked-by: Shaun Ruffell <sruffell@digium.com>
2014-07-23 16:24:01 -05:00
Shaun Ruffell
31cbf7a90e wcte43x: Fix failure to download firmware.
The firmware/Makefile missed a line that added the firmware for the TE436 to the
download list.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-07-18 10:19:09 -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
8210fea5b3 wcte13xp: 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
a1ff3cb0c0 dahdi: Stop tones on channel when updating tone zone.
If a channel is currently playing a tone when the tone zone is updated, the
existing tone zone could be freed while the channel keeps a reference to the
current tone (curtone) that points into the freed zone.

If the newly freed tone is then modified, there was a window where it was
possible to  corrupt 'struct dahdi_chan' (by overrunning swritechunk[])
resulting in a "BUG: unable to handle kernel paging request at virtual address"
panic in the context of __dahdi_transmit_chunk().

Reported-and-Tested-by: Matt Behrens <matt@zigg.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-07-07 12:25:36 -05:00
Shaun Ruffell
089b593b56 wct4xxp: Report rx signalling bit changes after spanconfig.
This fixes a long standing issue where, for CAS signaling, the RX bits were
sometimes misreported after span configuration before the first detected state
change.

The logic in the wct4xxp driver now matches that in the wcte43x driver and
wcte13xp drivers. The wcte12xp driver always polls the sigbits due to how
voicebus works and is not affected by this.

Internal-Issue-ID: DAHDI-1081
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-06-27 22:40:28 -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
f35e8aafb0 wcte13xp: Do not get stuck in "Not Open" state when DAHDI_CONFIG_NOTOPEN is set.
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 wcte13xp 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
b3a6b91858 Do not call dahdi_span_ops.open with spinlock held.
This makes the open symmetrical with the close. It is also considered good
practice to not call through callbacks with spinlocks held.

I modified all the drivers where I could not tell whether it was necessary to
hold the chan->lock with interrupts disabled to simply take the lock inside the
callback.

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
2e33bdc7b5 tor2: Remove unused open/close callbacks.
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
3755ec9bf2 wct4xxp: Remove unused open/close span_ops callbacks.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-20 13:01:27 -05:00
Doug Bailey
47f0fde0f1 wct4xxp: AMI w/CAS errata applies to octal card as well.
Fixes inability to reliably get CAS (robbed-bits) when using AMI line encoding
on the TE820 card.

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
180a17a39c wct4xxp: Trivial kmalloc + memset -> kzalloc.
Just a minor cleanup.

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
d1afa1b101 oct612x: Implement the SerializationObject callbacks.
When originally implemented, the octasic calls where protected by the big kernel
lock. This change now allows the octasic library to control it's synchronization
as originally intended.

It would still be worthwhile to completely make the oct612x library
kernel-compliant.

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
b4941f35ad wct4xxp: Move bottom half processing from tasklet to workqueue.
I am primarily making this change in order that the oct612x API can use a mutex as
a synchronization primitive. Mutexes can only be aquired in process context and
the wct4xxp driver calls the Oct61000InterruptServiceRoutine (which grabs a
serialization object) when tone detection is enabled.

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
a3578ca156 dahdi: dahdi_chan.ec_factory can be protected with the mutex.
This is never accessed or modified in interrupt context. This closes a potential
race if the echocan is being changed on a channel while enabling disabling is
hapening on another thread.

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
761e02da52 dahdi: Protect echocan creation/destruction with mutex.
This closes a reference and memory leak when multiple CPUs are enabling echocan
on a single channel in parallel.

The essential problem is that the call to try_module_get() is not serialized.
Two separate threads can come into ioctl_echocan() on the same channel, they
coordinate via the dahdi_chan.lock to release any current echocan, but then both
create a new echocan state, bump the reference on the module, and the last one
through will actually attach the new state to the channel. The earlier reference
/ memory is leaked.

I tried to conceive of a way to fix this leak without adding a new lock, but the
choices where calling throught the function pointers with dahdi_chan.lock.
Otherwise I needed to change the semantics of echocan_create /free which would
ripple through the hardware echocan modules.

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
cb50ae1500 wctc4xxp: spin_lock() -> spin_lock_irqsave() in wctc4xxp_watchdog()
Since commit (e10f740 "wctc4xxp: Service tx ring in interrupt handler."), it
was possible to deadlock the system if the interrupt fires while the
watchdog function is running in the context of the system timer.

This was reported by lockdep.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-10 11:33:00 -05:00
Shaun Ruffell
e9ec13dfa0 wctc4xxp: Trivial reduction of indentation level in wctc4xxp_watchdog()
Now use a continue after the check for cmd->timeout. This change is because I
need to make another change but the deep indentation level would make it hard to
stay within the 80 column limit.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-10 11:33:00 -05:00
Shaun Ruffell
dfa8a0ebd3 wctc4xxp: Trivial removal of unused structure members.
These were left over from recent developments and are not used by the driver.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-05 11:35:42 -05:00
Shaun Ruffell
6e10dbdfb6 wctc4xxp: Constrain RTP payload to 500 bytes.
This is a limitation of the DTE firmware that normally would result in dropped
packets on the firmware. If the driver knows it is going to be dropped it should
drop it.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-05 11:35:42 -05:00
Shaun Ruffell
2010bc6433 wctc4xxp: Reload the firmware if a fatal alert was received.
The driver will now automatically reload the firmware when there are no open
channels if the firmware reports a fatal error. If the firmware reports an
error, but it was not fatal, it will leave things running and try to reload when
all channels are shut down. The driver will also halt channel processing and
reload the firmware if a channel ever failed to be created.

The thought is that if the DTE reports a non-fatal error, I cannot be certain
what the state is, and it should be reset when possible without impacting
otherwise functioning card.  If there are problems, presumably all users would
hang up and the driver will then reload the firmware.

If the error is fatal, then all processing is halted to encourage everyone to
hang up. The card is probably not working at this point anyway, so there is no
point in trying to communicate with it.

Also included in this change is a compile-time selectable debug sysfs attribute
that will allow forcing an alert condition for testing the recovery.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-06-05 11:35:42 -05:00
Shaun Ruffell
624f30bbf6 wctc4xxp: Trivial fix typo that was preventing firmware load.
The interrupt handler was not schedulding the deferred processing routine when
there was packets to process. I did not test the actual master branch after
editing for checkpatch compliance. Sorry.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2014-06-02 06:08:08 -05:00
Shaun Ruffell
d7c0b0aba1 wctc4xxp: Prevent exhausting memory in firmware.
If the host system sends to many packets to the DTE to process, the on-card
memory can be exhausted which will result in an out of memory alert. In commit
2ac2338247, the driver will halt all communication
with the card and request a reload if any alert is received.

Now the driver will silently drop any "burst" traffic that was sent to the
transcoder as opposed to expecting the firmware to do it. There is currently a
limit of 640 samples (80ms of audio) in flight to the firmware at any one time
allowed.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-05-30 15:07:20 -05:00
Shaun Ruffell
e10f740476 wctc4xxp: Service tx ring in interrupt handler.
This helps to keep the tx descriptor ring at max capacity when the system is
otherwise loaded. Now ready packets are moved from cmd_list to the transmit
descriptor ring directly in the interrupt handler and not when the deferred
function runs.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-05-30 15:07:20 -05:00
Shaun Ruffell
dc92bf05cd wctc4xxp: Fix the timestamp calculation for the RTP stream.
I do not have any evidence that this made a difference, but hopefully it will
clear things up for people in the future who might be wondering why the
timestamp does not increase with the number of samples actually sent.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-05-30 15:07:20 -05:00
Shaun Ruffell
8557bb6786 wctc4xxp: Speed up the rate of polling.
The polling interval was not fast enough to keep the tx ring full on a loaded
card. This fixes a regression introduced in commits
ba05e31c8a and
354d88cd41.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
2014-05-30 15:07:20 -05:00