linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-serial@vger.kernel.org,
	'LKML' <linux-kernel@vger.kernel.org>,
	libc-alpha@sources.redhat.com
Subject: Re: Serial custom speed deprecated?
Date: Fri, 25 Aug 2006 12:58:57 +0200	[thread overview]
Message-ID: <m34pw1cc9a.fsf@defiant.localdomain> (raw)
In-Reply-To: <1156459387.3007.218.camel@localhost.localdomain> (Alan Cox's message of "Thu, 24 Aug 2006 23:43:07 +0100")

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> We could implement an entirely new TCSETS/TCGETS/TCSETSA/SAW which used
> different B* values so B9600 was 9600 etc and the data was stored in
> c_ospeed/c_ispeed type separate fields and we'd support arbitary speeds
> for input and output once and for all, shoot all the multiplier hacks
> etc. As it happens the kernel code for this is easy owing to some
> fortuitous good design long ago in the tty layer.

I think it makes most sense.

> We could also implement a Linux "improved" TCSET* new set of ioctls that
> had sensible speed fields, utf-8 characters for the _cc[] array and new
> flags for all the utf-8 handling and the like. That would be less
> compatible though.

I think compatibility at the source level is good here. UTF-8 looks
nice, though.

I think it could remain compatible - c_cc[] could grow into array of
multibyte characters with:
#define VINTR 0
#define VQUIT (1 * n)
#define VERASE (2 * n)
#define VKILL (3 * n)

where n is max number of UTF-8 bytes (5 for 32-bit UCS?)

I'm not sure if UTF-8 control codes are needed in practice, though
(I mean I just don't know).

> Or we could just add a standardised extra set of speed ioctls, but then
> we need to decide what occurs if I set the speed and then issue a
> termios call - does it override or not.

A bit messy I think. I think the first way is much better. Especially
when we have multiple changes (speed and UTF-8, for example).

>> Not sure if we want int, uint, or long long for speed values :-)
>
> You want speed_t according to POSIX.

Sure, I meant what does speed_t resolve to.

> I've no idea what the glibc impact of this kind of thing would be
> (consider new glibc, old kernel etc).  I've cc'd the libc folks but I am
> not sure it is practical to do.

While obviously I'm not glibc (nor termios) expert I don't think
we should expect problems. New glibc would just issue the old ioctl
if the new one isn't available. I think similar things are already
in place.
Glibc could be compiled with minimum kernel version = 2.6.20 or so
to assume the new ioctls are always present.
-- 
Krzysztof Halasa

  reply	other threads:[~2006-08-25 10:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <028a01c6c6fc$e792be90$294b82ce@stuartm>
     [not found] ` <1156411101.3012.15.camel@pmac.infradead.org>
     [not found]   ` <m3bqqap09a.fsf@defiant.localdomain>
2006-08-24 17:41     ` Serial custom speed deprecated? Alan Cox
2006-08-24 18:51       ` Krzysztof Halasa
2006-08-24 20:43         ` linux-os (Dick Johnson)
2006-08-24 22:11           ` Alan Cox
2006-08-27  6:52             ` Rogier Wolff
2006-08-27 10:00               ` Russell King
2006-08-28 14:14               ` Stuart MacDonald
2006-08-28 20:09                 ` Russell King
2006-08-29  6:20                   ` Rogier Wolff
2006-08-29  7:46                     ` Russell King
2006-08-25 15:17           ` Stuart MacDonald
2006-08-25 15:52             ` linux-os (Dick Johnson)
2006-08-24 22:43         ` Alan Cox
2006-08-25 10:58           ` Krzysztof Halasa [this message]
2006-08-25 15:21           ` Stuart MacDonald
2006-08-25 19:32             ` Russell King
2006-08-25 20:21               ` Stuart MacDonald
2006-08-25 20:54                 ` linux-os (Dick Johnson)
2006-08-25 20:39               ` Theodore Tso
2006-08-26 12:16                 ` Krzysztof Halasa
2006-08-25 15:10         ` Stuart MacDonald
2006-08-24 22:05       ` Russell King
2006-08-25 15:01       ` Stuart MacDonald
     [not found] <033001c6c77a$a7d8ab10$294b82ce@stuartm>
2006-08-24 13:19 ` Alan Cox
2006-08-24 13:03   ` David Woodhouse

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=m34pw1cc9a.fsf@defiant.localdomain \
    --to=khc@pm.waw.pl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=libc-alpha@sources.redhat.com \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).