25 #include <linux/module.h>
93 else if (hdlc->
crc != 0xf0b8)
136 static const unsigned char fast_flag[] = {
137 0x00, 0x00, 0x00, 0x20, 0x30, 0x38, 0x3c, 0x3e, 0x3f
140 static const unsigned char fast_flag_value[] = {
141 0x00, 0x7e, 0xfc, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f
144 static const unsigned char fast_abort[] = {
145 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff
148 #define handle_fast_flag(h) \
150 if (h->cbin == fast_flag[h->bit_shift]) { \
151 h->ffvalue = fast_flag_value[h->bit_shift]; \
152 h->state = HDLC_FAST_FLAG; \
153 h->ffbit_shift = h->bit_shift; \
156 h->state = HDLC_GET_DATA; \
157 h->data_received = 0; \
161 #define handle_abort(h) \
163 h->shift_reg = fast_abort[h->ffbit_shift - 1]; \
164 h->hdlc_bits1 = h->ffbit_shift - 2; \
165 if (h->hdlc_bits1 < 0) \
167 h->data_bits = h->ffbit_shift - 1; \
168 h->state = HDLC_GET_DATA; \
169 h->data_received = 0; \
178 hdlc->
cbin = bitrev8(*src++);
187 switch (hdlc->
state) {
191 if (hdlc->
cbin == 0xff) {
200 if (!(hdlc->
cbin & 0x80)) {
213 if (hdlc->
cbin & 0x80) {
223 if (hdlc->
cbin & 0x80) {
237 if (hdlc->
cbin & 0x80) {
247 if (hdlc->
cbin == fast_abort
269 status = check_frame(hdlc);
297 hdlc->
crc = crc_ccitt_byte(hdlc->
crc,
317 if (hdlc->
cbin == 0xff) {
357 static const unsigned char xfast_flag_value[] = {
358 0x7e, 0x3f, 0x9f, 0xcf, 0xe7, 0xf3, 0xf9, 0xfc, 0x7e
396 switch (hdlc->
state) {
406 *dst++ = bitrev8(hdlc->
ffvalue);
480 hdlc->
crc = crc_ccitt_byte(hdlc->
crc,
596 *dst++ = bitrev8(hdlc->
cbin);
618 *dst++ = bitrev8(hdlc->
cbin);