Commit Graph

589 Commits

Author SHA1 Message Date
Shaun Ruffell
25ce85e770 dahdi: Filter 'HWEC' from DAHDI_GETVERSION results if hwec is really not present.
Internally in DAHDI there is always a hardware echocan factory registered and
available. Having this factory always registered allows for DAHDI to work in a
backward compatible fashion. Namely, by default DAHDI will always use a hardware
echocan if one is available unless 'hwec_overrides_swec' dahdi module parameter
is set to 0 on load. However, if there were no real hardware echocans available
in the system dahdi would still report "Echo Canceller(s): HWEC" in the
dahdi_cfg -v output since the hwec factory is always there.

After this change dahdi_cfg will no longer report HWEC as one of the available
echocans if there isn't a physical span present that actually has a hardware
echocan.

Internal-Issue-ID: DAHLIN-300
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10727 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-10-04 20:24:24 +00:00
Shaun Ruffell
84e70cdac5 wctdm24xxp: Only two polarity reversals are needed to validate RING on FXO ports.
This fixes a regression introduced in commit r10186 "wctdm24xxp: Use time
interval for debouncing FXO ring detect." [1] which was first released in
DAHDI-Linux 2.6.0. This only affects users with analog trunks whose providers do
not present 4 polarity reversals on the ring signals. The reporter of this issue
is based in South Africa.

[1] http://svnview.digium.com/svn/dahdi?view=revision&revision=10168

In prior versions, the ring detector did not check for polarity reversals, only
the presence of ringing voltage unless fwringdetect or neonmwi_monitor mode was
set, and even when one of those modes were set, the driver only needed two
reversals to validate a ring. This commit allows the driver to always stay in
fwringdetect mode but restores the requirement for only two reversals.

Also included in this commit is a change to ensure that ringing is not reported
when debouncing lost battery which can happen when voltage is swinging through
0.

Reported-and-Tested-by: Jaco Kroon <jaco@uls.co.za>
Internal-Issue-ID: DAHLIN-298
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10719 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-09-21 18:16:35 +00:00
Russ Meyerriecks
6c02c3c156 dahdi-base: Minor maint mode error
The previous maint state was saved regardless if the base driver returned an
error or not. This caused strange behavior in dahdi tools. Moved the maint
state save to after the switch case to reflect this.

https://issues.asterisk.org/jira/browse/DAHDI-984

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10718 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-09-21 18:16:30 +00:00
Shaun Ruffell
7e614f4d29 wcte12xp: Fix stack corruption when checking T1 RBS states.
This fixes an (embarrassing) error in t1_check_sigbits in the previous commit
where I was writing pass the end of an array on the stack.

Now instead of using an array on the stack, of which all elements were not used,
the pending commands are now stored on a list. I also removed the automatic free
of commands from __t1_getresults and now the function that allocated the command
now frees them.

I believe this will be less error-prone going forward.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10700 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-07-11 16:13:22 +00:00
Shaun Ruffell
24ed250673 wcte12xp: Fix pulse digit detection when set for FXO signalling modes.
The frequency that the RBS registers were polled was too slow to catch the pulse
dialing digits. The result was that often times dahdi would generate WINK events
instead of PULSEDIGIT events.

This speeds up the rate at which the registers are checked from 100ms to 33ms
and also makes the process of checking the registers quicker by queing up all
the reads at once.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10699 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-06-26 17:10:54 +00:00
Shaun Ruffell
3d89ef975c wcte12xp: Allow default_linemode to be set to j1.
To enable J1 mode previously one would configure the card in T1 mode and then
set the j1mode module parameter. Now "modprobe wcte12xp default_linemode=j1"
will work like the other linemodes globally for all cards manged by this driver.
J1 can also be set on a card-by-card basis in sysfs.

Also move pr_fmt to top of file so pr_xxx macros print the module name as
intended.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10696 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-06-22 17:59:37 +00:00
Shaun Ruffell
eecf45cf5f wcte12xp: Destroy the cache if the linemode is not recognized.
Fixes the following errors when running:
  # modprobe wcte12xp default_linemode=blah; modprobe wcte12xp default_linemode=blah

'blah' is an unknown span type.kmem_cache_create: duplicate cache wcte12xp

Call Trace:
 [<ffffffff800394cf>] kmem_cache_create+0x572/0x5ac
 [<ffffffff800a926e>] __link_module+0x0/0x18
 [<ffffffff80064624>] __down_read+0x12/0x92
 [<ffffffff8002224d>] __up_read+0x19/0x7f
 [<ffffffff8818b01f>] :wcte12xp:te12xp_init+0x1f/0xde
 [<ffffffff800a9e37>] sys_init_module+0xbd/0x206
 [<ffffffff8005d28d>] tracesys+0xd5/0xe0

Reported-by: James Brown <jbrown@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10695 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-06-22 17:59:34 +00:00
Oron Peled
76ce8d5951 xpp: usermode_helper() bugfix for kernels >= 3.3.0
* UMH_WAIT_PROC semantics (and value) was changed from enum to
  a bitmask (via #define)
* This constant was missing from kernels older than 2.6.23

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10692 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-06-21 17:34:09 +00:00
Shaun Ruffell
e903273e3c dahdi_ioctl_spanstat() backward compat hack
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@10686 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-05-23 12:39:07 +00:00
Shaun Ruffell
1058502286 sysfs: refactor lineconfig string representation
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@10685 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-05-23 12:36:42 +00:00
Shaun Ruffell
bb2c15c103 sysfs: add a linecompat span attribute
This way, dahdi_genconf may gather needed information without issuing
ioctl()'s

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@10684 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-05-23 12:35:56 +00:00
Shaun Ruffell
579132bb89 convert span->spantype to enumerated type
* This is a minimal convertion -- everything compiles and looks OK.
* We print a warning for spans registering without a spantype.
* Low-level drivers may later want (but not required)
  to fold their internal representations to this canonical
  representation -- it will save code and make it more readable.

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@10683 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-05-23 12:20:23 +00:00
Doug Bailey
b7081c2b45 Assign NULL values to pointers to insure that future kfree calls do not cause errors.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10678 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-27 19:36:55 +00:00
Shaun Ruffell
e8e460af8a wcb4xxp: Fix typo in last commit that broke compilation.
I failed to compile test r10661 and introduced a typo when fixing a
checkpatch.pl warning.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10662 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-18 00:17:15 +00:00
Matthew Fredrickson
d6c9c4c9da wcb4xxp: Support for when network side deactivates layer1.
This is a port of the functionality in the wctdm24xxp driver to support power
savings modes. Specifically, if the the network side of a BRI spans deactivates
the span to save power, the B410P  previously automatically activated it again.
Now, if persistentlayer1=0 module parameter is set, the span will be allowed to
stay deactivated until layer two has a message to send on the dchannel.

This patch does not change any of the default behavior of the B410P driver and
the defaults for the persistentlayer1 option is inconsistent with that of the
B400M modules in the wctdm24xxp driver.

Internal-Issue-ID: ABE-2845
From: Matthew Fredrickson <creslin@digium.com>

[ Minor formatting, exposed the persistentlayer1 as module parameter, changed
defaults for teignorered, alarmdebounce, and persistentlayer1 to match current
defaults in wcb4xxp driver ]

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10661 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-18 00:12:06 +00:00
Shaun Ruffell
5cbf189ec4 xpp: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined.
Looks like a hold over from when dahdi_span_ops was first implemented in r8985
"dahdi: Move the callbacks in dahdi_span into its own structure" [1].

[1] http://svnview.digium.com/svn/dahdi?view=revision&revision=8985
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@10658 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11 20:09:44 +00:00
Mike Sinkovsky
d70f59d6e0 dahdi: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined.
From: Mike Sinkovsky <msink@trikom.ru>

Internal-Issue-ID: DAHLIN-288
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10655 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11 17:39:31 +00:00
Tzafrir Cohen
199cd70d2c FPGA_1161.201.hex rev 10545: fix reset of XR1000
Previous commit (r10649) included an incorrect version. Including full message
from that commit for the description.

rev. 10502 of the FPGA firmware for the new E-Main rev. 4 fixes a potential
issue when used on Xorcom XR1000 systems: an issue with the power supply may
cause the unit to reset.

Note that there is no issue with previous models, with a normal setup of an
Astribank, or other XRx000 systems.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10652 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11 09:06:29 +00:00
Tzafrir Cohen
432e83165c FPGA_1161.201.hex rev 10532: fix reset of XR1000
rev. 10502 of the FPGA firmware for the new E-Main rev. 4 fixes a potential
issue when used on Xorcom XR1000 systems: an issue with the power supply may
cause the unit to reset.

Note that there is no issue with previous models, with a normal setup of an
Astribank, or other XRx000 systems.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10649 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-10 21:36:43 +00:00
Shaun Ruffell
a1c4dfb99c wcte12xp, wctdm24xxp, wct4xxp: Print warning about potential GPL violation w/HOTPLUG_FIRMWARE=no.
Print a warning message that it may be a GPL violation to redistribute these
binaries if the firmware for the VPMOCT032/64/128/256 is compiled in.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10646 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-05 20:32:37 +00:00
Shaun Ruffell
b0801b23e8 wcb4xxp: Remove asm/system.h include.
Not needed anymore and will break compilation on Kernel versions >= 3.4 since
commit 0195c00244dc2e [1]

[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=0195c00244dc2e

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10641 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-05 16:15:27 +00:00
Shaun Ruffell
3d52bdd52f dahdi_dummy: Include timer.h instead of time.h
It appears that some kernel configurations do not include timer.h in any of
the include files that are included by dahdi_dummy. The timer_structs are
defined in timer.h and not time.h, so this change is correct even though I
never could find a configuation myself that actually failed to compile.

This has negligible impact since dahdi_dummy is not compiled by default.

Internal-Issue-ID: DAHLIN-185
Reported-by: Steve Murphy
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10640 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-05 16:15:22 +00:00
Shaun Ruffell
f800ac611f dahdi: Fix compilation when CONFIG_DAHDI_NET is defined.
'irq' field was removed from dahdi_span in r10276 "dahdi: Remove
dahdi_span.irq and move dahdi_span.irqmisses into dahdi_device." [1]
which was first released in dahdi-linux 2.6.0.

[1] http://svnview.digium.com/svn/dahdi?view=revision&revision=10276

Reported-by: Pavel Selivanov
Internal-Issue-ID: DAHLIN-278
Patches: hdlc.patch by Pavel Selivanov (license #5420)
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10634 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 21:54:34 +00:00
Shaun Ruffell
8b3870e6a7 dahdi: Fix compilation when CONFIG_DAHDI_ECHOCAN_PROCESS_TX is defined.
'ec_state' was renamed to 'dahdi_echocan_state' in r6529 [1] but support for
CONFIG_DAHDI_ECHOCAN_PROCESS_TX was first committed in r9442 [2]. So it
appears that I never compiled tested this exact commit when it went in for the
2.5.0 release.

[1] http://svnview.digium.com/svn/dahdi?view=revision&revision=6529
[2] http://svnview.digium.com/svn/dahdi?view=revision&revision=9442

Reported-by: Pavel Selivanov
Internal-Issue-ID: DAHLIN-279
Patches: ec.patch uploaded by Pavel Selivanov (License #5420)
[ edited the patch slightly for minor formatting ]
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10633 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 21:54:29 +00:00
Shaun Ruffell
347fe2b225 dahdi_dynamic_loc: Change and check the dyn->pvt pointer under lock.
Fixes a crash on unload if the sync_tick callback was running at the same time
the dynamic local span was destroyed. It was possible for
dahdi_dynamic_local_transmit to dereference a pointer that may have already
been freed.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10627 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 19:44:45 +00:00
Shaun Ruffell
034818dd81 dahdi_dynamic_eth: Make ztdeth_exit() symetrical with ztdeth_init() and fix race on unload.
Minor change to follow generally recommended practice. Prevents new packets
from being queued up for devices when they are about to be cleaned up. Also
clean up any skbs that may still be on the queue after unloading.

Also closes anoter potential kernel oops on module unload. It was possible to
delete the private structure while the master span process was running. The
result was an attempt to page memory from interrupt context.

Make sure that the pvt function is set and cleared under the zlock. Also do
not assume that the pvt pointer is valid in ztdeth_transmit.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10626 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 19:44:41 +00:00
Shaun Ruffell
9c0bb57efb dahdi_dynamic: Close race on unload if red alarm timer was running when unloaded.
I saw a kernel oops that was the result of the timer running after the
dahdi_dynamic module was unloaded. Now we wait for the timer to complete, and
then delete it again in case it reactivated itself.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10625 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 19:44:37 +00:00
Shaun Ruffell
d46ad9bca1 dahdi_dynamic: Remove calls to __module_get().
The board drivers are the ones calling the unregister function, and
therefore we do not need to worry about them unloading while calling the
destroy callback.

When destroying spans with the ioctl, replace __module_get() with
try_module_get. This avoids hitting a BUG in module_get on kernel versions <
2.6.29.

ALSO move the call to try_module_get out of the dahdi_dynamic_release function
and into destroy. This way if the destroy callback isn't called because the
dynamic driver is unloading the dynamic device can be left on the list to be
cleaned up by the dahdi_dynamic_unregister_driver function().

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10624 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 19:44:33 +00:00
Shaun Ruffell
4ee22f19d1 dahdi_dynamic: Do not call into dahdi_dynamic without holding reference.
Instead of registering a function pointer, register a dahdi_dynamic_ops
structure that contains the owner as well as the ioctl callback. This way
dahdi.ko can bump up the reference count on dahdi_dynamic.ko before calling
the ioctl callback.

Also, use the registration mutex to guard against the module being unloaded
between the time the structure pointer was checked, and the module reference
is taken.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10623 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-03 19:44:27 +00:00
Shaun Ruffell
7e9491bce1 wctdm24xxp, wcte12xp: Allow VPMOCT032 firmware to be compiled into driver.
Enables the driver to update firmware on systems that do not have the firmware
loader configured / enabled (Linux config option CONFIG_FW_LOADER). Compiling
the firmware into the driver increase the memory footprint by around ~440K.

Internal-Issue-ID: DAHDI-963
Reported-and-Tested-by: Guenther Kelleter
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10618 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-02 13:58:11 +00:00
Shaun Ruffell
eab20e05cb Remove Makefiles that are only needed on kernels < 2.6.9
Newer versions of kernel build system do not require these Makefiles and
support for kernels older than 2.6.9 are no longer supported by DAHDI.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10617 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-02 13:58:03 +00:00
Shaun Ruffell
0cd7f34201 wctdm24xxp: Remove forward declaration of inline for GCC 3.4.4
GCC 3.4.4 does not allow forward declaration of inline functions.

Internal-Issue-ID: DAHLIN-286
Reported-by: Guenther Kelleter
Patches: wctdm24xxp-inline.patch uploaded by Guenther Kelleter (License #6372)
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10613 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-29 15:25:23 +00:00
Shaun Ruffell
ed60a36854 wct4xxp: Trivial formatting changes around request_irq.
Quiet some checkpatch warnings introduced by the last patch. I kept this
separate since it may have obscured the real change made in the previous
commit if combined.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10590 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-22 18:31:22 +00:00
Shaun Ruffell
2b60d3b8e0 wct4xxp: Disable all interrupts explicitly in interrupt handler.
The driver makes the assumption that interrupts are disabled but this cannot
be guaranteed. We'll explicity disable interrupts on the local processor while
the interrupt handler is running.

This eliminates the "IRQF_DISABLED is not guaranteed on shared IRQs" warning
when loading the driver.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10589 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-22 18:31:17 +00:00
Shaun Ruffell
b69830b3d3 dahdi_dynamic_eth: Fix compilation on kernels < 2.6.22.
Resolves the follwing build error:
  drivers/dahdi/dahdi_dynamic_eth.c: In function ‘ztdeth_exit’:
  drivers/dahdi/dahdi_dynamic_eth.c:448: error: implicit declaration of function ‘cancel_work_sync’

RHEL kernel versions 2.6.18-238 (5.6) and greater had cancel_work_sync()
backported which is what I did my original smoke test on.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10588 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-22 18:31:13 +00:00
Shaun Ruffell
e54f0189a7 dahdi_dynamic_eth: Prevent crash is packet arrives before span is fully configured.
It was possible after a dynamic ethernet span was created for a packet to come
in before the dahdi_span was fully initialized. The result would be a NULL
pointer dereference. Now just discard any packets that might come in during
this time window.

Internal-Issue-ID: DAHLIN-280
Reported-by: Pavel Selivanov
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10587 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-22 18:31:08 +00:00
Oron Peled
59caf11dbe xpp: FXS: added a 'lower_ringing_noise' parameter
* Adds a new parameter, 'lower_ringing_noise', to module xpd_fxs.

* Makes the "power-down" behaviour that was added
  in upstream svn r10478, switchable in runtime.

* By default (false), makes the vbat_h behave like it did
  before the power-down change.
  - I.e: vbat_h is held throughout the ringing period (during
    both ring-up/ring-down)
  - So this patch revert part of r10478

* When switched to true, activate the "power-down" behaviour.
  - I.e: vbat_h follows the ring-up/ring-down.
  - This behaviour lowers the noise caused by group ringing of
    FXS channels in the same unit, but causes problems with CallerID.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10574 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 20:18:26 +00:00
Oron Peled
8aad29e4de xpp: FXS: atomic vbat_h power handling
* In do_chan_power() make vbat_h changes atomic.
* As a result we can ignore duplicate requests.
  This will allow cleaner logic in the next commit.
* Added proper debug messages.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10573 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 20:17:14 +00:00
Shaun Ruffell
3e1c317323 dahdi_dynamic: Since dynamic devices are 'parentless' we must name them.
This in conjunction with r10449 "A parent-less device should not crash dahdi",
this allows dahdi_dynamic spans to work post the dahdi_devices changes in
2.6.0.

The full address of the device is not used since kernels prior to 2.6.31 limit
the length of a devicename to 20 characters.  The full address of the device
can be pulled out of the "hardware_id" and "type" fields of the span.

This patch is just to get things working again. dahdi_dynamic devices *may*
still have issues if the auto_assign_spans module parameter is 0.

Internal-Issue-ID: DAHLIN-280
Reported-by: Pavel Selivanov
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10563 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 18:56:21 +00:00
Shaun Ruffell
4769ee67cd dahdi_dynamic_eth: Move tx packet flushing to process context.
The masterspan can be, and often is, called with interrupts disabled but
dev_queue_xmit() needs to be called with interrupts enabled. This potentially
fixes a deadlock.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10562 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 18:56:16 +00:00
Shaun Ruffell
bf4919e46b Update Digium copyright on files changed since beginning of the year.
In addition to updating the year, this also adds some boilerplate to
dahdi-sysfs.c and dahdi-sysfs-chan.c that wasn't there previously.

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@10560 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 18:56:05 +00:00
Shaun Ruffell
aa8bd2f546 wct4xxp: __t4_frame_in and __t4_framer_out slowdowns.
This is a partial revert of r10234 "wct4xxp: __t4_framer_in and
__t4_framer_out speedups."

There were some platform + firmware version combinations that would fail to
properly configure the framer with the aforementioned speedups. The originally
reported sympton was that interrupts would fail to start and while
troubleshooting I also saw cases where one of the spans would stay in alarm
after starting. By adding in additional reads to the version register, the
overall process of writing / reading from the framer control registers is
slowed down which increases reliability.

This change does *not* affect the main path of TDM data which is DMAed
directly into buffers in host memory and are not read / written to / from
framer registers directly.

Reported-and-Tested-by: Vahan Yerkanian <vahan@arminco.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10559 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 16:34:06 +00:00
Shaun Ruffell
0f61ab172d wct4xxp: Add compile-time option to disable ASPM for PCIe devices.
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@10558 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 16:34:02 +00:00
Shaun Ruffell
2c97dd21bd wcte12xp, wctdm24xxp: Add compile-time option to disable ASPM for PCIe devices.
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
2012-03-21 16:33:57 +00:00
Shaun Ruffell
da11ba2f0f dahdi: Add dahdi_pci_disable_link_state for kernel < 2.6.25.
Will allow the ASPM (Active State Power Management) state to be disabled on
PCIe devices before kernel version 2.6.25.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10556 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 16:33:51 +00:00
Tzafrir Cohen
b278ce23b5 xpp: firmwares: useless 0x1A at EOF
Remove a mostly harmless 0x1A (^Z) at the end of the file. If you
add a NL after it, it breaks the firmware loading.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10550 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-20 10:53:39 +00:00
Tzafrir Cohen
857801bd37 xpp: also install the new .201 fixrmware files
The Makefile changes needed to install the two new files.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10536 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18 15:35:11 +00:00
Tzafrir Cohen
f26bd63c6c xpp: firmwares to support E-Main 4
USB firmware (USB_FW.201.hex 10402) and FPGA firmware
(FPGA_1161.201.hex 10480) with support of the new E-Main 4 Astribank
mainboard.

(This was accidentally labeled as 'E-Main 3' in some previous commit
messages)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10535 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18 14:49:58 +00:00
Tzafrir Cohen
e2bf7013ef xpp: USB_FW rev 10401: minor 6FXS/2FXO caps issue
Fixes an issues with the 6FXS/2FXO module: if an extra FXS or FXO module
is added to a system with such a module, an excessive number of port
licenses was accidentally required (as if the 6FXS/2FXO module required
8FXS/8FXO licenses).

Internal-Issue-ID: #1371
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10534 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18 14:46:57 +00:00
Shaun Ruffell
92e2020fd2 dahdi_dummy: Fix compilation since dahdi-linux 2.6.0.
Even though dahdi_dummy is no longer built by default, the adoption of
dahdi_devices in 2.6 broke the ability to compile. This was not intended as
there are some packagers who still patch the Kbuild file to enable
dahdi_dummy.

Internal-Issue-ID: DAHLIN-274
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10486 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 16:01:22 +00:00