lantiq: ltq-tapi: add customer pulse digit time
authorJonas Albrecht <plonkbong100@protonmail.com>
Fri, 28 May 2021 10:28:35 +0000 (12:28 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 18 Nov 2022 19:27:52 +0000 (20:27 +0100)
With this patch you can change the pulse digit time by loading the Lantiq
FXS driver kernel module called ltq-tapi. This is relevant for old
rotaryphones that uses pulsedialing.

The default values are:
30-80ms for the low pulse
30-80ms for the high pulse
300ms for minimum Interdigit time

this is OK but on some Phones it can be usefull to customize the values
If you want to change the values to high and low pulse to 40-90ms and
minimum interdigit time to 400ms

than change /etc/modules.d/20-ltq-tapi to (without linebrakes):
drv_tapi min_digit_low=40  min_digit_high=90 max_digit_low=40 \
max_digit_high=90 min_interdigit=400

Signed-off-by: Jonas Albrecht <plonkbong100@protonmail.com>
package/kernel/lantiq/ltq-tapi/Makefile
package/kernel/lantiq/ltq-tapi/patches/410-custom_pulsedigit_time.patch [new file with mode: 0644]

index 77728644f6024998ed702186a5ad56bef633262f..d44eeae5658615554f36a436f17325ee72b8af80 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=drv_tapi
 PKG_VERSION:=3.13.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=drv_tapi-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@OPENWRT
diff --git a/package/kernel/lantiq/ltq-tapi/patches/410-custom_pulsedigit_time.patch b/package/kernel/lantiq/ltq-tapi/patches/410-custom_pulsedigit_time.patch
new file mode 100644 (file)
index 0000000..965b8be
--- /dev/null
@@ -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 */