diff options
author | Karsten Keil <keil@b1-systems.de> | 2009-07-08 08:21:12 -0400 |
---|---|---|
committer | Karsten Keil <keil@b1-systems.de> | 2009-07-25 14:15:21 -0400 |
commit | cb3824bade2549d7ad059d5802da43312540fdee (patch) | |
tree | 0ffcce666a8d3534f48ffa162defecf7e781c8ba /drivers | |
parent | 74d154189d597b91da4322996dbf4f5c3d1544ab (diff) |
ISDN: Make isdnhdlc usable for other ISDN drivers
isdnhdlc is useful for other ISDN drivers as well.
Move the include file to a central location and the source
to the central isdn location.
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/isdn/Kconfig | 6 | ||||
-rw-r--r-- | drivers/isdn/hisax/Kconfig | 6 | ||||
-rw-r--r-- | drivers/isdn/hisax/Makefile | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/isdnhdlc.h | 70 | ||||
-rw-r--r-- | drivers/isdn/hisax/st5481.h | 2 | ||||
-rw-r--r-- | drivers/isdn/i4l/Kconfig | 11 | ||||
-rw-r--r-- | drivers/isdn/i4l/Makefile | 1 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdnhdlc.c (renamed from drivers/isdn/hisax/isdnhdlc.c) | 2 |
8 files changed, 17 insertions, 85 deletions
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig index 02bdca6f95c3..022a19452953 100644 --- a/drivers/isdn/Kconfig +++ b/drivers/isdn/Kconfig | |||
@@ -21,8 +21,6 @@ menuconfig ISDN | |||
21 | 21 | ||
22 | if ISDN | 22 | if ISDN |
23 | 23 | ||
24 | source "drivers/isdn/mISDN/Kconfig" | ||
25 | |||
26 | menuconfig ISDN_I4L | 24 | menuconfig ISDN_I4L |
27 | tristate "Old ISDN4Linux (deprecated)" | 25 | tristate "Old ISDN4Linux (deprecated)" |
28 | ---help--- | 26 | ---help--- |
@@ -41,9 +39,9 @@ menuconfig ISDN_I4L | |||
41 | It is still available, though, for use with adapters that are not | 39 | It is still available, though, for use with adapters that are not |
42 | supported by the new CAPI subsystem yet. | 40 | supported by the new CAPI subsystem yet. |
43 | 41 | ||
44 | if ISDN_I4L | 42 | source "drivers/isdn/mISDN/Kconfig" |
43 | |||
45 | source "drivers/isdn/i4l/Kconfig" | 44 | source "drivers/isdn/i4l/Kconfig" |
46 | endif | ||
47 | 45 | ||
48 | menuconfig ISDN_CAPI | 46 | menuconfig ISDN_CAPI |
49 | tristate "CAPI 2.0 subsystem" | 47 | tristate "CAPI 2.0 subsystem" |
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig index 7832d8ba8e44..3464ebc4cdbc 100644 --- a/drivers/isdn/hisax/Kconfig +++ b/drivers/isdn/hisax/Kconfig | |||
@@ -391,6 +391,7 @@ comment "HiSax sub driver modules" | |||
391 | config HISAX_ST5481 | 391 | config HISAX_ST5481 |
392 | tristate "ST5481 USB ISDN modem (EXPERIMENTAL)" | 392 | tristate "ST5481 USB ISDN modem (EXPERIMENTAL)" |
393 | depends on USB && EXPERIMENTAL | 393 | depends on USB && EXPERIMENTAL |
394 | select ISDN_HDLC | ||
394 | select CRC_CCITT | 395 | select CRC_CCITT |
395 | select BITREVERSE | 396 | select BITREVERSE |
396 | help | 397 | help |
@@ -418,11 +419,6 @@ config HISAX_FRITZ_PCIPNP | |||
418 | (the latter also needs you to select "ISA Plug and Play support" | 419 | (the latter also needs you to select "ISA Plug and Play support" |
419 | from the menu "Plug and Play configuration") | 420 | from the menu "Plug and Play configuration") |
420 | 421 | ||
421 | config HISAX_HDLC | ||
422 | bool | ||
423 | depends on HISAX_ST5481 | ||
424 | default y | ||
425 | |||
426 | config HISAX_AVM_A1_PCMCIA | 422 | config HISAX_AVM_A1_PCMCIA |
427 | bool | 423 | bool |
428 | depends on HISAX_AVM_A1_CS | 424 | depends on HISAX_AVM_A1_CS |
diff --git a/drivers/isdn/hisax/Makefile b/drivers/isdn/hisax/Makefile index c7a3794bdae4..ab638b083df9 100644 --- a/drivers/isdn/hisax/Makefile +++ b/drivers/isdn/hisax/Makefile | |||
@@ -16,10 +16,6 @@ obj-$(CONFIG_HISAX_HFCUSB) += hfc_usb.o | |||
16 | obj-$(CONFIG_HISAX_HFC4S8S) += hfc4s8s_l1.o | 16 | obj-$(CONFIG_HISAX_HFC4S8S) += hfc4s8s_l1.o |
17 | obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o | 17 | obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o |
18 | 18 | ||
19 | ifdef CONFIG_HISAX_HDLC | ||
20 | obj-$(CONFIG_ISDN_DRV_HISAX) += isdnhdlc.o | ||
21 | endif | ||
22 | |||
23 | # Multipart objects. | 19 | # Multipart objects. |
24 | 20 | ||
25 | hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \ | 21 | hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \ |
diff --git a/drivers/isdn/hisax/isdnhdlc.h b/drivers/isdn/hisax/isdnhdlc.h deleted file mode 100644 index cf0a95a24015..000000000000 --- a/drivers/isdn/hisax/isdnhdlc.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * isdnhdlc.h -- General purpose ISDN HDLC decoder. | ||
3 | * | ||
4 | * Implementation of a HDLC decoder/encoder in software. | ||
5 | * Neccessary because some ISDN devices don't have HDLC | ||
6 | * controllers. Also included: a bit reversal table. | ||
7 | * | ||
8 | *Copyright (C) 2002 Wolfgang Mües <wolfgang@iksw-muees.de> | ||
9 | * 2001 Frode Isaksen <fisaksen@bewan.com> | ||
10 | * 2001 Kai Germaschewski <kai.germaschewski@gmx.de> | ||
11 | * | ||
12 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * 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 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | */ | ||
26 | |||
27 | #ifndef __ISDNHDLC_H__ | ||
28 | #define __ISDNHDLC_H__ | ||
29 | |||
30 | struct isdnhdlc_vars { | ||
31 | int bit_shift; | ||
32 | int hdlc_bits1; | ||
33 | int data_bits; | ||
34 | int ffbit_shift; // encoding only | ||
35 | int state; | ||
36 | int dstpos; | ||
37 | |||
38 | unsigned short crc; | ||
39 | |||
40 | unsigned char cbin; | ||
41 | unsigned char shift_reg; | ||
42 | unsigned char ffvalue; | ||
43 | |||
44 | unsigned int data_received:1; // set if transferring data | ||
45 | unsigned int dchannel:1; // set if D channel (send idle instead of flags) | ||
46 | unsigned int do_adapt56:1; // set if 56K adaptation | ||
47 | unsigned int do_closing:1; // set if in closing phase (need to send CRC + flag | ||
48 | }; | ||
49 | |||
50 | |||
51 | /* | ||
52 | The return value from isdnhdlc_decode is | ||
53 | the frame length, 0 if no complete frame was decoded, | ||
54 | or a negative error number | ||
55 | */ | ||
56 | #define HDLC_FRAMING_ERROR 1 | ||
57 | #define HDLC_CRC_ERROR 2 | ||
58 | #define HDLC_LENGTH_ERROR 3 | ||
59 | |||
60 | extern void isdnhdlc_rcv_init (struct isdnhdlc_vars *hdlc, int do_adapt56); | ||
61 | |||
62 | extern int isdnhdlc_decode (struct isdnhdlc_vars *hdlc, const unsigned char *src, int slen,int *count, | ||
63 | unsigned char *dst, int dsize); | ||
64 | |||
65 | extern void isdnhdlc_out_init (struct isdnhdlc_vars *hdlc,int is_d_channel,int do_adapt56); | ||
66 | |||
67 | extern int isdnhdlc_encode (struct isdnhdlc_vars *hdlc,const unsigned char *src,unsigned short slen,int *count, | ||
68 | unsigned char *dst,int dsize); | ||
69 | |||
70 | #endif /* __ISDNHDLC_H__ */ | ||
diff --git a/drivers/isdn/hisax/st5481.h b/drivers/isdn/hisax/st5481.h index cff7a6354334..64f78a8c28c5 100644 --- a/drivers/isdn/hisax/st5481.h +++ b/drivers/isdn/hisax/st5481.h | |||
@@ -226,7 +226,7 @@ printk(KERN_WARNING "%s:%s: " format "\n" , __FILE__, __func__ , ## arg) | |||
226 | #define INFO(format, arg...) \ | 226 | #define INFO(format, arg...) \ |
227 | printk(KERN_INFO "%s:%s: " format "\n" , __FILE__, __func__ , ## arg) | 227 | printk(KERN_INFO "%s:%s: " format "\n" , __FILE__, __func__ , ## arg) |
228 | 228 | ||
229 | #include "isdnhdlc.h" | 229 | #include <linux/isdn/hdlc.h> |
230 | #include "fsm.h" | 230 | #include "fsm.h" |
231 | #include "hisax_if.h" | 231 | #include "hisax_if.h" |
232 | #include <linux/skbuff.h> | 232 | #include <linux/skbuff.h> |
diff --git a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig index ed3510f273d8..dd744ffd240b 100644 --- a/drivers/isdn/i4l/Kconfig +++ b/drivers/isdn/i4l/Kconfig | |||
@@ -2,6 +2,8 @@ | |||
2 | # Old ISDN4Linux config | 2 | # Old ISDN4Linux config |
3 | # | 3 | # |
4 | 4 | ||
5 | if ISDN_I4L | ||
6 | |||
5 | config ISDN_PPP | 7 | config ISDN_PPP |
6 | bool "Support synchronous PPP" | 8 | bool "Support synchronous PPP" |
7 | depends on INET | 9 | depends on INET |
@@ -135,3 +137,12 @@ source "drivers/isdn/act2000/Kconfig" | |||
135 | source "drivers/isdn/hysdn/Kconfig" | 137 | source "drivers/isdn/hysdn/Kconfig" |
136 | 138 | ||
137 | endmenu | 139 | endmenu |
140 | # end ISDN_I4L | ||
141 | endif | ||
142 | |||
143 | config ISDN_HDLC | ||
144 | tristate | ||
145 | depends on HISAX_ST5481 | ||
146 | select CRC_CCITT | ||
147 | select BITREVERSE | ||
148 | |||
diff --git a/drivers/isdn/i4l/Makefile b/drivers/isdn/i4l/Makefile index 49a06c0005dd..cb9d3bb9fae0 100644 --- a/drivers/isdn/i4l/Makefile +++ b/drivers/isdn/i4l/Makefile | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_ISDN_I4L) += isdn.o | 5 | obj-$(CONFIG_ISDN_I4L) += isdn.o |
6 | obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o | 6 | obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_bsdcomp.o |
7 | obj-$(CONFIG_ISDN_HDLC) += isdnhdlc.o | ||
7 | 8 | ||
8 | # Multipart objects. | 9 | # Multipart objects. |
9 | 10 | ||
diff --git a/drivers/isdn/hisax/isdnhdlc.c b/drivers/isdn/i4l/isdnhdlc.c index c69a77a80062..44ec7418496b 100644 --- a/drivers/isdn/hisax/isdnhdlc.c +++ b/drivers/isdn/i4l/isdnhdlc.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/crc-ccitt.h> | 25 | #include <linux/crc-ccitt.h> |
26 | #include "isdnhdlc.h" | 26 | #include <linux/isdn/hdlc.h> |
27 | 27 | ||
28 | /*-------------------------------------------------------------------*/ | 28 | /*-------------------------------------------------------------------*/ |
29 | 29 | ||