From: Alan Cox <alan@redhat.com>
To: Sergei Organov <osv@javad.com>
Cc: Alan Cox <alan@redhat.com>, linux-serial@vger.kernel.org
Subject: Re: [Q] New tty flip interface doubt.
Date: Wed, 21 Jun 2006 09:42:08 -0400 [thread overview]
Message-ID: <20060621134208.GA12884@devserv.devel.redhat.com> (raw)
In-Reply-To: <87hd2epuu6.fsf@javad.com>
On Wed, Jun 21, 2006 at 04:16:33PM +0400, Sergei Organov wrote:
> tty_insert_flip_string(tty, data, length);
>
> instead has slightly more chances to transfer 'length' chars as
> tty_insert_flip_string(), unlike tty_buffer_request_room(), loops to
> find the memory.
>
> Overall, what's the canonical way to transfer 'length' chars from a
> buffer 'buf' to the tty layer?
tty_insert_flip_string called by itself will try to do the right thing. The
tty_insert_flip_char interface can benefit a lot from you knowing the ideal
buffer size to use so its very useful in the case of
int bytes = inw(port->fifo);
int count = tty_buffer_request_room(tty, bytes);
while(...) {
tty_insert_flip_char ..
It is also useful if you want a linear buffer for ease of copying.
In the USB case it may be helpful as it will try and allocate blocks of
memory reflecting the size of the blocks to be pushed to the user rather
than guessing. As you suggest for most cases it probably makes no real difference
next prev parent reply other threads:[~2006-06-21 13:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-21 12:16 [Q] New tty flip interface doubt Sergei Organov
2006-06-21 13:42 ` Alan Cox [this message]
2006-06-22 7:33 ` Sergei Organov
2006-06-22 12:56 ` Alan Cox
2006-06-22 15:17 ` Sergei Organov
2006-06-23 13:16 ` Alan Cox
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=20060621134208.GA12884@devserv.devel.redhat.com \
--to=alan@redhat.com \
--cc=linux-serial@vger.kernel.org \
--cc=osv@javad.com \
/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.