summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
AgeCommit message (Collapse)Author
2010-08-11dahdi: Do not error when uncrossing a channel if there is no 'dacs' callback.Shaun Ruffell
The previous commit was making all chan configs fail on a span that did not have a dacs callback. Also add some documentation for 'dahdi_chan_dacs' and make it more explicit when we're disabling cross connect. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9124 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-10dahdi: "Unable" -> "Unable to".Shaun Ruffell
Proper sentences are always preferred. Thanks kpfleming :) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9121 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-10dahdi: Fix oops when trying to dacs channels with a null dacs function.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9120 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-06dahdi: Trivial spelling change.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9094 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-05don't crash on disconnecting of ABTzafrir Cohen
This is a regression from r8985 . The temporary 'module' was there because the pointer 'chan' may become invalid after the close function. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9090 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-29dahdi-base: display Reserved when a channel is unusable (has a sigcap of 0)Kinsey Moore
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9052 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-28dahdi: Unlock the dahdi_span.lock when passed an invalid DAHDI_MAINT command.Shaun Ruffell
Fixes the following sparse warning "warning: context imbalance in 'dahdi_ctl_ioctl' - different lock contexts for basic block". Thank you sparse! git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9038 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26Added hardware transformer checkRuss Meyerriecks
QuadFalc has the ability to test if the transformer is performing correctly. If the components between the framer and the physical span interface are shorted out or opened for any reason we can now detect it. Possible causes for tripping this error could be a broken transformer from an electrical spike or a board manufacturing error. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8999 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26Added card level event handlerRuss Meyerriecks
When a loss of syncronization signal occurs on one of the spans, it affects all spans on that card. Since we do not have a span or card level event system, we have to queue up a global event on all channels for that card The new event is DAHDI_EVENT_SYNC git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8998 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26Added the ability to trigger alarm simulation states in theRuss Meyerriecks
qfalc framer. Added some more verbose red alarm states in the upper byte of the alarm member of the dahdi_span structure Removed some unnecessary instrumentation regarding the enabling of the errored second and 1 second counters for performance collecting. Also added a couple comments. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8997 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-12dahdi: Explicitly ensure we don't schedule a timer for the current tick.Shaun Ruffell
As best as I can tell, when CONFIG_NO_HZ is set along with CONFIG_HZ < 250, it is possible for the system timer to exceed MAX_SOFTIRQ_RESTART. Tony Mountifield alluded that this might be a problem in the below mailing list posting, but when I was originally testing, I wasn't using CONFIG_NO_HZ and HZ < 250. http://www.mail-archive.com/asterisk-dev@lists.digium.com/msg37384.html (closes issue #17620) Reported by: seanbright git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8868 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-26dahdi-base: Reverted a change from last patchRuss Meyerriecks
Removed a change to dahdi-base from last patch which might have caused compatibility with drivers other than the wcte12xp. wcte12xp: The channel clear/rbs function no longer reads the register first. It now uses the span's channel flags to determine each channels clear state. Also added various minor readability improvements. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8569 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-04-23dahdi-base: wcte12xp: Fixed Clear/RBS channel mode issueRuss Meyerriecks
Fixes DAHDI-449 where chanconfig was failing on the first call. It needed to be called twice in a row. This was due to the channel configuration using a non-relative channel number in its loop. Also re-added the register dumping ioctl for inspecting the framer's state. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8564 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
2010-03-29dahdi-base: Fix a bug preventing clobbering maint stateRuss Meyerriecks
Now the errror injection code prevents placing the driver into a loopback state in a less forceful way. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8443 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-21fix two cases of missing __user annotation (sparse)Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8370 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-09dahdi-base: Minor bugfix for alarm state indicationRuss Meyerriecks
Fixed a minor issue where stateless DAHDI_MAINT ioctl commands, such as error insertion and clearing, were indicating the span going into loopback alarm state when it really was not. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8298 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-03-08wct4xxp, wcte12xp: Fixed broken E1 and unsupported function bugsRuss Meyerriecks
* Fixed the bug where the card could not be brought out of local loopback in E1 mode. * Fixed a bunch of issues where the drivers didn't report unsupported maintenance functions correctly. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8291 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-27dahdi: Add option to disable the EC disable tone detection algorithm.Shaun Ruffell
Define CONFIG_DAHDI_NO_ECHOCAN_DISABLE in include/dahdi/dahdi_config.h in order to prevent the tone detector from disabling software echocan. I slightly modified the noechodisable.patch. (closes issue #16805) Reported by: sles Patches: noechodisable.patch uploaded by sles (license 991) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8162 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26dahdi: Change 'struct dahdi_spaninfo' in order to maintain Asterisk API ↵Shaun Ruffell
compatibility. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8147 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-26dahdi: Add line options for BRI NT/TE mode and termination resistance.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8120 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-22Branch merge from the maintenance modes projectRuss Meyerriecks
* Added logic for both the single and dual/quad span cards for supporting local loopback (virtual loopback plug), network loopback, network payload loopback, loopup, and loopback transmitting. * Added logic for the dual/quad span driver to support exporting the performance and error counters including : - errored seconds - framing errors - coding violations - bipolar violations - crc4 errors - ebit errors - fas errors * Moved the error and performance counters into a substructure for all drivers taking advantage of dahdi_span bpvcount. * Modified the DAHDI_SPANSTAT ioctl interface, so I moved the old interface to DAHDI_SPANSTAT_V1. The new interface comes with a nice, new shiny packed struct dahdi_spaninfo. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8061 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-22replace dahdi_dummy with internal timingTzafrir Cohen
* Enable the internal timing of DAHDI. * Disable building dahdi_dummy. * Have dahdi provide the alias 'dahdi_dummy', to allow 'modprobe dahdi_dummy' to still work. The code of dahdi_dummy is still kept, as some people may need the extra flexibility it provides. Those people are advised, though, to let us know what features are missing from the core module. Running 'modprobe dahdi_dummy' explicitly in a script or having 'dahdi_dummy' in /etc/dahdi/modules is thus also discourged. This patch is intentionally small (stripped of documentation) to simplify backporting. Documentation will follow. Review: https://reviewboard.asterisk.org/r/518/ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8053 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-08dahdi: Update the Digium copyright on files changed since 2010-01-01.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8008 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-02-08dahdi-base: Minor changes for sparse.Shaun Ruffell
Mostly making sure __user flag is caried through appropriately on user mode access, but also two cases of removing dynamically sized arrays (which unduly complicate using the kernel backtrace when you don't have a debugger attached since you do not know how much data is really on the stack), and editing dahdi_chan_register so that the lock/unlock context is clear. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8004 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-01-11Fail gracefully if we already have more than 1024 channels.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7850 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-01-06Use unlocked_ioctl and compat_ioctl instead of ioctl.Tzafrir Cohen
* dahdi-base needs compat_ioctl in order to allow 32-bit userspace applications to call the DAHDI ioctls in a 64-bit kernel. * add a separate dahdi_ioctl_compat() to handle functions whose parameters will need some tweaks (currently: only reject DAHDI_SFCONFIG). (closes issue #14808) * 0002-dahdi-base-Use-unlocked_ioctl-and-compat_ioctl-inste.patch uploaded by sruffell (license 456) * 0003-add-a-separate-dahdi_ioctl_compat.patch uploaded by tzafrir (license 46) Tested by: sruffell, tzafrir git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7769 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-01-06Remove some unused 'struct inode *' function parameters.Tzafrir Cohen
Patch 0001 from issue #14808 (initial cleanup) 0001-dahdi-base-Remove-some-unused-struct-inode-function-.patch uploaded by sruffell (license 456) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7768 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-12-11dahdi-base: Do not wait for impulse when echotraining.Shaun Ruffell
Waiting here for the impulse on the transmit can cause the echotraining logic to stick the channel into muted state. This is especially apparent on systems that regularly do not service the interrupts every millisecond. DAHDI-387. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7682 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-12-11dahdi-base: Reduce the max allocation size in dahdi_reallocbufs.Shaun Ruffell
Lower the maximum contiguous chunk that DAHDI asks for from DAHDI_MAX_BUFFER_SIZE*2 to DAHDI_MAX_BUFFER_SIZE. With 4K pages, this can allow the kernel to try a little harder to find the memory it needs since the request goes from order 4 to order 3. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7681 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-10-29dahdi-base: Do not allow jumps in system time to lock up the system w/core_timerShaun Ruffell
Since dahdi coretimer uses the number of milliseconds that has actually passed to determine how many times to call dahdi_receive, it is possible that if the system time shifts after dahdi is started, that the system can appear to lock up while the core timer attempts to catch up. This change prevents soft lock ups under these conditions. This is brings the dahdi_dummy changes in r6933 into dahdi-base. (related to issue #15647) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7437 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-10-11Fix kernel-doc, add some more.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7378 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-10-11Add a few kernel-doc commentsTzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7371 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-10-09dahdi-base: Include linux/sched.hShaun Ruffell
Commit a99bba to the mainline kernel removed sched.h from poll.h. So dahdi-base.c needs to include sched.h directly now. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a99bba git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7356 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-21Mark some userspace parameters with __user . No functional change.Tzafrir Cohen
Mark parameters for some system calls as __user . This handles some of the cases, but still leaves copy_from_user / copy_to_user that are currently always used with an explicit cast. A minor patch from issue #14808 . git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7164 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-21dahdi-base: dahdi_ioctl_[get|set]gains should return the res value.Shaun Ruffell
In function dahdi_ioctl_getgains() and dahdi_ioctl_setgains() return value assigned to res variable, but these function always return 0 which is an error. (closes issue #15916.) Patch by: ys git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7155 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-15dahdi-base: Minor syntax change to meet style guidelinesRuss Meyerriecks
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7125 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-14Fixed issue where the clear channel flags were not being set at the ↵Russ Meyerriecks
appropriate time causing a channel re-configure to mis-set the last channel in each span git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7110 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-07dahdi-base: Fix flag check in dahdi_rbs_sethook.Shaun Ruffell
As long as any of the flags were set, this check would have always passed. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7097 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-07dahdi-base: Prevent compilation if both EMPULSE and EMFLASH are defined.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7096 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-07dahdi-base: Reduce the stack usage of dahdi_common_ioctl.Shaun Ruffell
Split the DAHDI_GETGAINS and DAHDI_SETGAINS ioctls into their own functions and dynamically allocate the 'struct dahdi_gains' structure to reduce the pressure on the stack. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7095 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-08-24Don't dereference the span after a channel was closed.Tzafrir Cohen
Releasing the channel may trigger releasing a span in certain cases (e.g. the last channel on a xpp (Astribank). This gives a niec panic on closing of Asterisk under the right flow. As the span was only dereferenced to access the owner field, we can save it locally. Issue has been present since r6794 . git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7066 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-08-21Remove duplicate-ish code that has existed since r40 (committed 8 years ago).Jason Parker
After a long discussion, it was decided that this was the best action since there was no apparent issue caused by it. The alternative suggestion was to change the extra BBIT to an ABIT as FXSLS uses. Because of the nature of this code, it was deemed to be a bit (you see what I did there?) too risky. Who would've expected such a small change to be so complex? (closes issue #15178) Reported by: KrisV git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7057 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-08-14dahdi-base: Add comment to explain why rxhooksig is reset on span start.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7004 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-07-23dahdi-base: Update formatting in ioctl_load_zone.Shaun Ruffell
Fixes checkpatch.pl formatting errors from the previous commit. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6891 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-07-23dahdi-base: Reduce the stack usage of ioctl_load_zone.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6890 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-07-21dahdi-base: Add support for core timing.Shaun Ruffell
This essentially moves the function of dahdi_dummy into the core of DAHDI. It ensures that if DAHDI is loaded, it will always be able to provide timing, regardless of whether there are board drivers loaded, or if the board drivers are properly calling dahdi_receive. If there is a master span loaded which is calling dahdi_receive, then the behavior will be like it is normally. This functionality is off by default, uncomment CONFIG_DAHDI_CORE_TIMER in include/dahdi/config_dahdi.h in order to enable it. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6863 a0bf4364-ded3-4de4-8d8a-66a801d63aff