From: munisekharrms@gmail.com (Muni Sekhar)
To: kernelnewbies@lists.kernelnewbies.org
Subject: kernel mode termios API's
Date: Thu, 31 Mar 2016 16:43:09 +0530 [thread overview]
Message-ID: <CAHhAz+hOf6BTCJ_1Ly5uuOYYFBRDbJp4Dwud5G-UEOU512KAdQ@mail.gmail.com> (raw)
In-Reply-To: <20160330180258.GA25063@kroah.com>
On Wed, Mar 30, 2016 at 11:32 PM, Greg KH <greg@kroah.com> wrote:
> On Wed, Mar 30, 2016 at 09:23:00PM +0530, Muni Sekhar wrote:
>> Hi,
>>
>> We are having customized serial port driver, it always sets the baud
>> to 9600 (by configuring UART BAUD_RATE register) on device file open,
>> but not updating the termios structure.
>
> Please fix your driver. You do have the source for it, so this
> shouldn't be a problem, right?
>
> thanks,
>
> greg k-h
Yes, I am having the source code. It is a tiny TTY driver.
It sets the baud rate in three different functions [
tty_operations->open(), tty_operations->set_termios (),
tty_operations->ioctl() ]
It sets the fixed hard coded baud rate 9600 in tty_operations->open()
, in other places sets baud rate as user-space function requested.
I don?t know why it uses fixed baud rate in open. If a user-space
function queries baud (cfgetospeed() API) after open, it gets the
wrong value.
Can I update the termios structure before setting the baud rate as
mentioned below in tty_operations->open()?
tiny_tty_driver->init_termios = tty_std_termios;
tiny_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
In LINUX DEVICE DRIVERS book, TTY divers chapter says ?When the port
is opened for the first time, any needed hardware initialization and
memory allocation can be done?, I would like to know what kind of
hardware initialization might be needed for the first time?
--
Thanks,
Sekhar
next prev parent reply other threads:[~2016-03-31 11:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 15:53 kernel mode termios API's Muni Sekhar
2016-03-30 18:02 ` Greg KH
2016-03-31 11:13 ` Muni Sekhar [this message]
2016-03-31 16:02 ` Greg KH
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=CAHhAz+hOf6BTCJ_1Ly5uuOYYFBRDbJp4Dwud5G-UEOU512KAdQ@mail.gmail.com \
--to=munisekharrms@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).