http://bugs.winehq.org/show_bug.cgi?id=11339
Summary: serial.c:wait_on() sanity checks seem to be too strict Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: e_val@inbox.ru
Created an attachment (id=10448) --> (http://bugs.winehq.org/attachment.cgi?id=10448) Trivial patch to fix the problem
In its present state, wait_on() function implemented in ntdll/serial.c fails more often then it should. This means that in some cases serial events are not reported to the calling Windows program (even if in practice they could be) leading to application malfunction.
The problem is in the sanity check: if ((status = get_irq_info(fd, &commio->irq_info)) || (status = get_modem_status(fd, &commio->mstat))) goto out_now;
which bails out and silently returns 0 if low-level Unix kernel driver for serial device doesn't implement TIOCGICOUNT or TIOCMGET ioctl()s. This is, in fact, intended behavior if the calling program wants to monitor events like EV_BREAK, EV_ERR or EV_CTS and friends (otherwise, Wine will loop forever in wait_for_event()) but is useless and even harmful if the event in interest is EV_RXCHAR or EV_TXEMPTY. In latter case the check just prevents the program from working correctly.
I've came across this bug when trying to make control software for AnyData CDMA modems (EasyWirelessNet 1.00.xx) working. In Linux, those devices use "option" driver, which lacks TIOCGICOUNT ioctl().
The trivial patch is attached. It's not against git clone of Wine so it is not meant for applying directly.
http://bugs.winehq.org/show_bug.cgi?id=11339
--- Comment #1 from Austin English austinenglish@gmail.com 2008-01-26 04:59:50 --- Please submit patch to wine-patches@winehq.org
http://bugs.winehq.org/show_bug.cgi?id=11339
--- Comment #2 from Valentine Sinitsyn e_val@inbox.ru 2008-01-26 05:57:41 ---
It's not against git clone of Wine so it is not
meant for applying directly.
The patch doesn't fulfill requirements for code sent for inclusion into mainline git tree (although I use it in my everyday work with Wine and it works fine). It would be nice if someone from Wine developers team confirm that the problem is not NOTABUG/WONTFIX; if so, I'll put the patch into required form and send it to wine-patches.
http://bugs.winehq.org/show_bug.cgi?id=11339
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch OS/Version|other |Linux
--- Comment #3 from Vitaliy Margolen vitaliy@kievinfo.com 2008-01-26 10:30:55 --- At the very minimum you should send a note to wine-devel list. People who have knowledge about serial ports and have actual hardware to test with are hard to find.
http://bugs.winehq.org/show_bug.cgi?id=11339
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #4 from Alexandre Julliard julliard@winehq.org 2008-05-08 04:53:26 --- I committed a modified version of your patch.
http://bugs.winehq.org/show_bug.cgi?id=11339
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2008-05-09 12:54:51 --- Closing bugs fixed in 1.0-rc1.