summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/card_bri.c
AgeCommit message (Collapse)Author
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-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-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-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-07-04xpp: Eliminate "set but unused" compiler warnings.Tzafrir Cohen
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-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 XPP_DEBUGFS codeTzafrir Cohen
XPP_DEBUGFS code was some code used to send BRI D-Channel data through debugfs for, well, debugging. Unused in recent years. Time to remove. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9917 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
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-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-13Fix building without CONFIG_PROC_FS definedTzafrir Cohen
This changeset should have no functional changes. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8877 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-11-22xpp: statify and line length in card_bri.cTzafrir Cohen
* checkpatch.pl nudged about line lengthes. * sparse nudged about non-static functions. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7622 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-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-19xpp: report in sysfs if bri module uses hardhdlc supportTzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6640 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-27xpp: hard_hdlc support for the BRI module.Tzafrir Cohen
The BRI module will now use hardhdlc unless the DAHDI tree has been patched with the bri_dchan patch, in which case the old "bristuffed" code will be used. Thus it is now built by default. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6513 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-04-16xpp bri: explicitly turn off leds on startupTzafrir Cohen
If NT/TE was changed (e.g: happened because of firmware bug) We would be left with a lit led we don't know about. From xpp rev. 6990 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6376 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-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-03Fix a couple last references to dahdi_txsig_t.Russell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4680 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02Minor fixes following r4513:Tzafrir Cohen
* Convert card_bri as well. * memset each channel separately. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4517 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02Remove unneeded case for #ifdef DAHDI_SPANSTAT_V2 - Tzafrir Cohen
this is always the case for dahdi. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4509 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-01Make the bri module built.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4487 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-06-25String fixes: dahdi.conf -> /etc/dahdi/system.conf .Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4458 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-06-19Yet another zaptel->dahdi rename. XPP file names this time.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4418 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-06-17Make the xpp drivers build with dahdi.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4370 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-05-21start copying kernel bitsKevin P. Fleming
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4315 a0bf4364-ded3-4de4-8d8a-66a801d63aff