summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
AgeCommit message (Collapse)Author
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
2009-02-02Array-style echo canceller updates first appeared in Zaptel, because HPEC ↵Kevin P. Fleming
only supports that mode. However, when the function for doing array-style updates was written, the argument names were reversed. In Zaptel this did no harm, because HPEC was the only module that used array-style updates. When DAHDI was created, non-array-style updates were removed, and the existing modules were converted to using array-style updates. Unfortunately the new code was written based on the argument names, which were incorrect. This caused all the echo cancellers to be broken (except HPEC, although we did not know that at the time), and it was corrected by reversing the order of the arguments passed when the array-style update function was called (leading to a confusing mismatch). This fixed all the non-HPEC modules, but left HPEC broken, which was just discovered. This commit corrects all these problems, so that the argument names and the data passed actually make sense, and all the modules work properly. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5936 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-01-26Manipulate the REGISTERED flag with atomic bitops now since the bit is setShaun Ruffell
outside the protection of any locks. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5819 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-01-26If an execution context has already disabled interrupts on the localShaun Ruffell
processor we do not need to disable them again when grabbing another spin_lock from the same context. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5812 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-01-26Ensure the channel is in a good state before placing it on the chans arrays.Shaun Ruffell
Also ensure that dahdi_receive holds the chan_lock while iterating over the chans array to prevent channels from entering or leaving the array while the interrupt handler is running. Related to issue #14183 . git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5811 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-12-19Add support for new half full buffer policy. This significantly improves ↵Matthew Fredrickson
performance in fax and data modem calls. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5597 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-12-12use a format string for request_module, so the compiler will do the right thingKevin P. Fleming
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5523 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-12-11Fixed a typo that broke building dahdi-base with kernels < 2.6.13Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5482 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-21Fix a think-o in numeric comparison. Swap order to make it more clear.Jason Parker
(closes issue #13813) Reported by: ys git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5360 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-21Convert some uses of sprintf to snprintf in dahdi_proc_read in order toShaun Ruffell
eliminate a buffer overrun. Issue: DAHDI-209 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5355 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-10- Do not hold any locks while calling close_channel, which can result in callsShaun Ruffell
to the echocan modules which do not necesarrily assume they are being called in atomic context. - Remove the bigzaplock around calls to psuedo_alloc and pseudo_free. The structures protected by this lock are already protected by the chan_lock in these two cases. - Remove calls to in_atomic() that were previously added to work around this, but did not cover all the cases. Issue: DAHDI-195, DAHDI-170 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5275 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-09We only use print_debug_writebuf when CONFIG_DAHDI_NET or CONFIG_DAHDI_PPP ↵Sean Bright
are defined, so only define it in those cases as well. Reported & Tested by: KP7 via #asterisk-dev git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5270 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-09Add missing semi-colon.Sean Bright
Reported & Tested by: KP7 via #asterisk-dev git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5269 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-11-02dahdi-base: hw_echocancel_off: return 0 if no hardware ECTzafrir Cohen
If the span has no hardware EC, return 0, rather than a random uninitialized value (which was no harm, as that return value is always ignored anyway). git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5207 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-30Use correct length for the, well, dahdi transcoder device name.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5180 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-30Use ! to hint udev about directory separator.Tzafrir Cohen
Udev knows how to convert a '!' in the device name to a directory separator. Thus the name 'dahdi!ctl' will create the device /dev/dahdi/ctl . We still keep older udev rules in this release for compatibility, but eventually we'll only need them to set permissions. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5179 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-28fix a large number of warnings found by sparse, the kernel code sanity ↵Kevin P. Fleming
checking tool. some of these fixes are non-optimal (casting 'unsigned long' to '__user void *'), but are unavoidable in many cases. started from tzafrir's patch, did most of the work myself. (closes issue #13763) Reported by: tzafrir Patches: sparse_fixes_1.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5162 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-09a micro-optimization found while creslin and i spent four or five hours ↵Kevin P. Fleming
tracking down a very complex problem git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5068 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-06use the same logic here as elsewhere for releasing echocan module referencesKevin P. Fleming
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5064 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-06Fix a few compile errors that only show up when CONFIG_DAHDI_PPP isSean Bright
defined. (closes issue #13608) Reported by: Nik Soggia Fix suggested by: Nik Soggia Tested by: seanbright git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5056 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-03Fix building with CONFIG_DAHDI_NET in kernel 2.6.22Tzafrir Cohen
The leftovers of issues #13542 (which was mostly resolved in previous committ. This closes it. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5051 a0bf4364-ded3-4de4-8d8a-66a801d63aff