Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Dec 2008 16:53:58 -0500
From:      Gabor <gabor@sentex.net>
To:        freebsd-usb@freebsd.org
Subject:   Re: ucom serial bug?
Message-ID:  <49385176.3070104@sentex.net>
In-Reply-To: <49382D74.1030907@sentex.net>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <gabor@sentex.net> 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 <hselasky@c2i.net> 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.



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