Home | History | Annotate | Download | only in asm-generic
      1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
      2 #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
     66 #ifndef TIOCSRS485
     67 #define TIOCSRS485	0x542F
     68 #endif
     69 #define TIOCGPTN	_IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
     70 #define TIOCSPTLCK	_IOW('T', 0x31, int)  /* Lock/unlock Pty */
     71 #define TIOCGDEV	_IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
     72 #define TCGETX		0x5432 /* SYS5 TCGETX compatibility */
     73 #define TCSETX		0x5433
     74 #define TCSETXF		0x5434
     75 #define TCSETXW		0x5435
     76 #define TIOCSIG		_IOW('T', 0x36, int)  /* pty: generate signal */
     77 #define TIOCVHANGUP	0x5437
     78 #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 */
     81 #define TIOCGPTPEER	_IO('T', 0x41) /* Safely open the slave */
     82 
     83 #define FIONCLEX	0x5450
     84 #define FIOCLEX		0x5451
     85 #define FIOASYNC	0x5452
     86 #define TIOCSERCONFIG	0x5453
     87 #define TIOCSERGWILD	0x5454
     88 #define TIOCSERSWILD	0x5455
     89 #define TIOCGLCKTRMIOS	0x5456
     90 #define TIOCSLCKTRMIOS	0x5457
     91 #define TIOCSERGSTRUCT	0x5458 /* For debugging only */
     92 #define TIOCSERGETLSR   0x5459 /* Get line status register */
     93 #define TIOCSERGETMULTI 0x545A /* Get multiport config  */
     94 #define TIOCSERSETMULTI 0x545B /* Set multiport config */
     95 
     96 #define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
     97 #define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
     98 
     99 /*
    100  * Some arches already define FIOQSIZE due to a historical
    101  * conflict with a Hayes modem-specific ioctl value.
    102  */
    103 #ifndef FIOQSIZE
    104 # define FIOQSIZE	0x5460
    105 #endif
    106 
    107 /* Used for packet mode */
    108 #define TIOCPKT_DATA		 0
    109 #define TIOCPKT_FLUSHREAD	 1
    110 #define TIOCPKT_FLUSHWRITE	 2
    111 #define TIOCPKT_STOP		 4
    112 #define TIOCPKT_START		 8
    113 #define TIOCPKT_NOSTOP		16
    114 #define TIOCPKT_DOSTOP		32
    115 #define TIOCPKT_IOCTL		64
    116 
    117 #define TIOCSER_TEMT	0x01	/* Transmitter physically empty */
    118 
    119 #endif /* __ASM_GENERIC_IOCTLS_H */
    120