diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-06 08:24:41 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-06 08:24:41 +0000 |
commit | 78c015ad276be368cc19e50c6d7a9754c0758c00 (patch) | |
tree | b9941b22f1eee73d00d41f7ca9dcc863c50d93fe /xpp | |
parent | 3657d8f829223072c78d8054f325ef0ac134cc18 (diff) |
Cleanup the unused non-RBS code:
* remove all non WITH_RBS code. No need for the define.
* unused recv_errors and seq_errors.
* CID_START_TICKS, CID_STOP_TICKS cid_timer from trunk/
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1411 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp')
-rw-r--r-- | xpp/Makefile | 2 | ||||
-rw-r--r-- | xpp/card_fxo.c | 42 | ||||
-rw-r--r-- | xpp/card_fxs.c | 82 | ||||
-rw-r--r-- | xpp/xpd.h | 5 | ||||
-rw-r--r-- | xpp/xpp_zap.c | 28 | ||||
-rw-r--r-- | xpp/xproto.c | 4 | ||||
-rw-r--r-- | xpp/xproto.h | 4 |
7 files changed, 2 insertions, 165 deletions
diff --git a/xpp/Makefile b/xpp/Makefile index 8df0b48..3ecfdd9 100644 --- a/xpp/Makefile +++ b/xpp/Makefile @@ -1,4 +1,4 @@ -EXTRA_CFLAGS = -I$(SUBDIRS) -DDEBUG -DPOLL_DIGITAL_INPUTS -DWITH_ECHO_SUPPRESSION -DWITH_RBS # -DSOFT_RING +EXTRA_CFLAGS = -I$(SUBDIRS) -DDEBUG -DPOLL_DIGITAL_INPUTS -DWITH_ECHO_SUPPRESSION # -DSOFT_RING obj-m = xpp.o xpp_usb.o xpd_fxs.o xpd_fxo.o xpp-y += xbus-core.o xpp_zap.o xproto.o card_global.o diff --git a/xpp/card_fxo.c b/xpp/card_fxo.c index 7b8180f..771676a 100644 --- a/xpp/card_fxo.c +++ b/xpp/card_fxo.c @@ -400,7 +400,6 @@ static int FXO_card_zaptel_postregistration(xpd_t *xpd, bool on) return 0; } -#ifdef WITH_RBS int FXO_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) { struct FXO_priv_data *priv; @@ -426,43 +425,6 @@ int FXO_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) return 0; } -#else -int FXO_card_sethook(xbus_t *xbus, xpd_t *xpd, int pos, int hookstate) -{ - int ret = 0; - struct FXO_priv_data *priv; - - DBG("%s/%s/%d: %s\n", xbus->busname, xpd->xpdname, pos, hookstate2str(hookstate)); - switch(hookstate) { - /* On-hook, off-hook: The PBX is playing a phone on an FXO line. */ - case ZT_ONHOOK: - do_sethook(xpd, pos, 0); - break; - case ZT_START: - DBG("%s/%s/%d: fall through ZT_OFFHOOK\n", xbus->busname, xpd->xpdname, pos); - xpd->delay_until_dialtone[pos] = DELAY_UNTIL_DIALTONE; - // Fall through - case ZT_OFFHOOK: - do_sethook(xpd, pos, 1); - wait_event_interruptible(xpd->txstateq[pos], xpd->delay_until_dialtone[pos] <= 0); - break; - case ZT_WINK: - WARN("No code yet\n"); - break; - case ZT_FLASH: - WARN("No code yet\n"); - break; - case ZT_RING: - DBG("%s/%s/%d: ZT_RING: %d\n", xbus->busname, xpd->xpdname, pos, xpd->ringing[pos]); - break; - case ZT_RINGOFF: - WARN("No code yet\n"); - break; - } - return ret; -} -#endif - static void poll_battery(xbus_t *xbus, xpd_t *xpd) { int i; @@ -792,11 +754,7 @@ xproto_table_t PROTO_TABLE(FXO) = { .card_remove = FXO_card_remove, .card_zaptel_preregistration = FXO_card_zaptel_preregistration, .card_zaptel_postregistration = FXO_card_zaptel_postregistration, -#ifdef WITH_RBS .card_hooksig = FXO_card_hooksig, -#else - .card_sethook = FXO_card_sethook, -#endif .card_tick = FXO_card_tick, .card_ioctl = FXO_card_ioctl, diff --git a/xpp/card_fxs.c b/xpp/card_fxs.c index ec7192e..d5ade7b 100644 --- a/xpp/card_fxs.c +++ b/xpp/card_fxs.c @@ -325,17 +325,8 @@ static int FXS_card_init(xbus_t *xbus, xpd_t *xpd) /* * Setup ring timers */ -#ifdef WITH_RBS /* Software controled ringing (for CID) */ ret = SLIC_DIRECT_REQUEST(xbus, xpd, ALL_LINES, 0x22, 0x00); /* Ringing Oscilator Control */ -#else - /* Hardware controled ringing (no CID) */ - ret += SLIC_DIRECT_REQUEST(xbus, xpd, ALL_LINES, 0x30, 0x80); /* Active timer low byte */ - ret += SLIC_DIRECT_REQUEST(xbus, xpd, ALL_LINES, 0x31, 0x3E); /* Active timer high byte */ - ret += SLIC_DIRECT_REQUEST(xbus, xpd, ALL_LINES, 0x32, 0x80); /* Inactive timer low byte */ - ret += SLIC_DIRECT_REQUEST(xbus, xpd, ALL_LINES, 0x33, 0x3E); /* Inactive timer high byte */ - ret += SLIC_DIRECT_REQUEST(xbus, xpd, ALL_LINES, 0x22, 0x18); /* Ringing Oscilator Control */ -#endif if(ret < 0) goto err; DBG("%s/%s: done\n", xbus->busname, xpd->xpdname); @@ -417,7 +408,6 @@ static int FXS_card_zaptel_postregistration(xpd_t *xpd, bool on) return 0; } -#ifdef WITH_RBS int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) { int ret = 0; @@ -489,74 +479,6 @@ int FXS_card_hooksig(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig) return ret; } -#else -int FXS_card_sethook(xbus_t *xbus, xpd_t *xpd, int pos, int hookstate) -{ - int ret = 0; - - DBG("%s/%s/%d: %s\n", xbus->busname, xpd->xpdname, pos, hookstate2str(hookstate)); - switch(hookstate) { - /* On-hook, off-hook: The PBX is playing a phone on an FXO line. - * Can be ignored for an FXS line - */ - case ZT_ONHOOK: - if(IS_SET(xpd->digital_inputs, pos)) { - NOTICE("%s: Trying to ONHOOK a digital input channel %d. Ignoring\n", __FUNCTION__, pos); - ret = -EINVAL; - break; - } - if(IS_SET(xpd->digital_outputs, pos)) { - DBG("%s/%s/%d: digital output OFF\n", xbus->busname, xpd->xpdname, pos); - ret = CALL_XMETHOD(RELAY_OUT, xpd->xbus, xpd, pos-8, 0); - break; - } - xpd->ringing[pos] = 0; - DBG("%s/%s/%d: stop ringing\n", xbus->busname, xpd->xpdname, pos); -#if 1 // FIXME: Not needed -- verify - ret = CALL_XMETHOD(RING, xbus, xpd, pos, 0); // RING off -#endif - if(ret) { - DBG("ZT_ONHOOK(stop ring) Failed: ret=0x%02X\n", ret); - break; - } - break; - case ZT_START: - DBG("%s/%s/%d: fall through ZT_OFFHOOK\n", xbus->busname, xpd->xpdname, pos); - // Fall through - case ZT_OFFHOOK: - DBG("%s/%s/%d: ZT_OFFHOOK (ignoring for PHONES)\n", xbus->busname, xpd->xpdname, pos); - break; - case ZT_WINK: - WARN("No code yet\n"); - break; - case ZT_FLASH: - WARN("No code yet\n"); - break; - case ZT_RING: - DBG("%s/%s/%d: ZT_RING: %d\n", xbus->busname, xpd->xpdname, pos, xpd->ringing[pos]); - if(IS_SET(xpd->digital_inputs, pos)) { - NOTICE("%s: Trying to RING a digital input channel %d. Ignoring\n", __FUNCTION__, pos); - return -EINVAL; - } - if(IS_SET(xpd->digital_outputs, pos)) { - DBG("%s/%s/%d: digital output ON\n", xbus->busname, xpd->xpdname, pos); - ret = CALL_XMETHOD(RELAY_OUT, xpd->xbus, xpd, pos-8, 1); - return ret; - } - xpd->ringing[pos] = 1; - ret = CALL_XMETHOD(RING, xbus, xpd, pos, 1); // RING on - if(ret) { - DBG("ZT_RING Failed: ret=0x%02X\n", ret); - } - break; - case ZT_RINGOFF: - WARN("No code yet\n"); - break; - } - return ret; -} -#endif - /* * INPUT polling is done via SLIC register 0x06 (same as LEDS): * 7 6 5 4 3 2 1 0 @@ -853,11 +775,7 @@ xproto_table_t PROTO_TABLE(FXS) = { .card_remove = FXS_card_remove, .card_zaptel_preregistration = FXS_card_zaptel_preregistration, .card_zaptel_postregistration = FXS_card_zaptel_postregistration, -#ifdef WITH_RBS .card_hooksig = FXS_card_hooksig, -#else - .card_sethook = FXS_card_sethook, -#endif .card_tick = FXS_card_tick, .RING = XPROTO_CALLER(FXS, RING), @@ -282,8 +282,6 @@ struct xpd { void *priv; /* Card level private data */ bool card_present; - unsigned int recv_errors; - unsigned int seq_errors; unsigned long last_response; /* in jiffies */ unsigned id; xpd_addr_t addr; @@ -296,8 +294,7 @@ struct xpd { u_char ec_chunk2[CHANNELS_PERXPD][ZT_CHUNKSIZE]; }; -#define for_each_line(xpd,i) \ - for((i) = 0; (i) < (xpd)->channels; (i)++) +#define for_each_line(xpd,i) for((i) = 0; (i) < (xpd)->channels; (i)++) #endif diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c index 698ef2a..ffb8934 100644 --- a/xpp/xpp_zap.c +++ b/xpp/xpp_zap.c @@ -1137,7 +1137,6 @@ int xpp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long arg) return 0; } -#ifdef WITH_RBS static int xpp_hooksig(struct zt_chan *chan, zt_txsig_t txsig) { xpd_t *xpd = chan->pvt; @@ -1151,24 +1150,6 @@ static int xpp_hooksig(struct zt_chan *chan, zt_txsig_t txsig) return CALL_XMETHOD(card_hooksig, xbus, xpd, pos, txsig); } -#else - -static int xpp_sethook(struct zt_chan *chan, int hookstate) -{ - int pos = chan->chanpos - 1; - xpd_t *xpd = chan->pvt; - xbus_t *xbus; - int ret = 0; - - BUG_ON(!xpd); - xbus = xpd->xbus; - DBG("%s (%d) (old=0x%04X, hook-command=%d)\n", chan->name, pos, xpd->offhook, hookstate); - ret = CALL_XMETHOD(card_sethook, xpd->xbus, xpd, pos, hookstate); - return ret; -} - -#endif - /* Req: Set the requested chunk size. This is the unit in which you must report results for conferencing, etc */ int xpp_setchunksize(struct zt_span *span, int chunksize); @@ -1361,12 +1342,8 @@ static int zaptel_register_xpd(xpd_t *xpd) span->chanconfig = xpp_chanconfig; span->open = xpp_open; span->close = xpp_close; -#ifdef WITH_RBS span->flags = ZT_FLAG_RBS; span->hooksig = xpp_hooksig; /* Only with RBS bits */ -#else - span->sethook = xpp_sethook; -#endif span->ioctl = xpp_ioctl; span->maint = xpp_maint; #ifdef XPP_EC_CHUNK @@ -1424,11 +1401,6 @@ int __init xpp_zap_init(void) INFO("%s revision %s MAX_XPDS=%d\n", THIS_MODULE->name, ZAPTEL_VERSION, MAX_XPDS); -#ifdef WITH_RBS - INFO("FEATURE: %s (RBS signalling)\n", THIS_MODULE->name); -#else - INFO("FEATURE: %s (NO RBS signalling)\n", THIS_MODULE->name); -#endif #if WITH_ECHO_SUPPRESSION INFO("FEATURE: %s (with ECHO_SUPPRESSION)\n", THIS_MODULE->name); #else diff --git a/xpp/xproto.c b/xpp/xproto.c index d6e3e89..ff91c58 100644 --- a/xpp/xproto.c +++ b/xpp/xproto.c @@ -298,11 +298,7 @@ int xproto_register(const xproto_table_t *proto_table) CHECK_XOP(card_tick); CHECK_XOP(card_zaptel_preregistration); CHECK_XOP(card_zaptel_postregistration); -#ifdef WITH_RBS CHECK_XOP(card_hooksig); -#else - CHECK_XOP(card_sethook); -#endif // CHECK_XOP(card_ioctl); // optional method -- call after testing CHECK_XOP(SYNC_SOURCE); CHECK_XOP(PCM_WRITE); diff --git a/xpp/xproto.h b/xpp/xproto.h index 5a1d13d..4c6b924 100644 --- a/xpp/xproto.h +++ b/xpp/xproto.h @@ -151,11 +151,7 @@ struct xops { int (*card_tick)(xbus_t *xbus, xpd_t *xpd); int (*card_zaptel_preregistration)(xpd_t *xpd, bool on); int (*card_zaptel_postregistration)(xpd_t *xpd, bool on); -#ifdef WITH_RBS int (*card_hooksig)(xbus_t *xbus, xpd_t *xpd, int pos, zt_txsig_t txsig); -#else - int (*card_sethook)(xbus_t *xbus, xpd_t *xpd, int pos, int hookstate); -#endif int (*card_ioctl)(xpd_t *xpd, int pos, unsigned int cmd, unsigned long arg); int (*SYNC_SOURCE)(xbus_t *xbus, xpd_t *xpd, bool setit, bool is_master); |