xref: /linux/drivers/isdn/mISDN/core.h (revision 1802d0beecafe581ad584634ba92f8a471d8a63a)
1*1802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
21b2b03f8SKarsten Keil /*
31b2b03f8SKarsten Keil  * Copyright 2008  by Karsten Keil <kkeil@novell.com>
41b2b03f8SKarsten Keil  */
51b2b03f8SKarsten Keil 
61b2b03f8SKarsten Keil #ifndef mISDN_CORE_H
71b2b03f8SKarsten Keil #define mISDN_CORE_H
81b2b03f8SKarsten Keil 
91b2b03f8SKarsten Keil extern struct mISDNdevice	*get_mdevice(u_int);
101b2b03f8SKarsten Keil extern int			get_mdevice_count(void);
111b2b03f8SKarsten Keil 
121b2b03f8SKarsten Keil /* stack status flag */
131b2b03f8SKarsten Keil #define mISDN_STACK_ACTION_MASK		0x0000ffff
141b2b03f8SKarsten Keil #define mISDN_STACK_COMMAND_MASK	0x000f0000
151b2b03f8SKarsten Keil #define mISDN_STACK_STATUS_MASK		0xfff00000
161b2b03f8SKarsten Keil /* action bits 0-15 */
171b2b03f8SKarsten Keil #define mISDN_STACK_WORK	0
181b2b03f8SKarsten Keil #define mISDN_STACK_SETUP	1
191b2b03f8SKarsten Keil #define mISDN_STACK_CLEARING	2
201b2b03f8SKarsten Keil #define mISDN_STACK_RESTART	3
211b2b03f8SKarsten Keil #define mISDN_STACK_WAKEUP	4
221b2b03f8SKarsten Keil #define mISDN_STACK_ABORT	15
231b2b03f8SKarsten Keil /* command bits 16-19 */
241b2b03f8SKarsten Keil #define mISDN_STACK_STOPPED	16
251b2b03f8SKarsten Keil #define mISDN_STACK_INIT	17
261b2b03f8SKarsten Keil #define mISDN_STACK_THREADSTART	18
271b2b03f8SKarsten Keil /* status bits 20-31 */
281b2b03f8SKarsten Keil #define mISDN_STACK_BCHANNEL	20
291b2b03f8SKarsten Keil #define mISDN_STACK_ACTIVE      29
301b2b03f8SKarsten Keil #define mISDN_STACK_RUNNING     30
311b2b03f8SKarsten Keil #define mISDN_STACK_KILLED      31
321b2b03f8SKarsten Keil 
331b2b03f8SKarsten Keil 
341b2b03f8SKarsten Keil /* manager options */
351b2b03f8SKarsten Keil #define MGR_OPT_USER		24
361b2b03f8SKarsten Keil #define MGR_OPT_NETWORK		25
371b2b03f8SKarsten Keil 
381b2b03f8SKarsten Keil extern int	connect_Bstack(struct mISDNdevice *, struct mISDNchannel *,
391b2b03f8SKarsten Keil 			       u_int, struct sockaddr_mISDN *);
401b2b03f8SKarsten Keil extern int	connect_layer1(struct mISDNdevice *, struct mISDNchannel *,
411b2b03f8SKarsten Keil 			       u_int, struct sockaddr_mISDN *);
421b2b03f8SKarsten Keil extern int	create_l2entity(struct mISDNdevice *, struct mISDNchannel *,
431b2b03f8SKarsten Keil 				u_int, struct sockaddr_mISDN *);
441b2b03f8SKarsten Keil 
451b2b03f8SKarsten Keil extern int	create_stack(struct mISDNdevice *);
461b2b03f8SKarsten Keil extern int	create_teimanager(struct mISDNdevice *);
471b2b03f8SKarsten Keil extern void	delete_teimanager(struct mISDNchannel *);
481b2b03f8SKarsten Keil extern void	delete_channel(struct mISDNchannel *);
491b2b03f8SKarsten Keil extern void	delete_stack(struct mISDNdevice *);
501b2b03f8SKarsten Keil extern void	mISDN_initstack(u_int *);
511b2b03f8SKarsten Keil extern int      misdn_sock_init(u_int *);
521b2b03f8SKarsten Keil extern void     misdn_sock_cleanup(void);
531b2b03f8SKarsten Keil extern void	add_layer2(struct mISDNchannel *, struct mISDNstack *);
541b2b03f8SKarsten Keil extern void	__add_layer2(struct mISDNchannel *, struct mISDNstack *);
551b2b03f8SKarsten Keil 
561b2b03f8SKarsten Keil extern u_int		get_all_Bprotocols(void);
571b2b03f8SKarsten Keil struct Bprotocol	*get_Bprotocol4mask(u_int);
581b2b03f8SKarsten Keil struct Bprotocol	*get_Bprotocol4id(u_int);
591b2b03f8SKarsten Keil 
601b2b03f8SKarsten Keil extern int	mISDN_inittimer(u_int *);
611b2b03f8SKarsten Keil extern void	mISDN_timer_cleanup(void);
621b2b03f8SKarsten Keil 
631b2b03f8SKarsten Keil extern int	l1_init(u_int *);
641b2b03f8SKarsten Keil extern void	l1_cleanup(void);
651b2b03f8SKarsten Keil extern int	Isdnl2_Init(u_int *);
661b2b03f8SKarsten Keil extern void	Isdnl2_cleanup(void);
671b2b03f8SKarsten Keil 
683bd69ad1SAndreas Eversberg extern void	mISDN_init_clock(u_int *);
693bd69ad1SAndreas Eversberg 
701b2b03f8SKarsten Keil #endif
71