5 years agoKbuild: Fix OSLEC build error v2.6.3-rc1
Russ Meyerriecks [Wed, 13 Mar 2013 21:26:42 +0000 (16:26 -0500)]
Kbuild: Fix OSLEC build error

Fixes up the kbuild to work with compiling OSLEC from the kernel source. See
HOWTO here: http://forums.digium.com/viewtopic.php?t=67164

Internal-Issue-ID: DAHLIN-317
Reported-By: Vladimir Mikhelson
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
(cherry picked from commit f09daed735f1be091fe9f177f675d0c87ad65900)

5 years agobuild_tools/make_version: Only strip 'v' if followed by a digit.
Shaun Ruffell [Fri, 8 Mar 2013 17:28:11 +0000 (11:28 -0600)]
build_tools/make_version: Only strip 'v' if followed by a digit.

Do not want to accidentally change the tag "very_cool" to "ery_cool".

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 7714d5d94e3cb6d3ff5e9eceaee5b131a43b0ce8)

5 years agobuild_tools/make_version: Strip off the leading 'v' in the version string. v2.6.2
Shaun Ruffell [Fri, 8 Mar 2013 17:28:11 +0000 (11:28 -0600)]
build_tools/make_version: Strip off the leading 'v' in the version string.

Quote: "It's a change. People hate change"

Make the version string say something like 2.6.2 instead of v2.6.2.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 9b0d19c05449071c40827efbb0b0a5b302da435f)

5 years agobuild_tools/make_version: If making from a tag show only the tag in the version.
Shaun Ruffell [Fri, 25 Jan 2013 18:54:18 +0000 (12:54 -0600)]
build_tools/make_version: If making from a tag show only the tag in the version.

Also, if there is no other version information use the directory name. Downloads
from gitweb will include the sha information in the build and otherwise a user
could locate the source directory via the embedded version information. I
believe this is better than an empty string.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 37371f19e97e5af645082fcafa42d9e18ef574e5)

5 years agoRedefine the removed __dev* for now
Tzafrir Cohen [Mon, 28 Jan 2013 13:57:34 +0000 (15:57 +0200)]
Redefine the removed __dev* for now

The __dev* directives and functions were removed in 3.8, as they
are no-ops. We still have use of them for older versions, thus
we should define them (as noops) if they don't exist.

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

5 years agowctdm24xxp: Eliminate chance for channel to be stuck in RED alarm. v2.6.2-rc1
Shaun Ruffell [Thu, 24 Jan 2013 17:37:29 +0000 (11:37 -0600)]
wctdm24xxp: Eliminate chance for channel to be stuck in RED alarm.

There was a code patch where it was possible to get stuck in RED ALARM on a
channel when debouncing the battery states. The state transitions would look
like this:

(send alarm up to asterisk) --> BATTERY_LOST -> BATTERY_DEBOUNCING_PRESENT ->

In the above sequence there was never any transition from
never cleared and the channel stayed stuck.

Now when you loose battery when in the BATTERY_DEBOUNCING_PRESENT_ALARM go all
the way back to the BATTERY_LOST state instead of the BATTERY_DEBOUNCING_LOST
state so that all the events are properly sent up.

This fixes a regression introduced in 2.6.0 with commit (r10169 "wctdm24xxp: Use
interval for debouncing FXO battery." 874b76bd223313e22a773725be63c1b4b64cb274).

Internal-Issue-ID: DAHDI-1019
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 8bf04348963b440b57e308fdec6cc57c64fcdd3f)

5 years agowctdm24xxp: Use framecount and not jiffies when looking for battery present.
Shaun Ruffell [Wed, 23 Jan 2013 23:16:07 +0000 (17:16 -0600)]
wctdm24xxp: Use framecount and not jiffies when looking for battery present.

The logic to check for battery lost and battery present were using different
time bases. One was using jiffies and the other was using framecount. Since
framecount is always in milliseconds, let's use that to stay consistent.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit a6be60359012260610f616cda20118988529433c)

5 years agowcb4xxp: Allocate memory in hfc_decode_st_state() with GFP_ATOMIC.
Shaun Ruffell [Wed, 23 Jan 2013 22:14:07 +0000 (16:14 -0600)]
wcb4xxp: Allocate memory in hfc_decode_st_state() with GFP_ATOMIC.

hfc_decode_st_state() will be called from interrupt context when the debug flag
is set to 32. Therefore, must use GFP_ATOMIC when allocating memory.

Only affects the wcb4xxp driver when called with particular debug flags set.

Internal-Issue-ID: DAHLIN-314
Reported-by: Gerald Schnabel
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 85e6cdde83c3edc2d2efd3dd29dfd9de1536a838)

5 years agowct4xxp: t4_serial_setup() was called more often than necessary.
Shaun Ruffell [Mon, 17 Dec 2012 19:00:18 +0000 (13:00 -0600)]
wct4xxp: t4_serial_setup() was called more often than necessary.

The driver iterates through all the spans on a given device during assignment,
checking for unassigned spans, but it was erroneously testing the span on which
assigned was called.

This just removes some unexpected behavior and provides a slight performance
increase on load and does not impact the functionality of the driver as far as
I'm aware.

Reported-by: Doug Bailey <dbailey@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
(cherry picked from commit 9de213b1044c5e005d714b9cf00a367120d42392)

5 years agowct4xxp: EC channel calculation in TONEDETECT assumes TE820.
Shaun Ruffell [Thu, 4 Oct 2012 20:24:55 +0000 (20:24 +0000)]
wct4xxp: EC channel calculation in TONEDETECT assumes TE820.

Since r10290 "wct4xxp: Add support for TE820 and VPMOCT256." [1],
the TONEDETECT ioctl was not calculating the VPM channel correctly
on non TE820 cards. This fixes a regression first introduced in

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

Internal-Issue-ID: DAHLIN-302
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@10733 a0bf4364-ded3-4de4-8d8a-66a801d63aff
(cherry picked from commit abad4b447960bf3059d6a08485defa91ae05cf14)

5 years agowctdm24xxp: Only two polarity reversals are needed to validate RING on FXO ports.
Shaun Ruffell [Fri, 21 Sep 2012 18:16:35 +0000 (18:16 +0000)]
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

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
(cherry picked from commit 84e70cdac5ca14a43f37cf083f241eb7eb952bc5)

5 years agoxpp: Do not typedef bool on RHEL 5.2 or later.
Shaun Ruffell [Sat, 19 Jan 2013 23:02:41 +0000 (17:02 -0600)]
xpp: Do not typedef bool on RHEL 5.2 or later.

Without digging into the specifics, it looks like Red Hat Linux 5.9
removed the hex_asc definition that was previously used to determine
if the bool definition was backported.

We can simply use the RHEL_RELEASE_CODE now since we do not support any
releases before the 5 series now.

Reported-By: Vladimir Mikhelson
Internal-Issue-ID: DAHLIN-312
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
(cherry picked from commit da0aa6f231d39f6d12c97f16b439c65cb8d29254)


5 years agogitignore: Add README.html to git ignore list
Tzafrir Cohen [Wed, 12 Dec 2012 14:57:15 +0000 (16:57 +0200)]
gitignore: Add README.html to git ignore list

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
(cherry picked from commit a8dfd61e534b7ba703cb39e84621dc1ed33ba833)

5 years agoAdd .gitignore file
Tzafrir Cohen [Thu, 6 Dec 2012 21:49:54 +0000 (23:49 +0200)]
Add .gitignore file

Allows 'git status' command to better show untracked files which one may be
interested in.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
(cherry picked from commit d889fb39d317417756e66839b13364f0dd2c94be)

6 years agoxpp: pre/post_unregister: not for the EC
Tzafrir Cohen [Thu, 15 Nov 2012 15:15:48 +0000 (15:15 +0000)]
xpp: pre/post_unregister: not for the EC

Don't run the pre- and post-unregister hooks on a non-phone XPD
(practically: the echo canceller). This fixes a panic with manual
'dahdi_registertion off' as it is now called for the whole device
(regression of 2.6.x).

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10735

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10736 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: pci-aspm.h was included in 2.6.26 not 2.6.25.
Shaun Ruffell [Thu, 16 Aug 2012 21:39:01 +0000 (21:39 +0000)]
dahdi: pci-aspm.h was included in 2.6.26 not 2.6.25.

When compiling against kernels 2.6.25, you could get the following error.

  error: linux/pci-aspm.h: No such file or directory

This fixes a build regression introduced in r10556 "dahdi: Add
dahdi_pci_disable_link_state for kernel < 2.6.25." [1]

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

Reported-by: Jean-Philippe Lord
Internal-Issue-ID: DAHLIN-299
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10705

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10708 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcte12xp: Fix stack corruption when checking T1 RBS states.
Shaun Ruffell [Thu, 16 Aug 2012 21:38:57 +0000 (21:38 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10700

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10707 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcte12xp: Fix pulse digit detection when set for FXO signalling modes.
Shaun Ruffell [Thu, 16 Aug 2012 21:38:52 +0000 (21:38 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10699

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10706 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcte12xp: Allow default_linemode to be set to j1.
Shaun Ruffell [Sat, 23 Jun 2012 04:36:12 +0000 (04:36 +0000)]
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

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10696


git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10698 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcte12xp: Destroy the cache if the linemode is not recognized.
Shaun Ruffell [Sat, 23 Jun 2012 04:36:08 +0000 (04:36 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10695

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10697 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: usermode_helper() bugfix for kernels >= 3.3.0
Oron Peled [Thu, 21 Jun 2012 17:53:33 +0000 (17:53 +0000)]
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/branches/2.6@10694 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoAssign NULL values to pointers to insure that future kfree calls do not cause errors.
Doug Bailey [Fri, 27 Apr 2012 20:12:09 +0000 (20:12 +0000)]
Assign NULL values to pointers to insure that future kfree calls do not cause errors.

From: Doug Bailey <dbailey@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10678

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10679 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined. branched-2.6.1
Shaun Ruffell [Wed, 11 Apr 2012 20:19:29 +0000 (20:19 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10658

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10660 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined.
Mike Sinkovsky [Wed, 11 Apr 2012 17:45:45 +0000 (17:45 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10655

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10657 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoFPGA_1161.201.hex rev 10545: fix reset of XR1000
Tzafrir Cohen [Wed, 11 Apr 2012 09:16:06 +0000 (09:16 +0000)]
FPGA_1161.201.hex rev 10545: fix reset of XR1000

Previous commit (r10651) 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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10652

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10654 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoFPGA_1161.201.hex rev 10532: fix reset of XR1000
Tzafrir Cohen [Tue, 10 Apr 2012 22:00:52 +0000 (22:00 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10649

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10651 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcte12xp, wctdm24xxp, wct4xxp: Print warning about potential GPL violation w/HOTPLUG_...
Shaun Ruffell [Thu, 5 Apr 2012 20:34:50 +0000 (20:34 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10646

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10648 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcb4xxp: Remove asm/system.h include.
Shaun Ruffell [Thu, 5 Apr 2012 16:22:41 +0000 (16:22 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10641

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10645 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dummy: Include timer.h instead of time.h
Shaun Ruffell [Thu, 5 Apr 2012 16:22:37 +0000 (16:22 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10640

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10644 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: Fix compilation when CONFIG_DAHDI_NET is defined.
Shaun Ruffell [Tue, 3 Apr 2012 22:02:31 +0000 (22:02 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10634

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10637 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: Fix compilation when CONFIG_DAHDI_ECHOCAN_PROCESS_TX is defined.
Shaun Ruffell [Tue, 3 Apr 2012 22:02:26 +0000 (22:02 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10633

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10636 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic_loc: Change and check the dyn->pvt pointer under lock.
Shaun Ruffell [Tue, 3 Apr 2012 20:10:20 +0000 (20:10 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10627

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10632 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic_eth: Make ztdeth_exit() symetrical with ztdeth_init() and fix race...
Shaun Ruffell [Tue, 3 Apr 2012 20:10:16 +0000 (20:10 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10626

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10631 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic: Close race on unload if red alarm timer was running when unloaded.
Shaun Ruffell [Tue, 3 Apr 2012 20:10:12 +0000 (20:10 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10625

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10630 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic: Remove calls to __module_get().
Shaun Ruffell [Tue, 3 Apr 2012 20:10:08 +0000 (20:10 +0000)]
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 <

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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10624

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10629 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic: Do not call into dahdi_dynamic without holding reference.
Shaun Ruffell [Tue, 3 Apr 2012 20:10:03 +0000 (20:10 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10623

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10628 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowctdm24xxp, wcte12xp: Allow VPMOCT032 firmware to be compiled into driver.
Shaun Ruffell [Mon, 2 Apr 2012 14:05:17 +0000 (14:05 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10618

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10620 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowctdm24xxp: Remove forward declaration of inline for GCC 3.4.4
Shaun Ruffell [Thu, 29 Mar 2012 15:28:43 +0000 (15:28 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10613

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10614 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: Trivial formatting changes around request_irq. branched-2.6.1-rc2
Shaun Ruffell [Thu, 22 Mar 2012 18:36:14 +0000 (18:36 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10590

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10594 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: Disable all interrupts explicitly in interrupt handler.
Shaun Ruffell [Thu, 22 Mar 2012 18:36:10 +0000 (18:36 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10589

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10593 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic_eth: Fix compilation on kernels < 2.6.22.
Shaun Ruffell [Thu, 22 Mar 2012 18:36:06 +0000 (18:36 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10588

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10592 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic_eth: Prevent crash is packet arrives before span is fully configured.
Shaun Ruffell [Thu, 22 Mar 2012 18:36:01 +0000 (18:36 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10587

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10591 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: FXS: added a 'lower_ringing_noise' parameter branched-2.6.1-rc1
Oron Peled [Wed, 21 Mar 2012 20:35:33 +0000 (20:35 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10574

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10576 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: FXS: atomic vbat_h power handling
Oron Peled [Wed, 21 Mar 2012 20:34:05 +0000 (20:34 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10573

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10575 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoremove a duplicate dev_set_name()
Oron Peled [Wed, 21 Mar 2012 19:36:32 +0000 (19:36 +0000)]
remove a duplicate dev_set_name()

Remove duplicate definition from dahdi-sysfs.c

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10447

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10572 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic: Since dynamic devices are 'parentless' we must name them.
Shaun Ruffell [Wed, 21 Mar 2012 19:12:10 +0000 (19:12 +0000)]
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

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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10563

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10571 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dynamic_eth: Move tx packet flushing to process context.
Shaun Ruffell [Wed, 21 Mar 2012 19:12:08 +0000 (19:12 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10562

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10570 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: Update dev_set_name / dev_name for RHEL 5.6+.
Shaun Ruffell [Wed, 21 Mar 2012 19:12:06 +0000 (19:12 +0000)]
dahdi: Update dev_set_name / dev_name for RHEL 5.6+.

This is needed because dev_name() is mapped to kobject_name() in a backport,
but the kobject name isn't set until after device_add().  The result would be
parentless devices would fail since dahdi would not think a name was set for
these devices.

For these systems, we'll set both the bus_id string and the underlying

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10561

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10569 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoA parent-less device should not crash dahdi
Oron Peled [Wed, 21 Mar 2012 19:12:02 +0000 (19:12 +0000)]
A parent-less device should not crash dahdi

* A parent-less device should not crash dahdi:
  - Access span->parent->dev instead of span->parent-dev.parent
    in soem cases.
  - Access span->parent->dev via new inline span_device()
  - Use span_device() in all dahdi_dev_{dbg,info}()

* Allow low-level drivers to set their device name.
  - Drivers that don't use this feature get the default name
    based on the parent device name
  - Parent-less devices which don't set their name, fails
    to register with -EINVAL

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10449

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10568 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowcte12xp, wctdm24xxp: Add compile-time option to disable ASPM for PCIe devices.
Shaun Ruffell [Wed, 21 Mar 2012 19:11:57 +0000 (19:11 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10557

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10567 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: Add compile-time option to disable ASPM for PCIe devices.
Shaun Ruffell [Wed, 21 Mar 2012 19:11:53 +0000 (19:11 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10558

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10566 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: __t4_frame_in and __t4_framer_out slowdowns.
Shaun Ruffell [Wed, 21 Mar 2012 19:11:49 +0000 (19:11 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10559

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10565 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: Add dahdi_pci_disable_link_state for kernel < 2.6.25.
Shaun Ruffell [Wed, 21 Mar 2012 19:11:44 +0000 (19:11 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10556

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10564 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: firmwares: useless 0x1A at EOF
Tzafrir Cohen [Tue, 20 Mar 2012 11:20:36 +0000 (11:20 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10550

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10553 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: firmwares to support E-Main 4
Tzafrir Cohen [Sun, 18 Mar 2012 19:00:04 +0000 (19:00 +0000)]
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

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

Also includes Makefile fixes from r10536.

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10535

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10538 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: USB_FW rev 10401: minor 6FXS/2FXO caps issue
Tzafrir Cohen [Sun, 18 Mar 2012 18:57:51 +0000 (18:57 +0000)]
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>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10534

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10537 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi_dummy: Fix compilation since dahdi-linux 2.6.0.
Shaun Ruffell [Fri, 16 Mar 2012 16:11:29 +0000 (16:11 +0000)]
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

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10486

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10526 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: '%d' -> '%lu' when displaying module_refcount on kernel versions >= 3.3
Shaun Ruffell [Fri, 16 Mar 2012 16:11:25 +0000 (16:11 +0000)]
xpp: '%d' -> '%lu' when displaying module_refcount on kernel versions >= 3.3

Upstream commit bd77c047 "module: struct module_ref should contains long
fields" changed the return of module_refcount from int to unsigned long. This
change eliminates a warning from the string format specifier.

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10485



git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10525 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: Use 'bool' type for boolean module parameters on kernel versions >= 2.6.31.
Shaun Ruffell [Fri, 16 Mar 2012 16:11:20 +0000 (16:11 +0000)]
xpp: Use 'bool' type for boolean module parameters on kernel versions >= 2.6.31.

Eliminates warnings that are a result of upstream commit 72db395ffa
"module_param: check that bool parameters really are bool."

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10484



git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10524 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: FXS: better power-down to lower noise
Oron Peled [Thu, 15 Mar 2012 17:36:48 +0000 (17:36 +0000)]
xpp: FXS: better power-down to lower noise

* Now every linefeed control command which is not RING'ing
  powers-down the SLIC. This reduce audible noise when
  several channels are ringing.

* Simplify code by removing redundant calls to do_chan_power()
  before linefeed_control()

* Manage vbat_h state so we skip do_chan_power() calls when
  there isn't a state change

* Export vbat_h state to /proc/.../fxs_info

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10478

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10490 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: reset Astribank SPI busses
Oron Peled [Thu, 15 Mar 2012 17:35:57 +0000 (17:35 +0000)]
xpp: reset Astribank SPI busses

* A driver reload should reset Astribank hardware
* This patch send an SPI reset after we get AB_DESCRIPTION reply from Astribank

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10474

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10489 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowctdm24xxp: Shorten RINGOFF debounce interval from 512ms to 128ms.
Shaun Ruffell [Thu, 15 Mar 2012 15:03:27 +0000 (15:03 +0000)]
wctdm24xxp: Shorten RINGOFF debounce interval from 512ms to 128ms.

In commit r10168 "wctdm24xxp: Use time interval for debouncing FXO ring
detect" [1], I inadvertently changed the debounce interval of the RINGOFF
event from 128ms to 512ms. The result was a potential failure to detect CID,
depending on line conditions, since Asterisk would bump the rx gains on the
channel in the middle of the CID spill as opposed to before the CID spill.

This fixes a regression first introduced in DAHDI-Linux 2.6.0.

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

Internal-Issue-ID: DAHDI-951
Reported-and-Tested-by: Jack Wilson <ljwilson@digitalav.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10473

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10481 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoUSB_RECOV.hex: recovering from xpp hardware issues
Tzafrir Cohen [Tue, 7 Feb 2012 22:19:39 +0000 (22:19 +0000)]
USB_RECOV.hex: recovering from xpp hardware issues

USB_RECOV.hex, rev. 9760. It may be used to recover from certain
issues of the USB controller of the Astribank (when an Astribank
is not detected as such) by Support staff.

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10455

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10457 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoAstribank I firmwares rev. 7107
Tzafrir Cohen [Wed, 25 Jan 2012 20:51:21 +0000 (20:51 +0000)]
Astribank I firmwares rev. 7107

A slightly newer firmware (Xorcom rev. 7107) for older (non Astribank
II) Astribank modules. Was accidentally left uncommited. Includes minor
bug fixes.

No change for any relatively recent (Astribank II) Astribank.

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10443

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10445 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoBuild OSLEC EC if in the tree
Tzafrir Cohen [Tue, 17 Jan 2012 14:50:01 +0000 (14:50 +0000)]
Build OSLEC EC if in the tree

Build the OSLEC echo canceller (drivers/staging/echo and
dahdi_echocan_oslec) if the code of oslec is present in the tree.

Also closing another issue regarding documentation of building OSLEC,
as it is now even clearer than before.

Patch has been used in the Debian package for quite some time.

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

(closes issue DAHLIN-110)
Reported by: biohumanoid (Pavel Selivanov)
     oslec_auto.diff uploaded by tzafrir (license 5035)

(closes issue DAHLIN-261)

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10440

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10442 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: handle failures during dahdi_register_device()
Oron Peled [Tue, 10 Jan 2012 22:09:34 +0000 (22:09 +0000)]
xpp: handle failures during dahdi_register_device()

* If dahdi_register_device() failed, not all resources were freed.
  When dahdi_unregister_device() was called later (during driver
  removal) a panic was caused.

* Add proper error handling for possible failures in
  - new xbus_free_ddev() safely free an xbus->ddev
  - This is called from all failures points.
  - It is also called from xbus_unregister_dahdi_device()

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10410

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10419 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: Don't deactivate XPDs on unregistration
Oron Peled [Tue, 10 Jan 2012 22:09:29 +0000 (22:09 +0000)]
xpp: Don't deactivate XPDs on unregistration

* A bug was introduced during migration to dahdi_device code:
* Marking XPDs as non-functional (card_present=0, XPD_STATE_NOHW)
  was moved from xbus_request_removal() into xpd_dahdi_preunregister()
* As a result, unregistering an Astribank, made it non-functional
  so trying to re-register it later caused errors (e.g: "Cannot open"
  error message from xpp_open())
* This fix move XPD deactivation into the proper location (during

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10409

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10418 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: bugfix: fix bad refcount
Oron Peled [Tue, 10 Jan 2012 22:09:25 +0000 (22:09 +0000)]
xpp: bugfix: fix bad refcount

Code path called in error condition contained an superflous put_xpd() call

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10408

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10417 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: VPM module creates noise on alternate channels on E1 spans.
Shaun Ruffell [Tue, 10 Jan 2012 22:05:47 +0000 (22:05 +0000)]
wct4xxp: VPM module creates noise on alternate channels on E1 spans.

The VPMOCT128 module was using the VPMOCT256 timeslots assigments which would
mean that channels that should be marked alaw were being set in ulaw. This
only affected E1 spans since by default all spans are configured for ulaw by

This fixes a regression introduced in r10290 [1] "wct4xxp: Add support for
TE820 and VPMOCT256", first released in 2.6.0, that only affects E1 spans on a
quad and dual-span card when used with the hardware echocanceler.

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

Internal-Issue-ID: DAHDI-945, DAHLIN-275
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10414

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10416 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowctdm24xxp: FXS on-hook transmission timer incorrect.
Shaun Ruffell [Tue, 10 Jan 2012 22:05:43 +0000 (22:05 +0000)]
wctdm24xxp: FXS on-hook transmission timer incorrect.

The DAHDI_ONHOOKTRANSFER ioctl was incorrectly setting the ohttimer to 0. The
result was that an FXS port was leaving the on-hook transfer state before
finishing the transmission.

This was discovered while looking at why ./fxstest dtmfcid  was not able to
pass the DTMF callerid digits to an attached FXO port properly.

Fixes a regression introduced in r10167 "wctdm24xxp: Use interval for checking
FXS on hook transfer timer." [1], first released in 2.6.0.

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

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

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10413

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10415 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoCreating branch for 2.6.
Shaun Ruffell [Wed, 4 Jan 2012 22:19:55 +0000 (22:19 +0000)]
Creating branch for 2.6.

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10406 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoAvoid building PCI devices if kernel has no PCI branched-2.6
Tzafrir Cohen [Tue, 3 Jan 2012 22:44:43 +0000 (22:44 +0000)]
Avoid building PCI devices if kernel has no PCI

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10397 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowctdm24xxp: Fix bug if hook state on FXS changes before channel configuration.
Shaun Ruffell [Tue, 3 Jan 2012 19:25:46 +0000 (19:25 +0000)]
wctdm24xxp: Fix bug if hook state on FXS changes before channel configuration.

If the hook state on an FXS port changes before the channel is
configured with dahdi_cfg it is possible to erroneously force the line
feed register open without setting a timer to clear it.

The result would be a "dead" channel that cannot be cleared unless the
driver is reloaded and warning in the kernel log that "0 is an invalid
signaling state for an FXS module".

This change makes the OFF_HOOK to ON_HOOK change behave just as the
ON_HOOK to OFF_HOOK change has.

Internal-Issue-ID: DAHLIN-272
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@10396 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: Reduce time spent waiting for auth done bit on TE820.
Shaun Ruffell [Tue, 3 Jan 2012 19:25:42 +0000 (19:25 +0000)]
wct4xxp: Reduce time spent waiting for auth done bit on TE820.

It is not necessary to wait a full second for the donebit.

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@10395 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: BRI: batch D-Channel packets to fix frag.
Oron Peled [Mon, 2 Jan 2012 14:07:14 +0000 (14:07 +0000)]
xpp: BRI: batch D-Channel packets to fix frag.

* We need to split the BRI D-Channel (HDLC) frames to smaller packets,
  limitation of the FPGA.
* This changes batches BRI D-channel packets of the same HDLC frame to a
  single XPP frame.
* Avoids an accidental fragmantion in case we were delayed for a few ms-s.
* Also improves efficiency.

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@10390 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: BRI: split multibyte functionality
Oron Peled [Mon, 2 Jan 2012 14:06:50 +0000 (14:06 +0000)]
xpp: BRI: split multibyte functionality

* The zero lenth case (Magic request) was split into
  send_magic_request() function. It was not possible
  to move it into card_bri.c, because it is called
  directly from the general interface we provide for
  register read/write via sysfs/proc.

* The normal case (send_multibyte_request) was moved from
  card_global.c into card_bri.c

* This sets the stage to enable bundling of multibyte
  packets into frames (like we do for PCM).

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@10389 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: BRI: remove trivial BRISTUFF wrappers
Oron Peled [Mon, 2 Jan 2012 14:06:25 +0000 (14:06 +0000)]
xpp: BRI: remove trivial BRISTUFF wrappers

Now that legacy BRISTUFF code is gone, some wrapper
functions became trivial. Removed these wrappers
and inlined their contents.

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@10388 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: BRI: remove legacy BRISTUFF code
Oron Peled [Mon, 2 Jan 2012 14:05:58 +0000 (14:05 +0000)]
xpp: BRI: remove legacy BRISTUFF code

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@10387 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: Allow up to 128 Astribanks on a system
Tzafrir Cohen [Wed, 21 Dec 2011 18:10:44 +0000 (18:10 +0000)]
xpp: Allow up to 128 Astribanks on a system

This is also a work around the bug fixed in the previous commit.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10384 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoxpp: bad module_put() when too many Astribanks
Oron Peled [Wed, 21 Dec 2011 18:10:15 +0000 (18:10 +0000)]
xpp: bad module_put() when too many Astribanks

module_put() that was added while developing the sysfs code. The real
module_get()/module_put() pair were already removed at the time of
developing code for this branch. It was only triggered when using a
system with more than 32 (MAX_BUSES) Astribanks.

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@10383 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agoDAHDI-linux: Fix "surprise removal" problems
Oron Peled [Wed, 14 Dec 2011 19:27:27 +0000 (19:27 +0000)]
DAHDI-linux: Fix "surprise removal" problems

* Added a nodev_*() file_operations that handle system calls
  from user-space after surprise device removal.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-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@10381 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agowct4xxp: Fail startup if not generating interrupts.
Shaun Ruffell [Wed, 14 Dec 2011 19:02:53 +0000 (19:02 +0000)]
wct4xxp: Fail startup if not generating interrupts.

I've seen some platforms that do not properly route the interrupt from the
card to the host CPU. In these cases the card potentially could appear to be
greened up even though no data is flowing over the spans.

This change allows dahdi_cfg to return an error when this occurs, and also
ensures that all the spans are in RED alarm.

For example, dahdi_cfg output when the card is not generating interrupts:
  # dahdi_cfg
  DAHDI startup failed: Input/output error

And the kernel log will contain a string like:
  wct4xxp 0000:02:08.0: Interrupts not detected.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10380 a0bf4364-ded3-4de4-8d8a-66a801d63aff

6 years agodahdi: Return dahdi_span_ops.startup callback errors to userspace.
Shaun Ruffell [Wed, 14 Dec 2011 19:02:48 +0000 (19:02 +0000)]
dahdi: Return dahdi_span_ops.startup callback errors to userspace.

Allows dahdi_cfg to return an error code if a board driver fails it's startup
call for any reason.

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@10379 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agowctdm24xxp: Do not call voicebus_release() before wctdm_back_out_gracefully()
Shaun Ruffell [Mon, 12 Dec 2011 18:18:14 +0000 (18:18 +0000)]
wctdm24xxp: Do not call voicebus_release() before wctdm_back_out_gracefully()

voicebus_release is already called as part of the wctdm_back_out_gracefully()
call. If an Hx8 card fails to initialize, this will eliminate warnings from
the kernel such as:

  WARNING: at kernel/irq/manage.c:904 __free_irq+0x94/0x173()
  Trying to free already-free IRQ 18

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10377 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: BRI: fix timing priority calculation
Oron Peled [Wed, 7 Dec 2011 19:34:37 +0000 (19:34 +0000)]
xpp: BRI: fix timing priority calculation

Use similar caculation as in the PRI module:
* Save timing_priority from spanconfig and
  elect syncer when spanconfig is called.
* Create custom timing_priority() function that returns
  the value or error if span is disconnected.

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@10373 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: FXS: mwi and search_fsk fixes
Oron Peled [Wed, 7 Dec 2011 19:22:04 +0000 (19:22 +0000)]
xpp: FXS: mwi and search_fsk fixes

* We must not block PCM during from 'search_fsk_pattern' channels.
* We must vmwi_search() not only on FXS_LINE_POL_ACTIVE, but also during
  'neon_blinking' -- so we notice the message to turn it off.
* Also added 'search_fsk_pattern' and neon_blinking to /proc/.../fxs_info

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@10372 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agowct4xxp: Revise vpm struct due to product name changes
Russ Meyerriecks [Fri, 2 Dec 2011 22:48:44 +0000 (22:48 +0000)]
wct4xxp: Revise vpm struct due to product name changes

Renamed most of the "vpm450m" references to just "vpm".

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@10365 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agowct4xxp: Handle incorrect vpm module/card pairings
Russ Meyerriecks [Fri, 2 Dec 2011 22:48:39 +0000 (22:48 +0000)]
wct4xxp: Handle incorrect vpm module/card pairings

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@10364 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agodahdi: #include <linux/module.h> in dahdi/kernel.h and GpakCust.h
Shaun Ruffell [Fri, 2 Dec 2011 19:56:11 +0000 (19:56 +0000)]
dahdi: #include <linux/module.h> in dahdi/kernel.h and GpakCust.h

Commit de47725, first released in 3.2-rc1 removed module.h from some
kernel headers. Include it explicitly now.

Resolves compilation errors like:
error: implicit declaration of function 'try_module_get'
error: 'THIS_MODULE' undeclared (first use in this function)
error: implicit declaration of function 'module_put'

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10361 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agowctc4xxp: Replace 'ndo_set_multicast_list' with 'set_rx_mode'
Shaun Ruffell [Fri, 2 Dec 2011 19:56:07 +0000 (19:56 +0000)]
wctc4xxp: Replace 'ndo_set_multicast_list' with 'set_rx_mode'

The ndo_set_multicast_list callback was removed in b81693d9, which was
first released in Linux Kernel 3.2-rc1

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10360 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: PRI: restore pri_protocol to R/W:
Oron Peled [Tue, 29 Nov 2011 23:38:30 +0000 (23:38 +0000)]
xpp: PRI: restore pri_protocol to R/W:

Restores the pri_protocol attribute of the XPD node in SysFS to be
writable. Fixes a minor regression from the pinned-spans fix, similar to

* This attribute was made R/O in digium r10280 as part of the
  pinned-spans changes:
  - The E1/T1 settings were changed via new set_spantype() method
    which was called from dahdi when the 'spantype' dahdi attribute
    was written to.

  - This fails our init_card_4_* trying to write E1/T1 into our private

* Restored our old code (with minor modifications) so we
  can set E1/T1 the old way (writing to our 'pri_protocol' attribute)
  as well as the new way (when it will be used eventually).

Signed-off-by: Oron Peled <oron.peled@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10347 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: pri: fix RS1 init in E1 CAS mode
Oron Peled [Tue, 29 Nov 2011 23:37:33 +0000 (23:37 +0000)]
xpp: pri: fix RS1 init in E1 CAS mode

Force some reserved bits to really be 1 in E1 mode (otherwise
terrorists will win).

(Closes issue DAHLIN-264)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10346 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: fxs: demote SETPOLARITY message to DBG()
Oron Peled [Tue, 29 Nov 2011 23:36:17 +0000 (23:36 +0000)]
xpp: fxs: demote SETPOLARITY message to DBG()

Signed-off-by: Oron Peled <oron.peled@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10345 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: increase command queue length to 1500
Tzafrir Cohen [Wed, 16 Nov 2011 12:10:51 +0000 (12:10 +0000)]
xpp: increase command queue length to 1500

A length of 1000 commands is not enough is some cases with CAS.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10341 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: USB_FW rev 10085: fix regression from r10013
Tzafrir Cohen [Sun, 13 Nov 2011 15:04:16 +0000 (15:04 +0000)]
xpp: USB_FW rev 10085: fix regression from r10013

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10339 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: PIC_TYPE_1 rev 9841: followup to r10013
Tzafrir Cohen [Sun, 13 Nov 2011 13:23:10 +0000 (13:23 +0000)]
xpp: PIC_TYPE_1 rev 9841: followup to r10013

An extra fix that was accidentally not included in r10013. Minor bug fixes.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10337 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: silence some bad ioctl() reporting
Oron Peled [Thu, 10 Nov 2011 16:56:54 +0000 (16:56 +0000)]
xpp: silence some bad ioctl() reporting

Ignore some FXS-specific ioctl-s in xpd_pri.

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@10335 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agoxpp: restore backward compat dahdi_registration
Oron Peled [Thu, 10 Nov 2011 16:56:29 +0000 (16:56 +0000)]
xpp: restore backward compat dahdi_registration

This restores a somewhat limited functionality of the "span"
write interface in the SysFS node of the span, broken by the
pinned-spans code.

* PROBLEM: dahdi-linux pinned-spans should work with existing dahdi-tools
  specifically the dahdi_registration tool.

* As a result, we should still be able to control dahdi registration
  order. However, registration is now in complete devices and not spans

* Restored dahdi_autoreg=[0/1] xpp module parameter:
  - It now refers to complete astribanks and not individual spans

* The xpp module sysfs "span" attribute:
  - Implemented write method (for dahdi_registration tool)
  - The first write of [1/0] to this attribute, registers/unregisters
    the complete astribank
  - Further writes are ignored (with DBG messages)

* Also, implemented new xbus_is_registered() function

* Once the new dahdi-tools are merged, we should turn deprecation
  messages from DBG() to NOTICE()

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@10334 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agowctdm24xxp: Wait for background threads to complete on failed load.
Shaun Ruffell [Mon, 7 Nov 2011 22:40:20 +0000 (22:40 +0000)]
wctdm24xxp: Wait for background threads to complete on failed load.

Some of the VPM loading / probing threads use global system workqueues. They
might now be running when we abort early so we should wait for them to
complete their runs before freeing memory that may be in use.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10332 a0bf4364-ded3-4de4-8d8a-66a801d63aff

7 years agodahdi: Unregister dahdi_device from sysfs if we fail to auto assign spans.
Shaun Ruffell [Mon, 7 Nov 2011 22:40:15 +0000 (22:40 +0000)]
dahdi: Unregister dahdi_device from sysfs if we fail to auto assign spans.

Otherwise, if the _dahdi_assign_span call fails, the dahdi_device will never
be removed from the dahdi_devices virtual bus and the board drivers will not
be reloadable.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10331 a0bf4364-ded3-4de4-8d8a-66a801d63aff