18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef __ASM_GENERIC_IOCTLS_H
38c2ecf20Sopenharmony_ci#define __ASM_GENERIC_IOCTLS_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/ioctl.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/*
88c2ecf20Sopenharmony_ci * These are the most common definitions for tty ioctl numbers.
98c2ecf20Sopenharmony_ci * Most of them do not use the recommended _IOC(), but there is
108c2ecf20Sopenharmony_ci * probably some source code out there hardcoding the number,
118c2ecf20Sopenharmony_ci * so we might as well use them for all new platforms.
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * The architectures that use different values here typically
148c2ecf20Sopenharmony_ci * try to be compatible with some Unix variants for the same
158c2ecf20Sopenharmony_ci * architecture.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/* 0x54 is just a magic number to make these relatively unique ('T') */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define TCGETS		0x5401
218c2ecf20Sopenharmony_ci#define TCSETS		0x5402
228c2ecf20Sopenharmony_ci#define TCSETSW		0x5403
238c2ecf20Sopenharmony_ci#define TCSETSF		0x5404
248c2ecf20Sopenharmony_ci#define TCGETA		0x5405
258c2ecf20Sopenharmony_ci#define TCSETA		0x5406
268c2ecf20Sopenharmony_ci#define TCSETAW		0x5407
278c2ecf20Sopenharmony_ci#define TCSETAF		0x5408
288c2ecf20Sopenharmony_ci#define TCSBRK		0x5409
298c2ecf20Sopenharmony_ci#define TCXONC		0x540A
308c2ecf20Sopenharmony_ci#define TCFLSH		0x540B
318c2ecf20Sopenharmony_ci#define TIOCEXCL	0x540C
328c2ecf20Sopenharmony_ci#define TIOCNXCL	0x540D
338c2ecf20Sopenharmony_ci#define TIOCSCTTY	0x540E
348c2ecf20Sopenharmony_ci#define TIOCGPGRP	0x540F
358c2ecf20Sopenharmony_ci#define TIOCSPGRP	0x5410
368c2ecf20Sopenharmony_ci#define TIOCOUTQ	0x5411
378c2ecf20Sopenharmony_ci#define TIOCSTI		0x5412
388c2ecf20Sopenharmony_ci#define TIOCGWINSZ	0x5413
398c2ecf20Sopenharmony_ci#define TIOCSWINSZ	0x5414
408c2ecf20Sopenharmony_ci#define TIOCMGET	0x5415
418c2ecf20Sopenharmony_ci#define TIOCMBIS	0x5416
428c2ecf20Sopenharmony_ci#define TIOCMBIC	0x5417
438c2ecf20Sopenharmony_ci#define TIOCMSET	0x5418
448c2ecf20Sopenharmony_ci#define TIOCGSOFTCAR	0x5419
458c2ecf20Sopenharmony_ci#define TIOCSSOFTCAR	0x541A
468c2ecf20Sopenharmony_ci#define FIONREAD	0x541B
478c2ecf20Sopenharmony_ci#define TIOCINQ		FIONREAD
488c2ecf20Sopenharmony_ci#define TIOCLINUX	0x541C
498c2ecf20Sopenharmony_ci#define TIOCCONS	0x541D
508c2ecf20Sopenharmony_ci#define TIOCGSERIAL	0x541E
518c2ecf20Sopenharmony_ci#define TIOCSSERIAL	0x541F
528c2ecf20Sopenharmony_ci#define TIOCPKT		0x5420
538c2ecf20Sopenharmony_ci#define FIONBIO		0x5421
548c2ecf20Sopenharmony_ci#define TIOCNOTTY	0x5422
558c2ecf20Sopenharmony_ci#define TIOCSETD	0x5423
568c2ecf20Sopenharmony_ci#define TIOCGETD	0x5424
578c2ecf20Sopenharmony_ci#define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
588c2ecf20Sopenharmony_ci#define TIOCSBRK	0x5427  /* BSD compatibility */
598c2ecf20Sopenharmony_ci#define TIOCCBRK	0x5428  /* BSD compatibility */
608c2ecf20Sopenharmony_ci#define TIOCGSID	0x5429  /* Return the session ID of FD */
618c2ecf20Sopenharmony_ci#define TCGETS2		_IOR('T', 0x2A, struct termios2)
628c2ecf20Sopenharmony_ci#define TCSETS2		_IOW('T', 0x2B, struct termios2)
638c2ecf20Sopenharmony_ci#define TCSETSW2	_IOW('T', 0x2C, struct termios2)
648c2ecf20Sopenharmony_ci#define TCSETSF2	_IOW('T', 0x2D, struct termios2)
658c2ecf20Sopenharmony_ci#define TIOCGRS485	0x542E
668c2ecf20Sopenharmony_ci#ifndef TIOCSRS485
678c2ecf20Sopenharmony_ci#define TIOCSRS485	0x542F
688c2ecf20Sopenharmony_ci#endif
698c2ecf20Sopenharmony_ci#define TIOCGPTN	_IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
708c2ecf20Sopenharmony_ci#define TIOCSPTLCK	_IOW('T', 0x31, int)  /* Lock/unlock Pty */
718c2ecf20Sopenharmony_ci#define TIOCGDEV	_IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
728c2ecf20Sopenharmony_ci#define TCGETX		0x5432 /* SYS5 TCGETX compatibility */
738c2ecf20Sopenharmony_ci#define TCSETX		0x5433
748c2ecf20Sopenharmony_ci#define TCSETXF		0x5434
758c2ecf20Sopenharmony_ci#define TCSETXW		0x5435
768c2ecf20Sopenharmony_ci#define TIOCSIG		_IOW('T', 0x36, int)  /* pty: generate signal */
778c2ecf20Sopenharmony_ci#define TIOCVHANGUP	0x5437
788c2ecf20Sopenharmony_ci#define TIOCGPKT	_IOR('T', 0x38, int) /* Get packet mode state */
798c2ecf20Sopenharmony_ci#define TIOCGPTLCK	_IOR('T', 0x39, int) /* Get Pty lock state */
808c2ecf20Sopenharmony_ci#define TIOCGEXCL	_IOR('T', 0x40, int) /* Get exclusive mode state */
818c2ecf20Sopenharmony_ci#define TIOCGPTPEER	_IO('T', 0x41) /* Safely open the slave */
828c2ecf20Sopenharmony_ci#define TIOCGISO7816	_IOR('T', 0x42, struct serial_iso7816)
838c2ecf20Sopenharmony_ci#define TIOCSISO7816	_IOWR('T', 0x43, struct serial_iso7816)
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define FIONCLEX	0x5450
868c2ecf20Sopenharmony_ci#define FIOCLEX		0x5451
878c2ecf20Sopenharmony_ci#define FIOASYNC	0x5452
888c2ecf20Sopenharmony_ci#define TIOCSERCONFIG	0x5453
898c2ecf20Sopenharmony_ci#define TIOCSERGWILD	0x5454
908c2ecf20Sopenharmony_ci#define TIOCSERSWILD	0x5455
918c2ecf20Sopenharmony_ci#define TIOCGLCKTRMIOS	0x5456
928c2ecf20Sopenharmony_ci#define TIOCSLCKTRMIOS	0x5457
938c2ecf20Sopenharmony_ci#define TIOCSERGSTRUCT	0x5458 /* For debugging only */
948c2ecf20Sopenharmony_ci#define TIOCSERGETLSR   0x5459 /* Get line status register */
958c2ecf20Sopenharmony_ci#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
968c2ecf20Sopenharmony_ci#define TIOCSERSETMULTI 0x545B /* Set multiport config */
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
998c2ecf20Sopenharmony_ci#define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci/*
1028c2ecf20Sopenharmony_ci * Some arches already define FIOQSIZE due to a historical
1038c2ecf20Sopenharmony_ci * conflict with a Hayes modem-specific ioctl value.
1048c2ecf20Sopenharmony_ci */
1058c2ecf20Sopenharmony_ci#ifndef FIOQSIZE
1068c2ecf20Sopenharmony_ci# define FIOQSIZE	0x5460
1078c2ecf20Sopenharmony_ci#endif
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci/* Used for packet mode */
1108c2ecf20Sopenharmony_ci#define TIOCPKT_DATA		 0
1118c2ecf20Sopenharmony_ci#define TIOCPKT_FLUSHREAD	 1
1128c2ecf20Sopenharmony_ci#define TIOCPKT_FLUSHWRITE	 2
1138c2ecf20Sopenharmony_ci#define TIOCPKT_STOP		 4
1148c2ecf20Sopenharmony_ci#define TIOCPKT_START		 8
1158c2ecf20Sopenharmony_ci#define TIOCPKT_NOSTOP		16
1168c2ecf20Sopenharmony_ci#define TIOCPKT_DOSTOP		32
1178c2ecf20Sopenharmony_ci#define TIOCPKT_IOCTL		64
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci#define TIOCSER_TEMT	0x01	/* Transmitter physically empty */
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci#endif /* __ASM_GENERIC_IOCTLS_H */
122