blob: cdc9f4ca8c27504d7058903a2f8fc4de877a82bd [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Arnd Bergmann6103ec52009-05-13 22:56:27 +00002#ifndef __ASM_GENERIC_IOCTLS_H
3#define __ASM_GENERIC_IOCTLS_H
4
5#include <linux/ioctl.h>
6
7/*
8 * These are the most common definitions for tty ioctl numbers.
9 * Most of them do not use the recommended _IOC(), but there is
10 * probably some source code out there hardcoding the number,
11 * so we might as well use them for all new platforms.
12 *
13 * The architectures that use different values here typically
14 * try to be compatible with some Unix variants for the same
15 * architecture.
16 */
17
18/* 0x54 is just a magic number to make these relatively unique ('T') */
19
20#define TCGETS 0x5401
21#define TCSETS 0x5402
22#define TCSETSW 0x5403
23#define TCSETSF 0x5404
24#define TCGETA 0x5405
25#define TCSETA 0x5406
26#define TCSETAW 0x5407
27#define TCSETAF 0x5408
28#define TCSBRK 0x5409
29#define TCXONC 0x540A
30#define TCFLSH 0x540B
31#define TIOCEXCL 0x540C
32#define TIOCNXCL 0x540D
33#define TIOCSCTTY 0x540E
34#define TIOCGPGRP 0x540F
35#define TIOCSPGRP 0x5410
36#define TIOCOUTQ 0x5411
37#define TIOCSTI 0x5412
38#define TIOCGWINSZ 0x5413
39#define TIOCSWINSZ 0x5414
40#define TIOCMGET 0x5415
41#define TIOCMBIS 0x5416
42#define TIOCMBIC 0x5417
43#define TIOCMSET 0x5418
44#define TIOCGSOFTCAR 0x5419
45#define TIOCSSOFTCAR 0x541A
46#define FIONREAD 0x541B
47#define TIOCINQ FIONREAD
48#define TIOCLINUX 0x541C
49#define TIOCCONS 0x541D
50#define TIOCGSERIAL 0x541E
51#define TIOCSSERIAL 0x541F
52#define TIOCPKT 0x5420
53#define FIONBIO 0x5421
54#define TIOCNOTTY 0x5422
55#define TIOCSETD 0x5423
56#define TIOCGETD 0x5424
57#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
58#define TIOCSBRK 0x5427 /* BSD compatibility */
59#define TIOCCBRK 0x5428 /* BSD compatibility */
60#define TIOCGSID 0x5429 /* Return the session ID of FD */
61#define TCGETS2 _IOR('T', 0x2A, struct termios2)
62#define TCSETS2 _IOW('T', 0x2B, struct termios2)
63#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
64#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
65#define TIOCGRS485 0x542E
Jeff Mahoney8bc33722010-08-20 17:14:04 -040066#ifndef TIOCSRS485
Arnd Bergmann6103ec52009-05-13 22:56:27 +000067#define TIOCSRS485 0x542F
Jeff Mahoney8bc33722010-08-20 17:14:04 -040068#endif
Arnd Bergmann6103ec52009-05-13 22:56:27 +000069#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
70#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
Werner Finkb7b8de02010-12-03 12:48:23 +010071#define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
Arnd Bergmann6103ec52009-05-13 22:56:27 +000072#define TCGETX 0x5432 /* SYS5 TCGETX compatibility */
73#define TCSETX 0x5433
74#define TCSETXF 0x5434
75#define TCSETXW 0x5435
hyc@symas.com26df6d12010-06-22 10:14:49 -070076#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */
Kay Sievers3c95c982011-02-17 18:39:28 +010077#define TIOCVHANGUP 0x5437
Cyrill Gorcunovc6298032012-10-24 23:43:21 +040078#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
79#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
80#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
Gleb Fotengauer-Malinovskiyc6325172017-07-17 16:29:46 +030081#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
Nicolas Ferread8c0ea2018-09-26 14:58:47 +020082#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
83#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
Arnd Bergmann6103ec52009-05-13 22:56:27 +000084
85#define FIONCLEX 0x5450
86#define FIOCLEX 0x5451
87#define FIOASYNC 0x5452
88#define TIOCSERCONFIG 0x5453
89#define TIOCSERGWILD 0x5454
90#define TIOCSERSWILD 0x5455
91#define TIOCGLCKTRMIOS 0x5456
92#define TIOCSLCKTRMIOS 0x5457
93#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
94#define TIOCSERGETLSR 0x5459 /* Get line status register */
95#define TIOCSERGETMULTI 0x545A /* Get multiport config */
96#define TIOCSERSETMULTI 0x545B /* Set multiport config */
97
98#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
99#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
100
101/*
Jeff Dike39e53222010-06-17 15:15:16 -0400102 * Some arches already define FIOQSIZE due to a historical
103 * conflict with a Hayes modem-specific ioctl value.
Arnd Bergmann6103ec52009-05-13 22:56:27 +0000104 */
105#ifndef FIOQSIZE
Arnd Bergmann6103ec52009-05-13 22:56:27 +0000106# define FIOQSIZE 0x5460
107#endif
108
109/* Used for packet mode */
110#define TIOCPKT_DATA 0
111#define TIOCPKT_FLUSHREAD 1
112#define TIOCPKT_FLUSHWRITE 2
113#define TIOCPKT_STOP 4
114#define TIOCPKT_START 8
115#define TIOCPKT_NOSTOP 16
116#define TIOCPKT_DOSTOP 32
hyc@symas.com26df6d12010-06-22 10:14:49 -0700117#define TIOCPKT_IOCTL 64
Arnd Bergmann6103ec52009-05-13 22:56:27 +0000118
119#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
120
121#endif /* __ASM_GENERIC_IOCTLS_H */