aboutsummaryrefslogtreecommitdiff
path: root/misc/dahdi
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2010-08-26 04:10:10 +0000
committerMax Khon <fjoe@FreeBSD.org>2010-08-26 04:10:10 +0000
commit01f74df7350dfb3364d68493c9afdfe28f26c712 (patch)
tree621376a9b6f918bdb594e57faa9048febc52d49a /misc/dahdi
parent6c9136183ea41eb714346c6ab0fc0706e6f00356 (diff)
downloadports-01f74df7350dfb3364d68493c9afdfe28f26c712.tar.gz
ports-01f74df7350dfb3364d68493c9afdfe28f26c712.zip
Notes
Diffstat (limited to 'misc/dahdi')
-rw-r--r--misc/dahdi/Makefile15
-rw-r--r--misc/dahdi/distinfo6
-rw-r--r--misc/dahdi/files/dahdi.in13
-rw-r--r--misc/dahdi/files/patch-bchan165
-rw-r--r--misc/dahdi/pkg-plist11
5 files changed, 190 insertions, 20 deletions
diff --git a/misc/dahdi/Makefile b/misc/dahdi/Makefile
index ed61a62cf3fa..3dbadffd4d2e 100644
--- a/misc/dahdi/Makefile
+++ b/misc/dahdi/Makefile
@@ -19,8 +19,8 @@ COMMENT= Digium/Asterisk Hardware Device Interface
BUILD_DEPENDS= gmake:${PORTSDIR}/devel/gmake
LIB_DEPENDS= newt.52:${PORTSDIR}/devel/newt
-DAHDI_VERSION= 2.3.0-rc2
-DAHDI_TOOLS_VERSION= 2.3.0
+DAHDI_VERSION= 2.4.0-rc2
+DAHDI_TOOLS_VERSION= 2.4.0-rc1
NO_PACKAGE= Should be in sync with the kernel to work correctly
GNU_CONFIGURE= yes
@@ -29,7 +29,7 @@ CONFIGURE_ENV= WGET=/usr/bin/fetch
USE_LDCONFIG= yes
USE_RC_SUBR= dahdi
-ONLY_FOR_ARCHS= i386 amd64
+ONLY_FOR_ARCHS= i386 amd64 sparc64
CONFLICTS= zaptel-[0-9]*
MAN8= dahdi_cfg.8\
@@ -39,8 +39,6 @@ MAN8= dahdi_cfg.8\
dahdi_tool.8\
fxotune.8
-OPTIONS= EXPERIMENTAL "Enable experimental drivers" off
-
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 703000 || (${OSVERSION} >= 800000 && ${OSVERSION} < 800108)
@@ -53,13 +51,6 @@ PLIST_SUB+= X86=""
PLIST_SUB+= X86="@comment "
.endif
-.if defined(WITH_EXPERIMENTAL)
-MAKE_FLAGS+= WITH_EXPERIMENTAL=yes
-PLIST_SUB+= WITH_EXPERIMENTAL=""
-.else
-PLIST_SUB+= WITH_EXPERIMENTAL="@comment "
-.endif
-
pre-everything::
@if [ ! -f /usr/src/sys/Makefile ]; then \
${ECHO_MSG} ">> The dahdi port needs FreeBSD kernel source code to compile."; \
diff --git a/misc/dahdi/distinfo b/misc/dahdi/distinfo
index ba5f9996b6a6..bebc7c368400 100644
--- a/misc/dahdi/distinfo
+++ b/misc/dahdi/distinfo
@@ -1,3 +1,3 @@
-MD5 (dahdi-freebsd-complete-2.3.0-rc2+2.3.0.tar.gz) = 3885e017536e75cd1cb2a210e6668970
-SHA256 (dahdi-freebsd-complete-2.3.0-rc2+2.3.0.tar.gz) = aa56f9a87584de6c96e8efd4598e74760febaac470bd4616d7ee22b0ac398e08
-SIZE (dahdi-freebsd-complete-2.3.0-rc2+2.3.0.tar.gz) = 2013326
+MD5 (dahdi-freebsd-complete-2.4.0-rc2+2.4.0-rc1.tar.gz) = 3393be3504d041283a02a088a295c78f
+SHA256 (dahdi-freebsd-complete-2.4.0-rc2+2.4.0-rc1.tar.gz) = 0da28c257f8e21b2ab81a21144773dfdfcdd6c90981cc0eafd576fed63708a03
+SIZE (dahdi-freebsd-complete-2.4.0-rc2+2.4.0-rc1.tar.gz) = 2048391
diff --git a/misc/dahdi/files/dahdi.in b/misc/dahdi/files/dahdi.in
index ba9f2720c685..adf915391837 100644
--- a/misc/dahdi/files/dahdi.in
+++ b/misc/dahdi/files/dahdi.in
@@ -12,7 +12,18 @@
#
# dahdi_enable (bool): YES/NO (default: NO)
# dahdi_modules (list of strings): dahdi modules to load at boot (default: dahdi)
-# Valid modules are: dahdi, wct4xxp, wcb4xxp
+#
+# Valid modules are:
+# - dahdi
+# - dahdi_transcode
+# - wcb4xxp
+# - wcfxo
+# - wct4xxp
+# - wctc4xxp
+# - wctdm
+# - wctdm24xxp
+# - wcte11xp
+# - wcte12xp
#
# Example:
#
diff --git a/misc/dahdi/files/patch-bchan b/misc/dahdi/files/patch-bchan
new file mode 100644
index 000000000000..897ab738bd79
--- /dev/null
+++ b/misc/dahdi/files/patch-bchan
@@ -0,0 +1,165 @@
+Index: freebsd/include/dahdi/dahdi_config.h
+===================================================================
+--- freebsd/include/dahdi/dahdi_config.h (revision 8781)
++++ freebsd/include/dahdi/dahdi_config.h (working copy)
+@@ -180,7 +180,13 @@
+ */
+ /* #define OPTIMIZE_CHANMUTE */
+
++/*
++ * Uncomment the following for BRI D channels
++ *
++ */
++#define CONFIG_DAHDI_BRI_DCHANS
+
++
+ /*
+ * Pass DAHDI_AUDIOMODE to channel driver as well
+ */
+Index: freebsd/include/dahdi/kernel.h
+===================================================================
+--- freebsd/include/dahdi/kernel.h (revision 8781)
++++ freebsd/include/dahdi/kernel.h (working copy)
+@@ -426,6 +426,13 @@
+ int statcount;
+ int lastnumbufs;
+ #endif
++#ifdef CONFIG_DAHDI_BRI_DCHANS
++ int bytes2receive;
++ int maxbytes2transmit; /* size of the tx buffer in the card driver */
++ int bytes2transmit;
++ int eofrx;
++ int eoftx;
++#endif
+ spinlock_t lock;
+ char name[40];
+ /* Specified by DAHDI */
+@@ -738,6 +745,9 @@
+ DAHDI_FLAGBIT_LOOPED = 18, /*!< Loopback the receive data from the channel to the transmit */
+ DAHDI_FLAGBIT_MTP2 = 19, /*!< Repeats last message in buffer and also discards repeating messages sent to us */
+ DAHDI_FLAGBIT_HDLC56 = 20, /*!< Sets the given channel (if in HDLC mode) to use 56K HDLC instead of 64K */
++#if defined(CONFIG_DAHDI_BRI_DCHANS)
++ DAHDI_FLAGBIT_BRIDCHAN = 21, /*!< hardhdlc-like handling of the D channel */
++#endif
+ };
+
+ struct dahdi_count {
+@@ -788,6 +798,7 @@
+ #define DAHDI_FLAG_LOOPED DAHDI_FLAG(LOOPED)
+ #define DAHDI_FLAG_MTP2 DAHDI_FLAG(MTP2)
+ #define DAHDI_FLAG_HDLC56 DAHDI_FLAG(HDLC56)
++#define DAHDI_FLAG_BRIDCHAN DAHDI_FLAG(BRIDCHAN)
+
+ struct dahdi_span {
+ spinlock_t lock;
+Index: freebsd/drivers/dahdi/dahdi-base.c
+===================================================================
+--- freebsd/drivers/dahdi/dahdi-base.c (revision 8860)
++++ freebsd/drivers/dahdi/dahdi-base.c (working copy)
+@@ -6884,11 +6881,40 @@
+ *(txb++) = fasthdlc_tx_run_nocheck(&ms->txhdlc);
+ }
+ bytes -= left;
++#ifdef CONFIG_DAHDI_BRI_DCHANS
++ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
++ /*
++ * Let's get this right, we want to transmit complete frames only.
++ * The card driver will do the dirty HDLC work for us.
++ * txb (transmit buffer) is supposed to be big enough to store one frame
++ * we will make this as big as the D fifo (1KB or 2KB)
++ */
++
++ /* there are 'left' bytes in the user buffer left to transmit */
++ left = ms->writen[ms->outwritebuf] - ms->writeidx[ms->outwritebuf] - 2;
++ if (left > ms->maxbytes2transmit) {
++ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], ms->maxbytes2transmit);
++ ms->writeidx[ms->outwritebuf] += ms->maxbytes2transmit;
++ txb += ms->maxbytes2transmit;
++ ms->bytes2transmit = ms->maxbytes2transmit;
++ ms->eoftx = 0;
++ } else {
++ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
++ ms->writeidx[ms->outwritebuf] += left + 2;
++ txb += left + 2;
++ ms->bytes2transmit = left;
++ ms->eoftx = 1;
++ }
++ bytes = 0;
++#endif
+ } else {
+ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
+ ms->writeidx[ms->outwritebuf]+=left;
+ txb += left;
+ bytes -= left;
++#if defined(CONFIG_DAHDI_BRI_DCHANS)
++ ms->bytes2transmit=DAHDI_CHUNKSIZE;
++#endif
+ }
+ /* Check buffer status */
+ if (ms->writeidx[ms->outwritebuf] >= ms->writen[ms->outwritebuf]) {
+@@ -6947,6 +6973,17 @@
+ /* Transmit a flag if this is an HDLC channel */
+ if (ms->flags & DAHDI_FLAG_HDLC)
+ fasthdlc_tx_frame_nocheck(&ms->txhdlc);
++#if defined(CONFIG_DAHDI_BRI_DCHANS)
++ if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
++ // if (ms->bytes2transmit > 0) {
++ // txb += 2;
++ // ms->bytes2transmit -= 2;
++ bytes=0;
++ ms->eoftx = 1;
++// printk(KERN_CRIT "zaptel EOF(%d) bytes2transmit %d\n",ms->eoftx,ms->bytes2transmit);
++ // }
++ }
++#endif
+ #ifdef CONFIG_DAHDI_NET
+ if (ms->flags & DAHDI_FLAG_NETDEV)
+ netif_wake_queue(ztchan_to_dev(ms));
+@@ -7007,6 +7044,12 @@
+ memset(txb, 0xFF, bytes);
+ }
+ bytes = 0;
++#if defined(CONFIG_DAHDI_BRI_DCHANS)
++ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
++ ms->bytes2transmit = 0;
++ ms->eoftx = 0;
++ bytes = 0;
++#endif
+ } else {
+ memset(txb, DAHDI_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
+ bytes = 0;
+@@ -7905,6 +7948,14 @@
+ int left, x;
+
+
++#if defined(CONFIG_DAHDI_BRI_DCHANS)
++ if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
++ bytes = ms->bytes2receive;
++ if (bytes < 1) return;
++// printk(KERN_CRIT "bytes2receive %d\n",ms->bytes2receive);
++ }
++#endif
++
+ while(bytes) {
+ #if defined(CONFIG_DAHDI_NET) || defined(CONFIG_DAHDI_PPP)
+ skb = NULL;
+@@ -7962,6 +8013,19 @@
+ }
+ }
+ }
++#ifdef CONFIG_DAHDI_BRI_DCHANS
++ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
++ memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
++ rxb += left;
++ ms->readidx[ms->inreadbuf] += left;
++ bytes -= left;
++ if (ms->eofrx == 1) {
++ eof=1;
++ }
++// printk(KERN_CRIT "receiving %d bytes\n",ms->bytes2receive);
++ ms->bytes2receive = 0;
++ ms->eofrx = 0;
++#endif
+ } else {
+ /* Not HDLC */
+ memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
diff --git a/misc/dahdi/pkg-plist b/misc/dahdi/pkg-plist
index f64df1431013..8cec3807c4b1 100644
--- a/misc/dahdi/pkg-plist
+++ b/misc/dahdi/pkg-plist
@@ -6,6 +6,7 @@ include/dahdi/wctdm_user.h
lib/dahdi/dahdi-fw-hx8.bin.ko
lib/dahdi/dahdi-fw-oct6114-064.bin.ko
lib/dahdi/dahdi-fw-oct6114-128.bin.ko
+lib/dahdi/dahdi-fw-tc400m.bin.ko
lib/dahdi/dahdi.ko
lib/dahdi/dahdi_dynamic.ko
lib/dahdi/dahdi_dynamic_eth.ko
@@ -16,17 +17,19 @@ lib/dahdi/dahdi_echocan_kb1.ko
lib/dahdi/dahdi_echocan_mg2.ko
lib/dahdi/dahdi_echocan_sec.ko
lib/dahdi/dahdi_echocan_sec2.ko
+lib/dahdi/dahdi_transcode.ko
lib/dahdi/dahdi_voicebus.ko
+%%X86%%lib/dahdi/dahdi_vpmadt032_loader.ko
lib/dahdi/linker.hints
lib/dahdi/ng_dahdi_netdev.ko
lib/dahdi/wcb4xxp.ko
lib/dahdi/wcfxo.ko
lib/dahdi/wct4xxp.ko
+lib/dahdi/wctc4xxp.ko
+lib/dahdi/wctdm.ko
lib/dahdi/wctdm24xxp.ko
-%%X86%%%%WITH_EXPERIMENTAL%%lib/dahdi/dahdi_vpmadt032_loader.ko
-%%WITH_EXPERIMENTAL%%lib/dahdi/wctdm.ko
-%%WITH_EXPERIMENTAL%%lib/dahdi/wcte11xp.ko
-%%WITH_EXPERIMENTAL%%lib/dahdi/wcte12xp.ko
+lib/dahdi/wcte11xp.ko
+lib/dahdi/wcte12xp.ko
lib/libtonezone.a
lib/libtonezone.so
lib/libtonezone.so.1