2 * Driver for ST5481 USB ISDN modem
5 * Copyright 2001 by Frode Isaksen <fisaksen@bewan.com>
6 * 2001 by Kai Germaschewski <kai.germaschewski@gmx.de>
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
13 #ifndef __ST5481_HDLC_H__
14 #define __ST5481_HDLC_H__
20 int ffbit_shift; // encoding only
24 int data_received:1; // set if transferring data
25 int dchannel:1; // set if D channel (send idle instead of flags)
26 int do_adapt56:1; // set if 56K adaptation
27 int do_closing:1; // set if in closing phase (need to send CRC + flag
32 unsigned char shift_reg;
33 unsigned char ffvalue;
39 The return value from hdlc_decode is
40 the frame length, 0 if no complete frame was decoded,
41 or a negative error number
44 #define HDLC_FRAMING_ERROR 1
45 #define HDLC_CRC_ERROR 2
46 #define HDLC_LENGTH_ERROR 3
49 hdlc_rcv_init(struct hdlc_vars *hdlc, int do_adapt56);
52 hdlc_decode(struct hdlc_vars *hdlc, const unsigned char *src, int slen,int *count,
53 unsigned char *dst, int dsize);
56 hdlc_out_init(struct hdlc_vars *hdlc,int is_d_channel,int do_adapt56);
59 hdlc_encode(struct hdlc_vars *hdlc,const unsigned char *src,unsigned short slen,int *count,
60 unsigned char *dst,int dsize);