aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/i4l/isdnhdlc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/isdn/i4l/isdnhdlc.c b/drivers/isdn/i4l/isdnhdlc.c
index df345ce73f4..c989aa35dc2 100644
--- a/drivers/isdn/i4l/isdnhdlc.c
+++ b/drivers/isdn/i4l/isdnhdlc.c
@@ -47,7 +47,7 @@ enum {
47 HDLC_SEND_DATA, HDLC_SEND_CRC1, HDLC_SEND_FAST_FLAG, 47 HDLC_SEND_DATA, HDLC_SEND_CRC1, HDLC_SEND_FAST_FLAG,
48 HDLC_SEND_FIRST_FLAG, HDLC_SEND_CRC2, HDLC_SEND_CLOSING_FLAG, 48 HDLC_SEND_FIRST_FLAG, HDLC_SEND_CRC2, HDLC_SEND_CLOSING_FLAG,
49 HDLC_SEND_IDLE1, HDLC_SEND_FAST_IDLE, HDLC_SENDFLAG_B0, 49 HDLC_SEND_IDLE1, HDLC_SEND_FAST_IDLE, HDLC_SENDFLAG_B0,
50 HDLC_SENDFLAG_B1A6, HDLC_SENDFLAG_B7, STOPPED 50 HDLC_SENDFLAG_B1A6, HDLC_SENDFLAG_B7, STOPPED, HDLC_SENDFLAG_ONE
51}; 51};
52 52
53void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features) 53void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features)
@@ -362,6 +362,9 @@ int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src, u16 slen,
362 362
363 *count = slen; 363 *count = slen;
364 364
365 /* special handling for one byte frames */
366 if ((slen == 1) && (hdlc->state == HDLC_SEND_FAST_FLAG))
367 hdlc->state = HDLC_SENDFLAG_ONE;
365 while (dsize > 0) { 368 while (dsize > 0) {
366 if (hdlc->bit_shift == 0) { 369 if (hdlc->bit_shift == 0) {
367 if (slen && !hdlc->do_closing) { 370 if (slen && !hdlc->do_closing) {
@@ -407,6 +410,8 @@ int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src, u16 slen,
407 dsize--; 410 dsize--;
408 break; 411 break;
409 } 412 }
413 /* fall through */
414 case HDLC_SENDFLAG_ONE:
410 if (hdlc->bit_shift == 8) { 415 if (hdlc->bit_shift == 8) {
411 hdlc->cbin = hdlc->ffvalue >> 416 hdlc->cbin = hdlc->ffvalue >>
412 (8 - hdlc->data_bits); 417 (8 - hdlc->data_bits);