Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 12:51:15 +02:00
commit 27c9d80f51
10493 changed files with 1885777 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
config VOICE_CPE_TAPI_FAX
bool "fax relay and modem support"
depends on PACKAGE_kmod-ltq-tapi
default n
help
Option to enable fax/modem support in TAPI.
Note: Newer platforms as AR9 and VR9 support a T.38 fax relay stack
in FW while older platforms like Danube or VINETIC-CPE require a
separate SW stack executed as an application.
config VOICE_CPE_TAPI_CID
bool "CID support"
depends on PACKAGE_kmod-ltq-tapi
default y
help
Option to enable Caller ID support.
config VOICE_CPE_TAPI_LT_GR909
bool "Linetesting GR-909 support"
depends on PACKAGE_kmod-ltq-tapi
default y
help
Option to enable linetesting GR-909.
config VOICE_CPE_TAPI_DECT
bool "DECT encoding for COSIC modem"
depends on PACKAGE_kmod-ltq-tapi
default n
help
Option to enable DECT encoding for COSIC modem.
config VOICE_CPE_TAPI_KPI
bool "KPI (Kernel Packet Interface)"
depends on PACKAGE_kmod-ltq-tapi
default n
help
Option to enable the generic kernel level packet interface
which allows accelerated packet transfer for various purposes.
The most important example is the QOS option, which allows
to redirect RTP packets directly into the IP stack.
Other options relying on KPI are DECT and HDLC.
config VOICE_CPE_TAPI_QOS
bool "QOS for accelerated RTP packet handling"
depends on PACKAGE_kmod-ltq-tapi
default n
help
Option to enable an accelerated RTP packet transfer inside
the LINUX kernel space. This option requires the KPI2UDP
packet, which actually provides the OS specific hooks in
the IP stack.
config VOICE_CPE_TAPI_STATISTICS
bool "TAPI statistics via /proc fs"
depends on PACKAGE_kmod-ltq-tapi
default y
help
Option to enable /proc fs statistics for packet counts etc.
config VOICE_CPE_TAPI_METERING
bool "Metering (TTX) support"
depends on PACKAGE_kmod-ltq-tapi
default n
help
Option to enable metering (TTX) support.
config VOICE_CPE_TAPI_HDLC
bool "PCM HDLC support, evaluation"
depends on PACKAGE_kmod-ltq-tapi
default n
help
Option to enable PCM HDLC framing inside the firmware, e.g. for
ISDN D-Channel access.
config VOICE_CPE_TAPI_TRACES
bool "enable driver traces"
depends on PACKAGE_kmod-ltq-tapi
default y
help
enable driver traces with different trace levels to be
configured dynamically from the application or during insmod
config VOICE_CPE_TAPI_LINUX_HOTPLUG
bool "enable driver Linux hotplug events"
depends on PACKAGE_kmod-ltq-tapi
default y
help
enable driver Linux hotplug events generation

View File

@@ -0,0 +1,71 @@
#
# Copyright (C) 2011 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:=drv_tapi
PKG_VERSION:=3.13.0
PKG_RELEASE:=6
PKG_SOURCE:=drv_tapi-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@OPENWRT
PKG_HASH:=109374d52872716570fca3fef3b93c9a93159a804dfd42484b19152b825af5c0
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_CHECK_FORMAT_SECURITY:=0
PKG_FIXUP:=autoreconf
PKG_EXTMOD_SUBDIRS:=src
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ltq-tapi
SUBMENU:=Voice over IP
TITLE:=Lantiq TAPI subsystem
URL:=http://www.lantiq.com/
DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-ifxos
FILES:=$(PKG_BUILD_DIR)/src/drv_tapi.ko
AUTOLOAD:=$(call AutoLoad,20,drv_tapi)
endef
define KernelPackage/ltq-tapi/description
Voice Subsystem Telephony API High Level Driver
endef
define KernelPackage/ltq-tapi/config
source "$(SOURCE)/Config.in"
endef
MAKE_FLAGS += \
$(KERNEL_MAKE_FLAGS)
CONFIGURE_ARGS += \
ARCH=$(LINUX_KARCH) \
--enable-linux-26 \
--enable-kernelbuild="$(LINUX_DIR)" \
--enable-kernelincl="$(LINUX_DIR)/include" \
--with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
$(call autoconf_bool,CONFIG_IFX_DRV_TAPI_EVENT_LOGGER,el-debug) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_FAX,fax t38) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_CID,cid) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_DECT,dect) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_KPI,kpi) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_QOS,qos) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_LT_GR909,lt) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_STATISTICS,statistics) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_METERING,metering) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_HDLC,hdlc) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_TRACES,trace) \
$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_LINUX_HOTPLUG,hotplug)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/drv_tapi
$(CP) --dereference $(PKG_BUILD_DIR)/include/* $(1)/usr/include/drv_tapi
(cd $(1)/usr/include/drv_tapi && ln -s . include && ln -s ../ifxos/ifx_types.h .)
endef
$(eval $(call KernelPackage,ltq-tapi))

View File

@@ -0,0 +1,82 @@
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -154,7 +154,7 @@ if KERNEL_2_6
drv_tapi_OBJS = "$(subst .c,.o, $(drv_tapi_SOURCES))"
drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA_DIST)
- @echo -e "Making Linux 2.6.x kernel object"
+ @echo "Making Linux 2.6.x kernel object"
@for f in $(drv_tapi_SOURCES) ; do \
if test ! -e $(PWD)/$$f; then \
echo " LN $$f" ; \
@@ -162,10 +162,10 @@ drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA
ln -s @abs_srcdir@/$$f $(PWD)/$$f; \
fi; \
done;
- @echo -e "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
- @echo -e "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
- @echo -e "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
- @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
+ @echo "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
+ @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
+ @echo "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
+ @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
$(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
clean-generic:
--- a/configure.in
+++ b/configure.in
@@ -128,7 +128,7 @@ dnl Set kernel build path
AC_ARG_ENABLE(kernelbuild,
AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path),
[
- if test -r $enableval/include/linux/autoconf.h; then
+ if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
else
AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
--- a/src/drv_tapi_linux.h
+++ b/src/drv_tapi_linux.h
@@ -24,6 +24,7 @@
#include <linux/version.h>
#include <linux/interrupt.h> /* in_interrupt() */
#include <linux/delay.h> /* mdelay - udelay */
+#include <linux/workqueue.h> /* work_struct */
#include <asm/poll.h> /* POLLIN, POLLOUT */
#include "ifx_types.h" /* ifx type definitions */
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -47,6 +47,7 @@
#include <linux/errno.h>
#include <asm/uaccess.h> /* copy_from_user(), ... */
#include <asm/byteorder.h>
+#include <linux/smp_lock.h> /* lock_kernel() */
#include <asm/io.h>
#ifdef LINUX_2_6
@@ -55,7 +56,11 @@
#include <linux/sched.h>
#undef CONFIG_DEVFS_FS
#ifndef UTS_RELEASE
- #include "linux/utsrelease.h"
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+# include <linux/utsrelease.h>
+#else
+# include <generated/utsrelease.h>
+#endif
#endif /* UTC_RELEASE */
#else
#include <linux/tqueue.h>
@@ -3718,7 +3723,11 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
flag and released after the down() call. */
lock_kernel();
mb();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
kill_proc(pThrCntrl->tid, SIGKILL, 1);
+#else
+ kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
+#endif
/* release the big kernel lock */
unlock_kernel();
wait_for_completion (&pThrCntrl->thrCompletion);

View File

@@ -0,0 +1,22 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -54,6 +54,10 @@
#include <linux/workqueue.h> /* LINUX 2.6 We need work_struct */
#include <linux/device.h>
#include <linux/sched.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
+ #include <linux/sched/signal.h>
+ #include <uapi/linux/sched/types.h>
+#endif
#undef CONFIG_DEVFS_FS
#ifndef UTS_RELEASE
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
@@ -184,7 +188,7 @@ MODULE_PARM_DESC(block_egress_tasklet, "
MODULE_PARM_DESC(block_ingress_tasklet, "block the execution of the ingress tasklet, i.e. force to use the RT kernel thread");
/** The driver callbacks which will be registered with the kernel*/
-static struct file_operations tapi_fops = {0};
+static struct file_operations tapi_fops;
/* ============================= */
/* Global function definition */

View File

@@ -0,0 +1,27 @@
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -122,13 +122,9 @@ endif
## flags for the driver
if USE_MODULE
-drv_tapi_CFLAGS = -DLINUX -D__KERNEL__ -DMODULE -Wno-format -DEXPORT_SYMTAB $(AM_CFLAGS)
+drv_tapi_CFLAGS = -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB $(AM_CFLAGS)
else
-drv_tapi_CFLAGS = -DLINUX -D__KERNEL__ -Wno-format -DEXPORT_SYMTAB $(AM_CFLAGS)
-endif
-
-if KERNEL_2_6
-drv_tapi_CFLAGS += -fno-common
+drv_tapi_CFLAGS = -DLINUX -D__KERNEL__ -DEXPORT_SYMTAB $(AM_CFLAGS)
endif
@@ -165,7 +161,7 @@ drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA
@echo "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
@echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
@echo "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
- @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
+ @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
$(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
clean-generic:

View File

@@ -0,0 +1,96 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -556,7 +556,7 @@ static ssize_t ifx_tapi_write (struct fi
IFX_uint8_t *pData;
IFX_size_t buf_size;
#endif /* TAPI_PACKET */
- IFX_ssize_t size = 0;
+ ssize_t size = 0;
#ifdef TAPI_PACKET
if (pTapiDev->bInitialized == IFX_FALSE)
--- a/src/drv_tapi_osmap.h
+++ b/src/drv_tapi_osmap.h
@@ -17,39 +17,6 @@
*/
#include "ifx_types.h" /* ifx type definitions */
-
-#ifndef HAVE_IFX_ULONG_T
- #warning please update your ifx_types.h, using local definition of IFX_ulong_t
- /* unsigned long type - valid for 32bit systems only */
- typedef unsigned long IFX_ulong_t;
- #define HAVE_IFX_ULONG_T
-#endif /* HAVE_IFX_ULONG_T */
-
-#ifndef HAVE_IFX_LONG_T
- #warning please update your ifx_types.h, using local definition of IFX_long_t
- /* long type - valid for 32bit systems only */
- typedef long IFX_long_t;
- #define HAVE_IFX_LONG_T
-#endif /* HAVE_IFX_LONG_T */
-
-#ifndef HAVE_IFX_INTPTR_T
- #warning please update your ifx_types.h, using local definition of IFX_intptr_t
- typedef IFX_long_t IFX_intptr_t;
- #define HAVE_IFX_INTPTR_T
-#endif /* HAVE_IFX_INTPTR_T */
-
-#ifndef HAVE_IFX_SIZE_T
- #warning please update your ifx_types.h, using local definition of IFX_size_t
- typedef IFX_ulong_t IFX_size_t;
- #define HAVE_IFX_SIZE_T
-#endif /* HAVE_IFX_SIZE_T */
-
-#ifndef HAVE_IFX_SSIZE_T
- #warning please update your ifx_types.h, using local definition of IFX_ssize_t
- typedef IFX_long_t IFX_ssize_t;
- #define HAVE_IFX_SSIZE_T
-#endif /* HAVE_IFX_SSIZE_T */
-
#include "ifxos_interrupt.h"
#include "ifxos_memory_alloc.h"
#include "ifxos_copy_user_space.h"
--- a/include/drv_tapi_ll_interface.h
+++ b/include/drv_tapi_ll_interface.h
@@ -40,13 +40,6 @@
#include "ifxos_select.h"
#endif /* TAPI_PACKET */
-#ifndef HAVE_IFX_ULONG_T
- #warning please update your ifx_types.h, using local definition of IFX_ulong_t
- /* unsigned long type - valid for 32bit systems only */
- typedef unsigned long IFX_ulong_t;
- #define HAVE_IFX_ULONG_T
-#endif /* HAVE_IFX_ULONG_T */
-
/* ============================= */
/* Local Macros Definitions */
/* ============================= */
--- a/src/lib/lib_bufferpool/lib_bufferpool.c
+++ b/src/lib/lib_bufferpool/lib_bufferpool.c
@@ -85,24 +85,6 @@
#include <stdlib.h>
#endif /*VXWORKS*/
-
-/* ============================= */
-/* Extra type definitions */
-/* ============================= */
-#ifndef HAVE_IFX_ULONG_T
- #warning please update your ifx_types.h, using local definition of IFX_ulong_t
- /* unsigned long type - valid for 32bit systems only */
- typedef unsigned long IFX_ulong_t;
- #define HAVE_IFX_ULONG_T
-#endif /* HAVE_IFX_ULONG_T */
-
-#ifndef HAVE_IFX_UINTPTR_T
- #warning please update your ifx_types.h, using local definition of IFX_uintptr_t
- typedef IFX_ulong_t IFX_uintptr_t;
- #define HAVE_IFX_UINTPTR_T
-#endif /* HAVE_IFX_UINTPTR_T */
-
-
/* ============================= */
/* Local Macros & Definitions */
/* ============================= */

View File

@@ -0,0 +1,108 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -47,7 +47,9 @@
#include <linux/errno.h>
#include <asm/uaccess.h> /* copy_from_user(), ... */
#include <asm/byteorder.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
#include <linux/smp_lock.h> /* lock_kernel() */
+#endif
#include <asm/io.h>
#ifdef LINUX_2_6
@@ -69,7 +71,9 @@
#else
#include <linux/tqueue.h>
#include <linux/sched.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
#include <linux/smp_lock.h> /* lock_kernel() */
+#endif
#endif /* LINUX_2_6 */
#include "drv_tapi.h"
@@ -137,8 +141,13 @@ static ssize_t ifx_tapi_write(struct fil
size_t count, loff_t * ppos);
static ssize_t ifx_tapi_read(struct file * filp, char *buf,
size_t length, loff_t * ppos);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
static int ifx_tapi_ioctl(struct inode *inode, struct file *filp,
unsigned int nCmd, unsigned long nArgument);
+#else
+static long ifx_tapi_ioctl(struct file *filp,
+ unsigned int nCmd, unsigned long nArgument);
+#endif
static unsigned int ifx_tapi_poll (struct file *filp, poll_table *table);
#ifdef CONFIG_PROC_FS
@@ -222,7 +231,11 @@ IFX_return_t TAPI_OS_RegisterLLDrv (IFX_
IFX_char_t *pRegDrvName = IFX_NULL;
IFX_int32_t ret = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
if (tapi_fops.ioctl == IFX_NULL)
+#else
+ if (tapi_fops.unlocked_ioctl == IFX_NULL)
+#endif
{
#ifdef MODULE
tapi_fops.owner = THIS_MODULE;
@@ -230,7 +243,11 @@ IFX_return_t TAPI_OS_RegisterLLDrv (IFX_
tapi_fops.read = ifx_tapi_read;
tapi_fops.write = ifx_tapi_write;
tapi_fops.poll = ifx_tapi_poll;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
tapi_fops.ioctl = ifx_tapi_ioctl;
+#else
+ tapi_fops.unlocked_ioctl = ifx_tapi_ioctl;
+#endif
tapi_fops.open = ifx_tapi_open;
tapi_fops.release = ifx_tapi_release;
}
@@ -885,8 +902,13 @@ static IFX_uint32_t ifx_tapi_poll (struc
- 0 and positive values - success
- negative value - ioctl failed
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
static int ifx_tapi_ioctl(struct inode *inode, struct file *filp,
unsigned int nCmd, unsigned long nArg)
+#else
+static long ifx_tapi_ioctl(struct file *filp,
+ unsigned int nCmd, unsigned long nArg)
+#endif
{
TAPI_FD_PRIV_DATA_t *pTapiPriv;
IFX_TAPI_ioctlCtx_t ctx;
@@ -3725,7 +3747,9 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
kernel lock (lock_kernel()). The lock must be
grabbed before changing the terminate
flag and released after the down() call. */
- lock_kernel();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+ lock_kernel();
+#endif
mb();
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
kill_proc(pThrCntrl->tid, SIGKILL, 1);
@@ -3733,8 +3757,10 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
#endif
/* release the big kernel lock */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
unlock_kernel();
- wait_for_completion (&pThrCntrl->thrCompletion);
+#endif
+ wait_for_completion (&pThrCntrl->thrCompletion);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
/* Now we are sure the thread is in zombie state.
--- a/src/lib/lib_fifo/lib_fifo.c
+++ b/src/lib/lib_fifo/lib_fifo.c
@@ -41,7 +41,7 @@
#ifdef LINUX
/* if linux/slab.h is not available, use the precessor linux/malloc.h */
#include <linux/slab.h>
-#elif VXWORKS
+#elif defined(VXWORKS)
#include <sys_drv_debug.h>
#endif /* LINUX */

View File

@@ -0,0 +1,11 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -97,6 +97,8 @@
#include "drv_tapi_announcements.h"
#endif /* TAPI_ANNOUNCEMENTS */
+#undef CONFIG_PROC_FS
+
#define TAPI_IOCTL_STACKSIZE 4000 /* allow some overhead 4 k */
/* ================================== */

View File

@@ -0,0 +1,48 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -119,7 +119,11 @@ struct _TAPI_FD_PRIV_DATA
/* ============================= */
/* Local Functions */
/* ============================= */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg);
+#else
+static IFX_void_t TAPI_timer_call_back (struct timer_list *t);
+#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
static IFX_void_t TAPI_tqueue (IFX_void_t *pWork);
#else /* for Kernel newer or equal 2.6.20 */
@@ -3384,11 +3388,15 @@ Timer_ID TAPI_Create_Timer(TIMER_ENTRY p
pTimerData->nArgument = nArgument;
pTimerData->bStopped = IFX_FALSE;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0))
init_timer(&(pTimerData->Timer_List));
/* set timer call back function */
pTimerData->Timer_List.function = TAPI_timer_call_back;
pTimerData->Timer_List.data = (IFX_ulong_t) pTimerData;
+#else
+ timer_setup(&(pTimerData->Timer_List), TAPI_timer_call_back, 0);
+#endif
/* Initialize Timer Task */
#ifdef LINUX_2_6
@@ -3529,9 +3537,17 @@ static IFX_void_t TAPI_tqueue (struct wo
\param arg Pointer to corresponding timer ID.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg)
+#else
+static IFX_void_t TAPI_timer_call_back (struct timer_list *t)
+#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
Timer_ID Timer = (Timer_ID) arg;
+#else
+ Timer_ID Timer = from_timer(Timer, t, Timer_List);
+#endif
/* do the operation in process context,
not in interrupt context */
#ifdef LINUX_2_6

View File

@@ -0,0 +1,52 @@
--- a/src/drv_tapi.h
+++ b/src/drv_tapi.h
@@ -25,6 +25,7 @@
#include <lib_bufferpool.h>
#include "drv_tapi_io.h"
#include "drv_tapi_event.h"
+#include <linux/module.h>
/* ============================= */
--- a/src/drv_tapi_dial.c
+++ b/src/drv_tapi_dial.c
@@ -20,6 +20,19 @@
#include "drv_tapi.h"
#include "drv_tapi_errno.h"
+
+
+static unsigned int min_digit_low = TAPI_MIN_DIGIT_LOW;
+static unsigned int max_digit_low = TAPI_MAX_DIGIT_LOW;
+static unsigned int min_digit_high = TAPI_MIN_DIGIT_HIGH;
+static unsigned int max_digit_high = TAPI_MAX_DIGIT_HIGH;
+static unsigned int min_interdigit = TAPI_MIN_INTERDIGIT;
+module_param(min_digit_low, uint, 0);
+module_param(max_digit_low, uint, 0);
+module_param(min_digit_high, uint, 0);
+module_param(max_digit_high, uint, 0);
+module_param(min_interdigit, uint, 0);
+
/*lint -save -esym(749, TAPI_HOOK_STATE_PULSE_H_FLASH_VAL) */
/* ============================= */
/* Local macros and definitions */
@@ -408,14 +421,14 @@ IFX_int32_t IFX_TAPI_Dial_Initialise(TAP
}
}
/* set default values for the validation timers */
- pTapiDialData->TapiDigitLowTime.nMinTime = TAPI_MIN_DIGIT_LOW;
- pTapiDialData->TapiDigitLowTime.nMaxTime = TAPI_MAX_DIGIT_LOW;
- pTapiDialData->TapiDigitHighTime.nMinTime = TAPI_MIN_DIGIT_HIGH;
- pTapiDialData->TapiDigitHighTime.nMaxTime = TAPI_MAX_DIGIT_HIGH;
+ pTapiDialData->TapiDigitLowTime.nMinTime = min_digit_low;
+ pTapiDialData->TapiDigitLowTime.nMaxTime = max_digit_low;
+ pTapiDialData->TapiDigitHighTime.nMinTime = min_digit_high;
+ pTapiDialData->TapiDigitHighTime.nMaxTime = max_digit_high;
pTapiDialData->TapiHookFlashTime.nMinTime = TAPI_MIN_FLASH;
pTapiDialData->TapiHookFlashTime.nMaxTime = TAPI_MAX_FLASH;
pTapiDialData->TapiHookFlashMakeTime.nMinTime = TAPI_MIN_FLASH_MAKE;
- pTapiDialData->TapiInterDigitTime.nMinTime = TAPI_MIN_INTERDIGIT;
+ pTapiDialData->TapiInterDigitTime.nMinTime = min_interdigit;
pTapiDialData->TapiHookOffTime.nMinTime = TAPI_MIN_OFF_HOOK;
pTapiDialData->TapiHookOnTime.nMinTime = TAPI_MIN_ON_HOOK;
/* start hook state FSM in onhook state */

View File

@@ -0,0 +1,60 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -3287,10 +3287,13 @@ static IFX_void_t proc_EntriesRemove(IFX
*/
static IFX_void_t tapi_wq_setscheduler (IFX_int32_t foo)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
struct sched_param sched_params;
-
sched_params.sched_priority = TAPI_OS_THREAD_PRIO_HIGH;
sched_setscheduler(current, SCHED_FIFO, &sched_params);
+#else
+ sched_set_fifo_low(current);
+#endif
}
#endif /* LINUX_2_6 */
@@ -3727,6 +3730,7 @@ static IFX_int32_t TAPI_SelectCh (TAPI_F
*/
IFX_int32_t TAPI_OS_ThreadPriorityModify(IFX_uint32_t newPriority)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0))
struct sched_param sched_params;
IFX_int32_t ret;
@@ -3744,6 +3748,10 @@ IFX_int32_t TAPI_OS_ThreadPriorityModify
}
return (ret < 0) ? IFX_ERROR : IFX_SUCCESS;
+#else
+ sched_set_fifo_low(current);
+ return IFX_SUCCESS;
+#endif
}
@@ -3800,7 +3808,9 @@ module_exit (ifx_tapi_module_exit);
MODULE_AUTHOR ("Lantiq Deutschland GmbH");
MODULE_DESCRIPTION ("TAPI Driver - www.lantiq.com");
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5,10,0)
MODULE_SUPPORTED_DEVICE ("TAPI DEVICE");
+#endif
MODULE_LICENSE ("Dual BSD/GPL");
EXPORT_SYMBOL (IFX_TAPI_Register_LL_Drv);
--- a/src/drv_tapi_kpi.c
+++ b/src/drv_tapi_kpi.c
@@ -134,7 +134,11 @@ extern IFX_int32_t block_ingre
/* ========================================================================== */
static IFX_void_t ifx_tapi_KPI_IngressHandler (IFX_ulong_t foo);
#ifdef KPI_TASKLET
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
DECLARE_TASKLET(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler, 0L);
+#else
+DECLARE_TASKLET_OLD(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler);
+#endif
#endif /* KPI_TASKLET */
static IFX_int32_t ifx_tapi_KPI_IngressThread (IFXOS_ThreadParams_t *pThread);
static IFX_return_t ifx_tapi_KPI_GroupInit(IFX_uint32_t nKpiGroup);

View File

@@ -0,0 +1,14 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -3779,8 +3779,10 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
mb();
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
kill_proc(pThrCntrl->tid, SIGKILL, 1);
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
+#else
+ kill_pid(get_task_pid(pThrCntrl->tid, PIDTYPE_PID), SIGKILL, 1);
#endif
/* release the big kernel lock */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)

View File

@@ -0,0 +1,114 @@
--- a/src/drv_tapi_cid.c
+++ b/src/drv_tapi_cid.c
@@ -1424,6 +1424,8 @@ static IFX_int32_t cid_lookup_transparen
cidfsk_set_tx_time (pTxData, &pConfData->TapiCidFskConf);
+ fallthrough;
+
case IFX_TAPI_CID_GEN_TYPE_DTMF:
memcpy (pTxData->cidBuf[IFX_TAPI_CID_GEN_TYPE_DTMF].pBuf,
pMessage[0].transparent.data, pMessage[0].transparent.len);
@@ -1497,6 +1499,7 @@ static IFX_int32_t cid_prepare_data(TAPI
break;
case IFX_TAPI_CID_STD_KPN_DTMF:
/*lint -fallthrough*/
+ fallthrough;
case IFX_TAPI_CID_STD_KPN_DTMF_FSK:
if (IFX_TAPI_CID_HM_ONHOOK == pTxData->txHookMode)
{
@@ -1506,6 +1509,7 @@ static IFX_int32_t cid_prepare_data(TAPI
}
/* KPN CID Type 2 (off-hook) always using FSK */
/*lint -fallthrough*/
+ fallthrough;
default:
pTxData->cidGenType = IFX_TAPI_CID_GEN_TYPE_FSK;
break;
@@ -1532,6 +1536,7 @@ static IFX_int32_t cid_prepare_data(TAPI
break;
/*lint -fallthrough*/
+ fallthrough;
case IFX_TAPI_CID_GEN_TYPE_FSK:
if (IFX_TAPI_CID_STD_NTT == pConfData->nStandard)
@@ -2036,6 +2041,7 @@ static FSM_STATUS_t cid_fsm_alert_exec(T
}
pTxData->nCidSubState++;
/*lint -fallthrough*/
+ fallthrough;
case 1:
if (pConfData->OSIoffhook && pConfData->nSAStone)
{
@@ -2052,6 +2058,7 @@ static FSM_STATUS_t cid_fsm_alert_exec(T
}
pTxData->nCidSubState++;
/*lint -fallthrough*/
+ fallthrough;
case 2:
if (pConfData->nSAStone)
{
@@ -2069,6 +2076,7 @@ static FSM_STATUS_t cid_fsm_alert_exec(T
}
pTxData->nCidSubState++;
/*lint -fallthrough*/
+ fallthrough;
default:
/* Play CAS tone on data channel, use unprotected function, protection
is done around cid_fsm_alert_exec */
@@ -3458,6 +3466,7 @@ IFX_int32_t TAPI_Phone_CID_Stop_Tx(TAPI_
}
/* deliberately fall through */
/*lint -fallthrough*/
+ fallthrough;
case TAPI_CID_STATE_ACK:
/* deactivate the DTMF override - last two params are ignored */
if (ptr_chk(pDrvCtx->SIG.DTMFD_Override, ""))
@@ -3469,6 +3478,7 @@ IFX_int32_t TAPI_Phone_CID_Stop_Tx(TAPI_
}
/* deliberately fall through */
/*lint -fallthrough*/
+ fallthrough;
case TAPI_CID_STATE_SENDING:
TAPI_Stop_Timer (pTxData->CidTimerID);
break;
@@ -4066,6 +4076,7 @@ IFX_int32_t TAPI_Phone_Get_CidRxData (TA
/* If the fifo is not empty take the data from the fifo first. */
/* deliberately fallthrough to default case */
/*lint -fallthrough*/
+ fallthrough;
default:
/* Allow readout of data in all other states not handled above.
When there is no data in the fifo TAPI_statusErr is returned. */
--- a/src/drv_tapi_dial.c
+++ b/src/drv_tapi_dial.c
@@ -319,6 +319,8 @@ static IFX_void_t ifx_tapi_dial_OnTimer(
/* NOTE: the "break" statement has been intentionally omitted */
/*lint -fallthrough */
+ fallthrough;
+
case TAPI_HOOK_STATE_DIAL_L_VAL:
/* digit_l_min expires: onhook has lasted long enough to be a
certain low pulse (not noise). The next state is the overlap with
--- a/src/drv_tapi_event.c
+++ b/src/drv_tapi_event.c
@@ -1545,6 +1545,7 @@ IFX_int32_t IFX_TAPI_Event_Dispatch_Proc
/**\todo put in device fifo */
pEvent->ch = IFX_TAPI_DEVICE_CH_NUMBER;
/*lint -fallthrough */
+ fallthrough;
case IFX_TAPI_ERRSRC_LL_CH:
pEvent->data.value |= IFX_TAPI_ERRSRC_LL;
break;
--- a/src/drv_tapi_ioctl.c
+++ b/src/drv_tapi_ioctl.c
@@ -1552,6 +1552,7 @@ static IFX_int32_t TAPI_IoctlCh (IFX_TA
/* Dial Services */
ret = TAPI_statusNotSupported;
/*lint -fallthrough*/
+ fallthrough;
default:
bHandled = IFX_FALSE;
break;

View File

@@ -0,0 +1,12 @@
--- a/src/drv_tapi_ioctl.c
+++ b/src/drv_tapi_ioctl.c
@@ -702,7 +702,8 @@ static IFX_int32_t TAPI_IoctlDev (IFX_TA
if (ret == TAPI_statusOk || ret == 1)
{
- copy_to_user ((IFX_void_t*)ioarg, p_tmp, sizeof(IFX_TAPI_CAP_t));
+ if (copy_to_user ((IFX_void_t*)ioarg, p_tmp, sizeof(IFX_TAPI_CAP_t)))
+ ret = TAPI_statusErrKernCpy;
}
}
TAPI_OS_Free (p_tmp);

View File

@@ -0,0 +1,11 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -3351,7 +3351,7 @@ static void __exit ifx_tapi_module_exit(
/* as we are using work queues to schedule events from the interrupt
context to the process context, we use work queues in case of
Linux 2.6. they must be flushed on driver unload... */
- flush_scheduled_work();
+ flush_workqueue(pTapiWq);
destroy_workqueue(pTapiWq);
#endif /* LINUX_2_6 */

View File

@@ -0,0 +1,87 @@
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
@@ -274,7 +274,7 @@ IFX_return_t TAPI_OS_RegisterLLDrv (IFX_
TRACE( TAPI_DRV, DBG_LEVEL_HIGH,
("IFX_TAPI_Register_LL_Drv: unable to register chrdev major number "
"%d\n", majorNumber));
- return TAPI_statusErr;
+ return IFX_ERROR;
}
#if 0
@@ -290,7 +290,7 @@ IFX_return_t TAPI_OS_RegisterLLDrv (IFX_
#endif /* LINUX_2_6 */
#endif /* 0 */
- return TAPI_statusOk;
+ return IFX_SUCCESS;
}
@@ -316,7 +316,7 @@ IFX_return_t TAPI_OS_UnregisterLLDrv (IF
{
unregister_chrdev (pLLDrvCtx->majorNumber, pHLDrvCtx->registeredDrvName);
- return TAPI_statusOk;
+ return IFX_SUCCESS;
}
@@ -3589,7 +3589,7 @@ static IFX_void_t Deferred_Worker (struc
*/
IFX_return_t TAPI_DeferWork (IFX_void_t *pFunc, IFX_void_t *pParam)
{
- IFX_return_t ret = TAPI_statusOk;
+ IFX_return_t ret = IFX_SUCCESS;
IFX_TAPI_EXT_EVENT_PARAM_t *pEvParam = (IFX_TAPI_EXT_EVENT_PARAM_t *) pParam;
#ifdef LINUX_2_6
struct work_struct *pTapiWs;
@@ -3605,7 +3605,7 @@ IFX_return_t TAPI_DeferWork (IFX_void_t
if (queue_work (pTapiWq, pTapiWs) == 0)
{
- ret = TAPI_statusWorkFail;
+ ret = IFX_ERROR;
}
#else
struct tq_struct *pTapiTq;
@@ -3617,7 +3617,7 @@ IFX_return_t TAPI_DeferWork (IFX_void_t
pTapiTq->sync = 0;
if (schedule_task (pTapiTq) == 0)
{
- ret = TAPI_statusWorkFail;
+ ret = IFX_ERROR;
}
#endif /* LINUX_2_6 */
return ret;
--- a/src/drv_tapi_event.c
+++ b/src/drv_tapi_event.c
@@ -1394,7 +1394,7 @@ IFX_return_t IFX_TAPI_Event_Dispatch (TA
pTapiDev->error.nCode =
(IFX_uint32_t)pTapiEvent->data.error->nLlCode;
}
- return TAPI_statusOk;
+ return IFX_SUCCESS;
}
/* global irq lock - multiple drivers may be loaded and all share this
@@ -2660,7 +2660,7 @@ IFX_return_t TAPI_EVENT_PKT_EV_Generate
/* start/stop generation of rfc 2833 pkt */
(IFX_void_t)pDrvCtx->COD.RTP_EV_Generate(pChannel->pLLChannel,
pPacketEvent->event,
- pPacketEvent->action,
+ (IFX_boolean_t)pPacketEvent->action,
pPacketEvent->duration,
nVolume);
}
--- a/src/drv_tapi_cid.c
+++ b/src/drv_tapi_cid.c
@@ -2278,7 +2278,7 @@ static FSM_STATUS_t cid_fsm_ack_exec(TAP
memset(&tapiEvent, 0, sizeof(IFX_TAPI_EVENT_t));
tapiEvent.id = IFX_TAPI_EVENT_CID_TX_NOACK_ERR;
- ret = IFX_TAPI_Event_Dispatch(pChannel,&tapiEvent);
+ ret = (FSM_STATUS_t)IFX_TAPI_Event_Dispatch(pChannel,&tapiEvent);
TRACE (TAPI_DRV,DBG_LEVEL_HIGH, ("no CID ack received!\n"));
}
ret = E_FSM_ERROR;