18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright 2008 by Karsten Keil <kkeil@novell.com> 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef mISDN_CORE_H 78c2ecf20Sopenharmony_ci#define mISDN_CORE_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciextern struct mISDNdevice *get_mdevice(u_int); 108c2ecf20Sopenharmony_ciextern int get_mdevice_count(void); 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci/* stack status flag */ 138c2ecf20Sopenharmony_ci#define mISDN_STACK_ACTION_MASK 0x0000ffff 148c2ecf20Sopenharmony_ci#define mISDN_STACK_COMMAND_MASK 0x000f0000 158c2ecf20Sopenharmony_ci#define mISDN_STACK_STATUS_MASK 0xfff00000 168c2ecf20Sopenharmony_ci/* action bits 0-15 */ 178c2ecf20Sopenharmony_ci#define mISDN_STACK_WORK 0 188c2ecf20Sopenharmony_ci#define mISDN_STACK_SETUP 1 198c2ecf20Sopenharmony_ci#define mISDN_STACK_CLEARING 2 208c2ecf20Sopenharmony_ci#define mISDN_STACK_RESTART 3 218c2ecf20Sopenharmony_ci#define mISDN_STACK_WAKEUP 4 228c2ecf20Sopenharmony_ci#define mISDN_STACK_ABORT 15 238c2ecf20Sopenharmony_ci/* command bits 16-19 */ 248c2ecf20Sopenharmony_ci#define mISDN_STACK_STOPPED 16 258c2ecf20Sopenharmony_ci#define mISDN_STACK_INIT 17 268c2ecf20Sopenharmony_ci#define mISDN_STACK_THREADSTART 18 278c2ecf20Sopenharmony_ci/* status bits 20-31 */ 288c2ecf20Sopenharmony_ci#define mISDN_STACK_BCHANNEL 20 298c2ecf20Sopenharmony_ci#define mISDN_STACK_ACTIVE 29 308c2ecf20Sopenharmony_ci#define mISDN_STACK_RUNNING 30 318c2ecf20Sopenharmony_ci#define mISDN_STACK_KILLED 31 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci/* manager options */ 358c2ecf20Sopenharmony_ci#define MGR_OPT_USER 24 368c2ecf20Sopenharmony_ci#define MGR_OPT_NETWORK 25 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciextern int connect_Bstack(struct mISDNdevice *, struct mISDNchannel *, 398c2ecf20Sopenharmony_ci u_int, struct sockaddr_mISDN *); 408c2ecf20Sopenharmony_ciextern int connect_layer1(struct mISDNdevice *, struct mISDNchannel *, 418c2ecf20Sopenharmony_ci u_int, struct sockaddr_mISDN *); 428c2ecf20Sopenharmony_ciextern int create_l2entity(struct mISDNdevice *, struct mISDNchannel *, 438c2ecf20Sopenharmony_ci u_int, struct sockaddr_mISDN *); 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciextern int create_stack(struct mISDNdevice *); 468c2ecf20Sopenharmony_ciextern int create_teimanager(struct mISDNdevice *); 478c2ecf20Sopenharmony_ciextern void delete_teimanager(struct mISDNchannel *); 488c2ecf20Sopenharmony_ciextern void delete_channel(struct mISDNchannel *); 498c2ecf20Sopenharmony_ciextern void delete_stack(struct mISDNdevice *); 508c2ecf20Sopenharmony_ciextern void mISDN_initstack(u_int *); 518c2ecf20Sopenharmony_ciextern int misdn_sock_init(u_int *); 528c2ecf20Sopenharmony_ciextern void misdn_sock_cleanup(void); 538c2ecf20Sopenharmony_ciextern void add_layer2(struct mISDNchannel *, struct mISDNstack *); 548c2ecf20Sopenharmony_ciextern void __add_layer2(struct mISDNchannel *, struct mISDNstack *); 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciextern u_int get_all_Bprotocols(void); 578c2ecf20Sopenharmony_cistruct Bprotocol *get_Bprotocol4mask(u_int); 588c2ecf20Sopenharmony_cistruct Bprotocol *get_Bprotocol4id(u_int); 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ciextern int mISDN_inittimer(u_int *); 618c2ecf20Sopenharmony_ciextern void mISDN_timer_cleanup(void); 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciextern int Isdnl1_Init(u_int *); 648c2ecf20Sopenharmony_ciextern void Isdnl1_cleanup(void); 658c2ecf20Sopenharmony_ciextern int Isdnl2_Init(u_int *); 668c2ecf20Sopenharmony_ciextern void Isdnl2_cleanup(void); 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ciextern void mISDN_init_clock(u_int *); 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#endif 71