summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1/i4b_hdlc.h
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2000-10-20 11:20:58 +0000
committerhm <hm@FreeBSD.org>2000-10-20 11:20:58 +0000
commit0660ded96619d9701942d2d30e53a7a4f39a4237 (patch)
tree3287f7aa00632f4e130e2b0a476d7043a0f4fe38 /sys/i4b/layer1/i4b_hdlc.h
parenta961cceaf1336a3d72d56b73eeb93d908be68c0c (diff)
downloadFreeBSD-src-0660ded96619d9701942d2d30e53a7a4f39a4237.zip
FreeBSD-src-0660ded96619d9701942d2d30e53a7a4f39a4237.tar.gz
Submitted by: Hans Petter Selasky <hselasky@c2i.net>
Remove double 0x7e flags between hdlc-frames.
Diffstat (limited to 'sys/i4b/layer1/i4b_hdlc.h')
-rw-r--r--sys/i4b/layer1/i4b_hdlc.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/sys/i4b/layer1/i4b_hdlc.h b/sys/i4b/layer1/i4b_hdlc.h
index a34fb03..ebd48c1 100644
--- a/sys/i4b/layer1/i4b_hdlc.h
+++ b/sys/i4b/layer1/i4b_hdlc.h
@@ -33,6 +33,11 @@
*
* last edit-date: [Wed Jul 19 09:41:13 2000]
*
+ * NOTE:
+ * - October 19th: made minor changes to HDLC_ENCODE macro
+ * Please conform "ihfc/i4b_ihfc_drv.c" (ihfc_hdlc_Bwrite)
+ * for correct usage! (-hp)
+ *
*---------------------------------------------------------------------------*/
#ifndef _I4B_HDLC_H_
@@ -309,24 +314,27 @@ const u_short HDLC_BIT_TAB[256] = { 0x0100,
tmp2 = 0x7e; \
goto j3##d; \
case 3: /* get new frame */ \
- flag--; \
gfrcmd; \
- flag++; \
- crc = -1; \
- ib = 0; \
- if (!len--) { len++; flag++; goto j0##d; } \
- goto j1##d; /* first byte */ \
+ if (!len--) \
+ { \
+ len++; \
+ flag--; /* don't proceed */ \
+ tmp2 = 0x7e; \
+ goto j3##d; /* final FS */ \
+ } \
+ else \
+ { \
+ crc = -1; \
+ ib = 0; \
+ goto j1##d; /* first byte */ \
+ } \
case 4: /* CRC (lsb's) */ \
- j0##d: \
crc ^= -1; \
case 5: /* CRC (msb's) */ \
tmp2 = (u_char)crc; \
crc >>= 8; \
+ flag = 1; \
goto j2##d; /* CRC stuff */ \
- case 6: /* frame done */ \
- tmp2 = 0x7e; /* end FS */ \
- flag = 1; \
- goto j3##d; \
} \
} \
else \
OpenPOWER on IntegriCloud