Commit Graph

379 Commits

Author SHA1 Message Date
Russ Meyerriecks
1714113c17 wcte12xp, wctdm24xxp: Add support for the VPMOCT032 hardware echocanceler.
Support enabled for the vpmoct032 echo cancellation module for the wctdm24xxp
and wcte12xp drivers.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9997 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 22:28:53 +00:00
Shaun Ruffell
355ab14d47 dahdi: Always attach hwec to a channel if available.
In previous releases of DAHDI if dahdi_cfg attached a software echocan
to a channel and a hardware echocan was available, the hardware echocan
would be used instead of the software echocan.

Since the 2.4 branch was created a new feature was merged into
dahdi-linux where it was possible to mix software echocan and hardware
echocan on a channel. This required using "hwec" as the echocan in the
/etc/dahdi/system.conf file so that what was specified in the
configuration file is what was actually used.

This has resulted in users upgrading to the trunk of dahdi without
updating their /etc/dahdi/system.conf file and just suddenly not using
any hardware echocans any longer.

The capability to mix software and hardware echocans on a span will be
revisted when running dahdi_cfg on any preexisting configuration files
doesn't just silently turn off hardware echocan.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9995 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 21:29:20 +00:00
Oron Peled
15c12a08f8 xpd_echo: XPP Octasic echo canceler module
* xpd_echo (card_echo.c) - a module to handle an Astribank hardware echo
  canceller module.
* All other XPDs are now of type 'telephony_device'. Only a telephony device
  XPD provides a span to register.
* The EC module will typically show up as XPD-40 and will always show up as
  Unregistered in 'dahdi_hardware -v'

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>


git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9993 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 18:23:00 +00:00
Shaun Ruffell
a36bd8863e Revert "dahdi: Group dahdi timers into "rates" for improved CPU utilization."
This reverts commit r9891 and is part of two commits to revert all the
timer changes.

Grouping the timer into rates did not allow a timers rate to be changed
after another thread is already blocked on the poll call

The problem that was reported was if a sip call was made to a DAHDI
channel and the sip call was disconnected before answer, the DAHDI
channel would never stop rining.

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@9991 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 15:55:48 +00:00
Shaun Ruffell
6d4a47a6ef Revert "dahdi: If a timer is not configured then we should block indefinitely."
This reverts commit r9937 and is part of two commits to revert all the timer
changes.

Grouping the timer into rates did not allow a timers rate to be changed after
another thread is already blocked on the poll call

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@9990 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 15:55:44 +00:00
Shaun Ruffell
a1d84ea99c wcte12xp: Start alarm timer after marking board initialized.
r9946, "wcte12xp: Move the VPMADT032 test/configuration to module load
time." introduced a race condition where it was possible for the timer
that initiates the check for the alarms to fire before the board was
marked initialized.  This would result in a board that would never again
check it's alarm state since the first time the timer runs INITIALIZED
may not be set and it will not reschedule a check since it believes the
driver is unloading.

This happened because the check for the VPM was moved between when the
timer was first setup and when INITIALIZED was then set.

Now we make sure INITIALIZED is set before the timer is first setup, and
move those two operations together.

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@9981 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-20 16:01:59 +00:00
Shaun Ruffell
90e504dc25 wctdm24xxp: Do not read extra register when test for FXO module fails.
In commit r9968 "wctdm24xxp: Allow more than one outstanding read at a
time" I introduced a regression where the transmit FIFO on the data
channel of a B400M could get locked up. The result would be constant
HDLC overflows when writing to the data channel.

This regression did not make it into any releases and did not exhibit
itself when crossing spans on a single B400M module. This is a partial
revert of commit r9968.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9977 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-11 01:58:43 +00:00
Shaun Ruffell
fb942bbd11 wctdm24xxp: Do not export board number in the device description.
The board number dupliates the information that is available in the
location field. Exporting it as part of the description makes the name
dependent on the driver bind order which is not desirable.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9971 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:04:02 +00:00
Shaun Ruffell
20b5c919a4 wctdm24xxp: Calculate the SPI offsets ahead of time.
Updates the CMD_BYTE macro to use precalculated offsets.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9970 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:57 +00:00
Shaun Ruffell
40a8265509 wctdm24xxp: Shorten up some of the sleeps/waits.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9969 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:52 +00:00
Shaun Ruffell
3433925a92 wctdm24xxp: Allow more than one outstanding read at a time.
Since every read needs to go through the complete voicebus pipeline, if
we know we're going to read multiple bytes we can queue them all up.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9968 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:48 +00:00
Shaun Ruffell
982aa8ed1c wctdm24xxp: reglock can be used to protect the txhookstate.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9967 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:43 +00:00
Shaun Ruffell
e35a01e5df wctdm24xxp: Use lists for SPI commands to the modules.
Saves time in the interrupt handler by eliminating the need to scan
through all of the slots in the cmd arrays. Also allows the reads from
ISR context to automatically grow as the latency grows. This ensures
that battery and hook state is actually checked every frame like
originally intended.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9966 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:38 +00:00
Shaun Ruffell
b079b51b21 wctdm24xxp: Cleanup in wctdm_identify_modules.
Trivial reformatting that preps it for some parallelizing the module
loads.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9965 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:34 +00:00
Shaun Ruffell
2b6d5d3826 wctdm24xxp: Remove 'pos' member from 'struct wctdm'.
The card position is only used during startup so we don't need to carry it
around in the strucuture.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9964 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:29 +00:00
Shaun Ruffell
953a317be3 wctdm24xxp: Drop 'flags' from 'struct wctdm_module'.
The voicebus cards only support the S110M FXS modules which are based on
the 3215. The module flags member was only used to hold whether we were
dealing with a 3210 or 3215 SLIC, so we can drop it since we always know
we'll have a 3215 based SLIC.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9963 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:24 +00:00
Shaun Ruffell
8e96b99bc9 wctdm24xxp: Hold the reglock longer in the interrupt handler.
Cuts down on the overhead of constantly saving and restoring the
interrupt registers.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9962 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:20 +00:00
Shaun Ruffell
fca9c4949f wctdm24xxp: Pass the pointer to struct wctdm_module directly instead of index.
This change gets all the easy places and saves on array dereferences
when we already have the address of the module that we are interested
in.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9961 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:15 +00:00
Shaun Ruffell
ca3a7de06d wctdm24xxp: Use pointer to "struct fxs" in POLARITY_XOR.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9960 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:10 +00:00
Shaun Ruffell
6d8e406bc5 wctdm24xxp: Trivial. Reduce the indentation level in wctdm_proslic_oppending.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9959 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:06 +00:00
Shaun Ruffell
225eea7af3 wctdm24xxp: Use enumeration for module types.
This change is to primarily to clarify that the types are always mutually
exclusive.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9958 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:01 +00:00
Shaun Ruffell
5815009724 wctdm24xxp: Group the QRV members together.
This also allows us to add them to the union with the other module types so
they do not add to the memory usage if there aren't any QRV modules installed.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9957 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:56 +00:00
Shaun Ruffell
cfcd7c0aee wctdm24xxp: Group the per-module information together
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9956 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:51 +00:00
Shaun Ruffell
9a37c88c6d wctdm24xxp: Dynamically allocate the board_name.
Move the data backing the mostly unused string away from the active
members of 'struct wctdm'.

The location where some of the other members of 'struct wctdm' are initialized
were moved so that wctdm_back_out_gracefully always has a fully formed
structure to work on.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9955 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:47 +00:00
Shaun Ruffell
60406e1a0c wctdm24xxp: Remove modmap member from 'struct wctdm'.
We can already use the module type to determine presence of a module to
check. This also moves the background polling of the modules until after
the board is completely initialized because the module type may change
while the different types are being probed. This also means that we need
to preset the shadow registers for the FXS because otherwise the shadow
register will not have been read before the first time it's checked for
a power alarm.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9954 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:42 +00:00
Shaun Ruffell
712e65f0dc wcte12xp: Limit how many consecutive times to reset the VPMADT032 module.
Both limit the amount of junk in the kernel log and also prevent dahdi_cfg
from running indefinitely if there is a module with a hardware problem which
prevents it from completing the startup sequence.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9953 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:38 +00:00
Shaun Ruffell
778623eeff wcte12xp: Remove unused vpm100 member from 'struct t1'
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9952 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:33 +00:00
Shaun Ruffell
77dfe92f26 wcte12xp, wctdm24xxp: Separate test for VPMADT032 and initialization.
Part of increasing system startup speed.

Splitting these two operations facilitate checking if there is a module
present synchronously on driver load from the actual load of the firmware and
configuration of the channels.

This will allow the presence of the VPM module to be flagged on the span
before registration, but load and configuration can happen in the background.
When the modules are eventually loaded via udev, there will be enough time
from the time the drivers are loaded to when dahdi_cfg will run to complete
the firmware load, eliminating the need to block the driver here.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9951 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:28 +00:00
Shaun Ruffell
205847da8e wcte12xp, wctdm24xxp: Use a constant string for the VPM workqueue name.
In my opinion naming the VPM workqueues for each board is not worth the
extra complexity.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9950 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:23 +00:00
Shaun Ruffell
b60823b0cc wcte12xp: Set the t1.vpmadt032 pointer under the reglock.
Ensures that a single run of the interrupt service routine is consistent
about whether there are VPMADT032 commands to process or not.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9949 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:18 +00:00
Shaun Ruffell
456e7969ee wcte12xp: Put "Span configured" message behind debug flag.
This message also duplicates what is in the /etc/dahdi/system.conf file
and should only be necessary when troubleshooting problems.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9948 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:13 +00:00
Shaun Ruffell
578ebe85c2 wcte12xp: kmalloc/memset -> kzalloc.
This is trivial cleanup. Fixing up a couple of places that followed a
kmalloc with a memset to 0 and also sneaked in one ARRAY_SIZE usage
change.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9947 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:08 +00:00
Shaun Ruffell
82acfbd41d wcte12xp: Move the VPMADT032 test/configuration to module load time.
The firmware load of the VPMADT032 was moved to startspan because a
quad-span card in the same system would would lock interrupts for
several seconds to load VPMOCT064/128 firmware. Now that the wct4xxp
driver no longer locks interrupts while loading its VPM module this
driver can move the VPMADT032 check/load back to module load time.

This is also required so that the presence of a hardware echo canceler
is marked on the span before it is registered with dahdi-base.c.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9946 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:02:03 +00:00
Shaun Ruffell
c5691ec293 wcte12xp: Force spanconfig/chanconfig to wait for ready.
This is always true currently but will not necessarily be in the future.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9945 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:59 +00:00
Shaun Ruffell
27acb7088c wctdm24xxp: Block chanconfig and spanconfig until board is ready.
Currently the board will always be ready if the module initialization
function is complete but this change will facilitate allowing some of
the more time consuming configuration steps to happen in parallel on
system start.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9944 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:54 +00:00
Shaun Ruffell
759f0c07f0 dahdi: Do not allow 'hwec' to be attached to channels that do not have one.
This defines a NULL value for the name of an echocan as invalid. This
will allow dahdi_genconf to probe for the presence of a hardware echocan
on a channel by trying to attach one. If there is not a hardware echocan
available DAHDI_ATTACH_ECHOCAN ioctl will return -EINVAL if 'hwec' was
specified as the name of the echo canceler now.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9943 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:49 +00:00
Shaun Ruffell
93a7adfb9f dahdi: Provide notification when preechocan buffer is created and destroyed.
Not quite ideal, but this seems to be the most straightforward way to
know when someone is trying to monitor the preec stream on a channel.
This callback allows the board driver providing the span an opportunity
to setup the hardware preecho monitoring as needed.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9942 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:44 +00:00
Shaun Ruffell
dd33d6c357 dahdi: Update the dahdi_ec_chunk interface to support preec streams.
dahdi_ec_chunk is the function that saves the received audio and places
a signed linear copy of it in the pre echocanceled buffer on the
channel.  By splitting the input and output of this function into two
parameters, a driver that can provide separate pre and post ec streams
can pass them independently to DAHDI, without worrying about DAHDI
overwriting a stream that may have already been echocanceled by the
hardware.

Previously, the dahdi_ec_chunk interface took a received audio buffer
and overwrote it after canceling the echo.  Now the input and output
from the function are broken up in order to support hardware echocans
that have a different preechocan stream.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9941 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:40 +00:00
Shaun Ruffell
76df5ab26b dahdi: Allow dahdi_span_ops.[chan|span]config and startup to block.
This change ensures that the dahdi_span_ops callbacks are not called
with any spinlocks held, and that the module is pinned in memory, and
also passes the struct file * pointer to the callbacks.

Passing the file pointer to the callbacks allows the board drivers to
check any flags on the file descriptor used to configure the
span/channel. The intent here is to allow dahdi_config to open the
/dev/dahdi/ctl file in a non-blocking mode in case there is a lengthy
processes that needs to happen as part of configuration.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9940 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:34 +00:00
Shaun Ruffell
09eb417ec4 dahdi: Do not release the echocan under lock.
This allows any echocan cleanup to block if necessary. Especially useful
for hardware echocans that may need to wait for hardware to complete the
cleanup process.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9939 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:29 +00:00
Shaun Ruffell
ca9d290af1 dahdi: If a timer is not configured then we should block indefinitely.
Some older Asterisk versions do not handle well the error message when poll is
called on an unconfigured channel. The result would be constant

__ast_read: No/unknown event '0' on timer for 'DAHDI/1-1'?

messages from Asterisk.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9937 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:20 +00:00
Shaun Ruffell
20c8b9b597 dahdi: Make tone zone registration messages debug only.
This duplicates information that is already in the
/etc/dahdi/system.conf file and should normally only be necessary for
the user when debugging problems.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9936 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:15 +00:00
Shaun Ruffell
e8221c04cf dahdi: Propagate shutdown returncode to user space.
This change fixes a condition where 'dahdi_cfg -s' would always return
success regardless of whether a board driver was able to complete the
shutdown. Only impacts board drivers that implemented the shutdown span
callback.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9935 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:10 +00:00
Shaun Ruffell
cb67046067 dahdi: Fix compilation on Linux 2.6.26 w/CONFIG_DAHDI_NET.
The hdlc_stats function was removed from the mainline kernel in commit
198191c4a7ce4daba379608fb38b9bc5a4eedc61 [1] which was first released in
linux 2.6.27.

[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=198191c4a7ce4

(closes issue #19354)
Reported by: biohumanoid

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9934 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:05 +00:00
Shaun Ruffell
d069cf1958 wct4xxp: Move the check for the VPM to module load time.
This allows dahdi-base to know whether or not there is a VPM attached to
the module as soon as it's registered as opposed to waiting for start
span. This will simplify dahdi_genconf's task of creating a valid
configuration file.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9933 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:00 +00:00
Shaun Ruffell
83035fa12f wct4xxp: Do not set maintstat in t4_clear_maint.
If we always set maintstat to DAHDI_MAINT_NONE, dahdi_base will lose
track of what it thinks the current state of the span is.

For example, if you run
$ dahdi_maint -s 1 --loopback localhost

When t4_clear_maint is called, the current maintenance mode state,
'maintstat', is set to DAHDI_MAINT_NONE. So the next time you call:

$ dahdi_maint -s 1 --loopback off

dahdi-base.c will believe that the user is trying to set the maintenance
state from DAHDI_MAINT_NONE to DAHDI_MAINT_NONE and will not actually do
anything.

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@9932 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:00:56 +00:00
Shaun Ruffell
01379f6ce7 wct4xxp: Atomically set framer bits for maintenance modes.
Do not allow the interrupt handler or another CPU to change the value
between when we get the initial value and when we write the modified
value.

Also includes a minor formatting fix where braces were not aligned, and
remove 'inline' from t4_framer_in and t4_framer_out definitions.

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@9931 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:00:51 +00:00
Shaun Ruffell
907c993743 wct4xxp: Set -Wno-unused-but-set-variable compiler option if available.
Turn this option on for the entire wct4xxp driver in order to quiet the
warnings in the oct612x source files. These files are from a vendor drop and
the goal is to limit the deviations from the vendor if possible.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9930 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:00:47 +00:00
Shaun Ruffell
86519d1211 Remove unused variables.
gcc-4.6 now warns about variables that are set but never used. Clean up
unused variables everywhere except the oct612x subdirectory.

The oct612x should go in a separate patch in case that needs to be
pulled out into a separate project again.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9929 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:00:36 +00:00
Shaun Ruffell
8f5f051b92 wctdm24xxp: Check if the FXS signaling setting is valid.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9928 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:00:29 +00:00
Tzafrir Cohen
6d9baa3f99 xpp: empty labels are not duplicate
Some older Asttribanks had an empty label string. They should be ignored
when testing for a duplicate label at device probe time.

While we're at it, reduce panic level in the notice.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9925 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-05-31 13:11:56 +00:00
Tzafrir Cohen
155cb5a0b1 xpp: Remove obsolete XPP_DEBUGFS code
XPP_DEBUGFS code was some code used to send BRI D-Channel data
through debugfs for, well, debugging. Unused in recent years.
Time to remove.

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9917 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-05-23 13:38:16 +00:00
Tzafrir Cohen
bbb34d7f29 xpp: Remove obsolete and unused OLD_PROC code
OLD_PROC marked old and unused code that was used for writing to procfs.
It has long ago been replaced with different sysfs interfaces. Time
to remove it.

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9916 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-05-23 13:37:40 +00:00
Shaun Ruffell
9146433e6d wcte12xp: Fix regression preventing VPMADT032 from loading.
Commit r9781, "wcte12xp, wctdm24xxp: Remove unused support for booting
VPMADT032 from SPI", introduced a bug that would prevent the VPMADT032
from ever being able to complete its startup. This regression did not
make it to any releases.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9914 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-05-19 21:53:54 +00:00
Shaun Ruffell
9c1880d31a dahdi: Enable DTMF A,B,C, and D digits.
This appears to be an old regression from zaptel r4063 [1] that would
prevent DAHDI from generating the A,B,C, and D digits due to
unintentional drop through on a case statement.

[1] http://svn.asterisk.org/view/zaptel?view=revision&revision=4063

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9912 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-25 14:22:39 +00:00
Shaun Ruffell
cfa5779017 wcb4xxp: Updating copyright.
The wcb4xxp driver was edited this year.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9911 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-25 14:22:31 +00:00
Kinsey Moore
fcd4db20d1 dahdi: Bug fix for enabling buffer events
Introduced in rev 9905, this bug could cause buffer events to become
disabled if the kernel was unable to access userland data.


git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9907 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-15 18:42:16 +00:00
Kinsey Moore
e591241187 dahdi: Add capability to generate events on buffer underruns and overruns
Add BUFFEVENTS and individual buffer event channel flags so that DAHDI can
notify userspace processes when it is dropping data.  This can be useful when
trouble shooting fax problems since DAHDI currently silently discards data
becasuse of scheduling latency.  With this change, Asterisk could log an event
as opposed to just leaving it up to the tone detectors to figure out there was
some unexpected phase shift.

Acked-by: Shaun Ruffell <sruffell@digium.com>
(original patch by Matt Fredrickson)


git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9905 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-15 16:16:19 +00:00
Shaun Ruffell
d0093c16cc wcte12xp: If we cannot read the mode selection pins fail the module load.
Alexandre reported that on a particular server he would get a server
crash when loading the wcte12xp driver after receiving a line about a
timeout when trying to read the mode selection jumpers.

If the driver times out when trying to read the mode selection bits
there is a serious problem and it should not try to continue on with
configuration / registration.

Reported-and-Tested-by: Alexandre Abreu <alexandre.abreu@redt.com.br>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9902 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-14 19:11:14 +00:00
Shaun Ruffell
1ea9309756 b4xxp: Only create the timing_master attributes in the context of probe
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@9892 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:26:11 +00:00
Shaun Ruffell
3ae1b03082 dahdi: Group dahdi timers into "rates" for improved CPU utilization.
Most of the timers added to the kernel will be configured to fire at the
same rate. This allows one "wake_up" from interrupt context to wake up
all the waiters.  On one test system, I saw about a ~10% improvement in
CPU utilization when 10,000 timers were opened.

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@9891 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:26:05 +00:00
Shaun Ruffell
1a6bbe43e7 wctdm24xxp, wctdm: Reduce memory used by fxo_modes array.
Saves ~2K bytes from the size of wctdm24xxp.ko module, which saves system
memory when the driver is loaded.

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@9890 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:26:00 +00:00
Shaun Ruffell
e7ea26ae8d wcte12xp: Unroll the TDM extraction/insertion from the sframe.
This change saves around 2.5 us from the interrupt handler.

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@9889 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:54 +00:00
Shaun Ruffell
40945a2a00 wcte12xp, wctdm24xxp: decriptor_list.count does not need to be atomic.
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-04 16:25:47 +00:00
Shaun Ruffell
7487ce229d wcte12xp, wctdm24xxp: Remove a PCI read from hardirq context.
No need for the CPU to wait there for that write to flush when all the
writes will be flushed when the interrupt is acknoledged later. Saves
nearly a 1 us from the interrupt handler on a 3Ghz Xeon test system.

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@9887 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:42 +00:00
Shaun Ruffell
5ffb28b1f0 wcte12xp: Use the in-hardirq versions of dahdi_receive/dahdi_transmit.
We are in hard-irq context already, so we do not need to disable all
local interrupts. On one 3.06GHz Xeon test machine, drops the average
time in the interrupt handler from 23.10 us to 21.87 us.

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@9886 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:33 +00:00
Shaun Ruffell
f38965153b wctdm24xxp, wcte12xp: Always call handle_transmit/receive in hardirq context.
Allows the board drivers to use the regular locks instead of the
irqsave/irqrestore variants.

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@9885 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:28 +00:00
Shaun Ruffell
f8af2b7a5c dahdi: Add in-hardirq versions of the dahdi_receive/transmit/ec_span.
Since cli/sti are expensive instructions, if the board drivers are
calling receive/transmit/ec_span from interrupt context all local
interrupts do not need to be disabled. The board drivers all still use
the normal dahdi_receive and dahdi_transmit. _dahdi_receive and
_dahdi_transmit are the "in-hardirq" versions of those functions.

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@9884 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:23 +00:00
Shaun Ruffell
6519a0e911 wcte12xp: Use the reglock to protect the framer command lists.
Reduces the number of locks that must be grabbed and released in interrupt
context.  On one 3.06Ghz Intel Xeon test machine, drops the average time in
the interrupt handler from 29.83 us to 23.10 us.

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@9883 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:16 +00:00
Shaun Ruffell
731388e275 wctdm24xxp, wcte12xp, wct4xxp, wcb4xxp, wctdm: Do not support suspend.
These drivers (all DAHDI drivers) should explicitly block suspend if they are
loaded.

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@9882 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:09 +00:00
Shaun Ruffell
c5396b1366 wct4xxp: Add shutdown handler for kexec.
Makes the driver a little more kexec friendly when sharing an interrupt
line with another device.

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@9881 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:25:03 +00:00
Shaun Ruffell
58c1168185 wctdm24xxp, wcte12xp: Add voicebus_quiesce function.
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-04 16:24:54 +00:00
Shaun Ruffell
6d3a7e6f71 dahdi: Do not enable interrupts before processing entire span.
Fixes regression introduced in r9603 where if a channel was "dacs" with
another interrupts would be reenabled prematurely.

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@9878 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:24:39 +00:00
Shaun Ruffell
50f51ee459 voicebus: Update the network debug device to use dma_pools.
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
2011-04-04 16:24:33 +00:00
Tzafrir Cohen
1c42df4cd1 core timer: don't hang when the clock goes back.
If the clock shifts back, don't hang in a loop of running
process_masterspan from the timer interrupt forever.

Fixes a regression of r9407.

(closes issue #19035)
Reported by: tzafrir

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

After talking with Tzafrir on IRC, I combined the check if your far ahead
with the check if you're behind and added a '\n' at the end of the
existing "detected time shift" message.  That is why this patch is
different than what is posted on issue #19035.

Acked-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@9876 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-04-04 16:24:26 +00:00
Alec Davis
c166c172dc wctdm24xxp: Remove SLIC_LF_OPPENDING setting on fxs->idletxhookstate from set_vmwi
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9868 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-03-19 06:09:02 +00:00
Shaun Ruffell
e27f89b0b6 wctdm24xxp: Fix regression with LEDS on TDM410.
r9720 disabled the LEDs on the front panel of the TDM410. This commit
restores the behavior and clarify which part of the TDM410 eframes
control the LED operation.

(closes issue #18939)

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9827 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-03-15 19:06:05 +00:00
Shaun Ruffell
c4f6f1f225 wcte12xp, wctdm24xxp: Remove unused support for booting VPMADT032 from SPI.
Since there never was a VPMADT032 module shipped with non-volatile
memory no need to check that bit contantly in interrupt context.  Also
remove the unused VPM150M_DTMFDETECT bit.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9781 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-28 14:19:25 +00:00
Shaun Ruffell
dc06b57f14 wctdm24xxp: Remove unused wctdm_vpm_check, wctdm_vpm_in, and wctdm_vpm_out.
These functions were accidentally left in. They should have been remove in
"wctdm24xxp: Remove code for unsupported modules." r9720

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9780 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-28 14:19:20 +00:00
Shaun Ruffell
e5bdfd56ea wcte12xp, wctdm24xxp: Minor fixes for big endian host architectures.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9779 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-28 14:19:17 +00:00
Shaun Ruffell
a0246fd0be wctc4xxp: Minor fixes for big endian host architectures.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9778 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-28 14:19:14 +00:00
Shaun Ruffell
d43e2d3ade dahdi: Do not rebuild dahdi-base.c when only updating the version.
This moves the version string into dahdi-version.c that is then linked into
dahdi-base.c and dahdi-sysfs.c.  This speeds builds on slow computers since
dahdi-base.c and dahdi-sysfs.c does not need to be rebuilt if only the version
string is changing.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Oron Peled <oron.peled@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9777 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-28 14:19:09 +00:00
Oron Peled
0f25d96af3 replace old proc interface by modern seq_file
Switch to using the newer seq_file interface for procfs. Fixes a
race when you read the "file" while its size increases (e.g. the span
enters an alarm state).

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

(closes issue #18760)
Patches:
      0001-DAHDI-linux-trunk-replace-old-proc-interface-by-mode.patch uploaded by tzafrir (license 46)

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9770 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-20 23:13:20 +00:00
Russ Meyerriecks
cb356737c3 wctdm24xxp,wcte12xp: Replace read/writechunk with eframe/sframe
Trival name change to increase readability in the transmitprep and
recieveprep functions. Now we clearly define if we are working with an
sframe or an eframe.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-By: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9768 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-18 20:32:22 +00:00
Shaun Ruffell
b0a9e6f31d wct4xxp: Do not lock interrupts while loading the VPM firmware.
Since the oct6100 API consumes less stack there is no longer a danger of
overflowing our stack during load.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9752 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-10 16:22:59 +00:00
Shaun Ruffell
a340db5e76 wct4xxp: Reduce stack usage in oct612x API.
Reduce the stack usage by replacing the mOCT6100_RETRIEVE_NLP_CONF_DWORD
and mOCT6100_SAVE_NLP_CONF_DWORD macros with functions. Some compilers
do a better job of optimizing the local variables declared in those
macros than others.

For example, with gcc 4.3.0, running

]# make stackcheck | grep Oct6100 | head -n 20 | sed -e 's/^0\S* //g' | uniq

Before:
Oct6100ApiWriteVqeNlpMemory [wct4xxp]:  1112
Oct6100ApiInvalidateChanPlayoutStructs [wct4xxp]:520
Oct6100ApiSetChannelLevelControl [wct4xxp]:     392
Oct6100ApiBridgeEventRemove [wct4xxp]:  344
Oct6100ApiDebugChannelOpen [wct4xxp]:   312
Oct6100ApiWriteVqeAfMemory [wct4xxp]:   296
Oct6100ApiSetChannelTailConfiguration [wct4xxp]:264
Oct6100ApiRandomMemoryWrite [wct4xxp]:  248
Oct6100ApiTransferToneEvents [wct4xxp]: 248
Oct6100ApiModifyChannelStructs [wct4xxp]:       232

After:
Oct6100ApiBridgeEventRemove [wct4xxp]:  344
Oct6100ApiDebugChannelOpen [wct4xxp]:   312
Oct6100ApiRandomMemoryWrite [wct4xxp]:  248
Oct6100ApiTransferToneEvents [wct4xxp]: 248
Oct6100ApiInvalidateChanPlayoutStructs [wct4xxp]:248
Oct6100ApiModifyChannelStructs [wct4xxp]:       232
Oct6100ApiBridgeRemoveParticipantFromChannel [wct4xxp]:216
Oct6100ApiWriteVqeNlpMemory [wct4xxp]:  200
Oct6100ApiInitChannels [wct4xxp]:               168
Oct6100ApiProgramNLP [wct4xxp]:         168

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9751 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-10 16:22:55 +00:00
Shaun Ruffell
c9e258b9b0 wct4xxp: Reduce the memory footprint of the hardware echocanceler.
This saves ~300K of kernel memory for each quad or dual span VPM.  Due
to the fact that this change disables caching of the NLP words (among
other things), the time to disable the echocans appears to have
increased by ~1ms.

Before this change:
=======================================================================
0) ! 356.498 us  |  vpm450m_setecmode(); <--- disable
0) ! 387.762 us  |  vpm450m_setecmode(); <--- enable
0) ! 429.839 us  |  vpm450m_setecmode(); <--- disable

]# echo 1 > /proc/sys/vm/drop_caches && free -k
total       used       free     shared    buffers     cached
Mem:       2005352     228368    1776984          0        132
5540
-/+ buffers/cache:     222696    1782656
Swap:       983036          0     983036

After this change:
=======================================================================
0) ! 1109.515 us |  vpm450m_setecmode(); <--- disable
0) ! 339.017 us  |  vpm450m_setecmode(); <--- enable
0) ! 1431.460 us |  vpm450m_setecmode(); <--- disable

]# echo 1 > /proc/sys/vm/drop_caches && free -k
total       used       free     shared    buffers     cached
Mem:       2005352     228080    1777272          0        112
5484
-/+ buffers/cache:     222484    1782868
Swap:       983036          0     983036

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9750 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-10 16:22:49 +00:00
Shaun Ruffell
e9558d499b wctdm24xxp: Remove the wctdm_regs structure from the stack in wctdm_ioctl.
Drops the size of the wctdm_ioctl stack from 524 to 204 bytes.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9748 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-09 18:57:53 +00:00
Shaun Ruffell
04f50821d4 wctdm24xxp: Remove unused portconfig variable.
The code is duplicated in the config_vpmadt032 function.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9747 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-09 18:57:48 +00:00
Shaun Ruffell
4389604ffd dahdi: Analog spans do not have to be marked RUNNING to become master.
Fixes a regression introduced in r9611. Analog spans would never become
the master since the SPANSTART ioctl is not typically called on them,
and therefore they were never marked RUNNING.  The result could be audio
problems.

I'm marking this as related to issue 13205 since it's generally all
related to how should the drivers select which span is the master.  I
also mark as related to issue 16165 because the problems experienced are
a result of the same fundamental issue.

(issue #13205)(issue #16165)

Reported-and-Tested-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9729 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-02 19:28:40 +00:00
Tzafrir Cohen
a5ace09e60 xpp: Missing lock release in xpp_dahdi_unregister
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9727 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-31 20:16:33 +00:00
Jaco Kroon
e7d9a67f72 dahdi: Experimentally remove dependency on the Big Kernel Lock.
With the release of Linux 2.6.37, the Big Kernel Lock is now a compile
time option.  This change adds a mutex around the one place in the code
that we already knew was dependent on the lock_kernel/unlock_kernel
calls for serialization and drops the other calls to
lock_kernel/unlock_kernel if CONFIG_BKL is not defined.

This is *mostly* the dahdi-no-bkl.patch with a few minor whitespace
changes, the global_dialparmslock made static, and a warning added to
let people know they are running an experimental configuration.

(issue #18604)
Reported by: jkroon
Patches:
      dahdi-no-bkl.patch uploaded by jkroon (license 714)

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9721 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-31 15:53:31 +00:00
Shaun Ruffell
29020a2521 wctdm24xxp: Remove code for unsupported modules.
The VPM100 and S100M modules are no longer supported. Analog cards supported
by the wctdm24xxp are still compatible with the S110 and VPMADT032 modules.
DAHDI-302

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9720 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-31 15:53:26 +00:00
Oron Peled
c176762902 xpd_pri: Explicit initialization of span.alarms
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9718 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:33:37 +00:00
Oron Peled
37d561780a xpd_pri: Reduce indentation
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9717 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:32:53 +00:00
Oron Peled
c814b79abe xpd_pri: reorder debug messages
Move priv->layer1_up debug message after priv->is_cas debug message.
Otherwise, we get extra meaningless debug message.

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9716 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:32:16 +00:00
Oron Peled
63ccf9b7da xpp: remove unused XPD_STATE() "protocol method"
Folded XPD_STATE() "protocol method" into the card_state() method.
It was only called from these (otherwise empty) methods.

Also it is not a "protocol method" for a very very very long time.

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9715 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:31:35 +00:00
Oron Peled
38f916050a xpp: Remove few extra leading spaces
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9713 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:16:35 +00:00
Oron Peled
41d71c3c99 xpp: Use our KZALLOC/KZFREE
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9712 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:14:49 +00:00
Oron Peled
e208a25a7c xpp: use phonedev_cleanup() instead of inline code
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9711 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:13:39 +00:00