summaryrefslogtreecommitdiff
path: root/drivers/dahdi/voicebus/voicebus.h
AgeCommit message (Collapse)Author
2012-03-21wcte12xp, wctdm24xxp: Add compile-time option to disable ASPM for PCIe devices.Shaun Ruffell
Certain BIOSes appear to enable ASPM even though it is not fully supported by the platform. Also, since the PCIe links for TDM cards are always in use it does not make sense to allow them to transition to the disabled state. Just turn off power management on the PCIe links completely. For more information see http://lwn.net/Articles/449448/. Internal-Issue-ID: DAHLIN-283 Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10557 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04wcte12xp, wctdm24xxp: decriptor_list.count does not need to be atomic.Shaun Ruffell
It is only ever accessed in interrupt context anyway. Saves several hundred nanoseconds from hard interrupt context. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Michael Spiceland <mspiceland@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9888 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04wctdm24xxp, wcte12xp: Add voicebus_quiesce function.Shaun Ruffell
voicebus_quiesce is like voicebus_stop, except that it doesn't wait for any information to come back from the card. This prevents kexec from blocking waiting for information from a potentially dead card. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Michael Spiceland <mspiceland@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9880 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04voicebus: Update the network debug device to use dma_pools.Shaun Ruffell
r9402 switched to dma_pool for the SFRAMES. This updates the network debug device to use the dma_pools for SFRAME allocation. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Michael Spiceland <mspiceland@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9877 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-23wcte12xp, wctdm24xxp: Convert vbb cache from kmem_cache to dma_pool.Shaun Ruffell
The voicebus interface constantly uses the same buffers for moving data to/from the card. A fixed pool has less overhead in this case than constantly mapping/unmapping the kmem_cache_alloced buffers. Saves about ~2.608 us for each run of vb_isr on a 2.40 GHz Xeon test machine. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9402 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-11wctdm24xxp, wcte12xp: Fix comment. RELAXED is no longer a mode name.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9319 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-17wcte12xp, wctdm24xxp: Add compile time option CONFIG_VOICEBUS_ECREFERENCE.Shaun Ruffell
Add compile time option to improve the reference signal provided to software echo cancelers. The intent here is for this functionality to become the default behavior but more testing and work on the edge cases is needed. It's being brought in now as a compile time option since there have been reports that it helps in some environments. Instead of using two buffers, which means that at best we're two milliseconds behind, use a circular buffer where audio data is written on the transmit side and read on the receive path. In this way high latency values will not interfere with the operation of software echo cancelers. DAHDI-291. DAHDI-387. This work was originally on: http://svn.asterisk.org/svn/dahdi/linux/team/sruffell/improved_ecreference@9143 and includes a generic kfifo replacement by Matt Fredrickson. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9144 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26wcte12xp, wctdm24xxp: Return buffer processing to interrupt handler.Shaun Ruffell
In revision 8095, I had moved most of the buffer processing out of the interrupt handler and into a tasklet. The intended result was to enable multiple cards to interleave with one another. But once again I was bitten by the fact that there are some systems that for one reason or another do not process their tasklets in a timely enough manner for the real-time nature of TDM processing. This commit moves this processing back into the interrupt handler by default. It also limits the number of frames that the interrupt handler will process at any given time which appears to achieve the same intended result. (closes issue #17289) Tested by: alecdavis git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8982 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26wcte12xp, wctdm24xxp: spin_lock_bh -> spin_lock_irqsaveShaun Ruffell
Will add an option to allow calling the deferred processing callback directly in the interrupt handler. It appears there are some systems which still are unable to process their tasklets in a timely fashion, especially if they get pushed out to the ksoftirqd daemon. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8981 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-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-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-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-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-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-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-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-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: 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-04-29voicebus: Move common vpmadt032 interface into voicebus module.Shaun Ruffell
The voicebus library was previously linked into both the wcte12xp and wctdm24xxp drivers. It is now broken out into it's own module and the common parts of the vpmadt032 interface are now located in that module to reduce duplication between the wcte12xp and wctdm24xxp drivers. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6527 a0bf4364-ded3-4de4-8d8a-66a801d63aff