aboutsummaryrefslogtreecommitdiff
path: root/common/8b10b.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/8b10b.c')
-rw-r--r--common/8b10b.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/8b10b.c b/common/8b10b.c
index fd89e6f..4908e1f 100644
--- a/common/8b10b.c
+++ b/common/8b10b.c
@@ -181,8 +181,10 @@ int xfr_8b10b_feed_bit(struct state_8b10b_dec *st, int bit) {
int p3b = map_4b3b[pattern & 0xf];
int p5b = map_6b5b[pattern >> 4];
- if (p3b == 0 || p5b == 0)
+ if (p3b == 0 || p5b == 0) {
+ st->bit_ctr = 0;
return -DECODING_ERROR;
+ }
p3b = (p3b == -1) ? 0 : p3b;
p5b = (p5b == -1) ? 0 : p5b;
@@ -191,6 +193,7 @@ int xfr_8b10b_feed_bit(struct state_8b10b_dec *st, int bit) {
} else if (st->bit_ctr > 0) {
st->bit_ctr++;
} /* else we do not have sync yet */
+
return -DECODING_IN_PROGRESS;
}