## bristuff_astribank_bri.diff by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
##
## A temporary adaptation for HDLC in the Xorcom Astribank BRI.
## May break some PRI cards.
## 
## Note: for versions of zaptel before 1.2.13, replace zaptel-base.c with 
## zaptel.c

@DPATCH@
diff -urNad zaptel-1.2.14.xpp.r3517.sarge/zaptel-base.c /tmp/dpep.gsFTUx/zaptel-1.2.14.xpp.r3517.sarge/zaptel-base.c
--- zaptel-1.2.14.xpp.r3517.sarge/zaptel-base.c	2007-03-22 15:21:21.797681802 +0200
+++ /tmp/dpep.gsFTUx/zaptel-1.2.14.xpp.r3517.sarge/zaptel-base.c	2007-03-22 15:23:24.071535501 +0200
@@ -59,6 +59,8 @@
 #include <linux/if_ppp.h>
 #endif
 
+#define	NO_HDLC_CODE	0
+
 #ifndef CONFIG_OLD_HDLC_API
 #define NEW_HDLC_INTERFACE
 #endif
@@ -5062,7 +5064,7 @@
 			left = ms->writen[ms->outwritebuf] - ms->writeidx[ms->outwritebuf];
 			if (left > bytes)
 				left = bytes;
-			if (ms->flags & ZT_FLAG_HDLC) {
+			if (NO_HDLC_CODE && ms->flags & ZT_FLAG_HDLC) {
 				/* If this is an HDLC channel we only send a byte of
 				   HDLC. */
 				for(x=0;x<left;x++) {
@@ -5987,7 +5989,7 @@
 			left = ms->blocksize - ms->readidx[ms->inreadbuf];
 			if (left > bytes)
 				left = bytes;
-			if (ms->flags & ZT_FLAG_HDLC) {
+			if (NO_HDLC_CODE && ms->flags & ZT_FLAG_HDLC) {
 				for (x=0;x<left;x++) {
 					/* Handle HDLC deframing */
 					fasthdlc_rx_load_nocheck(&ms->rxhdlc, *(rxb++));
