From a5d2fdac0830b70e35828669e22e7145f7162e36 Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 25 Sep 2002 22:10:09 +0000 Subject: Version 0.3.1 from FTP git-svn-id: http://svn.digium.com/svn/zaptel/trunk@110 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- fasthdlc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fasthdlc.h') diff --git a/fasthdlc.h b/fasthdlc.h index e6a149d..adb5597 100755 --- a/fasthdlc.h +++ b/fasthdlc.h @@ -206,6 +206,11 @@ static inline unsigned int hdlc_frame_precalc(unsigned char x, unsigned short c) } c <<= 1; } + /* Consume the extra 0 now rather than later. */ + if (ones == 5) { + ones = 0; + consumed++; + } return HFP(STATUS_VALID, ones, consumed, data); } @@ -441,9 +446,10 @@ static inline int fasthdlc_rx_run(struct fasthdlc_state *h) retval = (RETURN_COMPLETE_FLAG); /* Stay in this state */ h->state = 1; - } else + } else { /* An abort (either out of sync of explicit) */ retval = (RETURN_DISCARD_FLAG); + } break; case STATUS_VALID: retval = (next & DATA_MASK); -- cgit v1.2.3