summaryrefslogtreecommitdiff
path: root/drivers/dahdi/voicebus
AgeCommit message (Collapse)Author
2010-05-14Merged revisions 8560,8575-8576 via svnmerge from Shaun Ruffell
https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r8560 | sruffell | 2010-04-22 16:36:16 -0500 (Thu, 22 Apr 2010) | 11 lines wcte12xp, wctdm24xxp: Ensure writes to I/O registers are flushed. In revision 8176 I changed register access from I/O space to memory mapped registers. Unfortunately, when I made that change, I didn't account for posted writes. This change makes sure all the registers are read back to ensure that they are posted through any intermediate bridges. The most readily observable symptom were cards that were taking 2000 interrupts/second. The card reported that it handled an interrupt but the write to silence the card wasn't flushed through until the second time the interrupt handler run. DAHDI-602. ........ r8575 | sruffell | 2010-04-26 18:29:16 -0500 (Mon, 26 Apr 2010) | 4 lines wcte12xp, wctdm24xxp: Do not allow interruptible sleep on VPM lock. If the sleep is ever interrupted, 'up' will still be called in the GpakApi, essentially making the lock useless after that point. ........ r8576 | sruffell | 2010-04-26 18:29:17 -0500 (Mon, 26 Apr 2010) | 9 lines wcte12xp, wctdm24xxp: Retry if the VPMADT032 reports not ready. CheckDspReset can return -1 if the DSP is not ready to process any new commands. In this case we should retry a few times to give the DSP a chance to become ready. While I'm not ready to say this definitely fixes recently reported cases when the wcte12xp driver constantly resets, it eliminated communication failures to the DSP module when under stress (via the vpm_firmware_version sysfs attribute). However, I haven't let it run long enough to say that the issue is resolved. DAHDI-603. ........ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.3@8621 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-06voicebus: Change WARN_ON_ONCE to BUG_ON.Shaun Ruffell
WARN_ON_ONCE is not defined in 2.6.9, and this condition would be catastrophic anyway if it were to occur. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8494 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-05wcte12xp: Try to reconfigure the VPM if we fail to configure the channels.Shaun Ruffell
Also, fall back to any software echocan configured for this channel for new calls while we're in the middle of a recovery. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8473 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-04wcte12xp: Poll the VPM and reset it if necessary.Shaun Ruffell
When the transmit descriptor runs out completely, there (appears to be) a chance for a random command to be sent that results in the VPMADT032 to no longer respond, typically resulting in one way audio. This change introduces a poll of the VPM. If it fails the poll, it will be bypassed temporarily while the driver resets and reprograms it. Also, the VPM is initially programmed in the spanconfig callback instead of at driver load. This moves the potential for underruns until later in the boot process. DAHDI-573. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8468 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-04wcte12xp, wctdm24xxp: If we're only one packet behind, just exit.Shaun Ruffell
This will make us two behind, which is fine, and eliminates a busy loop in atomic context. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8467 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-03wcte12xp, wtdm24xxp: Make sure the writes are retried.Shaun Ruffell
r8454 and r8460 introduced a change where writes are not retried when other module/framer commands are retried. This was an error and wasn't what was actually under test. This commit restores the behavior in wctdm24xxp and makes sure the vpm writes are retried in the wcte12xp. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8461 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-03wcte12xp, wctdm24xxp: Close a memory leak when processing VPM commands.Shaun Ruffell
Closes a memory leak when processing the VPM write commands introduced in r8454. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8460 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-03wcte12xp: Resend both framer and VPM commands when reads may have been lost.Shaun Ruffell
Latency conditions could cause the driver to misconfigure the VPM which would result in one way audio. DAHDI-572. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8454 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-25wctdm24xxp: Add an 'hx8' mode for buffer processing.Shaun Ruffell
The Hx8 series cards do not need any idle buffers and idle_buffers complicate processing when using the timing_cable. This change adds another mode of operation for the voicebus layer for the Hx8 cards that operates without the idle buffers. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8431 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-22wctdm24xxp, wcte12xp: Fix several problems with buffer processing.Shaun Ruffell
* If the receive packet isn't the correct size, we can't just drop it, we have to resubmit it to the receive queue immediately so it will get cleaned up properly. * It isn't safe to leave the buffers on any lists while calling the function to resubmit it to the descriptor ring, since it may be freed which potentially results in a corrupted list. * If the card is held up in a state where it is waiting for receive data, there is a chance that when the transmit process is started up again it could DMA data into a buffer that has already been freed. By using our own freelist, there isn't a chance that the board will DMA data into memory that has been recycled for another purpose. * Disable the tasklet when processing hard underruns in order to not corrupt the descriptor rings. * Make sure voicebus_stop and voicebus_release aren't running at the same time as the hard underrun handler. This too can result in corrupted descriptor lists. DAHDI-560. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8379 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-22wctdm24xxp, wcte12xp: Remove the completion on shutdown.Shaun Ruffell
Oddities in the receive processor state make this completion not so useful anymore. It is more straightforward to simply poll the state on shutdown. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8378 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-22wctdm24xxp, wcte12xp: Remove locking macros.Shaun Ruffell
Since the locking will always take place in a bottom half now (either a timer or tasklet), we do not need the special locking macros anymore. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8377 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-22wcte12xp, wctdm24xxp: Do not keep individual free lists for VPM commands.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8375 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-01voicebus: Include dahdi/kernel.h in voicebus_net.cShaun Ruffell
Brings in any backward compatibility definitions. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8204 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-01wctdm24xxp, wcte12xp: Add optional module parameter to set the maximum latency.Shaun Ruffell
Setting the maximum latency can be useful if you have a system event that normally causes a latency increase, but you would rather have a break in the audio or frame slip, then let the latency grow to the current default maximum which is 25ms. DAHDI-278. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8198 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-01wctdm24xx, wcte12xp: Fix compiler warning about unused local variable.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8189 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-01wctdm24xxp, wcte12xp: Change list_for_each_entry to list_for_each_entry_safe.Shaun Ruffell
Since we're calling list_move_tail, we need to use the safe version. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8183 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-01wcte12xp, wctdm24xxp: Use memory mapped IO instead of port IO.Shaun Ruffell
Some systems do not like the port I/O and this change allows it to work. DAHDI-515. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8176 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26voicebus: Turn off CONFIG_VOICEBUS_SYSFS by default.Shaun Ruffell
Needs work to make backward compatible with the range of supported kernels. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8141 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26wctdm24xxp: Add support for Hx8 series cards.Shaun Ruffell
The Hx8 series cards support BRI modules in addition to analog modules. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8123 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26wctdm24xxp, wcte12xp: Updating the interface for the VPMADT032.Shaun Ruffell
This description needs to be filled in more. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8121 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26voicebus: Only use the slab debug facilities if CONFIG_SLAB_DEBUG is defined.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8119 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26voicebus: Add optional network debugging interface.Shaun Ruffell
This interface is only used to facilitate debugging. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8118 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-25voicebus: Only use request_module_nowait on kernels >= 2.6.30.Shaun Ruffell
Request_module_nowait is only useful when asynchronous initialization is used (committed to trunk in r8094), and that can only happen in kernel version after 2.6.30. Some earlier kernels do not have the request_module_nowait interface. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8111 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-25wctdm24xxp, wcte12xp: Buffer handling improvements.Shaun Ruffell
This patch moves the majority of the buffer processing for the voicebus based cards out of the interrupt handler and into a tasklet. When multiple cards are running on the same CPU, and there was a latency condition that would cause them to get behind, this now allows the tasklet to limit how many buffers are processed on each card before giving the other card a chance to start working on it's backlog. Additionally, when the card detects a hard under run, instead of trying to fix it up in the handling routine, it will now reschedule a work item that will completely reset the descriptor rings. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8095 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-25wctdm24xxp: Provide option to initialize boards in parallel on kernels > 2.6.30Shaun Ruffell
The 2.6.30 kernel provides support for asynchronous initialization. If running on a kernel that supports this feature, let's add an option to use it in order to speed up driver load times. Keep it off by default. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8094 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-24wctdm24xxp, wcte12xp: Abort attach if interface fails to come out of reset.Shaun Ruffell
If the reset bit never clears, then just assume we cannot talk to the board and error on the attach. DAHDI-515. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8080 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-10voicebus: Improve hard underrun handling.Shaun Ruffell
When there is a hard underrun, or in other words interrupts are held off for so long that the board completely runs out of transmit descriptors, it was too easy for the driver to be in a 'confused' state about the descriptors. This change has the driver cleanup and reset the descriptor ring in this case so that we're not racing against the interface while we resume normal operation. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8026 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-10vpmadt032: show the location of the device printing to the kernel logShaun Ruffell
Another commit that has formatting problems (mainly lines over 80 characters) that I will fix in a later commit. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8025 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-08voicebus: Reset own bits when a soft underrun is detected.Shaun Ruffell
If a combination of softunderun results in descriptors that aren't owned being skipped in the vb_recover_tx_descriptor_list, it's possible for processing to stop on a descriptor that isn't owned. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8010 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-08dahdi: Update the Digium copyright on files changed since 2010-01-01.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8008 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-08vpmadt032,wcte12xp: Use a timeout on the read/write commands and during load.Shaun Ruffell
It is possible for poorly behaving hardware (and driver bugs) to lockup the modprobe process by having it wait indefinitely for a command to complete that never will. DAHDI-451. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8003 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-08voicebus: Remove unused 'voicebus_get_pci_dev'.Shaun Ruffell
Function is no longer needed since the 'struct voicebus' is now embedded in the client contexts. This commit also contains a few trivial formatting changes for sparse's sake. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8002 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-03wctdm24xxp, voicebus: Move sysfs handling from voicebus to wctdm24xxp.Shaun Ruffell
The drv_data attached to the pci_dev is no longer the 'struct voicebus' pointer, but is instead the 'struct wctdm' (or 'struct t1'), so the clients need to manage the sysfs files themselves. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7983 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-01-08voicebus: Remove framesize, buffer_cache, and cache_line members from struct.Shaun Ruffell
Framesize is the same on all the clients, so it can be removed from the 'struct voicebus' (and changed back again if needed). Since the framesize is the same, each board doesn't need it's own buffer_cache, and cache_line is only used during startup and can be read directly from pci configuration space, so we don't need to keep it around in our context. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7779 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-01-08voicebus: Make 'struct voicebus' embeddable by the client driver strutures.Shaun Ruffell
In addition to making 'struct voicebus' embeddable, also add an 'voicebus_operations' structure. This was done so that a) remove the "context" pointer from struct voicebus, and also to show that handle_recieve/transmit are to be managed together. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7778 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-12-22voicebus, wcte12xp: Only define SLAB_STORE_USER when CONFIG_SLUB is defined.Shaun Ruffell
On 2.6.22, there is was a bug in the SLUB allocator that required defining SLAB_STORE_USER, however this setting is only valid when CONFIG_SLUB is defined and not when using the previous slab allocator. DAHDI-424. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7722 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-12wcte12xp, voicebus: Set the companding mode correctly on E1.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7582 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-12voicebus: Use dev_xxx macro when printing vpm messages.Shaun Ruffell
We also do not need the unused context member of the vpmadt032 structure. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7569 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-12voicebus: Remove redundant MAX_CHANNELS_FROM_SPANShaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7568 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-12voicebus: Remove unused curtone from 'struct vpmadt032'Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7567 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-12voicebus: Fix race when enabling/disabling hardware echocan.Shaun Ruffell
This closes a race condition where it was possible for the driver to believe it has enabled the VPMADT032 when in fact, it really has not. This fixes a regression introduced in dahdi-linux 2.2.0. (issue #15724) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7565 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Be just a little more graceful if we cannot grab our interrupt line.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7524 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Remove 'assert' macros and use BUG_ON/WARN_ON directly.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7523 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Add optional sysfs entry for reading a boards current latency.Shaun Ruffell
This is off by default since it hasn't been tested on a full range of kernels, but can be useful for quickly seeing differences for latencies on different cards installed in the system. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7522 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus, wctdm24xxp, wcte12xp: Move a print out of the interrupt handler.Shaun Ruffell
This can be handled just as well in process context and printing to a serial console from the interrupt handler has the potential to cause long latencies. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7521 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Add function to lock the latency.Shaun Ruffell
Now that increases in the latency produce less undefined behavior on the SPI busses, provide an interface for client drivers to inform the voicebus library to not increase the latency if underruns are detected. This can speed up loads of the driver since latency bumps do not trigger a restart of the driver initialization. DAHDI-278. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7518 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Send 'idle' buffers when the transmit descriptor underruns.Shaun Ruffell
Previously, when the host system fails to service the interrupt in a timely fashion, the transmit descriptor ring for the voicebus card would "go empty" since the interface wouldn't have another descriptor to read in. The driver only knows that it went empty, not how far behind it actually was. Therefore, the driver could just increase the latency by a millisecond and keep going waiting for another bump. Additionally, when the transmit descriptor actually goes empty, there are some cases where an in process SPI transaction to one of the modules is interrupted, which may result in corrupted module register writes on rare occassions. This now makes it possible for the voicebus drivers to coexist with some devices that periodically lock interrupts for longer than 25ms. Before this patch, the latency would constantly increase until either the modules received a corrupted frame. This patch preconfigures all the receive descriptors to send an "idle" packet that will be transmitted to the onboard modules when the host doesn't service the interrupt within (latency - 2)ms. There are now two kinds of underruns, softunderuns where the driver can detect that these idlebuffers have made it to the TX FIFO, and the normal hard underrun where the part signals a transmit descriptor unavailable interrupt. DAHDI-278. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7517 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Use DAHDI_IRQ_SHARED instead of defining our own.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7516 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-07voicebus: Set the DMA_BIT_MASKShaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7515 a0bf4364-ded3-4de4-8d8a-66a801d63aff