Commit Graph

123 Commits

Author SHA1 Message Date
Tzafrir Cohen
6a3163e05c xpp: pre/post_unregister: not for the EC
Don't run the pre- and post-unregister hooks on a non-phone XPD
(practically: the echo canceller). This fixes a panic with manual
'dahdi_registertion off' as it is now called for the whole device
(regression of 2.6.x).

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10735 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-11-15 13:40:56 +00:00
Oron Peled
76ce8d5951 xpp: usermode_helper() bugfix for kernels >= 3.3.0
* UMH_WAIT_PROC semantics (and value) was changed from enum to
  a bitmask (via #define)
* This constant was missing from kernels older than 2.6.23

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10692 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-06-21 17:34:09 +00:00
Shaun Ruffell
579132bb89 convert span->spantype to enumerated type
* This is a minimal convertion -- everything compiles and looks OK.
* We print a warning for spans registering without a spantype.
* Low-level drivers may later want (but not required)
  to fold their internal representations to this canonical
  representation -- it will save code and make it more readable.

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@10683 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-05-23 12:20:23 +00:00
Shaun Ruffell
5cbf189ec4 xpp: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined.
Looks like a hold over from when dahdi_span_ops was first implemented in r8985
"dahdi: Move the callbacks in dahdi_span into its own structure" [1].

[1] http://svnview.digium.com/svn/dahdi?view=revision&revision=8985
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10658 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11 20:09:44 +00:00
Tzafrir Cohen
199cd70d2c FPGA_1161.201.hex rev 10545: fix reset of XR1000
Previous commit (r10649) included an incorrect version. Including full message
from that commit for the description.

rev. 10502 of the FPGA firmware for the new E-Main rev. 4 fixes a potential
issue when used on Xorcom XR1000 systems: an issue with the power supply may
cause the unit to reset.

Note that there is no issue with previous models, with a normal setup of an
Astribank, or other XRx000 systems.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10652 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11 09:06:29 +00:00
Tzafrir Cohen
432e83165c FPGA_1161.201.hex rev 10532: fix reset of XR1000
rev. 10502 of the FPGA firmware for the new E-Main rev. 4 fixes a potential
issue when used on Xorcom XR1000 systems: an issue with the power supply may
cause the unit to reset.

Note that there is no issue with previous models, with a normal setup of an
Astribank, or other XRx000 systems.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10649 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-10 21:36:43 +00:00
Oron Peled
59caf11dbe xpp: FXS: added a 'lower_ringing_noise' parameter
* Adds a new parameter, 'lower_ringing_noise', to module xpd_fxs.

* Makes the "power-down" behaviour that was added
  in upstream svn r10478, switchable in runtime.

* By default (false), makes the vbat_h behave like it did
  before the power-down change.
  - I.e: vbat_h is held throughout the ringing period (during
    both ring-up/ring-down)
  - So this patch revert part of r10478

* When switched to true, activate the "power-down" behaviour.
  - I.e: vbat_h follows the ring-up/ring-down.
  - This behaviour lowers the noise caused by group ringing of
    FXS channels in the same unit, but causes problems with CallerID.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10574 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 20:18:26 +00:00
Oron Peled
8aad29e4de xpp: FXS: atomic vbat_h power handling
* In do_chan_power() make vbat_h changes atomic.
* As a result we can ignore duplicate requests.
  This will allow cleaner logic in the next commit.
* Added proper debug messages.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10573 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 20:17:14 +00:00
Tzafrir Cohen
b278ce23b5 xpp: firmwares: useless 0x1A at EOF
Remove a mostly harmless 0x1A (^Z) at the end of the file. If you
add a NL after it, it breaks the firmware loading.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10550 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-20 10:53:39 +00:00
Tzafrir Cohen
857801bd37 xpp: also install the new .201 fixrmware files
The Makefile changes needed to install the two new files.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10536 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18 15:35:11 +00:00
Tzafrir Cohen
f26bd63c6c xpp: firmwares to support E-Main 4
USB firmware (USB_FW.201.hex 10402) and FPGA firmware
(FPGA_1161.201.hex 10480) with support of the new E-Main 4 Astribank
mainboard.

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10535 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18 14:49:58 +00:00
Tzafrir Cohen
e2bf7013ef xpp: USB_FW rev 10401: minor 6FXS/2FXO caps issue
Fixes an issues with the 6FXS/2FXO module: if an extra FXS or FXO module
is added to a system with such a module, an excessive number of port
licenses was accidentally required (as if the 6FXS/2FXO module required
8FXS/8FXO licenses).

Internal-Issue-ID: #1371
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10534 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18 14:46:57 +00:00
Shaun Ruffell
d1be14acf2 xpp: '%d' -> '%lu' when displaying module_refcount on kernel versions >= 3.3
Upstream commit bd77c047 "module: struct module_ref should contains long
fields" changed the return of module_refcount from int to unsigned long. This
change eliminates a warning from the string format specifier.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10485 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 15:41:40 +00:00
Shaun Ruffell
59197c5112 xpp: Use 'bool' type for boolean module parameters on kernel versions >= 2.6.31.
Eliminates warnings that are a result of upstream commit 72db395ffa
"module_param: check that bool parameters really are bool."

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10484 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 15:41:36 +00:00
Oron Peled
791a701524 xpp: FXS: improve fxs_info output layout
* Rotate the channels table in /proc/xpp/XBUS-*/XPD-*/fxs_info
  - This way we don't overflow 80 columns
  - Can also add more info items per-channel
* Linearize LED output for easier grep'ping

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@10479 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 12:53:07 +00:00
Oron Peled
12e2626351 xpp: FXS: better power-down to lower noise
* Now every linefeed control command which is not RING'ing
  powers-down the SLIC. This reduce audible noise when
  several channels are ringing.

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

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10478 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 12:52:32 +00:00
Oron Peled
1fbf6d8562 xpp: BRI: make it always SYNC_MODE_AB (like 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@10477 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 12:52:07 +00:00
Oron Peled
bb63d03bba xpp: PRI/BRI: fix channels opening/closing:
* If a DAHDI_AUDIO_NOTIFY is issued, offhook the channel
   (added to BRI).

 * If D-channel is closed, onhook all channels (added to PRI)

 * If a clear channel is closed and the D-Channel is not
   open (e.g: with patgen/pattest), onhook this channel
   (added to both BRI and 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@10476 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 12:51:22 +00:00
Oron Peled
40d3c42686 xpp: init_card: better variable naming
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@10475 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15 12:50:49 +00:00
Oron Peled
ee8bc184da xpp: reset Astribank SPI busses
* A driver reload should reset Astribank hardware
* This patch send an SPI reset after we get AB_DESCRIPTION reply from Astribank

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

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10472 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-13 20:09:12 +00:00
Tzafrir Cohen
4762177be0 USB_RECOV.hex: recovering from xpp hardware issues
USB_RECOV.hex, rev. 9760. It may be used to recover from certain
issues of the USB controller of the Astribank (when an Astribank
is not detected as such) by Support staff.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10455 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-02-07 21:50:04 +00:00
Oron Peled
3cf9003a26 xpp: FXO: improve ring debounce notice
* Less jargon.
* Fixes calculation: shows time passed rather than remaining time.
* Closes xorcom #1398.

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@10452 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-25 22:02:08 +00:00
Tzafrir Cohen
b79e172d23 Astribank I firmwares rev. 7107
A slightly newer firmware (Xorcom rev. 7107) for older (non Astribank
II) Astribank modules. Was accidentally left uncommited. Includes minor
bug fixes.

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10443 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-25 18:34:43 +00:00
Oron Peled
8228de4d11 xpp: style - remove extra braces
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@10438 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-12 17:14:15 +00:00
Oron Peled
2f03aa8bcb xpp: style - kfree() is NULL safe
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@10437 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-12 17:13:41 +00:00
Oron Peled
9e541045d9 xpp: style - add const to file_operations
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@10436 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-12 17:13:15 +00:00
Oron Peled
a28ffb3af5 xpp: style - manual whitespace/line-breaks cleanup
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@10435 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-12 17:12:48 +00:00
Oron Peled
0244106553 xpp: style - one macro cleanup
* Wrap in do {} while(0)
* Move closer to its use (it's #undef'ed anyway after this section)
* Also re-organize line-breaking in the same code section

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@10434 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-12 17:12:15 +00:00
Oron Peled
f9fb9622ec xpp: style - no more typedef byte
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@10433 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-12 17:11:46 +00:00
Tzafrir Cohen
bb5b3a6de4 xpp: style: fix an improper line break.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10432 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 20:33:03 +00:00
Oron Peled
cc083d440f xpp: style - place EXPORT_SYMBOL() (manually)
Manually place EXPORT_SYMBOL() after symbols (or at end of functions).

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@10431 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 20:01:32 +00:00
Oron Peled
dbf3f017d9 xpp: style - clean many long lines (manually)
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@10430 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 19:56:35 +00:00
Tzafrir Cohen
4ff781c2ba xpp: fix "non-const" index, right header, indent
Synchronize some changes from out internal tree:
* Fix a few of the places where indent did a lousy job.
* sparse did not like using the const MAX_ARGS as an index. Make it a define.
* Incorrect header included in card_fxs.c (doh!).
* One more funciton to statify.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10429 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 17:04:36 +00:00
Oron Peled
a2a695c742 xpp: style - Run Lindent
* Here it is:
  KERNEL_STYLE="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
  TYPEDEFS='
	-T gfp_t
	-T __user
	-T u_char
	-T __u8
	-T byte
	-T bool
	-T charp
	-T xusb_t
	-T xbus_t
	-T xpd_t
	-T xproto_table_t
	-T xproto_entry_t
	-T xframe_t
	-T xpacket_t
	-T reg_cmd_t
	'

  indent $TYPEDEFS $KERNEL_STYLE \
	--ignore-newlines	\
	--indent-label0	\
	--no-space-after-function-call-names	\
	"$@"

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@10428 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:22:46 +00:00
Oron Peled
97ad9f8d03 xpp: style - convert typedef of byte to __u8
* Applied via:
  perl -pi \
	-e '/"/ and next;' \
	-e '/^\s*\*/ and next;' \
	-e '/\/\*.*byte/ and next;' \
	-e '/typedef.*byte/ and next;' \
	-e 's/\bbyte\b/__u8/g' "$@"

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@10427 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:21:54 +00:00
Oron Peled
f84d579847 xpp: style - add space after comma
* Applied via:
  sed -i -e '/"/!s/,\([^ \t]\)/, \1/g' "$@"

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@10426 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:21:13 +00:00
Oron Peled
6caa62da4a xpp: style - insert space afer if/while/for/switch
* Applied via:
  perl -pi -e 's/\b(if|while|for|switch)\b\(/$1 (/g' "$@"

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@10425 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:20:05 +00:00
Oron Peled
8ed4c4a1ee xpp: style - Remove space before tabs
* Applied via:
  perl -pi -e 's/ +\t/\t/g;' "$@"

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@10424 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:19:01 +00:00
Oron Peled
c7946df16e xpp: style - Remove 0/NULL static initializers
* Applied via:
  perl -pi -e 's/(\bstatic\b[^=]*?)\s*=\s*(0|NULL)\s*;/$1;/' "$@"

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@10423 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:17:42 +00:00
Oron Peled
535ef8086c xpp: style: convert __FUNCTION__ to __func__
* Applied via:
  perl -pi -e 's/\b__FUNCTION__\b/__func__/g' "$@"

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@10422 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:17:09 +00:00
Oron Peled
647212c45f xpp: style - remove eolspace
* Applied via:
  perl -pi -e 's/[ \t]+$//' "$@"

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@10421 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-11 15:16:34 +00:00
Oron Peled
a01b9aaf14 xpp: handle failures during dahdi_register_device()
* If dahdi_register_device() failed, not all resources were freed.
  When dahdi_unregister_device() was called later (during driver
  removal) a panic was caused.

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10410 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-05 17:35:17 +00:00
Oron Peled
9c642364a7 xpp: Don't deactivate XPDs on unregistration
* A bug was introduced during migration to dahdi_device code:
    http://svnview.digium.com/svn/dahdi?view=rev&rev=10273
* Marking XPDs as non-functional (card_present=0, XPD_STATE_NOHW)
  was moved from xbus_request_removal() into xpd_dahdi_preunregister()
* As a result, unregistering an Astribank, made it non-functional
  so trying to re-register it later caused errors (e.g: "Cannot open"
  error message from xpp_open())
* This fix move XPD deactivation into the proper location (during
  xbus_deactivate()

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10409 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-05 17:34:16 +00:00
Oron Peled
0f619852d8 xpp: bugfix: fix bad refcount
Code path called in error condition contained an superflous put_xpd() call

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10408 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-05 17:33:47 +00:00
Oron Peled
892e49c356 xpp: BRI: batch D-Channel packets to fix frag.
* We need to split the BRI D-Channel (HDLC) frames to smaller packets,
  limitation of the FPGA.
* This changes batches BRI D-channel packets of the same HDLC frame to a
  single XPP frame.
* Avoids an accidental fragmantion in case we were delayed for a few ms-s.
* Also improves efficiency.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10390 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-02 14:07:14 +00:00
Oron Peled
9fd76d93c9 xpp: BRI: split multibyte functionality
* The zero lenth case (Magic request) was split into
  send_magic_request() function. It was not possible
  to move it into card_bri.c, because it is called
  directly from the general interface we provide for
  register read/write via sysfs/proc.

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

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

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10389 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-02 14:06:50 +00:00
Oron Peled
6706b03d9d xpp: BRI: remove trivial BRISTUFF wrappers
Now that legacy BRISTUFF code is gone, some wrapper
functions became trivial. Removed these wrappers
and inlined their contents.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10388 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-02 14:06:25 +00:00
Oron Peled
2ae396112a xpp: BRI: remove legacy BRISTUFF code
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10387 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-02 14:05:58 +00:00
Tzafrir Cohen
b6f3466607 xpp: Allow up to 128 Astribanks on a system
This is also a work around the bug fixed in the previous commit.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10384 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-12-21 18:10:44 +00:00