Date: Thu, 04 Dec 2008 17:37:23 -0500 From: Mike Tancsa <mike@sentex.net> To: Hans Petter Selasky <hselasky@c2i.net>, freebsd-usb@freebsd.org Subject: Re: ucom serial bug? Message-ID: <200812042237.mB4MbWLK018707@lava.sentex.ca> In-Reply-To: <200812042320.48818.hselasky@c2i.net> References: <200812041853.35539.hselasky@c2i.net> <49382D74.1030907@sentex.net> <49385176.3070104@sentex.net> <200812042320.48818.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
At 05:20 PM 12/4/2008, Hans Petter Selasky wrote: >On Thursday 04 December 2008, Gabor wrote: > > 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. > >Maybe you can try setting the MSR to zero when the modem is opened in the >uftdi.c driver file. > >In USB2 there is also a sysctl for UFTDI debugging which you can check. Hi, In the regular USB stack, I did run it with some debugging enabled. The diff between the first run and the second run is below using Gabor's check carrier program I havent tried with debugging enabled and just pulling the serial cable out yet. I will try that tomorrow when back at the office! In terms of setting the MSR to zero, do you mean in static int uftdi_open(void *vsc, int portno) ? First run where the program sees carrier : ucom0 on uhub3 : ucomtty_param: sc = 0xc47faa80 : ucomstopread: enter : ucomstopread: bulkin pipe NULL : uftdi_param: sc=0xc47faa80 : ucomstartread: start : ucom_dtr: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=1 : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : ucom0: ucomtty_open: tp = 0xc4c7c800 : ucom_dtr: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=1 : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : uftdi_open: sc=0xc47faa80 : uftdi_param: sc=0xc47faa80 : ucomtty_open: open pipes in = 129 out = 2 : ucomstartread: start : ucomioctl: cmd = 0x402c7413 : ucomioctl: cmd = 0x802c7414 : ucomtty_param: sc = 0xc47faa80 : ucomstopread: enter : ucomreadcb: status = 6 : ucomstopread: leave : uftdi_param: sc=0xc47faa80 : ucomstartread: start : ucomioctl: cmd = 0x8004667e : ucomioctl: cmd = 0x8004667d : ucomioctl: cmd = 0x4004746a : ucomioctl: cmd = 0x4004746a : ucomioctl: cmd = 0x8004746d : ucom_dtr: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=1 : ucomreadcb: status = 0 : ucomreadcb: got 2 chars, tp = 0xc4c7c800 : uftdi_read: status change msr=0xb0(0x00) lsr=0x60(0x00) : uftdi_status: msr=0xb0 lsr=0x60 : ucom_status_change: about to check sc->sc_poll it is 1 : ucom_status_change: DCD changed to 1 : ucomstartread: start : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : ucomioctl: cmd = 0x4004746a : ucom0: ucomtty_close : ucom_cleanup: closing pipes : ucom_shutdown : ucom_dtr: onoff = 0 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=0 : ucomreadcb: status = 0 : ucomreadcb: got 2 chars, tp = 0xc4c7c800 : uftdi_read: status change msr=0x00(0xb0) lsr=0x60(0x60) : uftdi_status: msr=0x00 lsr=0x60 : ucom_status_change: about to check sc->sc_poll it is 1 : ucom_status_change: DCD changed to 0 : ucomstartread: start : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : ucomreadcb: status = 0 : ucomreadcb: got 2 chars, tp = 0xc4c7c800 : uftdi_read: status change msr=0xb0(0x00) lsr=0x60(0x60) : uftdi_status: msr=0xb0 lsr=0x60 : ucom_status_change: about to check sc->sc_poll it is 1 : ucom_status_change: DCD changed to 1 : ucomstartread: start : ucomreadcb: status = 6 and second run, where it does not : ucomtty_param: sc = 0xc47faa80 : ucomstopread: enter : ucomstopread: leave : uftdi_param: sc=0xc47faa80 : ucomstartread: start : ucom_dtr: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=1 : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : ucom0: ucomtty_open: tp = 0xc4c7c800 : ucom_dtr: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=1 : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : uftdi_open: sc=0xc47faa80 : uftdi_param: sc=0xc47faa80 : ucomtty_open: open pipes in = 129 out = 2 : ucomstartread: start : ucomioctl: cmd = 0x402c7413 : ucomioctl: cmd = 0x802c7414 : ucomtty_param: sc = 0xc47faa80 : ucomstopread: enter : ucomreadcb: status = 6 : ucomstopread: leave : uftdi_param: sc=0xc47faa80 : ucomstartread: start : ucomioctl: cmd = 0x8004667e : ucomioctl: cmd = 0x8004667d : ucomioctl: cmd = 0x4004746a : ucomioctl: cmd = 0x4004746a : ucomioctl: cmd = 0x8004746d : ucom_dtr: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=1 : ucomreadcb: status = 0 : ucomreadcb: got 2 chars, tp = 0xc4c7c800 : ucomstartread: start : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : ucomioctl: cmd = 0x4004746a : ucom0: ucomtty_close : ucom_cleanup: closing pipes : ucom_shutdown : ucom_dtr: onoff = 0 : uftdi_set: sc=0xc47faa80, port=1 reg=1 onoff=0 : ucomreadcb: status = 0 : ucomreadcb: got 2 chars, tp = 0xc4c7c800 : uftdi_read: status change msr=0x00(0xb0) lsr=0x60(0x60) : uftdi_status: msr=0x00 lsr=0x60 : ucomstartread: start : ucom_rts: onoff = 1 : uftdi_set: sc=0xc47faa80, port=1 reg=2 onoff=1 : ucomreadcb: status = 0 : ucomreadcb: got 2 chars, tp = 0xc4c7c800 : uftdi_read: status change msr=0xb0(0x00) lsr=0x60(0x60) : uftdi_status: msr=0xb0 lsr=0x60 : ucom_status_change: about to check sc->sc_poll it is 1 : ucom_status_change: DCD changed to 1 : ucomstartread: start : ucomreadcb: status = 6 % diff a b 2d1 < : ucom0 on uhub3 5c4 < : ucomstopread: bulkin pipe NULL --- > : ucomstopread: leave 38,41d36 < : uftdi_read: status change msr=0xb0(0x00) lsr=0x60(0x00) < : uftdi_status: msr=0xb0 lsr=0x60 < : ucom_status_change: about to check sc->sc_poll it is 1 < : ucom_status_change: DCD changed to 1 55,56d49 < : ucom_status_change: about to check sc->sc_poll it is 1 < : ucom_status_change: DCD changed to 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812042237.mB4MbWLK018707>