Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be90038a authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

[PATCH] tty: preparatory structures for termios revamp



In order to sort out our struct termios and add proper speed control we need
to separate the kernel and user termios structures.  Glibc is fine but the
other libraries rely on the kernel exported struct termios and we need to
extend this without breaking the ABI/API

To do so we add a struct ktermios which is the kernel view of a termios
structure and overlaps the struct termios with extra fields on the end for
now.  (That limitation will go away in later patches).  Some platforms (eg
alpha) planned ahead and thus use the same struct for both, others did not.

This just adds the structures but does not use them, it seems a sensible
splitting point for bisect if there are compile failures (not that I expect
them)

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 96b066b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -798,7 +798,7 @@ static unsigned int get_baud(struct tty_struct *tty)
 */
 */
static void set_baud(struct tty_struct *tty, unsigned int baudcode)
static void set_baud(struct tty_struct *tty, unsigned int baudcode)
{
{
	struct termios old_termios = *(tty->termios);
	struct ktermios old_termios = *(tty->termios);
	tty->termios->c_cflag &= ~CBAUD;	/* Clear the old baud setting */
	tty->termios->c_cflag &= ~CBAUD;	/* Clear the old baud setting */
	tty->termios->c_cflag |= baudcode;	/* Set the new baud setting */
	tty->termios->c_cflag |= baudcode;	/* Set the new baud setting */
	tty->driver->set_termios(tty, &old_termios);
	tty->driver->set_termios(tty, &old_termios);
+13 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,19 @@ struct termios {
	speed_t c_ospeed;		/* output speed */
	speed_t c_ospeed;		/* output speed */
};
};


/* Alpha has matching termios and ktermios */

struct ktermios {
	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 */
/* c_cc characters */
#define VEOF 0
#define VEOF 0
#define VEOL 1
#define VEOL 1
+12 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,18 @@ struct termios {
	cc_t c_cc[NCCS];		/* control characters */
	cc_t c_cc[NCCS];		/* control characters */
};
};


struct ktermios {
	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_line;			/* line discipline */
	cc_t c_cc[NCCS];		/* control characters */
	speed_t c_ispeed;		/* input speed */
	speed_t c_ospeed;		/* output speed */
};


/* c_cc characters */
/* c_cc characters */
#define VINTR 0
#define VINTR 0
#define VQUIT 1
#define VQUIT 1
+12 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,18 @@ struct termios {
	cc_t c_cc[NCCS];		/* control characters */
	cc_t c_cc[NCCS];		/* control characters */
};
};


struct ktermios {
	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_line;			/* line discipline */
	cc_t c_cc[NCCS];		/* control characters */
	speed_t c_ispeed;		/* input speed */
	speed_t c_ospeed;		/* output speed */
};


/* c_cc characters */
/* c_cc characters */
#define VINTR 0
#define VINTR 0
#define VQUIT 1
#define VQUIT 1
+11 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,17 @@ struct termios {
	cc_t c_cc[NCCS];		/* control characters */
	cc_t c_cc[NCCS];		/* control characters */
};
};


struct ktermios {
	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_line;			/* line discipline */
	cc_t c_cc[NCCS];		/* control characters */
	speed_t c_ispeed;		/* input speed */
	speed_t c_ospeed;		/* output speed */
};

/* c_cc characters */
/* c_cc characters */
#define VINTR 0
#define VINTR 0
#define VQUIT 1
#define VQUIT 1
Loading