isdn_common.h 3.5 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4
/* $Id: isdn_common.h,v 1.21.6.1 2001/09/23 22:24:31 kai Exp $
 *
 * header for Linux ISDN subsystem
 * common used functions and debugging-switches (linklevel).
Linus Torvalds's avatar
Linus Torvalds committed
5 6 7 8 9
 *
 * Copyright 1994-1999  by Fritz Elfert (fritz@isdn4linux.de)
 * Copyright 1995,96    by Thinking Objects Software GmbH Wuerzburg
 * Copyright 1995,96    by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
 *
Linus Torvalds's avatar
Linus Torvalds committed
10 11
 * This software may be used and distributed according to the terms
 * of the GNU General Public License, incorporated herein by reference.
Linus Torvalds's avatar
Linus Torvalds committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 */

#undef  ISDN_DEBUG_MODEM_OPEN
#undef  ISDN_DEBUG_MODEM_IOCTL
#undef  ISDN_DEBUG_MODEM_WAITSENT
#undef  ISDN_DEBUG_MODEM_HUP
#undef  ISDN_DEBUG_MODEM_ICALL
#undef  ISDN_DEBUG_MODEM_DUMP
#undef  ISDN_DEBUG_MODEM_VOICE
#undef  ISDN_DEBUG_AT
#undef  ISDN_DEBUG_NET_DUMP
#undef  ISDN_DEBUG_NET_DIAL
#undef  ISDN_DEBUG_NET_ICALL
26
#undef  ISDN_DEBUG_STATCALLB
Kai Germaschewski's avatar
Kai Germaschewski committed
27
#undef  ISDN_DEBUG_COMMAND
Linus Torvalds's avatar
Linus Torvalds committed
28

29 30 31 32 33 34 35 36 37 38 39 40
#ifdef ISDN_DEBUG_NET_DIAL
#define dbg_net_dial(arg...) printk(KERN_DEBUG arg)
#else
#define dbg_net_dial(arg...) do {} while (0)
#endif

#ifdef ISDN_DEBUG_NET_ICALL
#define dbg_net_icall(arg...) printk(KERN_DEBUG arg)
#else
#define dbg_net_icall(arg...) do {} while (0)
#endif

41 42 43 44 45 46
#ifdef ISDN_DEBUG_STATCALLB
#define dbg_statcallb(arg...) printk(KERN_DEBUG arg)
#else
#define dbg_statcallb(arg...) do {} while (0)
#endif

47
#define isdn_BUG() \
Kai Germaschewski's avatar
Kai Germaschewski committed
48
do { printk(KERN_WARNING "ISDN Bug at %s:%d\n", __FILE__, __LINE__); \
49 50
} while(0)

Kai Germaschewski's avatar
Kai Germaschewski committed
51 52
#define HERE printk("%s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__)

Linus Torvalds's avatar
Linus Torvalds committed
53 54 55
/* Prototypes */
extern void isdn_MOD_INC_USE_COUNT(void);
extern void isdn_MOD_DEC_USE_COUNT(void);
Linus Torvalds's avatar
Linus Torvalds committed
56 57
extern void isdn_lock_drivers(void);
extern void isdn_unlock_drivers(void);
Linus Torvalds's avatar
Linus Torvalds committed
58 59 60 61 62 63 64 65 66 67 68
extern void isdn_free_channel(int di, int ch, int usage);
extern int isdn_dc2minor(int di, int ch);
extern void isdn_info_update(void);
extern char *isdn_map_eaz2msn(char *msn, int di);
extern void isdn_timer_ctrl(int tf, int onoff);
extern void isdn_unexclusive_channel(int di, int ch);
extern int isdn_getnum(char **);
extern int isdn_msncmp( const char *,  const char *);
extern int isdn_add_channels(driver *, int, int, int);
#if defined(ISDN_DEBUG_NET_DUMP) || defined(ISDN_DEBUG_MODEM_DUMP)
extern void isdn_dumppkt(char *, u_char *, int, int);
69 70
#else
static inline void isdn_dumppkt(char *s, u_char *d, int l, int m) { }
Linus Torvalds's avatar
Linus Torvalds committed
71
#endif
72

73 74 75 76 77 78 79 80 81 82
struct dial_info {
	int            l2_proto;
	int            l3_proto;
	struct T30_s  *fax;
	unsigned char  si1;
	unsigned char  si2;
	unsigned char *msn;
	unsigned char *phone;
};

83 84
extern struct list_head isdn_net_devs;

85
extern int   isdn_get_free_slot(int, int, int, int, int, char *);
86 87 88
extern void  isdn_slot_free(int slot, int usage);
extern void  isdn_slot_all_eaz(int slot);
extern int   isdn_slot_command(int slot, int cmd, isdn_ctrl *);
89
extern int   isdn_slot_dial(int slot, struct dial_info *dial);
90
extern char *isdn_slot_map_eaz2msn(int slot, char *msn);
91 92
extern int   isdn_slot_write(int slot, struct sk_buff *);
extern int   isdn_slot_readbchan(int slot, u_char *, u_char *, int);
93 94 95
extern int   isdn_slot_hdrlen(int slot);
extern int   isdn_slot_driver(int slot);
extern int   isdn_slot_channel(int slot);
96 97
extern int   isdn_slot_usage(int slot);
extern void  isdn_slot_set_usage(int slot, int usage);
98 99
extern char *isdn_slot_num(int slot);
extern int   isdn_slot_m_idx(int slot);
Kai Germaschewski's avatar
Kai Germaschewski committed
100
extern void  isdn_slot_set_m_idx(int slot, int midx);
101 102 103 104 105
extern void  isdn_slot_set_rx_netdev(int sl, isdn_net_dev *nd);
extern void  isdn_slot_set_st_netdev(int sl, isdn_net_dev *nd);
extern isdn_net_dev *isdn_slot_rx_netdev(int sl);
extern isdn_net_dev *isdn_slot_st_netdev(int sl);