summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
AgeCommit message (Collapse)Author
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
2009-06-30echocan: Do not go into PRETRAINING mode if not supported by the echocan.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6803 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-06-30echocan: Do not call through NULL 'echocan_traintap' pointer.Shaun Ruffell
This resolves an issue with a kernel panic if echotraining is enabled in the Asterisk configuration file, but the echocan on the channel (which may be a hardware echocanceller) has not defined that operation. DAHDI-272. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6801 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-06-29Improve MMX safety for DAHDI echo cancellers on 32-bit x86 systems.Kevin P. Fleming
Replaces the standard kernel FPU save/restore operations with custom written versions for 32-bit x86 CPUs, which have been tested to be reliable and safe to use. (closes issue #13500) Reported by: tzafrir Patches: dahdi_mmx_fix.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6791 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-06-29echocan: Properly keep the reference counts for the echocan modules.Shaun Ruffell
(closes issue #13504) (closes issue #15327) Reported by: sruffell, tzafrir git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6785 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-06-04dahdi-base: Fix bug in procfs handling.Shaun Ruffell
Fix bug in procfs handling where it was possible to get a warning in lib/vsprintf.c when reading from /proc/dahdi/x. Patch by: biohumanoid (closes issue #15252) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6675 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-05-01dahdi-base: define __RW_LOCK_UNLOCKED()Shaun Ruffell
Linux 2.6.9 does not contain that definition, but the older definition is deprecated since it defeats lock state checking. DAHDI-253 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6554 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-04-29echocan: Improve interface for echo cancelers.Shaun Ruffell
Echo cancelers are now able to report if they are able to automatically disable their NLP portions in the presence of tones in the audio stream. Also, the interface is changed to allow user space to just disable the NLP portion of the echo canceler. These changes improve fax and modem handling in DAHDI. This commit merges in the changes on http://svn.digium.com/svn/dahdi/linux/team/kpfleming/echocan_work Patch by: kpfleming Also contains improvements to CED tone detection. (closes issue #13286) Reported by: viniciusfontes git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6529 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-04-22don't refer to macros from dahdi_config.h until after it has been includedKevin P. Fleming
use the proper type for the flags variable in dahdi_ppp_xmit() git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6444 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-04-02ensure that the structure being returned by DAHDI_GET_BUFINFO is completely ↵Kevin P. Fleming
initialized git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6294 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-24Make sure the requested echo canceller name is NULL-terminated.Tzafrir Cohen
Make sure that the that the name of the echo canceller requested in the DAHDI ioctl DAHDI_ATTACH_ECHOCAN is NULL-terminated. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6236 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-16Move dahdi_config.h to be under include/dahdi/Tzafrir Cohen
This makes dahdi_config.h part of the "offcial" interface to external modules. Practically most of its configuration items are internal to dahdi-base. But some are intended for other drivers. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6177 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-16Make ecdis.h used by dahdi-base.h aloneTzafrir Cohen
ecdis.h is no longer #include-d in kernel.h . it was there because of decleration of some structs that are part of struct dahdi_chan. The declerations of those structs were moved into kernel.h directly. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6170 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-13Fix handling of 'w' in a pulse dial stringTzafrir Cohen
Make the special "digit" 'w' work in pulse dialing as it works with tone dialing (a delay of 0.5 second till the next digit). Note that the digit gets uppercased before it gets to this function. (closes issue #13999) Reported by: IgorG Patches: dahdi-base.c.pulse2.diff uploaded by tzafrir (license 46) Tested by: litnimax git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6147 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-12Fix handling of DAHDI_GETGAINS_V1 missing from r6124 .Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6134 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-11Fix direction bits on several ioctls.Shaun Ruffell
(related to issue #14499) Reported by: ys git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6124 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-11Eliminating an unused parameter to dahdi_specchan_open.Shaun Ruffell
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6113 a0bf4364-ded3-4de4-8d8a-66a801d63aff