From owner-freebsd-usb@FreeBSD.ORG Thu Dec 4 21:15:05 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 C780B106564A for ; Thu, 4 Dec 2008 21:15:05 +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 735E88FC1B for ; Thu, 4 Dec 2008 21:15:05 +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 mB4LF1kA057018; Thu, 4 Dec 2008 16:15:01 -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 mB4LF0Vq071539; Thu, 4 Dec 2008 16:15:01 -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 mB4LF0wg040683; Thu, 4 Dec 2008 16:15:00 -0500 (EST) (envelope-from gabor@sentex.net) Message-ID: <49384854.8000008@sentex.net> Date: Thu, 04 Dec 2008 16:15:00 -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.114842.-1540410064.imp@bsdimp.com> <49382D74.1030907@sentex.net> <200812042141.20836.hselasky@c2i.net> In-Reply-To: <200812042141.20836.hselasky@c2i.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 clamscanner3 X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.64 on 64.7.153.18 Cc: 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:15:05 -0000 Hi Hans, we just tested against RELENG_7 with the patch and we get the same behaviour. First time we get carrier but not on the second or subsequent try. Here is the patch we used. --- uftdi.c.orig 2008-12-04 15:54:42.000000000 -0500 +++ uftdi.c 2008-12-04 15:54:45.000000000 -0500 @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -457,13 +458,25 @@ { 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 3:41 PM, Hans Petter Selasky wrote: > On Thursday 04 December 2008, 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. >> > > Can it be that the new mpsafetty layer does not remember the TTY state (MSR > bits) betweeen two open/close sessions ? > > The uftdi driver will only report deltas in the MSR register. > > --HPS > -- Success is the result when preparation meets opportunity.