From owner-freebsd-usb@FreeBSD.ORG Thu Dec 4 21:54:02 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDD4D106564A for ; Thu, 4 Dec 2008 21:54:01 +0000 (UTC) (envelope-from gabor@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.freebsd.org (Postfix) with ESMTP id A1E998FC17 for ; Thu, 4 Dec 2008 21:54:01 +0000 (UTC) (envelope-from gabor@sentex.net) Received: from smtp2.sentex.ca (smtp2c.sentex.ca [64.7.153.30]) by smarthost1.sentex.ca (8.14.3/8.14.3) with ESMTP id mB4LrxIi065909 for ; Thu, 4 Dec 2008 16:53:59 -0500 (EST) (envelope-from gabor@sentex.net) Received: from pyroxene.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by smtp2.sentex.ca (8.14.3/8.14.3) with ESMTP id mB4LrxBM074057 for ; Thu, 4 Dec 2008 16:53:59 -0500 (EST) (envelope-from gabor@sentex.net) Received: from [192.168.43.153] ([192.168.43.153]) by pyroxene.sentex.ca (8.14.3/8.13.8) with ESMTP id mB4Lrw93041275 for ; Thu, 4 Dec 2008 16:53:58 -0500 (EST) (envelope-from gabor@sentex.net) Message-ID: <49385176.3070104@sentex.net> Date: Thu, 04 Dec 2008 16:53:58 -0500 From: Gabor User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: freebsd-usb@freebsd.org References: <200812041853.35539.hselasky@c2i.net> <20081204.111528.1723218601.imp@bsdimp.com> <49382349.5040804@sentex.net> <20081204.114842.-1540410064.imp@bsdimp.com> <49382D74.1030907@sentex.net> In-Reply-To: <49382D74.1030907@sentex.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on clamscanner2 X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.64 on 64.7.153.18 Subject: Re: ucom serial bug? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gabor@sentex.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2008 21:54:02 -0000 Some more twists to this. As I said if I kill off our program and restart it, it never sees carrier unless the module was reloaded. However, if I unplug the serial cable from the Windows box and re-plug it, carrier goes and comes back as expected but only as long as our software is running. If our software is not running and we unplug the serial cable from the Windows box, carrier does not come back when we start up our program with the cable plugged back in. On 12/4/08 2:20 PM, Gabor wrote: > Hi Warner, > > this patch did not seem to fix the issue. In fact this time after > unloading the module and reloading it, and then checking the carrier > doesn't raise carrier even on the first try. > > On 12/4/08 1:48 PM, M. Warner Losh wrote: >> In message: <49382349.5040804@sentex.net> >> Gabor writes: >> : Hi, >> : : thanks for looking at this issue. Are you guys saying that this >> was not meant to work? As in I shouldn't expect to see carrier? >> >> Ian Lepore sent me this patch a little while ago. I've not had time >> to look into it. If you could test it and let me know, then I'll be >> able to commit it more quickly. It is against a slightly hacked >> version of 6.1, but should translate right over. >> >> Warner >> >> Index: uftdi.c >> =================================================================== >> RCS file: /base/FreeBSD-tsc-6/sys/dev/usb/uftdi.c,v >> retrieving revision 1.2 >> diff -u -r1.2 uftdi.c >> --- uftdi.c 24 Sep 2007 21:37:33 -0000 1.2 >> +++ uftdi.c 14 Nov 2008 18:17:02 -0000 >> @@ -457,13 +457,24 @@ >> { >> struct uftdi_softc *sc = vsc; >> u_char msr, lsr; >> + u_char ftdi_msr; >> >> DPRINTFN(15,("uftdi_read: sc=%p, port=%d count=%d\n", sc, portno, >> *count)); >> >> - msr = FTDI_GET_MSR(*ptr); >> + ftdi_msr = FTDI_GET_MSR(*ptr); >> lsr = FTDI_GET_LSR(*ptr); >> >> + msr = 0; >> + if (ftdi_msr & FTDI_SIO_CTS_MASK) >> + msr |= SER_CTS; >> + if (ftdi_msr & FTDI_SIO_DSR_MASK) >> + msr |= SER_DSR; >> + if (ftdi_msr & FTDI_SIO_RI_MASK) >> + msr |= SER_RI; >> + if (ftdi_msr & FTDI_SIO_RLSD_MASK) >> + msr |= SER_DCD; >> + >> #ifdef USB_DEBUG >> if (*count != 2) >> DPRINTFN(10,("uftdi_read: sc=%p, port=%d count=%d data[0]=" >> >> : : On 12/4/08 1:15 PM, M. Warner Losh wrote: >> : > In message: <200812041853.35539.hselasky@c2i.net> >> : > Hans Petter Selasky writes: >> : > : On Thursday 04 December 2008, Mike Tancsa wrote: >> : > : > At 02:33 PM 12/3/2008, Gabor wrote: >> : > : > >everything works fine. When we try to use a USB to serial >> : > : > >converter(type doesn't matter, UFTDI or Prolific) we run into >> : > : > >problems. The first time we start up our side, everything >> : > : > >works. The second time we don't get carrier(DCD). The other >> side >> : > : > >is always running. Since we have no control >> : > : > >> : > : > Also tried with the usb2 development stack, and we never see >> carrier. >> : > : > >> : > : > Id Refs Address Size Name >> : > : > 1 20 0xc0400000 9f8014 kernel (/boot/kernel/kernel) >> : > : > 2 1 0xc4b95000 3000 usb2_serial_ftdi.ko >> : > : > (/boot/kernel/usb2_serial_ftdi.ko) >> : > : > 3 5 0xc4b99000 36000 usb2_core.ko >> (/boot/kernel/usb2_core.ko) >> : > : > 4 1 0xc4c56000 4000 usb2_serial.ko >> (/boot/kernel/usb2_serial.ko) >> : > : > 5 1 0xc4cb4000 a000 usb2_controller_uhci.ko >> : > : > (/boot/kernel/usb2_controller_uhci.ko) >> : > : > 6 2 0xc4cbe000 3000 usb2_controller.ko >> : > : > (/boot/kernel/usb2_controller.ko) >> : > : > 7 1 0xc4d50000 d000 usb2_controller_ehci.ko >> : > : > (/boot/kernel/usb2_controller_ehci.ko) >> : > : > >> : > : : > : Hi, >> : > : : > : I think this event is not implemented in the driver. Try >> to diff the NetBSD : > : and FreeBSD uftdi.c files. >> : > : > I have some diffs in my inbox from someone that was trying to >> : > implement modem control for uftdi chips. Let me see if they make >> : > sense... >> : > : > Warner >> : > _______________________________________________ >> : > freebsd-usb@freebsd.org mailing list >> : > http://lists.freebsd.org/mailman/listinfo/freebsd-usb >> : > To unsubscribe, send any mail to >> "freebsd-usb-unsubscribe@freebsd.org" >> : > : : -- : Success is the result when preparation meets opportunity. >> : _______________________________________________ >> : freebsd-usb@freebsd.org mailing list >> : http://lists.freebsd.org/mailman/listinfo/freebsd-usb >> : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" >> : : > -- Success is the result when preparation meets opportunity.