From owner-freebsd-isdn@FreeBSD.ORG Mon Jan 14 15:07:18 2013 Return-Path: Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A4B5C98 for ; Mon, 14 Jan 2013 15:07:18 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id 924A6E60 for ; Mon, 14 Jan 2013 15:07:17 +0000 (UTC) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id CA4985C942; Mon, 14 Jan 2013 16:07:09 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id pMzxSV0OBNWf; Mon, 14 Jan 2013 16:07:08 +0100 (CET) Received: from mail.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 07B365C94D; Mon, 14 Jan 2013 16:07:06 +0100 (CET) Received: from bsdlo.incore (bsdlo.incore [192.168.0.84]) by mail.incore (Postfix) with ESMTP id 00E2250875; Mon, 14 Jan 2013 16:07:05 +0100 (CET) Message-ID: <50F41F19.2050205@incore.de> Date: Mon, 14 Jan 2013 16:07:05 +0100 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Hans Petter Selasky Subject: Re: ISDN4BSD (HPS version) is going into ports References: <509E87EF.9070607@incore.de> <201301101756.16289.hselasky@c2i.net> <50EF40E4.7030805@incore.de> <201301111150.47312.hselasky@c2i.net> In-Reply-To: <201301111150.47312.hselasky@c2i.net> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Cc: freebsd-isdn@freebsd.org X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2013 15:07:18 -0000 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 */ + 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