Import 2.3.99pre9-1
[davej-history.git] / include / linux / isdn.h
blobc916a8fa0b08f5638d38117f098db11329f83e96
1 /* $Id: isdn.h,v 1.101 2000/03/20 22:37:47 detabc Exp $
3 * Main header for the Linux ISDN subsystem (linklevel).
5 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
6 * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
7 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * $Log: isdn.h,v $
24 * Revision 1.101 2000/03/20 22:37:47 detabc
25 * modify abc-extension to work together with the new LL.
26 * remove abc frame-counter (is obsolete now).
27 * use the new lp->super_tx_queue for internal queueing (bsd-rawip-compress).
28 * modify isdn_net_xmit() and isdn_net_write_super().
29 * -- Kai, please have a look to this two function's. Thank's.
31 * Revision 1.100 2000/03/19 15:27:53 kai
32 * no known bugs left...
34 * Revision 1.99 2000/03/18 16:20:26 kai
35 * cosmetics / renaming
37 * Revision 1.98 2000/03/17 18:20:47 kai
38 * moved to frame_cnt based flow control
39 * some races still need to be fixed
41 * Revision 1.97 2000/03/17 16:22:55 kai
42 * we keep track of outstanding packets (given to HL, but not confirmed yet)
43 * now, but we don't use it for flow control yet.
45 * Revision 1.96 2000/03/17 12:49:42 kai
46 * calling statcallb with ISDN_STAT_BSENT in hard-IRQ context is now
47 * officially allowed. writebuf_skb() will never be called in hard-IRQ context
48 * anymore.
50 * Revision 1.95 2000/03/04 16:20:42 detabc
51 * copy frames before rewriting frame's saddr
53 * Revision 1.94 2000/02/26 00:29:40 keil
54 * more softnet changes
56 * Revision 1.93 2000/02/25 11:29:17 paul
57 * changed chargetime to ulong from int (after about 20 days the "chargetime of
58 * ipppX is now 1234" message displays a negative number on alpha).
60 * Revision 1.92 2000/02/17 13:15:56 keil
61 * fix backward compatibility for 2.2
63 * Revision 1.91 2000/02/16 14:56:27 paul
64 * translated ISDN_MODEM_ANZREG to ISDN_MODEM_NUMREG for english speakers
66 * Revision 1.90 2000/02/06 21:50:00 detabc
67 * add rewriting of socket's and frame's saddr for udp-ipv4 dynip-connections.
68 * Include checksum-recompute of ip- and udp-header's.
70 * Revision 1.89 2000/02/05 22:11:33 detabc
71 * Add rewriting of socket's and frame's saddr adressfield for
72 * dynip-connections. Only for tcp/ipv4 and switchable per interface.
73 * Include checksum-recompute of ip- and tcp-header's.
75 * Revision 1.88 2000/01/20 19:59:43 keil
76 * Add FAX Class 1 support
78 * Revision 1.87 2000/01/09 20:43:15 detabc
79 * exand logical bind-group's for both call's (in and out).
80 * add first part of kernel-config-help for abc-extension.
82 * Revision 1.86 1999/12/05 16:06:09 detabc
83 * add resethandling for rawip-compression.
84 * at now all B2-Protocols are usable with rawip-compression
86 * Revision 1.85 1999/11/30 11:29:06 detabc
87 * add a on the fly frame-counter and limit
89 * Revision 1.84 1999/11/28 14:49:08 detabc
90 * In case of rawip-compress adjust dev[x]->ibytes/obytes to reflect the
91 * uncompressed size.
93 * Revision 1.83 1999/11/26 15:54:59 detabc
94 * added compression (isdn_bsdcompress) for rawip interfaces with x75i B2-protocol.
96 * Revision 1.82 1999/11/20 22:14:14 detabc
97 * added channel dial-skip in case of external use
98 * (isdn phone or another isdn device) on the same NTBA.
99 * usefull with two or more card's connected the different NTBA's.
100 * global switchable in kernel-config and also per netinterface.
102 * add auto disable of netinterface's in case of:
103 * to many connection's in short time.
104 * config mistakes (wrong encapsulation, B2-protokoll or so on) on local
105 * or remote side.
106 * wrong password's or something else to a ISP (syncppp).
108 * possible encapsulations for this future are:
109 * ISDN_NET_ENCAP_SYNCPPP, ISDN_NET_ENCAP_UIHDLC, ISDN_NET_ENCAP_RAWIP,
110 * and ISDN_NET_ENCAP_CISCOHDLCK.
112 * Revision 1.81 1999/10/27 21:21:18 detabc
113 * Added support for building logically-bind-group's per interface.
114 * usefull for outgoing call's with more then one isdn-card.
116 * Switchable support to dont reset the hangup-timeout for
117 * receive frames. Most part's of the timru-rules for receiving frames
118 * are now obsolete. If the input- or forwarding-firewall deny
119 * the frame, the line will be not hold open.
121 * Revision 1.80 1999/10/26 21:09:29 armin
122 * New bufferlen for phonenumber only with kernel 2.3.x
124 * Revision 1.79 1999/10/16 17:52:38 keil
125 * Changing the MSN length need new data versions
127 * Revision 1.78 1999/10/08 18:59:33 armin
128 * Bugfix of too small MSN buffer and checking phone number
129 * in isdn_tty_getdial()
131 * Revision 1.77 1999/09/23 22:22:42 detabc
132 * added tcp-keepalive-detect with local response (ipv4 only)
133 * added host-only-interface support
134 * (source ipaddr == interface ipaddr) (ipv4 only)
135 * ok with kernel 2.3.18 and 2.2.12
137 * Revision 1.76 1999/09/14 10:16:21 keil
138 * change ABC include
140 * Revision 1.75 1999/09/13 23:25:17 he
141 * serialized xmitting frames from isdn_ppp and BSENT statcallb
143 * Revision 1.74 1999/09/12 16:19:39 detabc
144 * added abc features
145 * low cost routing for net-interfaces (only the HL side).
146 * need more implementation in the isdnlog-utility
147 * udp info support (first part).
148 * different EAZ on outgoing call's.
149 * more checks on D-Channel callbacks (double use of channels).
150 * tested and running with kernel 2.3.17
152 * Revision 1.73 1999/09/06 07:29:36 fritz
153 * Changed my mail-address.
155 * Revision 1.72 1999/09/04 22:20:19 detabc
157 * Revision 1.71 1999/08/23 15:54:22 keil
158 * more backported changes from kernel 2.3.14
160 * Revision 1.70 1999/07/31 12:59:58 armin
161 * Added tty fax capabilities.
163 * Revision 1.69 1999/07/13 20:47:53 werner
164 * added channel bit ISDN_USAGE_DISABLED for limiting b-channel access.
166 * Revision 1.68 1999/07/11 17:07:37 armin
167 * Added tty modem register S23.
168 * Added new layer 2 and 3 protocols for Fax and DSP functions.
170 * Revision 1.67 1999/07/07 10:17:24 detabc
171 * remove unused messages
173 * Revision 1.66 1999/07/01 08:35:37 keil
174 * compatibility to 2.3
176 * Revision 1.65 1999/06/10 11:51:27 paul
177 * fixed comment for NET_DV
179 * Revision 1.64 1999/04/18 14:57:14 fritz
180 * Removed TIMRU stuff
182 * Revision 1.63 1999/04/18 14:07:18 fritz
183 * Removed TIMRU stuff.
185 * Revision 1.62 1999/04/12 13:16:54 fritz
186 * Changes from 2.0 tree.
188 * Revision 1.61 1999/03/02 11:43:21 armin
189 * Added variable to store connect-message of Modem.
190 * Added Timer-define for RegS7 (Wait for Carrier).
192 * Revision 1.60 1998/10/25 14:50:29 fritz
193 * Backported from MIPS (Cobalt).
195 * Revision 1.59 1998/10/23 10:18:55 paul
196 * Implementation of "dialmode" (successor of "status")
197 * You also need current isdnctrl for this!
199 * Revision 1.58 1998/10/23 10:10:06 fritz
200 * Test-Checkin
202 * Revision 1.57 1998/08/31 21:10:01 he
203 * new ioctl IIOCNETGPN for /dev/isdninfo (get network interface'
204 * peer phone number)
206 * Revision 1.56 1998/07/26 18:46:52 armin
207 * Added silence detection in voice receive mode.
209 * Revision 1.55 1998/06/26 15:13:17 fritz
210 * Added handling of STAT_ICALL with incomplete CPN.
211 * Added AT&L for ttyI emulator.
212 * Added more locking stuff in tty_write.
214 * Revision 1.54 1998/06/18 23:32:01 fritz
215 * Replaced cli()/restore_flags() in isdn_tty_write() by locking.
216 * Removed direct-senddown feature in isdn_tty_write because it will
217 * never succeed with locking and is useless anyway.
219 * Revision 1.53 1998/06/17 19:51:51 he
220 * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay())
221 * brute force fix to avoid Ugh's in isdn_tty_write()
222 * cleaned up some dead code
224 * Revision 1.46 1998/04/14 16:28:59 he
225 * Fixed user space access with interrupts off and remaining
226 * copy_{to,from}_user() -> -EFAULT return codes
228 * Revision 1.45 1998/03/24 16:33:12 hipp
229 * More CCP changes. BSD compression now "works" on a local loopback link.
230 * Moved some isdn_ppp stuff from isdn.h to isdn_ppp.h
232 * Revision 1.44 1998/03/22 18:50:56 hipp
233 * Added BSD Compression for syncPPP .. UNTESTED at the moment
235 * Revision 1.43 1998/03/09 17:46:44 he
236 * merged in 2.1.89 changes
239 * Revision 1.40 1998/03/08 01:08:29 fritz
240 * Increased NET_DV because of TIMRU
242 * Revision 1.39 1998/03/07 22:42:49 fritz
243 * Starting generic module support (Nothing usable yet).
245 * Revision 1.38 1998/03/07 18:21:29 cal
246 * Dynamic Timeout-Rule-Handling vs. 971110 included
248 * Revision 1.37 1998/02/22 19:45:24 fritz
249 * Some changes regarding V.110
251 * Revision 1.36 1998/02/20 17:35:55 fritz
252 * Added V.110 stuff.
254 * Revision 1.35 1998/01/31 22:14:14 keil
255 * changes for 2.1.82
257 * Revision 1.34 1997/10/09 21:28:11 fritz
258 * New HL<->LL interface:
259 * New BSENT callback with nr. of bytes included.
260 * Sending without ACK.
261 * New L1 error status (not yet in use).
262 * Cleaned up obsolete structures.
263 * Implemented Cisco-SLARP.
264 * Changed local net-interface data to be dynamically allocated.
265 * Removed old 2.0 compatibility stuff.
267 * Revision 1.33 1997/08/21 14:44:22 fritz
268 * Moved triggercps to end of struct for backwards-compatibility.
270 * Revision 1.32 1997/08/21 09:49:46 fritz
271 * Increased NET_DV
273 * Revision 1.31 1997/06/22 11:57:07 fritz
274 * Added ability to adjust slave triggerlevel.
276 * Revision 1.30 1997/06/17 13:07:23 hipp
277 * compression changes , MP changes
279 * Revision 1.29 1997/05/27 15:18:02 fritz
280 * Added changes for recent 2.1.x kernels:
281 * changed return type of isdn_close
282 * queue_task_* -> queue_task
283 * clear/set_bit -> test_and_... where apropriate.
284 * changed type of hard_header_cache parameter.
286 * Revision 1.28 1997/03/07 01:33:01 fritz
287 * Added proper ifdef's for CONFIG_ISDN_AUDIO
289 * Revision 1.27 1997/03/05 21:11:49 fritz
290 * Minor fixes.
292 * Revision 1.26 1997/02/28 02:37:53 fritz
293 * Added some comments.
295 * Revision 1.25 1997/02/23 16:54:23 hipp
296 * some initial changes for future PPP compresion
298 * Revision 1.24 1997/02/18 09:42:45 fritz
299 * Bugfix: Increased ISDN_MODEM_ANZREG.
300 * Increased TTY_DV.
302 * Revision 1.23 1997/02/10 22:07:13 fritz
303 * Added 2 modem registers for numbering plan and screening info.
305 * Revision 1.22 1997/02/03 23:42:08 fritz
306 * Added ISDN_TIMER_RINGING
307 * Misc. changes for Kernel 2.1.X compatibility
309 * Revision 1.21 1997/01/17 01:19:10 fritz
310 * Applied chargeint patch.
312 * Revision 1.20 1997/01/17 00:41:19 fritz
313 * Increased TTY_DV.
315 * Revision 1.19 1997/01/14 01:41:07 fritz
316 * Added ATI2 related variables.
317 * Added variables for audio support in skbuffs.
319 * Revision 1.18 1996/11/06 17:37:50 keil
320 * more changes for 2.1.X
322 * Revision 1.17 1996/09/07 12:53:57 hipp
323 * moved a few isdn_ppp.c specific defines to drives/isdn/isdn_ppp.h
325 * Revision 1.16 1996/08/12 16:20:56 hipp
326 * renamed ppp_minor to ppp_slot
328 * Revision 1.15 1996/06/15 14:56:57 fritz
329 * Added version signatures for data structures used
330 * by userlevel programs.
332 * Revision 1.14 1996/06/06 21:24:23 fritz
333 * Started adding support for suspend/resume.
335 * Revision 1.13 1996/06/05 02:18:20 fritz
336 * Added DTMF decoding stuff.
338 * Revision 1.12 1996/06/03 19:55:08 fritz
339 * Fixed typos.
341 * Revision 1.11 1996/05/31 01:37:47 fritz
342 * Minor changes, due to changes in isdn_tty.c
344 * Revision 1.10 1996/05/18 01:37:18 fritz
345 * Added spelling corrections and some minor changes
346 * to stay in sync with kernel.
348 * Revision 1.9 1996/05/17 03:58:20 fritz
349 * Added flags for DLE handling.
351 * Revision 1.8 1996/05/11 21:49:55 fritz
352 * Removed queue management variables.
353 * Changed queue management to use sk_buffs.
355 * Revision 1.7 1996/05/07 09:10:06 fritz
356 * Reorganized tty-related structs.
358 * Revision 1.6 1996/05/06 11:38:27 hipp
359 * minor change in ippp struct
361 * Revision 1.5 1996/04/30 11:03:16 fritz
362 * Added Michael's ippp-bind patch.
364 * Revision 1.4 1996/04/29 23:00:02 fritz
365 * Added variables for voice-support.
367 * Revision 1.3 1996/04/20 16:54:58 fritz
368 * Increased maximum number of channels.
369 * Added some flags for isdn_net to handle callback more reliable.
370 * Fixed delay-definitions to be more accurate.
371 * Misc. typos
373 * Revision 1.2 1996/02/11 02:10:02 fritz
374 * Changed IOCTL-names
375 * Added rx_netdev, st_netdev, first_skb, org_hcb, and org_hcu to
376 * Netdevice-local struct.
378 * Revision 1.1 1996/01/10 20:55:07 fritz
379 * Initial revision
383 #ifndef isdn_h
384 #define isdn_h
386 #include <linux/config.h>
387 #include <linux/ioctl.h>
389 #define ISDN_TTY_MAJOR 43
390 #define ISDN_TTYAUX_MAJOR 44
391 #define ISDN_MAJOR 45
393 /* The minor-devicenumbers for Channel 0 and 1 are used as arguments for
394 * physical Channel-Mapping, so they MUST NOT be changed without changing
395 * the correspondent code in isdn.c
398 #ifdef CONFIG_COBALT_MICRO_SERVER
399 /* Save memory */
400 #define ISDN_MAX_DRIVERS 2
401 #define ISDN_MAX_CHANNELS 8
402 #else
403 #define ISDN_MAX_DRIVERS 32
404 #define ISDN_MAX_CHANNELS 64
405 #endif
406 #define ISDN_MINOR_B 0
407 #define ISDN_MINOR_BMAX (ISDN_MAX_CHANNELS-1)
408 #define ISDN_MINOR_CTRL 64
409 #define ISDN_MINOR_CTRLMAX (64 + (ISDN_MAX_CHANNELS-1))
410 #define ISDN_MINOR_PPP 128
411 #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
412 #define ISDN_MINOR_STATUS 255
414 #undef CONFIG_ISDN_WITH_ABC_CALLB
415 #undef CONFIG_ISDN_WITH_ABC_UDP_CHECK
416 #undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
417 #undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
418 #undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
419 #undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
420 #undef CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
421 #undef CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
422 #undef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
423 #undef CONFIG_ISDN_WITH_ABC_ICALL_BIND
424 #undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
425 #undef CONFIG_ISDN_WITH_ABC_CONN_ERROR
426 #undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
427 #undef CONFIG_ISDN_WITH_ABC_IPV4_RW_SOCKADDR
428 #undef CONFIG_ISDN_WITH_ABC_IPV4_RWUDP_SOCKADDR
431 /* New ioctl-codes */
432 #define IIOCNETAIF _IO('I',1)
433 #define IIOCNETDIF _IO('I',2)
434 #define IIOCNETSCF _IO('I',3)
435 #define IIOCNETGCF _IO('I',4)
436 #define IIOCNETANM _IO('I',5)
437 #define IIOCNETDNM _IO('I',6)
438 #define IIOCNETGNM _IO('I',7)
439 #define IIOCGETSET _IO('I',8) /* no longer supported */
440 #define IIOCSETSET _IO('I',9) /* no longer supported */
441 #define IIOCSETVER _IO('I',10)
442 #define IIOCNETHUP _IO('I',11)
443 #define IIOCSETGST _IO('I',12)
444 #define IIOCSETBRJ _IO('I',13)
445 #define IIOCSIGPRF _IO('I',14)
446 #define IIOCGETPRF _IO('I',15)
447 #define IIOCSETPRF _IO('I',16)
448 #define IIOCGETMAP _IO('I',17)
449 #define IIOCSETMAP _IO('I',18)
450 #define IIOCNETASL _IO('I',19)
451 #define IIOCNETDIL _IO('I',20)
452 #define IIOCGETCPS _IO('I',21)
453 #define IIOCGETDVR _IO('I',22)
454 #define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
455 #define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
457 #define IIOCNETALN _IO('I',32)
458 #define IIOCNETDLN _IO('I',33)
460 #define IIOCNETGPN _IO('I',34)
462 #define IIOCDBGVAR _IO('I',127)
464 #define IIOCDRVCTL _IO('I',128)
466 /* Packet encapsulations for net-interfaces */
467 #define ISDN_NET_ENCAP_ETHER 0
468 #define ISDN_NET_ENCAP_RAWIP 1
469 #define ISDN_NET_ENCAP_IPTYP 2
470 #define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
471 #define ISDN_NET_ENCAP_SYNCPPP 4
472 #define ISDN_NET_ENCAP_UIHDLC 5
473 #define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
474 #define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/
475 #define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
476 /* Facility which currently uses an ISDN-channel */
477 #define ISDN_USAGE_NONE 0
478 #define ISDN_USAGE_RAW 1
479 #define ISDN_USAGE_MODEM 2
480 #define ISDN_USAGE_NET 3
481 #define ISDN_USAGE_VOICE 4
482 #define ISDN_USAGE_FAX 5
483 #define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
484 #define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
485 #define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
486 #define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
488 #define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
489 #define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
490 #define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
492 #define ISDN_MSNLEN 32
493 #define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
494 #define TTY_DV 0x06 /* Data version for iprofd etc. */
496 #define INF_DV 0x01 /* Data version for /dev/isdninfo */
498 typedef struct {
499 char drvid[25];
500 unsigned long arg;
501 } isdn_ioctl_struct;
503 typedef struct {
504 unsigned long isdndev;
505 unsigned long atmodem[ISDN_MAX_CHANNELS];
506 unsigned long info[ISDN_MAX_CHANNELS];
507 } debugvar_addr;
509 typedef struct {
510 char name[10];
511 char phone[ISDN_MSNLEN];
512 int outgoing;
513 } isdn_net_ioctl_phone;
515 typedef struct {
516 char name[10]; /* Name of interface */
517 char master[10]; /* Name of Master for Bundling */
518 char slave[10]; /* Name of Slave for Bundling */
519 char eaz[256]; /* EAZ/MSN */
520 char drvid[25]; /* DriverId for Bindings */
521 int onhtime; /* Hangup-Timeout */
522 int charge; /* Charge-Units */
523 int l2_proto; /* Layer-2 protocol */
524 int l3_proto; /* Layer-3 protocol */
525 int p_encap; /* Encapsulation */
526 int exclusive; /* Channel, if bound exclusive */
527 int dialmax; /* Dial Retry-Counter */
528 int slavedelay; /* Delay until slave starts up */
529 int cbdelay; /* Delay before Callback */
530 int chargehup; /* Flag: Charge-Hangup */
531 int ihup; /* Flag: Hangup-Timeout on incoming line */
532 int secure; /* Flag: Secure */
533 int callback; /* Flag: Callback */
534 int cbhup; /* Flag: Reject Call before Callback */
535 int pppbind; /* ippp device for bindings */
536 int chargeint; /* Use fixed charge interval length */
537 int triggercps; /* BogoCPS needed for triggering slave */
538 int dialtimeout; /* Dial-Timeout */
539 int dialwait; /* Time to wait after failed dial */
540 int dialmode; /* Flag: off / on / auto */
541 } isdn_net_ioctl_cfg;
543 #define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
544 #define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
545 #define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
546 #define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
547 #define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
549 #ifdef __KERNEL__
551 #include <linux/errno.h>
552 #include <linux/fs.h>
553 #include <linux/major.h>
554 #include <asm/segment.h>
555 #include <asm/io.h>
556 #include <linux/kernel.h>
557 #include <linux/signal.h>
558 #include <linux/malloc.h>
559 #include <linux/timer.h>
560 #include <linux/wait.h>
561 #include <linux/tty.h>
562 #include <linux/tty_flip.h>
563 #include <linux/serial_reg.h>
564 #include <linux/fcntl.h>
565 #include <linux/types.h>
566 #include <linux/interrupt.h>
567 #include <linux/ip.h>
568 #include <linux/in.h>
569 #include <linux/netdevice.h>
570 #include <linux/etherdevice.h>
571 #include <linux/skbuff.h>
572 #include <linux/tcp.h>
574 #ifdef CONFIG_ISDN_PPP
576 #ifdef CONFIG_ISDN_PPP_VJ
577 # include <net/slhc_vj.h>
578 #endif
580 #include <linux/ppp_defs.h>
581 #include <linux/if_ppp.h>
582 #include <linux/if_pppvar.h>
584 #include <linux/isdn_ppp.h>
585 #endif
587 #ifdef CONFIG_ISDN_X25
588 # include <linux/concap.h>
589 #endif
591 #ifdef CONFIG_DEVFS_FS
592 # include <linux/devfs_fs_kernel.h>
593 #endif
595 #include <linux/isdnif.h>
597 #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */
599 /* Until now unused */
600 #define ISDN_SERVICE_VOICE 1
601 #define ISDN_SERVICE_AB 1<<1
602 #define ISDN_SERVICE_X21 1<<2
603 #define ISDN_SERVICE_G4 1<<3
604 #define ISDN_SERVICE_BTX 1<<4
605 #define ISDN_SERVICE_DFUE 1<<5
606 #define ISDN_SERVICE_X25 1<<6
607 #define ISDN_SERVICE_TTX 1<<7
608 #define ISDN_SERVICE_MIXED 1<<8
609 #define ISDN_SERVICE_FW 1<<9
610 #define ISDN_SERVICE_GTEL 1<<10
611 #define ISDN_SERVICE_BTXN 1<<11
612 #define ISDN_SERVICE_BTEL 1<<12
614 /* Macros checking plain usage */
615 #define USG_NONE(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NONE)
616 #define USG_RAW(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_RAW)
617 #define USG_MODEM(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM)
618 #define USG_VOICE(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE)
619 #define USG_NET(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NET)
620 #define USG_FAX(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_FAX)
621 #define USG_OUTGOING(x) ((x & ISDN_USAGE_OUTGOING)==ISDN_USAGE_OUTGOING)
622 #define USG_MODEMORVOICE(x) (((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM) || \
623 ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE) )
625 /* Timer-delays and scheduling-flags */
626 #define ISDN_TIMER_RES 3 /* Main Timer-Resolution */
627 #define ISDN_TIMER_02SEC (HZ/(ISDN_TIMER_RES+1)/5) /* Slow-Timer1 .2 sec */
628 #define ISDN_TIMER_1SEC (HZ/(ISDN_TIMER_RES+1)) /* Slow-Timer2 1 sec */
629 #define ISDN_TIMER_RINGING 5 /* tty RINGs = ISDN_TIMER_1SEC * this factor */
630 #define ISDN_TIMER_KEEPINT 10 /* Cisco-Keepalive = ISDN_TIMER_1SEC * this factor */
631 #define ISDN_TIMER_MODEMREAD 1
632 #define ISDN_TIMER_MODEMPLUS 2
633 #define ISDN_TIMER_MODEMRING 4
634 #define ISDN_TIMER_MODEMXMIT 8
635 #define ISDN_TIMER_NETDIAL 16
636 #define ISDN_TIMER_NETHANGUP 32
637 #define ISDN_TIMER_IPPP 64
638 #define ISDN_TIMER_KEEPALIVE 128 /* Cisco-Keepalive */
639 #define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */
640 #define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \
641 ISDN_TIMER_MODEMXMIT)
642 #define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \
643 ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE | \
644 ISDN_TIMER_CARRIER)
646 /* Timeout-Values for isdn_net_dial() */
647 #define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
648 #define ISDN_TIMER_DTIMEOUT15 (15*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
649 #define ISDN_TIMER_DTIMEOUT60 (60*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
651 /* GLOBAL_FLAGS */
652 #define ISDN_GLOBAL_STOPPED 1
654 /*=================== Start of ip-over-ISDN stuff =========================*/
656 /* Feature- and status-flags for a net-interface */
657 #define ISDN_NET_CONNECTED 0x01 /* Bound to ISDN-Channel */
658 #define ISDN_NET_SECURE 0x02 /* Accept calls from phonelist only */
659 #define ISDN_NET_CALLBACK 0x04 /* activate callback */
660 #define ISDN_NET_CBHUP 0x08 /* hangup before callback */
661 #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
663 #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
665 /* Phone-list-element */
666 typedef struct {
667 void *next;
668 char num[ISDN_MSNLEN];
669 } isdn_net_phone;
672 Principles when extending structures for generic encapsulation protocol
673 ("concap") support:
674 - Stuff which is hardware specific (here i4l-specific) goes in
675 the netdev -> local structure (here: isdn_net_local)
676 - Stuff which is encapsulation protocol specific goes in the structure
677 which holds the linux device structure (here: isdn_net_device)
680 /* Local interface-data */
681 typedef struct isdn_net_local_s {
682 ulong magic;
683 char name[10]; /* Name of device */
684 struct enet_statistics stats; /* Ethernet Statistics */
685 int isdn_device; /* Index to isdn-device */
686 int isdn_channel; /* Index to isdn-channel */
687 int ppp_slot; /* PPPD device slot number */
688 int pre_device; /* Preselected isdn-device */
689 int pre_channel; /* Preselected isdn-channel */
690 int exclusive; /* If non-zero idx to reserved chan.*/
691 int flags; /* Connection-flags */
692 int dialretry; /* Counter for Dialout-retries */
693 int dialmax; /* Max. Number of Dial-retries */
694 int cbdelay; /* Delay before Callback starts */
695 int dtimer; /* Timeout-counter for dialing */
696 char msn[ISDN_MSNLEN]; /* MSNs/EAZs for this interface */
697 u_char cbhup; /* Flag: Reject Call before Callback*/
698 u_char dialstate; /* State for dialing */
699 u_char p_encap; /* Packet encapsulation */
700 /* 0 = Ethernet over ISDN */
701 /* 1 = RAW-IP */
702 /* 2 = IP with type field */
703 u_char l2_proto; /* Layer-2-protocol */
704 /* See ISDN_PROTO_L2..-constants in */
705 /* isdnif.h */
706 /* 0 = X75/LAPB with I-Frames */
707 /* 1 = X75/LAPB with UI-Frames */
708 /* 2 = X75/LAPB with BUI-Frames */
709 /* 3 = HDLC */
710 u_char l3_proto; /* Layer-3-protocol */
711 /* See ISDN_PROTO_L3..-constants in */
712 /* isdnif.h */
713 /* 0 = Transparent */
714 int huptimer; /* Timeout-counter for auto-hangup */
715 int charge; /* Counter for charging units */
716 ulong chargetime; /* Timer for Charging info */
717 int hupflags; /* Flags for charge-unit-hangup: */
718 /* bit0: chargeint is invalid */
719 /* bit1: Getting charge-interval */
720 /* bit2: Do charge-unit-hangup */
721 /* bit3: Do hangup even on incoming */
722 int outgoing; /* Flag: outgoing call */
723 int onhtime; /* Time to keep link up */
724 int chargeint; /* Interval between charge-infos */
725 int onum; /* Flag: at least 1 outgoing number */
726 int cps; /* current speed of this interface */
727 int transcount; /* byte-counter for cps-calculation */
728 int sqfull; /* Flag: netdev-queue overloaded */
729 ulong sqfull_stamp; /* Start-Time of overload */
730 ulong slavedelay; /* Dynamic bundling delaytime */
731 int triggercps; /* BogoCPS needed for trigger slave */
732 isdn_net_phone *phone[2]; /* List of remote-phonenumbers */
733 /* phone[0] = Incoming Numbers */
734 /* phone[1] = Outgoing Numbers */
735 isdn_net_phone *dial; /* Pointer to dialed number */
736 struct net_device *master; /* Ptr to Master device for slaves */
737 struct net_device *slave; /* Ptr to Slave device for masters */
738 struct isdn_net_local_s *next; /* Ptr to next link in bundle */
739 struct isdn_net_local_s *last; /* Ptr to last link in bundle */
740 struct isdn_net_dev_s *netdev; /* Ptr to netdev */
741 struct sk_buff_head super_tx_queue; /* List of supervisory frames to */
742 /* be transmitted asap */
743 atomic_t frame_cnt; /* number of frames currently */
744 /* queued in HL driver */
745 /* Ptr to orig. hard_header_cache */
746 spinlock_t xmit_lock; /* used to protect the xmit path of */
747 /* a particular channel (including */
748 /* the frame_cnt */
750 int (*org_hhc)(
751 struct neighbour *neigh,
752 struct hh_cache *hh);
753 /* Ptr to orig. header_cache_update */
754 void (*org_hcu)(struct hh_cache *,
755 struct net_device *,
756 unsigned char *);
757 int pppbind; /* ippp device for bindings */
758 int dialtimeout; /* How long shall we try on dialing? (jiffies) */
759 int dialwait; /* How long shall we wait after failed attempt? (jiffies) */
760 ulong dialstarted; /* jiffies of first dialing-attempt */
761 ulong dialwait_timer; /* jiffies of earliest next dialing-attempt */
762 int huptimeout; /* How long will the connection be up? (seconds) */
763 #ifdef CONFIG_ISDN_X25
764 struct concap_device_ops *dops; /* callbacks used by encapsulator */
765 #endif
766 int cisco_loop; /* Loop counter for Cisco-SLARP */
767 ulong cisco_myseq; /* Local keepalive seq. for Cisco */
768 ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */
769 struct tq_struct tqueue;
770 } isdn_net_local;
772 /* the interface itself */
773 typedef struct isdn_net_dev_s {
774 isdn_net_local *local;
775 isdn_net_local *queue; /* circular list of all bundled
776 channels, which are currently
777 online */
778 spinlock_t queue_lock; /* lock to protect queue */
779 void *next; /* Pointer to next isdn-interface */
780 struct net_device dev; /* interface to upper levels */
781 #ifdef CONFIG_ISDN_PPP
782 struct mpqueue *mp_last;
783 struct ippp_bundle ib;
784 #endif
785 #ifdef CONFIG_ISDN_X25
786 struct concap_proto *cprot; /* connection oriented encapsulation protocol */
787 #endif
789 } isdn_net_dev;
791 /*===================== End of ip-over-ISDN stuff ===========================*/
793 /*======================= Start of ISDN-tty stuff ===========================*/
795 #define ISDN_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking */
796 #define ISDN_ASYNC_INITIALIZED 0x80000000 /* port was initialized */
797 #define ISDN_ASYNC_CALLOUT_ACTIVE 0x40000000 /* Call out device active */
798 #define ISDN_ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device active */
799 #define ISDN_ASYNC_CLOSING 0x08000000 /* Serial port is closing */
800 #define ISDN_ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */
801 #define ISDN_ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */
802 #define ISDN_ASYNC_HUP_NOTIFY 0x0001 /* Notify tty on hangups/closes */
803 #define ISDN_ASYNC_SESSION_LOCKOUT 0x0100 /* Lock cua opens on session */
804 #define ISDN_ASYNC_PGRP_LOCKOUT 0x0200 /* Lock cua opens on pgrp */
805 #define ISDN_ASYNC_CALLOUT_NOHUP 0x0400 /* No hangup for cui */
806 #define ISDN_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */
807 #define ISDN_SERIAL_XMIT_SIZE 1024 /* Default bufsize for write */
808 #define ISDN_SERIAL_XMIT_MAX 4000 /* Maximum bufsize for write */
809 #define ISDN_SERIAL_TYPE_NORMAL 1
810 #define ISDN_SERIAL_TYPE_CALLOUT 2
812 #ifdef CONFIG_ISDN_AUDIO
813 /* For using sk_buffs with audio we need some private variables
814 * within each sk_buff. For this purpose, we declare a struct here,
815 * and put it always at skb->head. A few macros help accessing the
816 * variables. Of course, we need to check skb_headroom prior to
817 * any access.
819 typedef struct isdn_audio_skb {
820 unsigned short dle_count;
821 unsigned char lock;
822 } isdn_audio_skb;
824 #define ISDN_AUDIO_SKB_DLECOUNT(skb) (((isdn_audio_skb*)skb->head)->dle_count)
825 #define ISDN_AUDIO_SKB_LOCK(skb) (((isdn_audio_skb*)skb->head)->lock)
826 #endif
828 /* Private data of AT-command-interpreter */
829 typedef struct atemu {
830 u_char profile[ISDN_MODEM_NUMREG]; /* Modem-Regs. Profile 0 */
831 u_char mdmreg[ISDN_MODEM_NUMREG]; /* Modem-Registers */
832 char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */
833 char msn[ISDN_MSNLEN]; /* EAZ/MSN */
834 char plmsn[ISDN_LMSNLEN]; /* Listening MSNs Profile 0 */
835 char lmsn[ISDN_LMSNLEN]; /* Listening MSNs */
836 char cpn[ISDN_MSNLEN]; /* CalledPartyNumber on incoming call */
837 char connmsg[ISDN_CMSGLEN]; /* CONNECT-Msg from HL-Driver */
838 #ifdef CONFIG_ISDN_AUDIO
839 u_char vpar[10]; /* Voice-parameters */
840 int lastDLE; /* Flag for voice-coding: DLE seen */
841 #endif
842 int mdmcmdl; /* Length of Modem-Commandbuffer */
843 int pluscount; /* Counter for +++ sequence */
844 int lastplus; /* Timestamp of last + */
845 int carrierwait; /* Seconds of carrier waiting */
846 char mdmcmd[255]; /* Modem-Commandbuffer */
847 unsigned int charge; /* Charge units of current connection */
848 } atemu;
850 /* Private data (similar to async_struct in <linux/serial.h>) */
851 typedef struct modem_info {
852 int magic;
853 int flags; /* defined in tty.h */
854 int x_char; /* xon/xoff character */
855 int mcr; /* Modem control register */
856 int msr; /* Modem status register */
857 int lsr; /* Line status register */
858 int line;
859 int count; /* # of fd on device */
860 int blocked_open; /* # of blocked opens */
861 long session; /* Session of opening process */
862 long pgrp; /* pgrp of opening process */
863 int online; /* 1 = B-Channel is up, drop data */
864 /* 2 = B-Channel is up, deliver d.*/
865 int dialing; /* Dial in progress or ATA */
866 int rcvsched; /* Receive needs schedule */
867 int isdn_driver; /* Index to isdn-driver */
868 int isdn_channel; /* Index to isdn-channel */
869 int drv_index; /* Index to dev->usage */
870 int ncarrier; /* Flag: schedule NO CARRIER */
871 unsigned char last_cause[8]; /* Last cause message */
872 unsigned char last_num[ISDN_MSNLEN];
873 /* Last phone-number */
874 unsigned char last_l2; /* Last layer-2 protocol */
875 unsigned char last_si; /* Last service */
876 unsigned char last_lhup; /* Last hangup local? */
877 unsigned char last_dir; /* Last direction (in or out) */
878 struct timer_list nc_timer; /* Timer for delayed NO CARRIER */
879 int send_outstanding;/* # of outstanding send-requests */
880 int xmit_size; /* max. # of chars in xmit_buf */
881 int xmit_count; /* # of chars in xmit_buf */
882 unsigned char *xmit_buf; /* transmit buffer */
883 struct sk_buff_head xmit_queue; /* transmit queue */
884 atomic_t xmit_lock; /* Semaphore for isdn_tty_write */
885 #ifdef CONFIG_ISDN_AUDIO
886 int vonline; /* Voice-channel status */
887 /* Bit 0 = recording */
888 /* Bit 1 = playback */
889 /* Bit 2 = playback, DLE-ETX seen */
890 struct sk_buff_head dtmf_queue; /* queue for dtmf results */
891 void *adpcms; /* state for adpcm decompression */
892 void *adpcmr; /* state for adpcm compression */
893 void *dtmf_state; /* state for dtmf decoder */
894 void *silence_state; /* state for silence detection */
895 #endif
896 #ifdef CONFIG_ISDN_TTY_FAX
897 struct T30_s *fax; /* T30 Fax Group 3 data/interface */
898 int faxonline; /* Fax-channel status */
899 #endif
900 struct tty_struct *tty; /* Pointer to corresponding tty */
901 atemu emu; /* AT-emulator data */
902 struct termios normal_termios; /* For saving termios structs */
903 struct termios callout_termios;
904 wait_queue_head_t open_wait, close_wait;
905 struct semaphore write_sem;
906 } modem_info;
908 #define ISDN_MODEM_WINSIZE 8
910 /* Description of one ISDN-tty */
911 typedef struct {
912 int refcount; /* Number of opens */
913 struct tty_driver tty_modem; /* tty-device */
914 struct tty_driver cua_modem; /* cua-device */
915 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
916 struct termios *modem_termios[ISDN_MAX_CHANNELS];
917 struct termios *modem_termios_locked[ISDN_MAX_CHANNELS];
918 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
919 } modem;
921 /*======================= End of ISDN-tty stuff ============================*/
923 /*======================== Start of V.110 stuff ============================*/
924 #define V110_BUFSIZE 1024
926 typedef struct {
927 int nbytes; /* 1 Matrixbyte -> nbytes in stream */
928 int nbits; /* Number of used bits in streambyte */
929 unsigned char key; /* Bitmask in stream eg. 11 (nbits=2) */
930 int decodelen; /* Amount of data in decodebuf */
931 int SyncInit; /* Number of sync frames to send */
932 unsigned char *OnlineFrame; /* Precalculated V110 idle frame */
933 unsigned char *OfflineFrame; /* Precalculated V110 sync Frame */
934 int framelen; /* Length of frames */
935 int skbuser; /* Number of unacked userdata skbs */
936 int skbidle; /* Number of unacked idle/sync skbs */
937 int introducer; /* Local vars for decoder */
938 int dbit;
939 unsigned char b;
940 int skbres; /* space to reserve in outgoing skb */
941 int maxsize; /* maxbufsize of lowlevel driver */
942 unsigned char *encodebuf; /* temporary buffer for encoding */
943 unsigned char decodebuf[V110_BUFSIZE]; /* incomplete V110 matrices */
944 } isdn_v110_stream;
946 /*========================= End of V.110 stuff =============================*/
948 /*======================= Start of general stuff ===========================*/
950 typedef struct {
951 char *next;
952 char *private;
953 } infostruct;
955 typedef struct isdn_module {
956 struct isdn_module *prev;
957 struct isdn_module *next;
958 char *name;
959 int (*get_free_channel)(int, int, int, int, int);
960 int (*free_channel)(int, int, int);
961 int (*status_callback)(isdn_ctrl *);
962 int (*command)(isdn_ctrl *);
963 int (*receive_callback)(int, int, struct sk_buff *);
964 int (*writebuf_skb)(int, int, int, struct sk_buff *);
965 int (*net_start_xmit)(struct sk_buff *, struct net_device *);
966 int (*net_receive)(struct net_device *, struct sk_buff *);
967 int (*net_open)(struct net_device *);
968 int (*net_close)(struct net_device *);
969 int priority;
970 } isdn_module;
972 #define DRV_FLAG_RUNNING 1
973 #define DRV_FLAG_REJBUS 2
974 #define DRV_FLAG_LOADED 4
976 /* Description of hardware-level-driver */
977 typedef struct {
978 ulong online; /* Channel-Online flags */
979 ulong flags; /* Misc driver Flags */
980 int locks; /* Number of locks for this driver */
981 int channels; /* Number of channels */
982 wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */
983 int maxbufsize; /* Maximum Buffersize supported */
984 unsigned long pktcount; /* Until now: unused */
985 int stavail; /* Chars avail on Status-device */
986 isdn_if *interface; /* Interface to driver */
987 int *rcverr; /* Error-counters for B-Ch.-receive */
988 int *rcvcount; /* Byte-counters for B-Ch.-receive */
989 #ifdef CONFIG_ISDN_AUDIO
990 unsigned long DLEflag; /* Flags: Insert DLE at next read */
991 #endif
992 struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */
993 wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */
994 wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */
995 char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */
996 } driver;
998 /* Main driver-data */
999 typedef struct isdn_devt {
1000 unsigned short flags; /* Bitmapped Flags: */
1001 /* */
1002 int drivers; /* Current number of drivers */
1003 int channels; /* Current number of channels */
1004 int net_verbose; /* Verbose-Flag */
1005 int modempoll; /* Flag: tty-read active */
1006 int tflags; /* Timer-Flags: */
1007 /* see ISDN_TIMER_..defines */
1008 int global_flags;
1009 infostruct *infochain; /* List of open info-devs. */
1010 wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
1011 struct timer_list timer; /* Misc.-function Timer */
1012 int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
1013 int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
1014 int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
1015 char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
1016 /* Remote number of active ch.*/
1017 int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
1018 driver *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */
1019 isdn_net_dev *netdev; /* Linked list of net-if's */
1020 char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */
1021 struct task_struct *profd; /* For iprofd */
1022 modem mdm; /* tty-driver-data */
1023 isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */
1024 isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */
1025 ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */
1026 ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */
1027 int v110emu[ISDN_MAX_CHANNELS];/* V.110 emulator-mode 0=none */
1028 atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */
1029 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
1030 struct semaphore sem; /* serialize list access*/
1031 isdn_module *modules;
1032 unsigned long global_features;
1033 #ifdef CONFIG_DEVFS_FS
1034 devfs_handle_t devfs_handle_isdninfo;
1035 devfs_handle_t devfs_handle_isdnctrl;
1036 devfs_handle_t devfs_handle_isdnX[ISDN_MAX_CHANNELS];
1037 devfs_handle_t devfs_handle_isdnctrlX[ISDN_MAX_CHANNELS];
1038 #ifdef CONFIG_ISDN_PPP
1039 devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS];
1040 #endif
1041 #endif /* CONFIG_DEVFS_FS */
1042 } isdn_dev;
1044 extern isdn_dev *dev;
1048 /* Utility-Macros */
1049 #define MIN(a,b) ((a<b)?a:b)
1050 #define MAX(a,b) ((a>b)?a:b)
1051 #endif /* __KERNEL__ */
1052 #endif /* isdn_h */