Work needed to integrate C4B into the FreeBSD source tree
*********************************************************

The following notes are a very short summary of all actions necessary to
incorporate CAPI for BSD into the FreeBSD operating system source tree. These
modifications are primarily intended for 7-CURRENT, but may also be valid for
older versions as 6-STABLE or 5-STABLE.

This list is a list for the author of C4B to summarize all necessary changes
to incorporate C4B into the main FreeBSD, NetBSD or OpenBSD source tree (the
later will need help from others), it is not an installation note. See README
for a list of tasks to execute if you want to put C4B into Your own system.



Modifications under /usr/src/sys or /sys
========================================

Files added to the source tree
------------------------------

   c4b/include/capi20.h
   c4b/include/capidef.h
   c4b/include/capi_pack_on.h
   c4b/include/capi_pack_off.h
   c4b/include/capi_result.h
   c4b/include/capi_supplsvc.h
   c4b/include/capi_echoc.h
   c4b/include/capi_li.h
   c4b/include/capi_bsd.h
   c4b/include/capi_bsdtrc.h

   c4b/kcapimgr/kcapimgr.c
   c4b/kcapimgr/kcapimgr_var.h
   c4b/kcapimgr/kcapi_appl.c
   c4b/kcapimgr/kcapi_appl.h
   c4b/kcapimgr/kcapi_ctlr.c
   c4b/kcapimgr/kcapi_ctlr.h
   c4b/kcapimgr/kcapi_trace.c
   c4b/kcapimgr/kcapi_trace.h
   c4b/kcapimgr/capi_drv.h

   c4b/capidev/capidev.c

   c4b/avmaic/avmaic.c
   c4b/avmaic/avmaic_var.h
   c4b/avmaic/avmaic_misc.h
   c4b/avmaic/avmaic_misc.c
   c4b/avmaic/avmlli.h
   c4b/avmaic/avmb1.h
   c4b/avmaic/avmb1.c
   c4b/avmaic/avmarm.h
   c4b/avmaic/avmarm.c
   c4b/avmaic/avmdma.h
   c4b/avmaic/avmdma.c
   c4b/avmaic/avmio.h
   c4b/avmaic/avmio.c
   c4b/avmaic/avmt1.h
   c4b/avmaic/avmt1.c
   
   c4b/daic/daic.c
   c4b/daic/daic_var.h
   c4b/daic/daic_board_params.h
   c4b/daic/daic_bootstrap.c
   c4b/daic/daic_bootstrap.h
   c4b/daic/daic_dispatch.c
   c4b/daic/daic_dispatch.h
   c4b/daic/daic_globalid.c
   c4b/daic/daic_globalid.h
   c4b/daic/daic_hw.c
   c4b/daic/daic_hw.h
   c4b/daic/daic_hwdefs.h
   c4b/daic/daic_misc.c
   c4b/daic/daic_misc.h
   c4b/daic/daic_ncci.c
   c4b/daic/daic_ncci.h
   c4b/daic/daic_plci.c
   c4b/daic/daic_plci.h

	c4b/ix1a/ix1a.c
	c4b/ix1a/ix1a_var.h
	c4b/ix1a/ix1a_board_params.h
	c4b/ix1a/ix1a_hwdefs.h
	c4b/ix1a/ix1a_bpci.c
	c4b/ix1a/ix1a_bpci.h
	c4b/ix1a/ix1a_isa.c
	c4b/ix1a/ix1a_isa.h
	c4b/ix1a/ix1a_misc.c
	c4b/ix1a/ix1a_misc.h
	c4b/ix1a/ix1a_ppci.c
	c4b/ix1a/ix1a_ppci.h
	c4b/ix1a/ix1a_shm.c
	c4b/ix1a/ix1a_shm.h

   i4b/i4bcapimgr/i4bcapimgr.c
   i4b/i4bcapimgr/i4bcmgr_var.h
   i4b/i4bcapimgr/i4bcmgr_capiutil.c
   i4b/i4bcapimgr/i4bcmgr_capiutil.h
   i4b/i4bcapimgr/i4bcmgr_l4if.c
   i4b/i4bcapimgr/i4bcmgr_nccism.c
   i4b/i4bcapimgr/i4bcmgr_nccism.h
   i4b/i4bcapimgr/i4bcmgr_plcism.c
   i4b/i4bcapimgr/i4bcmgr_plcism.h

The following files are taken from their respective "Makefile" under
".../c4b/kernel/modules/*":

   modules/kcapimgr/Makefile
   modules/capidev/Makefile
   
   modules/avmaic/Makefile
   modules/daic/Makefile
   modules/ix1a/Makefile
   
   modules/i4bcapimgr/Makefile

Modified "modules/Makefile" to include the new modules directories above. Be
sure to put them into the correct order and sections. i4bcapimgr is only for
i386 machines, not for 64bit ones. The other modules are believed to be
64bit-ready (amd64), but mostly untested. So they are for now put into the
sections for the i386 and the amd64 architecture.



For 5.1-RELEASE and earlier
---------------------------

Patch /sys/sys/endian.h to compile (will be installed to
/usr/include/sys/endian.h when doing "make install" in /usr/src/include). In
most inline functions a cast is necessary in the assignment to the local
pointer variable.



Changes for the I4B part of the kernel
--------------------------------------

Changes to /sys/i386/include/i4b_ioctl.h:

Raise version number from 1.4.0 to 1.4.1:

	#define	VERSION		1		/* version number	*/
	#define	REL		4		/* release number	*/
	#define STEP		1		/* release step		*/

Add controller type CTRL_CAPIMGR "CAPIMGR driven controllers",
CTRL_NUMTYPES incremented:

   #define CTRL_CAPIMGR    6               /* boards accessed through the CAPI manager */
   #define CTRL_NUMTYPES   7               /* number of controller types   */



Changes to /sys/i4b/layer4/i4b_l4mgmt.c:

Functions "i4b_l4_daemon_attached" and "i4b_l4_daemon_detached":
   management commands are also sent to CAPIMGR controllers

/*XXX*/         if(*ctrl_desc[i].N_MGMT_COMMAND &&
                   (ctrl_desc[i].ctrl_type == CTRL_PASSIVE ||
                    ctrl_desc[i].ctrl_type == CTRL_CAPIMGR))



Files modified to compile c4b directly into the kernel
------------------------------------------------------

Added to "conf/files":

   #
   # the CAPI manager with the kernel CAPI interface for drivers and applications
   #
   c4b/kcapimgr/kcapimgr.c         optional kcapimgr
   c4b/kcapimgr/kcapi_appl.c       optional kcapimgr
   c4b/kcapimgr/kcapi_ctlr.c       optional kcapimgr
   c4b/kcapimgr/kcapi_trace.c      optional kcapimgr
   #
   # the CAPI device for CAPI support for user space applications
   #
   c4b/capidev/capidev.c   optional capidev
   #



Added to "conf/files.i386":

   #
   # the CAPI manager driver for AVM active ISDN controllers
   #
   c4b/avmaic/avmaic.c      optional avmaic
   c4b/avmaic/avmaic_misc.c optional avmaic
   c4b/avmaic/avmb1.c       optional avmaic
   c4b/avmaic/avmarm.c      optional avmaic
   c4b/avmaic/avmdma.c      optional avmaic
   c4b/avmaic/avmio.c       optional avmaic
   c4b/avmaic/avmt1.c       optional avmaic
   #
   # the CAPI manager driver for legacy Diehl active ISDN controllers
   #
   c4b/daic/daic.c          optional daic
   c4b/daic/daic_bootstrap.c optional daic
   c4b/daic/daic_dispatch.c optional daic
   c4b/daic/daic_globalid.c optional daic
   c4b/daic/daic_hw.c       optional daic
   c4b/daic/daic_misc.c     optional daic
   c4b/daic/daic_ncci.c     optional daic
   c4b/daic/daic_plci.c     optional daic
	#
	# the CAPI manager driver for IX1 active ISDN controllers (ITK, Digi Datafire)
	#
	c4b/driver/ix1a/ix1a.c		optional ix1a
	c4b/driver/ix1a/ix1a_bpci.c	optional ix1a
	c4b/driver/ix1a/ix1a_isa.c	optional ix1a
	c4b/driver/ix1a/ix1a_misc.c	optional ix1a
	c4b/driver/ix1a/ix1a_ppci.c	optional ix1a
	c4b/driver/ix1a/ix1a_shm.c	optional ix1a
   #
   # i4b driver to support CAPIMGR controllers
   #
   i4b/i4bcapimgr/i4bcapimgr.c             optional i4bcapimgr
   i4b/i4bcapimgr/i4bcmgr_l4if.c           optional i4bcapimgr
   i4b/i4bcapimgr/i4bcmgr_plcism.c         optional i4bcapimgr
   i4b/i4bcapimgr/i4bcmgr_nccism.c         optional i4bcapimgr
   i4b/i4bcapimgr/i4bcmgr_capiutil.c       optional i4bcapimgr



Added to "conf/files.amd64":

   #
   # the CAPI manager driver for AVM active ISDN controllers
   #
   c4b/avmaic/avmaic.c      optional avmaic
   c4b/avmaic/avmaic_misc.c optional avmaic
   c4b/avmaic/avmb1.c       optional avmaic
   c4b/avmaic/avmarm.c      optional avmaic
   c4b/avmaic/avmdma.c      optional avmaic
   c4b/avmaic/avmio.c       optional avmaic
   c4b/avmaic/avmt1.c       optional avmaic
   #
   # the CAPI manager driver for legacy Diehl active ISDN controllers
   #
   c4b/daic/daic.c          optional daic
   c4b/daic/daic_bootstrap.c optional daic
   c4b/daic/daic_dispatch.c optional daic
   c4b/daic/daic_globalid.c optional daic
   c4b/daic/daic_hw.c       optional daic
   c4b/daic/daic_misc.c     optional daic
   c4b/daic/daic_ncci.c     optional daic
   c4b/daic/daic_plci.c     optional daic
	#
	# the CAPI manager driver for IX1 active ISDN controllers (ITK, Digi Datafire)
	#
	c4b/driver/ix1a/ix1a.c		optional ix1a
	c4b/driver/ix1a/ix1a_bpci.c	optional ix1a
	c4b/driver/ix1a/ix1a_isa.c	optional ix1a
	c4b/driver/ix1a/ix1a_misc.c	optional ix1a
	c4b/driver/ix1a/ix1a_ppci.c	optional ix1a
	c4b/driver/ix1a/ix1a_shm.c	optional ix1a
   #
   # i4b driver to support CAPIMGR controllers
   #
   #XXX#i4b/i4bcapimgr/i4bcapimgr.c             optional i4bcapimgr
   #XXX#i4b/i4bcapimgr/i4bcmgr_l4if.c           optional i4bcapimgr
   #XXX#i4b/i4bcapimgr/i4bcmgr_plcism.c         optional i4bcapimgr
   #XXX#i4b/i4bcapimgr/i4bcmgr_nccism.c         optional i4bcapimgr
   #XXX#i4b/i4bcapimgr/i4bcmgr_capiutil.c       optional i4bcapimgr



Added to "conf/options":

   #
   # options for the CAPI manager
   #
   KCAPIMGR_LOG_MASK       opt_kcapimgr.h
   #
   # options for the CAPI device to user land
   #
   CAPIDEV_LOG_MASK        opt_capidev.h
   #



Added to "conf/options.i386" and "conf/options.amd64":

   #
   # options for the CAPI driver for AVM active ISDN controllers
   #
	AVMAIC_LOG_LEVEL                opt_avmaic.h
   AVMAIC_MAX_APPLICATIONS         opt_avmaic.h
   AVMAIC_MAX_NCCI_PER_CHANNEL     opt_avmaic.h
	#
	# options for the CAPI driver for legacy Diehl active ISDN controllers
	#
	DAIC_LOG_LEVEL			opt_daic.h
	DAIC_MAX_APPLICATIONS		opt_daic.h
	DAIC_MAX_NCCI_PER_PLCI		opt_daic.h
	DAIC_MAX_NCCI_PER_PORT		opt_daic.h
	DAIC_MAX_PLCI_PER_PORT		opt_daic.h
	#
	# options for the CAPI driver for IX1 active ISDN controllers
	#
	IX1A_LOG_LEVEL			opt_ix1a.h
	
	#
	# options for the i4b driver to support CAPIMGR controllers
	#
	I4BCAPIMGR_LOG_LEVEL               opt_i4bcapimgr.h
	I4BCAPIMGR_ALLOC_MAX_BDATA_SIZE    opt_i4bcapimgr.h



Added to "conf/majors":

for 4.x-RELEASE:

   170     capi            CAPI interface for user space applications

for 5.0-RELEASE:

   226     capi            CAPI interface for user space applications

for 5.1-RELEASE and up: Not relevant any more.



Files modified for kernel documentation
---------------------------------------

Note that all changes listed in the following are only valid for 5.1-RELEASE and up.
Earlier versions are not supported any more.

Added to "conf/NOTES":

   #
   # kernel and user space CAPI support
   #
   # supported options:
   #    KCAPIMGR_LOG_MASK          initializes the log mask for the CAPI manager,
   #                               integer value
   #    CAPIDEV_LOG_MASK           initialize the log mask for the CAPI device to
   #                               user space applications, integer value
   #
   pseudo-device   "kcapimgr"
   pseudo-device   "capidev"



Added to "i386/conf/NOTES":

	#
	# CAPI manager driver for the AVM active ISDN adapters (B1, C2, C4, T1)
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Supported flags:
	#    0x00 (or no flags) AVM-B1 ISA
	#    0x10 - 0x13        AVM-T1 ISA with board number 0 - 3 (low nibble of
	#                       flags)
	#
	# Supported options:
	#    AVMAIC_LOG_LEVEL           initializes the log level for the driver
	#    AVMAIC_MAX_APPLICATIONS    specifies the maximum no. supported
	#                               simultaneously registered applications,
	#                               default is 30
	#    AVMAIC_MAX_NCCI_PER_CHANNEL
	#                               specifies the maximum no. possible B3
	#                               connections per channel and application,
	#                               default is 4
	#
	device avmaic
	# AVM-B1 ISA
	hint.avmaic.0.at="isa"
	hint.avmaic.0.port="0x150"
	hint.avmaic.0.irq="5"
	
	#
	# CAPI manager driver for the legacy Diehl active ISDN adapters (S, SX, SXn,
	# SCOM, Quadro, S2m)
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Note2: The code for the S2m board is currently not implemented.
	#
	# Supported options:
	#    DAIC_LOG_LEVEL		initializes the log level for the driver
	#    DAIC_MAX_APPLICATIONS	specifies the maximum no. supported
	#				simultaneously registered applications,
	#				default is 30
	#    DAIC_MAX_NCCI_PER_PLCI	specifies the maximum no. supported NCCIs per
	#				PLCI (useful for ISO 8208 B3-protocol),
	#				default is 4
	#    DAIC_MAX_NCCI_PER_PORT	specifies the overall maximum no. supported
	#				NCCIs per port of a board, default is 128
	#    DAIC_MAX_PLCI_PER_PORT	specifies the overall maximum no. supported
	#				PLCIs per port of a board, default is 64
	#
	# For more information about the effect of these driver options see the manual
	# page daic(4).
	#
	device daic
	# Diehl S, SX, SXn, SCOM (specifying the memory size is optional)
	hint.daic.0.at="isa"
	hint.daic.0.maddr="0xD0000"
	hint.daic.0.msize="0x800"
	hint.daic.0.irq="10"
	# Diehl Quattro (specifying the memory size is optional)
	hint.daic.0.at="isa"
	hint.daic.0.maddr="0xD0000"
	hint.daic.0.msize="0x2000"
	hint.daic.0.irq="10"
	# Diehl S2m (specifying the memory size is optional)
	hint.daic.0.at="isa"
	hint.daic.0.maddr="0xD0000"
	hint.daic.0.msize="0x4000"
	hint.daic.0.irq="10"
	
	#
	# CAPI manager driver for the IX1 active ISDN adapters
	#
	# These ISDN boards were originally manufactured by ITK, Germany, that is now
	# part of Digi International. The boards were also sold under the name Digi
	# Datafire. See ix1a(4) for further information.
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Supported flags (see ix1a(4) for detailed information):
	#    0x00 - 0x03        IX1 Basic ISA, card types 1-4
	#    0x10 - 0x13        IX1 Octo ISA, card types 1-4
	#    0x20 - 0x27        IX1 Multimodem ISA, card types 1-8
	#
	# Supported options:
	#    IX1A_LOG_LEVEL             initializes the log level for the driver
	#
	device ix1a
	# IX1 Basic ISA, card number 1
	hint.ix1a.0.at="isa"
	hint.ix1a.0.port="0x380"
	hint.ix1a.0.irq="5"
	hint.ix1a.0.flags="0x00"
	# IX1 Octo ISA, card number 2
	hint.ix1a.0.at="isa"
	hint.ix1a.0.port="0x380"
	hint.ix1a.0.irq="5"
	hint.ix1a.0.flags="0x11"
	# IX1 Multimodem ISA, card number 8
	hint.ix1a.0.at="isa"
	hint.ix1a.0.port="0x380"
	hint.ix1a.0.irq="5"
	hint.ix1a.0.flags="0x27"
	
	#
	# i4b driver to support CAPI controllers
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Supported options:
	#    I4BCAPIMGR_LOG_LEVEL       initializes the log level for i4bcapimgr,
	#                               integer value
	#    I4BCAPIMGR_ALLOC_MAX_BDATA_SIZE
	#                               Normally incoming data blocks are forwarded to
	#                               the layer 4 drivers just as they are. But there
	#                               are situations (activated VJ compression and
	#                               uncompression is performed in the received
	#                               mbuf) where it is assumed that the received
	#                               mbuf is allocated with the maximum size of 2kB.
	#                               If this option is set, all incoming data blocks
	#                               are copied into new mbufs of maximum size, thus
	#                               wasting memory and computing time.
	#
	#device   "i4bcapimgr"
	
	
Added to "amd64/conf/NOTES":

	#
	# CAPI manager driver for the AVM active ISDN adapters (B1, C2, C4, T1)
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Supported flags:
	#    0x00 (or no flags) AVM-B1 ISA
	#    0x10 - 0x13        AVM-T1 ISA with board number 0 - 3 (low nibble of
	#                       flags)
	#
	# Supported options:
	#    AVMAIC_LOG_LEVEL           initializes the log level for the driver
	#    AVMAIC_MAX_APPLICATIONS    specifies the maximum no. supported
	#                               simultaneously registered applications,
	#                               default is 30
	#    AVMAIC_MAX_NCCI_PER_CHANNEL
	#                               specifies the maximum no. possible B3
	#                               connections per channel and application,
	#                               default is 4
	#
	device avmaic
	# AVM-B1 ISA
	hint.avmaic.0.at="isa"
	hint.avmaic.0.port="0x150"
	hint.avmaic.0.irq="5"
	
	#
	# CAPI manager driver for the legacy Diehl active ISDN adapters (S, SX, SXn,
	# SCOM, Quadro, S2m)
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Note2: The code for the S2m board is currently not implemented.
	#
	# Supported options:
	#    DAIC_LOG_LEVEL		initializes the log level for the driver
	#    DAIC_MAX_APPLICATIONS	specifies the maximum no. supported
	#				simultaneously registered applications,
	#				default is 30
	#    DAIC_MAX_NCCI_PER_PLCI	specifies the maximum no. supported NCCIs per
	#				PLCI (useful for ISO 8208 B3-protocol),
	#				default is 4
	#    DAIC_MAX_NCCI_PER_PORT	specifies the overall maximum no. supported
	#				NCCIs per port of a board, default is 128
	#    DAIC_MAX_PLCI_PER_PORT	specifies the overall maximum no. supported
	#				PLCIs per port of a board, default is 64
	#
	# For more information about the effect of these driver options see the manual
	# page daic(4).
	#
	device daic
	# Diehl S, SX, SXn, SCOM (specifying the memory size is optional)
	hint.daic.0.at="isa"
	hint.daic.0.maddr="0xD0000"
	hint.daic.0.msize="0x800"
	hint.daic.0.irq="10"
	# Diehl Quattro (specifying the memory size is optional)
	hint.daic.0.at="isa"
	hint.daic.0.maddr="0xD0000"
	hint.daic.0.msize="0x2000"
	hint.daic.0.irq="10"
	# Diehl S2m (specifying the memory size is optional)
	hint.daic.0.at="isa"
	hint.daic.0.maddr="0xD0000"
	hint.daic.0.msize="0x4000"
	hint.daic.0.irq="10"
	
	#
	# CAPI manager driver for the IX1 active ISDN adapters
	#
	# These ISDN boards were originally manufactured by ITK, Germany, that is now
	# part of Digi International. The boards were also sold under the name Digi
	# Datafire. See ix1a(4) for further information.
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Supported flags (see ix1a(4) for detailed information):
	#    0x00 - 0x03        IX1 Basic ISA, card types 1-4
	#    0x10 - 0x13        IX1 Octo ISA, card types 1-4
	#    0x20 - 0x27        IX1 Multimodem ISA, card types 1-8
	#
	# Supported options:
	#    IX1A_LOG_LEVEL             initializes the log level for the driver
	#
	device ix1a
	# IX1 Basic ISA, card number 1
	hint.ix1a.0.at="isa"
	hint.ix1a.0.port="0x380"
	hint.ix1a.0.irq="5"
	hint.ix1a.0.flags="0x00"
	# IX1 Octo ISA, card number 2
	hint.ix1a.0.at="isa"
	hint.ix1a.0.port="0x380"
	hint.ix1a.0.irq="5"
	hint.ix1a.0.flags="0x11"
	# IX1 Multimodem ISA, card number 8
	hint.ix1a.0.at="isa"
	hint.ix1a.0.port="0x380"
	hint.ix1a.0.irq="5"
	hint.ix1a.0.flags="0x27"
	
	#
	# i4b driver to support CAPI controllers
	#
	# The CAPI manager module "kcapimgr" is also needed when this device is entered
	# into a kernel configuration file.
	#
	# Note: Compiling this module as a separate module (i.e. not directly into the
	#       kernel) is preferred. So it is better to comment out the following
	#       device line.
	#
	# Note2: As i4b is currently not supported under 64bit systems, i4bcapimgr cannot be
	#        used either. But tests with some modified i4b version showed up that
	#        i4bcapimgr at least compiles under amd64.
	#
	# Supported options:
	#    I4BCAPIMGR_LOG_LEVEL       initializes the log level for i4bcapimgr,
	#                               integer value
	#    I4BCAPIMGR_ALLOC_MAX_BDATA_SIZE
	#                               Normally incoming data blocks are forwarded to
	#                               the layer 4 drivers just as they are. But there
	#                               are situations (activated VJ compression and
	#                               uncompression is performed in the received
	#                               mbuf) where it is assumed that the received
	#                               mbuf is allocated with the maximum size of 2kB.
	#                               If this option is set, all incoming data blocks
	#                               are copied into new mbufs of maximum size, thus
	#                               wasting memory and computing time.
	#
	#device   "i4bcapimgr"

	
	


Modifications under /usr/src/lib and /usr/src/include
=====================================================

Files added to the source tree
------------------------------

   /usr/src/lib/libcapi20/Makefile
   /usr/src/lib/libcapi20/capilib.c
   /usr/src/lib/libcapi20/capi20.3
   /usr/src/lib/libcapi20/capi-trc.7

Modified /usr/src/include/Makefile to install the CAPI header files from
/usr/src/sys/c4b/include to /usr/include.

Modify usr/src/lib/Makefile to build "libcapi20" if NO_C4B is not defined.





Changes made to I4B user space applications to support CAPI controllers
=======================================================================

Changes to "/usr/src/usr.sbin/i4b/isdnd/controller.c"
-----------------------------------------------------

Function "name_of_controller": added support for controller type CTRL_CAPIMGR

        static char *capimgr_card[] = {
                "CAPI manager driven board"
        };

        else if(ctrl_type == CTRL_CAPIMGR)
        {
                return capimgr_card[0];
        }

Function "init_controller_state": added support for controller type
CTRL_CAPIMGR, be sure to set the state to "CTRL_UP" for there is no method for
the controller to tell isdnd that it is up

        case CTRL_CAPIMGR:
                isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
                isdn_ctrl_tab[controller].card_type = card_type;
                isdn_ctrl_tab[controller].state = CTRL_UP;
                break;





Tools for C4B and management of the CAPI controller drivers
===========================================================

Files added to the source tree
------------------------------

Note that the first two files are taken from their respective "*-inst"
variants in the original c4b source tree.

	/usr/src/usr.sbin/c4b/Makefile
	/usr/src/usr.sbin/c4b/Makefile.inc
	
	/usr/src/usr.sbin/c4b/avmaicctl/Makefile
	/usr/src/usr.sbin/c4b/avmaicctl/avmaicctl.cc
	/usr/src/usr.sbin/c4b/avmaicctl/avmaic_cfgdefs.h
	/usr/src/usr.sbin/c4b/avmaicctl/avmaic_board_params.h
	/usr/src/usr.sbin/c4b/avmaicctl/config.cc
	/usr/src/usr.sbin/c4b/avmaicctl/config.h
	/usr/src/usr.sbin/c4b/avmaicctl/avmaic.cfg.8
	/usr/src/usr.sbin/c4b/avmaicctl/avmaicctl.8
	
	/usr/src/usr.sbin/c4b/capitest/Makefile
	/usr/src/usr.sbin/c4b/capitest/capitest.cc
	/usr/src/usr.sbin/c4b/capitest/batchadmin.cc
	/usr/src/usr.sbin/c4b/capitest/batchadmin.h
	/usr/src/usr.sbin/c4b/capitest/capism.cc
	/usr/src/usr.sbin/c4b/capitest/capism.h
	/usr/src/usr.sbin/c4b/capitest/capiutil.cc
	/usr/src/usr.sbin/c4b/capitest/capiutil.h
	/usr/src/usr.sbin/c4b/capitest/config.cc
	/usr/src/usr.sbin/c4b/capitest/config.h
	/usr/src/usr.sbin/c4b/capitest/control.cc
	/usr/src/usr.sbin/c4b/capitest/control.h
	/usr/src/usr.sbin/c4b/capitest/ctlrinfo.cc
	/usr/src/usr.sbin/c4b/capitest/ctlrinfo.h
	/usr/src/usr.sbin/c4b/capitest/capitest.8

	/usr/src/usr.sbin/c4b/capitrace/Makefile
	/usr/src/usr.sbin/c4b/capitrace/capitrace.cc
	/usr/src/usr.sbin/c4b/capitrace/bound_pointer.cc
	/usr/src/usr.sbin/c4b/capitrace/bound_pointer.h
	/usr/src/usr.sbin/c4b/capitrace/config.cc
	/usr/src/usr.sbin/c4b/capitrace/config.h
	/usr/src/usr.sbin/c4b/capitrace/form_out_stream.cc
	/usr/src/usr.sbin/c4b/capitrace/form_out_stream.h
	/usr/src/usr.sbin/c4b/capitrace/trace_file_header.h
	/usr/src/usr.sbin/c4b/capitrace/trace_interpreter.cc
	/usr/src/usr.sbin/c4b/capitrace/trace_interpreter.h
	/usr/src/usr.sbin/c4b/capitrace/trace_message_print.cc
	/usr/src/usr.sbin/c4b/capitrace/trace_message_print.h
	/usr/src/usr.sbin/c4b/capitrace/tracer.cc
	/usr/src/usr.sbin/c4b/capitrace/tracer.h
	/usr/src/usr.sbin/c4b/capitrace/capitrace.8

	/usr/src/usr.sbin/c4b/common/cfgfile.cc
	/usr/src/usr.sbin/c4b/common/cfgfile.h
	/usr/src/usr.sbin/c4b/common/cmdopt2.cc
	/usr/src/usr.sbin/c4b/common/cmdopt2.h
	/usr/src/usr.sbin/c4b/common/ctlrlist.cc
	/usr/src/usr.sbin/c4b/common/ctlrlist.h
	/usr/src/usr.sbin/c4b/common/icless.h

	/usr/src/usr.sbin/c4b/daicctl/Makefile
	/usr/src/usr.sbin/c4b/daicctl/daicctl.cc
	/usr/src/usr.sbin/c4b/daicctl/config.cc
	/usr/src/usr.sbin/c4b/daicctl/config.h
	/usr/src/usr.sbin/c4b/daicctl/daic_board_params.h
	/usr/src/usr.sbin/c4b/daicctl/daic_cfgdefs.h
	/usr/src/usr.sbin/c4b/daicctl/daic.cfg.5
	/usr/src/usr.sbin/c4b/daicctl/daicctl.8

	/usr/src/usr.sbin/c4b/ix1actl/Makefile
	/usr/src/usr.sbin/c4b/ix1actl/ix1actl.cc
	/usr/src/usr.sbin/c4b/ix1actl/config.cc
	/usr/src/usr.sbin/c4b/ix1actl/config.h
	/usr/src/usr.sbin/c4b/ix1actl/ix1a_board_params.h
	/usr/src/usr.sbin/c4b/ix1actl/ix1a_cfgdefs.h
	/usr/src/usr.sbin/c4b/ix1actl/ix1a.cfg.5
	/usr/src/usr.sbin/c4b/ix1actl/ix1actl.8

	/usr/src/usr.sbin/c4b/man/Makefile
	/usr/src/usr.sbin/c4b/man/avmaic.4
	/usr/src/usr.sbin/c4b/man/c4b.4
	/usr/src/usr.sbin/c4b/man/capidev.4
	/usr/src/usr.sbin/c4b/man/daic.4
	/usr/src/usr.sbin/c4b/man/i4bcapimgr.4
	/usr/src/usr.sbin/c4b/man/ix1a.4
	/usr/src/usr.sbin/c4b/man/kcapi-drv.9
	/usr/src/usr.sbin/c4b/man/kcapi.9
	/usr/src/usr.sbin/c4b/man/kcapimgr.4

Modify "/usr/src/usr.sbin/Makefile" to include the c4b subdirectory if NO_C4B is not
defined.





Firmware files for active controllers
=====================================

Files added to the source tree
------------------------------

Note that the Makefiles are taken from their respective "Makefile-inst"
variants from the c4b source tree. All binary firmware files are translated to
a uuencoded version before beeing added to the FreeBSD source tree.

	/usr/src/share/capi/Makefile
	/usr/src/share/capi/Makefile.inc
	
	/usr/src/share/capi/avmaic/Makefile
	/usr/src/share/capi/avmaic/README
	/usr/src/share/capi/avmaic/b1.t4.uu
	/usr/src/share/capi/avmaic/b1-1tr6.t4.uu
	/usr/src/share/capi/avmaic/b1-usa.t4.uu
	/usr/src/share/capi/avmaic/c2.bin.uu
	/usr/src/share/capi/avmaic/c4.bin.uu
	/usr/src/share/capi/avmaic/t1.t4.uu
	/usr/src/share/capi/avmaic/t1-1tr6.t4.uu
	/usr/src/share/capi/avmaic/t1b.t4.uu
	/usr/src/share/capi/avmaic/t1b-1tr6.t4.uu
	
	/usr/src/share/capi/daic/Makefile
	/usr/src/share/capi/daic/README
	/usr/src/share/capi/daic/dnload.bin.uu
	/usr/src/share/capi/daic/prload.bin.uu
	/usr/src/share/capi/daic/te_etsi.bin.uu
	/usr/src/share/capi/daic/te_etsi.p.uu
	/usr/src/share/capi/daic/te_etsi.sq.uu
	/usr/src/share/capi/daic/te_etsi.sx.uu
	/usr/src/share/capi/daic/te_etsi.sy.uu
	
	/usr/src/share/capi/ix1a/Makefile
	/usr/src/share/capi/ix1a/README
	/usr/src/share/capi/ix1a/ixb-1m-fax.bin.uu
	/usr/src/share/capi/ix1a/ixb-1m-modem.bin.uu
	/usr/src/share/capi/ix1a/ixb-4m.bin.uu
	/usr/src/share/capi/ix1a/ixboot.scr.uu
	/usr/src/share/capi/ix1a/ixm-1m.bin.uu
	/usr/src/share/capi/ix1a/ixm-4m.bin.uu
	/usr/src/share/capi/ix1a/ixmboot.scr.uu
	/usr/src/share/capi/ix1a/ixo.bin.uu
	/usr/src/share/capi/ix1a/ixpp.bin.uu



Modify /usr/src/share/Makefile to enter subdirectory capi if NO_C4B is not defined.





Other small changes to the FreeBSD source tree
==============================================

Add the following note for NO_C4B to "/usr/src/share/examples/etc/make.conf":

   #NO_C4B=        true    # do not build CAPI for BSD package

Add the following lines to "/usr/src/share/man/man5/make.conf.5" to document
the knob "NO_C4B" in the manual page:

	.It Va NO_C4B
	.Pq Vt bool
	Set to not build CAPI package.



Modify "/usr/src/etc/mtree/BSD.usr.dist" to include entries for the directories
".../share/capi", ".../share/capi/avmaic",  ".../share/capi/daic" and
".../share/capi/ix1a", using default ownership and rights mask.

As mentioned int the file "/usr/src/etc/mtree/README" update
"/usr/src/share/man/man7/hier.7" to include these directories.



Modify "/usr/src/share/mk/bsd.libnames.mk" to include a line for "libcapi20.a".





Integration of C4B into the system startup
==========================================

Note that the following hints are only valid for 5.1-RELEASE and up. Earlier versions are
not supported any more.



Files added to the source tree
------------------------------

	/usr/src/etc/rc.d/capibase
	
	/usr/src/etc/rc.d/avmaic
	/usr/src/etc/rc.d/daic
	/usr/src/etc/rc.d/ix1a
	
	/usr/src/etc/rc.d/i4bcapimgr

Modify "/user/src/etc/rc.d/Makefile" to include the above files in the list of files to
install.



Modify "/usr/src/etc/defaults/rc.conf"
--------------------------------------

Add the following text just before the settings for I4B:

### CAPI subsystem options: ###
capi_enable="NO"                # Enable the CAPI subsystem (YES or NO).
avmaic_enable="NO"              # Enable loading active AVM board firmware.
daic_enable="NO"                # Enable loading active Diehl board firmware.
ix1a_enable="NO"                # Enable loading active IX1 board firmware.

