linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Paul Menzel <pmenzel+linux-serial@molgen.mpg.de>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Is 115200 still the maximum baudrate?
Date: Thu, 2 Nov 2017 18:44:11 +0000	[thread overview]
Message-ID: <20171102184411.4f760de0@alans-desktop> (raw)
In-Reply-To: <20171102171355.onz27qoczedq7jpv@thunk.org>

On Thu, 2 Nov 2017 13:13:55 -0400
"Theodore Ts'o" <tytso@mit.edu> wrote:

> On Thu, Nov 02, 2017 at 04:42:56PM +0100, Paul Menzel wrote:
> > 
> > The Linux serial console documentation [1] says that 115200 is the maximum
> > supported baudrate.
> >   
> > > The maximum baudrate is 115200.  
> > 
> > Is that still accurate? If yes, where should I look to support higher
> > values?  
> 
> See the setserial man page and the spd_* options:

Those have been obsolete for over a decade and doesn't work on all
devices.

The core Linux code supports arbitrary baud rate setting. Although it was
designed with the glibc maintainers at the time it seems they never
adopted it so you have do the following Linux specific:


	struct termios t;

	iotl(tty, TCGETS2, &t);
	t.c_flag &= ~CBAUD;
	t.c_flag |= BOTHER;
	t.c_ispeed = input baud;
	t.c_ospeed = output baud;
	ioctl(tty, TCSETS2, &t);


and it'll let you ask for any speed you want including things like midi
baud rates. 76Kbit for ESP8266 devices and so on.

After the calls check the c_ispeed/c_ospeed to see what you got.

Alan

      reply	other threads:[~2017-11-02 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 15:42 Is 115200 still the maximum baudrate? Paul Menzel
2017-11-02 17:13 ` Theodore Ts'o
2017-11-02 18:44   ` Alan Cox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102184411.4f760de0@alans-desktop \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pmenzel+linux-serial@molgen.mpg.de \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).