diff options
author | phk <phk@FreeBSD.org> | 1998-12-27 21:47:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-12-27 21:47:14 +0000 |
commit | c7ecc129d72ba32b5d83c9a6019e93fd181d719c (patch) | |
tree | 8d5099bc7ef24151b4f6deb00d1d34a7e7ac694a /sys/i386 | |
parent | 3f431df8ec46b86090ad59ee153872c45d4d429d (diff) | |
download | FreeBSD-src-c7ecc129d72ba32b5d83c9a6019e93fd181d719c.zip FreeBSD-src-c7ecc129d72ba32b5d83c9a6019e93fd181d719c.tar.gz |
Initial entry of ISDN4BSD into the FreeBSD tree.
ISDN4BSD is the work of our brand-new comitter: Hellmuth Michaelis,
who has done a tremendous amount of work to bring us this far.
There are still some outstanding issues and files to bring into
the tree, and for now it will be needed to pick up all the extra
docs from the isdn4bsd release.
It is probably also a very good idea to subscribe to the isdn@freebsd.org
mailing list before you try this out.
These files correspond to release "beta Version 0.70.00 / December
1998" from Hellmuth.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/conf/LINT | 116 | ||||
-rw-r--r-- | sys/i386/conf/NOTES | 116 | ||||
-rw-r--r-- | sys/i386/conf/files.i386 | 26 | ||||
-rw-r--r-- | sys/i386/conf/options.i386 | 38 | ||||
-rw-r--r-- | sys/i386/include/i4b_cause.h | 144 | ||||
-rw-r--r-- | sys/i386/include/i4b_debug.h | 219 | ||||
-rw-r--r-- | sys/i386/include/i4b_ioctl.h | 606 | ||||
-rw-r--r-- | sys/i386/include/i4b_tel_ioctl.h | 52 | ||||
-rw-r--r-- | sys/i386/include/i4b_trace.h | 91 |
9 files changed, 1404 insertions, 4 deletions
diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 6730a07..ba4d97b 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.519 1998/12/27 14:21:08 sos Exp $ +# $Id: LINT,v 1.520 1998/12/27 19:51:34 phk Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1533,7 +1533,121 @@ device iicsmb0 at iicbus? controller pcf0 at isa? port 0x320 net irq 5 +# ISDN4BSD section + +# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver) +# note that the ``options'' and ``device'' lines must BOTH be defined ! +# +# Non-PnP Cards: +# -------------- +# +# Teles S0/8 or Niccy 1008 +options "TEL_S0_8" +#device isic0 at isa? iomem 0xd0000 net irq 5 flags 1 vector isicintr +# +# Teles S0/16 or Creatix ISDN-S0 or Niccy 1016 +options "TEL_S0_16" +#device isic0 at isa? port 0xd80 iomem 0xd0000 net irq 5 flags 2 vector isicintr +# +# Teles S0/16.3 +options "TEL_S0_16_3" +#device isic0 at isa? port 0xd80 net irq 5 flags 3 vector isicintr +# +# AVM A1 or AVM Fritz!Card +options "AVM_A1" +#device isic0 at isa? port 0x340 net irq 5 flags 4 vector isicintr +# +# USRobotics Sportster ISDN TA intern +options "USR_STI" +#device isic0 at isa? port 0x268 net irq 5 flags 7 vector isicintr +# +# ITK ix1 Micro +options "ITKIX1" +#device isic0 at isa? port 0x398 net irq 10 flags 18 vector isicintr +# +# PnP-Cards: +# ---------- +# +# Teles S0/16.3 PnP +options "TEL_S0_16_3_P" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Creatix ISDN-S0 P&P +options "CRTX_S0_P" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Dr. Neuhaus Niccy Go@ +options "DRN_NGO" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Sedlbauer Win Speed +options "SEDLBAUER" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Dynalink IS64PH +options "DYNALINK" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# ELSA QuickStep 1000pro ISA +options "ELSA_QS1ISA" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# PCI-Cards: +# ---------- +# +# ELSA QuickStep 1000pro PCI +options "ELSA_QS1PCI" +#device isic0 # +# PCMCIA-Cards: +# ------------- +# +# AVM PCMCIA Fritz!Card +options "AVM_A1_PCMCIA" +device isic0 at isa? port 0x340 net irq 5 flags 10 vector isicintr +# +# Active Cards: +# ------------- +# +# Stollmann Tina-dd control device +device tina0 at isa? port 0x260 net irq 10 vector tinaintr +# +# ISDN Protocol Stack +# ------------------- +# +# Q.921 / layer 2 - i4b passive cards D channel handling +pseudo-device "i4bq921" +# +# Q.931 / layer 3 - i4b passive cards D channel handling +pseudo-device "i4bq931" +# +# layer 4 - i4b common passive and active card handling +pseudo-device "i4b" +# +# ISDN devices +# ------------ +# +# userland driver to do ISDN tracing (for passive cards only) +pseudo-device "i4btrc" 4 +# +# userland driver to control the whole thing +pseudo-device "i4bctl" +# +# userland driver for access to raw B channel +pseudo-device "i4brbch" 4 +# +# userland driver for telephony +pseudo-device "i4btel" 2 +# +# network driver for IP over raw HDLC ISDN +pseudo-device "i4bipr" 4 +# enable VJ header compression detection for ipr i/f +options IPR_VJ +# +# network driver for sync PPP over ISDN +pseudo-device "i4bisppp" 4 + + # Parallel-Port Bus # # Parallel port bus support is provided by the `ppbus' device. diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 6730a07..ba4d97b 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.519 1998/12/27 14:21:08 sos Exp $ +# $Id: LINT,v 1.520 1998/12/27 19:51:34 phk Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1533,7 +1533,121 @@ device iicsmb0 at iicbus? controller pcf0 at isa? port 0x320 net irq 5 +# ISDN4BSD section + +# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver) +# note that the ``options'' and ``device'' lines must BOTH be defined ! +# +# Non-PnP Cards: +# -------------- +# +# Teles S0/8 or Niccy 1008 +options "TEL_S0_8" +#device isic0 at isa? iomem 0xd0000 net irq 5 flags 1 vector isicintr +# +# Teles S0/16 or Creatix ISDN-S0 or Niccy 1016 +options "TEL_S0_16" +#device isic0 at isa? port 0xd80 iomem 0xd0000 net irq 5 flags 2 vector isicintr +# +# Teles S0/16.3 +options "TEL_S0_16_3" +#device isic0 at isa? port 0xd80 net irq 5 flags 3 vector isicintr +# +# AVM A1 or AVM Fritz!Card +options "AVM_A1" +#device isic0 at isa? port 0x340 net irq 5 flags 4 vector isicintr +# +# USRobotics Sportster ISDN TA intern +options "USR_STI" +#device isic0 at isa? port 0x268 net irq 5 flags 7 vector isicintr +# +# ITK ix1 Micro +options "ITKIX1" +#device isic0 at isa? port 0x398 net irq 10 flags 18 vector isicintr +# +# PnP-Cards: +# ---------- +# +# Teles S0/16.3 PnP +options "TEL_S0_16_3_P" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Creatix ISDN-S0 P&P +options "CRTX_S0_P" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Dr. Neuhaus Niccy Go@ +options "DRN_NGO" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Sedlbauer Win Speed +options "SEDLBAUER" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# Dynalink IS64PH +options "DYNALINK" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# ELSA QuickStep 1000pro ISA +options "ELSA_QS1ISA" +#device isic0 at isa? port ? net irq ? vector isicintr +# +# PCI-Cards: +# ---------- +# +# ELSA QuickStep 1000pro PCI +options "ELSA_QS1PCI" +#device isic0 # +# PCMCIA-Cards: +# ------------- +# +# AVM PCMCIA Fritz!Card +options "AVM_A1_PCMCIA" +device isic0 at isa? port 0x340 net irq 5 flags 10 vector isicintr +# +# Active Cards: +# ------------- +# +# Stollmann Tina-dd control device +device tina0 at isa? port 0x260 net irq 10 vector tinaintr +# +# ISDN Protocol Stack +# ------------------- +# +# Q.921 / layer 2 - i4b passive cards D channel handling +pseudo-device "i4bq921" +# +# Q.931 / layer 3 - i4b passive cards D channel handling +pseudo-device "i4bq931" +# +# layer 4 - i4b common passive and active card handling +pseudo-device "i4b" +# +# ISDN devices +# ------------ +# +# userland driver to do ISDN tracing (for passive cards only) +pseudo-device "i4btrc" 4 +# +# userland driver to control the whole thing +pseudo-device "i4bctl" +# +# userland driver for access to raw B channel +pseudo-device "i4brbch" 4 +# +# userland driver for telephony +pseudo-device "i4btel" 2 +# +# network driver for IP over raw HDLC ISDN +pseudo-device "i4bipr" 4 +# enable VJ header compression detection for ipr i/f +options IPR_VJ +# +# network driver for sync PPP over ISDN +pseudo-device "i4bisppp" 4 + + # Parallel-Port Bus # # Parallel port bus support is provided by the `ppbus' device. diff --git a/sys/i386/conf/files.i386 b/sys/i386/conf/files.i386 index e32ce13..cbc1a26 100644 --- a/sys/i386/conf/files.i386 +++ b/sys/i386/conf/files.i386 @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $Id: files.i386,v 1.213 1998/12/27 13:55:48 sos Exp $ +# $Id: files.i386,v 1.214 1998/12/27 14:21:08 sos Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -195,6 +195,30 @@ i386/linux/linux_stats.c optional compat_linux i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux i386/linux/linux_util.c optional compat_linux +i4b/layer1/i4b_isic.c optional isic device-driver +i4b/layer1/i4b_isic_isa.c optional isic device-driver +i4b/layer1/i4b_isic_pnp.c optional isic device-driver +i4b/layer1/i4b_isic_pci.c optional isic device-driver +i4b/layer1/i4b_isic_pcmcia.c optional isic device-driver +i4b/layer1/i4b_isac.c optional isic device-driver +i4b/layer1/i4b_hscx.c optional isic device-driver +i4b/layer1/i4b_l1.c optional isic device-driver +i4b/layer1/i4b_l1fsm.c optional isic device-driver +i4b/layer1/i4b_bchan.c optional isic device-driver +i4b/layer1/i4b_tel_s08.c optional isic device-driver +i4b/layer1/i4b_tel_s016.c optional isic device-driver +i4b/layer1/i4b_tel_s0163.c optional isic device-driver +i4b/layer1/i4b_tel_s0P.c optional isic device-driver +i4b/layer1/i4b_ctx_s0P.c optional isic device-driver +i4b/layer1/i4b_avm_a1.c optional isic device-driver +i4b/layer1/i4b_avm_fritz_pcmcia.c optional isic device-driver +i4b/layer1/i4b_usr_sti.c optional isic device-driver +i4b/layer1/i4b_itk_ix1.c optional isic device-driver +i4b/layer1/i4b_drn_ngo.c optional isic device-driver +i4b/layer1/i4b_sws.c optional isic device-driver +i4b/layer1/i4b_dynalink.c optional isic device-driver +i4b/layer1/i4b_elsa_qs1i.c optional isic device-driver +i4b/layer1/i4b_elsa_qs1p.c optional isic device-driver libkern/bcd.c standard libkern/divdi3.c standard libkern/inet_ntoa.c standard diff --git a/sys/i386/conf/options.i386 b/sys/i386/conf/options.i386 index e1b95b9..4604c9a 100644 --- a/sys/i386/conf/options.i386 +++ b/sys/i386/conf/options.i386 @@ -1,4 +1,4 @@ -# $Id: options.i386,v 1.97 1998/12/27 13:36:44 phk Exp $ +# $Id: options.i386,v 1.98 1998/12/27 14:21:08 sos Exp $ DISABLE_PSE IDE_DELAY @@ -102,3 +102,39 @@ FDC_YE opt_fdc.h # Video spigot SPIGOT_UNSECURE opt_spigot.h +# ------------------------------- +# isdn4bsd: passive ISA cards +# ------------------------------- +TEL_S0_8 opt_i4b.h +TEL_S0_16 opt_i4b.h +TEL_S0_16_3 opt_i4b.h +AVM_A1 opt_i4b.h +USR_STI opt_i4b.h +ITKIX1 opt_i4b.h +# ------------------------------- +# isdn4bsd: passive ISA PnP cards +# ------------------------------- +CRTX_S0_P opt_i4b.h +DRN_NGO opt_i4b.h +TEL_S0_16_3_P opt_i4b.h +SEDLBAUER opt_i4b.h +DYNALINK opt_i4b.h +ELSA_QS1ISA opt_i4b.h +# ------------------------------- +# isdn4bsd: passive PCI cards +# ------------------------------- +ELSA_QS1PCI opt_i4b.h +# ------------------------------- +# isdn4bsd: passive PCMCIA cards +# ------------------------------- +AVM_A1_PCMCIA opt_i4b.h +# ------------------------------- +# isdn4bsd: misc options +# ------------------------------- +# temporary workaround for SMP machines +I4B_SMP_WORKAROUND opt_i4b.h +# enable VJ compression code for ipr i/f +IPR_VJ opt_i4b.h +# ------------------------------- +# EOF +# ------------------------------- diff --git a/sys/i386/include/i4b_cause.h b/sys/i386/include/i4b_cause.h new file mode 100644 index 0000000..439db4e --- /dev/null +++ b/sys/i386/include/i4b_cause.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + *--------------------------------------------------------------------------- + * + * i4b_cause.h - causes and cause handling for i4b + * ----------------------------------------------- + * + * $Id: i4b_cause.h,v 1.8 1998/12/05 18:05:55 hm Exp $ + * + * last edit-date: [Sat Dec 5 18:36:30 1998] + * + *---------------------------------------------------------------------------*/ + +#ifndef _I4B_CAUSE_H_ +#define _I4B_CAUSE_H_ + +/*---------------------------------------------------------------------------* + * ISDN4BSD internal causes specification + *---------------------------------------------------------------------------*/ + +#define CAUSE_VAL 0x000000ff /* cause value */ +#define CAUSE_TYPE 0x0000ff00 /* cause type */ +#define CAUSET_Q850 0 /* value coded according to Q.850 */ +#define CAUSET_I4B 1 /* i4b protocol independent causes*/ + +#define GET_CAUSE_VAL(cause) ((cause) & 0xff) +#define SET_CAUSE_VAL(dest, val) ((dest) = ((dest & 0xffffff00) | \ + (val & 0x000000ff))) + +#define GET_CAUSE_TYPE(cause) (((cause) >> 8) & 0xff) +#define SET_CAUSE_TYPE(dest, type) ((dest) = ((dest & 0xffff00ff) | \ + ((type << 8) & 0x0000ff00))) + +#define SET_CAUSE_TV(dest, type, val) ((dest) = ((val & 0x000000ff) | \ + ((type << 8) & 0x0000ff00))) + +/* CAUSET_I4B - protocol independent cause values */ + +#define CAUSE_I4B_NORMAL 0 /* normal call clearing */ +#define CAUSE_I4B_BUSY 1 /* user busy */ +#define CAUSE_I4B_NOCHAN 2 /* circuit/channel not available*/ +#define CAUSE_I4B_INCOMP 3 /* incompatible source/dest */ +#define CAUSE_I4B_REJECT 4 /* call rejected */ +#define CAUSE_I4B_OOO 5 /* destination out of order */ +#define CAUSE_I4B_TMPFAIL 6 /* temporary failure */ +#define CAUSE_I4B_L1ERROR 7 /* L1 error / persistent deact */ +#define CAUSE_I4B_MAX 8 + +/* CAUSET_Q850 - causes defined in Q.850 */ + +#define CAUSE_Q850_SHUTDN 0x00 /* normal D-channel shutdown */ +#define CAUSE_Q850_NUNALLC 0x01 /* Unallocated (unassigned) number */ +#define CAUSE_Q850_NRTTN 0x02 /* No route to specified transit network */ +#define CAUSE_Q850_NRTDST 0x03 /* No route to destination */ +#define CAUSE_Q850_SSINFTN 0x04 /* Send special information tone */ +#define CAUSE_Q850_MDIALTP 0x05 /* Misdialled trunk prefix */ +#define CAUSE_Q850_CHUNACC 0x06 /* Channel unacceptable */ +#define CAUSE_Q850_CALLAWD 0x07 /* Call awarded and being delivered in an established channel */ +#define CAUSE_Q850_PREEMPT 0x08 /* Preemption */ +#define CAUSE_Q850_PREECRR 0x09 /* Preemption - circuit reserved for reuse */ +#define CAUSE_Q850_NCCLR 0x10 /* Normal call clearing */ +#define CAUSE_Q850_USRBSY 0x11 /* User busy */ +#define CAUSE_Q850_NOUSRRSP 0x12 /* No user responding */ +#define CAUSE_Q850_NOANSWR 0x13 /* No answer from user (user alerted) */ +#define CAUSE_Q850_SUBSABS 0x14 /* Subscriber absent */ +#define CAUSE_Q850_CALLREJ 0x15 /* Call rejected */ +#define CAUSE_Q850_NUCHNG 0x16 /* Number changed */ +#define CAUSE_Q850_NONSELUC 0x1A /* Non-selected user clearing */ +#define CAUSE_Q850_DSTOOORDR 0x1B /* Destination out of order */ +#define CAUSE_Q850_INVNUFMT 0x1C /* Invalid number format */ +#define CAUSE_Q850_FACREJ 0x1D /* Facility rejected */ +#define CAUSE_Q850_STENQRSP 0x1E /* Response to STATUS ENQUIRY */ +#define CAUSE_Q850_NORMUNSP 0x1F /* Normal, unspecified */ +#define CAUSE_Q850_NOCAVAIL 0x22 /* No circuit / channel available */ +#define CAUSE_Q850_NETOOORDR 0x26 /* Network out of order */ +#define CAUSE_Q850_PFMCDOOSERV 0x27 /* Permanent frame mode connection out of service */ +#define CAUSE_Q850_PFMCOPER 0x28 /* Permanent frame mode connection operational */ +#define CAUSE_Q850_TMPFAIL 0x29 /* Temporary failure */ +#define CAUSE_Q850_SWEQCONG 0x2A /* Switching equipment congestion */ +#define CAUSE_Q850_ACCINFDIS 0x2B /* Access information discarded */ +#define CAUSE_Q850_REQCNOTAV 0x2C /* Requested circuit/channel not available */ +#define CAUSE_Q850_PRECALBLK 0x2E /* Precedence call blocked */ +#define CAUSE_Q850_RESUNAVAIL 0x2F /* Resources unavailable, unspecified */ +#define CAUSE_Q850_QOSUNAVAIL 0x31 /* Quality of service unavailable */ +#define CAUSE_Q850_REQSERVNS 0x32 /* Requested facility not subscribed */ +#define CAUSE_Q850_OCBARRCUG 0x35 /* Outgoing calls barred within CUG */ +#define CAUSE_Q850_ICBARRCUG 0x36 /* Incoming calls barred within CUG */ +#define CAUSE_Q850_BCAPNAUTH 0x39 /* Bearer capability not authorized */ +#define CAUSE_Q850_BCAPNAVAIL 0x3A /* Bearer capability not presently available */ +#define CAUSE_Q850_INCSTOACISC 0x3E /* Inconsistenciy in designated outgoing access information and subscriber class */ +#define CAUSE_Q850_SOONOTAVAIL 0x3F /* Service or option not available, unspecified */ +#define CAUSE_Q850_BCAPNOTIMPL 0x41 /* Bearer capability not implemented */ +#define CAUSE_Q850_CHTYPNIMPL 0x42 /* Channel type not implemented */ +#define CAUSE_Q850_REQFACNIMPL 0x45 /* Requested facility not implemented */ +#define CAUSE_Q850_ORDINBCAVL 0x46 /* Only restricted digital information bearer capability is available */ +#define CAUSE_Q850_SOONOTIMPL 0x4F /* Service or option not implemented, unspecified */ +#define CAUSE_Q850_INVCLRFVAL 0x51 /* Invalid call reference value */ +#define CAUSE_Q850_IDCHDNOEX 0x52 /* Identified channel does not exist */ +#define CAUSE_Q850_SUSCAEXIN 0x53 /* A suspended call exists, but this call identity does not */ +#define CAUSE_Q850_CLIDINUSE 0x54 /* Call identity in use */ +#define CAUSE_Q850_NOCLSUSP 0x55 /* No call suspended */ +#define CAUSE_Q850_CLIDCLRD 0x56 /* Call having the requested call identity has been cleared */ +#define CAUSE_Q850_UNOTMEMCUG 0x57 /* User not member of CUG */ +#define CAUSE_Q850_INCDEST 0x58 /* Incompatible destination */ +#define CAUSE_Q850_NONEXCUG 0x5A /* Non-existent CUG */ +#define CAUSE_Q850_INVNTWSEL 0x5B /* Invalid transit network selection */ +#define CAUSE_Q850_INVMSG 0x5F /* Invalid message, unspecified */ +#define CAUSE_Q850_MIEMISS 0x60 /* Mandatory information element is missing */ +#define CAUSE_Q850_MSGTNI 0x61 /* Message type non-existent or not implemented */ +#define CAUSE_Q850_MSGNCMPT 0x62 /* Message not compatible with call state or message type non-existent or not implemented */ +#define CAUSE_Q850_IENENI 0x63 /* Information element/parameter non-existent or not implemented */ +#define CAUSE_Q850_INVIEC 0x64 /* Invalid information element contents */ +#define CAUSE_Q850_MSGNCWCS 0x65 /* Message not compatible with call state */ +#define CAUSE_Q850_RECOTIMEXP 0x66 /* Recovery on timer expiry */ +#define CAUSE_Q850_PARMNENIPO 0x67 /* Parameter non-existent or not implemented, passed on */ +#define CAUSE_Q850_MSGUNRDPRM 0x6E /* Message with unrecognized parameter, discarded */ +#define CAUSE_Q850_PROTERR 0x6F /* Protocol error, unspecified */ +#define CAUSE_Q850_INTWRKU 0x7F /* Interworking, unspecified */ + +#define CAUSE_Q850_MAX 128 + +#endif /* _I4B_CAUSE_H_ */ diff --git a/sys/i386/include/i4b_debug.h b/sys/i386/include/i4b_debug.h new file mode 100644 index 0000000..33e6315 --- /dev/null +++ b/sys/i386/include/i4b_debug.h @@ -0,0 +1,219 @@ +/* + * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + *--------------------------------------------------------------------------- + * + * i4b_debug.h - i4b debug header file + * ----------------------------------- + * + * $Id: i4b_debug.h,v 1.14 1998/12/05 18:05:57 hm Exp $ + * + * last edit-date: [Sat Dec 5 18:36:47 1998] + * + *---------------------------------------------------------------------------*/ + +#define DO_I4B_DEBUG /* enable debugging code inclusion */ + +#undef DO_I4B_MAXDEBUG /* enable ALL debug messages by default */ + +#ifdef DO_I4B_DEBUG + +extern unsigned int i4b_l1_debug; +extern unsigned int i4b_l2_debug; +extern unsigned int i4b_l3_debug; +extern unsigned int i4b_l4_debug; + +#define DBGL1(bits, routine, what) \ + if(bits & i4b_l1_debug) \ + { \ + printf("i4b-L1-%s: ", routine); \ + printf what ; \ + } + +#define DBGL2(bits, routine, what) \ + if(bits & i4b_l2_debug) \ + { \ + printf("i4b-L2-%s: ", routine); \ + printf what ; \ + } + +#define DBGL3(bits, routine, what) \ + if(bits & i4b_l3_debug) \ + { \ + printf("i4b-L3-%s: ", routine); \ + printf what ; \ + } + +#define DBGL4(bits, routine, what) \ + if(bits & i4b_l4_debug) \ + { \ + printf("i4b-L4-%s: ", routine); \ + printf what ; \ + } +#else /* !DO_I4B_DEBUG */ + +#define DBGL1(bits, routine, what); +#define DBGL2(bits, routine, what); +#define DBGL3(bits, routine, what); +#define DBGL4(bits, routine, what); + +#endif /* DO_I4B_DEBUG */ + +/* Layer 1 */ + +#define L1_ERROR 0x0001 /* general error message*/ +#define L1_PRIM 0x0002 /* interlayer primitives*/ +#define L1_BCHAN 0x0004 /* B channel action */ +#define L1_H_ERR 0x0008 /* HSCX errors */ +#define L1_H_IRQ 0x0010 /* HSCX IRQ messages */ +#define L1_I_ERR 0x0020 /* ISAC errors */ +#define L1_I_MSG 0x0040 /* ISAC messages */ +#define L1_I_SETUP 0x0080 /* ISAC setup messages */ +#define L1_F_MSG 0x0100 /* FSM messages */ +#define L1_F_ERR 0x0200 /* FSM error messages */ +#define L1_T_MSG 0x0400 /* Timer messages */ +#define L1_T_ERR 0x0800 /* Timer error messages */ +#define L1_H_XFRERR 0x1000 /* HSCX data xfer error */ +#define L1_I_CICO 0x2000 /* ISAC command in/out */ + +#define L1_DEBUG_MAX 0x3fef /* all messages on except IRQ! */ +#define L1_DEBUG_ERR (L1_H_ERR | L1_I_ERR | L1_F_ERR | L1_T_ERR | L1_ERROR) + +#ifndef L1_DEBUG_DEFAULT +#ifdef DO_I4B_MAXDEBUG +#define L1_DEBUG_DEFAULT L1_DEBUG_MAX +#else +#define L1_DEBUG_DEFAULT L1_DEBUG_ERR +#endif +#endif + +/* Layer 2 */ + +#define L2_ERROR 0x0001 /* general error message */ +#define L2_PRIM 0x0002 /* interlayer primitives */ +#define L2_U_MSG 0x0004 /* U frame messages */ +#define L2_U_ERR 0x0008 /* U frame error messages */ +#define L2_S_MSG 0x0010 /* S frame messages */ +#define L2_S_ERR 0x0020 /* S frame error messages */ +#define L2_I_MSG 0x0040 /* I frame messages */ +#define L2_I_ERR 0x0080 /* I frame error messages */ +#define L2_F_MSG 0x0100 /* FSM messages */ +#define L2_F_ERR 0x0200 /* FSM error messages */ +#define L2_T_MSG 0x0400 /* timer messages */ +#define L2_T_ERR 0x0800 /* timer error messages */ +#define L2_TEI_MSG 0x1000 /* TEI messages */ +#define L2_TEI_ERR 0x2000 /* TEI error messages */ + +#define L2_DEBUG_MAX 0x3fff /* all messages on */ +#define L2_DEBUG_ERR (L2_ERROR | L2_I_ERR | L2_F_ERR | L2_T_ERR | L2_S_ERR | L2_TEI_ERR | L2_U_ERR ) + +#ifndef L2_DEBUG_DEFAULT +#ifdef DO_I4B_MAXDEBUG +#define L2_DEBUG_DEFAULT L2_DEBUG_MAX +#else +#define L2_DEBUG_DEFAULT L2_DEBUG_ERR +#endif +#endif + +/* Layer 3 */ + +#define L3_ERR 0x0001 /* general error message */ +#define L3_MSG 0x0002 /* general message */ +#define L3_F_MSG 0x0004 /* FSM messages */ +#define L3_F_ERR 0x0008 /* FSM error messages */ +#define L3_T_MSG 0x0010 /* timer messages */ +#define L3_T_ERR 0x0020 /* timer error messages */ +#define L3_P_MSG 0x0040 /* protocol messages */ +#define L3_P_ERR 0x0080 /* protocol error messages */ +#define L3_A_MSG 0x0100 /* AOC messages */ +#define L3_A_ERR 0x0200 /* AOC error messages */ +#define L3_PRIM 0x0400 /* messages exchanged */ + +#define L3_DEBUG_MAX 0x07ff /* all messages on */ +#define L3_DEBUG_ERR (L3_ERR | L3_F_ERR | L3_T_ERR | L3_P_ERR | L3_A_ERR) + +#ifndef L3_DEBUG_DEFAULT +#ifdef DO_I4B_MAXDEBUG +#define L3_DEBUG_DEFAULT L3_DEBUG_MAX +#else +#define L3_DEBUG_DEFAULT L3_DEBUG_ERR +#endif +#endif + +/* Layer 4 */ + +#define L4_ERR 0x0001 /* general error message */ +#define L4_MSG 0x0002 /* general message */ +#define L4_TIMO 0x0004 /* b channel idle timeout msgs */ +#define L4_DIALST 0x0008 /* network driver dial states */ +#define L4_IPRDBG 0x0010 /* ipr driver debug messages */ +#define L4_RBCHDBG 0x0020 /* rbch driver debug messages */ + +#define L4_DEBUG_MAX 0x003f /* all messages on */ +#define L4_DEBUG_ERR (L4_ERR) + +#ifndef L4_DEBUG_DEFAULT +#ifdef DO_I4B_MAXDEBUG +#define L4_DEBUG_DEFAULT L4_DEBUG_MAX +#else +#define L4_DEBUG_DEFAULT L4_DEBUG_ERR +#endif +#endif + +/*---------------------------------------------------------------------------* + * ioctl via /dev/i4bctl: + * get/set current debug bits settings + *---------------------------------------------------------------------------*/ + +typedef struct { + unsigned int l1; + unsigned int l2; + unsigned int l3; + unsigned int l4; +} ctl_debug_t; + +#define I4B_CTL_GET_DEBUG _IOR('C', 0, ctl_debug_t) + +#define I4B_CTL_SET_DEBUG _IOW('C', 1, ctl_debug_t) + +/*---------------------------------------------------------------------------* + * get hscx statistics + *---------------------------------------------------------------------------*/ + +typedef struct { + int unit; /* controller number */ + int chan; /* channel number */ + int vfr; + int rdo; + int crc; + int rab; + int xdu; + int rfo; +} hscxstat_t; + +#define I4B_CTL_GET_HSCXSTAT _IOWR('C', 2, hscxstat_t) + +#define I4B_CTL_CLR_HSCXSTAT _IOW('C', 3, hscxstat_t) + +/* EOF */ diff --git a/sys/i386/include/i4b_ioctl.h b/sys/i386/include/i4b_ioctl.h new file mode 100644 index 0000000..17e945f --- /dev/null +++ b/sys/i386/include/i4b_ioctl.h @@ -0,0 +1,606 @@ +/* + * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + *--------------------------------------------------------------------------- + * + * i4b_ioctl.h - messages kernel <--> userland + * ------------------------------------------- + * + * $Id: i4b_ioctl.h,v 1.58 1998/12/22 19:48:24 hm Exp $ + * + * last edit-date: [Tue Dec 22 20:33:46 1998] + * + *---------------------------------------------------------------------------*/ + +#ifndef _I4B_IOCTL_H_ +#define _I4B_IOCTL_H_ + +#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#ifndef _MACHINE_TYPES_H_ +#include <machine/types.h> +#endif /* _MACHINE_TYPES_H_ */ +#endif /* __FreeBSD__ */ + +/*---------------------------------------------------------------------------* + * version and release number for isdn4bsd package + *---------------------------------------------------------------------------*/ +#define VERSION 0 /* version number */ +#define REL 70 /* release number */ +#define STEP 00 /* release step */ + +/*---------------------------------------------------------------------------* + * date/time format in i4b log messages + * ------------------------------------ + * Being year 2000 clean is not easy with the current state of the + * ANSI C library standard and it's implementation for some locales. + * You might like to use the "%c" format of "strftime" sometimes, + * but this breaks Y2K in some locales. Also the old standard logfile + * format "%d.%m.%y %H:%M:%S" is non compliant. + * NetBSD's current toolset warns about this problems, and we compile + * with -Werror, so this problems need to be resolved. + *---------------------------------------------------------------------------*/ +#define I4B_TIME_FORMAT "%d.%m.%Y %H:%M:%S" + +/*---------------------------------------------------------------------------* + * max number of controllers in system + *---------------------------------------------------------------------------*/ +#define MAX_CONTROLLERS 8 /* max number of controllers */ + +/*---------------------------------------------------------------------------* + * controller types + *---------------------------------------------------------------------------*/ +#define CTRL_INVALID (-1) /* invalid, error */ +#define CTRL_UNKNOWN 0 /* unknown controller type */ +#define CTRL_PASSIVE 1 /* passive ISDN controller cards*/ +#define CTRL_DAIC 2 /* Diehl active controller cards*/ +#define CTRL_NUMTYPES 3 /* number of controller types */ + +/*---------------------------------------------------------------------------* + * card types for CTRL_PASSIVE + *---------------------------------------------------------------------------*/ +#define CARD_TYPEP_INVAL (-1) /* invalid, error */ +#define CARD_TYPEP_UNK 0 /* unknown */ +#define CARD_TYPEP_8 1 /* Teles, S0/8 */ +#define CARD_TYPEP_16 2 /* Teles, S0/16 */ +#define CARD_TYPEP_16_3 3 /* Teles, S0/16.3 */ +#define CARD_TYPEP_AVMA1 4 /* AVM A1 or AVM Fritz!Card */ +#define CARD_TYPEP_163P 5 /* Teles, S0/16.3 PnP */ +#define CARD_TYPEP_CS0P 6 /* Creatix, S0 PnP */ +#define CARD_TYPEP_USRTA 7 /* US Robotics ISDN TA internal */ +#define CARD_TYPEP_DRNNGO 8 /* Dr. Neuhaus Niccy GO@ */ +#define CARD_TYPEP_SWS 9 /* Sedlbauer Win Speed */ +#define CARD_TYPEP_DYNALINK 10 /* Dynalink IS64PH */ +#define CARD_TYPEP_BLMASTER 11 /* ISDN Blaster / ISDN Master */ +#define CARD_TYPEP_PCFRITZ 12 /* AVM PCMCIA Fritz!Card */ +#define CARD_TYPEP_ELSAQS1ISA 13 /* ELSA QuickStep 1000pro ISA */ +#define CARD_TYPEP_ELSAQS1PCI 14 /* ELSA QuickStep 1000pro PCI */ +#define CARD_TYPEP_SIEMENSITALK 15 /* Siemens I-Talk */ +#define CARD_TYPEP_ELSAMLIMC 16 /* ELSA MicroLink ISDN/MC */ +#define CARD_TYPEP_ELSAMLMCALL 17 /* ELSA MicroLink MCall */ +#define CARD_TYPEP_ITKIX1 18 /* ITK ix1 micro */ + +/* + * in case you add support for more cards, please update: + * + * isdnd: support.c, name_of_controller() + * diehl/diehlctl: main.c, listall() + * + * and adjust CARD_TYPEP_MAX below. + */ + +#define CARD_TYPEP_MAX 18 /* max type */ + +/*---------------------------------------------------------------------------* + * card types for CTRL_DAIC + *---------------------------------------------------------------------------*/ +#define CARD_TYPEA_DAIC_UNK 0 +#define CARD_TYPEA_DAIC_S 1 +#define CARD_TYPEA_DAIC_SX 2 +#define CARD_TYPEA_DAIC_SCOM 3 +#define CARD_TYPEA_DAIC_QUAD 4 + +/*---------------------------------------------------------------------------* + * max length of some strings + *---------------------------------------------------------------------------*/ +#define TELNO_MAX 41 /* max length of a telephone number (+ '\0') */ +#define DISPLAY_MAX 91 /* max length of display information (+ '\0') */ +#define DATETIME_MAX 21 /* max length of datetime information (+ '\0')*/ + +/*---------------------------------------------------------------------------* + * in case the src or dst telephone number is empty + *---------------------------------------------------------------------------*/ +#define TELNO_EMPTY "NotAvailable" + +/*---------------------------------------------------------------------------* + * B channel parameters + *---------------------------------------------------------------------------*/ +#define BCH_MAX_DATALEN 2048 /* max length of a B channel frame */ + +/*---------------------------------------------------------------------------* + * userland driver types + * --------------------- + * a "driver" is defined here as a piece of software interfacing an + * ISDN B channel with a userland service, such as IP, Telephony etc. + *---------------------------------------------------------------------------*/ +#define BDRV_RBCH 0 /* raw b-channel interface driver */ +#define BDRV_TEL 1 /* telephone (speech) interface driver */ +#define BDRV_IPR 2 /* IP over raw HDLC interface driver */ +#define BDRV_ISPPP 3 /* sync Kernel PPP interface driver */ + +/*---------------------------------------------------------------------------* + * B channel protocol + *---------------------------------------------------------------------------*/ +#define BPROT_NONE 0 /* no protocol at all, raw data */ +#define BPROT_RHDLC 1 /* raw HDLC: flag, data, crc, flag */ + +/*---------------------------------------------------------------------------* + * causes data type + *---------------------------------------------------------------------------*/ +typedef unsigned int cause_t; /* 32 bit unsigned int */ + +/*---------------------------------------------------------------------------* + * call descriptor id (cdid) definitions + *---------------------------------------------------------------------------*/ +#define CDID_UNUSED 0 /* cdid is invalid and unused */ +#define CDID_MAX 99999 /* highest valid cdid, wraparound to 1 */ + + +/**************************************************************************** + + outgoing call: + -------------- + + userland kernel + -------- ------ + + CDID_REQ -----------------> + + <------------------ cdid + + CONNECT_REQ --------------> + + <------------------ PROCEEDING_IND (if connect req ok) + + <------------------ CONNECT_ACTIVE_IND (if connection ok) + + or + + <------------------ DISCONNECT_IND (if connection failed) + + + + incoming call: + -------------- + + userland kernel + -------- ------ + + <------------------ CONNECT_IND + + CONNECT_RESP -------------> + + <------------------ CONNECT_ACTIVE_IND (if accepted) + + + + active disconnect: + ------------------ + + userland kernel + -------- ------ + + DISCONNECT_REQ ------------> + + <------------------ DISCONNECT_IND + + + passive disconnect: + ------------------- + + userland kernel + -------- ------ + + <------------------ DISCONNECT_IND + + +****************************************************************************/ + + +/*===========================================================================* + *===========================================================================* + * "read" messages from kernel -> userland + *===========================================================================* + *===========================================================================*/ + + +/*---------------------------------------------------------------------------* + * message header, included in every message + *---------------------------------------------------------------------------*/ +typedef struct { + char type; /* message identifier */ +#define MSG_CONNECT_IND 'a' +#define MSG_CONNECT_ACTIVE_IND 'b' +#define MSG_DISCONNECT_IND 'c' +#define MSG_DIALOUT_IND 'd' +#define MSG_IDLE_TIMEOUT_IND 'e' +#define MSG_ACCT_IND 'f' +#define MSG_CHARGING_IND 'g' +#define MSG_PROCEEDING_IND 'h' +#define MSG_ALERT_IND 'i' +#define MSG_DRVRDISC_REQ 'j' +#define MSG_L12STAT_IND 'k' +#define MSG_TEIASG_IND 'l' +#define MSG_PDEACT_IND 'm' +#define MSG_NEGCOMP_IND 'n' +#define MSG_IFSTATE_CHANGED_IND 'o' + int cdid; /* call descriptor id */ +} msg_hdr_t; + +/*---------------------------------------------------------------------------* + * connect indication + * indicates incoming connection + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int controller; /* controller number */ + int channel; /* channel number */ +#define CHAN_B1 0 /* this _must_ be 0, HSCX B1 is also 0 */ +#define CHAN_B2 1 /* this _must_ be 1, HSCX B2 is also 1 */ +#define CHAN_ANY (-1) /* outgoing, not possible for incoming */ +#define CHAN_NO (-2) /* call waiting (CW) for incoming */ + int bprot; /* b channel protocot, see BPROT_XXX */ + char dst_telno[TELNO_MAX]; /* destination telno */ + char src_telno[TELNO_MAX]; /* source telno */ + int scr_ind;/* screening indicator */ +#define SCR_NONE 0 /* no screening indicator transmitted */ +#define SCR_USR_NOSC 1 /* screening user provided, not screened*/ +#define SCR_USR_PASS 2 /* screening user provided, verified & passed */ +#define SCR_USR_FAIL 3 /* screening user provided, verified & failed */ +#define SCR_NET 4 /* screening network provided */ + char display[DISPLAY_MAX]; /* content of display IE*/ +} msg_connect_ind_t; + +/*---------------------------------------------------------------------------* + * connect active indication + * indicates active connection + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int controller; /* controller number actually used */ + int channel; /* channel number actually used */ + char datetime[DATETIME_MAX]; /* content of date/time IE */ +} msg_connect_active_ind_t; + +/*---------------------------------------------------------------------------* + * disconnect indication + * indicates a disconnect + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + cause_t cause; /* cause code */ +} msg_disconnect_ind_t; + +/*---------------------------------------------------------------------------* + * negotiation complete + * indicates an interface is completely up & running + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ +} msg_negcomplete_ind_t; + +/*---------------------------------------------------------------------------* + * interface changes internal state + * indicates an interface has somehow switched its FSM + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int state; /* new interface state */ +} msg_ifstatechg_ind_t; + +/*---------------------------------------------------------------------------* + * initiate a call to a remote site + * i.e. the IP driver got a packet and wants a connection + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int driver; /* driver type */ + int driver_unit; /* driver unit number */ +} msg_dialout_ind_t; + +/*---------------------------------------------------------------------------* + * idle timeout disconnect sent indication + * kernel has sent disconnect request because of b-ch idle + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ +} msg_idle_timeout_ind_t; + +/*---------------------------------------------------------------------------* + * accounting information from userland interface driver to daemon + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int accttype; /* accounting type */ +#define ACCT_DURING 0 +#define ACCT_FINAL 1 + int driver; /* driver type */ + int driver_unit; /* driver unit number */ + int ioutbytes; /* ISDN # of bytes sent */ + int iinbytes; /* ISDN # of bytes received */ + int outbps; /* bytes per sec out */ + int inbps; /* bytes per sec in */ + int outbytes; /* driver # of bytes sent */ + int inbytes; /* driver # of bytes received */ +} msg_accounting_ind_t; + +/*---------------------------------------------------------------------------* + * charging information from isdn driver to daemon + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int units; /* number of units */ + int units_type; /* type of units info */ +#define CHARGE_INVALID 0 /* invalid, unknown */ +#define CHARGE_AOCD 1 /* advice of charge during call */ +#define CHARGE_AOCE 2 /* advice of charge at end of call */ +#define CHARGE_CALC 3 /* locally calculated from rates information */ +} msg_charging_ind_t; + +/*---------------------------------------------------------------------------* + * call proceeding indication + * indicates outgoing SETUP has been acknowleged + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int controller; /* controller number actually used */ + int channel; /* channel number actually used */ +} msg_proceeding_ind_t; + +/*---------------------------------------------------------------------------* + * alert indication + * indicates remote user side "rings" + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ +} msg_alert_ind_t; + +/*---------------------------------------------------------------------------* + * driver requests to disconnect line + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int driver; /* driver type */ + int driver_unit; /* driver unit number */ +} msg_drvrdisc_req_t; + +/*---------------------------------------------------------------------------* + * state of layer 1/2 + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int controller; /* controller unit */ + int layer; /* layer number (1/2) */ +#define LAYER_ONE 1 +#define LAYER_TWO 2 + int state; /* state info */ +#define LAYER_IDLE 0 +#define LAYER_ACTIVE 1 +} msg_l12stat_ind_t; + +/*---------------------------------------------------------------------------* + * TEI assignment messages + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int controller; /* controller unit */ + int tei; /* TEI or -1 if invalid */ +} msg_teiasg_ind_t; + +/*---------------------------------------------------------------------------* + * persistent deactivation state of stack + *---------------------------------------------------------------------------*/ +typedef struct { + msg_hdr_t header; /* common header */ + int controller; /* controller unit */ + int numactive; /* number of active connections */ +} msg_pdeact_ind_t; + + +/*===========================================================================* + *===========================================================================* + * "ioctl" messages from userland -> kernel + *===========================================================================* + *===========================================================================*/ + + +/*---------------------------------------------------------------------------* + * request a unique cdid (to setup an outgoing call) + *---------------------------------------------------------------------------*/ +typedef struct { + int cdid; /* call descriptor id */ +} msg_cdid_req_t; + +#define I4B_CDID_REQ _IOWR('4', 0, int) + +/*---------------------------------------------------------------------------* + * connect request + * requests an outgoing connection + *---------------------------------------------------------------------------*/ +typedef struct { + int cdid; /* call descriptor id */ + int controller; /* controller to use */ + int channel; /* channel to use */ + int txdelay; /* tx delay after connect */ + int bprot; /* b channel protocol */ + int driver; /* driver to route b channel data to */ + int driver_unit; /* unit number for above driver */ + int unitlen_time; /* length of a charging unit */ + int idle_time; /* time without activity on b ch */ + int earlyhup_time; /* safety area at end of unit */ + int unitlen_method; /* how to calculate the unitlength */ +#define ULEN_METHOD_STATIC 0 /* use unitlen_time value (see above) */ +#define ULEN_METHOD_DYNAMIC 1 /* use AOCD */ + char dst_telno[TELNO_MAX]; /* destination telephone no */ + char src_telno[TELNO_MAX]; /* source telephone number */ +} msg_connect_req_t; + +#define I4B_CONNECT_REQ _IOW('4', 1, msg_connect_req_t) + +/*---------------------------------------------------------------------------* + * connect response + * this is the answer to an incoming connect indication + *---------------------------------------------------------------------------*/ +typedef struct { + int cdid; /* call descriptor id */ + int response; /* what to do with incoming call */ +#define SETUP_RESP_DNTCRE 0 /* dont care, call is not for me */ +#define SETUP_RESP_REJECT 1 /* reject call */ +#define SETUP_RESP_ACCEPT 2 /* accept call */ + cause_t cause; /* cause for case SETUP_RESP_REJECT */ + /* the following are only used for SETUP_RESP_ACCEPT !! */ + int txdelay; /* tx delay after connect */ + int bprot; /* B chan protocol */ + int driver; /* driver to route b channel data to */ + int driver_unit; /* unit number for above driver */ + int max_idle_time; /* max time without activity on b ch */ +} msg_connect_resp_t; + +#define I4B_CONNECT_RESP _IOW('4', 2, msg_connect_resp_t) + +/*---------------------------------------------------------------------------* + * disconnect request + * active disconnect request + *---------------------------------------------------------------------------*/ +typedef struct { + int cdid; /* call descriptor id */ + cause_t cause; /* protocol independent cause */ +} msg_discon_req_t; + +#define I4B_DISCONNECT_REQ _IOW('4', 3, msg_discon_req_t) + +/*---------------------------------------------------------------------------* + * controller info request + *---------------------------------------------------------------------------*/ +typedef struct { + int controller; /* controller number */ + int ncontroller; /* number of controllers in system */ + int ctrl_type; /* controller type passive/active */ + int card_type; /* brand / version */ + int tei; /* tei controller probably has */ +} msg_ctrl_info_req_t; + +#define I4B_CTRL_INFO_REQ _IOWR('4', 4, msg_ctrl_info_req_t) + +/*---------------------------------------------------------------------------* + * dialout response + * status report to driver who requested a dialout + *---------------------------------------------------------------------------*/ +typedef struct { + int driver; /* driver to route b channel data to */ + int driver_unit; /* unit number for above driver */ + int stat; /* state of dialout request */ +#define DSTAT_NONE 0 +#define DSTAT_TFAIL 1 /* transient failure */ +#define DSTAT_PFAIL 2 /* permanent failure */ +#define DSTAT_INONLY 3 /* no outgoing dials allowed */ +} msg_dialout_resp_t; + +#define I4B_DIALOUT_RESP _IOW('4', 5, msg_dialout_resp_t) + +/*---------------------------------------------------------------------------* + * timeout value update + *---------------------------------------------------------------------------*/ +typedef struct { + int cdid; /* call descriptor id */ + int unitlen_time; /* length of a charging unit */ + int idle_time; /* time without activity on b ch */ + int earlyhup_time; /* safety area at end of unit */ +} msg_timeout_upd_t; + +#define I4B_TIMEOUT_UPD _IOW('4', 6, msg_timeout_upd_t) + +/*---------------------------------------------------------------------------* + * soft enable/disable + *---------------------------------------------------------------------------*/ +typedef struct { + int driver; /* driver to route b channel data to */ + int driver_unit; /* unit number for above driver */ + int updown; /* what to do */ +#define SOFT_ENA 0 /* enable interface */ +#define SOFT_DIS 1 /* disable interface */ +} msg_updown_ind_t; + +#define I4B_UPDOWN_IND _IOW('4', 7, msg_updown_ind_t) + +/*---------------------------------------------------------------------------* + * send alert request + *---------------------------------------------------------------------------*/ +typedef struct { + int cdid; /* call descriptor id */ +} msg_alert_req_t; + +#define I4B_ALERT_REQ _IOW('4', 8, msg_alert_req_t) + +/*---------------------------------------------------------------------------* + * request version and release info from kernel part + *---------------------------------------------------------------------------*/ +typedef struct { + int version; /* version number */ + int release; /* release number */ + int step; /* release step number */ +} msg_vr_req_t; + +#define I4B_VR_REQ _IOR('4', 9, msg_vr_req_t) + +/*---------------------------------------------------------------------------* + * Protocol download to active cards + *---------------------------------------------------------------------------*/ +struct isdn_dr_prot { + size_t bytecount; /* length of code */ + u_int8_t *microcode; /* pointer to microcode */ +}; + +struct isdn_download_request { + int controller; /* controller number */ + int numprotos; /* number of protocols in 'protocols' */ + struct isdn_dr_prot *protocols; +}; + +#define I4B_CTRL_DOWNLOAD _IOW('4', 100, struct isdn_download_request) + +/*---------------------------------------------------------------------------* + * Generic diagnostic interface for active cards + *---------------------------------------------------------------------------*/ +struct isdn_diagnostic_request { + int controller; /* controller number */ + u_int32_t cmd; /* diagnostic command to execute */ + size_t in_param_len; /* length of additional input parameter */ + void *in_param; /* optional input parameter */ + size_t out_param_len; /* available output space */ + void *out_param; /* output data goes here */ +}; + +#define I4B_ACTIVE_DIAGNOSTIC _IOW('4', 102, struct isdn_diagnostic_request) + +#endif /* _I4B_IOCTL_H_ */ diff --git a/sys/i386/include/i4b_tel_ioctl.h b/sys/i386/include/i4b_tel_ioctl.h new file mode 100644 index 0000000..b7f0f73 --- /dev/null +++ b/sys/i386/include/i4b_tel_ioctl.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + *--------------------------------------------------------------------------- + * + * i4b_tel_ioctl.h telephony interface ioctls + * ------------------------------------------ + * + * $Id: i4b_tel_ioctl.h,v 1.5 1998/12/14 10:31:58 hm Exp $ + * + * last edit-date: [Sat Dec 5 18:37:36 1998] + * + *---------------------------------------------------------------------------*/ + +#ifndef _I4B_TEL_IOCTL_H_ +#define _I4B_TEL_IOCTL_H_ + +/* supported audio format conversions for /dev/i4btelXX devices */ + +#define CVT_NONE 0 /* no format conversion */ +#define CVT_ALAW2ULAW 1 /* kernel A-law, userland mu-law */ + +/*---------------------------------------------------------------------------* + * get / set audio format + *---------------------------------------------------------------------------*/ + +#define I4B_TEL_GETAUDIOFMT _IOR('A', 0, int) +#define I4B_TEL_SETAUDIOFMT _IOW('A', 1, int) +#define I4B_TEL_EMPTYINPUTQUEUE _IOW('A', 2, int) + +#endif /* _I4B_TEL_IOCTL_H_ */ diff --git a/sys/i386/include/i4b_trace.h b/sys/i386/include/i4b_trace.h new file mode 100644 index 0000000..07e08da --- /dev/null +++ b/sys/i386/include/i4b_trace.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + *--------------------------------------------------------------------------- + * + * i4b_trace.h - header file for trace data read device + * ---------------------------------------------------- + * + * $Id: i4b_trace.h,v 1.5 1998/12/05 18:06:01 hm Exp $ + * + * last edit-date: [Sat Dec 5 18:37:49 1998] + * + *---------------------------------------------------------------------------*/ + +#ifndef _I4B_TRACE_H_ +#define _I4B_TRACE_H_ + +/*---------------------------------------------------------------------------* + * structure of the header at the beginning of every trace mbuf + *---------------------------------------------------------------------------*/ +typedef struct { + int length; /* length of the following mbuf */ + int unit; /* controller unit number */ + int type; /* type of channel */ +#define TRC_CH_I 0 /* Layer 1 INFO's */ +#define TRC_CH_D 1 /* D channel */ +#define TRC_CH_B1 2 /* B1 channel */ +#define TRC_CH_B2 3 /* B2 channel */ + int dir; /* direction */ +#define FROM_TE 0 /* user -> network */ +#define FROM_NT 1 /* network -> user */ + int trunc; /* # of truncated bytes (frame > MCLBYTES) */ + unsigned int count; /* frame count for this unit/type */ + struct timeval time; /* timestamp for this frame */ +} i4b_trace_hdr_t; + +#define INFO0 0 /* layer 1 */ +#define INFO1_8 1 +#define INFO1_10 2 +#define INFO2 3 +#define INFO3 4 +#define INFO4_8 5 +#define INFO4_10 6 + +/*---------------------------------------------------------------------------* + * ioctl via /dev/i4btrc device(s): + * get/set current trace flag settings + *---------------------------------------------------------------------------*/ + +#define I4B_TRC_GET _IOR('T', 0, int) /* get trace settings */ +#define I4B_TRC_SET _IOW('T', 1, int) /* set trace settings */ + +#define TRACE_OFF 0x00 /* tracing off */ +#define TRACE_I 0x01 /* trace L1 INFO's on */ +#define TRACE_D_TX 0x02 /* trace D channel on */ +#define TRACE_D_RX 0x04 /* trace D channel on */ +#define TRACE_B_TX 0x08 /* trace B channel on */ +#define TRACE_B_RX 0x10 /* trace B channel on */ + +typedef struct { + int rxunit; /* unit # for rx frames */ + int rxflags; /* d and/or b channel */ + int txunit; /* unit # for tx frames */ + int txflags; /* d and/or b channel */ +} i4b_trace_setupa_t; + +#define I4B_TRC_SETA _IOW('T', 2, i4b_trace_setupa_t) /* set analyze mode */ +#define I4B_TRC_RESETA _IOW('T', 3, int) /* reset analyze mode */ + +#endif /* _I4B_TRACE_H_ */ |