diff options
author | Joshua M. Clulow <josh@sysmgr.org> | 2021-09-13 20:44:44 -0700 |
---|---|---|
committer | Joshua M. Clulow <josh@sysmgr.org> | 2021-09-14 00:08:56 -0700 |
commit | d9c3e05c2d8261e3f133b5e96a300b4fa6c0f1b7 (patch) | |
tree | 6dfa33ca74af9e355301f1a6c229e80c5c51a0df /usr/src/cmd/lp/model/lp.cat.c | |
parent | 60414d478553487f99278a4302d1116e73d5f6dc (diff) | |
download | illumos-gate-d9c3e05c2d8261e3f133b5e96a300b4fa6c0f1b7.tar.gz |
13975 support for higher baud rates
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/cmd/lp/model/lp.cat.c')
-rw-r--r-- | usr/src/cmd/lp/model/lp.cat.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr/src/cmd/lp/model/lp.cat.c b/usr/src/cmd/lp/model/lp.cat.c index 29f14ad318..1b94b0afd8 100644 --- a/usr/src/cmd/lp/model/lp.cat.c +++ b/usr/src/cmd/lp/model/lp.cat.c @@ -673,11 +673,12 @@ sigterm() * baudrate() - RETURN BAUD RATE OF OUTPUT LINE */ -static int baud_convert[] = -{ - 0, 50, 75, 110, 135, 150, 200, 300, 600, 1200, +static int baud_convert[] = { + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, - 76800, 115200, 153600, 230400, 307200, 460800, 921600 + 76800, 115200, 153600, 230400, 307200, 460800, 921600, + 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, + 3500000, 4000000 }; int @@ -688,12 +689,14 @@ baudrate() int speed; if (ioctl(1, TCGETS, &tms) < 0) { - if (ioctl(1, TCGETA, &tm) < 0) + if (ioctl(1, TCGETA, &tm) < 0) { return (1200); - else + } else { speed = tm.c_cflag&CBAUD; - } else + } + } else { speed = cfgetospeed(&tms); + } return (speed ? baud_convert[speed] : 1200); } |