diff options
-rwxr-xr-x | fasthdlc.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); |