Setting terminal baud-rate.

Richard B. Johnson (root@chaos.analogic.com)
Fri, 22 Jan 1999 10:12:57 -0500 (EST)


Ted,

Using version 2.1.131, I cannot set the baud rate of a terminal
to a speed higher than 38400 baud without cheating and using the
`setserial spd_hi` function. This function now results in a
warning message that it has been deprecated.

>From termbits.h

#define B38400 0000017 Works and everything below.
#define B57600 0010001 Sets baud-rate to about 600 baud
#define B115200 0010002 Sets baud-rate to about 1240 baud
#define B230400 0010003 Sets baud-rate to about 800 baud
#define B460800 0010004 Sets baud-rate to about 900 baud

Is this a bug or have I forgotten to set some magic high-speed
bit?
/*
* Set to dumb RAW mode with no echo and no character interpretation.
*/
memset(&io_mod, 0x00, sizeof(io_mod));
io_mod.c_cflag = B57600|CS8|CREAD|CLOCAL;
io_mod.c_iflag = IGNBRK|IGNPAR;
io_mod.c_cc[VMIN] = (cc_t) 1;
io_mod.c_cc[VTIME] = (cc_t) 1;
if(ioctl(fd, TCSETS, &io_mod) < 0)
{
fprintf(stderr, "ioctl of %s failed setting parameters (%s)\n",
argv[1], strerror(errno));
ERROR_EXIT;
}
There were no errors. The speed is now about 600 baud!

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.131 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
Wisdom : It's not a Y2K problem. It's a Y2Day problem.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/