Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2002 22:04:59 +0200
From:      <hselasky@c2i.net>
To:        freebsd-isdn@freebsd.org
Subject:   New ihfc driver
Message-ID:  <20020916200459.CQMY27518.fep04-svc.swip.net@mta-int.swip.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=____1032206699294_17x3RzVyy2
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi.

There is a new version of the new_ihfc driver available
for download. Please see attachment for more information.

Some changes:

A compability issue in the hdlc encoder has been fixed; Hardware decoders should no longer complain about missing bits (superflous bits), which the original encoder had compressed. See encoder file for more information. Also D-channel encoding support has been added.

An issue with the HFC-SP in polled mode has been
fixed.

Support for Asuscom ISDNLink 128K (USB - model TA-280-ST - WINBOND 6694) has been added (experimental, not finished)

LINT should compile.

Yours HPS

-------------------------------------------------
WebMail fra Tele2 http://www.tele2.no
-------------------------------------------------

------=____1032206699294_17x3RzVyy2
Content-Type: text/plain;
	name="driver_info.txt"
Content-Disposition: inline;
	filename="driver_info.txt"

For developers and others wanting to help debug:

Driver can be downloaded from:

http://home.c2i.net/hselasky/isdn4bsd/privat/temporary/new_ihfc_0_2.tar.bz2

List of new features currently not found in I4B:
	- Driver uses mutexes to protect chip access.
	- Direct access to D-channel and B-channel(not finished, but works)
	- D-channel encoding support.
	- Support for:
           - NT-mode (IPAC chips support line switch instead)
	   - data filters (``as plug-ins'')
	   - drivers (``as plug-ins'')
	   - polled interrupt mode
	   - chip reset
	   - HFCS-PCI
	   - USB (experimental, not all B-channels are functional)

About the driver:
=================

The driver supports generic IPAC/ISAC/HSCX/HFC chips and allows the
drivers to emulate behind one or more of those chips. As a consequence
of this any ring-buffer (``weird buffering'') or block-buffer isdn
device can easily be implemented with a minimum of code. To have more
people being able to test the driver there has been added support for
some cards already found in ISDN4BSD.  Please see the new_ihfc.4
manual.

NOTE: Only HFC based and Dynalink compatible cards have been tested.
Please send patches using `diff -crN` and include the complete file
if the patch is big.
NOTE: Code outside of i4b/layer1/ was rewritten.

Possible kernel bugs found:
===========================

1. (not patched, only temporary workaround)

In the function 

static int
isa_find_irq(device_t child,
             struct isa_config *config,
             struct isa_config *result)

the following lines have been added, though it is bus_alloc_resource
that doesn't check that RF_SHAREABLE is not present?!

                                /* Don't share IRQ unless the driver wants */
                                if(res[i]->r_sharehead) {
                                        bus_release_resource(child,
                                                        SYS_RES_IRQ, i, res[i]);
                                        res[i] = 0;
                                        continue;
                                }

2. (not patched, only temporary workaround)

the function device_get_namenunit(dev) in /sys/kern/subr_bus.c
returns one text pointer value at probe time and another after
attach. device_get_nameunit(dev) should be considered the same way as
device_get_softc(dev) in my opinion.

3. (no patch)

when using Polled mode the KERNEL provides no function to switch the
interrupt output of a card to an unused pin. All PnP controllers
should support this (and maybe PCI controllers too), but there are no
routines to call that will do this!  Currently only HFC chips support
switching of IRQ in hardware, any maybe the old ISA cards if you can
remove the IRQ jumper! This might be interesting for people wanting to
use their old ISA cards, but doesn't want to spend time on
configuration.

TODO:
=====
1. Currently freeing an mbuf takes ``so long time'' that if it is done
before ISAC/HSCX cmdr write, that command may fail (no fix). Is this
a mutex sleeping problem? Also when switching the console there
may occur glitches in the output stream. Maybe ISDN4BSD should
use a fixed ring of mbufs to speed up allocation and freeing?
Some tests in polled mode showed that enabling the Giant
mutex before interrupt call caused an extra delay in the range
10ms!

How to install:
=============

1. manually add these lines to /sys/conf/files.i386
   at the line saying:

#
# isdn4bsd, needed for isic | iwic | ifpi | ifpi2 | ihfc | ifpnp | itjc
#
# add this:
i4b/layer1/i4b_l1dmux.c         	optional        new_ihfc
i4b/layer1/i4b_l1lib.c          	optional        new_ihfc
#
# and this:
#
# isdn4bsd, new_ihfc
#
i4b/layer1/ihfc2/i4b_ihfc2_l1if.c	optional	new_ihfc
i4b/layer1/ihfc2/i4b_ihfc2_pnp.c	optional	new_ihfc
i4b/layer1/ihfc2/i4b_ihfc2_drv.c	optional	new_ihfc
i4b/layer1/ihfc2/i4b_ihfc2_dev.c	optional	new_ihfc

2. make sure the following lines are in your kernel
   configuration file: (NOTE: please only use one of new_ihfc
   and (ihfc or isic or itjc) at a time)

# I4B section
options IPR_VJ
device "i4bq921" 1
device "i4bq931" 1
device "i4b"     1
device "i4btrc"   8
device "i4bctl"  1
device "i4brbch"  8
device "i4btel"   8
device "i4bipr"   8
device "i4bisppp" 8

device new_ihfc

3. make backup of these directories if you don't want to
   develop the driver

mkdir /usr/i4b_bak || exit
mkdir /usr/i4b_bak/sys || exit

cp -rv /usr/include/machine /usr/i4b_bak/
cp -rv /usr/src/sys/i386/include /usr/i4b_bak/sys/
cp -rv /usr/src/usr.sbin/i4b /usr/i4b_bak/
cp -rv /usr/src/sys/i4b /usr/i4b_bak/sys/
cp -rv /usr/src/sys/isa/isa_common.c /usr/i4b_bak/

rm -rv /usr/src/sys/i4b/*

4. install the driver like this

tar -jxvf new_ihfc*.tar.bz2 -C /usr/src/

cp -rv /usr/src/sys/i386/include/*i4b* /usr/include/machine/

5. run your kernel configuration script

6. recompile the kernel (remove all *i4b*.o files
   from the compile directory or make clean build)

7. hopefully no errors should occur during
   compilation.

8. after the kernel has been compiled recompile isdndebug and
   manual pages (`man new_ihfc' should work afterwards)

   cd /usr/src/usr.sbin/i4b/
   make all install

9. make a backup of the old kernel in case
   it doesn't work.

10. reboot

-HPS

------=____1032206699294_17x3RzVyy2--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020916200459.CQMY27518.fep04-svc.swip.net>