summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
AgeCommit message (Collapse)Author
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
2008-08-05Fix a small regression from r4667: Please don't NULL a good pointer.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4705 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-05In the function start_digit(), the same logic was replicated 3 times; one timeRussell Bryant
for dtmf, one for mfr2_fwd, and one for mfr2_rev. So, I created a new function which handles all three cases in a way that is (IMO) easier to read. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4699 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-04 - Tweak some formatting to match coding guidelinesRussell Bryant
- Localize a couple of variables - Use snprintf instead of sprintf git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4697 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-04Fix small regression from r4690: do use channo for printing channelTzafrir Cohen
numbers. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4694 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-04Tweak spacing and reduce indentationRussell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4692 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Re-work a for loop in proc_read. This loop traversed the array of all DAHDIRussell Bryant
channels and determined whether they belonged to the span being printed or not. This has been simplified by simply traversing the array of channels on the span structure, itself. Thanks to tzafrir for the idea in #asterisk-dev. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4690 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Do use printk-s without a priority when continuing previous printk.Tzafrir Cohen
Also remove a small duplication in dahdi-base.c, as I'm too lazy to fix in two separate places. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4688 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Strip trailing whitespaceRussell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4686 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Change all instances of printk in DAHDI to include a priorityRussell Bryant
(closes issue #11504) Reported by: tzafrir Patches: 20080717__issue11504_dahdi_printk_without_priority.diff uploaded by bbryant (license 36) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4685 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03reduce indentation and tweak formatting of a for loop in proc_readRussell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4684 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Get rid of dahdi_rxsig_t typedefRussell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4682 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Get rid of another typedef, sf_detect_state_t, and fix referencesRussell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4681 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Rework the table of signalling bits for signalling types and hook statesRussell Bryant
in dahdi_rbs_sethook() to a much more readable and less error prone format. In passing, get rid of the dahdi_txsig_t typedef, and fix uses of it throughout the tree. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4679 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03 - Formatting changes to better conform to guidelinesRussell Bryant
- tweak hw_echocan_on to reduce indentation and use an initializer instead of memset git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4677 a0bf4364-ded3-4de4-8d8a-66a801d63aff