Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2013 16:07:05 +0100
From:      Andreas Longwitz <longwitz@incore.de>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-isdn@freebsd.org
Subject:   Re: ISDN4BSD (HPS version) is going into ports
Message-ID:  <50F41F19.2050205@incore.de>
In-Reply-To: <201301111150.47312.hselasky@c2i.net>
References:  <509E87EF.9070607@incore.de> <201301101756.16289.hselasky@c2i.net> <50EF40E4.7030805@incore.de> <201301111150.47312.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hans Petter Selasky wrote:

> Can you try to add a printf in "src/sys/i4b/driver/i4b_isppp.c":
> 
> static void
> i4bisppp_start(struct ifnet *ifp)
> {
>         struct i4bisppp_softc *sc = ifp->if_softc;
> 
>  printf("ifp=%p sc=%p\n", sc, ifp);
> 
> is the "sc" NULL ?

No, I get ifp=0xc0c1f380 sc=0xc5532800 for every try for an outgoing
message.

I had to modify my i4b_filter.h hack for eliminating the last byte of
every incoming D-channel message (not every incoming frame). Now
D-channel works for outgoing and incoming calls (SETUP length > 32 byte)
and also for long FACILITY messages of my provider. The patch is against
2.0.6:

--- i4b_filter.h.orig   2009-01-09 20:07:38.000000000 +0100
+++ i4b_filter.h        2013-01-14 15:29:56.000000000 +0100
@@ -158,6 +158,12 @@
     (f->buf_len)     -= (io_len);
     (f->Z_chip)      -= (io_len);

+    /* Hack for <AVM Fritz!Card version 2 PCI> */
+    if((FIFO_NO(f) == d1r) && (sc->sc_d1r_fifo_strip_last_byte == 1)) {
+           (f->buf_ptr)     -= 1;
+           (f->buf_len)     += 1;
+    }
+
     return;
 }

--- i4b_ihfc2.h.orig    2011-05-23 23:42:32.000000000 +0200
+++ i4b_ihfc2.h 2013-01-13 23:13:56.000000000 +0100
@@ -2583,7 +2583,7 @@
        struct usb_callout      sc_pollout_timr;      /* T50 ms  */
        struct usb_callout      sc_pollout_timr_wait; /* T125 us */

-       u_int8_t                sc_buffer[1024];
+       u_int8_t                sc_buffer[1024] __aligned(4);

        struct sc_fifo *        sc_fifo_select_last; /* used by
                                                      * FIFO_SELECT(,)
@@ -2600,6 +2600,8 @@

        u_int16_t               sc_f0_counter_offset;
        u_int32_t               sc_f0_counter_last;
+
+       u_int8_t                sc_d1r_fifo_strip_last_byte;
 };

--- i4b_avm_pci.h.orig  2012-11-26 22:37:23.000000000 +0100
+++ i4b_avm_pci.h       2013-01-14 12:27:31.000000000 +0100


                IHFC_MSG("ista_d=0x%02x\n", ista_d);

+               sc->sc_d1r_fifo_strip_last_byte = 0;
                if(ista_d & 0x80 /* RME */)
                {
                    /* read RBCL (ISAC) */
@@ -347,6 +348,7 @@
                    /* read RSTA (ISAC) */
                    avm_pci_chip_read(sc, REG_isacsx_rstad, &temp, 1);
                    sc->sc_fifo[d1r].F_chip = temp;
+                   sc->sc_d1r_fifo_strip_last_byte = 1;
                }

                /* RME or RPF - D channel receive */

For an incoming call I now see correct data in B-channel.

avm_pci_b_status_read: len=32:
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
avm_pci_b_status_read: len=32:
0xf3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3
... 12 repeats of last frame ...
avm_pci_b_status_read: len=18: 0xff03c02101b0000e0506693e5e370304c023
avm_pci_b_status_read: len=18: 0xff03c02101b1000e0506693e5e370304c023
avm_pci_b_status_read: len=18: 0xff03c02101b2000e0506693e5e370304c023
avm_pci_b_status_read: len=18: 0xff03c02101b3000e0506693e5e370304c023
...

The frames of length 18 are exactly the frames I see on the remote side
by isdndecode. But my local isdndecode does not see these B-channel
messages, I don't know why.

---
Andreas Longwitz




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50F41F19.2050205>