xref: /openbmc/linux/drivers/isdn/mISDN/core.h (revision 1b2b03f8)
11b2b03f8SKarsten Keil /*
21b2b03f8SKarsten Keil  * Copyright 2008  by Karsten Keil <kkeil@novell.com>
31b2b03f8SKarsten Keil  *
41b2b03f8SKarsten Keil  * This program is free software; you can redistribute it and/or modify
51b2b03f8SKarsten Keil  * it under the terms of the GNU General Public License version 2 as
61b2b03f8SKarsten Keil  * published by the Free Software Foundation.
71b2b03f8SKarsten Keil  *
81b2b03f8SKarsten Keil  * This program is distributed in the hope that it will be useful,
91b2b03f8SKarsten Keil  * but WITHOUT ANY WARRANTY; without even the implied warranty of
101b2b03f8SKarsten Keil  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
111b2b03f8SKarsten Keil  * GNU General Public License for more details.
121b2b03f8SKarsten Keil  *
131b2b03f8SKarsten Keil  */
141b2b03f8SKarsten Keil 
151b2b03f8SKarsten Keil #ifndef mISDN_CORE_H
161b2b03f8SKarsten Keil #define mISDN_CORE_H
171b2b03f8SKarsten Keil 
181b2b03f8SKarsten Keil extern struct mISDNdevice	*get_mdevice(u_int);
191b2b03f8SKarsten Keil extern int			get_mdevice_count(void);
201b2b03f8SKarsten Keil 
211b2b03f8SKarsten Keil /* stack status flag */
221b2b03f8SKarsten Keil #define mISDN_STACK_ACTION_MASK		0x0000ffff
231b2b03f8SKarsten Keil #define mISDN_STACK_COMMAND_MASK	0x000f0000
241b2b03f8SKarsten Keil #define mISDN_STACK_STATUS_MASK		0xfff00000
251b2b03f8SKarsten Keil /* action bits 0-15 */
261b2b03f8SKarsten Keil #define mISDN_STACK_WORK	0
271b2b03f8SKarsten Keil #define mISDN_STACK_SETUP	1
281b2b03f8SKarsten Keil #define mISDN_STACK_CLEARING	2
291b2b03f8SKarsten Keil #define mISDN_STACK_RESTART	3
301b2b03f8SKarsten Keil #define mISDN_STACK_WAKEUP	4
311b2b03f8SKarsten Keil #define mISDN_STACK_ABORT	15
321b2b03f8SKarsten Keil /* command bits 16-19 */
331b2b03f8SKarsten Keil #define mISDN_STACK_STOPPED	16
341b2b03f8SKarsten Keil #define mISDN_STACK_INIT	17
351b2b03f8SKarsten Keil #define mISDN_STACK_THREADSTART	18
361b2b03f8SKarsten Keil /* status bits 20-31 */
371b2b03f8SKarsten Keil #define mISDN_STACK_BCHANNEL	20
381b2b03f8SKarsten Keil #define mISDN_STACK_ACTIVE      29
391b2b03f8SKarsten Keil #define mISDN_STACK_RUNNING     30
401b2b03f8SKarsten Keil #define mISDN_STACK_KILLED      31
411b2b03f8SKarsten Keil 
421b2b03f8SKarsten Keil 
431b2b03f8SKarsten Keil /* manager options */
441b2b03f8SKarsten Keil #define MGR_OPT_USER		24
451b2b03f8SKarsten Keil #define MGR_OPT_NETWORK		25
461b2b03f8SKarsten Keil 
471b2b03f8SKarsten Keil extern int	connect_Bstack(struct mISDNdevice *, struct mISDNchannel *,
481b2b03f8SKarsten Keil 			u_int, struct sockaddr_mISDN *);
491b2b03f8SKarsten Keil extern int	connect_layer1(struct mISDNdevice *, struct mISDNchannel *,
501b2b03f8SKarsten Keil 			u_int, struct sockaddr_mISDN *);
511b2b03f8SKarsten Keil extern int	create_l2entity(struct mISDNdevice *, struct mISDNchannel *,
521b2b03f8SKarsten Keil 			u_int, struct sockaddr_mISDN *);
531b2b03f8SKarsten Keil 
541b2b03f8SKarsten Keil extern int	create_stack(struct mISDNdevice *);
551b2b03f8SKarsten Keil extern int	create_teimanager(struct mISDNdevice *);
561b2b03f8SKarsten Keil extern void	delete_teimanager(struct mISDNchannel *);
571b2b03f8SKarsten Keil extern void	delete_channel(struct mISDNchannel *);
581b2b03f8SKarsten Keil extern void	delete_stack(struct mISDNdevice *);
591b2b03f8SKarsten Keil extern void	mISDN_initstack(u_int *);
601b2b03f8SKarsten Keil extern int      misdn_sock_init(u_int *);
611b2b03f8SKarsten Keil extern void     misdn_sock_cleanup(void);
621b2b03f8SKarsten Keil extern void	add_layer2(struct mISDNchannel *, struct mISDNstack *);
631b2b03f8SKarsten Keil extern void	__add_layer2(struct mISDNchannel *, struct mISDNstack *);
641b2b03f8SKarsten Keil 
651b2b03f8SKarsten Keil extern u_int		get_all_Bprotocols(void);
661b2b03f8SKarsten Keil struct Bprotocol	*get_Bprotocol4mask(u_int);
671b2b03f8SKarsten Keil struct Bprotocol	*get_Bprotocol4id(u_int);
681b2b03f8SKarsten Keil 
691b2b03f8SKarsten Keil extern int	mISDN_inittimer(u_int *);
701b2b03f8SKarsten Keil extern void	mISDN_timer_cleanup(void);
711b2b03f8SKarsten Keil 
721b2b03f8SKarsten Keil extern int	l1_init(u_int *);
731b2b03f8SKarsten Keil extern void	l1_cleanup(void);
741b2b03f8SKarsten Keil extern int 	Isdnl2_Init(u_int *);
751b2b03f8SKarsten Keil extern void	Isdnl2_cleanup(void);
761b2b03f8SKarsten Keil 
771b2b03f8SKarsten Keil #endif
78