Commit Graph

79 Commits

Author SHA1 Message Date
Shaun Ruffell
a1c4dfb99c wcte12xp, wctdm24xxp, wct4xxp: Print warning about potential GPL violation w/HOTPLUG_FIRMWARE=no.
Print a warning message that it may be a GPL violation to redistribute these
binaries if the firmware for the VPMOCT032/64/128/256 is compiled in.

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

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

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

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

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

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

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

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10560 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 18:56:05 +00:00
Shaun Ruffell
aa8bd2f546 wct4xxp: __t4_frame_in and __t4_framer_out slowdowns.
This is a partial revert of r10234 "wct4xxp: __t4_framer_in and
__t4_framer_out speedups."

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10559 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 16:34:06 +00:00
Shaun Ruffell
0f61ab172d wct4xxp: Add compile-time option to disable ASPM for PCIe devices.
Certain BIOSes appear to enable ASPM even though it is not fully supported by
the platform. Also, since the PCIe links for TDM cards are always in use it
does not make sense to allow them to transition to the disabled state.

Just turn off power management on the PCIe links completely. For more
information see http://lwn.net/Articles/449448/.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10558 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 16:34:02 +00:00
Oron Peled
fc1824fd3c Remove support for kernels < 2.6.18
This patch removes support for kernel versions < 2.6.18, as those are
not actively supported in any major Linux distribution (except RHEL4,
which is in the "extended" support level of the product life cycle).

This removes much of the more #ifdef-rich parts of the code.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10472 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-13 20:09:12 +00:00
Shaun Ruffell
5475f33f3d 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>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10414 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-10 20:45:35 +00:00
Shaun Ruffell
afe3702873 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
2012-01-03 19:25:42 +00:00
Shaun Ruffell
6b6d047241 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
2011-12-14 19:02:53 +00:00
Russ Meyerriecks
6d1713c2c0 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
2011-12-02 22:48:44 +00:00
Russ Meyerriecks
da149b0d4d 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
2011-12-02 22:48:39 +00:00
Russ Meyerriecks
1e561e4ed7 wct4xxp: minor: Removed unnecessary instrumentation
Removed a couple prints of instrumentation that was cluttering up the log output.

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@10310 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-02 21:46:07 +00:00
Russ Meyerriecks
fde1081677 wct4xxp: Expose serial number in dahdi_device and kernel log.
This will allow the serial number to be exposed in sysfs and also
allow span assignment rules to use the serial number.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10292 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-01 15:27:32 +00:00
Russ Meyerriecks
e3c07497ee wct4xxp: Add field upgradable firmware support for TE820.
This commit adds field upgradeable support for the TE820 firmware.
Firmware can now be silently upgraded as part of updating drivers
like most of the existing DAHDI firmware. Previous versions of dual
and quad span cards did not support upgrading firmware in the field.

Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
Fixed up some checkpatch issues:
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10291 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-01 15:27:27 +00:00
Matthew Fredrickson
11d8140b23 wct4xxp: Add support for TE820 and VPMOCT256.
TE820 is an 8-span PCI-express digital interface card. VPMOCT256 is a hardware
echo canceler that is able to provide echo cancelation on all 8-spans.

From: Matthew Fredrickson <creslin@digium.com>

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10290 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-01 15:27:21 +00:00
Shaun Ruffell
d91b3c53d3 wct4xxp: Allow linemode (T1/E1/J1) to be changed via sysfs attribute.
Allowing the linemode to be configured with sysfs before the spans are
assigned opens the eventualy capability for line mode to be configured
with the other physical layer settings per card.  Currently linemode is
set with either physical jumpers or with a module parameter to the
wct4xxp driver that is global for all cards.

Default behavior is not changed with this commit.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10279 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:05:24 +00:00
Shaun Ruffell
8d23f878d4 dahdi: Remove dahdi_span.irq and move dahdi_span.irqmisses into dahdi_device.
'irqmisses' is more a function of the device and there are better ways
to get to IRQ for a device than storing it in any DAHDI structures.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10276 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:00:28 +00:00
Shaun Ruffell
935c9ba50a dahdi: Register devices instead of individual spans.
Increasingly, spans are implemented by devices that support more than a
single span. Introduce a 'struct dahdi_device' object which explicitly
contains multiple spans. This will allow a cleaner representation of
spans and devices in sysfs since order of arrival will not determine the
layout of the devices. This also gives the core of dahdi a way to know
the relationship between spans.

This generalizes similar concepts that were previously xpp specific. The
conversion of the xpp code was almost entirely done by Oron and Tzafrir.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10273 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 18:58:14 +00:00
Shaun Ruffell
4b1a2f9127 wct4xxp: Deprecate 't1e1override' module parameter in favor of 'default_linemode'.
't1e1override' isn't immediately apparent what it is supposed to do by the
name. Instead 'default_linemode' module parameter can be set to "auto", "t1",
or "e1" to make it clear.

This change was introduced earlier in the wcte12xp driver.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10269 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-24 22:19:11 +00:00
Shaun Ruffell
e14f3fa541 wct4xxp: Refactor t4_serial_setup() to remove t4.globalconfig.
Allows the globalconfig member to be removed from the struct t4 and not
carried around for the life of the card. Also holds the reglock a little
longer for all the framer writes but I realize the startup of the
wct4xxp based cards does not need to be optimized.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10250 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:26 +00:00
Shaun Ruffell
955641b52c wct4xxp: Trivial. Use ARRAY_SIZE in free_wc() and __handle_leds().
Reduces the amount of code to read in the two functions and fixes
checkpatch.pl warnings.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10249 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:22 +00:00
Shaun Ruffell
b7485aa383 wct4xxp: Atomically perform some read/modify/write operations
There are read/modify/write operations on the framer that were not
protected by any locks. While I didn't notice any code paths that would
result in simultaneous accesses to these registers, this change will
hopefully save someone else some time in the future verifying that the
accesses are safe. A side effect is that the reglock is acquired only
once for each read/modify/write cycle as opposed to twice previously.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10248 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:18 +00:00
Shaun Ruffell
a81fb56b5f wct4xxp: Fix spelling
Contains a minor spelling correction.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10247 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:13 +00:00
Shaun Ruffell
ef426966d6 wct4xxp: Change t4_span.spantype to linemode.
Since 'linemode' more accurately describes what spantype is specifying.
We can also use an enumeration for the linemode to make it explicit that
linemode is only set to one of three possible values.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10246 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:09 +00:00
Shaun Ruffell
133be4bb27 wct4xxp: Trivial refactoring in t4_init_one().
Use some convenience pointers to make the function easier to read as opposed
to indexing into the arrays.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10245 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:05 +00:00
Shaun Ruffell
73764a1dc9 wct4xxp: Add has_e1_span() helper.
All those checks for wc->t1e1 span appear to basically be there to
determine if there are *any* E1 spans exported by the card. We can make
that explicit by wrapping those tests with a has_e1_span() inline
function to help with readability.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10244 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:53:00 +00:00
Shaun Ruffell
22e054a958 wct4xxp: Remove redundant 'vpm' from struct t4.
Since removal of the VPM400 support the 'vpm' member of struct t4 is
now redundant with the 'vpm450m' member.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10242 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:52 +00:00
Russ Meyerreicks
20ee5f5b0c wct4xxp: Remove vpm400 support.
The VPM400 module is no longer supported by the wct4xxp driver. The
VPMOCT064 and VPMOCT128 are.

Signed-off-by: Russ Meyerreicks <rmeyerriecks@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Michael Spiceland <mspiceland@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10241 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:48 +00:00
Shaun Ruffell
ac09987a59 wct4xxp: Remove unused debugging code
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Michael Spiceland <mspiceland@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10240 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:44 +00:00
Shaun Ruffell
eae6c0d1e7 wct4xxp: Turn off the fancy alarm LEDS.
Saves about a 1us on average from the interrupt handler on one test
system.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10239 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:39 +00:00
Shaun Ruffell
0544f8c7cc wct4xxp: Hold a pointer to the devtype directly
Eliminates the need to store a copy of the flags and variety from the
global devtype.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10238 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:35 +00:00
Shaun Ruffell
a01f74d64a wct4xxp: Remove unused fields from 'struct t4' and 'struct t4_span'
'memaddr' and 'memlen' is already cached as part of the underlying pci
device so the wct4xxp driver does not need to cache it again.  'canary',
'passno', 'master', and 'oct_rw_count' are unused.

In t4_span 'irqmisses' was incremented, but never used anywhere, and there is
already the irqmisses on the span itself.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10237 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:31 +00:00
Shaun Ruffell
58514bc801 wct4xxp: Remove prefetching support.
I was unable to measure a performance change with prefetching.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10236 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:26 +00:00
Shaun Ruffell
fabe174b83 wct4xxp: Use in-hardirq version of dahdi_receive/transmit.
We are already in hardirq context and can therefore save the cli/sti
call.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10235 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:22 +00:00
Shaun Ruffell
d8c0898fb7 wct4xxp: __t4_framer_in and __t4_framer_out speedups.
Speeds up these calls primarily by eliminating unnecessary flushes
of writes to the PCI bus.

Before:

 7.095 us    |  __t4_framer_in();
 5.835 us    |  __t4_framer_out();
 7.122 us    |  __t4_framer_in();
 7.071 us    |  __t4_framer_in();
 7.059 us    |  __t4_framer_in();
 5.859 us    |  __t4_framer_out();
 7.076 us    |  __t4_framer_in();
 5.852 us    |  __t4_framer_out();
 7.124 us    |  __t4_framer_in();
 7.080 us    |  __t4_framer_in();

After:

 1.694 us    |  __t4_framer_out();
 1.686 us    |  __t4_framer_out();
 1.695 us    |  __t4_framer_out();
 3.182 us    |  __t4_framer_in();
 3.283 us    |  __t4_framer_in();
 2.889 us    |  __t4_framer_in();
 2.942 us    |  __t4_framer_in();
 2.951 us    |  __t4_framer_in();
 2.906 us    |  __t4_framer_in();

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10234 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:18 +00:00
Shaun Ruffell
fbc506c865 wct4xxp: Remove 'pedanticpci' module parameter.
The 'pedanticpci' module parameter, which is always on by default,
inserts extra reads from the card in order to ensure that all writes are
properly flushed through any PCI bridges which may post the writes.  The
side effect is that this takes more CPU time for registers reads and
writes, especially to the framer registers.

It is never recommended to run with pedanticpci set to 0, so I'm
removing it as a module parameter so that the default case does not take
a performance hit checking for whether the parameter is set or not.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10233 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:14 +00:00
Shaun Ruffell
2c4dad3c58 wct4xxp: Remove some debug information from the kernel logs.
Also has the nice side effect of eliminating a comparison from the
interrupt handler.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10232 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:10 +00:00
Shaun Ruffell
2c341b481e wct4xxp: Slow down the rate we poll the framers in alarm.
The overhead of reading the framer registers is significant and can
result in latency bumps / data drops on heavily loaded systems.
Instead of checking all spans every millisecond when they are in
alarm we will instead only check every 100 ms.

On one test system, dropped the % CPU time spent in hard interrupt
context from 10% per TDM4XX when all four spans are in alarm to
closer to 2%.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10231 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:06 +00:00
Shaun Ruffell
9c8eb34337 wct4xxp: Move "hardware DTMF disabled" message from dev_notice -> dev_info
This is the "normal" condition and can be lumped with the other
informational messages. Otherwise, just this one message might go to the
console depending on the system configuration which can be confusing.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10230 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:01 +00:00
Shaun Ruffell
ae2785e0e7 wct4xxp: Fix condition where hardware echo canceler erroneously mutes DTMF.
Commit r9750 "wct4xxp: Reduce the memory footprint of the hardware
echocanceler.", as part of reducing the non-pageable memory required to
support the VPMOCT064 and VPMOCT128, disabled caching of some hardware
echocan registers. This resulted in more physical reads to the echo
canceler. These new read transactions exposed an existing issue where
sometimes reads could be turned into writes which put a channel into an
unintended state preventing Asterisk from detecting any DTMF.

This issue is resolved by ensuring that the write signal to the Octasic
part is explicitly cleared between when the address is presented on the
bus and when the read and chip select signals are asserted. The cost is
an increase in the average time to enable / disable echo cancellation by
about 5 us on one Intel Xeon X3220 test machine (~250ns increase per
read from the Octasic part and 20 reads to enable / disable a channel).

This commit resolves a behavioral regression first introduced in 2.5.0
and 2.4.1 which could take many calls before revealing itself. This
change only affects cards with a VPMOCT128 or VPMOCT064 installed.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10220 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-12 16:12:33 +00:00
Shaun Ruffell
dfab257fef wct4xxp: Remove unused t4_span.psync and t4_span.redalarms.
These members are not used anywhere and are now gone.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10204 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-23 20:18:29 +00:00
Russ Meyerriecks
3b20fe39af wct4xxp: Bug in timing cable with different span density cards
The logic loops through the static cards[] array to determine timing,
    but the subloop was based off the current card's numspans member.
    This could cause a null dereference in the case where two cards of
    different span densities were connected via timing cables.

Reported-by: Doug Bailey <dbailey@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10140 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-15 21:57:49 +00:00
Russ Meyerriecks
0fa8ec572b wct4xxp: Fixed a bug where it sent loopdown signals forever
The wct4xxp driver was resetting it's maint state to NONE prematurely.

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@10063 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 21:32:09 +00:00
Shaun Ruffell
91da279443 wct4xxp: Fix compilation when VPM_SUPPORT is not defined.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10061 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 17:24:31 +00:00
Shaun Ruffell
bee7c5e579 wct4xxp: Add module parameter to ignore rotary switch settings.
The dual and quad span cards have a rotary switch onboard which controls
the order that cards serviced by this driver are registered with the
core of DAHDI. This commit adds a module parameter 'ignore_rotary'
which, when set to 1, causes the driver to ignore the position of the
rotary switch and only consider the physical slot when registering with
DAHDI.

Ignoring the rotary switch settings also permits the PCI device to be
bound and unbound from the driver at runtime since registration with
DAHDI no longer only happens when the module is first initialized.

By default, the rotary switch will still be used to determine
registration order. This commit does not change the default behavior.

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

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

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

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

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

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9933 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:01:00 +00:00