From owner-freebsd-isdn Mon Oct 7 9:58: 7 2002 Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E042637B401 for ; Mon, 7 Oct 2002 09:58:01 -0700 (PDT) Received: from nexus.tmp.com.br (nexus.tmp.com.br [200.255.204.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 280A243E3B for ; Mon, 7 Oct 2002 09:57:59 -0700 (PDT) (envelope-from prallon@nexus.tmp.com.br) Received: (from prallon@localhost) by nexus.tmp.com.br (8.8.8/8.8.8) id NAA15012; Mon, 7 Oct 2002 13:57:49 -0300 Date: Mon, 7 Oct 2002 13:57:49 -0300 From: Sergio de Souza Prallon To: hselasky@c2i.net Cc: freebsd-isdn@freebsd.org Subject: Re: New ihfc driver Message-ID: <20021007135749.A14322@tmp.com.br> References: <20021007144117.CCC23699.fep03-svc.swip.net@mta-int.swip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20021007144117.CCC23699.fep03-svc.swip.net@mta-int.swip.net>; from hselasky@c2i.net on Mon, Oct 07, 2002 at 04:41:17PM +0200 X-URL: http://www.tmp.com.br Sender: owner-freebsd-isdn@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, From the fragment below I noticed that your driver also works with the Tiger chips. In fact,if I understood right, it can replace the entire set of layer drivers. Apparently you tried very hard to eliminate duplicated code spread among the various drivers, what is, IMHO, a `Good Thing' (tm). The only critic I do is the legibility of the code. In a brief look I've made, I didn't manage to grasp how the gears of your "macro driver programing language" work under the hood. There isn't another, a bit more readable, way around it? Do you have a -STABLE version of your driver? I want to give it a try but an upgrade to -CURRENT is out of question. May be I learn a thing or two from the experience as it was the case with the HDLC macros. []'s -- Prallon On Mon, Oct 07, 2002 at 04:41:17PM +0200, hselasky@c2i.net wrote: > 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 > ------------------------------------------------- > 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isdn" in the body of the message