root/include/linux/isdn.h

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

INCLUDED FROM


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

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