From 5f38a7f8576634b39a589bd54955a66247e81ad4 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Thu, 29 Mar 2012 11:09:46 +0200 Subject: [PATCH] ftmod_misdn: Remove unused timerfd code. Timer-based b-channel tx gating won't work anyway, so remove all those "#if 0"-ed bits of cruft. Also remove the mISDN-specific timerfd_create() check in configure. Signed-off-by: Stefan Knoblich --- libs/freetdm/configure.ac | 13 +----- .../src/ftmod/ftmod_misdn/ftmod_misdn.c | 44 +------------------ 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/libs/freetdm/configure.ac b/libs/freetdm/configure.ac index 292c1e7cfa..d166233f00 100644 --- a/libs/freetdm/configure.ac +++ b/libs/freetdm/configure.ac @@ -407,22 +407,13 @@ AC_ARG_WITH([misdn], ) AS_IF([test "${with_misdn}" != "no"], [AC_MSG_RESULT([${as_nl}<<>> ftmod_misdn (Linux mISDN I/O plugin)]) - AC_CHECK_FUNCS([timerfd_create],, - [AS_IF([test "${with_misdn}" = "yes"], - [AC_MSG_ERROR([no timerfd support in libc])], - [AC_MSG_NOTICE([no timerfd support in libc])] - )] - ) - AC_CHECK_HEADER([mISDN/mISDNif.h],, + AC_CHECK_HEADER([mISDN/mISDNif.h], + [HAVE_MISDN="yes"], [AS_IF([test "${with_misdn}" = "yes"], [AC_MSG_ERROR([mISDN/mISDNif.h not found])], [AC_MSG_NOTICE([mISDN/mISDNif.h not found])] )], [#include ] - ) - AS_IF([test "${ac_cv_func_timerfd_create}" = "yes" -a "${ac_cv_header_mISDN_mISDNif_h}" = "yes"], - [HAVE_MISDN="yes"], - [AC_MSG_NOTICE([Some required dependencies are missing, module disabled])] )] ) AM_CONDITIONAL([HAVE_MISDN], [test "${HAVE_MISDN}" = "yes"]) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 38480950e7..60e3c1425d 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -45,8 +45,6 @@ #include #include -#include - /* this is how it should have been... #ifdef HAVE_FREETDM_FREETDM_H #include @@ -256,7 +254,6 @@ struct misdn_chan_private { /* */ int state; int debugfd; - int timerfd; int active; /* hw addr of channel */ @@ -941,36 +938,7 @@ static FIO_OPEN_FUNCTION(misdn_open) ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "mISDN channel activation request sent\n"); switch (ftdmchan->type) { - case FTDM_CHAN_TYPE_B: { -#if 0 - struct itimerspec its = { - .it_interval = { 0, 0 }, - .it_value = { 0, 0 }, - }; - - its.it_interval.tv_nsec = (ftdmchan->effective_interval * 1000000); - its.it_value.tv_nsec = (ftdmchan->effective_interval * 1000000); - - /* create tx timerfd */ - chan_priv->timerfd = timerfd_create(CLOCK_MONOTONIC, O_NONBLOCK); - if (chan_priv->timerfd < 0) { - ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "mISDN failed to create b-channel tx interval timer: %s\n", - strerror(errno)); - return FTDM_FAIL; - } - - /* start tx timerfd */ - ret = timerfd_settime(chan_priv->timerfd, 0, &its, NULL); - if (ret < 0) { - ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "mISDN failed to start b-channel tx interval timer: %s\n", - strerror(errno)); - return FTDM_FAIL; - } - - ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "mISDN created tx interval (%d ms) timer\n", - ftdmchan->effective_interval); -#endif - } + case FTDM_CHAN_TYPE_B: case FTDM_CHAN_TYPE_DQ921: chan_priv->state = MISDN_CHAN_STATE_OPEN; break; @@ -998,15 +966,6 @@ static FIO_CLOSE_FUNCTION(misdn_close) /* deactivate b-channels on close */ if (ftdm_channel_get_type(ftdmchan) == FTDM_CHAN_TYPE_B) { -#if 0 - /* - * Stop tx timerfd - */ - if (chan_priv->timerfd >= 0) { - close(chan_priv->timerfd); - chan_priv->timerfd = -1; - } -#endif /* * Send deactivation request (don't wait for answer) */ @@ -1570,7 +1529,6 @@ static ftdm_status_t misdn_open_range(ftdm_span_t *span, ftdm_chan_type_t type, priv->addr = addr; priv->debugfd = -1; - priv->timerfd = -1; /* * Create event queue