[Pkg-voip-commits] r10221 - in /dahdi-linux/trunk/debian: changelog patches/dahdi_linux_extra patches/fix_define_dev patches/fix_xpp_post_unregister patches/fix_xpp_usermode patches/no_firmware_download patches/series
tzafrir at alioth.debian.org
tzafrir at alioth.debian.org
Sun Jun 9 19:58:13 UTC 2013
Author: tzafrir
Date: Sun Jun 9 19:58:12 2013
New Revision: 10221
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=10221
Log:
New upstream release: 2.7.0
- Patch fix_define_dev dropped: merged upstream.
- Patch fix_xpp_usermode dropped: merged upstream.
- Patch fix_xpp_post_unregister dropped: merged upstream.
Removed:
dahdi-linux/trunk/debian/patches/fix_define_dev
dahdi-linux/trunk/debian/patches/fix_xpp_post_unregister
dahdi-linux/trunk/debian/patches/fix_xpp_usermode
Modified:
dahdi-linux/trunk/debian/changelog
dahdi-linux/trunk/debian/patches/dahdi_linux_extra
dahdi-linux/trunk/debian/patches/no_firmware_download
dahdi-linux/trunk/debian/patches/series
Modified: dahdi-linux/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/changelog?rev=10221&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/changelog (original)
+++ dahdi-linux/trunk/debian/changelog Sun Jun 9 19:58:12 2013
@@ -1,6 +1,9 @@
-dahdi-linux (1:2.6.1+dfsg2-2) UNRELEASED; urgency=low
-
- * NOT RELEASED YET
+dahdi-linux (1:2.7.0+dfsg-1) UNRELEASED; urgency=low
+
+ * New upstream release:
+ - Patch fix_define_dev dropped: merged upstream.
+ - Patch fix_xpp_usermode dropped: merged upstream.
+ - Patch fix_xpp_post_unregister dropped: merged upstream.
-- Tzafrir Cohen <tzafrir at debian.org> Wed, 30 Jan 2013 23:57:30 +0200
Modified: dahdi-linux/trunk/debian/patches/dahdi_linux_extra
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/dahdi_linux_extra?rev=10221&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/patches/dahdi_linux_extra (original)
+++ dahdi-linux/trunk/debian/patches/dahdi_linux_extra Sun Jun 9 19:58:12 2013
@@ -1,20 +1,20 @@
Subject: dahdi-extra: out-of-tree DAHDI drivers
-Origin: http://gitorious.org/dahdi-extra/dahdi-linux-extra
+Origin: http://gitorious.org/dahdi-extra/dahdi-linux
Forwarded: No
-Last-Update: 2012-03-06
+Last-Update: 2013-06-09
This patch includes a number of out-of-tree DAHDI drivers from the
dahdi-extra repository. They are all out-of-tree and are highly likely
not to be included in DAHDI-linux in the forseeable future.
-Git-Commit: f1fc13f5aad78e7d110f34d61b5a60dc83c119ff
-Dahdi: branches/2.6 at 10442
+Git-Commit: 65d0c3f161befe261c86d6cadc6a23986c8d09ad
+Dahdi: v2.7.0-rc1
---
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
-index 8bbfea0..9fed863 100644
+index 5450dff..6d426df 100644
--- a/drivers/dahdi/Kbuild
+++ b/drivers/dahdi/Kbuild
-@@ -31,6 +31,14 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE2) += dahdi_echocan_sec2.o
+@@ -39,6 +39,14 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE2) += dahdi_echocan_sec2.o
obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_KB1) += dahdi_echocan_kb1.o
obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_MG2) += dahdi_echocan_mg2.o
@@ -270,7 +270,7 @@
+
diff --git a/drivers/dahdi/ap400/ap400_drv.c b/drivers/dahdi/ap400/ap400_drv.c
new file mode 100644
-index 0000000..24c3807
+index 0000000..092aefb
--- /dev/null
+++ b/drivers/dahdi/ap400/ap400_drv.c
@@ -0,0 +1,2337 @@
@@ -1325,12 +1325,12 @@
+ ts->span.ops = &ap4_span_ops;
+ if (ts->spantype == TYPE_E1) {
+ ts->span.channels = 31;
-+ ts->span.spantype = "E1";
++ ts->span.spantype = SPANTYPE_DIGITAL_E1;
+ ts->span.linecompat = DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
+ ts->span.deflaw = DAHDI_LAW_ALAW;
+ } else {
+ ts->span.channels = 24;
-+ ts->span.spantype = "T1";
++ ts->span.spantype = SPANTYPE_DIGITAL_T1;
+ ts->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
+ ts->span.deflaw = DAHDI_LAW_MULAW;
+ }
@@ -6225,7 +6225,7 @@
+endif
diff --git a/drivers/dahdi/opvxd115/base.c b/drivers/dahdi/opvxd115/base.c
new file mode 100644
-index 0000000..d3f37a2
+index 0000000..8ef1796
--- /dev/null
+++ b/drivers/dahdi/opvxd115/base.c
@@ -0,0 +1,4908 @@
@@ -8316,13 +8316,13 @@
+ "D115/D130 (E1|T1) Card %d Span %d", wc->num, x+1);
+ switch (ts->spantype) {
+ case TYPE_T1:
-+ ts->span.spantype = "T1";
++ ts->span.spantype = SPANTYPE_DIGITAL_T1;
+ break;
+ case TYPE_E1:
-+ ts->span.spantype = "E1";
++ ts->span.spantype = SPANTYPE_DIGITAL_E1;
+ break;
+ case TYPE_J1:
-+ ts->span.spantype = "J1";
++ ts->span.spantype = SPANTYPE_DIGITAL_J1;
+ break;
+ }
+#ifdef DAHDI_SPAN_MODULE
@@ -9654,7 +9654,7 @@
+ }
+ if (!ts->span.alarms) {
+ if ((isr3 & 0x3) || (isr4 & 0xc0))
-+ ts->span.timingslips++;
++ ts->span.count.timingslips++;
+
+ if (debug & DEBUG_MAIN) {
+ if (isr3 & 0x02)
@@ -9675,7 +9675,7 @@
+ span + 1);
+ }
+ } else
-+ ts->span.timingslips = 0;
++ ts->span.count.timingslips = 0;
+
+ spin_lock_irqsave(&wc->reglock, flags);
+ /* HDLC controller checks - receive side */
@@ -12344,10 +12344,10 @@
+#endif
diff --git a/drivers/dahdi/wcopenpci.c b/drivers/dahdi/wcopenpci.c
new file mode 100644
-index 0000000..214d396
+index 0000000..d7fbc2d
--- /dev/null
+++ b/drivers/dahdi/wcopenpci.c
-@@ -0,0 +1,1868 @@
+@@ -0,0 +1,1784 @@
+/*
+ * Voicetronix OpenPCI Interface Driver for Zapata Telephony interface
+ *
@@ -12365,15 +12365,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.
+ *
+ */
+
@@ -12382,8 +12382,8 @@
+
+/* Driver constants */
+#define DRIVER_DESCRIPTION "Voicetronix OpenPCI DAHDI driver"
-+#define DRIVER_AUTHOR "Mark Spencer <markster at digium.com> "\
-+ "Voicetronix <support at voicetronix.com.au>"
++#define DRIVER_AUTHOR "Mark Spencer <markster at digium.com> "\
++ "Voicetronix <support at voicetronix.com.au>"
+
+#define NAME "wcopenpci"
+#define MAX_PORTS 8 /* Maximum number of ports on each carrier */
@@ -12402,135 +12402,10 @@
+#include <dahdi/version.h>
+#include "proslic.h"
+#include <dahdi/wctdm_user.h>
-+
-+
-+
-+/* Compatibility helpers */
-+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
-+ #include <linux/interrupt.h>
-+#else
-+ typedef void irqreturn_t;
-+ #define IRQ_NONE
-+ #define IRQ_HANDLED
-+ #define IRQ_RETVAL(x)
-+ #define __devexit_p(x) x
-+#endif
-+
-+// Centos4.3 uses a modified 2.6.9 kernel, with no indication that
-+// it is different from the mainstream (or even Centos4.2 2.6.9)
-+// kernel, so we must crowbar off the dunce-hat manually here.
-+#if !defined CENTOS4_3 && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
-+ typedef int gfp_t;
-+ static inline void *kzalloc( size_t n, gfp_t flags ){
-+ void *p = kmalloc(n,flags);
-+ if (p) memset(p, 0, n);
-+ return p;
-+ }
-+#endif
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
-+ #define DEFINE_MUTEX(x) DECLARE_MUTEX(x)
-+ #define mutex_init(x) init_MUTEX(x)
-+ #define mutex_lock(x) down(x)
-+ #define mutex_lock_interruptible(x) down_interruptible(x)
-+ #define mutex_trylock(x) down_trylock(x)
-+ #define mutex_unlock(x) up(x)
-+#else
-+ #include <linux/mutex.h>
-+#endif
-+
-+
-+static struct fxo_mode {
-+ char *name;
-+ int ohs;
-+ int ohs2;
-+ int rz;
-+ int rt;
-+ int ilim;
-+ int dcv;
-+ int mini;
-+ int acim;
-+ int ring_osc;
-+ int ring_x;
-+} fxo_modes[] =
-+{
-+ { "FCC", 0, 0, 0, 1, 0, 0x3, 0, 0, }, /* US, Canada */
-+ { "TBR21", 0, 0, 0, 0, 1, 0x3, 0, 0x2, 0x7e6c, 0x023a, },
-+ /* Austria, Belgium, Denmark, Finland, France, Germany,
-+ Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands,
-+ Norway, Portugal, Spain, Sweden, Switzerland, and UK */
-+ { "ARGENTINA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "AUSTRALIA", 1, 0, 0, 0, 0, 0, 0x3, 0x3, },
-+ { "AUSTRIA", 0, 1, 0, 0, 1, 0x3, 0, 0x3, },
-+ { "BAHRAIN", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "BELGIUM", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "BRAZIL", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "BULGARIA", 0, 0, 0, 0, 1, 0x3, 0x0, 0x3, },
-+ { "CANADA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "CHILE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "CHINA", 0, 0, 0, 0, 0, 0, 0x3, 0xf, },
-+ { "COLUMBIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "CROATIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "CYRPUS", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "CZECH", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "DENMARK", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "ECUADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "EGYPT", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "ELSALVADOR", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "FINLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "FRANCE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "GERMANY", 0, 1, 0, 0, 1, 0x3, 0, 0x3, },
-+ { "GREECE", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "GUAM", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "HONGKONG", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "HUNGARY", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "ICELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "INDIA", 0, 0, 0, 0, 0, 0x3, 0, 0x4, },
-+ { "INDONESIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "IRELAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "ISRAEL", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "ITALY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "JAPAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "JORDAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "KAZAKHSTAN", 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "KUWAIT", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "LATVIA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "LEBANON", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "LUXEMBOURG", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "MACAO", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "MALAYSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, }, /* Current loop >= 20ma */
-+ { "MALTA", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "MEXICO", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "MOROCCO", 0, 0, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "NETHERLANDS", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "NEWZEALAND", 0, 0, 0, 0, 0, 0x3, 0, 0x4, },
-+ { "NIGERIA", 0, 0, 0, 0, 0x1, 0x3, 0, 0x2, },
-+ { "NORWAY", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "OMAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "PAKISTAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "PERU", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "PHILIPPINES", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "POLAND", 0, 0, 1, 1, 0, 0x3, 0, 0, },
-+ { "PORTUGAL", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "ROMANIA", 0, 0, 0, 0, 0, 3, 0, 0, },
-+ { "RUSSIA", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "SAUDIARABIA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "SINGAPORE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "SLOVAKIA", 0, 0, 0, 0, 0, 0x3, 0, 0x3, },
-+ { "SLOVENIA", 0, 0, 0, 0, 0, 0x3, 0, 0x2, },
-+ { "SOUTHAFRICA", 1, 0, 1, 0, 0, 0x3, 0, 0x3, },
-+ { "SOUTHKOREA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "SPAIN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "SWEDEN", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "SWITZERLAND", 0, 1, 0, 0, 1, 0x3, 0, 0x2, },
-+ { "SYRIA", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "TAIWAN", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "THAILAND", 0, 0, 0, 0, 0, 0, 0x3, 0, },
-+ { "UAE", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "UK", 0, 1, 0, 0, 1, 0x3, 0, 0x5, },
-+ { "USA", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+ { "YEMEN", 0, 0, 0, 0, 0, 0x3, 0, 0, },
-+};
++#include <linux/interrupt.h>
++#include <linux/mutex.h>
++
++#include "fxo_modes.h"
+
+static struct ps_country_reg {
+ const char *country;
@@ -12579,27 +12454,27 @@
+ {"MALTA", 0xC},
+ {"MEXICO", 0x8},
+ {"MOROCCO", 0xC},
-+ {"NETHERLANDS",0xC},
++ {"NETHERLANDS", 0xC},
+ {"NEWZEALAND", 0xF},
+ {"NIGERIA", 0xC},
+ {"NORWAY", 0xC},
+ {"OMAN", 0x8},
+ {"PAKISTAN", 0x8},
+ {"PERU", 0x8},
-+ {"PHILIPPINES",0x8},
++ {"PHILIPPINES", 0x8},
+ {"POLAND", 0x8},
+ {"PORTUGAL", 0xC},
+ {"ROMANIA", 0x8},
+ {"RUSSIA", 0x8},
-+ {"SAUDIARABIA",0x8},
++ {"SAUDIARABIA", 0x8},
+ {"SINGAPORE", 0x8},
+ {"SLOVAKIA", 0xE},
+ {"SLOVENIA", 0xE},
-+ {"SOUTHAFRICA",0xE},
++ {"SOUTHAFRICA", 0xE},
+ {"SOUTHKOREA", 0x8},
+ {"SPAIN", 0xC},
+ {"SWEDEN", 0xC},
-+ {"SWITZERLAND",0xC},
++ {"SWITZERLAND", 0xC},
+ {"SYRIA", 0x8},
+ {"TAIWAN", 0x8},
+ {"THAILAND", 0x8},
@@ -12611,8 +12486,8 @@
+
+#define INOUT 2
+
-+/* Allocate enough memory for two zt chunks, receive and transmit. Each sample uses
-+ 32 bits. Allocate an extra set just for control too */
++/* Allocate enough memory for two zt chunks, receive and transmit. Each
++ * sample uses 32 bits. Allocate an extra set just for control too */
+#define VT_PCIDMA_BLOCKSIZE (DAHDI_MAX_CHUNKSIZE * INOUT * MAX_PORTS * 2 * 2)
+#define VT_PCIDMA_MIDDLE (DAHDI_MAX_CHUNKSIZE * MAX_PORTS - 4)
+#define VT_PCIDMA_END (DAHDI_MAX_CHUNKSIZE * MAX_PORTS * 2 - 4)
@@ -12671,21 +12546,21 @@
+#define HOOK_ONHOOK 0
+#define HOOK_OFFHOOK 1
+
-+#define DSP_CODEC_RING 12 /* RING rising edge detected */
-+#define DSP_CODEC_HKOFF 22 /* station port off hook */
-+#define DSP_CODEC_HKON 23 /* station port on hook */
-+#define DSP_RING_OFF 24 /* RING falling edge detected */
++#define DSP_CODEC_RING 12 /* RING rising edge detected */
++#define DSP_CODEC_HKOFF 22 /* station port off hook */
++#define DSP_CODEC_HKON 23 /* station port on hook */
++#define DSP_RING_OFF 24 /* RING falling edge detected */
+#define DSP_DROP 25
+
-+#define DSP_CODEC_FLASH 26 /* station port hook flash */
-+
-+#define DSP_LOOP_OFFHOOK 38 /* Loop Off hook from OpenPCI */
-+#define DSP_LOOP_ONHOOK 39 /* Loop On hook from OpenPCI */
-+#define DSP_LOOP_POLARITY 40 /* Loop Polarity from OpenPCI */
++#define DSP_CODEC_FLASH 26 /* station port hook flash */
++
++#define DSP_LOOP_OFFHOOK 38 /* Loop Off hook from OpenPCI */
++#define DSP_LOOP_ONHOOK 39 /* Loop On hook from OpenPCI */
++#define DSP_LOOP_POLARITY 40 /* Loop Polarity from OpenPCI */
+#define DSP_LOOP_NOBATT 41
+
-+#define DSP_PROSLIC_SANITY 50 /* Sanity alert from a ProSLIC port */
-+#define DSP_PROSLIC_PWR_ALARM 51 /* Power Alarm from a ProSLIC port */
++#define DSP_PROSLIC_SANITY 50 /* Sanity alert from a ProSLIC port */
++#define DSP_PROSLIC_PWR_ALARM 51 /* Power Alarm from a ProSLIC port */
+#define DSP_VDAA_ISO_FRAME_E 52 /* ISO-cap frame sync lost on VDAA port*/
+
+#if VERBOSE_TIMING
@@ -12696,10 +12571,10 @@
+#endif
+
+#define BUSY_WAIT(countvar,cond,delay,iter,failret) \
-+ countvar=0; \
++ countvar = 0; \
+ while(cond){ \
+ udelay(delay); \
-+ if(++countvar > iter){ \
++ if (++countvar > iter){ \
+ cardcrit(wc->boardnum, "busy wait FAILED at %d", __LINE__); \
+ return failret; \
+ } \
@@ -12707,10 +12582,10 @@
+ REPORT_WAIT(busy,i)
+
+#define LOCKED_WAIT(countvar,cond,delay,iter,failret) \
-+ countvar=0; \
++ countvar = 0; \
+ while(cond){ \
+ udelay(delay); \
-+ if(++countvar > iter){ \
++ if (++countvar > iter){ \
+ dbginfo(wc->boardnum,"busy wait failed at %d",__LINE__); \
+ spin_unlock_irqrestore(&wc->lock, flags); \
+ return failret; \
@@ -12729,7 +12604,7 @@
+#define HRXF_WAIT_LOCKED_RET(failret) LOCKED_WAIT(i,!HRXF_READY,5,1000,failret)
+
+
-+struct openpci {
++static struct openpci {
+ struct pci_dev *dev;
+ char *variety;
+ int boardnum;
@@ -12767,16 +12642,16 @@
+ struct dahdi_span span;
+} *cards[MAX_CARDS];
+
-+// You must hold this lock anytime you access or modify the cards[] array.
-+DEFINE_MUTEX(cards_mutex);
++/* You must hold this lock anytime you access or modify the cards[] array. */
++static DEFINE_MUTEX(cards_mutex);
+
+static unsigned char fxo_port_lookup[8] = { 0x0, 0x8, 0x4, 0xc, 0x10, 0x18, 0x14, 0x1c};
+static unsigned char fxs_port_lookup[8] = { 0x0, 0x1, 0x2, 0x3, 0x10, 0x11, 0x12, 0x13};
+static char wcopenpci[] = "Voicetronix OpenPCI";
+
+static char *country = DEFAULT_COUNTRY;
-+static int reversepolarity; // = 0
-+static int debug; // = 0
++static int reversepolarity; /* = 0 */
++static int debug; /* = 0 */
+
+module_param(country, charp, 0444);
+module_param(debug, int, 0600);
@@ -12784,11 +12659,12 @@
+MODULE_PARM_DESC(country, "Set the default country name");
+MODULE_PARM_DESC(debug, "Enable verbose logging");
+
-+//#define DEBUG_LOOP_VOLTAGE 1
++/* #define DEBUG_LOOP_VOLTAGE 1 */
+#ifdef DEBUG_LOOP_VOLTAGE
-+ // This param is a 32 bit bitfield where bit 1 << cardnum * 8 << portnum
-+ // will enable voltage monitoring on that port (fxo only presently)
-+ static int voltmeter; // = 0
++ /* This param is a 32 bit bitfield where bit 1 << cardnum * 8 << portnum
++ * will enable voltage monitoring on that port (fxo only presently)
++ */
++ static int voltmeter; /* = 0 */
+ module_param(voltmeter, int, 0600);
+ MODULE_PARM_DESC(voltmeter, "Enable loop voltage metering");
+#endif
@@ -12805,22 +12681,23 @@
+#define cardinfo(cardnum,format,...) info("[%02d] " format, cardnum , ## __VA_ARGS__)
+#define cardwarn(cardnum,format,...) warn("[%02d] " format, cardnum , ## __VA_ARGS__)
+#define cardcrit(cardnum,format,...) crit("[%02d] " format, cardnum , ## __VA_ARGS__)
-+#define dbginfo(cardnum,format,...) if(debug) info("[%02d] " format, cardnum , ## __VA_ARGS__)
++#define dbginfo(cardnum,format,...) if (debug) info("[%02d] " format, cardnum , ## __VA_ARGS__)
+
+
+static inline const char *porttype(struct openpci *wc, int port)
-+{ //{{{
++{
+ switch( wc->porttype[port] ) {
-+ case VT_PORT_VDAA: return "VDAA";
-+ case VT_PORT_PROSLIC: return "ProSLIC";
-+ case VT_PORT_EMPTY: return "empty port";
-+ default: return "unknown type";
-+ }
-+} //}}}
-+
-+
-+static int __read_reg_fxo(struct openpci *wc, int port, unsigned char reg, unsigned char *value)
-+{ //{{{
++ case VT_PORT_VDAA: return "VDAA";
++ case VT_PORT_PROSLIC: return "ProSLIC";
++ case VT_PORT_EMPTY: return "empty port";
++ default: return "unknown type";
++ }
++}
++
++
++static int __read_reg_fxo(struct openpci *wc, int port, unsigned char reg,
++ unsigned char *value)
++{
+ unsigned char portadr = fxo_port_lookup[port];
+ int i;
+
@@ -12833,24 +12710,26 @@
+ HRXF_WAIT(); *value = inb(PIB(1));
+
+ return RET_OK;
-+} //}}}
-+
-+static int read_reg_fxo(struct openpci *wc, int port, unsigned char reg, unsigned char *value)
-+{ //{{{
++}
++
++static int read_reg_fxo(struct openpci *wc, int port, unsigned char reg,
++ unsigned char *value)
++{
+ unsigned long flags;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ if( __read_reg_fxo(wc, port, reg, value) ){
++ if (__read_reg_fxo(wc, port, reg, value)) {
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_OK;
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
+ cardcrit(wc->boardnum, "FXO port %d, reg %d, read failed!", port, reg);
+ return RET_FAIL;
-+} //}}}
-+
-+static int __read_reg_fxs(struct openpci *wc, int port, unsigned char reg, unsigned char *value)
-+{ //{{{
++}
++
++static int __read_reg_fxs(struct openpci *wc, int port, unsigned char reg,
++ unsigned char *value)
++{
+ unsigned char portadr = fxs_port_lookup[port];
+ int i;
+
@@ -12863,24 +12742,26 @@
+ HRXF_WAIT(); *value = inb(PIB(1));
+
+ return RET_OK;
-+} //}}}
-+
-+static int read_reg_fxs(struct openpci *wc, int port, unsigned char reg, unsigned char *value)
-+{ //{{{
++}
++
++static int read_reg_fxs(struct openpci *wc, int port, unsigned char reg,
++ unsigned char *value)
++{
+ unsigned long flags;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ if( __read_reg_fxs(wc, port, reg, value) ) {
++ if ( __read_reg_fxs(wc, port, reg, value) ) {
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_OK;
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
+ cardcrit(wc->boardnum, "FXS port %d, reg %d, read failed!", port, reg);
+ return RET_FAIL;
-+} //}}}
-+
-+static int __write_reg_fxo(struct openpci *wc, int port, unsigned char reg, unsigned char value)
-+{ //{{{
++}
++
++static int __write_reg_fxo(struct openpci *wc, int port, unsigned char reg,
++ unsigned char value)
++{
+ unsigned char portadr = fxo_port_lookup[port];
+ int i;
+
@@ -12891,24 +12772,27 @@
+ outb(value, PIB(1)); HTXF_WAIT();
+
+ return RET_OK;
-+} //}}}
-+
-+static int write_reg_fxo(struct openpci *wc, int port, unsigned char reg, unsigned char value)
-+{ //{{{
++}
++
++static int write_reg_fxo(struct openpci *wc, int port, unsigned char reg,
++ unsigned char value)
++{
+ unsigned long flags;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ if( __write_reg_fxo(wc, port, reg, value) ){
++ if (__write_reg_fxo(wc, port, reg, value)) {
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_OK;
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
-+ cardcrit(wc->boardnum, "FXO port %d, reg %d, write(%d) failed!", port, reg, value);
++ cardcrit(wc->boardnum, "FXO port %d, reg %d, write(%d) failed!",
++ port, reg, value);
+ return RET_FAIL;
-+} //}}}
-+
-+static int __write_reg_fxs(struct openpci *wc, int port, unsigned char reg, unsigned char value)
-+{ //{{{
++}
++
++static int __write_reg_fxs(struct openpci *wc, int port, unsigned char reg,
++ unsigned char value)
++{
+ unsigned char portadr = fxs_port_lookup[port];
+ int i;
+
@@ -12919,31 +12803,31 @@
+ outb(value, PIB(1)); HTXF_WAIT();
+
+ return RET_OK;
-+} //}}}
-+
-+static int write_reg_fxs(struct openpci *wc, int port, unsigned char reg, unsigned char value)
-+{ //{{{
++}
++
++static int write_reg_fxs(struct openpci *wc, int port, unsigned char reg,
++ unsigned char value)
++{
+ unsigned long flags;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ if( __write_reg_fxs(wc, port, reg, value) ){
++ if (__write_reg_fxs(wc, port, reg, value)) {
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_OK;
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
+ cardcrit(wc->boardnum, "FXS port %d, reg %d, write(%d) failed!", port, reg, value);
+ return RET_FAIL;
-+} //}}}
++}
+
+static int __wait_indreg_fxs(struct openpci *wc, int port)
-+{ //{{{
++{
+ unsigned char value;
+ int count = 100;
+
-+ while (--count)
-+ {
-+ if( __read_reg_fxs(wc, port, I_STATUS, &value) ){
-+ if( value == 0 )
++ while (--count) {
++ if ( __read_reg_fxs(wc, port, I_STATUS, &value)) {
++ if (value == 0)
+ return RET_OK;
+ } else {
+ cardcrit(wc->boardnum,
@@ -12954,34 +12838,36 @@
+ }
+ cardcrit(wc->boardnum, "Failed to wait for indirect reg write to port %d", port);
+ return RET_FAIL;
-+} //}}}
-+
-+static int write_indreg_fxs(struct openpci *wc, int port, unsigned char reg, unsigned short value)
-+{ //{{{
++}
++
++static int write_indreg_fxs(struct openpci *wc, int port, unsigned char reg,
++ unsigned short value)
++{
+ unsigned long flags;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ if( __wait_indreg_fxs(wc, port)
++ if (__wait_indreg_fxs(wc, port)
+ && __write_reg_fxs(wc, port, IDA_LO, value & 0xff)
+ && __write_reg_fxs(wc, port, IDA_HI, (value & 0xff00)>>8)
+ && __write_reg_fxs(wc, port, IAA, reg)
-+ && __wait_indreg_fxs(wc, port) )
++ && __wait_indreg_fxs(wc, port))
+ {
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_OK;
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
-+ cardcrit(wc->boardnum, "FXS indreg %d write failed on port %d", reg, port);
++ cardcrit(wc->boardnum, "FXS indreg %d write failed on port %d",
++ reg, port);
+ return RET_FAIL;
-+} //}}}
++}
+
+static int read_indreg_fxs(struct openpci *wc, int port, unsigned char reg, unsigned short *value)
-+{ //{{{
++{
+ unsigned long flags;
+ unsigned char lo, hi;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ if( __wait_indreg_fxs(wc, port)
++ if (__wait_indreg_fxs(wc, port)
+ && __write_reg_fxs(wc, port, IAA, reg)
+ && __wait_indreg_fxs(wc, port)
+ && __read_reg_fxs(wc, port, IDA_LO, &lo)
@@ -12993,54 +12879,56 @@
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_FAIL;
-+} //}}}
++}
+
+static void start_dma(struct openpci *wc)
-+{ //{{{
++{
+ outb(0x0f, TJ_CNTL);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(1);
+ outb(0x01, TJ_CNTL);
+ outb(0x01, TJ_OPER);
-+} //}}}
++}
+
+static void restart_dma(struct openpci *wc)
-+{ //{{{
++{
+ /* Reset Master and TDM */
+ outb(0x01, TJ_CNTL);
+ outb(0x01, TJ_OPER);
-+} //}}}
++}
+
+/* You must hold the card spinlock to call this function */
+static int __ping_arm(struct openpci *wc)
-+{ //{{{
++{
+ int i;
-+ int pong=0;
-+
-+ while(pong != 0x02){
++ int pong = 0;
++
++ while (pong != 0x02) {
+ outb(0x02, PIB(1)); HTXF_WAIT();
+ HRXF_WAIT(); pong = inb(PIB(1));
+ dbginfo(wc->boardnum, "ping_arm returned %x", pong);
+ }
-+ while(pong == 0x02){
++ while (pong == 0x02) {
+ // Poke no-ops into the arm while it is still returning data,
+ // if 500 usec elapses with no further response from it then
+ // the message queue is should be completely cleared.
+ outb(0x00, PIB(1)); HTXF_WAIT();
+ i = 100;
-+ while( !HRXF_READY && --i ) udelay(5);
-+ if( i == 0 ) break;
++ while (!HRXF_READY && --i)
++ udelay(5);
++ if (i == 0)
++ break;
+ pong = inb(PIB(1));
+ dbginfo(wc->boardnum, "ping_arm returned %x.", pong);
+ }
+ return RET_OK;
-+} //}}}
++}
+
+static void arm_event(struct openpci *wc, char *msg)
-+{ //{{{
++{
+ int port = msg[0];
+
-+ switch(msg[1]){
++ switch (msg[1]) {
+ case DSP_LOOP_OFFHOOK:
+ dahdi_hooksig(wc->chans[port], DAHDI_RXSIG_OFFHOOK);
+ dbginfo(wc->boardnum, "Port %d Loop OffHook", port);
@@ -13085,7 +12973,8 @@
+ break;
+
+ case DSP_CODEC_FLASH:
-+ dahdi_qevent_lock(wc->chans[port], DAHDI_EVENT_WINKFLASH);
++ dahdi_qevent_lock(wc->chans[port],
++ DAHDI_EVENT_WINKFLASH);
+ dbginfo(wc->boardnum, "Port %d Station Flash", port);
+ break;
+
@@ -13104,10 +12993,16 @@
+ int i = 49;
+
+ msg[2] >>= 2;
-+ for(; i < 55; ++i, msg[2] >>= 1 )
-+ if(msg[2] & 1){ *(++p)='Q'; *(++p)=i; *(++p)=','; }
-+ if( p != errbuf ) *p = '\0';
-+ cardcrit(wc->boardnum,"%d: ProSlic power ALARM:%s",msg[0],errbuf);
++ for (; i < 55; ++i, msg[2] >>= 1 )
++ if (msg[2] & 1) {
++ *(++p) = 'Q';
++ *(++p) = i;
++ *(++p) = ',';
++ }
++ if (p != errbuf)
++ *p = '\0';
++ cardcrit(wc->boardnum,"%d: ProSlic power ALARM:%s",
++ msg[0], errbuf);
+ //write_reg_fxs(wc, port, 64, wc->mod[port].fxs.lasttxhook );
+ return;
+ }
@@ -13121,19 +13016,19 @@
+ msg[1], port);
+ break;
+ }
-+} //}}}
++}
+
+/* You must hold the card spinlock to call this function */
-+static inline int __read_arm_byte( struct openpci *wc, unsigned char *msg )
-+{ //{{{
++static inline int __read_arm_byte( struct openpci *wc, unsigned char *msg)
++{
+ int i;
+
+ HRXF_WAIT(); *msg = inb(PIB(1));
+ return RET_OK;
-+} //}}}
-+
-+static inline int read_arm_msg( struct openpci *wc, unsigned char *msg )
-+{ //{{{
++}
++
++static inline int read_arm_msg( struct openpci *wc, unsigned char *msg)
++{
+ unsigned long flags;
+ int i, d, count;
+ int ret = RET_OK;
@@ -13142,9 +13037,9 @@
+ outb(0x08, PIB(1)); HTXF_WAIT_LOCKED();
+ //XXX Do we need to clear the interrupt flag even if this fails?
+ HRXF_WAIT_LOCKED(); count = inb(PIB(1));
-+ if( count == 0 ){
++ if (count == 0) {
+ ret = RET_FAIL;
-+ } else if( count < 3 || count > 4 ){
++ } else if ( count < 3 || count > 4 ) {
+ cardcrit(wc->boardnum, "BOGUS arm message size %d, flushing queue", count);
+ // NB: This may take a while (up to 500usec or more) to complete
+ // and we are in the isr at present when this is called, so
@@ -13152,8 +13047,8 @@
+ // bottom half, but we are already in trouble, so...
+ d = debug; debug = 5; __ping_arm( wc ); debug = d;
+ ret = RET_FAIL;
-+ } else while( --count ){
-+ if( ! __read_arm_byte(wc, msg) ){
++ } else while (--count ) {
++ if (! __read_arm_byte(wc, msg)) {
+ cardcrit(wc->boardnum,
+ "Failed to read arm message %d more bytes expected",
+ count);
@@ -13165,19 +13060,20 @@
+ outb(0x09, PIB(1)); HTXF_WAIT_LOCKED();
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return ret;
-+} //}}}
++}
+
+static void openpci_arm_work( void *cardptr )
-+{ //{{{
++{
+ struct openpci *wc = (struct openpci*)cardptr;
+ unsigned char armmsg[4];
+
-+ if( read_arm_msg(wc, armmsg) ) arm_event(wc, armmsg);
-+} //}}}
++ if (read_arm_msg(wc, armmsg))
++ arm_event(wc, armmsg);
++}
+
+
+static inline void openpci_write(struct openpci *wc, unsigned char flags)
-+{ //{{{
++{
+ int x,y;
+ volatile unsigned int *writechunk;
+
@@ -13192,13 +13088,13 @@
+ }
+ /* get data */
+ dahdi_transmit(&wc->span);
-+ for (y=0,x=0;x<DAHDI_CHUNKSIZE;++x) {
++ for (y = 0, x = 0; x < DAHDI_CHUNKSIZE; ++x) {
+ /* Send a sample, as a 32-bit word */
+#ifdef __BIG_ENDIAN
+#warning No big endian support (yet)
+#else
+ /* transmit second 4 ports */
-+ writechunk[y]=0;
++ writechunk[y] = 0;
+ if (wc->porttype[4])
+ writechunk[y] |= (wc->chans[4]->writechunk[x] << 24);
+ else
@@ -13212,9 +13108,9 @@
+ ++y;
+
+ /* transmit first 4 ports */
-+ writechunk[y]=0x01000000;
++ writechunk[y] = 0x01000000;
+ /* Make sure first port doesnt equal 0x00 */
-+ if (wc->porttype[0]){
++ if (wc->porttype[0]) {
+ if (wc->chans[0]->writechunk[x] == 0)
+ writechunk[y] |= (0x01 << 24);
+ else
@@ -13230,10 +13126,10 @@
+ ++y;
+#endif
+ }
-+} //}}}
++}
+
+static inline void openpci_read(struct openpci *wc, unsigned char flags)
-+{ //{{{
++{
+ int x,y;
+ volatile unsigned int *readchunk;
+
@@ -13247,7 +13143,7 @@
+ return;
+ }
+
-+ for (y=0,x=0;x<DAHDI_CHUNKSIZE;++x) {
++ for (y = 0,x = 0; x < DAHDI_CHUNKSIZE; ++x) {
+#ifdef __BIG_ENDIAN
+#warning No big endian support (yet)
+#else
@@ -13280,14 +13176,10 @@
+ dahdi_ec_chunk(wc->chans[x], wc->chans[x]->readchunk, wc->chans[x]->writechunk);
+ }
+ dahdi_receive(&wc->span);
-+} //}}}
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-+static irqreturn_t openpci_isr(int irq, void *dev_id, struct pt_regs *regs)
-+#else
-+static irqreturn_t openpci_isr(int irq, void *dev_id)
-+#endif
-+{ //{{{
++}
++
++DAHDI_IRQ_HANDLER(openpci_isr)
++{
+ struct openpci *wc = dev_id;
+ unsigned long flags;
+ unsigned char status;
@@ -13297,7 +13189,7 @@
+ outb(status, TJ_INTSTAT);
+
+ if (!status) {
-+ if(inb(TJ_AUXR) & 0x02) {
++ if (inb(TJ_AUXR) & 0x02) {
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return IRQ_NONE;
+ }
@@ -13305,7 +13197,7 @@
+ openpci_arm_work(wc);
+ return IRQ_HANDLED;
+ }
-+ if (status & 0x10){
++ if (status & 0x10) {
+ /* PCI Master abort */
+ cardcrit(wc->boardnum, "PCI Master Abort.");
+ /* Stop DMA, wait for watchdog */
@@ -13315,15 +13207,15 @@
+ }
+ spin_unlock_irqrestore(&wc->lock, flags);
+
-+ if (status & 0x20){
++ if (status & 0x20) {
+ /* PCI Target abort */
+ cardcrit(wc->boardnum, "PCI Target Abort.");
+ return IRQ_HANDLED;
+ }
-+ if (status & 0x03){
++ if (status & 0x03) {
+ openpci_write(wc, status);
+ }
-+ if (status & 0x0c){
++ if (status & 0x0c) {
+ #ifdef DEBUG_LOOP_VOLTAGE
+ //{{{
+ static int counter[MAX_CARDS];
@@ -13331,11 +13223,13 @@
+ int port = ++counter[card] & 0x07;
+ int ignore = counter[card] & 0xf0;
+
-+ if( ! ignore && (voltmeter & ((1 << (card * 8)) << port)) ) {
++ if (!ignore && (voltmeter & ((1 << (card * 8)) << port))) {
+ unsigned char lv;
-+ if( wc->porttype[port] == VT_PORT_VDAA && read_reg_fxo(wc, port, 29, &lv) )
++ if (wc->porttype[port] == VT_PORT_VDAA &&
++ read_reg_fxo(wc, port, 29, &lv))
+ cardinfo(wc->boardnum, "Port %d loop voltage %d",
-+ port, lv < 128 ? lv : lv - 256);
++ port, lv < 128 ? lv :
++ lv - 256);
+ }
+ //}}}
+ #endif
@@ -13343,10 +13237,11 @@
+ }
+
+ return IRQ_HANDLED;
-+} //}}}
-+
-+static int openpci_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data)
-+{ //{{{
++}
++
++static int openpci_ioctl(struct dahdi_chan *chan, unsigned int cmd,
++ unsigned long data)
++{
+ struct wctdm_stats stats;
+ struct wctdm_regs regs;
+ struct wctdm_regop regop;
@@ -13359,26 +13254,27 @@
+ case DAHDI_ONHOOKTRANSFER:
+ if (wc->porttype[port] != VT_PORT_PROSLIC)
+ return -EINVAL;
-+ if (get_user(x, (int *)data))
++ if (get_user(x, (int __user *)data))
+ return -EFAULT;
+ wc->mod[port].fxs.ohttimer = x << 3;
+ if (reversepolarity)
+ wc->mod[port].fxs.idletxhookstate = 0x6; /* OHT mode when idle */
+ else
+ wc->mod[port].fxs.idletxhookstate = 0x2;
-+ switch(wc->mod[port].fxs.lasttxhook) {
++ switch (wc->mod[port].fxs.lasttxhook) {
+ case 0x1:
+ case 0x5:
+ if (reversepolarity)
+ wc->mod[port].fxs.lasttxhook = 0x6;
+ else
+ wc->mod[port].fxs.lasttxhook = 0x2;
-+ if( ! write_reg_fxs(wc, port, 64, wc->mod[port].fxs.lasttxhook) )
++ if (!write_reg_fxs(wc, port, 64,
++ wc->mod[port].fxs.lasttxhook))
+ return -EIO;
+ }
+ break;
+ case DAHDI_SETPOLARITY:
-+ if (get_user(x, (int *)data))
++ if (get_user(x, (int __user *)data))
+ return -EFAULT;
+ if (wc->porttype[port] != VT_PORT_PROSLIC)
+ return -EINVAL;
@@ -13391,84 +13287,87 @@
+ wc->mod[port].fxs.lasttxhook |= 0x04;
+ else
+ wc->mod[port].fxs.lasttxhook &= ~0x04;
-+ if( ! write_reg_fxs(wc, port, 64, wc->mod[port].fxs.lasttxhook) )
++ if (!write_reg_fxs(wc, port, 64, wc->mod[port].fxs.lasttxhook))
+ return -EIO;
+ break;
+ case WCTDM_GET_STATS:
+ if (wc->porttype[port] == VT_PORT_PROSLIC) {
+ unsigned char linevolt;
-+ if( read_reg_fxs(wc, port, 80, &linevolt) )
++ if (read_reg_fxs(wc, port, 80, &linevolt))
+ stats.tipvolt = linevolt * -376;
+ else
+ return -EIO;
-+ if( read_reg_fxs(wc, port, 81, &linevolt) )
++ if (read_reg_fxs(wc, port, 81, &linevolt))
+ stats.ringvolt = linevolt * -376;
+ else
+ return -EIO;
-+ if( read_reg_fxs(wc, port, 82, &linevolt) )
++ if (read_reg_fxs(wc, port, 82, &linevolt))
+ stats.batvolt = linevolt * -376;
+ else
+ return -EIO;
+ } else if (wc->porttype[port] == VT_PORT_VDAA) {
+ unsigned char linevolt;
-+ if( read_reg_fxo(wc, port, 29, &linevolt) )
++ if (read_reg_fxo(wc, port, 29, &linevolt))
+ stats.tipvolt = stats.ringvolt = stats.batvolt = linevolt * 1000;
+ else
+ return -EIO;
+ } else
+ return -EINVAL;
-+ if (copy_to_user((struct wctdm_stats *)data, &stats, sizeof(stats)))
++ if (copy_to_user((void __user *)data, &stats, sizeof(stats)))
+ return -EFAULT;
+ break;
+ case WCTDM_GET_REGS:
+ if (wc->porttype[port] == VT_PORT_PROSLIC) {
-+ for (x=0;x<NUM_INDIRECT_REGS;x++)
-+ if( ! read_indreg_fxs(wc, port, x, ®s.indirect[x]) )
++ for (x = 0; x < NUM_INDIRECT_REGS; x++)
++ if (!read_indreg_fxs(wc, port, x,
++ ®s.indirect[x]))
+ return -EIO;
-+ for (x=0;x<NUM_REGS;x++)
-+ if( ! read_reg_fxs(wc, port, x, ®s.direct[x]) )
++ for (x = 0; x < NUM_REGS; x++)
++ if (!read_reg_fxs(wc, port, x, ®s.direct[x]))
+ return -EIO;
+ } else {
+ memset(®s, 0, sizeof(regs));
-+ for (x=0;x<NUM_FXO_REGS;x++){
-+ if( ! read_reg_fxo(wc, port, x, ®s.direct[x]) )
++ for (x = 0; x < NUM_FXO_REGS; x++) {
++ if (!read_reg_fxo(wc, port, x, ®s.direct[x]))
+ return -EIO;
+ }
+ }
-+ if (copy_to_user((struct wctdm_regs *)data, ®s, sizeof(regs)))
++ if (copy_to_user((void __user *)data, ®s, sizeof(regs)))
+ return -EFAULT;
+ break;
+ case WCTDM_SET_REG:
-+ if (copy_from_user(®op, (struct wctdm_regop *)data, sizeof(regop)))
++ if (copy_from_user(®op, (void __user *)data, sizeof(regop)))
+ return -EFAULT;
+ if (regop.indirect) {
+ if (wc->porttype[port] != VT_PORT_PROSLIC)
+ return -EINVAL;
+ printk("Setting indirect %d to 0x%04x on %d\n",
+ regop.reg, regop.val, chan->chanpos);
-+ if( ! write_indreg_fxs(wc, port, regop.reg, regop.val) )
++ if (!write_indreg_fxs(wc, port, regop.reg, regop.val))
+ return -EIO;
+ } else {
+ regop.val &= 0xff;
+ printk("Setting direct %d to %04x on %d\n",
+ regop.reg, regop.val, chan->chanpos);
+ if (wc->porttype[port] == VT_PORT_PROSLIC) {
-+ if( ! write_reg_fxs(wc, port, regop.reg, regop.val) )
++ if (!write_reg_fxs(wc, port, regop.reg,
++ regop.val))
+ return -EIO;
+ } else {
-+ if( ! write_reg_fxo(wc, port, regop.reg, regop.val) )
++ if (!write_reg_fxo(wc, port, regop.reg,
++ regop.val))
+ return -EIO;
+ }
+ }
+ break;
+ case WCTDM_SET_ECHOTUNE:
+ cardinfo(wc->boardnum, "Setting echo registers");
-+ if (copy_from_user(&echoregs, (struct wctdm_echo_coefs*)data, sizeof(echoregs)))
++ if (copy_from_user(&echoregs, (void __user *)data, sizeof(echoregs)))
+ return -EFAULT;
+
+ if (wc->porttype[port] == VT_PORT_VDAA) {
+ /* Set the ACIM and digital echo canceller registers */
-+ if( ! write_reg_fxo(wc, port, 30, echoregs.acim)
++ if (!write_reg_fxo(wc, port, 30, echoregs.acim)
+ || ! write_reg_fxo(wc, port, 45, echoregs.coef1)
+ || ! write_reg_fxo(wc, port, 46, echoregs.coef2)
+ || ! write_reg_fxo(wc, port, 47, echoregs.coef3)
@@ -13476,7 +13375,7 @@
+ || ! write_reg_fxo(wc, port, 49, echoregs.coef5)
+ || ! write_reg_fxo(wc, port, 50, echoregs.coef6)
+ || ! write_reg_fxo(wc, port, 51, echoregs.coef7)
-+ || ! write_reg_fxo(wc, port, 52, echoregs.coef8) )
++ || ! write_reg_fxo(wc, port, 52, echoregs.coef8))
+ {
+ cardcrit(wc->boardnum, "Failed to set echo registers");
+ return -EIO;
@@ -13490,19 +13389,19 @@
+ return -ENOTTY;
+ }
+ return 0;
-+} //}}}
++}
+
+static int openpci_open(struct dahdi_chan *chan)
+{
+ struct openpci *wc = chan->pvt;
-+ if( ! wc->porttype[chan->chanpos-1] )
++ if (!wc->porttype[chan->chanpos-1])
+ return -ENODEV;
+
+ //XXX This is WRONG and can prang in a race. We must pass THIS_MODULE
+ // as the owner of the span that holds the pointer to this function,
+ // then bump the refcount in the dahdi code _BEFORE_ the potentially
+ // fatal call to an invalid pointer is made.
-+ //if( wc->dead ) return -ENODEV;
++ //if (wc->dead) return -ENODEV;
+ //wc->usecount++;
+ try_module_get(THIS_MODULE); //XXX
+
@@ -13544,7 +13443,7 @@
+}
+
+static int openpci_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig)
-+{ //{{{
++{
+ struct openpci *wc = chan->pvt;
+ int port = chan->chanpos - 1;
+ int new_hk_state;
@@ -13562,16 +13461,17 @@
+ switch(txsig) {
+ case DAHDI_TXSIG_START:
+ case DAHDI_TXSIG_OFFHOOK:
-+ if( write_reg_fxo(wc, port, 5, 0x9)
-+ && write_reg_fxo(wc, port, 0x20, 0x0) )
++ if (write_reg_fxo(wc, port, 5, 0x9)
++ && write_reg_fxo(wc, port, 0x20, 0x0))
+ wc->mod[port].fxo.offhook = 1;
+ else
-+ cardcrit(wc->boardnum, "Failed set fxo off-hook");
++ cardcrit(wc->boardnum,
++ "Failed set fxo off-hook");
+ break;
+
+ case DAHDI_TXSIG_ONHOOK:
-+ if( write_reg_fxo(wc, port, 5, 0x8)
-+ && write_reg_fxo(wc, port, 0x20, 0x3) )
++ if (write_reg_fxo(wc, port, 5, 0x8)
++ && write_reg_fxo(wc, port, 0x20, 0x3))
+ wc->mod[port].fxo.offhook = 0;
+ else
+ cardcrit(wc->boardnum, "Failed set fxo on-hook");
@@ -13628,13 +13528,14 @@
+ wc->porttype[port] == VT_PORT_VDAA ? "FXO" : "FXS",
+ port, wc->mod[port].fxs.lasttxhook, new_hk_state );
+
-+ if (new_hk_state != wc->mod[port].fxs.lasttxhook){
-+ if( write_reg_fxs(wc, port, 64, new_hk_state) )
++ if (new_hk_state != wc->mod[port].fxs.lasttxhook) {
++ if (write_reg_fxs(wc, port, 64, new_hk_state))
+ wc->mod[port].fxs.lasttxhook = new_hk_state;
+ else
+ cardcrit(wc->boardnum,
+ "Failed to set port %d fxs hookstate from %d to %d",
-+ port, wc->mod[port].fxs.lasttxhook, new_hk_state);
++ port, wc->mod[port].fxs.lasttxhook,
++ new_hk_state);
+ }
+ break;
+
@@ -13644,7 +13545,7 @@
+ wc->porttype[port] );
+ }
+ return 0;
-+} //}}}
++}
+
+static const struct dahdi_span_ops openpci_span_ops = {
+ .owner = THIS_MODULE,
@@ -13656,7 +13557,7 @@
+};
+
+static int span_initialize(struct openpci *wc)
-+{ //{{{
++{
+ int x;
+
+ wc->ddev = dahdi_create_device();
@@ -13673,9 +13574,11 @@
+ struct dahdi_chan *chan = &wc->_chans[x];
+ wc->chans[x] = chan;
+ sprintf(chan->name, "WCTDM/%d/%d", wc->boardnum, x);
-+ chan->sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS
-+ | DAHDI_SIG_SF | DAHDI_SIG_EM | DAHDI_SIG_CLEAR;
-+ chan->sigcap |= DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
++ chan->sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS
++ | DAHDI_SIG_FXOGS | DAHDI_SIG_SF | DAHDI_SIG_EM
++ | DAHDI_SIG_CLEAR;
++ chan->sigcap |= DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS
++ | DAHDI_SIG_SF | DAHDI_SIG_CLEAR;
+ chan->chanpos = x+1;
+ chan->pvt = wc;
+ }
@@ -13693,10 +13596,10 @@
+ return RET_FAIL;
+ }
+ return RET_OK;
-+} //}}}
++}
+
+static int get_port_type(struct openpci *wc, int port)
-+{ //{{{
++{
+ int i, type;
+ unsigned long flags;
+
@@ -13707,14 +13610,14 @@
+ spin_unlock_irqrestore(&wc->lock, flags);
+
+ return type;
-+} //}}}
++}
+
+static int check_ports(struct openpci *wc)
-+{ //{{{
++{
+ int i = 0;
+
+ wc->portcount = 0;
-+ for(; i < MAX_PORTS; ++i ){
++ for (; i < MAX_PORTS; ++i ) {
+ wc->porttype[i] = get_port_type(wc, i);
+ dbginfo(wc->boardnum,"%d: %s", i, porttype(wc,i));
+
@@ -13730,122 +13633,129 @@
+ ++wc->portcount;
+ }
+ }
-+ // we 'succeed' if any ports were discovered.
++ /* we 'succeed' if any ports were discovered. */
+ return wc->portcount ? RET_OK : RET_FAIL;
-+} //}}}
++}
+
+static int configure_vdaa_country(struct openpci *wc, int port, char *name)
-+{ //{{{
++{
+ unsigned char value;
+ int i;
+
-+ for (i=0; i < sizeof(fxo_modes)/sizeof(struct fxo_mode); ++i){
-+ if(!strcmp(fxo_modes[i].name, name)){
-+ dbginfo(wc->boardnum, "%d: Setting country to %s", port, name);
++ for (i = 0; i < sizeof(fxo_modes)/sizeof(struct fxo_mode); ++i) {
++ if (!strcmp(fxo_modes[i].name, name)) {
++ dbginfo(wc->boardnum, "%d: Setting country to %s",
++ port, name);
+ goto part2;
+ }
+ }
+ i = 3;
+ cardinfo(wc->boardnum, "Using default country %s", fxo_modes[i].name);
+
-+ part2:
++part2:
+ value = (fxo_modes[i].ohs << 6);
+ value |= (fxo_modes[i].rz << 1);
+ value |= (fxo_modes[i].rt << 0);
-+ if( ! write_reg_fxo(wc, port, 16, value) ) goto hell;
++ if (!write_reg_fxo(wc, port, 16, value)) goto hell;
+
+ /* DC Termination Control - Register 26 */
+ value = (fxo_modes[i].dcv << 6);
+ value |= (fxo_modes[i].mini << 4);
+ value |= (fxo_modes[i].ilim << 1);
-+ if( ! write_reg_fxo(wc, port, 26, value) ) goto hell;
++ if (!write_reg_fxo(wc, port, 26, value)) goto hell;
+
+ /* AC Termination Control - Register 30 */
+ value = (fxo_modes[i].acim << 0);
-+ if( ! write_reg_fxo(wc, port, 30, value) ) goto hell;
++ if (!write_reg_fxo(wc, port, 30, value)) goto hell;
+
+ /* DAA Control 5 - Register 31 */
+ msleep(1);
-+ if( ! read_reg_fxo(wc, port, 31, &value) ) goto hell;
++ if (!read_reg_fxo(wc, port, 31, &value)) goto hell;
+
+ value = (value & 0xf7) | (fxo_modes[i].ohs2 << 3);
+ value = value | 0x02;
-+ if( ! write_reg_fxo(wc, port, 31, value) ) goto hell;
++ if (! write_reg_fxo(wc, port, 31, value)) goto hell;
+
+ return RET_OK;
+
-+ hell:
++hell:
+ cardcrit(wc->boardnum, "port %d failed configure vdaa country", port);
+ return RET_FAIL;
-+} //}}}
-+
-+// Do not call this from an interrupt context, it may sleep.
++}
++
++/* Do not call this from an interrupt context, it may sleep. */
+static void configure_vdaa_port(struct openpci *wc, int port)
-+{ //{{{
++{
+ /* Set Country - default to Australia */
-+ if( configure_vdaa_country(wc, port, country) )
++ if (configure_vdaa_country(wc, port, country))
+ ++wc->portcount;
+ else {
+ cardcrit(wc->boardnum, "FAILED to configure vdaa port %d. Disabled.", port);
+ wc->porttype[port] = VT_PORT_EMPTY;
+ }
-+} //}}}
-+
-+static int configure_proslic_country(struct openpci *wc, int port, const char *name)
-+{ //{{{
++}
++
++static int configure_proslic_country(struct openpci *wc, int port,
++ const char *name)
++{
+ int i;
+
-+ for(i=0; i < sizeof(ps_country_regs)/sizeof(struct ps_country_reg); ++i) {
-+ if(!strcmp(ps_country_regs[i].country, name)){
-+ dbginfo(wc->boardnum, "%d: Setting country to %s", port, name);
++ for (i = 0; i < sizeof(ps_country_regs)/sizeof(struct ps_country_reg);
++ ++i) {
++ if (!strcmp(ps_country_regs[i].country, name)) {
++ dbginfo(wc->boardnum, "%d: Setting country to %s",
++ port, name);
+ goto part2;
+ }
+ }
+ return -EINVAL;
+
-+ part2:
-+
-+ if( ! write_reg_fxs(wc, port, 10, ps_country_regs[i].value) ){
++part2:
++
++ if (!write_reg_fxs(wc, port, 10, ps_country_regs[i].value)) {
+ cardcrit(wc->boardnum,"%d: failed to write PS_IMPEDANCE", port);
+ return -EIO;
+ }
+ return 0;
-+} //}}}
-+
-+// Do not call this from an interrupt context, it may sleep.
++}
++
++/* Do not call this from an interrupt context, it may sleep. */
+static void configure_proslic_port(struct openpci *wc, int port)
-+{ //{{{
++{
+ /* Set Country - default to Australia */
-+ switch( configure_proslic_country(wc, port, country) ){
-+ case 0:
-+ break;
-+
-+ case -EINVAL:
-+ cardwarn(wc->boardnum,"%d: Country '%s' unknown, using default", port, country);
-+ if( configure_proslic_country(wc, port, DEFAULT_COUNTRY) == 0 )
++ switch (configure_proslic_country(wc, port, country)) {
++ case 0:
++ break;
++
++ case -EINVAL:
++ cardwarn(wc->boardnum, "%d: Country '%s' unknown, using default",
++ port, country);
++ if (configure_proslic_country(wc, port,
++ DEFAULT_COUNTRY) == 0 )
++ goto hell;
++
++ default:
+ goto hell;
-+
-+ default:
-+ goto hell;
+ }
+
+ ++wc->portcount;
+ return;
+
-+ hell:
-+ cardcrit(wc->boardnum, "FAILED to configure proslic port %d. Disabled.", port);
++hell:
++ cardcrit(wc->boardnum, "FAILED to configure proslic port %d. Disabled.",
++ port);
+ wc->porttype[port] = VT_PORT_EMPTY;
-+} //}}}
-+
-+// Do not call this from an interrupt context, it may (indirectly) sleep.
++}
++
++/* Do not call this from an interrupt context, it may (indirectly) sleep. */
+static int configure_ports(struct openpci *wc)
-+{ //{{{
++{
+ unsigned long flags;
+ int i;
+
+ wc->portcount = 0;
-+ for(i=0; i < MAX_PORTS; ++i){
-+ switch (wc->porttype[i]){
++ for (i = 0; i < MAX_PORTS; ++i) {
++ switch (wc->porttype[i]) {
+ case VT_PORT_VDAA: configure_vdaa_port(wc,i); break;
+ case VT_PORT_PROSLIC: configure_proslic_port(wc,i); break;
+ }
@@ -13856,98 +13766,104 @@
+ outb(0xff, PIB(1)); HTXF_WAIT_LOCKED();
+ spin_unlock_irqrestore(&wc->lock, flags);
+
-+ // otherwise we 'succeed' if any ports were configured successfully.
++ /* otherwise we 'succeed' if any ports were configured successfully. */
+ return wc->portcount ? RET_OK : RET_FAIL;
-+} //}}}
++}
+
+static int __get_arm_id(struct openpci *wc, int field, char *value)
-+{ //{{{
++{
+ int i;
-+ int x=0;
-+ int count=0;
++ int x = 0;
++ int count = 0;
+
+ outb(0x01, PIB(1)); HTXF_WAIT();
+ outb(field, PIB(1)); HTXF_WAIT();
+ HRXF_WAIT(); count = inb(PIB(1));
-+ if (count > ID_DATA_MAXSIZE){
++ if (count > ID_DATA_MAXSIZE) {
+ cardcrit(wc->boardnum, "Too many bytes of id(%d) data %d/%d",
+ field, count, ID_DATA_MAXSIZE);
+ return RET_FAIL;
+ }
+ //cardinfo(wc->boardnum, "get_arm_id(%d): byte count %d",field,count);
-+ for(; x < count; ++x){
++ for (; x < count; ++x) {
+ HRXF_WAIT(); *value = inb(PIB(1));
+ //cardinfo(wc->boardnum, "get_arm_id(%d): byte %d => 0x%02x",field,x,tmp);
+ ++value;
+ }
+ return RET_OK;
-+} //}}}
++}
+
+static void enable_interrupts(struct openpci *wc)
-+{ //{{{
++{
+ outb(0x3f, TJ_MASK0);
+ outb(0x02, TJ_MASK1);
-+} //}}}
++}
+
+static void disable_interrupts(struct openpci *wc)
-+{ //{{{
++{
+ outb(0x00, TJ_MASK0);
+ outb(0x00, TJ_MASK1);
-+} //}}}
-+
-+// Do not call this from an interrupt context, it may sleep.
++}
++
++/* Do not call this from an interrupt context, it may sleep. */
+static int check_arm(struct openpci *wc)
-+{ //{{{
-+ char model[ID_DATA_MAXSIZE+1] = { 0 };
-+ char date[ID_DATA_MAXSIZE+1] = { 0 };
++{
++ char model[ID_DATA_MAXSIZE + 1] = { 0 };
++ char date[ID_DATA_MAXSIZE + 1] = { 0 };
+ unsigned long flags;
-+ int i=0;
-+ int tmp=0;
++ int i = 0;
++ int tmp = 0;
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ while ((tmp != 0x88)&&(++i<100)){
++ while ((tmp != 0x88) && (++i < 100)) {
+ outb(0x88, PIB(0));
+ msleep(1);
+ tmp = inb(PIB(1));
+ }
-+ if (i>=1000) goto limbo;
-+ dbginfo(wc->boardnum, "Arm responded on attempt %d",i);
-+
-+ // Flush out the queue if we sent several pings before a response.
-+ if(i>1) __ping_arm(wc);
-+
-+ if( ! __get_arm_id(wc, 0, model) ) goto hell;
++ if (i >= 1000)
++ goto limbo;
++ dbginfo(wc->boardnum, "Arm responded on attempt %d", i);
++
++ /* Flush out the queue if we sent several pings before a response. */
++ if (i > 1)
++ __ping_arm(wc);
++
++ if (!__get_arm_id(wc, 0, model))
++ goto hell;
+ sscanf(model, "OpenPCI8.%02d", &(wc->firmware));
+ cardinfo(wc->boardnum, " model: %s", model);
+
-+ if( ! __get_arm_id(wc, 1, date) ) goto hell;
++ if (!__get_arm_id(wc, 1, date))
++ goto hell;
+ cardinfo(wc->boardnum, " date: %s", date);
+
-+ if( ! __get_arm_id(wc, 2, wc->serial) ) goto hell;
++ if (!__get_arm_id(wc, 2, wc->serial))
++ goto hell;
+ cardinfo(wc->boardnum, " serial: %s", wc->serial);
+
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_OK;
+
-+ hell:
++hell:
+ spin_unlock_irqrestore(&wc->lock, flags);
-+ cardwarn(wc->boardnum, "Found ARM processor, dumb firmware.");
++ cardwarn(wc->boardnum, "Found ARM processor, dumb firmware.");
+ return RET_OK;
+
-+ limbo:
++limbo:
+ spin_unlock_irqrestore(&wc->lock, flags);
+ return RET_FAIL;
-+} //}}}
++}
+
+static int arm_monitor(struct openpci *wc, int on)
-+{ //{{{
++{
+ int i;
-+ outb( on ? 0x06 : 0x07, PIB(1) ); HTXF_WAIT();
++ outb(on ? 0x06 : 0x07, PIB(1)); HTXF_WAIT();
+ return RET_OK;
-+} //}}}
-+
-+static int __devinit openpci_probe_board(struct pci_dev *pdev, const struct pci_device_id *ent)
-+{ //{{{
++}
++
++static int __devinit openpci_probe_board(struct pci_dev *pdev,
++ const struct pci_device_id *ent)
++{
+ struct openpci *wc;
+ int boardnum = 0;
+ int failret = -ENOMEM;
@@ -13955,20 +13871,20 @@
+ int i;
+ unsigned long flags;
+
-+ if( ent->driver_data != (kernel_ulong_t)&wcopenpci )
-+ {
-+ info("Probe of non-OpenPCI card, ignoring.");
-+ return -EINVAL;
++ if (ent->driver_data != (kernel_ulong_t)&wcopenpci) {
++ info("Probe of non-OpenPCI card, ignoring.");
++ return -EINVAL;
+ }
+ wc = kzalloc(sizeof(struct openpci), GFP_KERNEL);
-+ if (!wc){
++ if (!wc)
+ return -ENOMEM;
-+ }
+
+ mutex_lock(&cards_mutex);
-+ for (; boardnum < MAX_CARDS && cards[boardnum]; ++boardnum);
-+ if (boardnum >= MAX_CARDS){
-+ crit("Too many OpenPCI cards(%d), max is %d.", boardnum, MAX_CARDS);
++ for (; boardnum < MAX_CARDS && cards[boardnum]; ++boardnum)
++ ;
++ if (boardnum >= MAX_CARDS) {
++ crit("Too many OpenPCI cards(%d), max is %d.",
++ boardnum, MAX_CARDS);
+ mutex_unlock(&cards_mutex);
+ goto hell;
+ }
@@ -13988,31 +13904,31 @@
+ goto hell_2;
+ }
+ wc->ioaddr = pci_resource_start(pdev, 0);
-+ if( ! request_region(wc->ioaddr, 0xff, NAME) ){
-+ cardcrit(boardnum, "Failed to lock IO region, another driver already using it");
++ if (!request_region(wc->ioaddr, 0xff, NAME)) {
++ cardcrit(boardnum, "Failed to lock IO region, another driver already using it");
+ failret = -EBUSY;
+ goto hell_2;
+ }
+
+ spin_lock_irqsave(&wc->lock, flags);
-+ outb(0xff, TJ_AUXD); /* Set up TJ to access the ARM */
-+ outb(0x78, TJ_AUXC); /* Set up for Jtag */
-+ outb(0x00, TJ_CNTL); /* pull ERST low */
++ outb(0xff, TJ_AUXD); /* Set up TJ to access the ARM */
++ outb(0x78, TJ_AUXC); /* Set up for Jtag */
++ outb(0x00, TJ_CNTL); /* pull ERST low */
+ spin_unlock_irqrestore(&wc->lock, flags);
-+ msleep(1); /* Wait a bit */
-+
-+ dbginfo(boardnum,"Starting ARM");
++ msleep(1); /* Wait a bit */
++
++ dbginfo(boardnum, "Starting ARM");
+ spin_lock_irqsave(&wc->lock, flags);
+ outb(0x01, TJ_CNTL); /* pull ERST high again */
+ spin_unlock_irqrestore(&wc->lock, flags);
+ msleep(100); /* Give it all a chance to boot */
+
-+ if( ! check_arm(wc) ){
++ if (!check_arm(wc)) {
+ cardcrit(boardnum, "Couldnt find ARM processor");
+ failret = -EIO;
+ goto hell_3;
+ }
-+ if( wc->firmware < 11 ){
++ if (wc->firmware < 11) {
+ cardcrit(boardnum,
+ "Firmware version %d not supported by this driver",
+ wc->firmware);
@@ -14020,21 +13936,23 @@
+ failret = -ENODEV;
+ goto hell_3;
+ }
-+ if( ! check_ports(wc) ){
++ if (!check_ports(wc)) {
+ cardcrit(boardnum, "Couldnt find ports!");
+ failret = -EIO;
+ goto hell_3;
+ }
+
-+ wc->writechunk = pci_alloc_consistent(pdev, VT_PCIDMA_BLOCKSIZE, &wc->writedma);
++ wc->writechunk = pci_alloc_consistent(pdev, VT_PCIDMA_BLOCKSIZE,
++ &wc->writedma);
+ if (!wc->writechunk) {
+ cardcrit(boardnum, "Couldnt get DMA memory.");
+ goto hell_3;
+ }
-+ wc->readchunk = wc->writechunk + DAHDI_MAX_CHUNKSIZE * (MAX_PORTS*2 / sizeof(int));
++ wc->readchunk = wc->writechunk + DAHDI_MAX_CHUNKSIZE *
++ (MAX_PORTS * 2 / sizeof(int));
+ wc->readdma = wc->writedma + DAHDI_MAX_CHUNKSIZE * (MAX_PORTS*2);
+
-+ memset((void*)wc->writechunk,0,VT_PCIDMA_BLOCKSIZE);
++ memset((void *)wc->writechunk, 0, VT_PCIDMA_BLOCKSIZE);
+
+ spin_lock_irqsave(&wc->lock, flags);
+ outb(0xc1, TJ_SERCTL);
@@ -14051,7 +13969,7 @@
+ outb(0xff, TJ_INTSTAT);
+ spin_unlock_irqrestore(&wc->lock, flags);
+
-+ if( ! arm_monitor(wc, 1) ){
++ if (!arm_monitor(wc, 1)) {
+ cardcrit(boardnum, "failed to start arm monitoring");
+ failret = -EIO;
+ goto hell_4;
@@ -14059,46 +13977,46 @@
+ msleep(1000);
+
+ i = 0;
-+ while(tmp != 0x88 && ++i < 1000) {
++ while (tmp != 0x88 && ++i < 1000) {
+ outb(0x88, PIB(0));
+ msleep(250);
+ tmp = inb(PIB(1));
+ }
-+ if(i>=1000) {
++ if (i >= 1000) {
+ cardcrit(boardnum, "FAILED to initialise board");
+ goto hell_4;
+ }
+
-+ if( ! check_ports(wc) ) {
++ if (!check_ports(wc)) {
+ cardcrit(boardnum, "FAILED to initialise ports");
+ failret = -EIO;
+ goto hell_4;
+ }
-+ if( ! configure_ports(wc) ){
++ if (!configure_ports(wc)) {
+ cardcrit(boardnum, "Failed to configure ports.");
+ failret = -EIO;
+ goto hell_4;
+ }
+ cardinfo(wc->boardnum, "have %d configured ports", wc->portcount);
+
-+ if( ! span_initialize(wc) ) {
++ if (!span_initialize(wc)) {
+ cardcrit(boardnum, "Failed to register with dahdi driver");
+ failret = -EFAULT;
+ goto hell_4;
+ }
+
+ /* Finalize signalling */
-+ for (i=0; i < MAX_PORTS; ++i) {
++ for (i = 0; i < MAX_PORTS; ++i) {
+ if (wc->porttype[i] == VT_PORT_VDAA)
-+ wc->chans[i]->sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS
-+ | DAHDI_SIG_CLEAR | DAHDI_SIG_SF;
++ wc->chans[i]->sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS
++ | DAHDI_SIG_CLEAR | DAHDI_SIG_SF;
+ else if (wc->porttype[i] == VT_PORT_PROSLIC)
-+ wc->chans[i]->sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS
-+ | DAHDI_SIG_FXOGS | DAHDI_SIG_SF
-+ | DAHDI_SIG_CLEAR | DAHDI_SIG_EM;
++ wc->chans[i]->sigcap = DAHDI_SIG_FXOKS | DAHDI_SIG_FXOLS
++ | DAHDI_SIG_FXOGS | DAHDI_SIG_SF
++ | DAHDI_SIG_CLEAR | DAHDI_SIG_EM;
+ else if (wc->porttype[i])
-+ cardcrit(wc->boardnum, "Port %d has unknown type (%d)",
-+ i, wc->porttype[i]);
++ cardcrit(wc->boardnum, "Port %d has unknown type (%d)",
++ i, wc->porttype[i]);
+ }
+
+ /* Enable bus mastering */
@@ -14114,35 +14032,35 @@
+ enable_interrupts(wc);
+ start_dma(wc);
+
-+ cardinfo(boardnum,"Initialised card.");
++ cardinfo(boardnum, "Initialised card.");
+ return 0;
+
-+ hell_5:
++hell_5:
+ dahdi_unregister_device(wc->ddev);
-+ hell_4:
-+ if (wc->writechunk){
++hell_4:
++ if (wc->writechunk)
+ pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE,
-+ (void*)wc->writechunk, wc->writedma);
-+ }
-+ hell_3:
++ (void *)wc->writechunk, wc->writedma);
++hell_3:
+ outb(0x00, TJ_CNTL);
+ release_region(wc->ioaddr, 0xff);
-+ hell_2:
++hell_2:
+ cards[boardnum] = NULL;
-+ hell:
++hell:
+ kfree(wc->ddev->location);
+ dahdi_free_device(wc->ddev);
+ kfree(wc);
+ return failret;
-+} //}}}
++}
+
+static void __devexit openpci_remove_board(struct pci_dev *pdev)
-+{ //{{{
++{
+ struct openpci *wc = pci_get_drvdata(pdev);
+
-+ if(!wc) return;
-+
-+ arm_monitor(wc,0);
++ if (!wc)
++ return;
++
++ arm_monitor(wc, 0);
+
+ /* Stop DMA */
+ outb(0x00, TJ_OPER);
@@ -14157,7 +14075,8 @@
+ dahdi_unregister_device(wc->ddev);
+ outb(0x00, TJ_CNTL);
+
-+ pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE, (void *)wc->writechunk, wc->writedma);
++ pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE,
++ (void *)wc->writechunk, wc->writedma);
+ free_irq(pdev->irq, wc);
+
+ release_region(wc->ioaddr, 0xff);
@@ -14170,9 +14089,9 @@
+ dahdi_free_device(wc->ddev);
+ kfree(wc);
+ cardinfo(wc->boardnum, "Removed OpenPCI card.");
-+} //}}}
-+
-+static struct pci_device_id openpci_pci_tbl[] = {
++}
++
++static DEFINE_PCI_DEVICE_TABLE(openpci_pci_tbl) = {
+ { 0xe159, 0x0001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (kernel_ulong_t) &wcopenpci },
+ { 0 }
+};
@@ -14180,12 +14099,10 @@
+MODULE_DEVICE_TABLE(pci, openpci_pci_tbl);
+
+static struct pci_driver openpci_driver = {
-+ name: NAME,
-+ probe: openpci_probe_board,
-+ remove: __devexit_p(openpci_remove_board),
-+ suspend: NULL,
-+ resume: NULL,
-+ id_table: openpci_pci_tbl,
++ .name = NAME,
++ .probe = openpci_probe_board,
++ .remove = __devexit_p(openpci_remove_board),
++ .id_table = openpci_pci_tbl,
+};
+
+static int __init openpci_init(void)
@@ -14195,7 +14112,7 @@
+ return -ENODEV;
+#endif
+
-+ if( dahdi_pci_module(&openpci_driver) )
++ if (dahdi_pci_module(&openpci_driver))
+ return -ENODEV;
+
+ info("Module loaded %s", debug ? "with debug enabled" : "");
@@ -14215,7 +14132,6 @@
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_VERSION(DAHDI_VERSION);
+MODULE_LICENSE("GPL");
-+
diff --git a/drivers/dahdi/zaphfc/Kbuild b/drivers/dahdi/zaphfc/Kbuild
new file mode 100644
index 0000000..960fb3a
@@ -14234,10 +14150,10 @@
+
diff --git a/drivers/dahdi/zaphfc/base.c b/drivers/dahdi/zaphfc/base.c
new file mode 100644
-index 0000000..65c6dae
+index 0000000..a7bf9b1
--- /dev/null
+++ b/drivers/dahdi/zaphfc/base.c
-@@ -0,0 +1,1719 @@
+@@ -0,0 +1,1720 @@
+/*
+ * zaphfc.c - Dahdi driver for HFC-S PCI A based ISDN BRI cards
+ *
@@ -14916,7 +14832,8 @@
+ "HFC-S PCI A ISDN card %d [%s] ",
+ hfctmp->cardnum,
+ hfctmp->nt_mode ? "NT" : "TE");
-+ hfccard->span.spantype = hfctmp->nt_mode ? "NT" : "TE";
++ hfccard->span.spantype = hfctmp->nt_mode ? SPANTYPE_DIGITAL_BRI_NT :
++ SPANTYPE_DIGITAL_BRI_TE;
+ hfccard->span.flags = 0;
+ hfccard->span.ops = &hfc_zap_span_ops;
+ hfccard->span.chans = hfccard->_chans;
Modified: dahdi-linux/trunk/debian/patches/no_firmware_download
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/no_firmware_download?rev=10221&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/patches/no_firmware_download (original)
+++ dahdi-linux/trunk/debian/patches/no_firmware_download Sun Jun 9 19:58:12 2013
@@ -10,12 +10,12 @@
--- a/Makefile
+++ b/Makefile
-@@ -88,7 +88,7 @@ include/dahdi/version.h: FORCE
+@@ -86,7 +86,7 @@ include/dahdi/version.h: FORCE
fi
@rm -f $@.tmp
--prereq: include/dahdi/version.h firmware-loaders
-+prereq: include/dahdi/version.h
+-prereq: include/dahdi/version.h firmware-loaders oct612x-lib
++prereq: include/dahdi/version.h oct612x-lib
stackcheck: $(CHECKSTACK) modules
objdump -d drivers/dahdi/*.ko drivers/dahdi/*/*.ko | $(CHECKSTACK)
Modified: dahdi-linux/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/series?rev=10221&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/patches/series (original)
+++ dahdi-linux/trunk/debian/patches/series Sun Jun 9 19:58:12 2013
@@ -3,8 +3,5 @@
no_firmware_download
chanmute
notest
-fix_define_dev
tor2-request_firmware
pciradio-request_firmware
-fix_xpp_usermode
-fix_xpp_post_unregister
More information about the Pkg-voip-commits
mailing list