From: Mark Underwood <basicmark@yahoo.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Rogier Wolff <R.E.Wolff@BitWizard.nl>, linux-kernel@vger.kernel.org
Subject: Re: Linux tty layer hackery: Heads up and RFC
Date: Tue, 26 Jul 2005 13:38:02 +0100 (BST) [thread overview]
Message-ID: <20050726123802.54412.qmail@web30313.mail.mud.yahoo.com> (raw)
In-Reply-To: <1122376291.2542.15.camel@localhost.localdomain>
Hi Alan,
Thanks for your help, I might give this ago once I've
fixed some flow control problems in my driver.
On a loosely related topic I have extended
serial_core.c to handle DMA UARTS (only the TX path is
effected). Once I'm happy with my changes I post a
patch.
Best Regards,
Mark
--- Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Maw, 2005-07-26 at 10:55 +0100, Mark Underwood
> wrote:
> > What my driver would like to do is to handle its
> own
> > input buffers. It would pass the buffer to the tty
> > layer when it is full and the tty layer would pass
> the
>
> In theory you can do that already, although the
> locking is a bit screwed
> up for it. Actually all the tty locking is broken
> for rx I believe.
> Everyone should be holding the tty read lock when
> updating flip buffers
> but right now we don't
>
> > buffer back once it has drained the data from it.
> > The problem is that I don't always receive a block
> > worth of characters so I also need to pass the tty
> > layer a buffer (which I'm still DMAing into) with
> a
> > count of how many chars there are in the buffer
> and a
> > offset of where to start from.
>
> You can do this now providing you don't do it
> blindly from IRQ context.
>
> >From a workqueue do
>
> struct tty_ldisc *ld = tty_ldisc_ref(tty);
> int space;
>
> if(ld == NULL) /* Bin/defer */
> return;
> space = ld->receive_room(tty);
> if(count > space) count = space;
>
> ld->receive_buf(tty, charbuf, flagbuf, count);
>
>
> There is a corner case if TTY_DONT_FLIP is set where
> you should queue
> but not all drivers do this and the DONT_FLIP hack
> 'has to die'
>
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
prev parent reply other threads:[~2005-07-26 12:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-21 17:46 Alan Cox
2005-07-21 17:47 ` Sergei Organov
2005-07-22 14:57 ` Rogier Wolff
2005-07-22 16:16 ` Alan Cox
2005-07-26 9:55 ` Mark Underwood
2005-07-26 11:11 ` Alan Cox
2005-07-26 12:38 ` Mark Underwood [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=20050726123802.54412.qmail@web30313.mail.mud.yahoo.com \
--to=basicmark@yahoo.com \
--cc=R.E.Wolff@BitWizard.nl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®