From owner-freebsd-stable@FreeBSD.ORG Mon Oct 12 07:08:31 2009 Return-Path: Delivered-To: stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1F811065672 for ; Mon, 12 Oct 2009 07:08:31 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 409AD8FC1C for ; Mon, 12 Oct 2009 07:08:31 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 005D81CD0B; Mon, 12 Oct 2009 09:08:29 +0200 (CEST) Date: Mon, 12 Oct 2009 09:08:29 +0200 From: Ed Schouten To: Mikolaj Golub Message-ID: <20091012070829.GA71731@hoeg.nl> References: <20091011201715.GY71731@hoeg.nl> <81k4z1p3fj.fsf@zhuzha.ua1> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9MdG657QzbOEWl1C" Content-Disposition: inline In-Reply-To: <81k4z1p3fj.fsf@zhuzha.ua1> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: stable@FreeBSD.org Subject: Re: can't change tty speed and buffer size on 8.0 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 07:08:31 -0000 --9MdG657QzbOEWl1C Content-Type: multipart/mixed; boundary="4vu0d+lqoSa2/ZEk" Content-Disposition: inline --4vu0d+lqoSa2/ZEk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Mikolaj Golub wrote: > So 115200/5=3D23040 would be more then enough for me :-) Great. I've attached a patch that should allow the buffer size to be configured. Unfortunately gettytab currently sets the baud rate to 115200, which means we'll always use buffer sizes. I think we'd better just remove the baud rate assignment and let the kernel decide which default baud rate for the console is the best. I'll commit the patch within the next couple of days. Let me know whether you experience any problems with it. --=20 Ed Schouten WWW: http://80386.nl/ --4vu0d+lqoSa2/ZEk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="tty.diff" Content-Transfer-Encoding: quoted-printable Index: etc/gettytab =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- etc/gettytab (revision 197973) +++ etc/gettytab (working copy) @@ -162,7 +162,7 @@ :fd@:nd@:cd@:rw:sp#9600: =20 P|Pc|Pc console:\ - :ht:np:sp#115200: + :ht:np: =20 # # Wierdo special case for fast crt's with hardcopy devices Index: sys/kern/tty.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/kern/tty.c (revision 197973) +++ sys/kern/tty.c (working copy) @@ -842,8 +842,19 @@ ttydevsw_defparam(struct tty *tp, struct termios *t) { =20 - /* Use a fake baud rate, we're not a real device. */ - t->c_ispeed =3D t->c_ospeed =3D TTYDEF_SPEED; + /* + * Allow the baud rate to be adjusted for pseudo-devices, but at + * least restrict it to 115200 to prevent excessive buffer + * usage. Also disallow 0, to prevent foot shooting. + */ + if (t->c_ispeed < B50) + t->c_ispeed =3D B50; + else if (t->c_ispeed > B115200) + t->c_ispeed =3D B115200; + if (t->c_ospeed < B50) + t->c_ospeed =3D B50; + else if (t->c_ospeed > B115200) + t->c_ospeed =3D B115200; =20 return (0); } --4vu0d+lqoSa2/ZEk-- --9MdG657QzbOEWl1C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrS1e0ACgkQ52SDGA2eCwWAVQCdE+bmZOAHZjdek3D/+Kg2ylBk lDMAni22ckCPX6k9/tGHC3O52oc2vsdD =kDPP -----END PGP SIGNATURE----- --9MdG657QzbOEWl1C--