Commit Graph

568 Commits

Author SHA1 Message Date
Oron Peled
c4616c6c86 xpp: PRI: restore pri_protocol to R/W:
Restores the pri_protocol attribute of the XPD node in SysFS to be
writable. Fixes a minor regression from the pinned-spans fix, similar to
r10334.

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

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10347 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-29 23:38:30 +00:00
Oron Peled
244c9bd254 xpp: pri: fix RS1 init in E1 CAS mode
Force some reserved bits to really be 1 in E1 mode (otherwise
terrorists will win).

(Closes issue DAHLIN-264)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10346 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-29 23:37:33 +00:00
Oron Peled
cc7c73c4d8 xpp: fxs: demote SETPOLARITY message to DBG()
Signed-off-by: Oron Peled <oron.peled@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10345 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-29 23:36:17 +00:00
Tzafrir Cohen
66eb65dda7 xpp: increase command queue length to 1500
A length of 1000 commands is not enough is some cases with CAS.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10341 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-16 12:10:51 +00:00
Tzafrir Cohen
1372573e68 xpp: USB_FW rev 10085: fix regression from r10013
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10339 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-13 15:04:16 +00:00
Tzafrir Cohen
1e22667c31 xpp: PIC_TYPE_1 rev 9841: followup to r10013
An extra fix that was accidentally not included in r10013. Minor bug fixes.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10337 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-13 13:23:10 +00:00
Oron Peled
8bcab23272 xpp: silence some bad ioctl() reporting
Ignore some FXS-specific ioctl-s in xpd_pri.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10335 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-10 16:56:54 +00:00
Oron Peled
1a79cb4fdc xpp: restore backward compat dahdi_registration
This restores a somewhat limited functionality of the "span"
write interface in the SysFS node of the span, broken by the
pinned-spans code.

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

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

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

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

* Also, implemented new xbus_is_registered() function

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10334 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-10 16:56:29 +00:00
Shaun Ruffell
bc7c111d7e wctdm24xxp: Wait for background threads to complete on failed load.
Some of the VPM loading / probing threads use global system workqueues. They
might now be running when we abort early so we should wait for them to
complete their runs before freeing memory that may be in use.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10332 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-07 22:40:20 +00:00
Shaun Ruffell
4b58524565 dahdi: Unregister dahdi_device from sysfs if we fail to auto assign spans.
Otherwise, if the _dahdi_assign_span call fails, the dahdi_device will never
be removed from the dahdi_devices virtual bus and the board drivers will not
be reloadable.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10331 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-07 22:40:15 +00:00
Shaun Ruffell
6ed54cc7e3 dahdi: Fix typo in previous commit which forced some spans to always fail assignment.
I misssed a small typo in r10328 "Extra debugging aids and messages" that
would force any span that supports a hardware preechocan to always fail
assignment with -EFAULT.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10330 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-07 22:40:11 +00:00
Oron Peled
09e46f2213 Extra debugging aids and messages
* Added dahdi_dev_dbg() macro to print when we don't (yet)
  have a span number.
* Added a new debug category: DAHDI_DBG_ASSIGN
* Made sure error return code paths prints helpfull messages
* Promote error messages from INFO to NOTICE
* Change some errno values from EINVAL to EFAULT (internal
  errors not caused by user input)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10328 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-07 17:48:00 +00:00
Tzafrir Cohen
875c1ec3b6 bugfix: off-by-one in span assignment
The test in _check_spanno_and_basechan() was off by one
(used '<' instead of '<=')

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10327 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-07 17:33:25 +00:00
Tzafrir Cohen
382125f880 xpp: USB firmware r9964: minor bugfixes
USB_FW rev 9964: includes a few stability bugfixes.

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


git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10323 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-07 15:27:37 +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
Shaun Ruffell
f0c61c85b8 dahdi: First span registered becomes master by default.
r10205 "dahdi: Check for master in DAHDI_STARTUP / resolves MeetMe
regression." did not handle the case for the wcb4xxp driver since it
would set DAHDI_FLAG_RUNNING as part of the probe. Therefore, the
DAHDI_STARTUP ioctl was never processed for it, creating a situation
where audio is missing on channels that are conferenced with channels on
the BRI spans.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10304 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-02 19:46:18 +00:00
Tzafrir Cohen
0c89cad864 xpp: bugfix: clear NOTOPEN span alarm on assign
The NOTOPEN span alarm flag is set at span unassignment time.

* It needs to be cleared when the span is reassigned.
* That is: only if the span is actually connected.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10302 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-02 17:05:38 +00:00
Tzafrir Cohen
e74fb7d04d xpp: bugfix -- manage xpd refcount for EC module
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10301 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-02 14:19:14 +00:00
Tzafrir Cohen
c7228589a9 xpp: Adaptations for E-Main-3
* An xbus transport now have a "model_string" member
 * The xpp_usb driver fills this with "usb:<idVendor>/<idProduct>/<bcdDevice>"
 * It is passed via environment to the "init_card_<type>_<protocol>" scripts
 * The FXS script uses this to condition two registers according to
   the power supply model.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10300 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-02 14:08:12 +00:00
Tzafrir Cohen
6a1561b749 xpp: remove leftovers of old XPD_STATE method
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10299 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-02 14:07:43 +00:00
Shaun Ruffell
ce261cd03a wctdm24xxp, wcte12xp: Allow VPMADT032 commands more time to complete.
Since "wctdm24xxp: Probe for and configure modules in parallel." the
check for the VPMADT032 module was moved closer to after when the
interface was initialized. The 200ms timeout did not provide enough
time for the system to settle out after initial start. The result
was that sometimes after a cold boot the driver would fail to detect
any VPMADT032 modules.

This fixes a race condition that is not in any released branches.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10296 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-01 20:35:20 +00:00
Doug Bailey
a054cddc09 wctdm24xxp, wcte12xp: Update VPMOCT032 firmware to 1.12.0.
- Cleaned up the OCT6114 interface .
- Relaxed the timeout waiting for OCT6114 bus cycle completion to 100 mS
  and added a 2 mS delay time from OCT6114 reset to initialization.

This change only addresses issues that were created in the lab and not in the
field.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10295 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-01 20:35:15 +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
Oron Peled
d556a1a57a xpp: cleanup some printk()'s
* Also demote them to DBG()

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10287 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:09:09 +00:00
Oron Peled
3fc23b4465 added 'basechan' and 'channels' attributes to spans
* So we can:
   - Generate 'pinned-spans.conf' from existing state
   - Run dahdi_cfg from udev (on specific span + its channels)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10286 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:08:33 +00:00
Oron Peled
4d10eab759 dahdi: Give userspace a chance to respond to surprise removal.
* We try very hard to help asterisk understand that we unassign spans.

 * Implement disable_span():
   - Set span + channels to DAHDI_ALARM_NOTOPEN
   - qevent DAHDI_EVENT_REMOVED

 * Use disable_span():
   - in dahdi_unassign_span() and dahdi_unregister_device()
   - with long msleep() so asterisk has a chance to get the message
   - Out of the registration_mutex so we actually context switch.

 * Also return more POLLERR variants (POLLRDHUP is not portable,
   should be tested).

 * Also improve printk(), fix rate_limit increment (was missing)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10285 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:07:59 +00:00
Oron Peled
8f4a626087 xpp: Remove dahdi_autoreg parameter:
* With pinned-spans all spans are registered to dahdi with the
   device (and assigned later)
 * So this parameter cannot function anymore
 * Also remove the (now) empty xpd_post_init() function.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10284 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:07:21 +00:00
Oron Peled
bf3d8aa2cd xpp: more informative span description:
* Contains the hardware_id and the local span number

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10283 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:06:57 +00:00
Oron Peled
aab9e51f30 xpp: make unregistration safer (idempotent)
* Otherwise, a failed unit initialization (e.g: when init_card_?_?? fails)
   causes a panic

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10282 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:06:32 +00:00
Oron Peled
bfae9c07da xpp: adapt to 'location' attribute removal:
* Reparent astribanks below their USB transport
 * This way their location can be derived from their hardware
   hierarchy.
 * The tradeoff is that once USB hardware is disconnected, there
   is no sysfs visibility of the astribank object even if it
   cannot be release yet due to open channels by asterisk
 * Thus, we'll need to migrate to "surprise removal" of dahdi
   devices...

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10281 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:06:11 +00:00
Oron Peled
7c4c826d68 xpp: PRI: use DAHDI new set_spantype() method
* Implement pri_set_spantype() method
 * Refactor code from PRI_card_dahdi_preregistration() into
   a new apply_pri_protocol().
   - It is now called from both PRI_card_dahdi_preregistration()
     and set_pri_proto()
   - It now also sets span name + description
 * Remove old pri_protocol_store() method (pri_protocol is now RO)
 * Added pri_protocol_bystr() method (maybe promote it to DAHDI?)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10280 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:05:49 +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
39c4b93ed6 wcte12xp: Allow linemode (T1/E1) 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
wcte12xp 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@10278 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:04:04 +00:00
Shaun Ruffell
f9c52bb271 dahdi: Allow 'spantype' to be changed before span assignement via sysfs.
For some boards, the linemode (E1/T1/J1) is software selectable but
needs to be configured before the spans were historically registered
since the line mode determines the channel count available on the span.

This change exports a "spantype" attribute from the dahdi_device that
can be used to set E1/T1/J1 before the spans are assigned. When
userspace writes to this attribute (in a <span offset>:<span type
string> format), and if the board driver has implemented a set_spantype
function in it's dahdi_span_ops, then the board driver can optionally
change it's mode before registration.

Also part of this change is breaking out the raw data structure
initialization of the spans / channels via the dahdi_init_device_spans
function since the board drivers may need to reallocate channels / spans
as part of this callback. For example, changing from T1 to E1 mode will
require allocating 7 new channels.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10277 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 19:01:19 +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
a6824019fb dahdi: Expose dahdi devices in sysfs.
This exposes dahdi devices in sysfs and also exposes attributes that
will allow user space to control the registration order in spans. This
facilitates loading drivers out of order yet keeping consistent
span/channel numbering, which in turn will eventually allow the
blacklist for DAHDI drivers to be removed. The default behavior,
controlled with the auto_register module parameter on dahdi is to number
the spans / channels in order like is currently done. So this change
does not introduce any new behavior by default.

 * Writing (anything) to this attribute returns the span to its
   unassigned state
 * Fix dahdi_chan_unreg() echocan refcount
 * Add safeguard against duplicate unassignment to _dahdi_unregister_span()
 * Remove the span from device_node list, only in dahdi_unregister_device()
   and not in dahdi_unregister_span()
 * Free allocated span->span_device in span_sysfs_remove()
   [is it safe?, didn't cause problem so far...]

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>

dahdi: Add "hardware_id" dahdi_device attribute.

- The "hardware_id" does not change with device location (e.g: when a PCI
  card is moved from one slot to another).
- Not all devices have this attribute. It is legal for it to be NULL (that
  is the default for all low-level drivers that do not set it explicitly).
- When "hardware_id" is NULL, the sysfs attribute value is "\n"

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10275 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 18:59:20 +00:00
Oron Peled
2794bb4937 dahdi: Expose spans in sysfs.
This change will facilitate creating rules that will allow spans and channels
to be accessed by named device files instead of by numbers.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10274 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 18:58:50 +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
Oron Peled
38c3cda8e2 dahdi: dahdi_is_analog_span() -> dahdi_is_digital_span()
* dahdi-base.c had a reverse is_analog_span() static function -- fixed.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10272 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 18:57:31 +00:00
Tzafrir Cohen
3998c8fd11 dahdi: Add error messages in dahdi_ioctl_chanconfig.
Provide more context to trouble shoot failures.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10271 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 18:57:07 +00:00
Oron Peled
33c31e9593 dahdi: start handling "surprise device removal".
This patch contains interim results while trying to make
device removal work correctly:

 * XPP has protections to prevent dahdi unregistration while
   channels are open -- they are now removed, so we can
   unregister immediately.

 * Handle processes in poll_wait():
   - Wake them during dahdi_chan_unreg() after the channel
     is gone (chan->channo = -1 or chan->file->private_data == NULL)

   - Test in every wait_event_interruptible() that the channel
     was not gone (chan->file->private_data)

   - Return correct values (POLLERR | POLLHUP) instead of
     some errno (would be important in the future if we
     modify asterisk to respond correctly to this condition.

 * Other issues:
   - If unregistered channel is being polled, than call msleep() before
     returning, to give other processes a chance (normally, asterisk
     has RT priority)

   - Call close_channel() from dahdi_chan_unreg() so it releases
     related tonezone

 * There is still a horrible race hidden by msleep(20) in
   dahdi_chan_unreg()

force close channels from dahdi_chan_unreg():

 * Mark them via DAHDI_FLAGBIT_OPEN
 * Call low-level driver close() method if available
 * What about other closing activities?

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10270 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-26 18:56:43 +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
35ffe2f550 dahdi: Move WARN_ON_ONCE from wctc4xxp driver to include/dahdi/kernel.h
I only generally test on RHEL 4 when testing against kernels older
than 2.6.18. Apparently OpenSUSE 10.1 runs with 2.6.16 and doesn't
have WARN_ON_ONCE backported. I took the patch Richard Miller
originally attached to the issue and moved it to
include/dahdi/kernel.h so it would be available for all the board
drivers in the future.

Internal-Issue-ID: DAHLIN-260
Reported-by: Richard Miller
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10252 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-21 19:32:25 +00:00
Shaun Ruffell
f06aa486c7 wcb4xxp: Do not show LASVEGAS2 as echocan name if vpmsupport is set to 0
This fixes an issue where "EC: LASVEGAS2" was displayed in /proc/dahdi/x
for a B410P span even though vpmsupport was disabled with the module
parameter.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10251 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-21 19:20:17 +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
19e874f682 wcte12xp: 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.

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@10243 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:52:56 +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
fba8fd1a70 wctdm24xxp: Remove DEBOUNCING_RINGING_OFF from ring_detector_state enum.
This value is not used and is now gone.

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@10229 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:51:57 +00:00
Shaun Ruffell
534c7e7547 wctdm24xxp: Setup all VPMADT032 channels on hybrid cards.
r10160 "wctdm24xxp: Probe for and configure modules in parallel."
did not properly setup the VPMADT032 for all ports on hybrid cards.
The most immediate sympton being that spans 3 and up on a hybrid
card would not come up in Asterisk even though they were out of
alarm. This was because the echo canceler was blocking messages on
the dchannels.

This does not affect any previously released versions of DAHDI-Linux
or users of the VPMOCT032.

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@10228 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:51:53 +00:00
Shaun Ruffell
f02b476fee dahdi: Add functions for determining spantype (E1/T1) to include/dahdi/kernel.h
Uses the linecompat member to determine what type of span it is. This will
allow removing T1/E1 flags from other places where the span type is stored.

This function also changes the return value from bool to int for the
inlines defined in include/dahdi/kernel.h. This is because not all
kernel versions include stdbool.h in the headers and it will conflict
with boolean values that are exported via module parameters on some
older kernels if dahdi included it globally.

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@10227 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-10-20 20:51:49 +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
4edd8a1973 wctc4xxp: Allow G723 SID frames to pass to the hardware decoder.
The driver has, until now, dropped G723 SID frames even though the
firmware on the TC400/TCE400 can handle them. Now let them on
through.

Reported-and-Tested-by: Angel Carhuas <acarhuas@colinanet.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10218 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-30 19:12:42 +00:00
Shaun Ruffell
17e0f2b7bb wcte12xp: Set uncollected performance counters to -1.
The intent here is to flag to users that the maintenance counters are
not collected for spans exported by the wcte12xp driver.

dahdi_maint before this change:

  # dahdi_maint -s 1
  Span 1:
  >Framing Errors : 0:
  >CRC Errors : 0:
  >Code Violations : 0:
  >E-bit Count : 0:
  >General Errored Seconds : 0:

And after:

  # dahdi_maint -s 1
  Span 1:
  >Framing Errors : -1:
  >CRC Errors : -1:
  >Code Violations : -1:
  >E-bit Count : -1:
  >General Errored Seconds : -1:

This can be combined with a change to dahdi_maint to recognize that the
errors are -1 and print an even more explicit warning.

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@10212 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-29 16:11:50 +00:00
Shaun Ruffell
5afc62e856 wctdm24xxp: Set dahdi_span.devicetype string in one place.
Currently, the devicetype string was set both when the device was first
allocated and updated when an echocanceler was detected. For simplicity,
combine both these steps into a single function.

This change also replaces an improper use of strncat with strlcat.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10210 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-27 22:08:31 +00:00
Tzafrir Cohen
dafb5f401b xpp: fix FXS D DTMF detection (not zero)
* 'D' DTMF digits were accidentally discarded with the notice message:
  "Bad DTMF value 0. Ignored".
* No need for an odd 1-based translation table anymore - it's 0-based.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10209 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-27 17:10:48 +00:00
Shaun Ruffell
e025a651fb dahdi: Check for master in DAHDI_STARTUP / resolves MeetMe regression.
There were a couple of reports that MeetMe conferences were not
working in 2.5.0.1 and that downgrading to 2.4.1.2 resolved the
issue. This could occur if there were no analog spans in a system,
and all the digital spans were out of alarm before DAHDI_STARTUP
ioctl was called by dahdi_cfg. If the spans were *not* out of alarm,
they would be marked master when the span changes it's alarm state.

This would result in a condition where no spans were marked as the
"master" and so the core timer was handling conferencing. The core
timer runs by default at 4ms and most board drivers run at 1ms
intervals, but a channel currently only buffers up 2ms of data when
conferenced. Therefore, 2ms of audio from a board was continuously
dropped from the conference every 4ms by default.

This fixes a regression first introduced in 2.5.0 which was
specifically added in revision r9611 "dahdi: Do not locate new
master in interrupt context."

Internal-reference-ID: DAHDI-894
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Tested-by: Dennis Martinez <dmartinez@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10205 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-23 20:18:36 +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
Shaun Ruffell
6fcd923dee wctdm24xxp, wcte12xp: Advertise VPMOCT032 presence in dahdi_span.devicetype.
A "(VPMADT032)" string is appended to the devicetype (as shown by
dahdi_scan) for the span if one is installed. Now append '(VPMOCT032)'
if one is installed as well.

Also, for the wcte12xp driver append the VPM name to the device type after
initially probing as opposed to only after the span is configured.

(Related to issue DAHDI-890)
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10203 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-23 20:18:21 +00:00
Tzafrir Cohen
1ba9a007d1 xpp: fxs: bugfix for 2fxs+6fxo cards
* Bug sympthoms: wrong FSK VMWI sent few seconds after
  offhook. That was caused because the driver kept
  polling the (physically unconnected) digital inputs.
  [note: a workaround for drivers without this patch
   is to zero the 'xpd_fxs.poll_digital_inputs' parameter.]

* Also, the digital_inputs/digital_output masks were
  calculate using a different condition.

* Now we determine number of channels, digital inputs and
  digital outputs in a single place and use this info
  later to calculate the correct masks.

* We poll only if there are digital_inputs

* We added a sanity check in process_digital_inputs, so
  we get a notice if it's called on an xpd without digital
  inputs (e.g: hypothetic firmware bug).

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10202 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-22 18:55:44 +00:00
Shaun Ruffell
d4ee448c7e dahdi: Decrease the initial coretimer delay to 4ms from 1 second.
DAHDI currently waits a second before checking if a board driver is
calling dahdi_receive and switching to internal timing. Some versions of
Asterisk (I was looking at 1.4.42 when writing this) only wait 300ms for
a timer to expire when first starting and verifying that DAHDI is
properly configured. This can result in a

"ERROR[27673] asterisk.c: Asterisk has detected a problem with your DAHDI
configuration and will shutdown for your protection. You have options:"

message if asterisk is started soon after loading DAHDI.

This change sets the inital polling interval to the same as that used
during normal coretimer operation, 4ms. The interval will still be
slowed to 1 second if a board driver starts calling dahdi_receive().

DAHDI-892.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10200 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-13 18:28:58 +00:00
Tzafrir Cohen
dc6ef91241 xpp: firmware to detect the new 2+6 module
New firmwares to handle the new 2FXS/6FXO module.

FPGA_1161.hex, PIC_TYPE_1.hex, PIC_TYPE_2.hex of internal rev. 9732

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10179 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-09-05 09:51:55 +00:00
Doug Bailey
0c5b91cc80 wcte12xp, wctdm24xxp: Update VPMOCT032 firmware to 1.11.0.
Firmware version 1.11.0 resolves an issue where the driver fails to
detect certain VPMOCT032 modules after a cold boot.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10172 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 20:58:06 +00:00
Shaun Ruffell
57f80508b5 wctdm24xxp: Remove fwringdetect module parameter.
The driver / FXO modules now always operate in a fwringdetect mode and the
module parameter was never checked anywhere. It is now gone.

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@10171 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:45 +00:00
Shaun Ruffell
17f0170829 wctdm24xxp: Use interval for debouncing FXO polarity detection.
Eliminate the assumption that the check function is going to be called
for every frame. Also use a state machine to make polarity debouncing
similar to the other debouncing code.

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@10170 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:41 +00:00
Shaun Ruffell
874b76bd22 wctdm24xxp: Use interval for debouncing FXO battery.
Allows the driver the option of not calling the misc function for every
frame.  This is part of preparation for moving misc processing out of
the interrupt handler.  Also use a state machine for the various battery
states to unify the technique for debouncing the various signals in the
driver.

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@10169 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:36 +00:00
Shaun Ruffell
cea4b8bda3 wctdm24xxp: Use time interval for debouncing FXO ring detect.
Do not assume the ring detection function is called for every frame.
Also change the debounce logic to a state machine to clarify what state
a port is in and unify the technique for debouncing the various signals.

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@10168 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:32 +00:00
Shaun Ruffell
60caca49f4 wctdm24xxp: Use interval for checking FXS on hook transfer timer.
Part of moving more of the module specific processing out of the
interrupt handler and allowing the interrupt rate to be slowed down.

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@10167 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:27 +00:00
Shaun Ruffell
b5bacb94a7 wctdm24xxp: 'oppending_ms' shouldn't assume being checked at 1ms intervals.
Part of preparations for being able to optionally slow the interrupt
rate down and opening the door for moving more module processing out of
the interrupt handler.

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@10166 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:23 +00:00
Shaun Ruffell
a2aba65e0c wctdm24xxp: Name the shadow registers for each modules.
Saved me time when reading the code so I don't have to lookup which position
in the index is what register for each of the modules.

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@10165 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:19 +00:00
Shaun Ruffell
32bb7d4c10 wctdm24xxp: Change intcount to framecount.
The variable does not necessarily have anything to do with the frequency
of interrupts but is instead a count of sframes received. For example,
it is possible to slow the interrupt rate down on the voicebus cards to
one every 2 frames.

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@10164 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:14 +00:00
Shaun Ruffell
fd3eb2da05 wctdm24xxp: Use fact that handle_transmit/receive are called in hard-irq
We can spend less time in interrupt context by not saving and restoring the
local interrupt state. This is a particularly noticeable improvement on debug
kernels with lockdep.

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@10163 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:10 +00:00
Shaun Ruffell
25cb4126c8 wctdm24xxp: Protect creation / destruction of VPM instance.
Closes a small window of opportunity where one CPU might free a VPM
instance that the interrupt handler may currently be using.

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@10162 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:06 +00:00
Shaun Ruffell
3d8629e864 wctdm24xxp: Reset the polarity debounce setting when battery is lost.
Wait until we have de-bounced the presence of battery before moving on the
check for changes in polarity. This removes the sometimes random
polarity messages generated on an FXO port when the far side drops
battery from a supervisor disconnect.

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@10161 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:38:01 +00:00
Shaun Ruffell
1d03f6f8a8 wctdm24xxp: Probe for and configure modules in parallel.
Use the newly create bg_create and bg_join to actually probe / configure
groups of 4 modules in parallel. This currently has to be done in groups
of four due to the way 4-port modules are identified relative to single
port modules.

This provides a dramatic improvement in driver load time. When loading a
single TDM2400 with 24 FXS ports before this change:

    # time modprobe wctdm24xxp vpmsupport=0

    real    0m46.674s
    user    0m0.000s
    sys     0m0.520s

And after this change:

    # time modprobe wctdm24xxp vpmsupport=0

    real    0m7.900s
    user    0m0.000s
    sys     0m0.070s

Note that the boards themselves are still configured serially. Board
configuration can be parallelized once the assignment of board position
is moved out of the function that is run in parallel. Otherwise it could
be possible for board numbers to switch on repeated loads.

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@10160 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:37:57 +00:00
Shaun Ruffell
cfafd3a7b7 wctdm24xxp: Introduce bg_create/bg_join.
Create a generic facility to spawn tasks to run in parallel. There are
interfaces already in the kernel for doing this, but they are not
supported on the full range of kernels that DAHDI must support.

This will be used to identify and configure FXS/FXO/B400M/VPM modules in
parallel.

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@10159 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-30 16:37:52 +00:00
Tzafrir Cohen
a3fd58979d xpp: FXS: new 2+6 module has no digital I/O ports
This module is recognized via subtype==4

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10158 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-28 09:46:12 +00:00
Shaun Ruffell
77ec2dce9f wcte12xp: Abort driver bind if read/write test fails.
When the driver begins to initialize a device it conducts a read/write
test on one of the framer registers. The driver ignores the result of
that test and results in much output spammed to the kernel logs for a
failed card since the driver doesn't then try to unbind from the device.

What was getting spammed:
     wcte12xp 0000:03:01.0: Timeout in t1_getreg
     wcte12xp 0000:03:01.0: Wrote '0' but read 'fffffffb'

Now abort the bind if the read / write test fails.

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@10155 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-25 18:28:53 +00:00
Tzafrir Cohen
cdeaafb910 xpp: fix bashism in xpp_debug
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10152 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-24 08:11:38 +00:00
Shaun Ruffell
f74112b551 wctdm24xxp: Set 'fastoffhook' counter to 8ms and turn off calibration delay.
r10006 "wctdm24xxp: Add 'fastpick' module parameter." copied the
fast-off hook module parameter from the wctdm.c driver, but the setting
in that driver does not match the data sheet. The previous commit did
not actually change any of the significant bits in that register. Also,
that commit changed the timer, but did not disable the callibration
delay which is necessary for Type-II callerid.

The fastpickup option in the wctdm24xxp driver should now match the
fastpickup option in the wctdm driver.

DAHDI-224.

Reported-By: Kinnith Wallace <kwallace@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10148 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-19 22:40:41 +00:00
Shaun Ruffell
0bc7ff0816 wctdm: Set 'fastpickup' counter to 8ms
This fixes what looks like a typo in r1055 [1].

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

Reported-by: Kinnith Wallace <kwallace@digium.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10147 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-19 22:40:36 +00:00
Shaun Ruffell
ad4489c7f4 wctdm24xxp: Use our own free list for IRQ commands.
Really only *necessary* when SLAB debugging is enabled, but in that
case, can reduce the chance of latency bumps when first loading the
driver. Otherwise the constant slab poisoning / checking in interrupt
context from the kmalloc / kfrees is too much.

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@10144 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-18 19:21:44 +00:00
Russ Meyerriecks
1862d8040c wcte12xp, wctdm24xxp: Remove frowny face from vpmoct032 error message
:O(

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10141 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-15 21:57:53 +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
Shaun Ruffell
eda8ceea1c wctc4xxp: Fix lock imbalance in wctc4xxp_watchdog.
r10082 "wctc4xxp: Cleanup in-flight commands when halting due to
hardware error." introduced a lock imblance on the error path where the
cmd_list_lock would be unlocked twice when the board is halted due to a
hardware error. Thanks sparse.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10138 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-15 21:49:36 +00:00
Shaun Ruffell
e25a65b692 wcte12xp, wctdm24xxp: Force local interrupts off in the interrupt handler.
r10066 "wctdm24xxp, wcte12xp: Run the ISR with interrupts disabled."
requested that the interrupt handler be run in "fast" mode (disabled)
but this isn't necessarily guaranteed.

This patch makes the interrupt handler itself disable all the interrupts.
Linux commit 470c66239ef0336429b35345f3f615d47341e13b [1] contains a comment
about why this is necessary.

[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=470c66239ef03364

(closes issue DAHLIN-248)
Reported-and-Tested-by: Vladimir Mikhelson <vlad@mikhelson.com>
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10118 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-12 15:58:27 +00:00
Wagner Gegler
4f8b2dded1 dahdi_dynamic: Call dahdi_receive in rx packet handler.
Currently dahdi_receive is called on all channels in the context of the
master dynamic span. If one span (not the master) receive two packets
before the master span received a packet, the older packet on the
dynamic span would end up lost because the "readchunk" for the
channels would be overwritten by the new packet. DAHLIN-245

Signed-off-by: Wagner Gegler <wagner@aligera.com.br> (License #6268)
Changed dahdi_ec_chunk to dahdi_ec_span.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10110 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-10 19:22:01 +00:00
Tzafrir Cohen
c793b1b173 FPGA_1161 rev 9605: EC related bug fixes
Astribank II FPGA firmware rev 9605. Includes two bug fixes:

* Error in checking EC licenses when the license was for exactly 64 or 128
  channels.
* Proper handling of a slave FXO Astribank (in line with the quirks
  handling from r10019).

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10099 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-09 12:20:08 +00:00
Shaun Ruffell
d401ad4233 wctc4xxp, wcte12xp, wctdm24xxp: Remove check for HAVE_NETDEV_PRIV
DAHDI currently supports kernels >= 2.6.9. netdev_priv() has been in the
mainline kernel since versions 2.6.6 so it's available in all the
supported kernels. This change is needed to compile against the 3.1 kernel.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10096 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-08-08 06:38:25 +00:00
Shaun Ruffell
9fd43e0139 wctc4xxp: Cleanup in-flight commands when halting due to hardware error.
On one system I was seeing the board reset in the middle of a
transaction. Any commands that were on the response list when this would
happen would never be completed and the process would then be stuck in
an uninterruptible sleep. This change also prevents the driver from
sleeping in timer context, which would result in a kernel panic.

This change at least lets an error message propogate back to the user.

DAHDI-880

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10082 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-26 20:19:30 +00:00
Russ Meyerriecks
1813c9ad09 wcb4xxp: Prevent null pointer dereference on spanconfig
In the rare case where spanconfig is called while there is pending data
on the hdlc channel, the hdlc_getbuf interrupt could try to read from
the hdlc buffer before the channel was fully setup. This could
potentially result in a null pointer dereference. This condition has
existed since the creation of the wcb4xxp driver.

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@10079 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-22 17:56:07 +00:00
Shaun Ruffell
00764f705c dahdi: Drivers that do not support hwec should not report hwec is available.
When attaching software echocans to a channel, if there is a hardware
echocan available always give preference to them.

Revision 9995 "dahdi: Always attach hwec to a channel if available" had
an error where if a driver did not even support an option of hardware
echocan, dahdi-base would take that to mean there always was a hardware
echocan available on the channel.

DAHLIN-246

Reported-by: Michael L. Young
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@10070 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-21 16:26:31 +00:00
Shaun Ruffell
071cfdc983 wctdm24xxp, wcte12xp: Run the ISR with interrupts disabled.
Revision 9886, "wcte12xp: Use the in-hardirq versions of
dahdi_receive/dahdi_transmit", changed the call into dahdi_receive and
dahdi_transmit to use versions that assume local interrupts are already
disabled.  Not all versions of the kernel run interrupt service routines with
all interrupts disabled and therefore it was possible to lock up a CPU with a
recursive grab of the chan_lock.

When LOCKDEP was enabled (on debug kernels) interrupt handlers were run
atomically so this problem would only occur on pre 2.6.35 kernels that did not
have lockdep enabled.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10066 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-21 03:11:20 +00:00
Russ Meyerriecks
abafafcdfe wcte12xp: Fix bug when not recognizing loopup codes
The wcte12xp wasn't recognizing loopup/loopdown signals. The debounce was so
long that it was preventing the loopup/loopdown signals from being registered
properly. Removed the debounce entirely as it was unnecessary to the operation.

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@10064 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 21:32:13 +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
Doug Bailey
64b150eb96 oct612x: Increase the size of some of the instance variables.
Revision 9750 "wct4xxp: Reduce the memory footprint of the hardware
echocanceler" reduced the number of bits used to store some structure
members. Some of the new field lengths were unable to store all the
possible values the API as used assigned to the fields, resulting in
channels never entering power down mode when they were disabled like
they were previously.

The change for byEchoOperationMode was found in testing the operation of
the VPMOCT032 which currently uses the same code. The others were done
via a review of the API doc.

This change represents negligable risk and contains no logic changes.
It only increases the memory footprint of the API instance in the
kernel.

Signed-off-by: Doug Bailey <dbailey@digium.com>
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@10060 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 17:24:27 +00:00
Tzafrir Cohen
b2f71aa2b8 get registration_mutex at free_pseudo
Make sure that the call to dahdi_chan_unreg() in free_pseudo() is
protected by the registration_mutex, like the other calls to that
function.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10056 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 16:50:14 +00:00
Tzafrir Cohen
47823b3a74 xpp: increase command queue lenge to 1000
Required by CAS in latest (2.5) DAHDI versions.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10055 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 16:49:53 +00:00
Tzafrir Cohen
6c2233c894 xpp: make quirk bit flags unsigned
This avoids a nag about a meaningless single-bit signed int.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10054 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 16:49:31 +00:00
Tzafrir Cohen
0ab741b32d xpp: PRI_timing_priority can be static.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10053 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 16:49:07 +00:00
Tzafrir Cohen
6308ee5f7a xpp: rate limit queue overflow messages
If the CPU becomes overly busy, merely printing the "Overflow in the
recieve_queue" messages becomes CPU-intensive on its own right.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10052 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-20 16:48:46 +00:00
Shaun Ruffell
643b60ffb0 wcte12xp: Close a potential race on driver unload.
The shutdown logic requires that all CPUs see that the INITIALIZED bit
has been cleared. Otherwise it may be possible for the workqueue to run
after the hardware resources have been released.

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@10047 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-18 23:32:21 +00:00
Tzafrir Cohen
74ce1b7f9a xpp: install Octasic frmware if it's there
If the OCT6104E-256D.ima Octasic firmware was downloaded to the build
directory, install it over with the rest of the firmware files.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10038 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-12 18:15:03 +00:00
Tzafrir Cohen
03ee387133 xpp: Demote notices for HWEC create/free to debug
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10037 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-12 18:08:42 +00:00
Shaun Ruffell
80e9aa8098 dahdi: Add dynamic dahdi parameter hwec_overrides_swec.
If set to true (default) a HWEC, if available on the channel, takes
priority over any software echocan configured in /etc/dahdi/system.conf.
This has historically been the default behavior in all released versions
of DAHDI that support module echocans.

Otherwise, hwec_overrides_swec is set to false, HWEC is chosen only via
the "echocanceller=hwec" directive.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10036 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-12 18:08:14 +00:00
Shaun Ruffell
08d6076e38 oct612x: Eliminate some compiler warnings.
Eliminate "large integer implicitly truncated to unsigned type" warnings
from r10010.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10024 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-05 17:23:41 +00:00
Tzafrir Cohen
45e5b324d0 xpp: xpd_fxs: ring_trapez parameter
This adds module parameter 'ring_trapez'. When set, the wave form of
the ring tone is set to be a trapezoid, rather than sine. Thus making
the ring stronger.

This is a boolean parameter of the module xpd_fxs. Takes effect at the
beginning of the next ring.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10022 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-04 14:05:43 +00:00
Tzafrir Cohen
451de80d2a A number of cases of testing for unsigned int < 0
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10021 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-04 14:05:19 +00:00
Shaun Ruffell
7f4bd56121 xpp: Eliminate "set but unused" compiler warnings.
gcc 4.6 complains about variables that are assigned values but then
never used.

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@10020 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-04 14:04:56 +00:00
Oron Peled
d7e723ae8a xpp: add FXO HWEC quirks handling
In some cases the hardware echo canceller cannot be used. Mostly related to
an FXO module.
* FXO module if the first module is BRI or PRI
* FXS module if the Astribank has another FXO, no PRI/BRI, and is a sync
  slave.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10019 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-04 14:04:33 +00:00
Shaun Ruffell
bfbfdbab33 wcb4xxp: Return NULL if there is not a hardware EC on installed.
r9943 enabled the presence of hardware EC to be probed on a card. That
change did not account for wcb4xxp based cards that did not have a
hardware echocan on board.

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@10017 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-07-01 15:45:19 +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
Tzafrir Cohen
3e64fbfc26 xpp: FPGA_1161 rev 9252, USB_FW rev 8826: HWEC
New Astribank II FPGA firmware and USB firmwares that add support for the
hardware echo canceller module.

Note that due to a bug in previous FPGA firmwares, an Astribank with such
older firmware and with a hardware echo canceller module will not have any
functioning audio at all.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10013 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-30 21:53:22 +00:00
Tzafrir Cohen
65361158b5 xpp: also install init (non)script for xpd_echo
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10012 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-30 21:38:47 +00:00
Oron Peled
304e481d47 oct612x: Fixes for Octasic user space compilation:
* Don't assume a pointer diff is 16 bits only.
* cOCT6100_INVALID_VALUE should be used against 32 unsigned values
* Make 3 constants adjustable via '-Dmacro=value':
  - cOCT6100_INTERNAL_SUPER_ARRAY_SIZE
  - cOCT6100_MAX_ECHO_CHANNELS
  - cOCT6100_MAX_MIXER_EVENTS

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10010 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-30 20:09:39 +00:00
Shaun Ruffell
d7fdb06033 wctdm24xxp: Fix typo in previous commit for fastpickup mode.
I failed to compile the commit exactly as it was committed.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10008 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-29 22:15:42 +00:00
Shaun Ruffell
f2c8359d2e wctdm24xxp: Add 'fastpick' module parameter.
When true / 1 the FXO port will use a shorter off-hook calibration
delay. This is sometimes necessary in order to properly decode Type-II
Caller ID information which is sent shortly after an FXO port goes off
hook.

Defaults to 0 unless opermode is "JAPAN" then it will default to 1. This
functionality was ported from the wctdm.c driver.

DAHDI-854.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10006 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-29 19:53:52 +00:00
Shaun Ruffell
59e277ef5a wctdm24xxp: Ensure battery drops on FXS hangups honor the channel otimer.
If an FXS port is configured to use kewl start signalling, when the FXS port
is "hungup" it should drop battery for 500ms so that any attached devices can
detect that the remote side has disconnected.  The wctdm24xxp driver
since version 2.4.0 was only dropping battery for ~5-10 ms because it would
set "open" on the line, but then the next time it read the line feed register
state, it was setting the LINE feed register to the idle state.

This change checks if the line is forced open before setting the FXS port back
"onhook" so as to not turn on battery prematurely.

This fixes a regression introduced in r9070 "wctdm24xxp: Prevent FXS Proslic
staying in "Forward/Reverse OnHookTransfer...". DAHDI-849.

Checking for open on the line feed registered was originally suggested by Alec
Davis.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10002 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-29 16:57:38 +00:00
Russ Meyerriecks
f2c0bcd0f2 wcte12xp, wctdm24xxp: Load VPMOCT032 firmware in background.
The firmware load has been moved into a workqueue to prevent the module load
from blocking for the duration of the firmware upload. This could be up to 40
seconds. Driver prevents configuration until firmware load is finished and
is_initialized() returns true.

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@9998 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 22:29:00 +00:00
Russ Meyerriecks
1714113c17 wcte12xp, wctdm24xxp: Add support for the VPMOCT032 hardware echocanceler.
Support enabled for the vpmoct032 echo cancellation module for the wctdm24xxp
and wcte12xp drivers.

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@9997 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 22:28:53 +00:00
Shaun Ruffell
355ab14d47 dahdi: Always attach hwec to a channel if available.
In previous releases of DAHDI if dahdi_cfg attached a software echocan
to a channel and a hardware echocan was available, the hardware echocan
would be used instead of the software echocan.

Since the 2.4 branch was created a new feature was merged into
dahdi-linux where it was possible to mix software echocan and hardware
echocan on a channel. This required using "hwec" as the echocan in the
/etc/dahdi/system.conf file so that what was specified in the
configuration file is what was actually used.

This has resulted in users upgrading to the trunk of dahdi without
updating their /etc/dahdi/system.conf file and just suddenly not using
any hardware echocans any longer.

The capability to mix software and hardware echocans on a span will be
revisted when running dahdi_cfg on any preexisting configuration files
doesn't just silently turn off hardware echocan.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9995 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 21:29:20 +00:00
Oron Peled
15c12a08f8 xpd_echo: XPP Octasic echo canceler module
* xpd_echo (card_echo.c) - a module to handle an Astribank hardware echo
  canceller module.
* All other XPDs are now of type 'telephony_device'. Only a telephony device
  XPD provides a span to register.
* The EC module will typically show up as XPD-40 and will always show up as
  Unregistered in 'dahdi_hardware -v'

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@9993 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 18:23:00 +00:00
Shaun Ruffell
a36bd8863e Revert "dahdi: Group dahdi timers into "rates" for improved CPU utilization."
This reverts commit r9891 and is part of two commits to revert all the
timer changes.

Grouping the timer into rates did not allow a timers rate to be changed
after another thread is already blocked on the poll call

The problem that was reported was if a sip call was made to a DAHDI
channel and the sip call was disconnected before answer, the DAHDI
channel would never stop rining.

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@9991 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 15:55:48 +00:00
Shaun Ruffell
6d4a47a6ef Revert "dahdi: If a timer is not configured then we should block indefinitely."
This reverts commit r9937 and is part of two commits to revert all the timer
changes.

Grouping the timer into rates did not allow a timers rate to be changed after
another thread is already blocked on the poll call

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@9990 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-28 15:55:44 +00:00
Shaun Ruffell
a1d84ea99c wcte12xp: Start alarm timer after marking board initialized.
r9946, "wcte12xp: Move the VPMADT032 test/configuration to module load
time." introduced a race condition where it was possible for the timer
that initiates the check for the alarms to fire before the board was
marked initialized.  This would result in a board that would never again
check it's alarm state since the first time the timer runs INITIALIZED
may not be set and it will not reschedule a check since it believes the
driver is unloading.

This happened because the check for the VPM was moved between when the
timer was first setup and when INITIALIZED was then set.

Now we make sure INITIALIZED is set before the timer is first setup, and
move those two operations together.

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@9981 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-20 16:01:59 +00:00
Shaun Ruffell
90e504dc25 wctdm24xxp: Do not read extra register when test for FXO module fails.
In commit r9968 "wctdm24xxp: Allow more than one outstanding read at a
time" I introduced a regression where the transmit FIFO on the data
channel of a B400M could get locked up. The result would be constant
HDLC overflows when writing to the data channel.

This regression did not make it into any releases and did not exhibit
itself when crossing spans on a single B400M module. This is a partial
revert of commit r9968.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9977 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-11 01:58:43 +00:00
Shaun Ruffell
fb942bbd11 wctdm24xxp: Do not export board number in the device description.
The board number dupliates the information that is available in the
location field. Exporting it as part of the description makes the name
dependent on the driver bind order which is not desirable.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9971 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:04:02 +00:00
Shaun Ruffell
20b5c919a4 wctdm24xxp: Calculate the SPI offsets ahead of time.
Updates the CMD_BYTE macro to use precalculated offsets.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9970 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:57 +00:00
Shaun Ruffell
40a8265509 wctdm24xxp: Shorten up some of the sleeps/waits.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9969 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02 20:03:52 +00:00
Shaun Ruffell
3433925a92 wctdm24xxp: Allow more than one outstanding read at a time.
Since every read needs to go through the complete voicebus pipeline, if
we know we're going to read multiple bytes we can queue them all up.

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

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