mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Paul Mackerras <paulus@samba.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] $ARCH: Enable arbitary speed tty ioctls and split input/output speed
Date: Wed, 06 Jun 2007 13:33:05 +0100	[thread overview]
Message-ID: <1181133185.4096.32.camel@pmac.infradead.org> (raw)
In-Reply-To: <18010.24300.599531.828815@cargo.ozlabs.ibm.com>

On Mon, 2007-05-28 at 14:47 +1000, Paul Mackerras wrote:
> Sure, we can add them.  I suggest IBSHIFT = 16 and CIBAUD = 0xff0000
> (or 077600000 if we are going to continue the peculiar convention of
> using octal for the C* constants). 

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/include/asm-powerpc/ioctls.h b/include/asm-powerpc/ioctls.h
index 279a622..b6dfe7f 100644
--- a/include/asm-powerpc/ioctls.h
+++ b/include/asm-powerpc/ioctls.h
@@ -31,6 +31,11 @@
 #define TCXONC		_IO('t', 30)
 #define TCFLSH		_IO('t', 31)
 
+#define TCGETS2		_IOR('t', 32, struct termios2)
+#define TCSETS2		_IOW('t', 33, struct termios2)
+#define TCSETSW2	_IOW('t', 34, struct termios2)
+#define TCSETSF2	_IOW('t', 35, struct termios2)
+
 #define TIOCSWINSZ	_IOW('t', 103, struct winsize)
 #define TIOCGWINSZ	_IOR('t', 104, struct winsize)
 #define	TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h
index 5e79198..a5a87f0 100644
--- a/include/asm-powerpc/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -43,6 +43,19 @@ struct ktermios {
 	speed_t c_ospeed;		/* output speed */
 };
 
+/* Yay. A third identical definition of the same structure. */
+
+struct termios2 {
+	tcflag_t c_iflag;		/* input mode flags */
+	tcflag_t c_oflag;		/* output mode flags */
+	tcflag_t c_cflag;		/* control mode flags */
+	tcflag_t c_lflag;		/* local mode flags */
+	cc_t c_cc[NCCS];		/* control characters */
+	cc_t c_line;			/* line discipline (== c_cc[19]) */
+	speed_t c_ispeed;		/* input speed */
+	speed_t c_ospeed;		/* output speed */
+};
+
 /* c_cc characters */
 #define VINTR 	         0
 #define VQUIT 	         1
@@ -152,6 +165,10 @@ struct ktermios {
 #define B3000000  00034
 #define B3500000  00035
 #define B4000000  00036
+#define   BOTHER  00037
+
+#define CIBAUD	077600000
+#define IBSHIFT	16		/* Shift from CBAUD to CIBAUD */
 
 #define CSIZE	00001400
 #define   CS5	00000000
diff --git a/include/asm-powerpc/termios.h b/include/asm-powerpc/termios.h
index 2c14fea..2841fb1 100644
--- a/include/asm-powerpc/termios.h
+++ b/include/asm-powerpc/termios.h
@@ -80,6 +80,9 @@ struct termio {
 
 #include <asm-generic/termios.h>
 
+#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
+#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
+
 #endif	/* __KERNEL__ */
 
 #endif	/* _ASM_POWERPC_TERMIOS_H */


-- 
dwmw2


  reply	other threads:[~2007-06-06 12:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23 16:27 [PATCH] ARM/ARM26: " Alan Cox
2007-05-23 16:27 ` Russell King
2007-05-24 13:08 ` [PATCH] $ARCH: " David Woodhouse
2007-05-24 13:41   ` Alan Cox
2007-05-24 13:45     ` David Woodhouse
2007-05-24 15:05       ` Alan Cox
2007-05-24 15:18         ` David Woodhouse
2007-05-28  4:47         ` Paul Mackerras
2007-06-06 12:33           ` David Woodhouse [this message]
2007-06-08 11:18             ` [PATCH] PowerPC: " David Woodhouse
2007-06-06 12:30         ` [SERIAL] Don't optimise away baud rate changes when BOTHER is used David Woodhouse
2007-06-06 15:03           ` Alan Cox
2007-06-06 17:29             ` David Woodhouse
2007-06-07 15:38               ` Alan Cox
2007-06-07 15:50                 ` David Woodhouse
2007-06-07 21:55                   ` Alan Cox
2007-06-07 22:04                     ` David Woodhouse
2007-06-07 22:15                     ` David Woodhouse
2007-06-07 22:54                       ` Alan Cox
2007-06-08 11:01                         ` David Woodhouse
2007-06-08 11:48                           ` Alan Cox
2007-06-08 11:48                             ` David Woodhouse
2007-06-08 11:13           ` David Woodhouse
2007-06-08 11:14           ` [SERIAL] Don't optimise away baud rate changes when BOTHER is used (v2) David Woodhouse
2007-06-08 11:42             ` Alan Cox
2007-06-06 12:34         ` [PATCH] Minor cleanups in tty_ioctl.c David Woodhouse
2007-06-06 13:09           ` Jiri Slaby
2007-05-28 19:36 ` [PATCH] ARM/ARM26: Enable arbitary speed tty ioctls and split input/output speed Russell King
2007-05-28 21:56   ` Andrew Morton
2007-05-28 22:00     ` Russell King
2007-05-29  8:31     ` 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=1181133185.4096.32.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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®