Commit Graph

232 Commits

Author SHA1 Message Date
Oron Peled
38f916050a xpp: Remove few extra leading spaces
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9713 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:16:35 +00:00
Oron Peled
41d71c3c99 xpp: Use our KZALLOC/KZFREE
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9712 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:14:49 +00:00
Oron Peled
e208a25a7c xpp: use phonedev_cleanup() instead of inline code
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9711 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:13:39 +00:00
Oron Peled
c94f184673 xpp: Add fixed runtime checks for the PHONEDEV code
Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9710 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:12:02 +00:00
Tzafrir Cohen
5b09167d68 xpp: init_card_4_30: add comment
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9709 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:10:33 +00:00
Oron Peled
a911c10f61 xpp: Kbuild: always update version string
* Keep the xpp version number up-to-date
* Non-verbose build output.

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9708 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 18:06:16 +00:00
Oron Peled
1331610048 xpp: phonedev: Cleanup method macros
* Caller to CALL_XMETHOD() no longer need to explicitly pass xbus
  (calculate xpd->xbus)
* Create CALL_PHONE_METHOD() similar to CALL_XMETHOD() -- inlining
  the extra parameters (more readable)
* Reverse parameter order in PHONE_METHOD() and CALL_PHONE_METHOD()
  to be consistent with XMETHOD() and CALL_XMETHOD()
* Rename XPD_STATE phonedev method to card_state:
  - Consistency with other phonedev methods.
  - These calls now Wrap internal calls to XPD_STATE protocol HOSTCMD
    in PRI, BRI, FXS, FXO

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9706 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 14:14:14 +00:00
Oron Peled
1584ff6a7d xpp: More adaptations for non-PHONEDEV XPDs
* Add IS_PHONEDEV(xpd) macro
* Reject dahdi_register_xpd()/dahdi_unregister_xpd() for non-PHONEDEV
* Make sysfs 'offhook' attribute contain '\n' if empty (no channels)
* Skip PHONEDEV related xbus_tick() parts -- we still want to process
  the end of it for the card_tick() calls.
* Remove BUG_ON() for missing phoneops
  (also remove old duplicate test for XBUS_IS...)
* Call XPD_STATE method only for PHONEDEV XPD's

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9705 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 14:13:22 +00:00
Oron Peled
af702dafff xpp: prepare for phonedev refactor
* Allow having XPDs that represent a device that is not a span.
* Refactor all span related data from 'struct xpd' to 'struct phonedev'
* Refactor span related methods into 'phonedev->phoneops'
* Refactor phone related initialization into phonedev_init()/phonedev_cleanup()

Signed-off-by: Oron Peled <oron@actcom.co.il>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9704 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30 14:11:49 +00:00
Matthew Fredrickson
dd73a1c778 Fix for bugs in timing selection when B410P card is not the first configured card in system.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9701 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-27 20:58:40 +00:00
Shaun Ruffell
08200e4a7e wct4xxp: Do not place _t4_remove_one in module exit section.
_t4_remove_one is now used during module initialization so it should not
be placed in the exit section of the module.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9650 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-20 19:01:17 +00:00
Shaun Ruffell
e9aae4933a wctdm24xxp: Replace interruptible_sleep_on with wait_event_interruptible.
Eliminates the interruptible_sleep_on deprecated and prevents the driver from
triggering the SLEEP_ON_BKLCHECK warning.

It is still desirable to convert the cmdq to something more like what is in
the single span to eliminate the need to schedule the sleeping process every
millisecond while we're waiting for the command to complete.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9646 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-20 14:32:58 +00:00
Shaun Ruffell
8b68d2dd1b dahdi: Constify the data parameter to __buf_push.
Just clarifying a parameter that is never updated.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9644 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-18 20:25:35 +00:00
Shaun Ruffell
3cee9adfbb dahdi: Trivial. Move process_masterspan description.
Move the description of the master span processing to above the
process_masterspan function.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9643 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-18 20:25:31 +00:00
Shaun Ruffell
f2b7303161 dahdi: Fix recent regression with native bridging.
This fixes a regression introduced in r9603.  That commit removed
DAHDI_CONF_DIGITALMON handling (which is used to natively bridge two
channels that cannot be crossed in the board driver / hardware) since I
mistakenly thought that it was only part of the DACS handling.  The
symptom of the regression is muted audio when Asterisk tries to natively
bridge two channels.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9642 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-18 20:25:26 +00:00
Shaun Ruffell
4fea8415d6 dahdi: Permit open pseudo channels before spans are registered.
Move pseudo channel numbers up into a high range so that their presence
does not interfere with assigning channel numbers for the channels
implemented on spans. Otherwise, if a pseudo channel was opened up
before an expected span was registered, all the channel numbers in the
newly registered span would be bumped up one. This does limit the number
of real channels that a single system may have registered to 32K (but in
dahdi-linux 2.4.0 and below you were limited to 1024 channels anyway,
both real and pseudo).

Also, the string name of the Pseudo channel is now based off the
number of Pseudo channels and not the total number of channels.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9637 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-17 17:17:52 +00:00
Shaun Ruffell
6b797b607b wct4xxp: Check the return value of dahdi_register call.
If dahdi_register fails, we would like the error to propagate to the
user who ran modprobe.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9636 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-17 17:17:44 +00:00
Shaun Ruffell
9b745d29dd wct4xxp: Perform an extended reset on PCI-Express cards by default.
Extended reset is needed primarily with the PCI express version of the
dual and quad-span cards.  Enable it by default for those cards and
allow it to be forced on or off globally for the driver as a compile
time option.

The options to force it should be able to come out if there aren't any
further reports that the compile time option needs to be set.

DAHDI-773

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9635 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-17 17:17:39 +00:00
Tzafrir Cohen
cd595df1c3 dahdi-sysfs: include slab.h for newer kernels
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9633 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-16 21:12:20 +00:00
Tzafrir Cohen
7e6509855a Remove the (now) duplicate rule
Now that makefw has the proper name, the rule to create it is
automatically generated by Kbuild. Removed.


git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9632 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-16 20:19:56 +00:00
Tzafrir Cohen
11edb7d2b5 Fixes accidental generation of drvers/dahdi/$(obj)
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-16 17:21:16 +00:00
Tzafrir Cohen
69f3c96690 Refactor SysFS code to dahdi-sysfs.c
* 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-16 14:18:18 +00:00
Tzafrir Cohen
adb849e064 cleaner error handling in dahdi_register
* 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-10 21:42:49 +00:00
Tzafrir Cohen
52cc07ecb1 span_sysfs_{create,remove}
* 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-10 21:42:00 +00:00
Tzafrir Cohen
98aa2844c1 Pass error val from dahdi_register_echocan_factory
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-10 21:36:41 +00:00
Tzafrir Cohen
244dd928e5 separate device init functions
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-10 21:30:54 +00:00
Shaun Ruffell
d5520c533a dahdi: Do not call dahdi_check_conf under lock.
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-06 21:34:10 +00:00
Shaun Ruffell
68c0c37691 dahdi: Ensure we have room to keep all span channels contiguous.
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-05 15:52:10 +00:00
Shaun Ruffell
a45f853395 dahdi: Move the default tone lengths into include/dahdi/dahdi_config.h
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-05 15:52:03 +00:00
Tzafrir Cohen
d4c047f5d9 dahdi: Also use constant for DAHDI_TRANSCODE
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-03 21:17:17 +00:00
Shaun Ruffell
588d311c62 dahdi: Break the dahdi_ctl_ioctl handlers into separate functions.
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-03 18:28:28 +00:00
Shaun Ruffell
9f790b7859 dahdi: Do not locate new master in interrupt context.
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-03 18:28:24 +00:00
Shaun Ruffell
e5cbedbf37 dahdi: Add module parameter to limit number of pseudo channels.
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-03 18:28:19 +00:00
Shaun Ruffell
579ea560ef dahdi: Remove 'chans' array from reg/unreg. Now completely removed.
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-03 18:28:15 +00:00
Shaun Ruffell
b3aa15a793 dahdi: Remove three maxchans/DAHDI_MAX_CHANNELS references.
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-03 18:28:11 +00:00
Shaun Ruffell
6f8b5cefe5 dahdi: Drop 'chans' reference in chan_from_num.
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-03 18:28:06 +00:00
Shaun Ruffell
4533614fb6 dahdi: Group all conditions for skipping channel receive together.
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-03 18:28:02 +00:00
Shaun Ruffell
5002e537c3 dahdi: Move the slave channel processing into separate functions.
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-03 18:27:58 +00:00
Shaun Ruffell
766d0755fd dahdi: Save pointer to monitored channel in struct dahdi_chan.
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-03 18:27:53 +00:00
Shaun Ruffell
88345e505a dahdi: When DACS is enabled, hold a pointer directly to the crossed channel.
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-03 18:27:49 +00:00
Shaun Ruffell
7c49f372c2 dahdi: Only check for NOSTDTXRX once in dahdi_receive.
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-03 18:27:44 +00:00
Shaun Ruffell
9d4a2fad78 dahdi: Trivial formatting change in dahdi_receive.
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-03 18:27:40 +00:00
Shaun Ruffell
8053657761 dahdi: Change dahdi_chan.nextslave from index to a pointer.
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-03 18:27:36 +00:00
Shaun Ruffell
c380e4d91e dahdi: Use 'dacs_chan' convenience pointer in dahdi_ioctl_chanconfig.
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-03 18:27:31 +00:00
Shaun Ruffell
800c356cf3 dahdi: Remove arbitrary limit on number of spans in the kernel.
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-03 18:27:27 +00:00
Shaun Ruffell
7a6d71f35c dahdi: Move the contents of digits.h directly into dahdi-base.c
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-03 18:27:23 +00:00
Shaun Ruffell
89d96a16b5 dahdi: Cleanup formatting in dahdi_ioctl_set_dialparams().
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-03 18:27:18 +00:00
Shaun Ruffell
a6b2fb1891 dahdi: Move DAHDI_SET_DIALPARAMS code into 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@9595 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-03 18:27:14 +00:00
Shaun Ruffell
daf96e677d dahdi: Change reference counting for tone zones.
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-03 18:27:10 +00:00
Shaun Ruffell
215d530887 dahdi: Introduce dahdi_kasprintf for pre 2.6.12 kernels.
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-03 18:27:05 +00:00