Commit Graph

21 Commits

Author SHA1 Message Date
Shaun Ruffell
c885e2ae3b dahdi: Use 'chan' convenience pointer in process_masterspan.
Reduces the amount of indexing into the global channel array.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9363 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:33:11 +00:00
Shaun Ruffell
f907dc01b3 dahdi: Use 'chan' convenience pointer in dahdi_transmit.
I believe this makes it a little more clear what is happening.  Also could
provide a potential speedup if the span doesn't need to be constantly
dereferenced (although an optimizer might make this moot).  Regardless, this
change doesn't hurt.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9362 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:33:07 +00:00
Shaun Ruffell
488a849209 dahdi: chans[ms->confna] -> conf_chan.
In  __dahdi_process_getaudio_chunk and __dahdi_process_putaudio_chunk we
can streamline the operation slightly by saving a constant pointer to
the conference channel instead of constantly dereferencing the master
channel and indexing into the chan array.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9361 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:33:03 +00:00
Shaun Ruffell
3e0f903861 dahdi: Remove unused parameter in three ioctl handlers.
The 'int cmd' parameter is unused and unneeded in dahdi_ioctl_getgains,
dahdi_ioctl_setgains, and dahdi_ioctl_chandiag.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9360 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:59 +00:00
Shaun Ruffell
3c774e386b dahdi: Move handlers for DAHDI_[GET|SET]_PARAMS into separate functions.
Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9359 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:55 +00:00
Shaun Ruffell
b7545e9d0d dahdi: Move the conferencing ioctls into their own functions.
DAHDI_GETCONF, DAHDI_SETCONF, DAHDI_CONFLINK, and DAHDI_CONFDIAG are all
now in their own functions.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9358 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:51 +00:00
Shaun Ruffell
1e068dcf6c dahdi: Move DAHDI_CHANCONFIG ioctl into separate function.
Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9357 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:47 +00:00
Shaun Ruffell
8a8d98f210 dahdi: Move DAHDI_CHANDIAG ioctl into separate function.
Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9356 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:43 +00:00
Shaun Ruffell
01267db394 dahdi: Refactor some of the access to the 'spans' array.
It is still used at span registration / unregistration to assign the span
number, and when iterating through all spans. Otherwise, moves the code base a
step closer to removal of the 'spans' array.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9355 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:39 +00:00
Shaun Ruffell
ee7057f87a dahdi: Embed the proc entries in struct dahdi_span.
Part of preparations for replacing the array of spans with a list of
spans.

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9354 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:35 +00:00
Shaun Ruffell
5514b84e06 dahdi: Be more tolerant of surprise removal of channels.
Enable DAHDI to detect if an operation on a file handle refers to a
channel that may have been unregistered. This can occur, for example,
when a board driver is hot-swapped out in a live system.

This patch ensures that file->private_data is always properly set for
any open channel, and it's set back to NULL when a channel is
unregistered.  This way file->private_data can be used to check whether
it's valid to perform an operation on the channel.  (NOTE:  There is
still a race condition here if the driver was unbound on one processor
during the window of time between when file->private_data was checked
and the system call finishes).

Also, since DAHDI should only return -ENODEV on read or write when there
was a surprise device removal on a running system this sleep can prevent
the system from becoming unresponsive if the userspace application does
not check for the -ENODEV error and constantly tries to call read with
elevated privileges.

(issue #17669)
Reported by: tzafrir
Tested by: sruffell

Review: https://reviewboard.asterisk.org/r/905/

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9353 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 20:32:29 +00:00
Shaun Ruffell
078b3b7bbc dahdi: Remove '#if 1' in dahdi_transmit.
Most likely some stale debugging code that slipped in and is now gone.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9350 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-20 18:54:55 +00:00
Shaun Ruffell
2cc62b7c05 dahdi: 0 -> DAHDI_LAW_DEFAULT
Makes it a little more clear what the '0' parameter represents.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9324 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-14 14:02:33 +00:00
Shaun Ruffell
5dc10d2aef dahdi: Remove unused functions __buf_munge and __buf_cpush.
These functions were only defined if BUF_MUNGE was defined, but even if
that symbol is defined there is not anyplace in the driver where these
functions were then called.  This has been in the code since rev 87 so
this is most likely stale debugging code.

Feel free to revert if this is actually used somewhere that is not
apparent.

Here is where the functions were originally added to the drivers:
http://svnview.digium.com/svn/zaptel?view=revision&revision=87

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9322 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-14 02:20:58 +00:00
Shaun Ruffell
1d5d934052 dahdi: Remove the unused label from __buf_pull and __buf_push calls.
These label parameters were not used in the functions. They are most
likely some debug code that was left over.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9321 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-14 02:20:54 +00:00
Kinsey Moore
048634fc5f dahdi-base: All channels for a span are now unconfigured on shutdown
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9317 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-10 15:54:36 +00:00
Russ Meyerriecks
f2fa702132 dahdi-base: Hide "Master changed to" message
Put the "Master changed to xxx/x/x" message behind a debug flag. It's an
implementation specific detail and has caused confusion with customers.
DAHDI-692

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9299 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-03 21:08:05 +00:00
Shaun Ruffell
40ad4a85a3 dahdi: A couple of trivial spelling changes.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9248 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-01 15:46:27 +00:00
Shaun Ruffell
e88554710f dahdi: Fix compilation error when CONFIG_DAHDI_NET is defined.
Kernel interface for network devices changed. This is the patch from issue
plus a few trivial checkpatch.pl formatting changes (minus the >80 column
warnings).

(closes issue #17857)
Reported by: msink
Patches:
      dahdi_net-v2.patch uploaded by msink (license 1103)

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9247 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-01 15:46:26 +00:00
Shaun Ruffell
892fe4b325 dahdi, dahdi_transcode: Remove mmap interface.
There are not any existing users of the interface (and it would always
return -ENOSYS to the caller anyway).

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9246 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-09-01 15:46:25 +00:00
Shaun Ruffell
bf3fe05dfb wct4xxp: Moving the transmit short detection behind debug module param.
This needs some more testing before it's on by default.  If the card is
otherwise functioning, these messages may be confusing to the user.  If
the card is not functioning, the driver can be reloaded with debug to
check for this condition.

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

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9205 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-08-27 21:59:27 +00:00