Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISA com driver no longer groks B0 as hangup #42

Open
ghost opened this issue Jun 20, 2014 · 0 comments
Open

ISA com driver no longer groks B0 as hangup #42

ghost opened this issue Jun 20, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 20, 2014

Metadata

Description


    The latest changes to the com driver to handle multiple
frequency multipliers seems to have broken the POSIX requirement that a
baud rate of B0 mean "hang up".  comparam() rejects a termios with a
speed of B0.


How to repeat



#include <termios.h>

main()
{
    struct termios t;

    tcgetattr(0, &t);
    cfsetispeed(&t, 0);
    cfsetospeed(&t, B0);
    if (tcsetattr(0, TCSANOW, &t) == -1)
    perror("tcsetattr");
}


Fix


    There's an #if 0 in comrate() which when converted to #if 1
seems to do the trick.  I'm not sure if that's quite right, though ...

Audit trail


Responsible-Changed-From-To: kern-bug-people->kleink 
Responsible-Changed-By: jtk 
Responsible-Changed-When: Thu Feb 11 04:40:07 PST 1999 
Responsible-Changed-Why:  
assigning to Klaus for standards comments 

From: "Charles M. Hannum" <root@ihack.net>
To: jtk@kolvir.arlington.ma.us
Cc: kleink@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: kern/4123
Date: Wed, 28 Apr 1999 19:11:26 -0400 (EDT)

 I thought I had already appended this to the PR.

 One might assume that since I specifically turned that code off, that
 just turning it back on is not the right thing to do.

 As it turns out, there are multiple problems with it:

 * Turning on DTR on a baud rate change is clearly wrong; the `else'
   clause *must* be omitted.

 * The interaction between B0 and TIOCSDTR/TIOCCDTR is not well
   defined.

 * It's not clear whether `hang up' in the POSIX text means to cycle
   DTR, or to just leave it turned off.

 * What happens to the rest of the settings?  It's obviously not
   correct to *just* set the baud rate registers to some random value.
   Does hanging up mean that we should stop receiving data?  Stop
   sending?  Both?  The code doesn't deal with this.

 I asked Klaus to define the semantics for me more precisely so that I
 could implement it, but I don't think this ever happened.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants