Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: kernelnewbies@kernelnewbies.org
Cc: linux-serial@vger.kernel.org
Subject: Re: tty: uart: custom speed
Date: Mon, 4 Mar 2019 18:47:42 -0000 (UTC)	[thread overview]
Message-ID: <q5jrsd$4dg0$1@blaine.gmane.org> (raw)
In-Reply-To: CAPY=qRTEh5yksQH9o2bBSRWA8J1xSdjLd4dknXt7S9QFrKsfSQ@mail.gmail.com

On 2019-03-04, Subhashini Rao Beerisetty <subhashbeerisetty@gmail.com> wrote:
> On Mon, Mar 4, 2019 at 8:27 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
>> Have you read the documentation on how to set custom baud rates?  I
>> can't find the link to it at the moment, but it is very possible to do
>> that today, no special ioctls are needed at all.  I think someone was
>> finally working on getting glibc to support it directly, but I do not
>> know if those patches ever got merged, so you would just have to "open
>> code" it in userspace if you want to do this.
>
> I could not find clear documentation on this, I’m very much thankful
> if someone point me on this. I thought of exploring TIOCGSERIAL and
> TIOCSSERIAL Ioctl’s to set custom baud rates. Now it looks like I
> should read the kernel code to understand how to achieve this without
> special ioctls.

You use the termios2 structure and TCGETS2/TCSETS ioctl calls:

    http://www.panix.com/~grante/arbitrary-baud.c

-- 
Grant








_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      parent reply	other threads:[~2019-03-04 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPY=qRSrw7JxAbORoUHckxcMRjk16zYP7nc2zakGd411JMjGjA@mail.gmail.com>
     [not found] ` <20190304132302.GA9869@kroah.com>
2019-03-04 14:49   ` tty: uart: custom speed Subhashini Rao Beerisetty
2019-03-04 14:57     ` Greg KH
2019-03-04 15:23       ` Subhashini Rao Beerisetty
2019-03-04 17:16         ` Vladimir Zapolskiy
2019-03-04 18:47         ` Grant Edwards [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='q5jrsd$4dg0$1@blaine.gmane.org' \
    --to=grant.b.edwards@gmail.com \
    --cc=kernelnewbies@kernelnewbies.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox