Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1470978
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive |
| Date | 2016-08-26 22:20 +0200 |
| Message-ID | <savLA-3ml-7@gated-at.bofh.it> (permalink) |
| References | <s9PMm-17y-3@gated-at.bofh.it> <s9PMm-17y-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi!
> @@ -133,26 +133,29 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
> if (!test_bit(SERPORT_ACTIVE, &serport->flags))
> goto out;
>
> - for (i = 0; i < count; i++) {
> - if (fp) {
> - switch (fp[i]) {
> - case TTY_FRAME:
> - ch_flags = SERIO_FRAME;
> - break;
> -
> - case TTY_PARITY:
> - ch_flags = SERIO_PARITY;
> - break;
> -
> - default:
> - ch_flags = 0;
> - break;
> + if (serio_buffered_mode_enabled(serport->serio)) {
> + serio_receive_buf(serport->serio, cp, count);
Elsewhere:
+ /* Use buffer receive if the driver provides a callback */
+ if (drv->receive_buf)
+ set_bit(SERIO_MODE_BUFFERED, &drv->flags);
Could we use if (drv->receive_buf) above directly, and not require the
bitfield?
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Pavel Machek <pavel@ucw.cz> - 2016-08-26 22:20 +0200
Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Rob Herring <robh@kernel.org> - 2016-08-26 23:40 +0200
Re: [RFC PATCH 4/6] serio: serport: add support for buffered write and receive Pavel Machek <pavel@ucw.cz> - 2016-08-27 00:30 +0200
csiph-web