summaryrefslogtreecommitdiff
path: root/package/ltq-tapidemo
diff options
context:
space:
mode:
Diffstat (limited to 'package/ltq-tapidemo')
-rw-r--r--package/ltq-tapidemo/Config.in41
-rw-r--r--package/ltq-tapidemo/Makefile68
-rw-r--r--package/ltq-tapidemo/files/bringup_tapidemo89
-rw-r--r--package/ltq-tapidemo/patches/100-ifxmips.patch78
-rw-r--r--package/ltq-tapidemo/patches/110-no_echo_cancelation.patch12
5 files changed, 288 insertions, 0 deletions
diff --git a/package/ltq-tapidemo/Config.in b/package/ltq-tapidemo/Config.in
new file mode 100644
index 0000000000..b8e157cf97
--- /dev/null
+++ b/package/ltq-tapidemo/Config.in
@@ -0,0 +1,41 @@
+#menu "Configuration"
+# depends on PACKAGE_ltq-tapidemo
+choice
+ prompt "board selection"
+ depends on PACKAGE_ltq-tapidemo
+ default VOICE_CPE_TAPIDEMO_BOARD_EASY50712_V3 if TARGET_ifxmips_platform_danube
+ default VOICE_CPE_TAPIDEMO_BOARD_EASY508xx if TARGET_ifxmips_platform_ar9
+ default VOICE_CPE_TAPIDEMO_BOARD_EASY80910 if TARGET_ifxmips_platform_vr9
+ default VOICE_CPE_TAPIDEMO_BOARD_EASY50812
+ help
+ Select the target platform.
+
+ config VOICE_CPE_TAPIDEMO_BOARD_EASY50712
+ bool "Danube reference board"
+
+ config VOICE_CPE_TAPIDEMO_BOARD_EASY50712_V3
+ bool "Danube reference board V3"
+
+ config VOICE_CPE_TAPIDEMO_BOARD_EASY508xx
+ bool "AR9/GR9 reference board"
+
+ config VOICE_CPE_TAPIDEMO_BOARD_EASY80910
+ bool "VR9 reference board"
+endchoice
+
+config VOICE_CPE_TAPIDEMO_QOS
+ bool "enable QOS support"
+ depends on PACKAGE_ltq-tapidemo
+ default n
+ help
+ Option to enable the KPI2UDP RTP packet acceleration path
+ (highly recommended for VoIP).
+
+config VOICE_CPE_TAPIDEMO_FAX_T.38_FW
+ bool "enable T.38 fax relay"
+ depends on (TARGET_ifxmips_platform_ar9 || TARGET_ifxmips_platform_vr9) && PACKAGE_ltq
+ default n
+ help
+ enable T.38 fax relay demo.
+
+#endmenu
diff --git a/package/ltq-tapidemo/Makefile b/package/ltq-tapidemo/Makefile
new file mode 100644
index 0000000000..3d3ddc91d2
--- /dev/null
+++ b/package/ltq-tapidemo/Makefile
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2008-2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=tapidemo
+PKG_VERSION:=5.0.1.27
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
+PKG_MD5SUM:=a38a7bf3242aad607f50f57b988bc87c
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ltq-tapidemo
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=TAPIdemo application for Lantiq boards
+ URL:=http://www.lantiq.com/
+ DEPENDS:=+kmod-ltq-tapi +kmod-ltq-vmmc
+ MAINTAINER:=John Crispin <blogic@openwrt.org>
+ MENU:=1
+endef
+
+define Package/ltq-tapidemo/description
+ Voice Access mini-PBX Demo Application
+endef
+
+define Package/ltq-tapidemo/config
+ source "$(SOURCE)/Config.in"
+endef
+
+CONFIGURE_ARGS += \
+ ARCH=$(LINUX_KARCH) \
+ --enable-linux-26 \
+ --enable-kernelincl="$(LINUX_DIR)/include" \
+ --with-drvincl="$(STAGING_DIR)/usr/include" \
+ $(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_QOS,qos) \
+ $(call autoconf_bool,CONFIG_VOICE_CPE_TAPIDEMO_FAX_T,fax-t38) \
+ --enable-trace \
+ --enable-fs
+
+ifeq ($(CONFIG_VOICE_CPE_TAPIDEMO_BOARD_EASY50712),y)
+ CONFIGURE_ARGS += --enable-boardname=EASY50712
+endif
+ifeq ($(CONFIG_VOICE_CPE_TAPIDEMO_BOARD_EASY50712_V3),y)
+ CONFIGURE_ARGS += --enable-boardname=EASY50712_V3
+endif
+ifeq ($(CONFIG_VOICE_CPE_TAPIDEMO_BOARD_EASY508xx),y)
+ CONFIGURE_ARGS += --enable-boardname=EASY508XX
+endif
+ifeq ($(CONFIG_VOICE_CPE_TAPIDEMO_BOARD_EASY80910),y)
+ CONFIGURE_ARGS += --enable-boardname=EASY508XX
+endif
+
+define Package/ltq-tapidemo/install
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tapidemo $(1)/usr/sbin
+ $(INSTALL_BIN) ./files/bringup_tapidemo $(1)/etc/init.d/tapidemo
+endef
+
+$(eval $(call BuildPackage,ltq-tapidemo))
diff --git a/package/ltq-tapidemo/files/bringup_tapidemo b/package/ltq-tapidemo/files/bringup_tapidemo
new file mode 100644
index 0000000000..6eb13d25f1
--- /dev/null
+++ b/package/ltq-tapidemo/files/bringup_tapidemo
@@ -0,0 +1,89 @@
+#!/bin/sh /etc/rc.common
+# (C) 2008 openwrt.org
+
+START=96
+
+[ ! -f /dev/vmmc10 ] && {
+ mknod /dev/vmmc10 c 122 10
+ mknod /dev/vmmc11 c 122 11
+ mknod /dev/vmmc12 c 122 12
+ mknod /dev/vmmc13 c 122 13
+ mknod /dev/vmmc14 c 122 14
+ mknod /dev/vmmc15 c 122 15
+ mknod /dev/vmmc16 c 122 16
+ mknod /dev/vmmc17 c 122 17
+ mknod /dev/vmmc18 c 122 18
+}
+
+TD_EXTRA_FLAGS_FXO=
+TD_EXTRA_FLAGS_KPI2UDP=
+TD_DOWNLOAD_PATH=/lib/firmware/
+DEV_NODE_TERIDIAN=ter10
+
+ # Show help
+help()
+{
+ echo "Usage:"
+ echo " - $0 WAN-IF-NAME - start TAPIDEMO without FXO support"
+ echo " - $0 WAN-IF-NAME fxo - start TAPIDEMO with FXO support."
+ echo " - $0 stop - stop TAPIDEMO"
+}
+
+# Check if device node for Teridian exists
+checkFxoSupport()
+{
+ if [ ! -e /dev/$DEV_NODE_TERIDIAN ];then
+ echo "FXO support is disabled. Can not find required driver's device node."
+ else
+ TD_EXTRA_FLAGS_FXO="-x"
+ fi
+}
+
+# Check if module drv_kpi2udp is loaded
+checkKpi2UdpSupport()
+{
+ tmp=`cat /proc/modules | grep 'drv_kpi2udp '`
+ if [ "$tmp" != "" ]; then
+ TD_EXTRA_FLAGS_KPI2UDP="-q"
+ fi
+}
+
+start()
+{
+ TD_WANIF=$1
+
+ TD_WANIF_IP=`ifconfig $TD_WANIF | grep 'inet addr:' | cut -f2 -d: | cut -f1 -d' '`
+ if [ "$TD_WANIF_IP" = "" ]; then
+ echo "Error, getting IP address for network device $TD_WANIF failed."
+ exit 1
+ fi
+
+ if [ "$2" = "" ];then
+ # FXO support is disabled.
+ continue
+ elif [ "$2" = "fxo" ];then
+ checkFxoSupport
+ else
+ echo "Error, unknown second parameter."
+ help
+ exit 1
+ fi
+
+ checkKpi2UdpSupport
+
+ if [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
+ fi
+
+ TD_DEBUG_LEVEL=$tapiDebugLevel
+ if [ "$TD_DEBUG_LEVEL" = "" ]; then
+ TD_DEBUG_LEVEL=3
+ fi
+
+ /usr/sbin/tapidemo -d $TD_DEBUG_LEVEL $TD_EXTRA_FLAGS_FXO $TD_EXTRA_FLAGS_KPI2UDP -i $TD_WANIF_IP -l $TD_DOWNLOAD_PATH &
+}
+
+stop()
+{
+ killall tapidemo > /dev/null 2> /dev/null
+}
diff --git a/package/ltq-tapidemo/patches/100-ifxmips.patch b/package/ltq-tapidemo/patches/100-ifxmips.patch
new file mode 100644
index 0000000000..43fa988ef7
--- /dev/null
+++ b/package/ltq-tapidemo/patches/100-ifxmips.patch
@@ -0,0 +1,78 @@
+--- a/src/board_easy50712.c Mon Mar 15 14:47:53 2010 +0300
++++ b/src/board_easy50712.c Tue Mar 16 17:25:55 2010 +0300
+@@ -40,7 +40,9 @@
+ #endif /* DUSLIC_FXO */
+ #endif /* EASY50712_V3 */
+
+-#include "asm/ifx/ifx_gpio.h"
++#ifdef FXO
++# include "asm/ifx/ifx_gpio.h"
++#endif
+
+ /* ============================= */
+ /* Defines */
+@@ -896,6 +898,7 @@
+ /* Global function definition */
+ /* ============================= */
+
++#ifdef FXO
+ /**
+ Set direction of GPIO pin to out which is used for set/clear reset.
+
+@@ -944,7 +947,7 @@
+ return IFX_SUCCESS;
+ }
+ break;
+-
++
+ case GPIO_DUSLIC_EASY50510:
+ {
+ TRACE(TAPIDEMO, DBG_LEVEL_LOW,
+@@ -982,8 +985,9 @@
+
+ return IFX_SUCCESS;
+ };
++#endif
+
+-
++#ifdef FXO
+ /*
+ Set/Clear reset of device by using GPIO port.
+
+@@ -1086,7 +1090,9 @@
+ /* usleep(100000); karol - workaround, */
+ return ret;
+ }
++#endif
+
++#ifdef EASY50510
+ /**
+ Set PCM master mode.
+
+@@ -1178,15 +1184,16 @@
+
+ return ret;
+ }
++#endif
+
+ /**
+ Register board.
+
+ \param pBoard - pointer to board
+-
++
+ \return IFX_SUCCESS if successful, otherwise IFX_ERROR.
+
+- \remarks
++ \remarks
+ */
+ IFX_return_t BOARD_Easy50712_Register(BOARD_t* pBoard)
+ {
+@@ -1204,7 +1211,3 @@
+ pBoard->RemoveBoard = BOARD_Easy50712_RemoveBoard;
+ return IFX_SUCCESS;
+ }
+-
+-
+-
+-
diff --git a/package/ltq-tapidemo/patches/110-no_echo_cancelation.patch b/package/ltq-tapidemo/patches/110-no_echo_cancelation.patch
new file mode 100644
index 0000000000..d424d48470
--- /dev/null
+++ b/package/ltq-tapidemo/patches/110-no_echo_cancelation.patch
@@ -0,0 +1,12 @@
+Index: tapidemo-5.0.1.27/src/device_vmmc.c
+===================================================================
+--- tapidemo-5.0.1.27.orig/src/device_vmmc.c 2009-11-09 15:40:31.000000000 +0100
++++ tapidemo-5.0.1.27/src/device_vmmc.c 2010-03-30 21:32:51.000000000 +0200
+@@ -240,7 +240,6 @@
+ TRACE(TAPIDEMO, DBG_LEVEL_HIGH,
+ ("Error, BBD file %s is not found.\n(File: %s, line: %d)\n",
+ pCpuDevice->pszBBD_CRAM_File, __FILE__, __LINE__));
+- return IFX_ERROR;
+ }
+
+ #endif /* USE_FILESYSTEM */