ISDN4BSD (HPS version) is going into ports

Hans Petter Selasky hselasky at c2i.net
Wed Jan 9 09:14:19 UTC 2013


On Wednesday 09 January 2013 00:41:47 Andreas Longwitz wrote:
> Hans Petter Selasky wrote:
> 
> Hi,
> 
> i have continued to get my AVM Fritz!Card version 2 PCI card working
> with isdn4bsd using isdnd and there is some progress: D-channel works
> correct now with isdn4bsd 2.0.6 and the following patch:
> 
> --- i4b_filter.h.orig   2009-01-09 20:07:38.000000000 +0100
> +++ i4b_filter.h        2013-01-08 18:23:01.000000000 +0100
> @@ -158,6 +158,12 @@
>          (f->buf_len)     -= (io_len);
>          (f->Z_chip)      -= (io_len);
> 
> +        /* Hack:  <AVM Fritz!Card version 2 PCI> is ihfc1 */
> +        if((FIFO_NO(f) == d1r) && sc->sc_nametmp[4] == '1' ) {
> +           (f->buf_ptr)     -= 1;
> +           (f->buf_len)     += 1;
> +       }
> +
>         return;
>  }

Can you try the attached patch instead? And revert the one above?

> 
> I have analyzed the i4b_ifpi2_pci.c source from FreeBSD 6 (nearly
> identical to the NetBSD source ifpci2.c) and found that your patch
> brings us a step forward to the way the BSD-source ifpci2.c works.
> But there are some more differences between isdn4bsd and BSD:
> 
> 1. Access to the PCI bus via mem in isdn4bsd, via I/O port in BSD.
> 2. DELAY times on startup is different: 4 ms in isdn4bsd, 10 ms in BSD
> 3. Initializing the chip is more expansive in BSD, otherwise the
>    register cmdrd is only used in isdn4bsd.
> 4. In avm_pci_fifo_reset() we write two single bytes, but BSD does one
>    (atomic) four byte read. Particularly we do not write the HSCX_LEN
>    byte between the both written bytes (must set to 0 ?)
> 5. In avm_pci_b_status_read() - analog to 4. - we read two single bytes,
>    BSD (atomic) four bytes.
> 6. After an interrupt BSD checks explicit HSCX_INT_MASK before working,
>    Afterwords the use of HSCX_INT_RPR and HSCX_INT_XPR seems a little
>    bit different to me.
> 7. isdn4bsd and BSD both set HSCX_MODE_TRANS at startup, but BSD changes
>    this to HSCX_MODE_ITF_FLAG (ITF: interframe time fill) at the moment
>    a B-channel is coming up. Simultaneously the HSCX_CMD_RRS bit is
>    dropped (RRS = ?).

There is no specific reason. Some of this programming was guessed based on 
other drivers and common thinking in this area.

Please fix if something is wrong. However, note that my driver only uses 
transparent mode and HDLC emulation. This makes the driver much simpler.

> 
> Especially the last point does not have a counterpart in isdn4bsd - or I
> am wrong ?

--HPS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avm_pci.diff
Type: text/x-patch
Size: 4353 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-isdn/attachments/20130109/d1865c42/attachment.bin>


More information about the freebsd-isdn mailing list