Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Aug 2002 14:51:02 +0200
From:      <hselasky@c2i.net>
To:        freebsd-isdn@freebsd.org
Subject:   New ihfc driver
Message-ID:  <20020823125105.EQHE29728.fep01-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.

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

Hi.

I've been working on a new driver for
i4b supporting some (new) cards. The driver does not include DOV support,
and if there has been any other commits this summer (after MAY) I
would be glad if someone could make and send me patches against
my driver. Please see attachment for more information.

About the HFC PCMIA support the PCMIA version should work, given
internal IO and IRQ are right. If someone could send me the wiring of
the chip to the PCMIA slot + other chips on the card + PnP/PCI id if
present, I could write the tables needed for automatic setup and add
it to my driver.

--
Yours
   HPS

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

------=____1030107062407_R)SYISCpjH
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_1.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)
	- 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

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

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:

# 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
------=____1030107062407_R)SYISCpjH--


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?20020823125105.EQHE29728.fep01-svc.swip.net>