Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / drivers / isdn / mISDN / core.h
blob7ac2f81a812b0f32eab886684800ab4c937158d4
1 /*
2 * Copyright 2008 by Karsten Keil <kkeil@novell.com>
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.
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.
15 #ifndef mISDN_CORE_H
16 #define mISDN_CORE_H
18 extern struct mISDNdevice *get_mdevice(u_int);
19 extern int get_mdevice_count(void);
21 /* stack status flag */
22 #define mISDN_STACK_ACTION_MASK 0x0000ffff
23 #define mISDN_STACK_COMMAND_MASK 0x000f0000
24 #define mISDN_STACK_STATUS_MASK 0xfff00000
25 /* action bits 0-15 */
26 #define mISDN_STACK_WORK 0
27 #define mISDN_STACK_SETUP 1
28 #define mISDN_STACK_CLEARING 2
29 #define mISDN_STACK_RESTART 3
30 #define mISDN_STACK_WAKEUP 4
31 #define mISDN_STACK_ABORT 15
32 /* command bits 16-19 */
33 #define mISDN_STACK_STOPPED 16
34 #define mISDN_STACK_INIT 17
35 #define mISDN_STACK_THREADSTART 18
36 /* status bits 20-31 */
37 #define mISDN_STACK_BCHANNEL 20
38 #define mISDN_STACK_ACTIVE 29
39 #define mISDN_STACK_RUNNING 30
40 #define mISDN_STACK_KILLED 31
43 /* manager options */
44 #define MGR_OPT_USER 24
45 #define MGR_OPT_NETWORK 25
47 extern int connect_Bstack(struct mISDNdevice *, struct mISDNchannel *,
48 u_int, struct sockaddr_mISDN *);
49 extern int connect_layer1(struct mISDNdevice *, struct mISDNchannel *,
50 u_int, struct sockaddr_mISDN *);
51 extern int create_l2entity(struct mISDNdevice *, struct mISDNchannel *,
52 u_int, struct sockaddr_mISDN *);
54 extern int create_stack(struct mISDNdevice *);
55 extern int create_teimanager(struct mISDNdevice *);
56 extern void delete_teimanager(struct mISDNchannel *);
57 extern void delete_channel(struct mISDNchannel *);
58 extern void delete_stack(struct mISDNdevice *);
59 extern void mISDN_initstack(u_int *);
60 extern int misdn_sock_init(u_int *);
61 extern void misdn_sock_cleanup(void);
62 extern void add_layer2(struct mISDNchannel *, struct mISDNstack *);
63 extern void __add_layer2(struct mISDNchannel *, struct mISDNstack *);
65 extern u_int get_all_Bprotocols(void);
66 struct Bprotocol *get_Bprotocol4mask(u_int);
67 struct Bprotocol *get_Bprotocol4id(u_int);
69 extern int mISDN_inittimer(u_int *);
70 extern void mISDN_timer_cleanup(void);
72 extern int l1_init(u_int *);
73 extern void l1_cleanup(void);
74 extern int Isdnl2_Init(u_int *);
75 extern void Isdnl2_cleanup(void);
77 extern void mISDN_init_clock(u_int *);
79 #endif