summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
AgeCommit message (Collapse)Author
2009-07-21Merged revisions 6844,6852,6862-6863 via svnmerge from Shaun Ruffell
https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r6844 | sruffell | 2009-07-16 12:29:53 -0500 (Thu, 16 Jul 2009) | 10 lines wcte12xp: Disable vpmadt032 companding by default. This fixes a regression in 2.2.0 where certain configurations will fail patloop test or have repeated HDLC aborts because the VPMADT032 is modifying the clear channel or d channel data streams. This restores the behavior to how it was in dahdi-linux 2.1.0.4. (closes issue #15498) Reported by: alecdavis Tested by: alecdavis ........ r6852 | tzafrir | 2009-07-19 10:45:40 -0500 (Sun, 19 Jul 2009) | 12 lines tor2: allow using port4 as timing source Fix a silly regression introduced when strict check on the timing parameter was added (sync-1 is the array index, not sync itself. And 0 is a special case). (closes issue #15408) Reported by: dferrer Patches: tor2-4th_sync.patch uploaded by dferrer (license 525) ........ r6862 | sruffell | 2009-07-21 12:52:59 -0500 (Tue, 21 Jul 2009) | 4 lines Revert "wct4xxp, wcte11xp: Use the default configuration by default at startup." This reverts the change introduced by revision 6712. This change can cause problems when there is a VPM module installed on the quad-span digital cards. ........ r6863 | sruffell | 2009-07-21 12:53:02 -0500 (Tue, 21 Jul 2009) | 12 lines dahdi-base: Add support for core timing. 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/branches/2.2@6864 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-07-21Merged revisions 6712,6776,6799,6801,6803 via svnmerge from Shaun Ruffell
https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r6712 | sruffell | 2009-06-24 14:13:35 -0500 (Wed, 24 Jun 2009) | 4 lines wct4xxp, wcte11xp: Use the default configuration by default at startup. This change allows hardware to provide timing to asterisk before normal configuration. DAHDI-275. ........ r6776 | sruffell | 2009-06-26 16:24:34 -0500 (Fri, 26 Jun 2009) | 4 lines voicebus: Limit the string length of the vpm workqueue name. On older kernels, it is possible to cause a kernel panic if the lenght of the workqueue name is greater than 10. DAHDI-276. ........ r6799 | sruffell | 2009-06-30 10:45:06 -0500 (Tue, 30 Jun 2009) | 5 lines wcb4xxp: Start the first span with default settings on load. One of the spans of the B410P is now started at driver load time in order to allow it to provide early timing to asterisk, before the card has been properly configured. ........ r6801 | sruffell | 2009-06-30 12:17:09 -0500 (Tue, 30 Jun 2009) | 5 lines echocan: Do not call through NULL 'echocan_traintap' pointer. 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. ........ r6803 | sruffell | 2009-06-30 12:27:34 -0500 (Tue, 30 Jun 2009) | 1 line echocan: Do not go into PRETRAINING mode if not supported by the echocan. ........ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.2@6860 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
2008-10-03Fix building with CONFIG_DAHDI_NET . It builds, but will it run?Tzafrir Cohen
Patch dahdi-base.c.hdlc.patch by biohumanoid that fixes some aparant copy&paste errors. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5046 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-03Fix some compilation problems that show up when CONFIG_DAHDI_DEBUG is defined.Sean Bright
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5045 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-01DAHDI should always make data received from the PSTN available to user modeShaun Ruffell
immediately. Only allow the transmit buffering policy to be changed in order to reduce the chance of underruns to the PSTN. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5021 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-28Fixes failure of modular echo cancelers in DAHDI.Shaun Ruffell
Reported by lots of people, fix suggested by mattf. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5002 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-26The channel master should not be set to 0, but rather should be 'cleared' byShaun Ruffell
setting the channel to be it's own master. (related to issue 11611) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4990 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-18close_channel is called with a spin_lock held, which means that GFP_KERNEL canShaun Ruffell
not be used for the memory allocations down that call path. Have allocations in this call path check if they are in atomic context and use the appropriate flags. Issue: DAHDI-195 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4956 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-17Turn off reference counting on the echo canceller modules in order to preventShaun Ruffell
misconfigurations from preventing the drivers from unloading. NOTE: This is only a temporary workaround, since it also means that the echocanceller can be unloaded by an administrator while in use, which would most likely result in a kernel oops. Related to issue #13504. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4917 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-15Edit some comments and error strings.Shaun Ruffell
Issue: DAHDI-13 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4909 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-11Fix a type used in nethdlc mode, as pointed out in #13427 .Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4900 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-06Fix buglet in #define for 2.6.9Matthew Fredrickson
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4870 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-09-06Fix class_simple on old 2.6.9 kernelsMatthew Fredrickson
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4868 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-29Remove useless kzallocMatthew Fredrickson
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4856 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-24Add support for 56 KB HDLC as well as selectable rate via ioctlMatthew Fredrickson
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4817 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-20improve compatibility with 2.6.26 and 2.6.27 kernelsKevin P. Fleming
(closes issue #13253) Reported by: raiden Patches: zap-dev.patch uploaded by smurfix on issue #13277 (license 547) zap-sema.patch uploaded by smurfix on issue #13277 (license 547) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4801 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-06last round of license header updates hereKevin P. Fleming
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4721 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-06A significant change to the DAHDI transcoder interface and the wctc4xxpShaun Ruffell
driver which breaks backwards compatibility. Basically, I've replaced the memory mapped interface with a read/write interface that allows codec_dahdi to communicate with the hardware transcoder the exact size of the packet to be transcoded. This eliminates issues with remote devices that send G729.B CNG packets even though asterisk does not support them. From a user standpoint: - The transcoder drivers are much more robust in light of system / external conditions. From a developer standpoint: - DAHDI_TRANSCODE_OP is no longer supported, instead use DAHDI_TC_ALLOCATE, DAHDI_TC_GETINFO, and write/read. - Memory and stack usage is reduced (stack usage could still be reduced some more by continuing the process of getting rid of the users of wctc4xxp_send_cmd and wctc4xxp_create_cmd). - If more than one card is in the system channels will be allocated in a round-robin fashion from all available cards, reducing contention for the supervisor channel. - There is no longer a tc400b workqueue created that will not show up in the process list. - Commands and their responses are now explicitly matched up which elimated certain errors caused by unsolicited messages from the transcoder confusing the driver. - There is now an option to export a network interface for capturing traffic to/from the hardware transcoder. - codec_test has been removed from the dadhi/linux package. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4717 a0bf4364-ded3-4de4-8d8a-66a801d63aff