[svn-commits] sruffell: branch linux/sruffell/dahdi-transcoder r4715 - in /linux/team/sruff...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 6 11:57:29 CDT 2008


Author: sruffell
Date: Wed Aug  6 11:57:28 2008
New Revision: 4715

URL: http://svn.digium.com/view/dahdi?view=rev&rev=4715
Log:
Merged revisions 4628,4630,4636-4637,4641,4643,4648,4651,4653,4655,4657-4659,4662,4664-4665,4667-4669,4671-4673,4675,4677,4679-4682,4684-4686,4688,4690,4692,4694-4695,4697,4699,4702-4703,4705,4709 via svnmerge from 
https://origsvn.digium.com/svn/dahdi/linux/trunk

........
r4628 | kpfleming | 2008-07-29 15:03:52 -0700 (Tue, 29 Jul 2008) | 2 lines

make an initial split of dahdi/kernel.h into userspace- and kernelspace-specific parts

........
r4630 | kpfleming | 2008-07-29 15:11:25 -0700 (Tue, 29 Jul 2008) | 2 lines

missed one definition needed by Asterisk 1.6/trunk

........
r4636 | kpfleming | 2008-07-30 08:14:58 -0700 (Wed, 30 Jul 2008) | 2 lines

remove extraneous file from .PHONY

........
r4637 | kpfleming | 2008-07-30 08:18:58 -0700 (Wed, 30 Jul 2008) | 2 lines

use a better technique to ensure that version.h gets updated when necessary

........
r4641 | kpfleming | 2008-07-31 09:21:27 -0700 (Thu, 31 Jul 2008) | 2 lines

would help if we didn't copy a NULL pointer and then try to dereference it...

........
r4643 | kpfleming | 2008-08-01 14:18:59 -0700 (Fri, 01 Aug 2008) | 8 lines

fix problem accepting non-linearized skbs from NIC drivers

(closes issue #13204)
Reported by: biohumanoid
Patches:
      ztd-eth.c.patch uploaded by biohumanoid (license 459) (modified by me to actually apply to DAHDI)


........
r4648 | kpfleming | 2008-08-01 15:07:28 -0700 (Fri, 01 Aug 2008) | 2 lines

make skb_linearize() work for kernels <= 2.6.17 too

........
r4651 | kpfleming | 2008-08-01 15:46:02 -0700 (Fri, 01 Aug 2008) | 6 lines

fix a couple of places where the driver assumed 4 spans were present on the card

(closes issue #13141)
Reported by: pabelanger


........
r4653 | kpfleming | 2008-08-01 16:07:28 -0700 (Fri, 01 Aug 2008) | 6 lines

use correct logic to handle a slave channel being removed from a master channel, so if the master channel itself is not reconfigured it will still end up properly linking to any remaining slaves

(closes issue #11611)
Reported by: richvdh
Tested by: tzafrir

........
r4655 | russell | 2008-08-01 21:17:00 -0700 (Fri, 01 Aug 2008) | 2 lines

Space out the definition of an enum, and remove an unused typedef

........
r4657 | russell | 2008-08-01 21:38:56 -0700 (Fri, 01 Aug 2008) | 2 lines

convert a list of defines to an enum

........
r4658 | russell | 2008-08-01 21:39:28 -0700 (Fri, 01 Aug 2008) | 2 lines

Convert most of the existing comments in kernel.h to doxygen format

........
r4659 | russell | 2008-08-01 21:41:11 -0700 (Fri, 01 Aug 2008) | 1 line

ignore tags
........
r4662 | russell | 2008-08-02 06:59:43 -0700 (Sat, 02 Aug 2008) | 3 lines

- use kzalloc instead of kmalloc+memset
- reformat dahdi_q_sig to match proper coding guidelines

........
r4664 | russell | 2008-08-02 07:56:38 -0700 (Sat, 02 Aug 2008) | 5 lines

- align case with switch
- constify return of sigstr()
- rework implementation of fill_alarm_string to only use one call to snprintf()
  and avoid more complicated string building logic

........
r4665 | russell | 2008-08-02 08:15:50 -0700 (Sat, 02 Aug 2008) | 2 lines

kzalloc was introduced in later versions of 2.6, so use kcalloc instead

........
r4667 | russell | 2008-08-02 12:59:37 -0700 (Sat, 02 Aug 2008) | 4 lines

 - Define kzalloc() for kernel versions that don't have it
 - Use kzalloc instead of kmalloc+memset
 - formatting tweaks to better conform to coding guidelines

........
r4668 | russell | 2008-08-02 13:07:24 -0700 (Sat, 02 Aug 2008) | 2 lines

Update copyright, and fix a typo in some HDLC code that I wasn't building

........
r4669 | russell | 2008-08-02 13:17:43 -0700 (Sat, 02 Aug 2008) | 3 lines

 - simplify some code using ARRAY_SIZE
 - don't put multiple statements on the same line

........
r4671 | russell | 2008-08-02 13:22:13 -0700 (Sat, 02 Aug 2008) | 2 lines

Use C99 instead of GNU style initializers

........
r4672 | russell | 2008-08-02 13:33:18 -0700 (Sat, 02 Aug 2008) | 5 lines

 - use C99 instead of GNU initializers
 - adding spaces and braces according to guidelines
 - use for loop instead of a while loop for open coded list traversal
 - reduce some indentation

........
r4673 | russell | 2008-08-02 13:42:54 -0700 (Sat, 02 Aug 2008) | 6 lines

Rework free_tone_zone a bit to avoid a potential memory leak in a weird scenario.
It was theoretically possible that a zone was registered after we removed a zone,
but before we tried to put it back after determining that it was busy.  If this
occurred, then when putting the zone back, we would overwrite the reference to
the newly created zone, leaking the associated memory.

........
r4675 | russell | 2008-08-02 15:23:42 -0700 (Sat, 02 Aug 2008) | 2 lines

Convert dahdi timers to a kernel list instead of an open coded list

........
r4677 | russell | 2008-08-03 07:31:03 -0700 (Sun, 03 Aug 2008) | 3 lines

 - Formatting changes to better conform to guidelines
 - tweak hw_echocan_on to reduce indentation and use an initializer instead of memset

........
r4679 | russell | 2008-08-03 08:42:46 -0700 (Sun, 03 Aug 2008) | 5 lines

Rework the table of signalling bits for signalling types and hook states
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.

........
r4680 | russell | 2008-08-03 08:44:24 -0700 (Sun, 03 Aug 2008) | 2 lines

Fix a couple last references to dahdi_txsig_t.

........
r4681 | russell | 2008-08-03 08:48:43 -0700 (Sun, 03 Aug 2008) | 2 lines

Get rid of another typedef, sf_detect_state_t, and fix references

........
r4682 | russell | 2008-08-03 09:25:15 -0700 (Sun, 03 Aug 2008) | 2 lines

Get rid of dahdi_rxsig_t typedef

........
r4684 | russell | 2008-08-03 09:38:30 -0700 (Sun, 03 Aug 2008) | 2 lines

reduce indentation and tweak formatting of a for loop in proc_read

........
r4685 | russell | 2008-08-03 09:47:46 -0700 (Sun, 03 Aug 2008) | 7 lines

Change all instances of printk in DAHDI to include a priority

(closes issue #11504)
Reported by: tzafrir
Patches:
      20080717__issue11504_dahdi_printk_without_priority.diff uploaded by bbryant (license 36)

........
r4686 | russell | 2008-08-03 09:49:33 -0700 (Sun, 03 Aug 2008) | 2 lines

Strip trailing whitespace

........
r4688 | tzafrir | 2008-08-03 11:06:15 -0700 (Sun, 03 Aug 2008) | 5 lines

Do use printk-s without a priority when continuing previous printk.

Also remove a small duplication in dahdi-base.c, as I'm too lazy to
fix in two separate places.

........
r4690 | russell | 2008-08-03 16:04:23 -0700 (Sun, 03 Aug 2008) | 7 lines

Re-work a for loop in proc_read.  This loop traversed the array of all DAHDI
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.

........
r4692 | russell | 2008-08-03 17:27:47 -0700 (Sun, 03 Aug 2008) | 2 lines

Tweak spacing and reduce indentation

........
r4694 | tzafrir | 2008-08-04 06:43:18 -0700 (Mon, 04 Aug 2008) | 3 lines

Fix small regression from r4690: do use channo for printing channel
numbers.

........
r4695 | tzafrir | 2008-08-04 07:02:10 -0700 (Mon, 04 Aug 2008) | 7 lines

Firmware update: 5959 (FTMF and BRI ID)

* Fix some cases of double digits.
* Fix some rare cases of a BRI unit providing incorrect directionality.
* Extra debugging code in card_fxs.c to trace future DTMF issues.
* Properly note Zaptel (as opposed to DAHDI) ioctls.

........
r4697 | russell | 2008-08-04 14:43:45 -0700 (Mon, 04 Aug 2008) | 4 lines

 - Tweak some formatting to match coding guidelines
 - Localize a couple of variables
 - Use snprintf instead of sprintf

........
r4699 | russell | 2008-08-04 17:54:49 -0700 (Mon, 04 Aug 2008) | 4 lines

In the function start_digit(), the same logic was replicated 3 times; one time
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.

........
r4702 | russell | 2008-08-05 08:55:32 -0700 (Tue, 05 Aug 2008) | 2 lines

Copy tools README over to the linux package

........
r4703 | russell | 2008-08-05 08:58:35 -0700 (Tue, 05 Aug 2008) | 2 lines

Fix alignment issues caused by different tab sizes

........
r4705 | tzafrir | 2008-08-05 11:34:16 -0700 (Tue, 05 Aug 2008) | 2 lines

Fix a small regression from r4667: Please don't NULL a good pointer.

........
r4709 | kpfleming | 2008-08-05 16:56:00 -0700 (Tue, 05 Aug 2008) | 3 lines

first pass at licensing cleanup here... put dahdi/user.h under LGPL instead of GPL


........

Added:
    linux/team/sruffell/dahdi-transcoder/LICENSE
      - copied unchanged from r4709, linux/trunk/LICENSE
    linux/team/sruffell/dahdi-transcoder/LICENSE.LGPL
      - copied unchanged from r4709, linux/trunk/LICENSE.LGPL
    linux/team/sruffell/dahdi-transcoder/README
      - copied unchanged from r4709, linux/trunk/README
    linux/team/sruffell/dahdi-transcoder/include/dahdi/fasthdlc.h
      - copied unchanged from r4709, linux/trunk/include/dahdi/fasthdlc.h
Removed:
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/fasthdlc.h
Modified:
    linux/team/sruffell/dahdi-transcoder/   (props changed)
    linux/team/sruffell/dahdi-transcoder/Makefile
    linux/team/sruffell/dahdi-transcoder/UPGRADE.txt
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/adt_lec.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/arith.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/biquad.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi-base.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_config.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_dummy.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_dynamic.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_dynamic_eth.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_dynamic_loc.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_echocan_kb1.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_echocan_mg2.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_echocan_sec.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_echocan_sec2.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi_transcode.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/digits.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/ecdis.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/fir.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/fxo_modes.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/hpec/dahdi_echocan_hpec.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/pciradio.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/proslic.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/tor2-hw.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/tor2.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/voicebus.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/voicebus.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wcfxo.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wct1xxp.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wct4xxp/base.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wct4xxp/vpm450m.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wct4xxp/wct4xxp-diag.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wctc4xxp/base.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wctdm.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wctdm24xxp/GpakApi.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wctdm24xxp/GpakCust.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wctdm24xxp/base.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wcte11xp.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wcte12xp/GpakApi.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wcte12xp/base.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wcte12xp/vpmadt032.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/wcte12xp/wcte12xp.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/card_bri.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/card_fxo.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/card_fxs.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/card_pri.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/dahdi_debug.h
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/firmwares/FPGA_1141.hex
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/firmwares/FPGA_1151.hex
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/firmwares/FPGA_FXS.hex
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/xbus-pcm.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/xframe_queue.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/xpp_dahdi.c
    linux/team/sruffell/dahdi-transcoder/drivers/dahdi/xpp/xproto.h
    linux/team/sruffell/dahdi-transcoder/include/dahdi/kernel.h
    linux/team/sruffell/dahdi-transcoder/include/dahdi/user.h
    linux/team/sruffell/dahdi-transcoder/include/dahdi/wctdm_user.h

Propchange: linux/team/sruffell/dahdi-transcoder/
------------------------------------------------------------------------------
    automerge = yes

Propchange: linux/team/sruffell/dahdi-transcoder/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Aug  6 11:57:28 2008
@@ -1,3 +1,4 @@
 .tmp_versions
 Module.symvers
 version.h
+tags

Propchange: linux/team/sruffell/dahdi-transcoder/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug  6 11:57:28 2008
@@ -1,1 +1,1 @@
-/linux/trunk:1-4625
+/linux/trunk:1-4711

Modified: linux/team/sruffell/dahdi-transcoder/Makefile
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-transcoder/Makefile?view=diff&rev=4715&r1=4714&r2=4715
==============================================================================
--- linux/team/sruffell/dahdi-transcoder/Makefile (original)
+++ linux/team/sruffell/dahdi-transcoder/Makefile Wed Aug  6 11:57:28 2008
@@ -80,7 +80,7 @@
 endif
 	$(KMAKE) modules DAHDI_BUILD_ALL=m
 
-include/dahdi/version.h:
+include/dahdi/version.h: FORCE
 	@DAHDIVERSION="${DAHDIVERSION}" build_tools/make_version_h > $@.tmp
 	@if cmp -s $@.tmp $@ ; then :; else \
 		mv $@.tmp $@ ; \
@@ -120,8 +120,11 @@
 install-include:
 	install -D -m 644 include/dahdi/kernel.h $(DESTDIR)/usr/include/dahdi/kernel.h
 	install -D -m 644 include/dahdi/user.h $(DESTDIR)/usr/include/dahdi/user.h
+	install -D -m 644 include/dahdi/fasthdlc.h $(DESTDIR)/usr/include/dahdi/fasthdlc.h
 # Include any driver-specific header files here
 	install -D -m 644 include/dahdi/wctdm_user.h $(DESTDIR)/usr/include/dahdi/wctdm_user.h
+	- at rm -f $(DESTDIR)/usr/include/zaptel/*.h
+	- at rmdir $(DESTDIR)/usr/include/zaptel
 
 uninstall-include:
 	rm -f $(DESTDIR)/usr/include/dahdi/kernel.h
@@ -222,4 +225,6 @@
 test:
 	./test-script $(DESTDIR)/lib/modules/$(KVERS) dahdi
 
-.PHONY: distclean dist-clean clean version.h all install devices modules stackcheck install-udev update install-modules install-include uninstall-modules firmware-download
+.PHONY: distclean dist-clean clean all install devices modules stackcheck install-udev update install-modules install-include uninstall-modules firmware-download
+
+FORCE:

Modified: linux/team/sruffell/dahdi-transcoder/UPGRADE.txt
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-transcoder/UPGRADE.txt?view=diff&rev=4715&r1=4714&r2=4715
==============================================================================
--- linux/team/sruffell/dahdi-transcoder/UPGRADE.txt (original)
+++ linux/team/sruffell/dahdi-transcoder/UPGRADE.txt Wed Aug  6 11:57:28 2008
@@ -60,13 +60,13 @@
 Notes about the dahdi-tools package:
 
 * Many tool names have changed:
-      ztcfg	      ->	dahdi_cfg
-      ztmonitor	      ->	dahdi_monitor
-      ztscan	      ->	dahdi_scan
-      ztspeed	      ->	dahdi_speed
-      zttest	      ->	dahdi_test
-      zttool	      ->	dahdi_tool
-      zapconf         ->        dahdi_genconf (deprecate genzaptelconf)
+      ztcfg      ->  dahdi_cfg
+      ztmonitor  ->  dahdi_monitor
+      ztscan     ->  dahdi_scan
+      ztspeed    ->  dahdi_speed
+      zttest     ->  dahdi_test
+      zttool     ->  dahdi_tool
+      zapconf    ->  dahdi_genconf (deprecate genzaptelconf)
 
 * The system configuration file has moved from /etc/zaptel.conf to
   /etc/dahdi/system.conf.

Modified: linux/team/sruffell/dahdi-transcoder/drivers/dahdi/adt_lec.h
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-transcoder/drivers/dahdi/adt_lec.h?view=diff&rev=4715&r1=4714&r2=4715
==============================================================================
--- linux/team/sruffell/dahdi-transcoder/drivers/dahdi/adt_lec.h (original)
+++ linux/team/sruffell/dahdi-transcoder/drivers/dahdi/adt_lec.h Wed Aug  6 11:57:28 2008
@@ -6,20 +6,19 @@
  * Kevin P. Fleming <kpfleming at digium.com>
  *
  * All rights reserved.
+ */
+
+/*
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2 as published by the
+ * Free Software Foundation. See the LICENSE file included with
+ * this program for more details.
  */
 
 #ifndef _ADT_LEC_H

Modified: linux/team/sruffell/dahdi-transcoder/drivers/dahdi/arith.h
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-transcoder/drivers/dahdi/arith.h?view=diff&rev=4715&r1=4714&r2=4715
==============================================================================
--- linux/team/sruffell/dahdi-transcoder/drivers/dahdi/arith.h (original)
+++ linux/team/sruffell/dahdi-transcoder/drivers/dahdi/arith.h Wed Aug  6 11:57:28 2008
@@ -1,10 +1,24 @@
-#ifndef _DAHDI_ARITH_H
-#define _DAHDI_ARITH_H
 /*
  * Handy add/subtract functions to operate on chunks of shorts.
  * Feel free to add customizations for additional architectures
  *
  */
+
+/*
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2 as published by the
+ * Free Software Foundation. See the LICENSE file included with
+ * this program for more details.
+ */
+
+#ifndef _DAHDI_ARITH_H
+#define _DAHDI_ARITH_H
 
 #ifdef CONFIG_DAHDI_MMX
 #ifdef DAHDI_CHUNKSIZE

Modified: linux/team/sruffell/dahdi-transcoder/drivers/dahdi/biquad.h
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-transcoder/drivers/dahdi/biquad.h?view=diff&rev=4715&r1=4714&r2=4715
==============================================================================
--- linux/team/sruffell/dahdi-transcoder/drivers/dahdi/biquad.h (original)
+++ linux/team/sruffell/dahdi-transcoder/drivers/dahdi/biquad.h Wed Aug  6 11:57:28 2008
@@ -10,20 +10,19 @@
  *
  * All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ */
+
+/*
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2 as published by the
+ * Free Software Foundation. See the LICENSE file included with
+ * this program for more details.
  */
 
 typedef struct

Modified: linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/view/dahdi/linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi-base.c?view=diff&rev=4715&r1=4714&r2=4715
==============================================================================
--- linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/sruffell/dahdi-transcoder/drivers/dahdi/dahdi-base.c Wed Aug  6 11:57:28 2008
@@ -4,9 +4,9 @@
  * Written by Mark Spencer <markster at digium.com>
  * Based on previous works, designs, and architectures conceived and
  * written by Jim Dixon <jim at lambdatel.com>.
- * 
+ *
  * Special thanks to Steve Underwood <steve at coppice.org>
- * for substantial contributions to signal processing functions 
+ * for substantial contributions to signal processing functions
  * in DAHDI and the Zapata library.
  *
  * Yury Bokhoncovich <byg at cf1.ru>
@@ -15,7 +15,7 @@
  * from Cisco 3620 to IBM x305 here in F1 Group
  *
  * Copyright (C) 2001 Jim Dixon / Zapata Telephony.
- * Copyright (C) 2001 -2006 Digium, Inc.
+ * Copyright (C) 2001 - 2008 Digium, Inc.
  *
  * All rights reserved.
  *
@@ -23,15 +23,15 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 
@@ -78,13 +78,10 @@
 
 /* #define BUF_MUNGE */
 
+#include <dahdi/version.h>
 /* Grab fasthdlc with tables */
 #define FAST_HDLC_NEED_TABLES
-#include "fasthdlc.h"
-
-#include <dahdi/version.h>
 #include <dahdi/kernel.h>
-#include <dahdi/user.h>
 
 #include "hpec/hpec_user.h"
 
@@ -152,7 +149,7 @@
 EXPORT_SYMBOL(dahdi_set_hpec_ioctl);
 
 #ifdef CONFIG_PROC_FS
-static struct proc_dir_entry *proc_entries[DAHDI_MAX_SPANS]; 
+static struct proc_dir_entry *proc_entries[DAHDI_MAX_SPANS];
 #endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
@@ -192,20 +189,33 @@
 
 static int debug;
 
-/* states for transmit signalling */
-typedef enum {DAHDI_TXSTATE_ONHOOK,DAHDI_TXSTATE_OFFHOOK,DAHDI_TXSTATE_START,
-	DAHDI_TXSTATE_PREWINK,DAHDI_TXSTATE_WINK,DAHDI_TXSTATE_PREFLASH,
-	DAHDI_TXSTATE_FLASH,DAHDI_TXSTATE_DEBOUNCE,DAHDI_TXSTATE_AFTERSTART,
-	DAHDI_TXSTATE_RINGON,DAHDI_TXSTATE_RINGOFF,DAHDI_TXSTATE_KEWL,
-	DAHDI_TXSTATE_AFTERKEWL,DAHDI_TXSTATE_PULSEBREAK,DAHDI_TXSTATE_PULSEMAKE,
-	DAHDI_TXSTATE_PULSEAFTER
-	} DAHDI_TXSTATE_t;
+/*!
+ * \brief states for transmit signalling
+ */
+enum dahdi_txstate {
+	DAHDI_TXSTATE_ONHOOK,
+	DAHDI_TXSTATE_OFFHOOK,
+	DAHDI_TXSTATE_START,
+	DAHDI_TXSTATE_PREWINK,
+	DAHDI_TXSTATE_WINK,
+	DAHDI_TXSTATE_PREFLASH,
+	DAHDI_TXSTATE_FLASH,
+	DAHDI_TXSTATE_DEBOUNCE,
+	DAHDI_TXSTATE_AFTERSTART,
+	DAHDI_TXSTATE_RINGON,
+	DAHDI_TXSTATE_RINGOFF,
+	DAHDI_TXSTATE_KEWL,
+	DAHDI_TXSTATE_AFTERKEWL,
+	DAHDI_TXSTATE_PULSEBREAK,
+	DAHDI_TXSTATE_PULSEMAKE,
+	DAHDI_TXSTATE_PULSEAFTER,
+};
 
 typedef short sumtype[DAHDI_MAX_CHUNKSIZE];
 
 static sumtype sums[(DAHDI_MAX_CONF + 1) * 3];
 
-/* Translate conference aliases into actual conferences 
+/* Translate conference aliases into actual conferences
    and vice-versa */
 static short confalias[DAHDI_MAX_CONF + 1];
 static short confrev[DAHDI_MAX_CONF + 1];
@@ -218,8 +228,7 @@
 static struct file_operations dahdi_fops;
 struct file_operations *dahdi_transcode_fops = NULL;
 
-static struct
-{
+static struct {
 	int	src;	/* source conf number */
 	int	dst;	/* dst conf number */
 } conf_links[DAHDI_MAX_CONF + 1];
@@ -227,7 +236,7 @@
 
 /* There are three sets of conference sum accumulators. One for the current
 sample chunk (conf_sums), one for the next sample chunk (conf_sums_next), and
-one for the previous sample chunk (conf_sums_prev). The following routine 
+one for the previous sample chunk (conf_sums_prev). The following routine
 (rotate_sums) "rotates" the pointers to these accululator arrays as part
 of the events of sample chink processing as follows:
 
@@ -263,11 +272,13 @@
 
 */
 
-#define DIGIT_MODE_DTMF 	0
-#define DIGIT_MODE_MFR1		1
-#define DIGIT_MODE_PULSE	2
-#define DIGIT_MODE_MFR2_FWD	3
-#define DIGIT_MODE_MFR2_REV	4
+enum dahdi_digit_mode {
+	DIGIT_MODE_DTMF,
+	DIGIT_MODE_MFR1,
+	DIGIT_MODE_PULSE,
+	DIGIT_MODE_MFR2_FWD,
+	DIGIT_MODE_MFR2_REV,
+};
 
 #include "digits.h"
 
@@ -281,16 +292,18 @@
 
 #if defined(CONFIG_DAHDI_MMX) || defined(ECHO_CAN_FP)
 #define dahdi_kernel_fpu_begin kernel_fpu_begin
-#endif	
-
-static struct dahdi_timer {
+#endif
+
+struct dahdi_timer {
 	int ms;			/* Countdown */
 	int pos;		/* Position */
 	int ping;		/* Whether we've been ping'd */
 	int tripped;	/* Whether we're tripped */
-	struct dahdi_timer *next;	/* Linked list */
+	struct list_head list;
 	wait_queue_head_t sel;
-} *zaptimers = NULL;
+};
+
+LIST_HEAD(zaptimers);
 
 #ifdef DEFINE_SPINLOCK
 static DEFINE_SPINLOCK(zaptimerlock);
@@ -304,7 +317,7 @@
 	atomic_t refcount;
 	char name[40];	/* Informational, only */
 	int ringcadence[DAHDI_MAX_CADENCE];
-	struct dahdi_tone *tones[DAHDI_TONE_MAX]; 
+	struct dahdi_tone *tones[DAHDI_TONE_MAX];
 	/* Each of these is a circular list
 	   of dahdi_tones to generate what we
 	   want.  Use NULL if the tone is
@@ -319,7 +332,7 @@
 };
 
 static struct dahdi_span *spans[DAHDI_MAX_SPANS];
-static struct dahdi_chan *chans[DAHDI_MAX_CHANNELS]; 
+static struct dahdi_chan *chans[DAHDI_MAX_CHANNELS];
 
 static int maxspans = 0;
 static int maxchans = 0;
@@ -379,12 +392,10 @@
 		}
 	}
 
-	if (!(cur = kmalloc(sizeof(*cur), GFP_KERNEL))) {
+	if (!(cur = kzalloc(sizeof(*cur), GFP_KERNEL))) {
 		write_unlock(&echocan_list_lock);
 		return -ENOMEM;
 	}
-
-	memset(cur, 0, sizeof(*cur));
 
 	cur->ec = ec;
 	INIT_LIST_HEAD(&cur->list);
@@ -423,107 +434,110 @@
 	memset(conf_sums_next, 0, maxconfs * sizeof(sumtype));
 }
 
-  /* return quiescent (idle) signalling states, for the various signalling types */
+/*!
+ * \return quiescent (idle) signalling states, for the various signalling types
+ */
 static int dahdi_q_sig(struct dahdi_chan *chan)
 {
 	int	x;
-
-	static unsigned int in_sig[NUM_SIGS][2] = {
-		{ DAHDI_SIG_NONE, 0},
-		{ DAHDI_SIG_EM, 0 | (DAHDI_ABIT << 8)},
-		{ DAHDI_SIG_FXSLS,DAHDI_BBIT | (DAHDI_BBIT << 8)},
-		{ DAHDI_SIG_FXSGS,DAHDI_ABIT | DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8)},
-		{ DAHDI_SIG_FXSKS,DAHDI_BBIT | DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8)},
-		{ DAHDI_SIG_FXOLS,0 | (DAHDI_ABIT << 8)},
-		{ DAHDI_SIG_FXOGS,DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8)},
-		{ DAHDI_SIG_FXOKS,0 | (DAHDI_ABIT << 8)},
-		{ DAHDI_SIG_SF, 0},
+	static const unsigned int in_sig[NUM_SIGS][2] = {
+		{ DAHDI_SIG_NONE,  0 },
+		{ DAHDI_SIG_EM,    (DAHDI_ABIT << 8) },
+		{ DAHDI_SIG_FXSLS, DAHDI_BBIT | (DAHDI_BBIT << 8) },
+		{ DAHDI_SIG_FXSGS, DAHDI_ABIT | DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8) },
+		{ DAHDI_SIG_FXSKS, DAHDI_BBIT | DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8) },
+		{ DAHDI_SIG_FXOLS, (DAHDI_ABIT << 8) },
+		{ DAHDI_SIG_FXOGS, DAHDI_BBIT | ((DAHDI_ABIT | DAHDI_BBIT) << 8) },
+		{ DAHDI_SIG_FXOKS, (DAHDI_ABIT << 8) },
+		{ DAHDI_SIG_SF,    0 },
 		{ DAHDI_SIG_EM_E1, DAHDI_DBIT | ((DAHDI_ABIT | DAHDI_DBIT) << 8) },
-	} ;
-	
+	};
+
 	/* must have span to begin with */
-	if (!chan->span) return(-1);
+	if (!chan->span)
+		return -1;
+
 	/* if RBS does not apply, return error */
-	if (!(chan->span->flags & DAHDI_FLAG_RBS) || 
-	    !chan->span->rbsbits) return(-1);
+	if (!(chan->span->flags & DAHDI_FLAG_RBS) || !chan->span->rbsbits)
+		return -1;
+
 	if (chan->sig == DAHDI_SIG_CAS)
 		return chan->idlebits;
-	for (x=0;x<NUM_SIGS;x++) {
-		if (in_sig[x][0] == chan->sig) return(in_sig[x][1]);
-	}	return(-1); /* not found -- error */
+
+	for (x = 0; x < NUM_SIGS; x++) {
+		if (in_sig[x][0] == chan->sig)
+			return in_sig[x][1];
+	}
+
+	return -1; /* not found -- error */
 }
 
 #ifdef CONFIG_PROC_FS
-static char *sigstr(int sig)
+static const char *sigstr(int sig)
 {
 	switch (sig) {
-		case DAHDI_SIG_FXSLS:
-			return "FXSLS";
-		case DAHDI_SIG_FXSKS:
-			return "FXSKS";
-		case DAHDI_SIG_FXSGS:
-			return "FXSGS";
-		case DAHDI_SIG_FXOLS:
-			return "FXOLS";
-		case DAHDI_SIG_FXOKS:
-			return "FXOKS";
-		case DAHDI_SIG_FXOGS:
-			return "FXOGS";
-		case DAHDI_SIG_EM:
-			return "E&M";
-		case DAHDI_SIG_EM_E1:
-			return "E&M-E1";
-		case DAHDI_SIG_CLEAR:
-			return "Clear";
-		case DAHDI_SIG_HDLCRAW:
-			return "HDLCRAW";
-		case DAHDI_SIG_HDLCFCS:
-			return "HDLCFCS";
-		case DAHDI_SIG_HDLCNET:
-			return "HDLCNET";
-		case DAHDI_SIG_HARDHDLC:
-			return "Hardware-assisted HDLC";
-		case DAHDI_SIG_MTP2:
-			return "MTP2";
-		case DAHDI_SIG_SLAVE:
-			return "Slave";
-		case DAHDI_SIG_CAS:
-			return "CAS";
-		case DAHDI_SIG_DACS:
-			return "DACS";
-		case DAHDI_SIG_DACS_RBS:
-			return "DACS+RBS";
-		case DAHDI_SIG_SF:
-			return "SF (ToneOnly)";
-		case DAHDI_SIG_NONE:
-		default:
-			return "Unconfigured";
-	}
-
-}
-
-static inline int fill_alarm_string(char *buf, int count, int alarms)
-{
-	int	len = 0;
-
-	if (alarms > 0) {
-		if (alarms & DAHDI_ALARM_BLUE)
-			len += snprintf(buf + len, count - len, "BLUE ");
-		if (alarms & DAHDI_ALARM_YELLOW)
-			len += snprintf(buf + len, count - len, "YELLOW ");
-		if (alarms & DAHDI_ALARM_RED)
-			len += snprintf(buf + len, count - len, "RED ");
-		if (alarms & DAHDI_ALARM_LOOPBACK)
-			len += snprintf(buf + len, count - len, "LOOP ");
-		if (alarms & DAHDI_ALARM_RECOVER)
-			len += snprintf(buf + len, count - len, "RECOVERING ");
-		if (alarms & DAHDI_ALARM_NOTOPEN)
-			len += snprintf(buf + len, count - len, "NOTOPEN ");
-	}
-	if(len > 0) {
-		len--;
-		buf[len] = '\0';	/* strip last space */
-	}
+	case DAHDI_SIG_FXSLS:
+		return "FXSLS";
+	case DAHDI_SIG_FXSKS:
+		return "FXSKS";
+	case DAHDI_SIG_FXSGS:
+		return "FXSGS";
+	case DAHDI_SIG_FXOLS:
+		return "FXOLS";
+	case DAHDI_SIG_FXOKS:
+		return "FXOKS";
+	case DAHDI_SIG_FXOGS:
+		return "FXOGS";
+	case DAHDI_SIG_EM:
+		return "E&M";
+	case DAHDI_SIG_EM_E1:
+		return "E&M-E1";
+	case DAHDI_SIG_CLEAR:
+		return "Clear";
+	case DAHDI_SIG_HDLCRAW:
+		return "HDLCRAW";
+	case DAHDI_SIG_HDLCFCS:
+		return "HDLCFCS";
+	case DAHDI_SIG_HDLCNET:
+		return "HDLCNET";
+	case DAHDI_SIG_HARDHDLC:
+		return "Hardware-assisted HDLC";
+	case DAHDI_SIG_MTP2:
+		return "MTP2";
+	case DAHDI_SIG_SLAVE:
+		return "Slave";
+	case DAHDI_SIG_CAS:
+		return "CAS";
+	case DAHDI_SIG_DACS:
+		return "DACS";
+	case DAHDI_SIG_DACS_RBS:
+		return "DACS+RBS";
+	case DAHDI_SIG_SF:
+		return "SF (ToneOnly)";
+	case DAHDI_SIG_NONE:
+	default:
+		return "Unconfigured";
+	}
+}
+
+static int fill_alarm_string(char *buf, int count, int alarms)
+{
+	int len;
+
+	if (alarms <= 0)
+		return 0;
+
+	len = snprintf(buf, count, "%s%s%s%s%s%s",
+			(alarms & DAHDI_ALARM_BLUE) ? "BLUE " : "",
+			(alarms & DAHDI_ALARM_YELLOW) ? "YELLOW " : "",
+			(alarms & DAHDI_ALARM_RED) ? "RED " : "",
+			(alarms & DAHDI_ALARM_LOOPBACK) ? "LOOP " : "",
+			(alarms & DAHDI_ALARM_RECOVER) ? "RECOVERING " : "",
+			(alarms & DAHDI_ALARM_NOTOPEN) ? "NOTOPEN " : "");
+
+	if (len)
+		buf[--len] = '\0';	/* strip last space */
+
 	return len;
 }
 
@@ -539,7 +553,7 @@
 	if (!span)
 		return 0;
 
-	if (spans[span]->name) 
+	if (spans[span]->name)
 		len += sprintf(page + len, "Span %ld: %s ", span, spans[span]->name);
 	if (spans[span]->desc)
 		len += sprintf(page + len, "\"%s\"", spans[span]->desc);
@@ -590,44 +604,44 @@
 		len += sprintf(page + len, "\tTiming slips: %d\n", spans[span]->timingslips);
 	len += sprintf(page + len, "\n");
 
-
-        for (x=1;x<DAHDI_MAX_CHANNELS;x++) {	
-		if (chans[x]) {
-			if (chans[x]->span && (chans[x]->span->spanno == span)) {
-				if (chans[x]->name)
-					len += sprintf(page + len, "\t%4d %s ", x, chans[x]->name);
-				if (chans[x]->sig) {
-					if (chans[x]->sig == DAHDI_SIG_SLAVE)
-						len += sprintf(page + len, "%s ", sigstr(chans[x]->master->sig));
-					else {
-						len += sprintf(page + len, "%s ", sigstr(chans[x]->sig));
-						if (chans[x]->nextslave && chans[x]->master->channo == x)
-							len += sprintf(page + len, "Master ");
-					}
-				}
-				if (test_bit(DAHDI_FLAGBIT_OPEN, &chans[x]->flags)) {
-					len += sprintf(page + len, "(In use) ");
-				}
+	for (x = 0; x < spans[span]->channels; x++) {
+		struct dahdi_chan *chan = spans[span]->chans[x];
+
+		if (chan->name)
+			len += sprintf(page + len, "\t%4d %s ", chan->channo, chan->name);
+
+		if (chan->sig) {
+			if (chan->sig == DAHDI_SIG_SLAVE)
+				len += sprintf(page + len, "%s ", sigstr(chan->master->sig));
+			else {
+				len += sprintf(page + len, "%s ", sigstr(chan->sig));
+				if (chan->nextslave && chan->master->channo == chan->channo)
+					len += sprintf(page + len, "Master ");
+			}
+		}
+
+		if (test_bit(DAHDI_FLAGBIT_OPEN, &chan->flags))
+			len += sprintf(page + len, "(In use) ");
+
 #ifdef	OPTIMIZE_CHANMUTE
-				if (chans[x]->chanmute) {
-					len += sprintf(page + len, "(no pcm) ");
-				}
-#endif
-				len += fill_alarm_string(page + len, count - len, chans[x]->chan_alarms);
-
-				if (chans[x]->ec_factory) {
-					len += sprintf(page + len, " (EC: %s) ", chans[x]->ec_factory->name);
-				}
-
-				len += sprintf(page + len, "\n");
-			}
-			if (len <= off) { /* If everything printed so far is before beginning of request */
-				off -= len;
-				len = 0;
-			}
-			if (len > off+count) /* stop if we've already generated enough */
-				break;
-		}
+		if (chan->chanmute)
+			len += sprintf(page + len, "(no pcm) ");
+#endif
+
+		len += fill_alarm_string(page + len, count - len, chan->chan_alarms);
+
+		if (chan->ec_factory)
+			len += sprintf(page + len, " (EC: %s) ", chan->ec_factory->name);
+
+		len += sprintf(page + len, "\n");
+
+		if (len <= off) { /* If everything printed so far is before beginning of request */
+			off -= len;
+			len = 0;
+		}
+
+		if (len > off + count) /* stop if we've already generated enough */
+			break;
 	}
 	if (len <= off) { /* If everything printed so far is before beginning of request */
 		off -= len;
@@ -635,7 +649,8 @@
 	}
 	*start = page + off;
 	len -= off;     /* un-count any remaining offset */
-	if (len > count) len = count;   /* don't return bytes not asked for */
+	if (len > count)
+		len = count;   /* don't return bytes not asked for */
 	return len;
 }
 #endif
@@ -654,24 +669,28 @@
 static void recalc_maxconfs(void)
 {
 	int x;
-	for (x=DAHDI_MAX_CONF-1;x>0;x--) {
+
+	for (x = DAHDI_MAX_CONF - 1; x > 0; x--) {
 		if (confrev[x]) {
-			maxconfs = x+1;
+			maxconfs = x + 1;
 			return;
 		}
 	}
+
 	maxconfs = 0;
 }
 
 static void recalc_maxlinks(void)
 {
 	int x;
-	for (x=DAHDI_MAX_CONF-1;x>0;x--) {
+
+	for (x = DAHDI_MAX_CONF - 1; x > 0; x--) {
 		if (conf_links[x].src || conf_links[x].dst) {
-			maxlinks = x+1;
+			maxlinks = x + 1;
 			return;
 		}
 	}
+
 	maxlinks = 0;
 }
 
@@ -679,19 +698,21 @@
 {
 	/* Find the first conference which has no alias */
 	int x;
-	for (x=DAHDI_MAX_CONF-1;x>0;x--) {
+
+	for (x = DAHDI_MAX_CONF - 1; x > 0; x--) {
 		if (!confalias[x])
 			return x;
 	}
+
 	return -1;
 }
 
 static int dahdi_get_conf_alias(int x)
 {
 	int a;
-	if (confalias[x]) {
+
+	if (confalias[x])
 		return confalias[x];
-	}
 
 	/* Allocate an alias */
 	a = dahdi_first_empty_alias();
@@ -700,6 +721,7 @@
 
 	/* Highest conference may have changed */
 	recalc_maxconfs();
+
 	return a;
 }
 
@@ -708,19 +730,24 @@
 	int y;
 
 	/* return if no valid conf number */
-	if (x <= 0) return;
+	if (x <= 0)
+		return;
+
 	/* Return if there is no alias */
 	if (!confalias[x])
 		return;
-	for (y=0;y<maxchans;y++) {
+
+	for (y = 0; y < maxchans; y++) {
 		if (chans[y] && (chans[y]->confna == x) &&
-			((chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONF ||
-			(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANN ||
-			(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFMON ||
-			(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANNMON ||
-			(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_REALANDPSEUDO))
+				((chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONF ||
+				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANN ||
+				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFMON ||
+				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANNMON ||
+				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_REALANDPSEUDO)) {
 			return;
-	}
+		}
+	}
+
 	/* If we get here, nobody is in the conference anymore.  Clear it out
 	   both forward and reverse */
 	confrev[confalias[x]] = 0;
@@ -733,21 +760,29 @@
 /* enqueue an event on a channel */
 static void __qevent(struct dahdi_chan *chan, int event)
 {
-
-	  /* if full, ignore */
-	if ((chan->eventoutidx == 0) && (chan->eventinidx == (DAHDI_MAX_EVENTSIZE - 1))) 
+	/* if full, ignore */
+	if ((chan->eventoutidx == 0) && (chan->eventinidx == (DAHDI_MAX_EVENTSIZE - 1)))
 		return;
-	  /* if full, ignore */
-	if (chan->eventinidx == (chan->eventoutidx - 1)) return;
-	  /* save the event */
+
+	/* if full, ignore */
+	if (chan->eventinidx == (chan->eventoutidx - 1))
+		return;
+
+	/* save the event */
 	chan->eventbuf[chan->eventinidx++] = event;
-	  /* wrap the index, if necessary */
-	if (chan->eventinidx >= DAHDI_MAX_EVENTSIZE) chan->eventinidx = 0;
-	  /* wake em all up */
-	if (chan->iomask & DAHDI_IOMUX_SIGEVENT) wake_up_interruptible(&chan->eventbufq);
+
+	/* wrap the index, if necessary */
+	if (chan->eventinidx >= DAHDI_MAX_EVENTSIZE)
+		chan->eventinidx = 0;
+
+	/* wake em all up */
+	if (chan->iomask & DAHDI_IOMUX_SIGEVENT)
+		wake_up_interruptible(&chan->eventbufq);
+
 	wake_up_interruptible(&chan->readbufq);
 	wake_up_interruptible(&chan->writebufq);
 	wake_up_interruptible(&chan->sel);
+
 	return;
 }
 
@@ -768,32 +803,40 @@
 static int schluffen(wait_queue_head_t *q)
 {
 	DECLARE_WAITQUEUE(wait, current);
+
 	add_wait_queue(q, &wait);

[... 15970 lines stripped ...]



More information about the svn-commits mailing list