1c9874d3fSAl Viro /* SPDX-License-Identifier: GPL-2.0 */
2c9874d3fSAl Viro #ifndef _LINUX_TERMIOS_CONV_H
3c9874d3fSAl Viro #define _LINUX_TERMIOS_CONV_H
4c9874d3fSAl Viro 
5c9874d3fSAl Viro #include <linux/uaccess.h>
6c9874d3fSAl Viro #include <asm/termios.h>
7c9874d3fSAl Viro 
8c9874d3fSAl Viro /*	intr=^C		quit=^\		erase=del	kill=^U
9c9874d3fSAl Viro 	eof=^D		vtime=\0	vmin=\1		sxtc=\0
10c9874d3fSAl Viro 	start=^Q	stop=^S		susp=^Z		eol=\0
1138fc315aSAl Viro 	reprint=^R	discard=^O	werase=^W	lnext=^V
12c9874d3fSAl Viro 	eol2=\0
13c9874d3fSAl Viro */
14*e7b4c812SAl Viro 
15*e7b4c812SAl Viro #ifdef VDSUSP
16*e7b4c812SAl Viro #define INIT_C_CC_VDSUSP_EXTRA [VDSUSP] = 'Y'-0x40,
17*e7b4c812SAl Viro #else
18*e7b4c812SAl Viro #define INIT_C_CC_VDSUSP_EXTRA
19*e7b4c812SAl Viro #endif
20*e7b4c812SAl Viro 
21d04f9915SAl Viro #define INIT_C_CC {		\
22d04f9915SAl Viro 	[VINTR] = 'C'-0x40,	\
23d04f9915SAl Viro 	[VQUIT] = '\\'-0x40,	\
24d04f9915SAl Viro 	[VERASE] = '\177',	\
25d04f9915SAl Viro 	[VKILL] = 'U'-0x40,	\
26d04f9915SAl Viro 	[VEOF] = 'D'-0x40,	\
27d04f9915SAl Viro 	[VSTART] = 'Q'-0x40,	\
28d04f9915SAl Viro 	[VSTOP] = 'S'-0x40,	\
29d04f9915SAl Viro 	[VSUSP] = 'Z'-0x40,	\
30d04f9915SAl Viro 	[VREPRINT] = 'R'-0x40,	\
31d04f9915SAl Viro 	[VDISCARD] = 'O'-0x40,	\
32d04f9915SAl Viro 	[VWERASE] = 'W'-0x40,	\
33d04f9915SAl Viro 	[VLNEXT] = 'V'-0x40,	\
34*e7b4c812SAl Viro 	INIT_C_CC_VDSUSP_EXTRA	\
35d04f9915SAl Viro 	[VMIN] = 1 }
36c9874d3fSAl Viro 
37c9874d3fSAl Viro int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *);
38c9874d3fSAl Viro int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *);
39c9874d3fSAl Viro #ifdef TCGETS2
40c9874d3fSAl Viro int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *);
41c9874d3fSAl Viro int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *);
42c9874d3fSAl Viro int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *);
43c9874d3fSAl Viro int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *);
44c9874d3fSAl Viro #else /* TCGETS2 */
45c9874d3fSAl Viro int user_termios_to_kernel_termios(struct ktermios *, struct termios __user *);
46c9874d3fSAl Viro int kernel_termios_to_user_termios(struct termios __user *, struct ktermios *);
47c9874d3fSAl Viro #endif /* TCGETS2 */
48c9874d3fSAl Viro 
49c9874d3fSAl Viro #endif /* _LINUX_TERMIOS_CONV_H */
50