Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / drivers / isdn / mISDN / core.h
1 /*
2  * Copyright 2008  by Karsten Keil <kkeil@novell.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  */
14
15 #ifndef mISDN_CORE_H
16 #define mISDN_CORE_H
17
18 extern struct mISDNdevice       *get_mdevice(u_int);
19 extern int                      get_mdevice_count(void);
20 extern u_int misdn_permitted_gid;
21
22 /* stack status flag */
23 #define mISDN_STACK_ACTION_MASK         0x0000ffff
24 #define mISDN_STACK_COMMAND_MASK        0x000f0000
25 #define mISDN_STACK_STATUS_MASK         0xfff00000
26 /* action bits 0-15 */
27 #define mISDN_STACK_WORK        0
28 #define mISDN_STACK_SETUP       1
29 #define mISDN_STACK_CLEARING    2
30 #define mISDN_STACK_RESTART     3
31 #define mISDN_STACK_WAKEUP      4
32 #define mISDN_STACK_ABORT       15
33 /* command bits 16-19 */
34 #define mISDN_STACK_STOPPED     16
35 #define mISDN_STACK_INIT        17
36 #define mISDN_STACK_THREADSTART 18
37 /* status bits 20-31 */
38 #define mISDN_STACK_BCHANNEL    20
39 #define mISDN_STACK_ACTIVE      29
40 #define mISDN_STACK_RUNNING     30
41 #define mISDN_STACK_KILLED      31
42
43
44 /* manager options */
45 #define MGR_OPT_USER            24
46 #define MGR_OPT_NETWORK         25
47
48 extern int      connect_Bstack(struct mISDNdevice *, struct mISDNchannel *,
49                                u_int, struct sockaddr_mISDN *);
50 extern int      connect_layer1(struct mISDNdevice *, struct mISDNchannel *,
51                                u_int, struct sockaddr_mISDN *);
52 extern int      create_l2entity(struct mISDNdevice *, struct mISDNchannel *,
53                                 u_int, struct sockaddr_mISDN *);
54
55 extern int      create_stack(struct mISDNdevice *);
56 extern int      create_teimanager(struct mISDNdevice *);
57 extern void     delete_teimanager(struct mISDNchannel *);
58 extern void     delete_channel(struct mISDNchannel *);
59 extern void     delete_stack(struct mISDNdevice *);
60 extern void     mISDN_initstack(u_int *);
61 extern int      misdn_sock_init(u_int *);
62 extern void     misdn_sock_cleanup(void);
63 extern void     add_layer2(struct mISDNchannel *, struct mISDNstack *);
64 extern void     __add_layer2(struct mISDNchannel *, struct mISDNstack *);
65
66 extern u_int            get_all_Bprotocols(void);
67 struct Bprotocol        *get_Bprotocol4mask(u_int);
68 struct Bprotocol        *get_Bprotocol4id(u_int);
69
70 extern int      mISDN_inittimer(u_int *);
71 extern void     mISDN_timer_cleanup(void);
72
73 extern int      l1_init(u_int *);
74 extern void     l1_cleanup(void);
75 extern int      Isdnl2_Init(u_int *);
76 extern void     Isdnl2_cleanup(void);
77
78 extern void     mISDN_init_clock(u_int *);
79
80 #endif