isdn.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. /* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
  2. *
  3. * Main header for the Linux ISDN subsystem (linklevel).
  4. *
  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 software may be used and distributed according to the terms
  10. * of the GNU General Public License, incorporated herein by reference.
  11. *
  12. */
  13. #ifndef __ISDN_H__
  14. #define __ISDN_H__
  15. #include <linux/errno.h>
  16. #include <linux/fs.h>
  17. #include <linux/major.h>
  18. #include <asm/io.h>
  19. #include <linux/kernel.h>
  20. #include <linux/signal.h>
  21. #include <linux/slab.h>
  22. #include <linux/timer.h>
  23. #include <linux/wait.h>
  24. #include <linux/tty.h>
  25. #include <linux/tty_flip.h>
  26. #include <linux/serial_reg.h>
  27. #include <linux/fcntl.h>
  28. #include <linux/types.h>
  29. #include <linux/interrupt.h>
  30. #include <linux/ip.h>
  31. #include <linux/in.h>
  32. #include <linux/netdevice.h>
  33. #include <linux/etherdevice.h>
  34. #include <linux/skbuff.h>
  35. #include <linux/tcp.h>
  36. #include <linux/mutex.h>
  37. #include <uapi/linux/isdn.h>
  38. #define ISDN_TTY_MAJOR 43
  39. #define ISDN_TTYAUX_MAJOR 44
  40. #define ISDN_MAJOR 45
  41. /* The minor-devicenumbers for Channel 0 and 1 are used as arguments for
  42. * physical Channel-Mapping, so they MUST NOT be changed without changing
  43. * the correspondent code in isdn.c
  44. */
  45. #define ISDN_MINOR_B 0
  46. #define ISDN_MINOR_BMAX (ISDN_MAX_CHANNELS-1)
  47. #define ISDN_MINOR_CTRL 64
  48. #define ISDN_MINOR_CTRLMAX (64 + (ISDN_MAX_CHANNELS-1))
  49. #define ISDN_MINOR_PPP 128
  50. #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
  51. #define ISDN_MINOR_STATUS 255
  52. #ifdef CONFIG_ISDN_PPP
  53. #ifdef CONFIG_ISDN_PPP_VJ
  54. # include <net/slhc_vj.h>
  55. #endif
  56. #include <linux/ppp_defs.h>
  57. #include <linux/ppp-ioctl.h>
  58. #include <linux/isdn_ppp.h>
  59. #endif
  60. #ifdef CONFIG_ISDN_X25
  61. # include <linux/concap.h>
  62. #endif
  63. #include <linux/isdnif.h>
  64. #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */
  65. /* Until now unused */
  66. #define ISDN_SERVICE_VOICE 1
  67. #define ISDN_SERVICE_AB 1<<1
  68. #define ISDN_SERVICE_X21 1<<2
  69. #define ISDN_SERVICE_G4 1<<3
  70. #define ISDN_SERVICE_BTX 1<<4
  71. #define ISDN_SERVICE_DFUE 1<<5
  72. #define ISDN_SERVICE_X25 1<<6
  73. #define ISDN_SERVICE_TTX 1<<7
  74. #define ISDN_SERVICE_MIXED 1<<8
  75. #define ISDN_SERVICE_FW 1<<9
  76. #define ISDN_SERVICE_GTEL 1<<10
  77. #define ISDN_SERVICE_BTXN 1<<11
  78. #define ISDN_SERVICE_BTEL 1<<12
  79. /* Macros checking plain usage */
  80. #define USG_NONE(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NONE)
  81. #define USG_RAW(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_RAW)
  82. #define USG_MODEM(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM)
  83. #define USG_VOICE(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE)
  84. #define USG_NET(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NET)
  85. #define USG_FAX(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_FAX)
  86. #define USG_OUTGOING(x) ((x & ISDN_USAGE_OUTGOING)==ISDN_USAGE_OUTGOING)
  87. #define USG_MODEMORVOICE(x) (((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM) || \
  88. ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE) )
  89. /* Timer-delays and scheduling-flags */
  90. #define ISDN_TIMER_RES 4 /* Main Timer-Resolution */
  91. #define ISDN_TIMER_02SEC (HZ/ISDN_TIMER_RES/5) /* Slow-Timer1 .2 sec */
  92. #define ISDN_TIMER_1SEC (HZ/ISDN_TIMER_RES) /* Slow-Timer2 1 sec */
  93. #define ISDN_TIMER_RINGING 5 /* tty RINGs = ISDN_TIMER_1SEC * this factor */
  94. #define ISDN_TIMER_KEEPINT 10 /* Cisco-Keepalive = ISDN_TIMER_1SEC * this factor */
  95. #define ISDN_TIMER_MODEMREAD 1
  96. #define ISDN_TIMER_MODEMPLUS 2
  97. #define ISDN_TIMER_MODEMRING 4
  98. #define ISDN_TIMER_MODEMXMIT 8
  99. #define ISDN_TIMER_NETDIAL 16
  100. #define ISDN_TIMER_NETHANGUP 32
  101. #define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */
  102. #define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \
  103. ISDN_TIMER_MODEMXMIT)
  104. #define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \
  105. ISDN_TIMER_NETDIAL | ISDN_TIMER_CARRIER)
  106. /* Timeout-Values for isdn_net_dial() */
  107. #define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
  108. #define ISDN_TIMER_DTIMEOUT15 (15*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
  109. #define ISDN_TIMER_DTIMEOUT60 (60*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
  110. /* GLOBAL_FLAGS */
  111. #define ISDN_GLOBAL_STOPPED 1
  112. /*=================== Start of ip-over-ISDN stuff =========================*/
  113. /* Feature- and status-flags for a net-interface */
  114. #define ISDN_NET_CONNECTED 0x01 /* Bound to ISDN-Channel */
  115. #define ISDN_NET_SECURE 0x02 /* Accept calls from phonelist only */
  116. #define ISDN_NET_CALLBACK 0x04 /* activate callback */
  117. #define ISDN_NET_CBHUP 0x08 /* hangup before callback */
  118. #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
  119. #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
  120. /* Phone-list-element */
  121. typedef struct {
  122. void *next;
  123. char num[ISDN_MSNLEN];
  124. } isdn_net_phone;
  125. /*
  126. Principles when extending structures for generic encapsulation protocol
  127. ("concap") support:
  128. - Stuff which is hardware specific (here i4l-specific) goes in
  129. the netdev -> local structure (here: isdn_net_local)
  130. - Stuff which is encapsulation protocol specific goes in the structure
  131. which holds the linux device structure (here: isdn_net_device)
  132. */
  133. /* Local interface-data */
  134. typedef struct isdn_net_local_s {
  135. ulong magic;
  136. struct net_device_stats stats; /* Ethernet Statistics */
  137. int isdn_device; /* Index to isdn-device */
  138. int isdn_channel; /* Index to isdn-channel */
  139. int ppp_slot; /* PPPD device slot number */
  140. int pre_device; /* Preselected isdn-device */
  141. int pre_channel; /* Preselected isdn-channel */
  142. int exclusive; /* If non-zero idx to reserved chan.*/
  143. int flags; /* Connection-flags */
  144. int dialretry; /* Counter for Dialout-retries */
  145. int dialmax; /* Max. Number of Dial-retries */
  146. int cbdelay; /* Delay before Callback starts */
  147. int dtimer; /* Timeout-counter for dialing */
  148. char msn[ISDN_MSNLEN]; /* MSNs/EAZs for this interface */
  149. u_char cbhup; /* Flag: Reject Call before Callback*/
  150. u_char dialstate; /* State for dialing */
  151. u_char p_encap; /* Packet encapsulation */
  152. /* 0 = Ethernet over ISDN */
  153. /* 1 = RAW-IP */
  154. /* 2 = IP with type field */
  155. u_char l2_proto; /* Layer-2-protocol */
  156. /* See ISDN_PROTO_L2..-constants in */
  157. /* isdnif.h */
  158. /* 0 = X75/LAPB with I-Frames */
  159. /* 1 = X75/LAPB with UI-Frames */
  160. /* 2 = X75/LAPB with BUI-Frames */
  161. /* 3 = HDLC */
  162. u_char l3_proto; /* Layer-3-protocol */
  163. /* See ISDN_PROTO_L3..-constants in */
  164. /* isdnif.h */
  165. /* 0 = Transparent */
  166. int huptimer; /* Timeout-counter for auto-hangup */
  167. int charge; /* Counter for charging units */
  168. ulong chargetime; /* Timer for Charging info */
  169. int hupflags; /* Flags for charge-unit-hangup: */
  170. /* bit0: chargeint is invalid */
  171. /* bit1: Getting charge-interval */
  172. /* bit2: Do charge-unit-hangup */
  173. /* bit3: Do hangup even on incoming */
  174. int outgoing; /* Flag: outgoing call */
  175. int onhtime; /* Time to keep link up */
  176. int chargeint; /* Interval between charge-infos */
  177. int onum; /* Flag: at least 1 outgoing number */
  178. int cps; /* current speed of this interface */
  179. int transcount; /* byte-counter for cps-calculation */
  180. int sqfull; /* Flag: netdev-queue overloaded */
  181. ulong sqfull_stamp; /* Start-Time of overload */
  182. ulong slavedelay; /* Dynamic bundling delaytime */
  183. int triggercps; /* BogoCPS needed for trigger slave */
  184. isdn_net_phone *phone[2]; /* List of remote-phonenumbers */
  185. /* phone[0] = Incoming Numbers */
  186. /* phone[1] = Outgoing Numbers */
  187. isdn_net_phone *dial; /* Pointer to dialed number */
  188. struct net_device *master; /* Ptr to Master device for slaves */
  189. struct net_device *slave; /* Ptr to Slave device for masters */
  190. struct isdn_net_local_s *next; /* Ptr to next link in bundle */
  191. struct isdn_net_local_s *last; /* Ptr to last link in bundle */
  192. struct isdn_net_dev_s *netdev; /* Ptr to netdev */
  193. struct sk_buff_head super_tx_queue; /* List of supervisory frames to */
  194. /* be transmitted asap */
  195. atomic_t frame_cnt; /* number of frames currently */
  196. /* queued in HL driver */
  197. /* Ptr to orig. hard_header_cache */
  198. spinlock_t xmit_lock; /* used to protect the xmit path of */
  199. /* a particular channel (including */
  200. /* the frame_cnt */
  201. int pppbind; /* ippp device for bindings */
  202. int dialtimeout; /* How long shall we try on dialing? (jiffies) */
  203. int dialwait; /* How long shall we wait after failed attempt? (jiffies) */
  204. ulong dialstarted; /* jiffies of first dialing-attempt */
  205. ulong dialwait_timer; /* jiffies of earliest next dialing-attempt */
  206. int huptimeout; /* How long will the connection be up? (seconds) */
  207. #ifdef CONFIG_ISDN_X25
  208. struct concap_device_ops *dops; /* callbacks used by encapsulator */
  209. #endif
  210. /* use an own struct for that in later versions */
  211. ulong cisco_myseq; /* Local keepalive seq. for Cisco */
  212. ulong cisco_mineseen; /* returned keepalive seq. from remote */
  213. ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */
  214. int cisco_keepalive_period; /* keepalive period */
  215. ulong cisco_last_slarp_in; /* jiffie of last keepalive packet we received */
  216. char cisco_line_state; /* state of line according to keepalive packets */
  217. char cisco_debserint; /* debugging flag of cisco hdlc with slarp */
  218. struct timer_list cisco_timer;
  219. struct work_struct tqueue;
  220. } isdn_net_local;
  221. /* the interface itself */
  222. typedef struct isdn_net_dev_s {
  223. isdn_net_local *local;
  224. isdn_net_local *queue; /* circular list of all bundled
  225. channels, which are currently
  226. online */
  227. spinlock_t queue_lock; /* lock to protect queue */
  228. void *next; /* Pointer to next isdn-interface */
  229. struct net_device *dev; /* interface to upper levels */
  230. #ifdef CONFIG_ISDN_PPP
  231. ippp_bundle * pb; /* pointer to the common bundle structure
  232. * with the per-bundle data */
  233. #endif
  234. #ifdef CONFIG_ISDN_X25
  235. struct concap_proto *cprot; /* connection oriented encapsulation protocol */
  236. #endif
  237. } isdn_net_dev;
  238. /*===================== End of ip-over-ISDN stuff ===========================*/
  239. /*======================= Start of ISDN-tty stuff ===========================*/
  240. #define ISDN_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking */
  241. #define ISDN_SERIAL_XMIT_SIZE 1024 /* Default bufsize for write */
  242. #define ISDN_SERIAL_XMIT_MAX 4000 /* Maximum bufsize for write */
  243. #ifdef CONFIG_ISDN_AUDIO
  244. /* For using sk_buffs with audio we need some private variables
  245. * within each sk_buff. For this purpose, we declare a struct here,
  246. * and put it always at the private skb->cb data array. A few macros help
  247. * accessing the variables.
  248. */
  249. typedef struct _isdn_audio_data {
  250. unsigned short dle_count;
  251. unsigned char lock;
  252. } isdn_audio_data_t;
  253. #define ISDN_AUDIO_SKB_DLECOUNT(skb) (((isdn_audio_data_t *)&skb->cb[0])->dle_count)
  254. #define ISDN_AUDIO_SKB_LOCK(skb) (((isdn_audio_data_t *)&skb->cb[0])->lock)
  255. #endif
  256. /* Private data of AT-command-interpreter */
  257. typedef struct atemu {
  258. u_char profile[ISDN_MODEM_NUMREG]; /* Modem-Regs. Profile 0 */
  259. u_char mdmreg[ISDN_MODEM_NUMREG]; /* Modem-Registers */
  260. char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */
  261. char msn[ISDN_MSNLEN]; /* EAZ/MSN */
  262. char plmsn[ISDN_LMSNLEN]; /* Listening MSNs Profile 0 */
  263. char lmsn[ISDN_LMSNLEN]; /* Listening MSNs */
  264. char cpn[ISDN_MSNLEN]; /* CalledPartyNumber on incoming call */
  265. char connmsg[ISDN_CMSGLEN]; /* CONNECT-Msg from HL-Driver */
  266. #ifdef CONFIG_ISDN_AUDIO
  267. u_char vpar[10]; /* Voice-parameters */
  268. int lastDLE; /* Flag for voice-coding: DLE seen */
  269. #endif
  270. int mdmcmdl; /* Length of Modem-Commandbuffer */
  271. int pluscount; /* Counter for +++ sequence */
  272. u_long lastplus; /* Timestamp of last + */
  273. int carrierwait; /* Seconds of carrier waiting */
  274. char mdmcmd[255]; /* Modem-Commandbuffer */
  275. unsigned int charge; /* Charge units of current connection */
  276. } atemu;
  277. /* Private data (similar to async_struct in <linux/serial.h>) */
  278. typedef struct modem_info {
  279. int magic;
  280. struct tty_port port;
  281. int x_char; /* xon/xoff character */
  282. int mcr; /* Modem control register */
  283. int msr; /* Modem status register */
  284. int lsr; /* Line status register */
  285. int line;
  286. int online; /* 1 = B-Channel is up, drop data */
  287. /* 2 = B-Channel is up, deliver d.*/
  288. int dialing; /* Dial in progress or ATA */
  289. int rcvsched; /* Receive needs schedule */
  290. int isdn_driver; /* Index to isdn-driver */
  291. int isdn_channel; /* Index to isdn-channel */
  292. int drv_index; /* Index to dev->usage */
  293. int ncarrier; /* Flag: schedule NO CARRIER */
  294. unsigned char last_cause[8]; /* Last cause message */
  295. unsigned char last_num[ISDN_MSNLEN];
  296. /* Last phone-number */
  297. unsigned char last_l2; /* Last layer-2 protocol */
  298. unsigned char last_si; /* Last service */
  299. unsigned char last_lhup; /* Last hangup local? */
  300. unsigned char last_dir; /* Last direction (in or out) */
  301. struct timer_list nc_timer; /* Timer for delayed NO CARRIER */
  302. int send_outstanding;/* # of outstanding send-requests */
  303. int xmit_size; /* max. # of chars in xmit_buf */
  304. int xmit_count; /* # of chars in xmit_buf */
  305. struct sk_buff_head xmit_queue; /* transmit queue */
  306. atomic_t xmit_lock; /* Semaphore for isdn_tty_write */
  307. #ifdef CONFIG_ISDN_AUDIO
  308. int vonline; /* Voice-channel status */
  309. /* Bit 0 = recording */
  310. /* Bit 1 = playback */
  311. /* Bit 2 = playback, DLE-ETX seen */
  312. struct sk_buff_head dtmf_queue; /* queue for dtmf results */
  313. void *adpcms; /* state for adpcm decompression */
  314. void *adpcmr; /* state for adpcm compression */
  315. void *dtmf_state; /* state for dtmf decoder */
  316. void *silence_state; /* state for silence detection */
  317. #endif
  318. #ifdef CONFIG_ISDN_TTY_FAX
  319. struct T30_s *fax; /* T30 Fax Group 3 data/interface */
  320. int faxonline; /* Fax-channel status */
  321. #endif
  322. atemu emu; /* AT-emulator data */
  323. spinlock_t readlock;
  324. } modem_info;
  325. #define ISDN_MODEM_WINSIZE 8
  326. /* Description of one ISDN-tty */
  327. typedef struct _isdn_modem {
  328. int refcount; /* Number of opens */
  329. struct tty_driver *tty_modem; /* tty-device */
  330. struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
  331. struct ktermios *modem_termios[ISDN_MAX_CHANNELS];
  332. struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS];
  333. modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
  334. } isdn_modem_t;
  335. /*======================= End of ISDN-tty stuff ============================*/
  336. /*======================== Start of V.110 stuff ============================*/
  337. #define V110_BUFSIZE 1024
  338. typedef struct {
  339. int nbytes; /* 1 Matrixbyte -> nbytes in stream */
  340. int nbits; /* Number of used bits in streambyte */
  341. unsigned char key; /* Bitmask in stream eg. 11 (nbits=2) */
  342. int decodelen; /* Amount of data in decodebuf */
  343. int SyncInit; /* Number of sync frames to send */
  344. unsigned char *OnlineFrame; /* Precalculated V110 idle frame */
  345. unsigned char *OfflineFrame; /* Precalculated V110 sync Frame */
  346. int framelen; /* Length of frames */
  347. int skbuser; /* Number of unacked userdata skbs */
  348. int skbidle; /* Number of unacked idle/sync skbs */
  349. int introducer; /* Local vars for decoder */
  350. int dbit;
  351. unsigned char b;
  352. int skbres; /* space to reserve in outgoing skb */
  353. int maxsize; /* maxbufsize of lowlevel driver */
  354. unsigned char *encodebuf; /* temporary buffer for encoding */
  355. unsigned char decodebuf[V110_BUFSIZE]; /* incomplete V110 matrices */
  356. } isdn_v110_stream;
  357. /*========================= End of V.110 stuff =============================*/
  358. /*======================= Start of general stuff ===========================*/
  359. typedef struct {
  360. char *next;
  361. char *private;
  362. } infostruct;
  363. #define DRV_FLAG_RUNNING 1
  364. #define DRV_FLAG_REJBUS 2
  365. #define DRV_FLAG_LOADED 4
  366. /* Description of hardware-level-driver */
  367. typedef struct _isdn_driver {
  368. ulong online; /* Channel-Online flags */
  369. ulong flags; /* Misc driver Flags */
  370. int locks; /* Number of locks for this driver */
  371. int channels; /* Number of channels */
  372. wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */
  373. int maxbufsize; /* Maximum Buffersize supported */
  374. unsigned long pktcount; /* Until now: unused */
  375. int stavail; /* Chars avail on Status-device */
  376. isdn_if *interface; /* Interface to driver */
  377. int *rcverr; /* Error-counters for B-Ch.-receive */
  378. int *rcvcount; /* Byte-counters for B-Ch.-receive */
  379. #ifdef CONFIG_ISDN_AUDIO
  380. unsigned long DLEflag; /* Flags: Insert DLE at next read */
  381. #endif
  382. struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */
  383. wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */
  384. wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */
  385. char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */
  386. } isdn_driver_t;
  387. /* Main driver-data */
  388. typedef struct isdn_devt {
  389. struct module *owner;
  390. spinlock_t lock;
  391. unsigned short flags; /* Bitmapped Flags: */
  392. int drivers; /* Current number of drivers */
  393. int channels; /* Current number of channels */
  394. int net_verbose; /* Verbose-Flag */
  395. int modempoll; /* Flag: tty-read active */
  396. spinlock_t timerlock;
  397. int tflags; /* Timer-Flags: */
  398. /* see ISDN_TIMER_..defines */
  399. int global_flags;
  400. infostruct *infochain; /* List of open info-devs. */
  401. wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
  402. struct timer_list timer; /* Misc.-function Timer */
  403. int chanmap[ISDN_MAX_CHANNELS]; /* Map minor->device-channel */
  404. int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
  405. int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
  406. char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
  407. /* Remote number of active ch.*/
  408. int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
  409. isdn_driver_t *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */
  410. isdn_net_dev *netdev; /* Linked list of net-if's */
  411. char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */
  412. struct task_struct *profd; /* For iprofd */
  413. isdn_modem_t mdm; /* tty-driver-data */
  414. isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */
  415. isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */
  416. ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */
  417. ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */
  418. int v110emu[ISDN_MAX_CHANNELS]; /* V.110 emulator-mode 0=none */
  419. atomic_t v110use[ISDN_MAX_CHANNELS]; /* Usage-Semaphore for stream */
  420. isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
  421. struct mutex mtx; /* serialize list access*/
  422. unsigned long global_features;
  423. } isdn_dev;
  424. extern isdn_dev *dev;
  425. #endif /* __ISDN_H__ */