root/include/linux/isdn.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /* $Id: isdn.h,v 1.2 1996/02/11 02:10:02 fritz Exp fritz $
   2  *
   3  * Main header for the Linux ISDN subsystem (linklevel).
   4  *
   5  * Copyright 1994,95,96 by Fritz Elfert (fritz@wuemaus.franken.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.
  13  *
  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.
  18  *
  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. 
  22  *
  23  * $Log: isdn.h,v $
  24  * Revision 1.2  1996/02/11 02:10:02  fritz
  25  * Changed IOCTL-names
  26  * Added rx_netdev, st_netdev, first_skb, org_hcb, and org_hcu to
  27  * Netdevice-local struct.
  28  *
  29  * Revision 1.1  1996/01/10 20:55:07  fritz
  30  * Initial revision
  31  *
  32  */
  33 
  34 #ifndef isdn_h
  35 #define isdn_h
  36 
  37 #include <linux/ioctl.h>
  38 
  39 #define ISDN_TTY_MAJOR    43
  40 #define ISDN_TTYAUX_MAJOR 44
  41 #define ISDN_MAJOR        45
  42 
  43 /* The minor-devicenumbers for Channel 0 and 1 are used as arguments for
  44  * physical Channel-Mapping, so they MUST NOT be changed without changing
  45  * the correspondent code in isdn.c
  46  */
  47 
  48 #define ISDN_MAX_DRIVERS    16
  49 #define ISDN_MAX_CHANNELS   16
  50 #define ISDN_MINOR_B        0
  51 #define ISDN_MINOR_BMAX     (ISDN_MAX_CHANNELS-1)
  52 #define ISDN_MINOR_CTRL     ISDN_MAX_CHANNELS
  53 #define ISDN_MINOR_CTRLMAX  (2*ISDN_MAX_CHANNELS-1)
  54 #define ISDN_MINOR_PPP      (2*ISDN_MAX_CHANNELS)
  55 #define ISDN_MINOR_PPPMAX   (3*ISDN_MAX_CHANNELS-1)
  56 #define ISDN_MINOR_STATUS   128
  57 
  58 /* New ioctl-codes */
  59 #define IIOCNETAIF  _IO('I',1)
  60 #define IIOCNETDIF  _IO('I',2)
  61 #define IIOCNETSCF  _IO('I',3)
  62 #define IIOCNETGCF  _IO('I',4)
  63 #define IIOCNETANM  _IO('I',5)
  64 #define IIOCNETDNM  _IO('I',6)
  65 #define IIOCNETGNM  _IO('I',7)
  66 #define IIOCGETSET  _IO('I',8)
  67 #define IIOCSETSET  _IO('I',9)
  68 #define IIOCSETVER  _IO('I',10)
  69 #define IIOCNETHUP  _IO('I',11)
  70 #define IIOCSETGST  _IO('I',12)
  71 #define IIOCSETBRJ  _IO('I',13)
  72 #define IIOCSIGPRF  _IO('I',14)
  73 #define IIOCGETPRF  _IO('I',15)
  74 #define IIOCSETPRF  _IO('I',16)
  75 #define IIOCGETMAP  _IO('I',17)
  76 #define IIOCSETMAP  _IO('I',18)
  77 #define IIOCNETASL  _IO('I',19)
  78 #define IIOCNETDIL  _IO('I',20)
  79 
  80 #define IIOCNETALN  _IO('I',32)
  81 #define IIOCNETDLN  _IO('I',33)
  82 
  83 #define IIOCDBGVAR  _IO('I',127)
  84 
  85 #define IIOCDRVCTL  _IO('I',128)
  86 
  87 /* Packet encapsulations for net-interfaces */
  88 #define ISDN_NET_ENCAP_ETHER     0
  89 #define ISDN_NET_ENCAP_RAWIP     1
  90 #define ISDN_NET_ENCAP_IPTYP     2
  91 #define ISDN_NET_ENCAP_CISCOHDLC 3
  92 #define ISDN_NET_ENCAP_SYNCPPP   4
  93 
  94 /* Facility which currently uses an ISDN-channel */
  95 #define ISDN_USAGE_NONE       0
  96 #define ISDN_USAGE_RAW        1
  97 #define ISDN_USAGE_MODEM      2
  98 #define ISDN_USAGE_NET        3
  99 #define ISDN_USAGE_VOICE      4
 100 #define ISDN_USAGE_FAX        5
 101 #define ISDN_USAGE_MASK       7 /* Mask to get plain usage */
 102 #define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
 103 #define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing  */
 104 
 105 #define ISDN_MODEM_ANZREG    20        /* Number of Modem-Registers        */
 106 #define ISDN_MSNLEN          20
 107 
 108 typedef struct {
 109   char drvid[25];
 110   unsigned long arg;
 111 } isdn_ioctl_struct;
 112 
 113 typedef struct {
 114   unsigned long isdndev;
 115   unsigned long atmodem[ISDN_MAX_CHANNELS];
 116   unsigned long info[ISDN_MAX_CHANNELS];
 117 } debugvar_addr;
 118 
 119 typedef struct {
 120   char name[10];
 121   char phone[20];
 122   int  outgoing;
 123 } isdn_net_ioctl_phone;
 124 
 125 typedef struct {
 126   char name[10];     /* Name of interface                     */
 127   char master[10];   /* Name of Master for Bundling           */
 128   char slave[10];    /* Name of Slave for Bundling            */
 129   char eaz[256];     /* EAZ/MSN                               */
 130   char drvid[25];    /* DriverId for Bindings                 */
 131   int  secure;       /* Flag: Secure                          */
 132   int  callback;     /* Flag: Callback                        */
 133   int  onhtime;      /* Hangup-Timeout                        */
 134   int  charge;       /* Charge-Units                          */
 135   int  chargehup;    /* Flag: Charge-Hangup                   */
 136   int  l2_proto;     /* Layer-2 protocol                      */
 137   int  l3_proto;     /* Layer-3 protocol                      */
 138   int  p_encap;      /* Encapsulation                         */
 139   int  ihup;         /* Flag: Hangup-Timeout on incoming line */
 140   int  exclusive;    /* Channel, if bound exclusive           */
 141   int  slavedelay;   /* Delay until slave starts up           */
 142 } isdn_net_ioctl_cfg;
 143 
 144 #ifdef __KERNEL__
 145 
 146 #ifndef STANDALONE
 147 #include <linux/config.h>
 148 #endif
 149 #include <linux/errno.h>
 150 #include <linux/fs.h>
 151 #include <linux/major.h>
 152 #include <asm/segment.h>
 153 #include <asm/io.h>
 154 #include <linux/kernel.h>
 155 #include <linux/signal.h>
 156 #include <linux/malloc.h>
 157 #include <linux/mm.h>
 158 #include <linux/timer.h>
 159 #include <linux/wait.h>
 160 #include <linux/tty.h>
 161 #include <linux/tty_flip.h>
 162 #include <linux/serial_reg.h>
 163 #include <linux/fcntl.h>
 164 #include <linux/types.h>
 165 #include <linux/interrupt.h>
 166 #include <linux/ip.h>
 167 #include <linux/in.h>
 168 #include <linux/netdevice.h>
 169 #include <linux/etherdevice.h>
 170 #include <linux/skbuff.h>
 171 #include <linux/tcp.h>
 172 
 173 #ifdef CONFIG_ISDN_PPP
 174 
 175 #ifdef CONFIG_ISDN_PPP_VJ
 176 #  include "/usr/src/linux/drivers/net/slhc.h"
 177 #endif
 178 
 179 #include <linux/ppp_defs.h>
 180 #include <linux/if_ppp.h>
 181 #include <linux/if_pppvar.h>
 182 
 183 #include <linux/isdn_ppp.h>
 184 #endif
 185 
 186 #include <linux/isdnif.h>
 187 
 188 #define ISDN_DRVIOCTL_MASK       0x7f  /* Mask for Device-ioctl */
 189 
 190 /* Until now unused */
 191 #define ISDN_SERVICE_VOICE 1
 192 #define ISDN_SERVICE_AB    1<<1 
 193 #define ISDN_SERVICE_X21   1<<2
 194 #define ISDN_SERVICE_G4    1<<3
 195 #define ISDN_SERVICE_BTX   1<<4
 196 #define ISDN_SERVICE_DFUE  1<<5
 197 #define ISDN_SERVICE_X25   1<<6
 198 #define ISDN_SERVICE_TTX   1<<7
 199 #define ISDN_SERVICE_MIXED 1<<8
 200 #define ISDN_SERVICE_FW    1<<9
 201 #define ISDN_SERVICE_GTEL  1<<10
 202 #define ISDN_SERVICE_BTXN  1<<11
 203 #define ISDN_SERVICE_BTEL  1<<12
 204 
 205 /* Macros checking plain usage */
 206 #define USG_NONE(x)     ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NONE)
 207 #define USG_RAW(x)      ((x & ISDN_USAGE_MASK)==ISDN_USAGE_RAW)
 208 #define USG_MODEM(x)    ((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM)
 209 #define USG_NET(x)      ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NET)
 210 #define USG_OUTGOING(x) ((x & ISDN_USAGE_OUTGOING)==ISDN_USAGE_OUTGOING)
 211 
 212 /* Timer-delays and scheduling-flags */
 213 #define ISDN_TIMER_RES       3                     /* Main Timer-Resolution  */
 214 #define ISDN_TIMER_02SEC     (HZ/ISDN_TIMER_RES/5) /* Slow-Timer1 (0.2 sec.) */
 215 #define ISDN_TIMER_1SEC      (HZ/ISDN_TIMER_RES)   /* Slow-Timer2 (1 sec.)   */
 216 #define ISDN_TIMER_MODEMREAD 1
 217 #define ISDN_TIMER_MODEMPLUS 2
 218 #define ISDN_TIMER_MODEMRING 4
 219 #define ISDN_TIMER_MODEMXMIT 8
 220 #define ISDN_TIMER_NETDIAL   16
 221 #define ISDN_TIMER_NETHANGUP 32
 222 #define ISDN_TIMER_IPPP      64
 223 #define ISDN_TIMER_FAST      (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \
 224                               ISDN_TIMER_MODEMXMIT)
 225 #define ISDN_TIMER_SLOW      (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \
 226                               ISDN_TIMER_NETDIAL)
 227 
 228 /* Timeout-Values for isdn_net_dial() */
 229 #define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*ISDN_TIMER_RES))
 230 #define ISDN_TIMER_DTIMEOUT15 (15*HZ/(ISDN_TIMER_02SEC*ISDN_TIMER_RES))
 231 
 232 /* GLOBAL_FLAGS */
 233 #define ISDN_GLOBAL_STOPPED 1
 234 
 235 /*=================== Start of ip-over-ISDN stuff =========================*/
 236 
 237 /* Feature- and status-flags for a net-interface */
 238 #define ISDN_NET_CONNECTED  0x01       /* Bound to ISDN-Channel             */
 239 #define ISDN_NET_SECURE     0x02       /* Accept calls from phonelist only  */
 240 #define ISDN_NET_CALLBACK   0x04       /* callback incoming phonenumber     */
 241 #define ISDN_NET_CLONE      0x08       /* clone a tmp interface when called */
 242 #define ISDN_NET_TMP        0x10       /* tmp interface until getting an IP */
 243 #define ISDN_NET_DYNAMIC    0x20       /* this link is dynamically allocated */
 244 #define ISDN_NET_MAGIC      0x49344C02 /* for paranoia-checking             */
 245 
 246 /* Phone-list-element */
 247 typedef struct {
 248   void *next;
 249   char num[20];
 250 } isdn_net_phone;
 251 
 252 /* Local interface-data */
 253 typedef struct isdn_net_local_s {
 254   ulong                  magic;
 255   char                   name[10];     /* Name of device                   */
 256   struct enet_statistics stats;        /* Ethernet Statistics              */
 257   int                    isdn_device;  /* Index to isdn-device             */
 258   int                    isdn_channel; /* Index to isdn-channel            */
 259   int                    ppp_minor;    /* PPPD device minor number         */
 260   int                    pre_device;   /* Preselected isdn-device          */
 261   int                    pre_channel;  /* Preselected isdn-channel         */
 262   int                    exclusive;    /* If non-zero idx to reserved chan.*/
 263   int                    flags;        /* Connection-flags                 */
 264   int                    dialstate;    /* State for dialing                */
 265   int                    dialretry;    /* Counter for Dialout-retries      */
 266   int                    dialmax;      /* Max. Number of Dial-retries      */
 267   char                   msn[ISDN_MSNLEN]; /* MSNs/EAZs for this interface */
 268   int                    dtimer;       /* Timeout-counter for dialing      */
 269   u_char                 p_encap;      /* Packet encapsulation             */
 270                                        /*   0 = Ethernet over ISDN         */
 271                                        /*   1 = RAW-IP                     */
 272                                        /*   2 = IP with type field         */
 273   u_char                 l2_proto;     /* Layer-2-protocol                 */
 274                                        /* See ISDN_PROTO_L2..-constants in */
 275                                        /* isdnif.h                         */
 276                                        /*   0 = X75/LAPB with I-Frames     */
 277                                        /*   1 = X75/LAPB with UI-Frames    */
 278                                        /*   2 = X75/LAPB with BUI-Frames   */
 279                                        /*   3 = HDLC                       */
 280   u_char                 l3_proto;     /* Layer-3-protocol                 */
 281                                        /* See ISDN_PROTO_L3..-constants in */
 282                                        /* isdnif.h                         */
 283                                        /*   0 = Transparent                */
 284   int                    huptimer;     /* Timeout-counter for auto-hangup  */
 285   int                    charge;       /* Counter for charging units       */
 286   int                    chargetime;   /* Timer for Charging info          */
 287   int                    hupflags;     /* Flags for charge-unit-hangup:    */
 288                                        /* bit0: chargeint is invalid       */
 289                                        /* bit1: Getting charge-interval    */
 290                                        /* bit2: Do charge-unit-hangup      */
 291   int                    outgoing;     /* Flag: outgoing call              */
 292   int                    onhtime;      /* Time to keep link up             */
 293   int                    chargeint;    /* Interval between charge-infos    */
 294   int                    onum;         /* Flag: at least 1 outgoing number */
 295   int                    cps;          /* current speed of this interface  */
 296   int                    transcount;   /* byte-counter for cps-calculation */
 297   int                    sqfull;       /* Flag: netdev-queue overloaded    */
 298   ulong                  sqfull_stamp; /* Start-Time of overload           */
 299   ulong                  slavedelay;   /* Dynamic bundling delaytime       */
 300   struct device          *srobin;      /* Ptr to Master device for slaves  */
 301   isdn_net_phone         *phone[2];    /* List of remote-phonenumbers      */
 302                                        /* phone[0] = Incoming Numbers      */
 303                                        /* phone[1] = Outgoing Numbers      */
 304   isdn_net_phone         *dial;        /* Pointer to dialed number         */
 305   struct device          *master;      /* Ptr to Master device for slaves  */
 306   struct device          *slave;       /* Ptr to Slave device for masters  */
 307   struct isdn_net_local_s *next;       /* Ptr to next link in bundle       */
 308   struct isdn_net_local_s *last;       /* Ptr to last link in bundle       */
 309   struct isdn_net_dev_s  *netdev;      /* Ptr to netdev                    */
 310   struct sk_buff         *first_skb;   /* Ptr to skb that triggers dialing */
 311   struct sk_buff         *sav_skb;     /* Ptr to skb, rejected by LL-driver*/
 312                                        /* Ptr to orig. header_cache_bind   */
 313   void                   (*org_hcb)(struct hh_cache **, struct device *,
 314                                     unsigned short, __u32);
 315                                        /* Ptr to orig. header_cache_update */
 316   void                   (*org_hcu)(struct hh_cache *, struct device *,
 317                                     unsigned char *);
 318 } isdn_net_local;
 319 
 320 #ifdef CONFIG_ISDN_PPP
 321 struct ippp_bundle {
 322   int mp_mrru;                        /* unused                             */
 323   struct mpqueue *last;               /* currently defined in isdn_net_dev  */
 324   int min;                            /* currently calculated 'on the fly'  */
 325   long next_num;                      /* we wanna see this seq.-number next */
 326   struct sqqueue *sq;
 327   int modify:1;                       /* set to 1 while modifying sqqueue   */
 328   int bundled:1;                      /* bundle active ?                    */
 329 };
 330 #endif
 331 
 332 /* the interface itself */
 333 typedef struct isdn_net_dev_s {
 334   isdn_net_local  local;
 335   isdn_net_local *queue;
 336   void           *next;                /* Pointer to next isdn-interface   */
 337   struct device   dev;                 /* interface to upper levels        */
 338 #ifdef CONFIG_ISDN_PPP
 339   struct mpqueue *mp_last; 
 340   struct ippp_bundle ib;
 341 #endif
 342 } isdn_net_dev;
 343 
 344 /*===================== End of ip-over-ISDN stuff ===========================*/
 345 
 346 /*======================= Start of ISDN-tty stuff ===========================*/
 347 
 348 #define ISDN_ASYNC_MAGIC          0x49344C01 /* for paranoia-checking        */
 349 #define ISDN_ASYNC_INITIALIZED    0x80000000 /* port was initialized         */
 350 #define ISDN_ASYNC_CALLOUT_ACTIVE 0x40000000 /* Call out device active       */
 351 #define ISDN_ASYNC_NORMAL_ACTIVE  0x20000000 /* Normal device active         */
 352 #define ISDN_ASYNC_CLOSING        0x08000000 /* Serial port is closing       */
 353 #define ISDN_ASYNC_CTS_FLOW       0x04000000 /* Do CTS flow control          */
 354 #define ISDN_ASYNC_CHECK_CD       0x02000000 /* i.e., CLOCAL                 */
 355 #define ISDN_ASYNC_HUP_NOTIFY         0x0001 /* Notify tty on hangups/closes */
 356 #define ISDN_ASYNC_SESSION_LOCKOUT    0x0100 /* Lock cua opens on session    */
 357 #define ISDN_ASYNC_PGRP_LOCKOUT       0x0200 /* Lock cua opens on pgrp       */
 358 #define ISDN_ASYNC_CALLOUT_NOHUP      0x0400 /* No hangup for cui            */
 359 #define ISDN_ASYNC_SPLIT_TERMIOS      0x0008 /* Sep. termios for dialin/out  */
 360 #define ISDN_PORT_16550A                   4 /* Type of faked Hardware       */
 361 #define ISDN_SERIAL_XMIT_SIZE           4000 /* Maximum bufsize for write    */
 362 #define ISDN_SERIAL_TYPE_NORMAL            1 /* tty-type                     */
 363 #define ISDN_SERIAL_TYPE_CALLOUT           2 /* cua-type                     */
 364 
 365 /* Private data (similar to async_struct in <linux/serial.h>) */
 366 typedef struct {
 367   int                   magic;
 368   int                   flags;           /* defined in tty.h               */
 369   int                   type;            /* UART type                      */
 370   struct tty_struct     *tty;
 371   int                   x_char;          /* xon/xoff character             */
 372   int                   close_delay;
 373   int                   MCR;             /* Modem control register         */
 374   int                   line;
 375   int                   count;           /* # of fd on device              */
 376   int                   blocked_open;    /* # of blocked opens             */
 377   long                  session;         /* Session of opening process     */
 378   long                  pgrp;            /* pgrp of opening process        */
 379   int                   isdn_driver;     /* Index to isdn-driver           */
 380   int                   isdn_channel;    /* Index to isdn-channel          */
 381   int                   drv_index;       /* Index to dev->usage            */
 382 #if FUTURE
 383   int                   send_outstanding;/* # of outstanding send-requests */
 384 #endif
 385   int                   xmit_size;       /* max. # of chars in xmit_buf    */
 386   int                   xmit_count;      /* # of chars in xmit_buf         */
 387   u_char                *xmit_buf;       /* transmit-buffer                */
 388   struct termios        normal_termios;
 389   struct termios        callout_termios;
 390   struct wait_queue     *open_wait;
 391   struct wait_queue     *close_wait;
 392 } modem_info;
 393 
 394 #define ISDN_MODEM_WINSIZE 8
 395 
 396 /* Private data of AT-command-interpreter */
 397 typedef struct {
 398   u_char              profile[ISDN_MODEM_ANZREG]; /* Modem-Regs. Profile 0  */
 399   u_char              mdmreg[ISDN_MODEM_ANZREG];  /* Modem-Registers        */
 400   char                pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0             */
 401   char                msn[ISDN_MSNLEN];/* EAZ/MSN                          */
 402   int                 mdmcmdl;         /* Length of Modem-Commandbuffer    */
 403   int                 pluscount;       /* Counter for +++ sequence         */
 404   int                 lastplus;        /* Timestamp of last +              */
 405   char                mdmcmd[255];     /* Modem-Commandbuffer              */
 406 } atemu;
 407 
 408 /* Description of one ISDN-tty */
 409 typedef struct {
 410   int                msr[ISDN_MAX_CHANNELS];      /* Modem-statusregister   */
 411   int                mlr[ISDN_MAX_CHANNELS];      /* Line-statusregister    */
 412   int                refcount;                    /* Number of opens        */
 413   int                online[ISDN_MAX_CHANNELS];   /* B-Channel is up        */
 414   int                dialing[ISDN_MAX_CHANNELS];  /* Dial in progress       */
 415   int                rcvsched[ISDN_MAX_CHANNELS]; /* Receive needs schedule */
 416   int                ncarrier[ISDN_MAX_CHANNELS]; /* Output NO CARRIER      */
 417   struct tty_driver  tty_modem;                   /* tty-device             */
 418   struct tty_driver  cua_modem;                   /* cua-device             */
 419   struct tty_struct  *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
 420   struct termios     *modem_termios[ISDN_MAX_CHANNELS];
 421   struct termios     *modem_termios_locked[ISDN_MAX_CHANNELS];
 422   atemu              atmodem[ISDN_MAX_CHANNELS];  /* AT-Command-parser      */
 423   modem_info         info[ISDN_MAX_CHANNELS];     /* Private data           */
 424 } modem;
 425 
 426 /*======================= End of ISDN-tty stuff ============================*/
 427 
 428 /*======================= Start of sync-ppp stuff ==========================*/
 429 
 430 
 431 #define NUM_RCV_BUFFS     64
 432 #define PPP_HARD_HDR_LEN 4
 433 
 434 #define IPPP_OPEN        0x1
 435 #define IPPP_CONNECT     0x2
 436 #define IPPP_CLOSEWAIT   0x4
 437 #define IPPP_NOBLOCK     0x8
 438 
 439 #ifdef CONFIG_ISDN_PPP
 440 
 441 struct sqqueue {
 442   struct sqqueue *next;
 443   int sqno_start;
 444   int sqno_end;
 445   struct sk_buff *skb;
 446   long timer;
 447 };
 448   
 449 struct mpqueue {
 450   struct mpqueue *next;
 451   struct mpqueue *last;
 452   int    sqno;
 453   struct sk_buff *skb;
 454   int BEbyte;
 455   unsigned long time;
 456 }; 
 457 
 458 struct ippp_buf_queue {
 459   struct ippp_buf_queue *next;
 460   struct ippp_buf_queue *last;
 461   char *buf;                 /* NULL here indicates end of queue */
 462   int len;
 463 };
 464 
 465 struct ippp_struct {
 466   struct ippp_struct *next_link;
 467   int state;
 468   struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */
 469   struct ippp_buf_queue *first;  /* pointer to (current) first packet */
 470   struct ippp_buf_queue *last;   /* pointer to (current) last used packet in queue */
 471   struct wait_queue *wq;
 472   struct wait_queue *wq1;
 473   struct task_struct *tk;
 474   unsigned int mpppcfg;
 475   unsigned int pppcfg;
 476   unsigned int mru;
 477   unsigned int mpmru;
 478   unsigned int mpmtu;
 479   unsigned int maxcid;
 480   isdn_net_local *lp;
 481   int unit; 
 482   long last_link_seqno;
 483   long mp_seqno;
 484   long range;
 485 #ifdef CONFIG_ISDN_PPP_VJ
 486   unsigned char *cbuf;
 487   struct slcompress *slcomp;
 488 #endif
 489 };
 490 
 491 #endif
 492 
 493 /*======================== End of sync-ppp stuff ===========================*/
 494 
 495 /*======================= Start of general stuff ===========================*/
 496 
 497 /* Packet-queue-element */
 498 typedef struct pqueue {
 499   char   *next;                         /* Pointer to next packet           */
 500   short   length;                       /* Packetlength                     */
 501   short   size;                         /* Allocated size                   */
 502   u_char *rptr;                         /* Read-pointer for stream-reading  */
 503   u_char  buffer[1];                    /* The data (will be alloc'd)       */
 504 } pqueue;
 505 
 506 typedef struct {
 507   char *next;
 508   char *private;
 509 } infostruct;
 510 
 511 /* Description of hardware-level-driver */
 512 typedef struct {
 513   ulong               flags;            /* Flags                            */
 514   int                 channels;         /* Number of channels               */
 515   int                 reject_bus;       /* Flag: Reject rejected call on bus*/
 516   struct wait_queue  *st_waitq;         /* Wait-Queue for status-read's     */
 517   int                 maxbufsize;       /* Maximum Buffersize supported     */
 518   unsigned long       pktcount;         /* Until now: unused                */
 519   int                 running;          /* Flag: Protocolcode running       */
 520   int                 loaded;           /* Flag: Driver loaded              */
 521   int                 stavail;          /* Chars avail on Status-device     */
 522   isdn_if            *interface;        /* Interface to driver              */
 523   int                *rcverr;           /* Error-counters for B-Ch.-receive */
 524   int                *rcvcount;         /* Byte-counters for B-Ch.-receive  */
 525   pqueue             **rpqueue;         /* Pointers to start of Rcv-Queue   */
 526   struct wait_queue  **rcv_waitq;       /* Wait-Queues for B-Channel-Reads  */
 527   struct wait_queue  **snd_waitq;       /* Wait-Queue for B-Channel-Send's  */
 528   char               msn2eaz[10][ISDN_MSNLEN];  /* Mapping-Table MSN->EAZ   */
 529 } driver;
 530 
 531 /* Main driver-data */
 532 typedef struct isdn_devt {
 533   unsigned short    flags;                     /* Bitmapped Flags:           */
 534                                                /*                            */
 535   int               drivers;                   /* Current number of drivers  */
 536   int               channels;                  /* Current number of channels */
 537   int               net_verbose;               /* Verbose-Flag               */
 538   int               modempoll;                 /* Flag: tty-read active      */
 539   int               tflags;                    /* Timer-Flags:               */
 540                                                /*  see ISDN_TIMER_..defines  */
 541   int               global_flags;
 542   infostruct        *infochain;                /* List of open info-devs.    */
 543   struct wait_queue *info_waitq;               /* Wait-Queue for isdninfo    */
 544   struct timer_list timer;                     /* Misc.-function Timer       */
 545   int               chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel  */
 546   int               drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index    */
 547   int               usage[ISDN_MAX_CHANNELS];  /* Used by tty/ip/voice       */
 548   char              num[ISDN_MAX_CHANNELS][20];/* Remote number of active ch.*/
 549   int               m_idx[ISDN_MAX_CHANNELS];  /* Index for mdm....          */
 550   driver            *drv[ISDN_MAX_DRIVERS];    /* Array of drivers           */
 551   isdn_net_dev      *netdev;                   /* Linked list of net-if's    */
 552   char              drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID                 */
 553   struct task_struct *profd;                   /* For iprofd                 */
 554   modem             mdm;                       /* tty-driver-data            */
 555   isdn_net_dev      *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers     */
 556   isdn_net_dev      *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers   */
 557 } isdn_dev;
 558 
 559 extern isdn_dev *dev;
 560 
 561 /* Utility-Macros */
 562 #define MIN(a,b) ((a<b)?a:b)
 563 #define MAX(a,b) ((a>b)?a:b)
 564 
 565 #endif /* __KERNEL__ */
 566 #endif /* isdn_h */

/* [previous][next][first][last][top][bottom][index][help] */