dahdi/linux.git
4 years agowctc4xxp: Trivial fix typo that was preventing firmware load.
Shaun Ruffell [Mon, 2 Jun 2014 11:08:08 +0000 (06:08 -0500)]
wctc4xxp: Trivial fix typo that was preventing firmware load.

The interrupt handler was not schedulding the deferred processing routine when
there was packets to process. I did not test the actual master branch after
editing for checkpatch compliance. Sorry.

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

4 years agowctc4xxp: Prevent exhausting memory in firmware.
Shaun Ruffell [Thu, 29 May 2014 20:53:45 +0000 (15:53 -0500)]
wctc4xxp: Prevent exhausting memory in firmware.

If the host system sends to many packets to the DTE to process, the on-card
memory can be exhausted which will result in an out of memory alert. In commit
2ac233824705e2f5f1cf67b6b22459fa20e9aa4c, the driver will halt all communication
with the card and request a reload if any alert is received.

Now the driver will silently drop any "burst" traffic that was sent to the
transcoder as opposed to expecting the firmware to do it. There is currently a
limit of 640 samples (80ms of audio) in flight to the firmware at any one time
allowed.

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

4 years agowctc4xxp: Service tx ring in interrupt handler.
Shaun Ruffell [Thu, 29 May 2014 19:43:24 +0000 (14:43 -0500)]
wctc4xxp: Service tx ring in interrupt handler.

This helps to keep the tx descriptor ring at max capacity when the system is
otherwise loaded. Now ready packets are moved from cmd_list to the transmit
descriptor ring directly in the interrupt handler and not when the deferred
function runs.

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

4 years agowctc4xxp: Fix the timestamp calculation for the RTP stream.
Shaun Ruffell [Thu, 29 May 2014 18:02:25 +0000 (13:02 -0500)]
wctc4xxp: Fix the timestamp calculation for the RTP stream.

I do not have any evidence that this made a difference, but hopefully it will
clear things up for people in the future who might be wondering why the
timestamp does not increase with the number of samples actually sent.

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

4 years agowctc4xxp: Speed up the rate of polling.
Shaun Ruffell [Thu, 29 May 2014 12:40:48 +0000 (07:40 -0500)]
wctc4xxp: Speed up the rate of polling.

The polling interval was not fast enough to keep the tx ring full on a loaded
card. This fixes a regression introduced in commits
ba05e31c8a786d7524fd1aed47feda27331606dd and
354d88cd418627285e86e77cceb9318e33f0348c.

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

4 years agowctc4xxp: Handle all known interrupts regardless of mask.
Shaun Ruffell [Fri, 16 May 2014 06:47:13 +0000 (01:47 -0500)]
wctc4xxp: Handle all known interrupts regardless of mask.

When switching to polling mode it was possible that we would mask off the
receive complete interrupt until the next timer fired. Now go ahead and handle
anything we know how to handle regardless of the current mask.

Also, no need to update the reg local anymore since it isn't used to ack any
interrupts. We now always ack all the interrupts first and inspect them all.

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

4 years agoxpp: re-organize calls so worker_reset()
Oron Peled [Mon, 12 May 2014 15:36:16 +0000 (11:36 -0400)]
xpp: re-organize calls so worker_reset()

re-organize calls so worker_reset() isn't called twice
(was called from xbus_disconnect() and worker_destroy())

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

4 years agoxpp: demote some NOTICE() to DBG()
Oron Peled [Mon, 12 May 2014 15:36:16 +0000 (11:36 -0400)]
xpp: demote some NOTICE() to DBG()

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

4 years agoxpp: stability -- better xbus shut down
Oron Peled [Mon, 12 May 2014 14:51:59 +0000 (10:51 -0400)]
xpp: stability -- better xbus shut down

* Maintain a "shutting_down" flag per-xbus
* Use it to prevent xbus dereferencing (via xbus_get()/xbus_put())
  during an xbus shutdown.
* Also, remove xbus from global array earlier.

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

4 years agoxpp: stability -- deadlock in waitfor_xpds()
Oron Peled [Mon, 12 May 2014 14:10:50 +0000 (10:10 -0400)]
xpp: stability -- deadlock in waitfor_xpds()

waitfor_xpds xbus sysfs file should not take an xbus refcount:

* It is called from sysfs which maintain its own device refcount.
* If put_xbus() calls xbus_destroy() than down the call chain it will
  try to release an object that is held by sysfs.
* This will create a deadlock.

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

4 years agoxpp: stability -- better debug information
Oron Peled [Mon, 12 May 2014 14:09:22 +0000 (10:09 -0400)]
xpp: stability -- better debug information

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

4 years agoxpp: stability -- cleaner xpp_open/close
Oron Peled [Mon, 12 May 2014 14:04:28 +0000 (10:04 -0400)]
xpp: stability -- cleaner xpp_open/close

 * No need to use spinlock.
 * Just correctly use the atomic open_counter.

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

4 years agoxpp: stability fixes - xusb mutex
Oron Peled [Mon, 12 May 2014 14:02:35 +0000 (10:02 -0400)]
xpp: stability fixes - xusb mutex

 * Replace old semaphore with mutex
 * Use this mutex for BOTH usb probe/disconnect

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

4 years agowctc4xxp: Speed up channel setup / tear-down.
Shaun Ruffell [Fri, 16 May 2014 19:33:12 +0000 (14:33 -0500)]
wctc4xxp: Speed up channel setup / tear-down.

1) Enabling multiple csm_encaps channel commands in a single packet.
2) Sending commands to separate channels in parallel.

This reduces the time waiting for the responses to the commands and brings in
the channel setup from 50ms to under 10ms.

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

4 years agopciradio: interruptible_sleep_on_timeout() -> msleep_interruptible()
Shaun Ruffell [Sun, 18 May 2014 07:49:30 +0000 (02:49 -0500)]
pciradio: interruptible_sleep_on_timeout() -> msleep_interruptible()

interruptible_sleep_on_timeout() has been deprecated for awhile and was finally
removed in Linux 3.15. Since interruptible_sleep_on_timeout() uses jiffies for
the delay, I assumed that each jiffy equated to 10ms given the age of the
driver.

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

4 years agoAdd #include <linux/slab.h> to all files that call kzalloc|kmalloc|kfree.
Shaun Ruffell [Fri, 28 Feb 2014 15:28:46 +0000 (09:28 -0600)]
Add #include <linux/slab.h> to all files that call kzalloc|kmalloc|kfree.

Some architectures, like arm, do not automatically pull in the definitions for
kzalloc and friends. This allows DAHDI to build on those platforms.

Originally reported to the asterisk-users mailing list here
http://lists.digium.com/pipermail/asterisk-users/2014-February/282338.html

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

4 years agowctc4xxp: Add debug option to print channel stats to kernel log.
Shaun Ruffell [Tue, 11 Feb 2014 05:41:12 +0000 (23:41 -0600)]
wctc4xxp: Add debug option to print channel stats to kernel log.

This patch does a couple of things. It adds a new DEBUG mode where packet
statistics are printed when channels are closed which can be used to track where
packets might be lost in the transcoding chain.

This patch will also print to the kernel log if the AN983 has detected any
errored received packets. Problems of this type are typically system problems,
like when the card is having trouble DMAing packets.

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

4 years agowctc4xxp: Allow the tx and rx descriptor rings to be different sizes
Shaun Ruffell [Thu, 8 May 2014 18:40:45 +0000 (13:40 -0500)]
wctc4xxp: Allow the tx and rx descriptor rings to be different sizes

Keeping the transmit descriptor ring shorter reduces the time it takes to send
CSM_ENCAP commands to the transcoding engine when the card is otherwise busy.

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

4 years agowctc4xxp: channel count does not need to be atomic.
Shaun Ruffell [Fri, 9 May 2014 21:09:41 +0000 (16:09 -0500)]
wctc4xxp: channel count does not need to be atomic.

It is only modified under the chanlock anyway.

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

4 years agowctc4xxp: Use hardware timer for polling and not kernel timer
Shaun Ruffell [Fri, 9 May 2014 18:58:11 +0000 (13:58 -0500)]
wctc4xxp: Use hardware timer for polling and not kernel timer

Simplifies the logic when polling is enabled. No need to worry about any system
factors when scheduling the default kernel timer.

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

4 years agowctc4xxp: Make sure csm_encaps commands are sent before RTP.
Shaun Ruffell [Fri, 9 May 2014 14:46:26 +0000 (09:46 -0500)]
wctc4xxp: Make sure csm_encaps commands are sent before RTP.

Otherwise, if there are many RTP commands queued on the command list, some of
the CSM_ENCAP packets, like ACKS, weren't being sent to the firmware within the
timeout value.

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

4 years agowctc4xxp: Reduce the number of locks grabbed when sending commands
Shaun Ruffell [Fri, 9 May 2014 14:40:24 +0000 (09:40 -0500)]
wctc4xxp: Reduce the number of locks grabbed when sending commands

Not only does this make it atomic when moving commands from the
waiting_for_response_list to the command_list if the descriptor is full, it will
also make the entire process of submitting a packet the packet transmission
logic atomic.

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

4 years agowctc4xxp: Trivial removal of the receiveprep function.
Shaun Ruffell [Thu, 8 May 2014 21:45:36 +0000 (16:45 -0500)]
wctc4xxp: Trivial removal of the receiveprep function.

This was more a holdover when the AN983 interface was brought over from the
voicebus driver.

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

4 years agowctc4xxp: Cleanup RTP for unopened channels.
Shaun Ruffell [Thu, 8 May 2014 18:46:18 +0000 (13:46 -0500)]
wctc4xxp: Cleanup RTP for unopened channels.

When we start the shutdown sequence for a channel, there is no need to submit
any RTP packets that are queued on the command list. Under extreme load with
many backed up RTP packets it was possible to have RTP packets submitted after
the channel shutdown process started.

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

4 years agowctc4xxp: All the commands do not need to have completions embedded in them.
Shaun Ruffell [Tue, 6 May 2014 16:47:56 +0000 (11:47 -0500)]
wctc4xxp: All the commands do not need to have completions embedded in them.

A small percentage of the total packets sent to the DTE ever wait for
completions. This will save on the need to keep the completion around in all the
packets.

Also, since we can use the presence of the completion as the flag whether we
intend to auto free, we can simplify the flags as well.

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

4 years agowctc4xxp: Encode the function in the ACK.
Shaun Ruffell [Mon, 5 May 2014 19:47:44 +0000 (14:47 -0500)]
wctc4xxp: Encode the function in the ACK.

While not required by the protocol to the DTE, this does help when debugging the
trace files.

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

4 years agowctc4xxp: We always want to ack the responses.
Shaun Ruffell [Mon, 5 May 2014 19:10:57 +0000 (14:10 -0500)]
wctc4xxp: We always want to ack the responses.

Furthermore, do it as soon as we know we should to prevent the ack from
potentially going out after another CSM_ENCAPS packet on another CPU.

Previously, we would not send ACKS to responses we believed we already responded
to.

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

4 years agowctc4xxp: Only capture commands once they are on the descriptor ring.
Shaun Ruffell [Mon, 5 May 2014 18:54:47 +0000 (13:54 -0500)]
wctc4xxp: Only capture commands once they are on the descriptor ring.

Eliminates some cases where there are duplicated packets in the capture if the
hardware descriptor ring was already full.

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

4 years agowctc4xxp: Do not allow duplicated sequence numbers to be received for the channels.
Shaun Ruffell [Mon, 5 May 2014 17:08:20 +0000 (12:08 -0500)]
wctc4xxp: Do not allow duplicated sequence numbers to be received for the channels.

Makes the channels themselves behave like the supervisor channel. This only
protects the driver in the case the commands were severly backed up, like when
there was high packet loss.

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

4 years agowctc4xxp: Do not need locks on the transcoder buffers.
Shaun Ruffell [Sat, 3 May 2014 01:37:51 +0000 (20:37 -0500)]
wctc4xxp: Do not need locks on the transcoder buffers.

They are sufficiently protected by the list locks. This also cleans up a case
where the tcp was unlocked after already completing it, which was corrupting the
list.

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

4 years agowctc4xxp: Check for shutdown after acquiring the mutex lock.
Shaun Ruffell [Fri, 2 May 2014 16:07:56 +0000 (11:07 -0500)]
wctc4xxp: Check for shutdown after acquiring the mutex lock.

In case we missed an alert, this will allow for rapid shutdown of Asterisk.

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

4 years agowctc4xxp: Always ack a response packet.
Shaun Ruffell [Fri, 2 May 2014 16:04:48 +0000 (11:04 -0500)]
wctc4xxp: Always ack a response packet.

Even if it is duplicated or we don't have an outbound message waiting, we should
ack it so that the firmware does not keep trying to send it to the host.
Otherwise the firmware could get into situations where it was constantly
retrying to send packets for which it did not receive our previous ACK and
exhaust memory.

I was only seeing this on platforms were packets were going missing in the
stream, increasing the probability that the driver would miss early responses.

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

4 years agowctc4xxp: Enable the fatal bus error interrupt.
Shaun Ruffell [Fri, 2 May 2014 15:48:30 +0000 (10:48 -0500)]
wctc4xxp: Enable the fatal bus error interrupt.

The kernel log will now contain reports if there are bus errors.
This is a troubleshooting aide on systems with bus issues.

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

4 years agowctc4xxp: Replace channel semaphore with channel mutex.
Shaun Ruffell [Fri, 2 May 2014 15:44:17 +0000 (10:44 -0500)]
wctc4xxp: Replace channel semaphore with channel mutex.

Clarifies that the semaphore was being used as a mutex. Mutexes are also more
efficient and allow better debugging checks.

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

4 years agowctc4xxp: Remove unused debug ioctl interface.
Shaun Ruffell [Fri, 2 May 2014 15:39:47 +0000 (10:39 -0500)]
wctc4xxp: Remove unused debug ioctl interface.

The ioctls for the debug network interface on the tc400b0 has not been used for
a long time. It is now gone.

This will also allow the sempahore set in the ioctl to be changed into a mutex
which provides enhanced debugging checks.

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

4 years agowctc4xxp: Halt the card when an alert is received.
Shaun Ruffell [Thu, 1 May 2014 15:10:19 +0000 (10:10 -0500)]
wctc4xxp: Halt the card when an alert is received.

When an unsolicited alert is received, we'll flag the card as halted so that
commands will not be retried. This is because often times the firmware will no
longer process any commands in this state and the driver will hold processes in
the dstate while waiting to retry the commands.

This is a debugging aide in that it simplies unloading the driver if the card /
driver is currently in a failed state.

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

4 years agowctc4xxp: Disable read-line and read-line-multiple PCI commands.
Shaun Ruffell [Thu, 15 May 2014 18:27:28 +0000 (13:27 -0500)]
wctc4xxp: Disable read-line and read-line-multiple PCI commands.

The read-line-multiple command was already disabled on the voicebus cards, which
use the same interface, in commit 4de462c3e014c612b2aa5bbf7f056c747eb01687. This
does the same thing for the transcoder card and also disables the read line
command.

I've seen this change directly correlated to problems with the AN983 receiving
packets from the onboard DSP on some platforms.

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

4 years agowctc4xxp: Make sure we call the pci_enable_mwi() function.
Shaun Ruffell [Thu, 15 May 2014 17:39:38 +0000 (12:39 -0500)]
wctc4xxp: Make sure we call the pci_enable_mwi() function.

I've not seen this directly tied to any issue, but it's enabled on the voicebus
cards and so brings the wctc4xxp driver in line.

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

4 years agoxpp: pri: Fix more than a single CAS/R2 call
Tzafrir Cohen [Sun, 27 Apr 2014 12:21:00 +0000 (15:21 +0300)]
xpp: pri: Fix more than a single CAS/R2 call

Fixes regression from bb63d03bbad48f798177dfce62a1ee392d736c57 (before
v2.7.0). This failed to set the PCM mask on a CAS span when
DAHDI_AUDIO_NOTIFY was not set.

As the first channel of each xbus would be enabled (for
synchronization), a single call may still have passed.

This patch sets the PCM mask on any CAS channel explicitly.

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

4 years agoxpp: prevent double dahdi un-registration
Oron Peled [Sun, 6 Apr 2014 18:01:55 +0000 (14:01 -0400)]
xpp: prevent double dahdi un-registration

* It's currently harmless (just re-run the pre/post XPD registrations)
* But it's cleaner this way (as with xbus_register_dahdi_device())

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

4 years agoxpp: new xbus attribute: dahdi_registration
Oron Peled [Mon, 17 Mar 2014 16:35:39 +0000 (12:35 -0400)]
xpp: new xbus attribute: dahdi_registration

XPP devices have implicit support for device registration and
unregistration. Even though it is only used for the legacy (non-hotplug)
configuration case, we still prefer to make it explicit.

This attribute would later allow a simpler implementation of the user
space (xpp-specific) tool dahdi_registration.

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

4 years agoxpp: fix failed multi-PRI E1<->T1 transition
Oron Peled [Mon, 7 Apr 2014 11:05:50 +0000 (07:05 -0400)]
xpp: fix failed multi-PRI E1<->T1 transition

In an Astribank with >= 2 PRI ports, switching from E1 to T1 at run-time
may fail at the DAHDI_CHANCONFIG ioctl on the first channel in a span,
That is, on first run of dahdi_cfg, it fails on second span, on second:
it fails on third span, etc.

The code clears the D-channel information on the DAHDI_CHANCONFIG call
for the first channel in the span.

However The code tested for the global "channo" rather than the per-span
"chanpos" to check for the first channel in the span. This the test
failed.

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

4 years agoDon't install firmware to /usr/lib/hotplug/firmware
Tzafrir Cohen [Tue, 1 Apr 2014 13:45:09 +0000 (16:45 +0300)]
Don't install firmware to /usr/lib/hotplug/firmware

/usr/lib/hotplug/firmware is an old location not used since the move
from the old hotplug system. We no longer need to support it. No need to
keep two copies of the firmware files.

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

4 years agowcte43x: Build against 2.6.18 and CentOS 5.5
Shaun Ruffell [Wed, 30 Apr 2014 18:32:58 +0000 (13:32 -0500)]
wcte43x: Build against 2.6.18 and CentOS 5.5

This is to support users who are unable to update to the lastest CentOS 5.x.
There is no change for most users on the latest releases of their distribution.

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

4 years agowcte43x: Trivial fix of 'source' in comment.
Shaun Ruffell [Wed, 30 Apr 2014 16:45:00 +0000 (11:45 -0500)]
wcte43x: Trivial fix of 'source' in comment.

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

4 years agowctc4xxp: Trivial. Remove unused timer_list from struct tcb.
Shaun Ruffell [Fri, 14 Feb 2014 17:24:27 +0000 (11:24 -0600)]
wctc4xxp: Trivial. Remove unused timer_list from struct tcb.

The timer_list member of the transcoder buffer has not been used for a long
time. Saves some space in the buffer in addition to removing any future
curiosity about what it is for.

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

4 years agodahdi: Define pf_fmt() globally in kernel.h
Shaun Ruffell [Sat, 5 Apr 2014 16:50:22 +0000 (11:50 -0500)]
dahdi: Define pf_fmt() globally in kernel.h

Normally the board drivers should define this, but if they do not we will
provide a suitable default. This allows compilation with vanilla Linux 2.6.18.

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

5 years agowcte43xp: Close potential unbalanced call to enable_irq().
Shaun Ruffell [Tue, 1 Apr 2014 16:53:00 +0000 (11:53 -0500)]
wcte43xp: Close potential unbalanced call to enable_irq().

If the memory allocation for the new channel array fails, it would be possible
to call enable_irq() without the corresponding call to disable_irq().

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

5 years agowcte13xp: Remove redundant call to synchronize_irq().
Shaun Ruffell [Tue, 1 Apr 2014 16:46:46 +0000 (11:46 -0500)]
wcte13xp: Remove redundant call to synchronize_irq().

disable_irq() already synchronizes with any running handlers.

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

5 years agowcte13xp: Trivial. Remove duplicate pointer to "struct pci_dev".
Shaun Ruffell [Tue, 1 Apr 2014 15:45:36 +0000 (10:45 -0500)]
wcte13xp: Trivial. Remove duplicate pointer to "struct pci_dev".

This pointer was left over during the switch to the wcxb library.

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

5 years agofirmware: Honor DESTDIR when installing firmware. v2.9.1.1
Tzafrir Cohen [Sun, 30 Mar 2014 16:55:17 +0000 (19:55 +0300)]
firmware: Honor DESTDIR when installing firmware.

This fixes a regression introduced first in release 2.9.1 with commit
(7ce849846502ff9d "firmware: Refactor by using build_tools/install_firmware.")
which prevents from installing the firmware in a location other than the system
root.

Bug: https://issues.asterisk.org/jira/browse/DAHLIN-337
Reported-by: Anthony Messina <amessina@messinet.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
[edited the commit message]
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

5 years agoxpp: fix PANIC for old dahdi_registration v2.9.1 v2.9.1-rc2
Oron Peled [Mon, 17 Mar 2014 15:55:29 +0000 (11:55 -0400)]
xpp: fix PANIC for old dahdi_registration

* dahdi_registration writes multiple times to:
     /sys/bus/astribanks/devices/*/*/span
* In some race cases this resulted in corruption and eventual kernel
  panic.
* Until migration to "assigned-spans" is complete:
  - Accept and ignore multiple "dahdi registrations" from user-space.

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

5 years agowcxb: Disable presence detect reporting on upstream port during PCIe hard reset. v2.9.1-rc1
Shaun Ruffell [Wed, 19 Mar 2014 20:15:11 +0000 (15:15 -0500)]
wcxb: Disable presence detect reporting on upstream port during PCIe hard reset.

When the card goes through a reset the PCIe link will be brought down. Some
slots will report this change upstream to the root port which will believe that
the card has been hotplugged out of the system.

This fixes cases on some systems where, during a firmware update, the card gets
removed from the system's logical PCI tree with messages like the following in
the kernel log:

  pciehp 0000:00:1c.0:pcie04: Card not present on Slot(259)
  pciehp 0000:00:1c.0:pcie04: Card present on Slot(259)

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

5 years agowcte43x: Update firmware for TE435 / TE235 to e0019.
Shaun Ruffell [Mon, 17 Mar 2014 16:58:49 +0000 (11:58 -0500)]
wcte43x: Update firmware for TE435 / TE235 to e0019.

This firmware image is able to handle system conditions that would result in
spans internmittenly going down and recovering.

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

5 years agowcaxx: Update firmware for A8B/A4B to 1d0019/b0019.
Shaun Ruffell [Mon, 17 Mar 2014 16:54:27 +0000 (11:54 -0500)]
wcaxx: Update firmware for A8B/A4B to 1d0019/b0019.

These firmware images can handle system conditions that would previously result
in transmitted audio being intermittently silenced and then unsilenced.

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

5 years agowcte13xp: Update firmware for TE133/TE131 to 780019
Shaun Ruffell [Wed, 12 Mar 2014 04:58:11 +0000 (23:58 -0500)]
wcte13xp: Update firmware for TE133/TE131 to 780019

This firmware image is able to handle system conditions that would result in
spans going down and then coming back intermittently.

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

5 years agowcxb: Add diagnostic message if DMA retries are increasing when DEBUG is defined.
Shaun Ruffell [Thu, 13 Mar 2014 06:37:51 +0000 (01:37 -0500)]
wcxb: Add diagnostic message if DMA retries are increasing when DEBUG is defined.

There are some platforms where the DMA operation to the host does not complete
within the required 50us. When this happens some versions of the firmware will
issue a retry and increment the retry field in the descriptor status word.

Now if this driver is configured in DEBUG mode, the presence of these retries
will be printed to the kernel log as a potential troubleshooting aide.

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

5 years agowcxb: Reset TDM engine on IO errors.
Shaun Ruffell [Wed, 12 Mar 2014 04:41:44 +0000 (23:41 -0500)]
wcxb: Reset TDM engine on IO errors.

There are error conditions that the firmware can detect but cannot recover from
without help from the driver. When firmware detects these conditions the
DESC_IO_ERROR bit will be set in the descriptor header to signal that the driver
should reset the TDM engine on the card. Since this is not due to failure of the
host to service the interrupt in time, it does not make sense to increase
latency when these conditions are detected.

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

5 years agowcxb: Print running version when recommending power cycle.
Shaun Ruffell [Wed, 12 Mar 2014 05:46:02 +0000 (00:46 -0500)]
wcxb: Print running version when recommending power cycle.

Without this change it's hard to see what is actually running on the card when
the firmware in the flash doesn't match the reported version. This is a
debugging aide.

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

5 years agobuild_tools/install_firwmare: Try to extract the .bin file from .tar.gz
Shaun Ruffell [Thu, 13 Mar 2014 04:01:47 +0000 (23:01 -0500)]
build_tools/install_firwmare: Try to extract the .bin file from .tar.gz

This allows a .tar.gz file that is normally downloaded from the server to be
checked directly into a test branch. Now when the firmware is being installed,
it can be extracted from any present .tar.gz.  Again, this is primarily to
simplify testing.

A nice side effect is that when going from a newer version to an older version,
any stale .bin files in the firmware directory will not be installed into
/lib/firmware, but instead the bin file from the *versioned* .tar.gz will always
be installed. This should reduce problems where you have to run "make
dist-clean" when reverting to an older version that has a firmware change.

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

5 years agofirmware: Refactor by using build_tools/install_firmware.
Shaun Ruffell [Wed, 12 Mar 2014 20:35:51 +0000 (15:35 -0500)]
firmware: Refactor by using build_tools/install_firmware.

This is intended to simplify the Makefile and move a large common part into a
subscript. The behavior is the same as it was before.

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

5 years agoxpp: PRI stability fixes
Oron Peled [Sun, 29 Dec 2013 18:43:14 +0000 (13:43 -0500)]
xpp: PRI stability fixes

* We didn't handle proper E1/T1 transitions after device registration.

* Fix SPAN_REGISTERED(xpd):
  It now checks for DAHDI_FLAGBIT_REGISTERED as well, as this flag is
  set/clear by assign/unassign.

* From set_pri_proto():
  - Always free/allocate channels
  - Always call dahdi_init_span()

* Improve phonedev_cleanup() safety:
  - NULL pointers after free.
  - Zero number of channels at the end.

* Refactor channel allocation out of phonedev_init():
  - Into phonedev_alloc_channels()
  - Also called from xpd_init_span() to prevent duplicated logic.
  - And called from set_pri_proto() to prevent our bug.

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

5 years agodahdi_get_auto_assigned_spans
Tzafrir Cohen [Tue, 28 Jan 2014 19:27:50 +0000 (21:27 +0200)]
dahdi_get_auto_assigned_spans

Commit 74e949c33aeb6cf2cf2c33364e12b227c4579ca7 exported the module
variable dahdi.auto_assigned_spans. However this is not a good name.

This commit reverts the export and replaces it with a new function to
get the value of the variable.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agosysfs: registration_time: use ktime_get_ts v2.9.0 v2.9.0-rc2
Tzafrir Cohen [Tue, 28 Jan 2014 18:39:21 +0000 (20:39 +0200)]
sysfs: registration_time: use ktime_get_ts

A fix to 03b3ce1a107c4926038931b38894290c074d9e5f: use ktime_get_ts
instead of getnstimeofday to better handle system time changes.
(Shaun Ruffell)

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

5 years agoREADME: The sysfs class now includes no channels
Tzafrir Cohen [Tue, 28 Jan 2014 18:24:40 +0000 (20:24 +0200)]
README: The sysfs class now includes no channels

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

5 years agoREADME: the new registration_time device attribute
Tzafrir Cohen [Tue, 28 Jan 2014 18:17:26 +0000 (20:17 +0200)]
README: the new registration_time device attribute

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

5 years agosysfs: new device attribute: registration_time
Oron Peled [Sun, 26 Jan 2014 15:27:49 +0000 (17:27 +0200)]
sysfs: new device attribute: registration_time

Add a new sysfs attribute to dahdi_device: registration_time

* Records the time of the device's registration with DAHDI.
* Used by dahdi_auto_assign_compat to assign spans by device
  registration order when backward compatibility needed.

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

5 years agoREADME: xpp.dahdi_autoreg is deprecated
Tzafrir Cohen [Tue, 28 Jan 2014 14:37:04 +0000 (16:37 +0200)]
README: xpp.dahdi_autoreg is deprecated

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoxpp: continue xpp.dahdi_autoreg deprecation
Oron Peled [Sun, 26 Jan 2014 14:11:01 +0000 (16:11 +0200)]
xpp: continue xpp.dahdi_autoreg deprecation

* Set it to 0 by default (as we use dahdi.auto_assign_spans now)
* Make it readonly (no runtime changes)
* Warn during startup if it was forced to 1

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agoxpp: deprecate dahdi_autoreg
Oron Peled [Sun, 26 Jan 2014 14:11:00 +0000 (16:11 +0200)]
xpp: deprecate dahdi_autoreg

Instead, use the inverse of dahdi.auto_assign_spans value.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agowcte13xp: wcxb: Add delayed reset firmware feature v2.9.0-rc1
Russ Meyerriecks [Wed, 11 Dec 2013 22:46:36 +0000 (16:46 -0600)]
wcte13xp: wcxb: Add delayed reset firmware feature

Allow certain older firmwares to delay the hard reset until a full power cycle.
This way we can "preload" newer firmware images, without requiring the user to
physically power off/on their machine.

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

5 years agowcte43x, wcte13xp, wcaxx: Bump irqmisses counter when there are DMA underruns.
Shaun Ruffell [Wed, 22 Jan 2014 18:24:04 +0000 (12:24 -0600)]
wcte43x, wcte13xp, wcaxx: Bump irqmisses counter when there are DMA underruns.

This makes the behavior of IRQ misses for these drivers behave the same as the
wcte12xp, wctdm24xxp, and wct4xxp drivers.

Previously irqmisses would never increase. The presence of underruns would still
show up in dmesg as latency bumps.

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

5 years agowct4xxp: Trivial drop of unnecessary local variables.
Shaun Ruffell [Mon, 13 Jan 2014 18:58:36 +0000 (12:58 -0600)]
wct4xxp: Trivial drop of unnecessary local variables.

These were left over from when the VPM callbacks depended on the different VPM
installed. On the wcte43x this is unnecessary.

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

5 years agowcte43x: Trivial drop of unnecessary local variables.
Shaun Ruffell [Mon, 13 Jan 2014 18:58:36 +0000 (12:58 -0600)]
wcte43x: Trivial drop of unnecessary local variables.

These were left over from when the VPM callbacks depended on the different VPM
installed. On the wcte43x this is unnecessary.

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

5 years agowcte13xp: wcaxx: wcte43x: Remove VPM_SUPPORT compile option.
Russ Meyerriecks [Tue, 17 Dec 2013 23:20:28 +0000 (17:20 -0600)]
wcte13xp: wcaxx: wcte43x: Remove VPM_SUPPORT compile option.

This was a legacy compile time option that is no longer necessary with the new
series of cards.

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

5 years agoRevert "dahdi: Change auto_assign_spans default from 1 to 0."
Russ Meyerriecks [Tue, 21 Jan 2014 22:36:44 +0000 (16:36 -0600)]
Revert "dahdi: Change auto_assign_spans default from 1 to 0."

This reverts commit c49a56c954616d64b3596f2020714db77c98dffd.

Delaying this feature until after v2.9 release.

5 years agowcte13xp: Add support for te131 and te132 products
Russ Meyerriecks [Tue, 17 Dec 2013 21:51:13 +0000 (15:51 -0600)]
wcte13xp: Add support for te131 and te132 products

These are similar to te133 and te134 but without integrated echo cancel.

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

5 years agowcte13xp: Update firmware to 0x780017
Russ Meyerriecks [Tue, 17 Dec 2013 19:37:21 +0000 (13:37 -0600)]
wcte13xp: Update firmware to 0x780017

This firmware adds support for the te131 and te132 products.

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

5 years agowcte13xp: wcaxx: Fix broken devicetype attributes
Russ Meyerriecks [Tue, 17 Dec 2013 00:09:59 +0000 (18:09 -0600)]
wcte13xp: wcaxx: Fix broken devicetype attributes

struct dahdi_device.devicetype was set incorrectly in both drivers. This caused
the vpm module to not show up after the device name when reading this field
from a spanstat.

Reported-by: Charles Moye <cmoye@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agodahdi: Do not access invalid memory if invalid local span number is passed to spantyp...
Shaun Ruffell [Tue, 14 Jan 2014 21:13:28 +0000 (15:13 -0600)]
dahdi: Do not access invalid memory if invalid local span number is passed to spantype attribute.

This fixes potential kernel panic due to accessing invalid memory if passing
invalid local span number to 'spantype' attribute via sysfs.

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

5 years agowcte43x, wcte13xp: Use MSI interrupts if possible.
Shaun Ruffell [Tue, 7 Jan 2014 20:31:59 +0000 (14:31 -0600)]
wcte43x, wcte13xp: Use MSI interrupts if possible.

It was an oversight to prevent the wcte43x and wcte13xp drivers from using
Message Signaled interrupts during the switch to the wcxb library.

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

5 years agowcte13xp: Export max_latency module parameter.
Shaun Ruffell [Tue, 7 Jan 2014 20:14:39 +0000 (14:14 -0600)]
wcte13xp: Export max_latency module parameter.

wcte13xp now has a max_latency module parameter like the wcaxx and wcte43x
drivers.

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

5 years agowcaxx, wcte13xp, wcte43x: Honor max_latency module parameter.
Shaun Ruffell [Tue, 7 Jan 2014 20:10:56 +0000 (14:10 -0600)]
wcaxx, wcte13xp, wcte43x: Honor max_latency module parameter.

The wcxb library did not do actually use the max_latency member to limit the
maximum latency of the DMA engine.

Now it does.

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

5 years agodahdi: Change auto_assign_spans default from 1 to 0.
Shaun Ruffell [Mon, 6 Jan 2014 19:03:04 +0000 (13:03 -0600)]
dahdi: Change auto_assign_spans default from 1 to 0.

The infrastructure has been put in place in 2.8.0 for fully dynamic device and
span configuration. This will be the default mode in DAHDI-Linux 2.9.0.

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

5 years agodahdi: Move clearing of DAHDI_ALARM_NOTOPEN to __dahdi_assign_span().
Shaun Ruffell [Mon, 23 Dec 2013 21:55:36 +0000 (15:55 -0600)]
dahdi: Move clearing of DAHDI_ALARM_NOTOPEN to __dahdi_assign_span().

Previously this was in __dahdi_init_span(). The problem was that
__dahdi_init_span() was only called when a spans' line mode was being changed.
Therefore it was possible to unassign and resassign an analog span and leave it
stuck in the 'NOP' alarm state.

It also make the setting / clearing of DAHDI_ALARM_NOTOPEN symetrical about span
unassignment / assignment in addition to updating the alarm states on all the
channels on the span via the dahdi_alarm_notify() function.

This is a better version of commit 496f81777323d309bd5c32afc2186bdc0055e5be.

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

5 years agowctdm24xxp: Reset module specific type information on probe.
Shaun Ruffell [Fri, 20 Dec 2013 19:54:19 +0000 (13:54 -0600)]
wctdm24xxp: Reset module specific type information on probe.

This fixes an issue that affects TDM410 modules when there is not a module
installed in the first port, but there is an FXO module installed in the third
port.

When scaning for QRV modules in the first port, the 3rd port will have the
'hook' struct.qrv set to 0xff. When a QRV module is  not detected, that value
will be left, which then maps to an invalid state for both fxo.ring_state and
fxo.battery_state.

The result would be that FXO ports would fail to run the ring detector state
machine since it did not know what the current state was.

Now we'll just reset all the values in struct fxo or struct fxs to the expected
init state.

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

5 years agowcte13xp: Fix bug preventing recover timing from ever being set v2.8.0.1
Russ Meyerriecks [Thu, 19 Dec 2013 00:10:40 +0000 (18:10 -0600)]
wcte13xp: Fix bug preventing recover timing from ever being set

A bug introduced in v2.8.0 prevented the recover timing configuration from
being set properly on the hardware. This caused the card to never go into
recovered timing mode.

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

5 years agobuild_tools/dkms-helper: Helper script for DKMS integration.
Shaun Ruffell [Wed, 5 Jun 2013 22:31:02 +0000 (17:31 -0500)]
build_tools/dkms-helper: Helper script for DKMS integration.

DKMS (Dynamic Kernel Module Support) [1] provides a mechanism where kernel
modules can be automatically updated when a new kernel is booted.  This is a
simple helper script to automate the process of adding dahdi-linux to the local
DKMS system.

[1] http://linux.dell.com/dkms/

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

5 years agoxpp: Replace drv_attrs with drv_groups on kernels > 3.12 v2.8.0
Shaun Ruffell [Mon, 2 Dec 2013 05:10:15 +0000 (23:10 -0600)]
xpp: Replace drv_attrs with drv_groups on kernels > 3.12

drv_attrs was fully removed from the bus structure in upstream commit
e18945b159a1cdbc031f1d3b0b7e515a33bdcbf7 which was merged into 3.13.

This is necessary to compile against linux kernel version 3.13.

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

5 years agodahdi: Fix previous CentOS 6.5 commit. v2.8.0-rc4 v2.8.0-rc5
Shaun Ruffell [Mon, 2 Dec 2013 22:55:26 +0000 (16:55 -0600)]
dahdi: Fix previous CentOS 6.5 commit.

The previous commit from earlier today to fix the backport of PDE_DATA was
wrong in that it would not then process the other defines for older kernels if
it detected it was running on a redhat release.

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

5 years agoRevert "wcaxx: Use startup/shutdown callbacks to protect access to channel registers." v2.8.0-rc3
Shaun Ruffell [Mon, 2 Dec 2013 22:20:05 +0000 (16:20 -0600)]
Revert "wcaxx: Use startup/shutdown callbacks to protect access to channel registers."

This reverts commit 1cf7d9b08c892404791b25eff6a743af2a660428.

It turns out this change was not necessary.

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

5 years agodahdi: Replace drv_attr with drv_groups on kernels > 3.12.
Shaun Ruffell [Mon, 2 Dec 2013 05:10:15 +0000 (23:10 -0600)]
dahdi: Replace drv_attr with drv_groups on kernels > 3.12.

drv_attrs was fully removed from the bus structure in upstream commit
e18945b159a1cdbc031f1d3b0b7e515a33bdcbf7 which was merged into 3.13.

This is necessary to compile dahdi against linux version 3.13.

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

5 years agowcte43x: Update firmware to version e0017.
Shaun Ruffell [Mon, 2 Dec 2013 20:55:12 +0000 (14:55 -0600)]
wcte43x: Update firmware to version e0017.

This resolves issues where, when using internal timing, the first channel of
span 3 has occassional corrupted data in transmit stream.

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

5 years agowcaxx: Add extra dummy read when checking for single fxs modules.
Shaun Ruffell [Mon, 2 Dec 2013 20:43:46 +0000 (14:43 -0600)]
wcaxx: Add extra dummy read when checking for single fxs modules.

This extra read eliminates some problems with detecting certain S100M modules.
It is unclear at this time why it is necessary.

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

5 years agowcxb: Do not access cur_transfer/cur_msg outside of lock.
Shaun Ruffell [Mon, 2 Dec 2013 19:36:59 +0000 (13:36 -0600)]
wcxb: Do not access cur_transfer/cur_msg outside of lock.

The spi master cur_transfer and cur_msg should only be changed under the
spin_lock for the master. The result is that if running user space tools, like
fxstest, that check registers on the modules, it's possible to have a message
that was not yet complete flagged as completed which would result in a bad read.

This does not affect "normal" operation of the wcaxx driver since interrupts are
not enabled during module detection, and during normal operation all access to
the resgisters is done in the context of the interrupt handler. This would only
be an issue if the interrupt handler was running and register accesses are tried
in user space context on an SMP system.

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

5 years agoMakefile: new 'make-dist' target
Oron Peled [Mon, 25 Nov 2013 21:37:37 +0000 (23:37 +0200)]
Makefile: new 'make-dist' target

Creates a tar.gz:
* Identical results to the existing distributed tarballs
* Named "dahdi-linux-<version>.tar.gz"
* Only from committed files (uses git-archive)
* Adds a .version file

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

5 years agowcxb: is_pcie -> pci_is_pcie()
Shaun Ruffell [Sat, 30 Nov 2013 23:05:12 +0000 (17:05 -0600)]
wcxb: is_pcie -> pci_is_pcie()

is_pcie attribute was finally dropped from struct pci_dev in
upstream commit 115e3bc5e23e7ec3c85a2014bfa96c0ddd036083.

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

5 years agodahdi: CentOS 6.5 backported PDE_DATA definition.
Shaun Ruffell [Mon, 2 Dec 2013 01:57:44 +0000 (19:57 -0600)]
dahdi: CentOS 6.5 backported PDE_DATA definition.

This will fix the "error: redefinition of 'PDE_DATA'" error when compiling.

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

5 years agodahdi: Remove "ddev" symlink before unregistering the span device.
Shaun Ruffell [Fri, 29 Nov 2013 21:14:27 +0000 (15:14 -0600)]
dahdi: Remove "ddev" symlink before unregistering the span device.

This makes the order of operations for device removal symmetrical with those for
device addition. This change also eliminates the following warning when
unloading dahdi after dynamic spans have been created:

  ------------[ cut here ]------------
  WARNING: at /build/buildd/linux-3.2.0/fs/sysfs/inode.c:324 sysfs_hash_and_remove+0x92/0xa0()
  Hardware name: VirtualBox
  sysfs: can not remove 'ddev', no directory
  Modules linked in: dahdi_dynamic_loc(O-) dahdi_dynamic(O) dahdi(O) crc_ccitt
     hdlc_cisco hdlc vboxvideo(O) drm vboxsf(O) vesafb ppdev psmouse parport_pc
     serio_raw mac_hid vboxguest(O) nfsd nfs i2c_piix4 lockd fscache auth_rpcgss
     nfs_acl sunrpc ext2 lp parport e1000 [last unloaded: dahdi]
  Pid: 3533, comm: rmmod Tainted: G        W  O 3.2.0-56-generic-pae #86-Ubuntu
  Call Trace:
   [<c105ab42>] warn_slowpath_common+0x72/0xa0
   [<c11a7992>] ? sysfs_hash_and_remove+0x92/0xa0
   [<c11a7992>] ? sysfs_hash_and_remove+0x92/0xa0
   [<c105ac13>] warn_slowpath_fmt+0x33/0x40
   [<c11a7992>] sysfs_hash_and_remove+0x92/0xa0
   [<c1385427>] ? device_del+0x127/0x150
   [<c11a9bd0>] sysfs_remove_link+0x20/0x30
   [<d8a03fa3>] span_sysfs_remove+0xa3/0x170 [dahdi]
   [<c1036a88>] ? default_spin_lock_flags+0x8/0x10
   [<d89f7e5e>] _dahdi_unassign_span+0xae/0x210 [dahdi]
   [<c1053f6b>] ? __cond_resched+0x1b/0x30
   [<c15a9859>] ? _cond_resched+0x29/0x30
   [<d89f80a3>] dahdi_unregister_device+0xe3/0x190 [dahdi]
   [<d8936464>] dahdi_dynamic_unregister_driver+0x84/0x130 [dahdi_dynamic]
   [<d89284ed>] dahdi_dynamic_local_exit+0xd/0xb20 [dahdi_dynamic_loc]
   [<c1095995>] sys_delete_module+0x135/0x230
   [<c1110063>] ? pagetypeinfo_show.part.8+0x33/0x100
   [<c15b295f>] sysenter_do_call+0x12/0x28
  ---[ end trace b818e326720c8385 ]---

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

5 years agowctdm24xxp: Remove assigned callback.
Shaun Ruffell [Tue, 26 Nov 2013 16:41:44 +0000 (10:41 -0600)]
wctdm24xxp: Remove assigned callback.

For the spans exported by the wctdm24xxp, the channels are not going to change
after they are already registered.

This eliminates a problem when analog spans are unassigned/reassigned and the
not_ready goes negative, thereby causing many warnings in the kernel.

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