[Pkg-voip-commits] r5668 - in /zaptel/trunk/debian: changelog patches/series patches/xpp_fix_t1

tzafrir-guest at alioth.debian.org tzafrir-guest at alioth.debian.org
Sun May 4 19:24:11 UTC 2008


Author: tzafrir-guest
Date: Sun May  4 19:24:11 2008
New Revision: 5668

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=5668
Log:
* Patch xpp_fix_t1: allow the xpp pri module to initialize as T1.

Added:
    zaptel/trunk/debian/patches/xpp_fix_t1
Modified:
    zaptel/trunk/debian/changelog
    zaptel/trunk/debian/patches/series

Modified: zaptel/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/zaptel/trunk/debian/changelog?rev=5668&op=diff
==============================================================================
--- zaptel/trunk/debian/changelog (original)
+++ zaptel/trunk/debian/changelog Sun May  4 19:24:11 2008
@@ -7,6 +7,7 @@
   * Note the buid "error" from http://bugs.digium.com/12426 .
   * Fix the generation of tonezone.txt.
   * Patch zaptel_config_nodie: A bit of perl that fell off in the merges.
+  * Patch xpp_fix_t1: allow the xpp pri module to initialize as T1.
 
  -- Tzafrir Cohen <tzafrir.cohen at xorcom.com>  Tue, 22 Apr 2008 10:10:49 +0300
 

Modified: zaptel/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/zaptel/trunk/debian/patches/series?rev=5668&op=diff
==============================================================================
--- zaptel/trunk/debian/patches/series (original)
+++ zaptel/trunk/debian/patches/series Sun May  4 19:24:11 2008
@@ -7,3 +7,4 @@
 zaphfc-florz
 zaptel_perl
 zaptel_config_nodie
+xpp_fix_t1

Added: zaptel/trunk/debian/patches/xpp_fix_t1
URL: http://svn.debian.org/wsvn/pkg-voip/zaptel/trunk/debian/patches/xpp_fix_t1?rev=5668&op=file
==============================================================================
--- zaptel/trunk/debian/patches/xpp_fix_t1 (added)
+++ zaptel/trunk/debian/patches/xpp_fix_t1 Sun May  4 19:24:11 2008
@@ -1,0 +1,107 @@
+* Do allow configuring an xpp PRI module as T1.
+* A less strict check for availability of layer 1 on PRI (mostly affect
+  T1).
+
+Source: http://svn.digium.com/view/zaptel?view=rev&revision=4235
+
+--- zaptel-1.4.10~dfsg.orig/kernel/xpp/card_pri.c
++++ zaptel-1.4.10~dfsg/kernel/xpp/card_pri.c
+@@ -66,6 +66,7 @@ static int proc_xpd_register_read(char *
+ static int proc_xpd_register_write(struct file *file, const char __user *buffer, unsigned long count, void *data);
+ static int pri_startup(struct zt_span *span);
+ static int pri_shutdown(struct zt_span *span);
++static int pri_lineconfig(xpd_t *xpd, int lineconfig);
+ 
+ #define	PROC_REGISTER_FNAME	"slics"
+ #define	PROC_PRI_INFO_FNAME	"pri_info"
+@@ -174,8 +174,9 @@
+ };
+ 
+ #define	REG_FRS0	0x4C	/* Framer Receive Status Register 0 */
++#define	REG_FRS0_T1_FSR	BIT(0)	/* T1 - Frame Search Restart Flag */
+ #define	REG_FRS0_LMFA	BIT(1)	/* Loss of Multiframe Alignment */
+-#define	REG_FRS0_NMF	BIT(2)	/* No Multiframe Alignment Found */
++#define	REG_FRS0_E1_NMF	BIT(2)	/* E1 - No Multiframe Alignment Found */
+ #define	REG_FRS0_RRA	BIT(4)	/* Receive Remote Alarm: T1-YELLOW-Alarm */
+ #define	REG_FRS0_LFA	BIT(5)	/* Loss of Frame Alignment */
+ #define	REG_FRS0_AIS	BIT(6)	/* Alarm Indication Signal: T1-BLUE-Alarm */
+@@ -400,7 +401,9 @@ static int set_pri_proto(xpd_t *xpd, enu
+ 					REG_FMR1_AFR |
+ 					REG_FMR1_XFS |
+ 					REG_FMR1_ECM;
++	int			default_lineconfig = 0;
+ 	byte			rc0 = 0;	/* FIXME: PCM offsets */
++	int			ret;
+ 
+ 	BUG_ON(!xpd);
+ 	priv = xpd->priv;
+@@ -413,10 +416,12 @@ static int set_pri_proto(xpd_t *xpd, enu
+ 		case PRI_PROTO_E1:
+ 			deflaw = ZT_LAW_ALAW;
+ 			dchan_num = 16;
++			default_lineconfig = ZT_CONFIG_CRC4 | ZT_CONFIG_HDB3;
+ 			break;
+ 		case PRI_PROTO_T1:
+ 			deflaw = ZT_LAW_MULAW;
+ 			dchan_num = 24;
++			default_lineconfig = ZT_CONFIG_ESF | ZT_CONFIG_B8ZS;
+ 			fmr1 |= REG_FMR1_PMOD;
+ 			break;
+ 		case PRI_PROTO_J1:
+@@ -427,6 +432,7 @@ static int set_pri_proto(xpd_t *xpd, enu
+ 			dchan_num = 24;
+ 			fmr1 |= REG_FMR1_PMOD;
+ 			rc0 |= REG_RC0_SJR;
++			default_lineconfig = 0;	/* FIXME: J1??? */
+ 			XPD_NOTICE(xpd, "J1 is not supported yet\n");
+ 			return -ENOSYS;
+ 		default:
+@@ -452,6 +458,15 @@ static int set_pri_proto(xpd_t *xpd, enu
+ 	if(rc0)
+ 		write_subunit(xpd, REG_RC0, rc0);
+ #endif
++	/*
++	 * Must set default now, so layer1 polling (Register REG_FRS0) would
++	 * give reliable results.
++	 */
++	ret = pri_lineconfig(xpd, default_lineconfig);
++	if(ret) {
++		XPD_NOTICE(xpd, "Failed setting PRI default line config\n");
++		return ret;
++	}
+ 	return 0;
+ }
+ 
+@@ -854,15 +869,6 @@ static int PRI_card_init(xbus_t *xbus, x
+ 		XPD_NOTICE(xpd, "PRI protocol not set\n");
+ 		goto err;
+ 	}
+-	/*
+-	 * Must set default now, so layer1 polling (Register REG_FRS0) would
+-	 * give reliable results.
+-	 */
+-	ret = pri_lineconfig(xpd, ZT_CONFIG_CCS | ZT_CONFIG_CRC4 | ZT_CONFIG_HDB3);
+-	if(ret) {
+-		XPD_NOTICE(xpd, "Failed setting PRI default line config\n");
+-		goto err;
+-	}
+ 	XPD_DBG(GENERAL, xpd, "done\n");
+ 	for(ret = 0; ret < NUM_LEDS; ret++) {
+ 		DO_LED(xpd, ret, PRI_LED_ON);
+@@ -1347,12 +1348,15 @@
+ 	if(data_low & REG_FRS0_RRA)
+ 		alarms |= ZT_ALARM_YELLOW;
+ 	priv->layer1_up = alarms == 0;
++#if 0
+ 	/*
+ 	 * Some bad bits (e.g: LMFA and NMF have no alarm "colors"
+ 	 * associated. However, layer1 is still not working if they are set.
++	 * FIXME: These behave differently in E1/T1, so ignore them for while.
+ 	 */
+-	if(data_low & (REG_FRS0_LMFA | REG_FRS0_NMF))
++	if(data_low & (REG_FRS0_LMFA | REG_FRS0_E1_NMF))
+ 		priv->layer1_up = 0;
++#endif
+ 	priv->alarms = alarms;
+ 	if(!priv->layer1_up)
+ 		dchan_state(xpd, 0);




More information about the Pkg-voip-commits mailing list