From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Subject: Re: serial: custom baud rate
Date: Thu, 3 May 2018 18:27:14 +0000 (UTC) [thread overview]
Message-ID: <pcfka2$gie$1@blaine.gmane.org> (raw)
In-Reply-To: CAHhAz+hrmLiRJ77cM=CYj+iyH8aUJ64R6FtAwGqqB2pOS0n0aQ@mail.gmail.com
On 2018-05-03, Muni Sekhar <munisekharrms@gmail.com> wrote:
> If I need to set a custom baud rates(e.g. 14400, 128000, 256000), does
> Linux serial framework has any supporting method?
Sure, use the termios2 structure instead of the termios structure:
#include <linux/termios.h>
struct termios2 t;
ioctl(fd, TCGETS2, &t)
t.c_cflag &= ~CBAUD;
t.c_cflag |= BOTHER;
t.c_ispeed = baud;
t.c_ospeed = baud;
ioctl(fd, TCSETS2, &t)
[Not all devices/drivers support termios2]
--
Grant Edwards grant.b.edwards Yow! Are we live or on
at tape?
gmail.com
next prev parent reply other threads:[~2018-05-03 18:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 12:39 serial: custom baud rate Muni Sekhar
2018-05-03 17:54 ` Theodore Y. Ts'o
2018-05-04 9:04 ` Muni Sekhar
2018-05-04 13:59 ` Theodore Y. Ts'o
2018-05-14 17:24 ` Andy Shevchenko
2018-05-03 18:27 ` Grant Edwards [this message]
2018-05-13 19:57 ` Alan Cox
2018-05-14 15:36 ` Grant Edwards
-- strict thread matches above, loose matches on Subject: below --
2018-05-03 12:59 Muni Sekhar
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='pcfka2$gie$1@blaine.gmane.org' \
--to=grant.b.edwards@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.