aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/isdn
diff options
context:
space:
mode:
authorKarsten Keil <keil@b1-systems.de>2009-07-08 13:11:09 -0400
committerKarsten Keil <keil@b1-systems.de>2009-07-25 14:15:54 -0400
commit6bd4bcd3cd8affc09eaee7efbc037f65f4a71501 (patch)
treea4472ca7194d1579b36d8398d6ba2c6022c4081a /include/linux/isdn
parentcb3824bade2549d7ad059d5802da43312540fdee (diff)
ISDN: Clean up isdnhdlc code
Clean up isdnhdlc to meet current code standard. Remove hint to already removed bit reversal table. Signed-off-by: Karsten Keil <keil@b1-systems.de>
Diffstat (limited to 'include/linux/isdn')
-rw-r--r--include/linux/isdn/hdlc.h68
1 files changed, 37 insertions, 31 deletions
diff --git a/include/linux/isdn/hdlc.h b/include/linux/isdn/hdlc.h
index cf0a95a24015..8f3540c7f692 100644
--- a/include/linux/isdn/hdlc.h
+++ b/include/linux/isdn/hdlc.h
@@ -1,27 +1,28 @@
1/* 1/*
2 * isdnhdlc.h -- General purpose ISDN HDLC decoder. 2 * hdlc.h -- General purpose ISDN HDLC decoder.
3 * 3 *
4 * Implementation of a HDLC decoder/encoder in software. 4 * Implementation of a HDLC decoder/encoder in software.
5 * Neccessary because some ISDN devices don't have HDLC 5 * Neccessary because some ISDN devices don't have HDLC
6 * controllers. Also included: a bit reversal table. 6 * controllers.
7 * 7 *
8 *Copyright (C) 2002 Wolfgang Mües <wolfgang@iksw-muees.de> 8 * Copyright (C)
9 * 2001 Frode Isaksen <fisaksen@bewan.com> 9 * 2002 Wolfgang Mües <wolfgang@iksw-muees.de>
10 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de> 10 * 2001 Frode Isaksen <fisaksen@bewan.com>
11 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de>
11 * 12 *
12 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 14 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or 15 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version. 16 * (at your option) any later version.
16 * 17 *
17 * This program is distributed in the hope that it will be useful, 18 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details. 21 * GNU General Public License for more details.
21 * 22 *
22 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software 24 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */ 26 */
26 27
27#ifndef __ISDNHDLC_H__ 28#ifndef __ISDNHDLC_H__
@@ -31,20 +32,24 @@ struct isdnhdlc_vars {
31 int bit_shift; 32 int bit_shift;
32 int hdlc_bits1; 33 int hdlc_bits1;
33 int data_bits; 34 int data_bits;
34 int ffbit_shift; // encoding only 35 int ffbit_shift; /* encoding only */
35 int state; 36 int state;
36 int dstpos; 37 int dstpos;
37 38
38 unsigned short crc; 39 u16 crc;
39 40
40 unsigned char cbin; 41 u8 cbin;
41 unsigned char shift_reg; 42 u8 shift_reg;
42 unsigned char ffvalue; 43 u8 ffvalue;
43 44
44 unsigned int data_received:1; // set if transferring data 45 /* set if transferring data */
45 unsigned int dchannel:1; // set if D channel (send idle instead of flags) 46 u32 data_received:1;
46 unsigned int do_adapt56:1; // set if 56K adaptation 47 /* set if D channel (send idle instead of flags) */
47 unsigned int do_closing:1; // set if in closing phase (need to send CRC + flag 48 u32 dchannel:1;
49 /* set if 56K adaptation */
50 u32 do_adapt56:1;
51 /* set if in closing phase (need to send CRC + flag) */
52 u32 do_closing:1;
48}; 53};
49 54
50 55
@@ -57,14 +62,15 @@ struct isdnhdlc_vars {
57#define HDLC_CRC_ERROR 2 62#define HDLC_CRC_ERROR 2
58#define HDLC_LENGTH_ERROR 3 63#define HDLC_LENGTH_ERROR 3
59 64
60extern void isdnhdlc_rcv_init (struct isdnhdlc_vars *hdlc, int do_adapt56); 65extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, int do_adapt56);
61 66
62extern int isdnhdlc_decode (struct isdnhdlc_vars *hdlc, const unsigned char *src, int slen,int *count, 67extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src,
63 unsigned char *dst, int dsize); 68 int slen, int *count, u8 *dst, int dsize);
64 69
65extern void isdnhdlc_out_init (struct isdnhdlc_vars *hdlc,int is_d_channel,int do_adapt56); 70extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, int is_d_channel,
71 int do_adapt56);
66 72
67extern int isdnhdlc_encode (struct isdnhdlc_vars *hdlc,const unsigned char *src,unsigned short slen,int *count, 73extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src,
68 unsigned char *dst,int dsize); 74 u16 slen, int *count, u8 *dst, int dsize);
69 75
70#endif /* __ISDNHDLC_H__ */ 76#endif /* __ISDNHDLC_H__ */