Compare commits

..

2 Commits

Author SHA1 Message Date
Shaun Ruffell
53a8c5626e Importing files for 2.6.1 release.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/tags/2.6.1@10664 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-18 17:08:23 +00:00
Shaun Ruffell
6ced49ebdd Creating tag for the release of dahdi-linux-2.6.1
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/tags/2.6.1@10663 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-18 17:07:13 +00:00
12 changed files with 634 additions and 292 deletions

41
.gitignore vendored
View File

@@ -1,41 +0,0 @@
# Files that are generated as part of the build process which we do not want git
# to track.
*.[oa]
*.mod
*.mod.[oc]
*.ko
*.cmd
*.order
*.tar.gz
tags
cscope.*
*.symvers
*.markers
.*.o.d
README.html
modules.order
Module.markers
build_tools/checkpatch.pl
drivers/dahdi/xpp/*.verified
drivers/dahdi/.tmp_versions/
drivers/dahdi/Module.symvers
drivers/dahdi/makefw
drivers/dahdi/radfw.h
drivers/dahdi/tor2fw.h
drivers/dahdi/xpp/init_fxo_modes
drivers/dahdi/xpp/print_fxo_modes
drivers/dahdi/xpp/xpp_version.h
include/dahdi/version.h
drivers/dahdi/vpmadt032_loader/vpmadt032_loader.h
drivers/dahdi/vpmadt032_loader/vpmadt032_x86_32.o_shipped
drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o_shipped
drivers/dahdi/firmware/dahdi-fw-hx8.bin
drivers/dahdi/firmware/dahdi-fw-oct6114-064.bin
drivers/dahdi/firmware/dahdi-fw-oct6114-128.bin
drivers/dahdi/firmware/dahdi-fw-oct6114-256.bin
drivers/dahdi/firmware/dahdi-fw-tc400m.bin
drivers/dahdi/firmware/dahdi-fw-te820.bin
drivers/dahdi/firmware/dahdi-fw-vpmoct032.bin
drivers/dahdi/firmware/make_firmware_object

1
.version Normal file
View File

@@ -0,0 +1 @@
2.6.1

555
ChangeLog Normal file
View File

@@ -0,0 +1,555 @@
2012-04-18 Shaun Ruffell <sruffell@digium.com>
* Released 2.6.1
2012-04-11 20:19 +0000 [r10657-10660] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/xpp/xpp_dahdi.c, drivers/dahdi/xpp/xpp_dahdi.h:
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
* drivers/dahdi/dahdi-base.c: 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
2012-04-11 09:16 +0000 [r10651-10654] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/firmwares/FPGA_1161.201.hex: 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
* drivers/dahdi/xpp/firmwares/FPGA_1161.201.hex: 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
2012-04-05 20:34 +0000 [r10644-10648] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/voicebus/Kbuild, drivers/dahdi/wct4xxp/Kbuild:
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
* drivers/dahdi/wcb4xxp/base.c: 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
* drivers/dahdi/dahdi_dummy.c: 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
2012-04-03 22:02 +0000 [r10628-10637] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/dahdi-base.c: 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
* drivers/dahdi/dahdi-base.c: 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
* drivers/dahdi/dahdi_dynamic_loc.c: 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
* drivers/dahdi/dahdi_dynamic_eth.c: 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
* drivers/dahdi/dahdi_dynamic.c: 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
* drivers/dahdi/dahdi_dynamic.c: 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> Origin:
http://svnview.digium.com/svn/dahdi?view=rev&rev=10624
* drivers/dahdi/dahdi-base.c, include/dahdi/kernel.h,
drivers/dahdi/dahdi_dynamic.c: 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
2012-04-02 14:05 +0000 [r10620] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/voicebus/vpmoct.c, drivers/dahdi/firmware/Makefile,
drivers/dahdi/voicebus/Kbuild: 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
2012-03-29 15:28 +0000 [r10614] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/wctdm24xxp/base.c: 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
2012-03-28 Shaun Ruffell <sruffell@digium.com>
* Released 2.6.0-rc1
2012-03-22 18:36 +0000 [r10591-10594] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/wct4xxp/base.c: 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
* drivers/dahdi/wct4xxp/base.c: 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
* drivers/dahdi/dahdi_dynamic_eth.c: 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
* drivers/dahdi/dahdi_dynamic_eth.c: 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
2012-03-21 20:35 +0000 [r10575-10576] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/card_fxs.c: 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
* drivers/dahdi/xpp/card_fxs.c: 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
2012-03-21 19:36 +0000 [r10564-10572] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/dahdi-sysfs.c: 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
* include/dahdi/kernel.h, drivers/dahdi/dahdi_dynamic.c:
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> Origin:
http://svnview.digium.com/svn/dahdi?view=rev&rev=10563
* drivers/dahdi/dahdi_dynamic_eth.c: 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
* include/dahdi/kernel.h: 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 kobject_name. 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
* drivers/dahdi/dahdi-base.c, drivers/dahdi/dahdi-sysfs.c: 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
* drivers/dahdi/voicebus/voicebus.h, drivers/dahdi/wcte12xp/base.c,
drivers/dahdi/wctdm24xxp/base.c: 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
* drivers/dahdi/wct4xxp/base.c: 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
* drivers/dahdi/wct4xxp/base.c: 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
* drivers/dahdi/dahdi-base.c, include/dahdi/kernel.h: 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
2012-03-20 11:20 +0000 [r10553] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/firmwares/USB_RECOV.hex,
drivers/dahdi/xpp/firmwares/USB_FW.hex,
drivers/dahdi/xpp/firmwares/FPGA_1161.201.hex: 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
2012-03-18 19:00 +0000 [r10537-10538] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/firmwares/Makefile,
drivers/dahdi/xpp/firmwares/FPGA_1161.201.hex (added),
drivers/dahdi/xpp/firmwares/USB_FW.201.hex (added): 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) 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
* drivers/dahdi/xpp/firmwares/USB_FW.hex: 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
2012-03-16 16:11 +0000 [r10524-10526] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/dahdi_dummy.c: 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> Origin:
http://svnview.digium.com/svn/dahdi?view=rev&rev=10486
* drivers/dahdi/xpp/xproto.c: 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 Conflicts:
drivers/dahdi/xpp/xproto.c
* drivers/dahdi/xpp/xpd.h: 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 Conflicts:
drivers/dahdi/xpp/xpd.h
2012-03-15 17:36 +0000 [r10489-10490] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/card_fxs.c: 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
* drivers/dahdi/xpp/card_global.c, drivers/dahdi/xpp/card_global.h:
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
2012-03-15 15:03 +0000 [r10481] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/wctdm24xxp/base.c: 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
2012-02-07 22:19 +0000 [r10457] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/firmwares/USB_RECOV.hex (added),
drivers/dahdi/xpp/firmwares/Makefile: 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
2012-01-25 20:51 +0000 [r10445] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* drivers/dahdi/xpp/firmwares/FPGA_FXS.hex,
drivers/dahdi/xpp/firmwares/FPGA_1141.hex,
drivers/dahdi/xpp/firmwares/FPGA_1151.hex: 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
2012-01-17 14:50 +0000 [r10442] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* README, drivers/dahdi/Kbuild: 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) Patches:
oslec_auto.diff uploaded by tzafrir (license 5035) (closes issue
DAHLIN-261) Origin:
http://svnview.digium.com/svn/dahdi?view=rev&rev=10440
2012-01-10 22:09 +0000 [r10415-10419] Shaun Ruffell <sruffell@digium.com>
* drivers/dahdi/xpp/xbus-core.c: 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
xbus_register_dahdi_device(): - 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
* drivers/dahdi/xpp/xpp_dahdi.c, drivers/dahdi/xpp/xbus-core.c:
xpp: Don't deactivate XPDs on unregistration * A bug was
introduced during migration to dahdi_device code:
http://svnview.digium.com/svn/dahdi?view=rev&rev=10273 * 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 xbus_deactivate() 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
* drivers/dahdi/xpp/xpp_dahdi.c: 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
* drivers/dahdi/wct4xxp/vpm450m.c: 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 default. 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
* drivers/dahdi/wctdm24xxp/base.c: 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
2012-01-04 22:19 +0000 [r10406] Shaun Ruffell <sruffell@digium.com>
* / (added): Creating branch for 2.6.

View File

@@ -1249,8 +1249,7 @@ static char *hfc_decode_st_state(struct b4xxp *b4, int port, unsigned char state
"?", "?", "?", "?", "?", "?", "?", "?" }
};
str = kmalloc(256, GFP_ATOMIC);
if (!str) {
if (!(str = kmalloc(256, GFP_KERNEL))) {
dev_warn(&b4->pdev->dev, "could not allocate mem for ST state decode string!\n");
return NULL;
}

View File

@@ -1239,11 +1239,9 @@ static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long dat
else
clear_bit(chan->chanpos - 1, &ts->dtmfmutemask);
channel = has_e1_span(wc) ? chan->chanpos : chan->chanpos + 4;
if (is_octal(wc))
channel = channel << 3;
else
channel = channel << 2;
channel = (chan->chanpos) << 3;
if (!has_e1_span(wc))
channel += (4 << 3);
channel |= chan->span->offset;
vpm450m_setdtmf(wc->vpm, channel, j & DAHDI_TONEDETECT_ON,
j & DAHDI_TONEDETECT_MUTE);
@@ -2039,7 +2037,7 @@ static void t4_span_assigned(struct dahdi_span *span)
/* We use this to make sure all the spans are assigned before
* running the serial setup. */
list_for_each_entry(pos, &wc->ddev->spans, device_node) {
if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &pos->flags))
if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags))
++unassigned_spans;
}
@@ -2095,8 +2093,6 @@ static int t4_alloc_channels(struct t4 *wc, struct t4_span *ts,
for (i = 0; i < ARRAY_SIZE(ts->chans); ++i) {
kfree(ts->chans[i]);
kfree(ts->ec[i]);
ts->chans[i] = NULL;
ts->ec[i] = NULL;
}
ts->linemode = linemode;

View File

@@ -1833,22 +1833,19 @@ static void wctdm_qrvdri_check_hook(struct wctdm *wc, int card)
static inline bool is_fxo_ringing(const struct fxo *const fxo)
{
return ((fxo->hook_ring_shadow & 0x60) &&
((fxo->battery_state == BATTERY_PRESENT) ||
(fxo->battery_state == BATTERY_DEBOUNCING_LOST)));
(fxo->battery_state == BATTERY_PRESENT));
}
static inline bool is_fxo_ringing_positive(const struct fxo *const fxo)
{
return (((fxo->hook_ring_shadow & 0x60) == 0x20) &&
((fxo->battery_state == BATTERY_PRESENT) ||
(fxo->battery_state == BATTERY_DEBOUNCING_LOST)));
(fxo->battery_state == BATTERY_PRESENT));
}
static inline bool is_fxo_ringing_negative(const struct fxo *const fxo)
{
return (((fxo->hook_ring_shadow & 0x60) == 0x40) &&
((fxo->battery_state == BATTERY_PRESENT) ||
(fxo->battery_state == BATTERY_DEBOUNCING_LOST)));
(fxo->battery_state == BATTERY_PRESENT));
}
static inline void set_ring(struct fxo *fxo, enum ring_detector_state new)
@@ -1859,21 +1856,19 @@ static inline void set_ring(struct fxo *fxo, enum ring_detector_state new)
static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod)
{
struct fxo *const fxo = &mod->mod.fxo;
static const unsigned int POLARITY_CHANGES_NEEDED = 2;
/* Look for ring status bits (Ring Detect Signal Negative and Ring
* Detect Signal Positive) to transition back and forth
* POLARITY_CHANGES_NEEDED times to indicate that a ring is occurring.
* Provide some number of samples to allow for the transitions to occur
* before giving up. NOTE: neon mwi voltages will trigger one of these
* bits to go active but not to have transitions between the two bits
* (i.e. no negative to positive or positive to negative traversals) */
* Detect Signal Positive) to transition back and forth some number of
* times to indicate that a ring is occurring. Provide some number of
* samples to allow for the transitions to occur before giving up.
* NOTE: neon mwi voltages will trigger one of these bits to go active
* but not to have transitions between the two bits (i.e. no negative
* to positive or positive to negative traversals) */
switch (fxo->ring_state) {
case DEBOUNCING_RINGING_POSITIVE:
if (is_fxo_ringing_negative(fxo)) {
if (++fxo->ring_polarity_change_count >
POLARITY_CHANGES_NEEDED) {
if (++fxo->ring_polarity_change_count > 4) {
mod_hooksig(wc, mod, DAHDI_RXSIG_RING);
set_ring(fxo, RINGING);
if (debug) {
@@ -1891,8 +1886,7 @@ static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod)
break;
case DEBOUNCING_RINGING_NEGATIVE:
if (is_fxo_ringing_positive(fxo)) {
if (++fxo->ring_polarity_change_count >
POLARITY_CHANGES_NEEDED) {
if (++fxo->ring_polarity_change_count > 4) {
mod_hooksig(wc, mod, DAHDI_RXSIG_RING);
set_ring(fxo, RINGING);
if (debug) {
@@ -1962,13 +1956,13 @@ wctdm_check_battery_lost(struct wctdm *wc, struct wctdm_module *const mod)
*/
switch (fxo->battery_state) {
case BATTERY_DEBOUNCING_PRESENT:
case BATTERY_DEBOUNCING_PRESENT_ALARM: /* intentional drop through */
/* we were going to BATTERY_PRESENT, but
* battery was lost again. */
fxo->battery_state = BATTERY_LOST;
break;
case BATTERY_UNKNOWN:
mod_hooksig(wc, mod, DAHDI_RXSIG_ONHOOK);
case BATTERY_DEBOUNCING_PRESENT_ALARM: /* intentional drop through */
case BATTERY_PRESENT:
fxo->battery_state = BATTERY_DEBOUNCING_LOST;
fxo->battdebounce_timer = wc->framecount + battdebounce;
@@ -2023,7 +2017,7 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
switch (fxo->battery_state) {
case BATTERY_DEBOUNCING_PRESENT:
if (time_after(wc->framecount, fxo->battdebounce_timer)) {
if (time_after(jiffies, fxo->battdebounce_timer)) {
if (debug) {
dev_info(&wc->vb.pdev->dev,
"BATTERY on %d/%d (%s)!\n",
@@ -2048,12 +2042,12 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
* of its time period has already passed while
* debouncing occurred */
fxo->battery_state = BATTERY_DEBOUNCING_PRESENT_ALARM;
fxo->battdebounce_timer = wc->framecount +
battalarm - battdebounce;
fxo->battdebounce_timer = jiffies +
msecs_to_jiffies(battalarm - battdebounce);
}
break;
case BATTERY_DEBOUNCING_PRESENT_ALARM:
if (time_after(wc->framecount, fxo->battdebounce_timer)) {
if (time_after(jiffies, fxo->battdebounce_timer)) {
fxo->battery_state = BATTERY_PRESENT;
dahdi_alarm_channel(get_dahdi_chan(wc, mod),
DAHDI_ALARM_NONE);
@@ -2062,7 +2056,6 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
case BATTERY_PRESENT:
break;
case BATTERY_DEBOUNCING_LOST:
case BATTERY_DEBOUNCING_LOST_ALARM:
/* we were going to BATTERY_LOST, but battery appeared again,
* so clear the debounce timer */
fxo->battery_state = BATTERY_PRESENT;
@@ -2070,8 +2063,10 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
case BATTERY_UNKNOWN:
mod_hooksig(wc, mod, DAHDI_RXSIG_OFFHOOK);
case BATTERY_LOST: /* intentional drop through */
case BATTERY_DEBOUNCING_LOST_ALARM:
fxo->battery_state = BATTERY_DEBOUNCING_PRESENT;
fxo->battdebounce_timer = wc->framecount + battdebounce;
fxo->battdebounce_timer = jiffies +
msecs_to_jiffies(battdebounce);
break;
}
}

View File

@@ -27,8 +27,6 @@
* this program for more details.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>
@@ -57,14 +55,18 @@
#error VOICEBUS_SFRAME_SIZE != SFRAME_SIZE
#endif
#ifndef pr_fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#endif
static int debug;
static int j1mode = -1;
static int j1mode = 0;
static int alarmdebounce = 2500; /* LOF/LFA def to 2.5s AT&T TR54016*/
static int losalarmdebounce = 2500; /* LOS def to 2.5s AT&T TR54016*/
static int aisalarmdebounce = 2500; /* AIS(blue) def to 2.5s AT&T TR54016*/
static int yelalarmdebounce = 500; /* RAI(yellow) def to 0.5s AT&T devguide */
static int t1e1override = -1; /* deprecated */
static char *default_linemode = "auto"; /* 'auto', 'e1', 't1', or 'j1' */
static char *default_linemode = "auto"; /* 'auto', 'e1', or 't1' */
static int latency = VOICEBUS_DEFAULT_LATENCY;
static unsigned int max_latency = VOICEBUS_DEFAULT_MAXLATENCY;
static int vpmsupport = 1;
@@ -643,21 +645,21 @@ static inline int t1_setreg(struct t1 *wc, int addr, int val)
return 0;
}
static void __t1_getreg(struct t1 *wc, int addr, struct command *cmd)
static int t1_getreg(struct t1 *wc, int addr)
{
cmd->address = addr;
cmd->data = 0x00;
cmd->flags = __CMD_RD;
submit_cmd(wc, cmd);
}
static int __t1_getresult(struct t1 *wc, struct command *cmd)
{
int ret;
struct command *cmd = NULL;
unsigned long ret;
unsigned long flags;
might_sleep();
cmd = get_free_cmd(wc);
if (!cmd)
return -ENOMEM;
cmd->address = addr;
cmd->data = 0x00;
cmd->flags = __CMD_RD;
submit_cmd(wc, cmd);
ret = wait_for_completion_interruptible_timeout(&cmd->complete, HZ*10);
if (unlikely(!ret)) {
spin_lock_irqsave(&wc->reglock, flags);
@@ -688,20 +690,8 @@ static int __t1_getresult(struct t1 *wc, struct command *cmd)
}
}
ret = cmd->data;
return ret;
}
static int t1_getreg(struct t1 *wc, int addr)
{
int res;
struct command *cmd = NULL;
cmd = get_free_cmd(wc);
if (!cmd)
return -ENOMEM;
__t1_getreg(wc, addr, cmd);
res = __t1_getresult(wc, cmd);
free_cmd(wc, cmd);
return res;
return ret;
}
static void t1_setleds(struct t1 *wc, int leds)
@@ -893,8 +883,7 @@ static void t1_configure_t1(struct t1 *wc, int lineconfig, int txlevel)
fmr1 = 0x9e; /* FMR1: Mode 0, T1 mode, CRC on for ESF, 2.048 Mhz system data rate, no XAIS */
fmr2 = 0x20; /* FMR2: no payload loopback, don't auto yellow alarm */
if (!strcasecmp("j1", wc->span.spantype))
if (j1mode)
fmr4 = 0x1c;
else
fmr4 = 0x0c; /* FMR4: Lose sync on 2 out of 5 framing bits, auto resync */
@@ -934,7 +923,7 @@ static void t1_configure_t1(struct t1 *wc, int lineconfig, int txlevel)
t1_setreg(wc, 0x38, 0x0a); /* PCD: LOS after 176 consecutive "zeros" */
t1_setreg(wc, 0x39, 0x15); /* PCR: 22 "ones" clear LOS */
if (!strcasecmp("j1", wc->span.spantype))
if (j1mode)
t1_setreg(wc, 0x24, 0x80); /* J1 overide */
/* Generate pulse mask for T1 */
@@ -1195,47 +1184,15 @@ static int t1xxp_rbsbits(struct dahdi_chan *chan, int bits)
return 0;
}
static void t1_check_sigbits(struct t1 *wc)
static inline void t1_check_sigbits(struct t1 *wc)
{
struct command_container {
struct command *cmd;
struct list_head node;
unsigned int index;
};
struct command_container *cont;
LIST_HEAD(commands);
int a,i,rxs;
if (!(test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags)))
return;
if (dahdi_is_e1_span(&wc->span)) {
/* Send out all the commands first. */
for (i = 0; i < 15; i++) {
if (!(wc->span.chans[i+16]->sig & DAHDI_SIG_CLEAR) ||
!(wc->span.chans[i]->sig & DAHDI_SIG_CLEAR)) {
cont = kzalloc(sizeof(*cont), GFP_KERNEL);
if (!cont) {
WARN_ON_ONCE(1);
goto done;
}
cont->cmd = get_free_cmd(wc);
if (!cont->cmd) {
WARN_ON_ONCE(1);
goto done;
}
cont->index = i;
list_add_tail(&cont->node, &commands);
__t1_getreg(wc, 0x71 + i, cont->cmd);
}
}
/* Now check the results */
list_for_each_entry_reverse(cont, &commands, node) {
i = cont->index;
a = __t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
a = t1_getreg(wc, 0x71 + i);
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0xf);
@@ -1253,29 +1210,8 @@ static void t1_check_sigbits(struct t1 *wc)
}
}
} else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
/* First we'll send out the commands */
for (i = 0; i < 24; i += 4) {
cont = kzalloc(sizeof(*cont), GFP_KERNEL);
if (!cont) {
WARN_ON_ONCE(1);
goto done;
}
cont->cmd = get_free_cmd(wc);
if (!cont->cmd) {
WARN_ON_ONCE(1);
goto done;
}
cont->index = i;
list_add_tail(&cont->node, &commands);
__t1_getreg(wc, 0x70 + (i>>2), cont->cmd);
}
/* Now we'll check the results */
list_for_each_entry_reverse(cont, &commands, node) {
i = cont->index;
a = __t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
for (i = 0; i < 24; i+=4) {
a = t1_getreg(wc, 0x70 + (i>>2));
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0x3) << 2;
@@ -1305,28 +1241,8 @@ static void t1_check_sigbits(struct t1 *wc)
}
}
} else {
/* First send out the commands. */
for (i = 0; i < 24; i += 2) {
cont = kzalloc(sizeof(*cont), GFP_KERNEL);
if (!cont) {
WARN_ON_ONCE(1);
goto done;
}
cont->cmd = get_free_cmd(wc);
if (!cont->cmd) {
WARN_ON_ONCE(1);
goto done;
}
cont->index = i;
list_add_tail(&cont->node, &commands);
__t1_getreg(wc, 0x70 + (i>>1), cont->cmd);
}
list_for_each_entry_reverse(cont, &commands, node) {
i = cont->index;
a = __t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
for (i = 0; i < 24; i+=2) {
a = t1_getreg(wc, 0x70 + (i>>1));
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0xf);
@@ -1344,21 +1260,6 @@ static void t1_check_sigbits(struct t1 *wc)
}
}
}
done:
while (!list_empty(&commands)) {
cont = container_of(commands.next,
struct command_container, node);
if (unlikely(cont->cmd)) {
/* We do not care about the result, let's just wait for
* the rest of the system to finish with it. */
__t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
}
list_del(&cont->node);
kfree(cont);
}
return;
}
struct maint_work_struct {
@@ -1945,32 +1846,18 @@ static int t1_software_init(struct t1 *wc, enum linemode type)
memset(chans, 0, sizeof(chans));
memset(ec, 0, sizeof(ec));
switch (type) {
case E1:
if (type == E1) {
wc->span.channels = 31;
wc->span.spantype = "E1";
wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_HDB3 |
DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
wc->span.deflaw = DAHDI_LAW_ALAW;
break;
case T1:
} else {
wc->span.channels = 24;
wc->span.spantype = "T1";
wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS |
DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
wc->span.deflaw = DAHDI_LAW_MULAW;
break;
case J1:
wc->span.channels = 24;
wc->span.spantype = "J1";
wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS |
DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
wc->span.deflaw = DAHDI_LAW_MULAW;
break;
default:
spin_unlock_irqrestore(&wc->reglock, flags);
res = -EINVAL;
goto error_exit;
}
spin_unlock_irqrestore(&wc->reglock, flags);
@@ -1979,7 +1866,7 @@ static int t1_software_init(struct t1 *wc, enum linemode type)
return -ENOMEM;
t1_info(wc, "Setting up global serial parameters for %s\n",
wc->span.spantype);
(dahdi_is_e1_span(&wc->span) ? "E1" : "T1"));
t4_serial_setup(wc);
set_bit(DAHDI_FLAGBIT_RBS, &wc->span.flags);
@@ -2035,19 +1922,12 @@ static int t1xxp_set_linemode(struct dahdi_span *span, const char *linemode)
if (!strcasecmp(linemode, "t1")) {
dev_info(&wc->vb.pdev->dev,
"Changing from %s to T1 line mode.\n",
wc->span.spantype);
"Changing from E1 to T1 line mode.\n");
res = t1_software_init(wc, T1);
} else if (!strcasecmp(linemode, "e1")) {
dev_info(&wc->vb.pdev->dev,
"Changing from %s to E1 line mode.\n",
wc->span.spantype);
"Changing from T1 to E1 line mode.\n");
res = t1_software_init(wc, E1);
} else if (!strcasecmp(linemode, "j1")) {
dev_info(&wc->vb.pdev->dev,
"Changing from %s to E1 line mode.\n",
wc->span.spantype);
res = t1_software_init(wc, J1);
} else {
dev_err(&wc->vb.pdev->dev,
"'%s' is an unknown linemode.\n", linemode);
@@ -2087,15 +1967,14 @@ static int t1_hardware_post_init(struct t1 *wc, enum linemode *type)
int x;
/* T1 or E1 */
if ((-1 != t1e1override) || (-1 != j1mode)) {
*type = (t1e1override) ? E1 : (j1mode) ? J1 : T1;
if (-1 != t1e1override) {
pr_info("t1e1override is deprecated. Please use 'default_linemode'.\n");
*type = (t1e1override) ? E1 : T1;
} else {
if (!strcasecmp(default_linemode, "e1")) {
*type = E1;
} else if (!strcasecmp(default_linemode, "t1")) {
*type = T1;
} else if (!strcasecmp(default_linemode, "j1")) {
*type = J1;
} else {
u8 pins;
res = t1_getpins(wc, &pins);
@@ -2104,8 +1983,7 @@ static int t1_hardware_post_init(struct t1 *wc, enum linemode *type)
*type = (pins & 0x01) ? T1 : E1;
}
}
debug_printk(wc, 1, "linemode: %s\n", (*type == T1) ? "T1" :
(J1 == *type) ? "J1" : "E1");
debug_printk(wc, 1, "linemode: %s\n", (*type == T1) ? "T1" : "E1");
/* what version of the FALC are we using? */
reg = t1_setreg(wc, 0x4a, 0xaa);
@@ -2136,41 +2014,19 @@ static int t1_hardware_post_init(struct t1 *wc, enum linemode *type)
return 0;
}
static void t1_check_alarms(struct t1 *wc)
static inline void t1_check_alarms(struct t1 *wc)
{
unsigned char c,d;
int alarms;
int x,j;
unsigned char fmr4; /* must read this always */
struct command *cmds[3];
if (!(test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags)))
return;
for (x = 0; x < ARRAY_SIZE(cmds); ++x) {
cmds[x] = get_free_cmd(wc);
if (!cmds[x]) {
WARN_ON(1);
for (x = 0; x < ARRAY_SIZE(cmds); ++x)
free_cmd(wc, cmds[x]);
return;
}
}
/* Since this is voicebus, if we issue all the reads initially and then
* check the results we can save ourselves some time. Otherwise, each
* read will take a minimum of 3ms to go through the complete pipeline.
*/
__t1_getreg(wc, 0x4c, cmds[0]);
__t1_getreg(wc, 0x20, cmds[1]); /* must read this even if not used */
__t1_getreg(wc, 0x4d, cmds[2]);
d = __t1_getresult(wc, cmds[2]);
fmr4 = __t1_getresult(wc, cmds[1]);
c = __t1_getresult(wc, cmds[0]);
for (x=0; x < ARRAY_SIZE(cmds); ++x)
free_cmd(wc, cmds[x]);
c = t1_getreg(wc, 0x4c);
fmr4 = t1_getreg(wc, 0x20); /* must read this even if we don't use it */
d = t1_getreg(wc, 0x4d);
/* Assume no alarms */
alarms = 0;
@@ -2586,11 +2442,11 @@ static void timer_work_func(struct work_struct *work)
{
struct t1 *wc = container_of(work, struct t1, timer_work);
#endif
if (test_bit(INITIALIZED, &wc->bit_flags))
mod_timer(&wc->timer, jiffies + HZ/30);
t1_do_counters(wc);
t1_check_alarms(wc);
t1_check_sigbits(wc);
if (test_bit(INITIALIZED, &wc->bit_flags))
mod_timer(&wc->timer, jiffies + HZ/10);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
@@ -3076,20 +2932,14 @@ static int __init te12xp_init(void)
if (!cmd_cache)
return -ENOMEM;
if ((-1 != t1e1override) || (-1 != j1mode)) {
pr_info("'t1e1override' and 'j1mode' are deprecated. "
"Please use 'default_linemode' instead.\n");
/* If someone is setting j1mode, then, t1e1override most likely
* needs to be forced to t1 mode */
if (j1mode > 0)
t1e1override = 0;
if (-1 != t1e1override) {
pr_info("'t1e1override' is deprecated. "
"Please use 'default_linemode' instead\n");
} else if (strcasecmp(default_linemode, "auto") &&
strcasecmp(default_linemode, "t1") &&
strcasecmp(default_linemode, "j1") &&
strcasecmp(default_linemode, "e1")) {
pr_err("'%s' is an unknown span type.\n", default_linemode);
pr_err("'%s' is an unknown span type.", default_linemode);
default_linemode = "auto";
kmem_cache_destroy(cmd_cache);
return -EINVAL;
}
res = dahdi_pci_module(&te12xp_driver);

View File

@@ -77,7 +77,6 @@
enum linemode {
T1 = 1,
E1,
J1,
};
struct command {

View File

@@ -22,7 +22,6 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/kmod.h>
#include "xdefs.h"
#include "xpd.h"
#include "xpp_dahdi.h"
@@ -656,15 +655,6 @@ static void global_packet_dump(const char *msg, xpacket_t *pack)
#define MAX_PATH_STR 128
#ifndef UMH_WAIT_PROC
/*
* - UMH_WAIT_PROC was introduced as enum in 2.6.23
* with a value of 1
* - It was changed to a macro (and it's value was modified) in 3.3.0
*/
#define UMH_WAIT_PROC 1
#endif
int run_initialize_registers(xpd_t *xpd)
{
int ret;
@@ -747,7 +737,7 @@ int run_initialize_registers(xpd_t *xpd)
}
XPD_DBG(DEVICES, xpd, "running '%s' for type=%d revision=%d\n",
init_card, xpd->type, xbus->revision);
ret = call_usermodehelper(init_card, argv, envp, UMH_WAIT_PROC);
ret = call_usermodehelper(init_card, argv, envp, 1);
/*
* Carefully report results
*/

View File

@@ -144,14 +144,12 @@ typedef unsigned char byte;
#define SET_PROC_DIRENTRY_OWNER(p) do { } while(0);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
/* Also don't define this for later RHEL >= 5.2. */
#if defined(RHEL_RELEASE_CODE) && defined(RHEL_RELEASE_VERSION)
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 3)
typedef int bool;
#endif
#else
typedef int bool;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
* same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch
* as is the bool typedef. */
#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,18) || ! defined(hex_asc)
typedef int bool;
#endif
#endif
#else

View File

@@ -1083,7 +1083,7 @@ int xpd_dahdi_postregister(xpd_t *xpd)
*/
void xpd_dahdi_preunregister(xpd_t *xpd)
{
if (!xpd || !IS_PHONEDEV(xpd))
if (!xpd)
return;
XPD_DBG(DEVICES, xpd, "\n");
update_xpd_status(xpd, DAHDI_ALARM_NOTOPEN);
@@ -1103,7 +1103,7 @@ void xpd_dahdi_preunregister(xpd_t *xpd)
void xpd_dahdi_postunregister(xpd_t *xpd)
{
if (!xpd || !IS_PHONEDEV(xpd))
if (!xpd)
return;
atomic_dec(&PHONEDEV(xpd).dahdi_registered);
atomic_dec(&num_registered_spans);

View File

@@ -72,7 +72,7 @@
#define DAHDI_IRQ_HANDLER(a) static irqreturn_t a(int irq, void *dev_id, struct pt_regs *regs)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
#ifdef CONFIG_PCI
#include <linux/pci-aspm.h>
#endif