linux/drivers/isdn/hardware/mISDN/isdnhdlc.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * hdlc.h  --  General purpose ISDN HDLC decoder.
 *
 * Implementation of a HDLC decoder/encoder in software.
 * Necessary because some ISDN devices don't have HDLC
 * controllers.
 *
 * Copyright (C)
 *	2009	Karsten Keil		<[email protected]>
 *	2002	Wolfgang Mües		<[email protected]>
 *	2001	Frode Isaksen		<[email protected]>
 *	2001	Kai Germaschewski	<[email protected]>
 */

#ifndef __ISDNHDLC_H__
#define __ISDNHDLC_H__

struct isdnhdlc_vars {};

/* Feature Flags */
#define HDLC_56KBIT
#define HDLC_DCHANNEL
#define HDLC_BITREVERSE

/*
  The return value from isdnhdlc_decode is
  the frame length, 0 if no complete frame was decoded,
  or a negative error number
*/
#define HDLC_FRAMING_ERROR
#define HDLC_CRC_ERROR
#define HDLC_LENGTH_ERROR

extern void	isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features);

extern int	isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src,
			int slen, int *count, u8 *dst, int dsize);

extern void	isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features);

extern int	isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src,
			u16 slen, int *count, u8 *dst, int dsize);

#endif /* __ISDNHDLC_H__ */