Submitted by: Hans Petter Selasky <hselasky@c2i.net>
Remove double 0x7e flags between hdlc-frames.
This commit is contained in:
parent
8de38d83a3
commit
1c2715d95d
@ -33,6 +33,11 @@
|
|||||||
*
|
*
|
||||||
* last edit-date: [Wed Jul 19 09:41:13 2000]
|
* 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_
|
#ifndef _I4B_HDLC_H_
|
||||||
@ -309,24 +314,27 @@ const u_short HDLC_BIT_TAB[256] = { 0x0100,
|
|||||||
tmp2 = 0x7e; \
|
tmp2 = 0x7e; \
|
||||||
goto j3##d; \
|
goto j3##d; \
|
||||||
case 3: /* get new frame */ \
|
case 3: /* get new frame */ \
|
||||||
flag--; \
|
|
||||||
gfrcmd; \
|
gfrcmd; \
|
||||||
flag++; \
|
if (!len--) \
|
||||||
crc = -1; \
|
{ \
|
||||||
ib = 0; \
|
len++; \
|
||||||
if (!len--) { len++; flag++; goto j0##d; } \
|
flag--; /* don't proceed */ \
|
||||||
goto j1##d; /* first byte */ \
|
tmp2 = 0x7e; \
|
||||||
|
goto j3##d; /* final FS */ \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
crc = -1; \
|
||||||
|
ib = 0; \
|
||||||
|
goto j1##d; /* first byte */ \
|
||||||
|
} \
|
||||||
case 4: /* CRC (lsb's) */ \
|
case 4: /* CRC (lsb's) */ \
|
||||||
j0##d: \
|
|
||||||
crc ^= -1; \
|
crc ^= -1; \
|
||||||
case 5: /* CRC (msb's) */ \
|
case 5: /* CRC (msb's) */ \
|
||||||
tmp2 = (u_char)crc; \
|
tmp2 = (u_char)crc; \
|
||||||
crc >>= 8; \
|
crc >>= 8; \
|
||||||
|
flag = 1; \
|
||||||
goto j2##d; /* CRC stuff */ \
|
goto j2##d; /* CRC stuff */ \
|
||||||
case 6: /* frame done */ \
|
|
||||||
tmp2 = 0x7e; /* end FS */ \
|
|
||||||
flag = 1; \
|
|
||||||
goto j3##d; \
|
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
|
@ -233,8 +233,9 @@ ihfc_control(ihfc_sc_t *sc, int flag)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
S_SCTRL &= ~0x04; /* TE mode */
|
S_SCTRL &= ~0x04; /* TE mode */
|
||||||
|
S_STDEL &= 0x7f; /* use mask! */
|
||||||
S_CLKDEL &= ~0x7f; /* clear delay */
|
S_CLKDEL &= ~0x7f; /* clear delay */
|
||||||
S_CLKDEL |= S_STDEL; /* set delay */
|
S_CLKDEL |= S_STDEL; /* set delay */
|
||||||
}
|
}
|
||||||
if (S_DLP) /* configure D-priority */
|
if (S_DLP) /* configure D-priority */
|
||||||
{
|
{
|
||||||
@ -1419,10 +1420,18 @@ ihfc_hdlc_Bwrite (ihfc_sc_t *sc, u_char chan)
|
|||||||
i4b_Bfreembuf(S_MBUF);
|
i4b_Bfreembuf(S_MBUF);
|
||||||
S_MBUF = ihfc_getmbuf(sc, chan);
|
S_MBUF = ihfc_getmbuf(sc, chan);
|
||||||
|
|
||||||
if (!S_MBUF) goto d0;
|
if (S_MBUF)
|
||||||
|
{
|
||||||
src = S_MBUFDATA;
|
src = S_MBUFDATA;
|
||||||
len = S_MBUFLEN;
|
len = S_MBUFLEN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sendlen = 0; /* Exit after final FS, *
|
||||||
|
* else the buffer will *
|
||||||
|
* only be filled with *
|
||||||
|
* "0x7e"-bytes! */
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{/* wrd */
|
{/* wrd */
|
||||||
|
|
||||||
@ -1437,7 +1446,6 @@ ihfc_hdlc_Bwrite (ihfc_sc_t *sc, u_char chan)
|
|||||||
S_MBUFLEN = len;
|
S_MBUFLEN = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
d0:
|
|
||||||
S_HDLC_IB = ib;
|
S_HDLC_IB = ib;
|
||||||
S_HDLC_BLEVEL = blevel;
|
S_HDLC_BLEVEL = blevel;
|
||||||
S_HDLC_TMP = tmp;
|
S_HDLC_TMP = tmp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user