summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/card_pri.c
AgeCommit message (Collapse)Author
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-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-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-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-07-20xpp: PRI_timing_priority can be static.Tzafrir Cohen
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-04A number of cases of testing for unsigned int < 0Tzafrir Cohen
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-06-28xpd_echo: XPP Octasic echo canceler moduleTzafrir Cohen
* 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-02dahdi: Allow dahdi_span_ops.[chan|span]config and startup to block.Shaun Ruffell
This change ensures that the dahdi_span_ops callbacks are not called with any spinlocks held, and that the module is pinned in memory, and also passes the struct file * pointer to the callbacks. Passing the file pointer to the callbacks allows the board drivers to check any flags on the file descriptor used to configure the span/channel. The intent here is to allow dahdi_config to open the /dev/dahdi/ctl file in a non-blocking mode in case there is a lengthy processes that needs to happen as part of configuration. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9940 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-06-02Remove unused variables.Shaun Ruffell
gcc-4.6 now warns about variables that are set but never used. Clean up unused variables everywhere except the oct612x subdirectory. The oct612x should go in a separate patch in case that needs to be pulled out into a separate project again. 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@9929 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-05-23xpp: Remove obsolete and unused OLD_PROC codeTzafrir Cohen
OLD_PROC marked old and unused code that was used for writing to procfs. It has long ago been replaced with different sysfs interfaces. Time to remove it. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9916 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpd_pri: Explicit initialization of span.alarmsTzafrir Cohen
Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9718 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpd_pri: Reduce indentationTzafrir Cohen
Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9717 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpd_pri: reorder debug messagesTzafrir Cohen
Move priv->layer1_up debug message after priv->is_cas debug message. Otherwise, we get extra meaningless debug message. Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9716 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: remove unused XPD_STATE() "protocol method"Tzafrir Cohen
Folded XPD_STATE() "protocol method" into the card_state() method. It was only called from these (otherwise empty) methods. Also it is not a "protocol method" for a very very very long time. Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9715 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: phonedev: Cleanup method macrosTzafrir Cohen
* Caller to CALL_XMETHOD() no longer need to explicitly pass xbus (calculate xpd->xbus) * Create CALL_PHONE_METHOD() similar to CALL_XMETHOD() -- inlining the extra parameters (more readable) * Reverse parameter order in PHONE_METHOD() and CALL_PHONE_METHOD() to be consistent with XMETHOD() and CALL_XMETHOD() * Rename XPD_STATE phonedev method to card_state: - Consistency with other phonedev methods. - These calls now Wrap internal calls to XPD_STATE protocol HOSTCMD in PRI, BRI, FXS, FXO Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9706 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: prepare for phonedev refactorTzafrir Cohen
* Allow having XPDs that represent a device that is not a span. * Refactor all span related data from 'struct xpd' to 'struct phonedev' * Refactor span related methods into 'phonedev->phoneops' * Refactor phone related initialization into phonedev_init()/phonedev_cleanup() Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9704 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03Trivial removal of duplicate #includesShaun Ruffell
Mostly linux/errno.h was included more than once. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9557 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-07xpd_pri: Remove pointless hooksig span opTzafrir Cohen
If the span reports that it supports hooksig, DAHDI may fail to use RBS. So remove a call to that stub function. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9506 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-07xpd_pri: ignore DAHDI_VMWI and DAHDIVMWI_CONFIGTzafrir Cohen
This fixes an annoying, though harmless issue: if Asterisk decides to send voicemail messages to a channel (CAS, configured as FXS), We can't do anything useful with them. So ignore them to avoid scary-looking messages (from report_bad_ioctl()). Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9505 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-28Ignore Reg. 0x70 messages at E1.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9028 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-28demote a notice that will happen at registrationTzafrir Cohen
We might as well ignore this, as we will get this at span registration time anyway. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9025 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26dahdi: Move the 'owner' field from dahdi_span to dahdi_span_ops.Shaun Ruffell
One more thing that can be moved out of the per-span structure. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8986 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26dahdi: Move the callbacks in dahdi_span into its own structure.Shaun Ruffell
Part of preparation for adding additional callbacks to allow board drivers to advertise and support gathering pre-echocan data from hardware echocans. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8985 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26dahdi: Remove the 'pvt' member from dahdi_span.Shaun Ruffell
The vast majority of board drivers already keep the dahdi_span structure in a driver specific structure. The others were easily converted. This way board drivers can use the container_of macro to find what was previously pointed to by the "pvt" member of the span. One less thing to think about in the span structure. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8984 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-25No need to worry about accidental "changes" in reg. 0x70 in E1Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8975 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-14Set Astribank PRI before initializationTzafrir Cohen
This avoids most cases of sending garbage at startup by setting each port to tristate mode at init time (in the init script) and enable it back at DAHDI_STARTUO (end of dahdi_cfg). Upgrade note: if you have upgraded the files (including init script) but old module is still loaded, you may end up with the port not getting ever enabled and the line practically dead. In such a case, reload the new module. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8922 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13PRI Astribanks always sync AB (and independent)Tzafrir Cohen
* PRI devices always get SYNC-AB (never PLL, not even for NT) * Fix Timing priority calculation accordingly. * On PRI layer1 changes, elect_syncer() is called, so we have re-election. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8909 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13Don't reset span flag RBS on pri moduleTzafrir Cohen
Don't attempt to reset the span flag DAHDI_FLAG_RBS. At pre-registration we don't yet know if we're CAS or not. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8896 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13don't send "duplicates" in E1 as in D4Tzafrir Cohen
Make sure we only consider T1-s to be potentially D4 (which requires sending the bits twice). This fixes occasional command-queue floods in E1 CAS. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8892 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-19typos, mostly unkownTzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8539 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-12-14DAHDI_AUDIO_NOTIFY: Also pass DAHDI_AUDIOMODE to channel driverTzafrir Cohen
Adds a new compile-time option DAHDI_AUDIO_NOTIFY. With it there's a new span hook, audio_notify, that gets called (if not NULL) whenever the ioctl DAHDI_AUDIOMODE is called for a channel. This can be useful to tell (in most cases) if an ISDN channel is active or not and thus allow the low-level driver to optimize traffic when channels are not active. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7691 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-15xpp: card_pri: force remote refresh on CASTzafrir Cohen
Send different values on alarm to make the remote party re-read state. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7591 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-15xpp: refactor card_pri access to CAS registersTzafrir Cohen
Provide some functions to access the CAS registers for E1, T1/ESF and T1/D4. Mostly, relatively few changes. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7590 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-11-03xpp: More E1/T1 CAS fixes. Mostly connect/disconnectTzafrir Cohen
xpp revs: mostly 7458, 7466 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7457 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-29xpp: T1 CAS supportTzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7266 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-29xpp: refactor pcm mask handling.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7245 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-07-27Replace typos "recieved" with "received".David Brooks
(closes issue #15571) Reported by: alecdavis git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6897 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-06-29dahdi-base: Enable DAHDI to manage the reference counts for the board drivers.Shaun Ruffell
Adds a struct module 'owner' member to the dahdi_span structure and updates all the board drivers to set this member before registering the span. This allows the core of dahdi to maintain the reference counts on the channels itself. (closes issue #10601) Reported by: Matti git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6794 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-05-27xpp: Fix more 'owner' for 2.6.30 to be happy.Tzafrir Cohen
Finishing the work of r6642. Complitly shut issue #14964. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6659 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-05-19Replaece member bus_id with dev_name() and set_dev_name()Tzafrir Cohen
As of 2.6.26 the macros dev_name() and set_dev_name() are used to read and set (respectively) the bus_id member in sysfs. As of 2.6.30 bus_id is gone. This patch provides comaptiobility macros for older kernel versions and removes direct usage of bus_id. (closes issue #14965) Patches: xpp_2630_dev_name.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6637 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-04-20xpp: Do use information about number of ports the Astribank providesTzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6408 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-01-18xpp.r6616: More sysfs migration, FXO enhancements, BRI fixesTzafrir Cohen
* Fix cases where the command_queue overflowed during initialization. * More migrations to sysfs: - Add a 'transport' attribute to our astribank devices which points to the usb device we use. E.g: /sys/bus/astribanks/devices/xbus-00/transport is symlinked to ../../../../../../devices/pci0000:00/0000:00:10.4/usb5/5-4 - Move /proc/xpp/XBUS-??/XPD-??/span to /sys/bus/xpds/devices/??:?:?/span - Migrate from /proc/xpp/sync to: /sys/bus/astribanks/drivers/xppdrv/sync * PRI: change the "timing" priority to match the convention used by other PRI cards -- I.e: lower numbers (not 0) have higher priority. * FXO: - Power denial: create two module parameters instead of hard-coded constants (power_denial_safezone, power_denial_minlen). For sites that get non-standard power-denial signals from central office on offhook. - Don't hangup on power-denial, just notify Dahdi and wait for - Fix caller-id detection for the case central office sends it before first ring without any indication before. Asterisk's desicion. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5663 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-17xpp_pri: Fix T1 CRC initializationTzafrir Cohen
Clock synchronization when sync is not from first port. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5320 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-27Fix xpp compile problems on kernel < 2.6.16Tzafrir Cohen
Support for kernels that use the older hotplug support rather than the newer uevent. Fixes the xpp issue from #13427. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5130 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-16xpp: start migration from procfs to sysfs.Tzafrir Cohen
* Sysfs representation for XPDs: /sys/bus/xpds/devices/<bus>:<unit>:<subunit> * Astribanks sysfs directories now include the XPDs as subdirectories: e.g. /sys/bus/astribanks/devices/xbus-00/00:3:0 * procfs control interface deprecated: conditioned by OLD_PROC (defaults to off). Control functionality moved to sysfs: * xbus attributes: cls connector label status timing waitfor_xpds xbus_state * XPDs can have driver-specific attributes. Common attriubtes: blink chipregs span * PRI-specific attributes: pri_clocking pri_dchan pri_cas pri_alarms pri_layer1 pri_localloop pri_protocol * The Astribank attribute "xbus_state" is read/write. Reading it shows the current state of the Astribank. Writing "start" or "stop" allows a software equivalent of connect or disconnect respectively. * When an Astribank is ready it sends an "online" event. Whenever its not ready (e.g. at the time of disconnect) it sends an "offline" event. Use astribank_hook.sample to handle those. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5097 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-11xpp: CAS/E1 support in the PRI module, and minor fixes.Tzafrir Cohen
* Add support for CAS in the PRI module. Use firmware rev. 5975. * Debugging parameter pcmtx_chan now accepts a dahdi channel number. * Do initialize a reserved protocol field (card_global). * The name DAHDI as used in proc/xpp/sync has 5 (not 6) letters. * Fix DTMF "channel leak" regression in the FXS module. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4761 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Rework the table of signalling bits for signalling types and hook statesRussell Bryant
in dahdi_rbs_sethook() to a much more readable and less error prone format. In passing, get rid of the dahdi_txsig_t typedef, and fix uses of it throughout the tree. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4679 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02Only set the XSP registers from a single place.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4518 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02break up large memory allocations made by digital span drivers into smaller ↵Kevin P. Fleming
ones (one allocation for each dahdi_chan structure, separate from any private structures used by the driver) (closes issue #12657) Reported by: tzafrir git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4513 a0bf4364-ded3-4de4-8d8a-66a801d63aff