Commit Graph

28 Commits

Author SHA1 Message Date
Shaun Ruffell
c050ca9065 dahdi: Allow spans to advertise if they can provide any timing.
Some spans, specifically dynamic local spans, should never be the timing
master since they are dependent on some other timing source driving
them.

The bit in 'struct dahdi_span' is named cannot provide timing so that by
default the other drivers will set it to 0.

This is loosely related to issue #13205 but doesn't address any of the
other elements of that issue about how to allow the user to configure
what the master span order of succession is.

(issue #13205)
Reported by: biohumanoid

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9581 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:26:08 +00:00
Shaun Ruffell
593787e3b3 dahdi: If mutexes are not available use semaphores instead.
Mutexes were added in 2.6.16.  This will allow future changes to use the
mutex API without breaking on pre 2.6.16 kernels.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9579 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:26:00 +00:00
Shaun Ruffell
e0d94d5ca4 dahdi_dynamic: Pass the dahdi_dynamic to create/destroy functions.
This allows the pvt member to be set under lock without holding the lock
through the call to create destroy.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9578 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:25:56 +00:00
Shaun Ruffell
cee7f745e5 dahdi_dynamic: constify the address parameter to create.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9574 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:25:36 +00:00
Shaun Ruffell
8212485969 dahdi_dynamic: dynamic drivers should not reference count themselves.
Move the try_module_get/module_put calls from the various dynamic
drivers into the "core" dahdi_dynamic.c file itself.  This way, a
reference count can always be held while calling through the function
pointers.  This is enabled by adding an .owner field to 'struct
dahdi_dynamic_driver'.

Dynamic spans are also unique in dahdi in that they require a "dahdi_cfg
-s" to stop them and release the references on the modules.  This is
counterintuitive. This change makes sure they are reference counted just
like other spans and on driver unload, if there aren't any open handles
from userspace, they will take care of unwinding themselves.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9573 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:25:32 +00:00
Shaun Ruffell
1aacc92326 dahdi_dynamic: "dahdi_dynamic_[un]register()" -> "dahdi_dynamic_[un]register_driver()"
Clarify that we're registering / unregistering the driver.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9572 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:25:27 +00:00
Shaun Ruffell
7251a7e35a dahdi_dynamic_[loc|eth|ethmf]: Remove unused return value from transmit callback.
The return value from the transmit callback function was not used
anywhere, and is now removed.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9570 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:25:18 +00:00
Shaun Ruffell
c7ae773800 dahdi_dynamic: Use const pointers for dahdi_dynamic_driver strings.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9569 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:25:13 +00:00
Tzafrir Cohen
5759e5a6a6 constants for ctl, transcode, timer, channel, pseudo
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9552 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 10:49:22 +00:00
Shaun Ruffell
2765186d03 dahdi: Use a single wait_queue_t for dahdi channels.
Since we've now switched to wait_event_interruptible calls, we have a
condition that we can check when we're awoken.  This allows us to
combine the separate wait queues into a single queue.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerreicks <rmeyerreicks@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9548 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-21 16:09:22 +00:00
Kinsey Moore
7a7d4000a0 dahdi-base, dahdi_echocan_*, wcb4xxp, wct4xxp, wctdm24xxp, wcte12xp, kernel: Allow name of EC factory to vary based on channel
Changed the echocan factory name to a function (get_name) called to get the
name.  This allows a factory to return a different name when being called in
reference to a channel such as in the case of hardware echo cancellers.  To
further accommodate this change for HWEC, a new echocan_name function was
added to the span ops struct and is used in hwec_factory in dahdi-base for
all cards that support hardware echo cancellation.

Signed-off-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9524 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-09 20:19:26 +00:00
Kinsey Moore
fd01eef199 dahdi-base, kernel, dahdi_echocan_*, wcb4xxp, wct4xxp, wctdm24xxp, wcte12xp: Remove name field from echocan ops
This field was redundant and was only used in places where the factory's name could be used.

Signed-off-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9523 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-09 20:19:21 +00:00
Russ Meyerriecks
5ee55a6147 dahdi: Clean up an unused waitqueue
The dahdi_span->maintq wait queue was very old and not being used so it
has been removed.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-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@9514 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-08 22:11:46 +00:00
Shaun Ruffell
51bff0d802 wcte12xp: Use interruptible waits to decrease impact on load average.
The wcte12xp does all the checking for alarm in a user space workqueue.
Most of this time is spent sleeping waiting for reads from the framer to
complete.  Tasks in uninterruptible sleeps are added to running tasks
for the purposes of calculating load average. This change makes the
sleeps interruptible so as to not affect the load average as much.

For example, the following command will load and configure the driver and
then print the load average every 10 seconds.

]# modprobe wcte12xp && dahdi_cfg && ((x=12)); while [[ $x -gt 0 ]]; do cat
/proc/loadavg; sleep 10; let x=$x-1; done

With this change:
0.29 0.10 0.02 1/101 29945
0.24 0.10 0.02 1/101 29967
0.20 0.09 0.02 1/101 30019
0.17 0.09 0.02 1/101 30041
0.15 0.09 0.02 1/101 30062
0.12 0.08 0.02 1/101 30085
0.10 0.08 0.02 1/101 30107
0.09 0.08 0.02 1/101 30129
0.07 0.08 0.02 1/101 30151
0.14 0.09 0.02 1/101 30173
0.12 0.09 0.02 1/101 30195
0.10 0.08 0.02 1/101 30217
(and I've seen it get down to 0.0)

Before this change:
0.57 0.22 0.07 1/101 31920
0.48 0.21 0.07 1/101 31942
0.48 0.22 0.07 1/101 31964
0.48 0.23 0.08 1/101 31986
0.41 0.22 0.07 1/101 32008
0.42 0.23 0.08 1/101 32030
0.43 0.24 0.08 1/101 32054
0.45 0.25 0.09 1/101 32076
0.45 0.25 0.09 1/101 32098
0.46 0.26 0.10 1/101 32120
0.47 0.27 0.10 1/101 32172
0.39 0.26 0.10 1/101 32194

(closes issue #18142)
Reported by: foxfire
Tested by: foxfire

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9512 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-08 01:56:56 +00:00
Shaun Ruffell
75c33ce64e dahdi: A little cleanup in the dahdi_ioctl_iomux function.
The primary change is to make clear that the wait result is not ever to
be returned by the function.  There are also edits to remove some
comments that were expressed clearly in the source already and ensure
that the iomux member of 'struct dahdi_chan' is only accessed under the
chan->lock.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Sean Bright <sean.bright@gmail.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9497 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-11-25 00:07:10 +00:00
Russ Meyerriecks
712704c237 dahdi: Moved the channel mirroring interface behind a build flag
It can now be enabled by un-commenting the CONFIG_DAHDI_MIRROR define in
include/dahdi/dahdi_config.h
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@9492 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-11-19 17:34:31 +00:00
Russ Meyerriecks
9090c6fcd2 dahdi: adding ss7 pcap support to dahdi.
Adding the patch from the issue with various fixups to fit style and
checkpatch

(issue #16831)
Reported by: tsearle
Patches:
      driver_v2.patch uploaded by tsearle (license 373)
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@9491 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-11-19 17:34:25 +00:00
Shaun Ruffell
3de1002cb5 dahdi: Constify the dahdi_txlevelnames and return of dahdi_lboname().
Also moves the dahdi_txlevelnames array into the dahdi_lboname function,
which is the only place it it used.

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@9468 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-11-04 16:40:49 +00:00
Shaun Ruffell
37097411ea Remove mutex emulation
Using semaphores as mutexes was removed from the kernel in 4882720b267b.
Just use straight semaphores now.  'DECLARE_MUTEX()' -> 'DEFINE_SEMAPHORE()'
and 'init_MUTEX()' -> 'sema_init()'.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9464 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-11-04 16:40:29 +00:00
Shaun Ruffell
aa5c973611 dahdi: Atomically set/test if channel has associated network device.
Push all tests for the DAHDI_FLAGBIT_NETDEV flag behind a
'dahdi_have_netdev' function so if CONFIG_DAHDI_NET is not defined the
compiler can just remove all the flag tests.  Also, makes sure that the
bit is checked / set atomically.

(closes issue #9379)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9444 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-10-20 12:23:16 +00:00
Shaun Ruffell
2ba1b4c201 dahdi: Add compile time DAHDI_ECHOCAN_PROCESS_TX option.
Add optional interface to allow software echo cans to process the
transmitted samples.  Can be used for things like DC removal.

I used the following patches uploaded by biohumanoid but changed the
name of 'echocan_hpf_tx' to 'echoan_process_tx and put the changes
behind a compile time option.

(issue #13562)
Reported by: biohumanoid
Patches:
      kernel.h.patch uploaded by biohumanoid (license 459)
      dahdi-base.c.#2.patch uploaded by biohumanoid (license 459)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9442 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-10-20 12:23:06 +00:00
Kinsey Moore
408787c77b dahdi: Anonymous member in dahdi_echocan_events union.
Make explicit what part of the union is being accessed.

(closes issue #15908)
Reported by: ys
Patches:
      dahdi-dahdi_echocan_events.diff uploaded by ys (license 281)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9421 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-29 22:00:22 +00:00
Shaun Ruffell
283235686d Move test for DEFINE_SPINLOCK into include/dahdi/kernel.h
The check for DEFINE_SPINLOCK was spread throughout the source tree. If
not defined we can just define it in inlucde/dahdi/kernel.h.  Now
include/dahdi/kernel.h is the only place that references
SPIN_LOCK_UNLOCKED (which breaks lockdep checking if DEFINE_SPINLOCK is
otherwise defined in the kernel).

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Review: https://reviewboard.asterisk.org/r/940/

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9411 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-24 22:44:53 +00:00
Shaun Ruffell
731b5868d4 dahdi: Allow core DAHDI software timing to work when DAHDI_CHUNKSIZE > 8.
When no hardware spans are configured DAHDI will use a kernel timer in order
provide timing for conferences. This is what dahdi_dummy historically was used
for. When kernel timers are used to provide timing DAHDI can both potentially
slow the rate at which time timer runs and also needs to account for how many
milliseconds of audio are processed for each 'tick' of process_masterspan.

The result is that if you are only using DAHDI for app_meetme, you can change
DAHDI_CHUNKSIZE to 40 (5ms) or 80 (10ms) bytes to reduce overhead since user
space is dealing with chunks of 20ms by default anyway.

NOTE: If you set this, you may still need to comment out the board drivers in
drivers/dahdi/Kbuild since they all do not support operating with a
DAHDI_CHUNKSIZE != 8 currently.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Review: https://reviewboard.asterisk.org/r/940/

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9407 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-24 22:44:37 +00:00
Shaun Ruffell
851203c182 dahdi: Remove redundant 'gainalloc' member from struct dahdi_chan.
I want to add some new members to dahdi_chan, but I don't want to
increase the overall size any more than necessary.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9385 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:34:40 +00:00
Shaun Ruffell
4bdc2afebf dahdi: Define psuedo channels as being without a span.
Therefore we can use the fact that the span pointer on the channel is
NULL to identify them.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9382 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:34:27 +00:00
Shaun Ruffell
ee7057f87a dahdi: Embed the proc entries in struct dahdi_span.
Part of preparations for replacing the array of spans with a list of
spans.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9354 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:35 +00:00
Shaun Ruffell
bf3fe05dfb wct4xxp: Moving the transmit short detection behind debug module param.
This needs some more testing before it's on by default.  If the card is
otherwise functioning, these messages may be confusing to the user.  If
the card is not functioning, the driver can be reloaded with debug to
check for this condition.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9205 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-27 21:59:27 +00:00