Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Oct 2002 16:41:17 +0200
From:      <hselasky@c2i.net>
To:        freebsd-isdn@freebsd.org
Subject:   New ihfc driver
Message-ID:  <20021007144117.CCC23699.fep03-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.

------=____1034001677145_I.C2G'rDRh
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi.

There is another version of new_ihfc available. For more information please see
attached file driver_info.txt.

Some bugs have been fixed:
	- ifpi2: had a missing include file which broke LINT
	- memset was replaced with a local copy due to a compile issue which
	caused TIGERJET to send 0x00 instead of 0xff on
	IOM2 bus.
	- code should be sync with current unless new
	patches have been committed since last week.
                - All B-channels should now work with wibusb.
                - with some luck LINT should compile.

Yours
 - HPS


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

------=____1034001677145_I.C2G'rDRh
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_3.tar.bz2

A diff has also been made for existing files (not the new ones) so that
it is easier to check where changes have been made, hence current may
change.

http://home.c2i.net/hselasky/isdn4bsd/privat/temporary/new_ihfc_0_3.diff.bz2

NOTE:

This code should work with the current sources of 2. of October 2002. Using this
driver with earlier current sources may break other drivers, but new_ihfc.

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

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 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.

4. (local patch)

memset in ../sys/libkern.h does not work when sizeof(*src) > sizeof(char)
(reason unknown, maybe a compiler issue)

TODO:
===== 

1. Currently freeing an mbuf takes ``so long time'' that if it is done
before an 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
i4b/layer1/i4b_hdlc.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"
device "i4bq931"
device "i4b"
device "i4btrc"   8
device "i4bctl"
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

------=____1034001677145_I.C2G'rDRh--


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?20021007144117.CCC23699.fep03-svc.swip.net>