summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp
AgeCommit message (Collapse)Author
2012-06-21xpp: usermode_helper() bugfix for kernels >= 3.3.0Tzafrir Cohen
* 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/branches/2.6@10694 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11xpp: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined.Shaun Ruffell
Looks like a hold over from when dahdi_span_ops was first implemented in r8985 "dahdi: Move the callbacks in dahdi_span into its own structure" [1]. [1] http://svnview.digium.com/svn/dahdi?view=revision&revision=8985 Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10658 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10660 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-11FPGA_1161.201.hex rev 10545: fix reset of XR1000Tzafrir Cohen
Previous commit (r10651) included an incorrect version. Including full message from that commit for the description. rev. 10502 of the FPGA firmware for the new E-Main rev. 4 fixes a potential issue when used on Xorcom XR1000 systems: an issue with the power supply may cause the unit to reset. Note that there is no issue with previous models, with a normal setup of an Astribank, or other XRx000 systems. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10652 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10654 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-04-10FPGA_1161.201.hex rev 10532: fix reset of XR1000Tzafrir Cohen
rev. 10502 of the FPGA firmware for the new E-Main rev. 4 fixes a potential issue when used on Xorcom XR1000 systems: an issue with the power supply may cause the unit to reset. Note that there is no issue with previous models, with a normal setup of an Astribank, or other XRx000 systems. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10649 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10651 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21xpp: FXS: added a 'lower_ringing_noise' parameterTzafrir Cohen
* Adds a new parameter, 'lower_ringing_noise', to module xpd_fxs. * Makes the "power-down" behaviour that was added in upstream svn r10478, switchable in runtime. * By default (false), makes the vbat_h behave like it did before the power-down change. - I.e: vbat_h is held throughout the ringing period (during both ring-up/ring-down) - So this patch revert part of r10478 * When switched to true, activate the "power-down" behaviour. - I.e: vbat_h follows the ring-up/ring-down. - This behaviour lowers the noise caused by group ringing of FXS channels in the same unit, but causes problems with CallerID. Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10574 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10576 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21xpp: FXS: atomic vbat_h power handlingTzafrir Cohen
* In do_chan_power() make vbat_h changes atomic. * As a result we can ignore duplicate requests. This will allow cleaner logic in the next commit. * Added proper debug messages. Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10573 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10575 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-20xpp: firmwares: useless 0x1A at EOFTzafrir Cohen
Remove a mostly harmless 0x1A (^Z) at the end of the file. If you add a NL after it, it breaks the firmware loading. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10550 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10553 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18xpp: firmwares to support E-Main 4Tzafrir Cohen
USB firmware (USB_FW.201.hex 10402) and FPGA firmware (FPGA_1161.201.hex 10480) with support of the new E-Main 4 Astribank mainboard. (This was accidentally labeled as 'E-Main 3' in some previous commit messages) Also includes Makefile fixes from r10536. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10535 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10538 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-18xpp: USB_FW rev 10401: minor 6FXS/2FXO caps issueTzafrir Cohen
Fixes an issues with the 6FXS/2FXO module: if an extra FXS or FXO module is added to a system with such a module, an excessive number of port licenses was accidentally required (as if the 6FXS/2FXO module required 8FXS/8FXO licenses). Internal-Issue-ID: #1371 Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10534 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10537 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-16xpp: '%d' -> '%lu' when displaying module_refcount on kernel versions >= 3.3Shaun Ruffell
Upstream commit bd77c047 "module: struct module_ref should contains long fields" changed the return of module_refcount from int to unsigned long. This change eliminates a warning from the string format specifier. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10485 Conflicts: drivers/dahdi/xpp/xproto.c git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10525 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-16xpp: Use 'bool' type for boolean module parameters on kernel versions >= 2.6.31.Shaun Ruffell
Eliminates warnings that are a result of upstream commit 72db395ffa "module_param: check that bool parameters really are bool." Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10484 Conflicts: drivers/dahdi/xpp/xpd.h git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10524 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15xpp: FXS: better power-down to lower noiseTzafrir Cohen
* Now every linefeed control command which is not RING'ing powers-down the SLIC. This reduce audible noise when several channels are ringing. * Simplify code by removing redundant calls to do_chan_power() before linefeed_control() * Manage vbat_h state so we skip do_chan_power() calls when there isn't a state change * Export vbat_h state to /proc/.../fxs_info Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10478 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10490 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-15xpp: reset Astribank SPI bussesTzafrir Cohen
* A driver reload should reset Astribank hardware * This patch send an SPI reset after we get AB_DESCRIPTION reply from Astribank Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10474 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10489 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-02-07USB_RECOV.hex: recovering from xpp hardware issuesTzafrir Cohen
USB_RECOV.hex, rev. 9760. It may be used to recover from certain issues of the USB controller of the Astribank (when an Astribank is not detected as such) by Support staff. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10455 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10457 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-25Astribank I firmwares rev. 7107Tzafrir Cohen
A slightly newer firmware (Xorcom rev. 7107) for older (non Astribank II) Astribank modules. Was accidentally left uncommited. Includes minor bug fixes. No change for any relatively recent (Astribank II) Astribank. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10443 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10445 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-10xpp: handle failures during dahdi_register_device()Shaun Ruffell
* If dahdi_register_device() failed, not all resources were freed. When dahdi_unregister_device() was called later (during driver removal) a panic was caused. * Add proper error handling for possible failures in xbus_register_dahdi_device(): - new xbus_free_ddev() safely free an xbus->ddev - This is called from all failures points. - It is also called from xbus_unregister_dahdi_device() Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10410 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10419 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-10xpp: Don't deactivate XPDs on unregistrationShaun Ruffell
* A bug was introduced during migration to dahdi_device code: http://svnview.digium.com/svn/dahdi?view=rev&rev=10273 * Marking XPDs as non-functional (card_present=0, XPD_STATE_NOHW) was moved from xbus_request_removal() into xpd_dahdi_preunregister() * As a result, unregistering an Astribank, made it non-functional so trying to re-register it later caused errors (e.g: "Cannot open" error message from xpp_open()) * This fix move XPD deactivation into the proper location (during xbus_deactivate() Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10409 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10418 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-10xpp: bugfix: fix bad refcountShaun Ruffell
Code path called in error condition contained an superflous put_xpd() call Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10408 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10417 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-01-02xpp: BRI: batch D-Channel packets to fix frag.Tzafrir Cohen
* 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-02xpp: BRI: split multibyte functionalityTzafrir Cohen
* 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-02xpp: BRI: remove trivial BRISTUFF wrappersTzafrir Cohen
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-02xpp: BRI: remove legacy BRISTUFF codeTzafrir Cohen
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
2011-12-21xpp: Allow up to 128 Astribanks on a systemTzafrir Cohen
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-21xpp: bad module_put() when too many AstribanksTzafrir Cohen
module_put() that was added while developing the sysfs code. The real module_get()/module_put() pair were already removed at the time of developing code for this branch. It was only triggered when using a system with more than 32 (MAX_BUSES) Astribanks. 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@10383 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-12-07xpp: BRI: fix timing priority calculationTzafrir Cohen
Use similar caculation as in the PRI module: * Save timing_priority from spanconfig and elect syncer when spanconfig is called. * Create custom timing_priority() function that returns the value or error if span is disconnected. 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@10373 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-12-07xpp: FXS: mwi and search_fsk fixesTzafrir Cohen
* We must not block PCM during from 'search_fsk_pattern' channels. * We must vmwi_search() not only on FXS_LINE_POL_ACTIVE, but also during 'neon_blinking' -- so we notice the message to turn it off. * Also added 'search_fsk_pattern' and neon_blinking 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@10372 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-11-29xpp: PRI: restore pri_protocol to R/W:Tzafrir Cohen
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-29xpp: pri: fix RS1 init in E1 CAS modeTzafrir Cohen
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-29xpp: fxs: demote SETPOLARITY message to DBG()Tzafrir Cohen
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-16xpp: increase command queue length to 1500Tzafrir Cohen
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-13xpp: USB_FW rev 10085: fix regression from r10013Tzafrir Cohen
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-13xpp: PIC_TYPE_1 rev 9841: followup to r10013Tzafrir Cohen
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-10xpp: silence some bad ioctl() reportingTzafrir Cohen
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-10xpp: restore backward compat dahdi_registrationTzafrir Cohen
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-07xpp: USB firmware r9964: minor bugfixesTzafrir Cohen
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-02xpp: bugfix: clear NOTOPEN span alarm on assignTzafrir Cohen
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-02xpp: bugfix -- manage xpd refcount for EC moduleTzafrir Cohen
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-02xpp: Adaptations for E-Main-3Tzafrir Cohen
* 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-02xpp: remove leftovers of old XPD_STATE methodTzafrir Cohen
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-10-26xpp: cleanup some printk()'sTzafrir Cohen
* 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-26xpp: Remove dahdi_autoreg parameter:Tzafrir Cohen
* 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-26xpp: more informative span description:Tzafrir Cohen
* 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-26xpp: make unregistration safer (idempotent)Tzafrir Cohen
* 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-26xpp: adapt to 'location' attribute removal:Tzafrir Cohen
* 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-26xpp: PRI: use DAHDI new set_spantype() methodTzafrir Cohen
* 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-26dahdi: Expose dahdi devices in sysfs.Tzafrir Cohen
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-26dahdi: Register devices instead of individual spans.Tzafrir Cohen
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-26dahdi: start handling "surprise device removal".Tzafrir Cohen
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-09-27xpp: fix FXS D DTMF detection (not zero)Tzafrir Cohen
* '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-22xpp: fxs: bugfix for 2fxs+6fxo cardsTzafrir Cohen
* 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