Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Dec 2008 16:15:00 -0500
From:      Gabor <gabor@sentex.net>
To:        freebsd-usb@freebsd.org
Subject:   Re: ucom serial bug?
Message-ID:  <49384854.8000008@sentex.net>
In-Reply-To: <200812042141.20836.hselasky@c2i.net>
References:  <200812041853.35539.hselasky@c2i.net> <20081204.114842.-1540410064.imp@bsdimp.com> <49382D74.1030907@sentex.net> <200812042141.20836.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/ioccom.h>
  #include <sys/fcntl.h>
  #include <sys/conf.h>
+#include <sys/serial.h>
  #include <sys/tty.h>
  #include <sys/file.h>

@@ -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.



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