summaryrefslogtreecommitdiff
path: root/fasthdlc.h
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-09-25 22:10:09 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-09-25 22:10:09 +0000
commita5d2fdac0830b70e35828669e22e7145f7162e36 (patch)
tree32a169538e427239a862caa124316cd68cd9eca9 /fasthdlc.h
parentd5bfe835fa4aa0af3e3d9cab7690f4a6ca34483f (diff)
Version 0.3.1 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@110 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'fasthdlc.h')
-rwxr-xr-xfasthdlc.h8
1 files changed, 7 insertions, 1 deletions
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);