summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2011-01-16Fixes accidental generation of drvers/dahdi/$(obj)Tzafrir Cohen
If we tell Kbuild (at least of some versions) that the host program is $obj/makefw , it will attempt to create the full path of $(obj) for it under the current $(obj). git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9630 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-16Refactor SysFS code to dahdi-sysfs.cTzafrir Cohen
* Refactor SysFS and device-related code to drivers/dahdi/dahdi-sysfs.c . * Move common headers to drivers/dahdi/dahdi.h . This commit merely moves existing code and should have no functional change. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Oron Peled <oron.peled@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9628 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-10cleaner error handling in dahdi_registerTzafrir Cohen
* Better error handling in dahdi_register. * Fail registration if fails creating proc entry for span. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9626 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-10span_sysfs_{create,remove}Tzafrir Cohen
* Separate out device generation in dahdi_[un]register to separate functions. * As we don't keep anywhere the information of whether or not * there's an existing device node for a channel, I abuse an unused flag: DAHDI_FLAGBIT_DEVFILE (25), to mark if the channel has a sysfs node. DAHDI_FLAGBIT_DEVFILE is expected to be replaced later on with a proper pointer to the device (or embedding of the device). I prefer a simple flag for now as it does not break ABI. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9625 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-10Pass error val from dahdi_register_echocan_factoryTzafrir Cohen
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9624 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-10separate device init functionsTzafrir Cohen
Separate out device initialization and removal functions: dahdi_sysfs_init() and dahdi_sysfs_exit(). A safer way of generating the main device files. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9623 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-06dahdi: Do not call dahdi_check_conf under lock.Shaun Ruffell
dahdi_check_conf() acqurires the locks as needed when scanning the channels and should not be called under any spinlocks. Fixes a regression that Tzafrir reported in #asterisk-dev that he could trigger via "asterisk -rx 'channel originate Local/600@demo Application Meetme 3000,d'" Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9621 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-05dahdi: Ensure we have room to keep all span channels contiguous.Shaun Ruffell
This fixes a regression from r9609 that Tzafrir reported. If you register multiple spans, then remove the first span and try to register a new span with more channels then the old span, you could end up with multiple channels with the same number. This change ensures that spans are ordered and that channels on a span are always contiguous and ordered in relation to the spans. In previous released versions of DAHDI (2.4.0 and below) this condition would result in spans that may not have contiguous blocks of channels. So it fixes both a recent regression and improves the behavior. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9617 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-05dahdi: Move the default tone lengths into include/dahdi/dahdi_config.hShaun Ruffell
The default tone lengths are compile time options and they were in digits.h to make it easy for users to patch. Most of these settings are potentially overridden from user space via the DAHDI_SET_DIALPARAMS ioctl currently regardless of these settings. In r9597 I moved digits.h directly into dahdi-base.c since I thought it was broken out for sharing between compilation units as opposed to ease patching. I also changed the units of the default options to ms instead of in samples. This way if the sampling frequency changes the user will not need to update the defaults. Signed-off-by: Shaun Ruffell <sruffell@digium.com> asterisk-dev-reference: 4D236FD7.30707@digium.com git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9616 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Also use constant for DAHDI_TRANSCODETzafrir Cohen
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9614 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Break the dahdi_ctl_ioctl handlers into separate functions.Shaun Ruffell
This is a cleanup as part of simplifying reference counting for the spans. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9612 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Do not locate new master in interrupt context.Shaun Ruffell
When a span goes into alarm it will look for a potential new master span. For dynamic spans that are running their processing in the sync_tick callback, the chan_lock will already be held. Therefore, push the locating of a new master out to the global workqueue. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9611 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Add module parameter to limit number of pseudo channels.Shaun Ruffell
Since there isn't a fixed array to hold all the channels, and also limit the total number of channels that can be created, we'll add a module parameter to allow the system administrator to specify the maximum number of pseudo channels. This is to prevent a potentially non-privledged process from consuming too much CPU (since all pseudos are checked each "tick" for conferencing) and kernel memory. By default the number of pseudo channels is limited to 512. Change the default limit with: ]# modprobe dahdi max_pseudo_channels=<new limit> or at runtime with: ]# echo <new limit> > /sys/module/dahdi/parameters/max_psuedo_channels Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9610 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Remove 'chans' array from reg/unreg. Now completely removed.Shaun Ruffell
Remove the remaining locations the 'chans' array was referenced but keep the observable behavior the same. Namely, channels are numbered in registration order. Only now it's possible to renumber channels easily since their number is not also their implied location in the 'chans' array. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9609 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Remove three maxchans/DAHDI_MAX_CHANNELS references.Shaun Ruffell
In dahdi_chec_conf, dahdi_chan_unreg, and dahdi_ioctl_confdiag maxchans and DAHDI_MAX_CHANNELS was used to scan through all the channels. Since the channels are stored on the list of spans and list of pseudo channels, we can directly iterate through those lists. This also paves the way for removing the arbitrary limit on the number of channels in the driver. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9608 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Drop 'chans' reference in chan_from_num.Shaun Ruffell
Part of getting rid of global chans array. We need to search the list of spans and the list of pseudo channels. While this is slower than a direct index into a 'chans' array, the places where this function is called are not in the 'hot' path but instead part of channel configuration and conferencing setup. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9607 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Group all conditions for skipping channel receive together.Shaun Ruffell
Streamlines the function a bit by grouping the three conditions that would cause the channel receive to be completely skipped. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9606 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Move the slave channel processing into separate functions.Shaun Ruffell
IMO this improves readability of dahdi_receive and dahdi_transmit, and the compiler can decide if it is better to inline this in with the caller or break it out into a separate function. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9605 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Save pointer to monitored channel in struct dahdi_chan.Shaun Ruffell
When we're in monitor mode, we can save a pointer to the channel we are monitoring directly instead of dereferencing the 'chans' array each time. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9604 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: When DACS is enabled, hold a pointer directly to the crossed channel.Shaun Ruffell
This both removes the need to reference the 'chans' __dahdi_process_putaudio_chunk and __dahdi_process_getaudio_chunk, and allows the dahdi_receive / dahdi_transmit logic to be streamlined. DACS channels can no longer be echocanceled if crossed. However, if a channel was DACSed with dahi_cfg it couldn't have been echocanceled anyway since the echo cancelers are disabled on the channel by default. This change was originally contained in a patch kpfleming had floating around. I split it up and merged it. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Signed-off-by: Kevin P. Fleming <kpfleming@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9603 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Only check for NOSTDTXRX once in dahdi_receive.Shaun Ruffell
There is no need to check the flag on the master channel when processing all the slave channels. Originally part of a patch kpfleming had floating around. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Signed-off-by: Kevin P. Fleming <kpfleming@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9602 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Trivial formatting change in dahdi_receive.Shaun Ruffell
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9601 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Change dahdi_chan.nextslave from index to a pointer.Shaun Ruffell
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9600 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Use 'dacs_chan' convenience pointer in dahdi_ioctl_chanconfig.Shaun Ruffell
Eliminates the need to look for the channel number twice. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9599 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Remove arbitrary limit on number of spans in the kernel.Shaun Ruffell
Spans are no longer added to a static array, but they are chained together in a list. DAHDI_MAX_SPANS, while no longer used in the kernel, is still in include/dahdi/user.h since dahdi tools is currently using it. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9598 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Move the contents of digits.h directly into dahdi-base.cShaun Ruffell
Clarify that these definitions are not / no longer used outside dahdi-base.c. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9597 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Cleanup formatting in dahdi_ioctl_set_dialparams().Shaun Ruffell
Mainly I wanted to document that the global_dialparams is protected by the BKL so that it can be closely checked when lock_kernel is removed from DAHDI. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9596 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Move DAHDI_SET_DIALPARAMS code into separate function.Shaun Ruffell
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9595 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Change reference counting for tone zones.Shaun Ruffell
This change primarily is a memory reduction. Most users only ever have a single tone zone loaded so we can save some mostly unused pointers by using a list instead of an array. Since we also have a pointer to the dahdi_zone in struct dahdi_chan, we also don't need to store the integer that is an index into that array. This saves 4 bytes for every channel allocated in the system. Finally, we don't need a separate default_zone member since we're on a list, we can define the first element on the list to always be the default zone. Additionally, all reference counted structures in the drivers should standardize on kref as much as possible for simplicity. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9594 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Introduce dahdi_kasprintf for pre 2.6.12 kernels.Shaun Ruffell
kasprintf will be used in upcoming changes and it's not supported on RHEL4 kernels. This change essentially backports it. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9593 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Add error if CONFIG_BKL is not definedShaun Ruffell
Might help when someone wonders why they are now getting errors about "lock_kernel" being undefined. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9592 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: trivial. Remove unneccessary comment.Shaun Ruffell
Not only should you not reach that line, it's impossible for you to reach that line. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9591 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Minor fix for alloc/free of 'struct ecfactory'Shaun Ruffell
Do not allocate the structure with GFP_KERNEL under the lock in dahdi_echocan_factory_register and closes a leak in dahdi_echocan_factory_unregister. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9590 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Convert ecfactory_list_lock from rwlock to spinlock.Shaun Ruffell
rwlocks are slowly being deprecated because they typically do not provide the performance increase expected. Most of the ecfactory_list_lock acquiring is during setup and not in the hot path anyway, so we can just use the simpler spinlock semantics without the overhead of a semaphore or mutex. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9589 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Use a spinlock instead of a rwlock for 'zone_lock'Shaun Ruffell
rwlocks are deprecated and there aren't that many places where read_lock was called on the lock anyway. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9588 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi, xpp: dahdi_span_ops.sync_tick should return void.Shaun Ruffell
Since the return value is not defined/used just return void. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9587 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Trivial move of sync_tick callback to inline function.Shaun Ruffell
This is a trivial cleanup to primarily to remove the #ifdef test out of process_masterspan. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9586 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03'dahdi_copy_string()' -> 'strlcpy()'Shaun Ruffell
There is already a safe string copying function in all the kernels DAHDI currently supports. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9585 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03"struct pci_device_id[]" -> "DEFINE_PCI_DEVICE_TABLE"Shaun Ruffell
2.6.25 added the DEFINE_PCI_DEVICE_TABLE macro to make sure that the pci_device_id tables are put into the correct section in the binary. Convert all the places where the tables were defined to use them. This is linux-2.6 commit where the change went in along with the rationale: 90a1ba0c5e39eeea278f263c28ae02166c5911c8 Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9584 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Take a reference count on module when operating on spans directly.Shaun Ruffell
Normally, spans are accessed via channels, which increment the reference count on the supporting module as part of the open call. When operating on spans by number we are susceptible to a module_unload while we are accessing the span. Renames find_span to span_find_and_get to indicate that we're both finding the span by number and increasing the reference count on the span. Spans themselves don't currently have reference counts, but we can increment the reference count on the module that owns the spans. This will prevent the module that has the span from unloading in the middle of a span_config call, which in the case of the wcte12xp can take awhile since the VPM firmware is loading. Hopefully in the near future the spans themselves will be reference counted directly. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9583 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Add the span onto the list as the very last thingShaun Ruffell
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9582 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi: Allow spans to advertise if they can provide any timing.Shaun Ruffell
Some spans, specifically dynamic local spans, should never be the timing master since they are dependent on some other timing source driving them. The bit in 'struct dahdi_span' is named cannot provide timing so that by default the other drivers will set it to 0. This is loosely related to issue #13205 but doesn't address any of the other elements of that issue about how to allow the user to configure what the master span order of succession is. (issue #13205) Reported by: biohumanoid Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9581 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: Do not depend on BKL for serialization of dspan creation.Shaun Ruffell
Also makes it safe to unregister a dynamic driver when there aren't any open channels on the dynamic spans. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9580 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: Pass the dahdi_dynamic to create/destroy functions.Shaun Ruffell
This allows the pvt member to be set under lock without holding the lock through the call to create destroy. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9578 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: Do not enable tasklets by default for dynamic_spans.Shaun Ruffell
Running in tasklets does not work well when dahdi doesn't have a span that is acting as the master. In this case, process_masterspan is being called in system timer that may not be running at 1ms intervals. The end result is that the dynamic_run function isn't called for every chunk processed, and there is data loss. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9577 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: Use dahdi_span_ops.sync_tick for driving dynamic spans.Shaun Ruffell
Dynamic spans that are unable to provide their own timing, like dahdi local spans, typically derived their timing source from dahdi_dynamic_ioctl(0,0) call in process_masterspan. This change uses the sync_tick member of dahdi_span_ops instead so that dynamic operations do not happen on a span until it is fully registered. Also removes the check for dahdi_dynamic_ioctl in process masterspan for those users that never load a dynamic span. This was originally suggested in a comment on: (issue #13205) Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9576 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: Remove tests for KERNEL_VERSION < 2.6.9Shaun Ruffell
2.6.9 is the earliest kernel version currently supported by DAHDI. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9575 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: constify the address parameter to create.Shaun Ruffell
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9574 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: dynamic drivers should not reference count themselves.Shaun Ruffell
Move the try_module_get/module_put calls from the various dynamic drivers into the "core" dahdi_dynamic.c file itself. This way, a reference count can always be held while calling through the function pointers. This is enabled by adding an .owner field to 'struct dahdi_dynamic_driver'. Dynamic spans are also unique in dahdi in that they require a "dahdi_cfg -s" to stop them and release the references on the modules. This is counterintuitive. This change makes sure they are reference counted just like other spans and on driver unload, if there aren't any open handles from userspace, they will take care of unwinding themselves. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9573 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03dahdi_dynamic: "dahdi_dynamic_[un]register()" -> ↵Shaun Ruffell
"dahdi_dynamic_[un]register_driver()" Clarify that we're registering / unregistering the driver. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9572 a0bf4364-ded3-4de4-8d8a-66a801d63aff