Lines Matching +full:0 +full:x7e
42 memset(hdlc, 0, sizeof(struct isdnhdlc_vars)); in isdnhdlc_rcv_init()
53 memset(hdlc, 0, sizeof(struct isdnhdlc_vars)); in isdnhdlc_out_init()
58 hdlc->dchannel = 0; in isdnhdlc_out_init()
60 hdlc->ffvalue = 0x7e; in isdnhdlc_out_init()
62 hdlc->cbin = 0x7e; in isdnhdlc_out_init()
80 else if (hdlc->crc != 0xf0b8) /* crc error */ in check_frame()
96 the frame is found, the bit stuffing is removed (0 after 5 1's).
121 int status = 0; in isdnhdlc_decode()
124 0x00, 0x00, 0x00, 0x20, 0x30, 0x38, 0x3c, 0x3e, 0x3f in isdnhdlc_decode()
128 0x00, 0x7e, 0xfc, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f in isdnhdlc_decode()
132 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff in isdnhdlc_decode()
144 h->data_received = 0; \ in isdnhdlc_decode()
146 } while (0) in isdnhdlc_decode()
152 if (h->hdlc_bits1 < 0) \ in isdnhdlc_decode()
153 h->hdlc_bits1 = 0; \ in isdnhdlc_decode()
156 h->data_received = 0; \ in isdnhdlc_decode()
157 } while (0) in isdnhdlc_decode()
161 while (slen > 0) { in isdnhdlc_decode()
162 if (hdlc->bit_shift == 0) { in isdnhdlc_decode()
164 if (hdlc->do_bitreverse == 0) in isdnhdlc_decode()
176 return 0; in isdnhdlc_decode()
178 if (hdlc->cbin == 0xff) { in isdnhdlc_decode()
179 hdlc->bit_shift = 0; in isdnhdlc_decode()
183 hdlc->hdlc_bits1 = 0; in isdnhdlc_decode()
187 if (!(hdlc->cbin & 0x80)) { in isdnhdlc_decode()
189 hdlc->hdlc_bits1 = 0; in isdnhdlc_decode()
200 if (hdlc->cbin & 0x80) { in isdnhdlc_decode()
205 hdlc->hdlc_bits1 = 0; in isdnhdlc_decode()
210 if (hdlc->cbin & 0x80) { in isdnhdlc_decode()
214 hdlc->crc = 0xffff; in isdnhdlc_decode()
215 hdlc->shift_reg = 0; in isdnhdlc_decode()
216 hdlc->hdlc_bits1 = 0; in isdnhdlc_decode()
217 hdlc->data_bits = 0; in isdnhdlc_decode()
218 hdlc->data_received = 0; in isdnhdlc_decode()
224 if (hdlc->cbin & 0x80) { in isdnhdlc_decode()
246 hdlc->shift_reg |= 0x80; in isdnhdlc_decode()
257 hdlc->crc = 0xffff; in isdnhdlc_decode()
258 hdlc->shift_reg = 0; in isdnhdlc_decode()
259 hdlc->data_bits = 0; in isdnhdlc_decode()
264 hdlc->data_received = 0; in isdnhdlc_decode()
272 hdlc->hdlc_bits1 = 0; in isdnhdlc_decode()
275 hdlc->dstpos = 0; in isdnhdlc_decode()
282 hdlc->data_bits = 0; in isdnhdlc_decode()
293 hdlc->dstpos = 0; in isdnhdlc_decode()
301 hdlc->bit_shift = 0; in isdnhdlc_decode()
304 if (hdlc->cbin == 0xff) { in isdnhdlc_decode()
306 hdlc->bit_shift = 0; in isdnhdlc_decode()
319 return 0; in isdnhdlc_decode()
327 (0 after 5 1's).
331 If this function is called with empty source buffer (slen=0), flags or
345 0x7e, 0x3f, 0x9f, 0xcf, 0xe7, 0xf3, 0xf9, 0xfc, 0x7e in isdnhdlc_encode()
348 int len = 0; in isdnhdlc_encode()
355 while (dsize > 0) { in isdnhdlc_encode()
356 if (hdlc->bit_shift == 0) { in isdnhdlc_encode()
360 if (slen == 0) in isdnhdlc_encode()
368 hdlc->crc ^= 0xffff; in isdnhdlc_encode()
371 hdlc->crc & 0xff; in isdnhdlc_encode()
386 *dst++ = 0xff; in isdnhdlc_encode()
389 hdlc->do_closing = 0; in isdnhdlc_encode()
390 if (slen == 0) { in isdnhdlc_encode()
392 if (hdlc->do_bitreverse == 0) in isdnhdlc_encode()
406 hdlc->crc = 0xffff; in isdnhdlc_encode()
407 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
412 hdlc->do_closing = 0; in isdnhdlc_encode()
415 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
428 if (slen == 0) { in isdnhdlc_encode()
434 hdlc->crc = 0xffff; in isdnhdlc_encode()
435 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
443 hdlc->crc = 0xffff; in isdnhdlc_encode()
444 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
449 if (hdlc->shift_reg & 0x01) in isdnhdlc_encode()
453 if (hdlc->bit_shift == 0) { in isdnhdlc_encode()
455 hdlc->crc = 0xffff; in isdnhdlc_encode()
456 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
463 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
469 if (hdlc->shift_reg & 0x01) { in isdnhdlc_encode()
475 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
484 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
487 if (hdlc->shift_reg & 0x01) { in isdnhdlc_encode()
493 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
497 if (hdlc->bit_shift == 0) { in isdnhdlc_encode()
507 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
510 if (hdlc->shift_reg & 0x01) { in isdnhdlc_encode()
516 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
520 if (hdlc->bit_shift == 0) { in isdnhdlc_encode()
521 hdlc->shift_reg = 0x7e; in isdnhdlc_encode()
530 hdlc->hdlc_bits1 = 0; in isdnhdlc_encode()
533 if (hdlc->shift_reg & 0x01) in isdnhdlc_encode()
537 if (hdlc->bit_shift == 0) { in isdnhdlc_encode()
541 hdlc->ffvalue = 0x7e; in isdnhdlc_encode()
544 if (hdlc->bit_shift == 0) in isdnhdlc_encode()
551 hdlc->data_received = 0; in isdnhdlc_encode()
554 hdlc->data_received = 0; in isdnhdlc_encode()
563 hdlc->do_closing = 0; in isdnhdlc_encode()
568 if (hdlc->bit_shift == 0) { in isdnhdlc_encode()
570 hdlc->bit_shift = 0; in isdnhdlc_encode()
574 hdlc->do_closing = 0; in isdnhdlc_encode()
575 hdlc->cbin = 0xff; in isdnhdlc_encode()
578 hdlc->cbin = 0x7e; in isdnhdlc_encode()
582 if (hdlc->do_bitreverse == 0) in isdnhdlc_encode()
586 hdlc->bit_shift = 0; in isdnhdlc_encode()
587 hdlc->data_bits = 0; in isdnhdlc_encode()
589 dsize = 0; in isdnhdlc_encode()
604 if (hdlc->do_bitreverse == 0) in isdnhdlc_encode()
608 hdlc->data_bits = 0; in isdnhdlc_encode()