* ttyUSB sendbreak problem
@ 2009-02-16 23:29 Jean-Denis Girard
2009-02-17 0:22 ` Thiago Galesi
2009-02-17 3:14 ` Greg KH
0 siblings, 2 replies; 3+ messages in thread
From: Jean-Denis Girard @ 2009-02-16 23:29 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-usb
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I'm writing a program which communicates via modem with an embedded
device (electrical network monitoring). The frames are terminated by a
BREAK.
My program works fine when I use a Cyclades 8Yo multiports card, but
fails using USB to serial adapters (tried with pl2303 and FTDI
converters). I suspect that the BREAK are not passed correctly, but I
don't have equipment to check.
I've tried with:
tcsendbreak(modem,0);
ioctl(modem, TCSBRK,0);
ioctl(modem, TCSBRKP, 0);
- From pl2303 debug mode, I see that pl2303_break_ctl is called:
drivers/usb/serial/pl2303.c: pl2303_break_ctl - port 0
drivers/usb/serial/pl2303.c: pl2303_break_ctl - turning break on
drivers/usb/serial/pl2303.c: pl2303_write_bulk_callback - port 0
drivers/usb/serial/pl2303.c: pl2303_send - port 0
drivers/usb/serial/pl2303.c: pl2303_break_ctl - port 0
drivers/usb/serial/pl2303.c: pl2303_break_ctl - turning break off
I found a few references of similar problems in the past, but it was for
older kernels (I'm using 2.6.28.4), so the question remains: should it
work or is there a known problem sending BREAK using ttyUSB?
Thanks,
- --
Jean-Denis Girard
SysNux Systèmes Linux en Polynésie française
http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27
-----BEGIN PGP SIGNATURE-----
iEYEARECAAYFAkmZ9sgACgkQuu7Rv+oOo/iFuQCeJSaxikghrQhjS68WKU0Hc//7
wZQAn2XMnmunfW2avO/uPFQDrw+s9INO
=AB0j
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ttyUSB sendbreak problem
2009-02-16 23:29 ttyUSB sendbreak problem Jean-Denis Girard
@ 2009-02-17 0:22 ` Thiago Galesi
2009-02-17 3:14 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Thiago Galesi @ 2009-02-17 0:22 UTC (permalink / raw)
To: Jean-Denis Girard; +Cc: linux-kernel, linux-usb
And in this case BREAK is which character?? 0x00?
Anyway, take a look at the stty options and man termios (even though
they may do what your IOCTL is doing)
Also explain what's happening exactly: what does "but
> fails using USB to serial adapters" mean.
On Mon, Feb 16, 2009 at 8:29 PM, Jean-Denis Girard <jd.girard@sysnux.pf> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi list,
>
> I'm writing a program which communicates via modem with an embedded
> device (electrical network monitoring). The frames are terminated by a
> BREAK.
>
> My program works fine when I use a Cyclades 8Yo multiports card, but
> fails using USB to serial adapters (tried with pl2303 and FTDI
> converters). I suspect that the BREAK are not passed correctly, but I
> don't have equipment to check.
>
> I've tried with:
> tcsendbreak(modem,0);
> ioctl(modem, TCSBRK,0);
> ioctl(modem, TCSBRKP, 0);
>
> - From pl2303 debug mode, I see that pl2303_break_ctl is called:
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - port 0
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - turning break on
> drivers/usb/serial/pl2303.c: pl2303_write_bulk_callback - port 0
> drivers/usb/serial/pl2303.c: pl2303_send - port 0
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - port 0
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - turning break off
>
> I found a few references of similar problems in the past, but it was for
> older kernels (I'm using 2.6.28.4), so the question remains: should it
> work or is there a known problem sending BREAK using ttyUSB?
>
>
> Thanks,
> - --
> Jean-Denis Girard
>
> SysNux Systèmes Linux en Polynésie française
> http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27
> -----BEGIN PGP SIGNATURE-----
>
> iEYEARECAAYFAkmZ9sgACgkQuu7Rv+oOo/iFuQCeJSaxikghrQhjS68WKU0Hc//7
> wZQAn2XMnmunfW2avO/uPFQDrw+s9INO
> =AB0j
> -----END PGP SIGNATURE-----
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
-
Thiago Galesi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ttyUSB sendbreak problem
2009-02-16 23:29 ttyUSB sendbreak problem Jean-Denis Girard
2009-02-17 0:22 ` Thiago Galesi
@ 2009-02-17 3:14 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-02-17 3:14 UTC (permalink / raw)
To: Jean-Denis Girard; +Cc: linux-kernel, linux-usb
On Mon, Feb 16, 2009 at 01:29:12PM -1000, Jean-Denis Girard wrote:
> Hi list,
>
> I'm writing a program which communicates via modem with an embedded
> device (electrical network monitoring). The frames are terminated by a
> BREAK.
>
> My program works fine when I use a Cyclades 8Yo multiports card, but
> fails using USB to serial adapters (tried with pl2303 and FTDI
> converters). I suspect that the BREAK are not passed correctly, but I
> don't have equipment to check.
Odd, pl2303 should support break just fine.
> I've tried with:
> tcsendbreak(modem,0);
> ioctl(modem, TCSBRK,0);
> ioctl(modem, TCSBRKP, 0);
>
> From pl2303 debug mode, I see that pl2303_break_ctl is called:
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - port 0
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - turning break on
> drivers/usb/serial/pl2303.c: pl2303_write_bulk_callback - port 0
> drivers/usb/serial/pl2303.c: pl2303_send - port 0
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - port 0
> drivers/usb/serial/pl2303.c: pl2303_break_ctl - turning break off
>
> I found a few references of similar problems in the past, but it was for
> older kernels (I'm using 2.6.28.4), so the question remains: should it
> work or is there a known problem sending BREAK using ttyUSB?
It should work, but your specific device might not support the break
control (some seem to and others don't.) It's a very cheap device.
You might want to try a more expensive device, like the io networks
devices, break on them should work just fine as they have a "real" uart
device within them.
good luck,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-17 3:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-16 23:29 ttyUSB sendbreak problem Jean-Denis Girard
2009-02-17 0:22 ` Thiago Galesi
2009-02-17 3:14 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox