ucom serial bug?
Gabor
gabor at sentex.net
Thu Dec 4 13:15:05 PST 2008
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.
More information about the freebsd-usb
mailing list