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