162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright 2008 by Karsten Keil <kkeil@novell.com> 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef mISDN_CORE_H 762306a36Sopenharmony_ci#define mISDN_CORE_H 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciextern struct mISDNdevice *get_mdevice(u_int); 1062306a36Sopenharmony_ciextern int get_mdevice_count(void); 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* stack status flag */ 1362306a36Sopenharmony_ci#define mISDN_STACK_ACTION_MASK 0x0000ffff 1462306a36Sopenharmony_ci#define mISDN_STACK_COMMAND_MASK 0x000f0000 1562306a36Sopenharmony_ci#define mISDN_STACK_STATUS_MASK 0xfff00000 1662306a36Sopenharmony_ci/* action bits 0-15 */ 1762306a36Sopenharmony_ci#define mISDN_STACK_WORK 0 1862306a36Sopenharmony_ci#define mISDN_STACK_SETUP 1 1962306a36Sopenharmony_ci#define mISDN_STACK_CLEARING 2 2062306a36Sopenharmony_ci#define mISDN_STACK_RESTART 3 2162306a36Sopenharmony_ci#define mISDN_STACK_WAKEUP 4 2262306a36Sopenharmony_ci#define mISDN_STACK_ABORT 15 2362306a36Sopenharmony_ci/* command bits 16-19 */ 2462306a36Sopenharmony_ci#define mISDN_STACK_STOPPED 16 2562306a36Sopenharmony_ci#define mISDN_STACK_INIT 17 2662306a36Sopenharmony_ci#define mISDN_STACK_THREADSTART 18 2762306a36Sopenharmony_ci/* status bits 20-31 */ 2862306a36Sopenharmony_ci#define mISDN_STACK_BCHANNEL 20 2962306a36Sopenharmony_ci#define mISDN_STACK_ACTIVE 29 3062306a36Sopenharmony_ci#define mISDN_STACK_RUNNING 30 3162306a36Sopenharmony_ci#define mISDN_STACK_KILLED 31 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/* manager options */ 3562306a36Sopenharmony_ci#define MGR_OPT_USER 24 3662306a36Sopenharmony_ci#define MGR_OPT_NETWORK 25 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ciextern int connect_Bstack(struct mISDNdevice *, struct mISDNchannel *, 3962306a36Sopenharmony_ci u_int, struct sockaddr_mISDN *); 4062306a36Sopenharmony_ciextern int connect_layer1(struct mISDNdevice *, struct mISDNchannel *, 4162306a36Sopenharmony_ci u_int, struct sockaddr_mISDN *); 4262306a36Sopenharmony_ciextern int create_l2entity(struct mISDNdevice *, struct mISDNchannel *, 4362306a36Sopenharmony_ci u_int, struct sockaddr_mISDN *); 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ciextern int create_stack(struct mISDNdevice *); 4662306a36Sopenharmony_ciextern int create_teimanager(struct mISDNdevice *); 4762306a36Sopenharmony_ciextern void delete_teimanager(struct mISDNchannel *); 4862306a36Sopenharmony_ciextern void delete_channel(struct mISDNchannel *); 4962306a36Sopenharmony_ciextern void delete_stack(struct mISDNdevice *); 5062306a36Sopenharmony_ciextern void mISDN_initstack(u_int *); 5162306a36Sopenharmony_ciextern int misdn_sock_init(u_int *); 5262306a36Sopenharmony_ciextern void misdn_sock_cleanup(void); 5362306a36Sopenharmony_ciextern void add_layer2(struct mISDNchannel *, struct mISDNstack *); 5462306a36Sopenharmony_ciextern void __add_layer2(struct mISDNchannel *, struct mISDNstack *); 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ciextern u_int get_all_Bprotocols(void); 5762306a36Sopenharmony_cistruct Bprotocol *get_Bprotocol4mask(u_int); 5862306a36Sopenharmony_cistruct Bprotocol *get_Bprotocol4id(u_int); 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ciextern int mISDN_inittimer(u_int *); 6162306a36Sopenharmony_ciextern void mISDN_timer_cleanup(void); 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ciextern int Isdnl1_Init(u_int *); 6462306a36Sopenharmony_ciextern void Isdnl1_cleanup(void); 6562306a36Sopenharmony_ciextern int Isdnl2_Init(u_int *); 6662306a36Sopenharmony_ciextern void Isdnl2_cleanup(void); 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciextern void mISDN_init_clock(u_int *); 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci#endif 71