Hi,
pluart(4) does not report the correct baudrate for the hardware console
but instead defaults to 38400. This in turn causes the same baudrate to
end up in /etc/ttys during installation. Note that this is not a problem
as of now since pluart does not support changing the baudrate just yet,
I have another subsequent diff for that.
Instead, honor and propagate the baudrate given to pluartcnattach()
while attaching the hardware console. Similar to what com(4) already
does.
Comments? OK?
diff --git sys/dev/ic/pluart.c sys/dev/ic/pluart.c
index be7d4483646..03acab832a9 100644
--- sys/dev/ic/pluart.c
+++ sys/dev/ic/pluart.c
@@ -153,11 +153,12 @@ struct cfdriver pluart_cd = {
NULL, "pluart", DV_TTY
};
+int pluartdefaultrate = B38400;
+int pluartconsrate = B38400;
bus_space_tag_t pluartconsiot;
bus_space_handle_t pluartconsioh;
bus_addr_t pluartconsaddr;
tcflag_t pluartconscflag = TTYDEF_CFLAG;
-int pluartdefaultrate = B38400;
struct cdevsw pluartdev =
cdev_tty_init(3/*XXX NUART */ ,pluart); /* 12: serial port */
@@ -563,7 +564,10 @@ pluartopen(dev_t dev, int flag, int mode, struct proc *p)
if (ISSET(sc->sc_swflags, COM_SW_MDMBUF))
SET(tp->t_cflag, MDMBUF);
tp->t_lflag = TTYDEF_LFLAG;
- tp->t_ispeed = tp->t_ospeed = pluartdefaultrate;
+ if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE))
+ tp->t_ispeed = tp->t_ospeed = pluartconsrate;
+ else
+ tp->t_ispeed = tp->t_ospeed = pluartdefaultrate;
s = spltty();
@@ -837,6 +841,7 @@ pluartcnattach(bus_space_tag_t iot, bus_addr_t iobase, int
rate, tcflag_t cflag)
pluartconsiot = iot;
pluartconsaddr = iobase;
pluartconscflag = cflag;
+ pluartconsrate = rate;
return 0;
}