[zaptel-commits] tzafrir: trunk r1411 - /trunk/xpp/

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Sep 6 01:24:43 MST 2006


Author: tzafrir
Date: Wed Sep  6 03:24:41 2006
New Revision: 1411

URL: http://svn.digium.com/view/zaptel?rev=1411&view=rev
Log:
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/			 

Modified:
    trunk/xpp/Makefile
    trunk/xpp/card_fxo.c
    trunk/xpp/card_fxs.c
    trunk/xpp/xpd.h
    trunk/xpp/xpp_zap.c
    trunk/xpp/xproto.c
    trunk/xpp/xproto.h

Modified: trunk/xpp/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/xpp/Makefile?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/Makefile (original)
+++ trunk/xpp/Makefile Wed Sep  6 03:24:41 2006
@@ -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

Modified: trunk/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxo.c?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/card_fxo.c (original)
+++ trunk/xpp/card_fxo.c Wed Sep  6 03:24:41 2006
@@ -400,7 +400,6 @@
 	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;
@@ -425,43 +424,6 @@
 	}
 	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)
 {
@@ -792,11 +754,7 @@
 		.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,
 

Modified: trunk/xpp/card_fxs.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxs.c?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/card_fxs.c (original)
+++ trunk/xpp/card_fxs.c Wed Sep  6 03:24:41 2006
@@ -325,17 +325,8 @@
 	/*
 	 * 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 @@
 	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 @@
 	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 @@
 		.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),

Modified: trunk/xpp/xpd.h
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xpd.h?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/xpd.h (original)
+++ trunk/xpp/xpd.h Wed Sep  6 03:24:41 2006
@@ -282,8 +282,6 @@
 	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 @@
 	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
 

Modified: trunk/xpp/xpp_zap.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xpp_zap.c?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/xpp_zap.c (original)
+++ trunk/xpp/xpp_zap.c Wed Sep  6 03:24:41 2006
@@ -1137,7 +1137,6 @@
 	return 0;
 }
 
-#ifdef	WITH_RBS
 static int xpp_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
 {
 	xpd_t	*xpd = chan->pvt;
@@ -1150,24 +1149,6 @@
 	DBG("Setting %s to %s (%d)\n", chan->name, txsig2str(txsig), 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 */
@@ -1361,12 +1342,8 @@
 	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 @@
 
 	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

Modified: trunk/xpp/xproto.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xproto.c?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/xproto.c (original)
+++ trunk/xpp/xproto.c Wed Sep  6 03:24:41 2006
@@ -298,11 +298,7 @@
 	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);

Modified: trunk/xpp/xproto.h
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xproto.h?rev=1411&r1=1410&r2=1411&view=diff
==============================================================================
--- trunk/xpp/xproto.h (original)
+++ trunk/xpp/xproto.h Wed Sep  6 03:24:41 2006
@@ -151,11 +151,7 @@
 	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);



More information about the zaptel-commits mailing list