1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef __ISDNHDLC_H__
17 #define __ISDNHDLC_H__
18
19 struct isdnhdlc_vars {
20 int bit_shift;
21 int hdlc_bits1;
22 int data_bits;
23 int ffbit_shift;
24 int state;
25 int dstpos;
26
27 u16 crc;
28
29 u8 cbin;
30 u8 shift_reg;
31 u8 ffvalue;
32
33
34 u32 data_received:1;
35
36 u32 dchannel:1;
37
38 u32 do_adapt56:1;
39
40 u32 do_closing:1;
41
42 u32 do_bitreverse:1;
43 };
44
45
46 #define HDLC_56KBIT 0x01
47 #define HDLC_DCHANNEL 0x02
48 #define HDLC_BITREVERSE 0x04
49
50
51
52
53
54
55 #define HDLC_FRAMING_ERROR 1
56 #define HDLC_CRC_ERROR 2
57 #define HDLC_LENGTH_ERROR 3
58
59 extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features);
60
61 extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src,
62 int slen, int *count, u8 *dst, int dsize);
63
64 extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features);
65
66 extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src,
67 u16 slen, int *count, u8 *dst, int dsize);
68
69 #endif