130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#ifndef __ASM_GENERIC_IOCTLS_H
230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define __ASM_GENERIC_IOCTLS_H
330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#include <linux/ioctl.h>
530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/*
730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * These are the most common definitions for tty ioctl numbers.
830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Most of them do not use the recommended _IOC(), but there is
930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * probably some source code out there hardcoding the number,
1030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * so we might as well use them for all new platforms.
1130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng *
1230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * The architectures that use different values here typically
1330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * try to be compatible with some Unix variants for the same
1430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * architecture.
1530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */
1630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
1730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* 0x54 is just a magic number to make these relatively unique ('T') */
1830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
1930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCGETS		0x5401
2030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETS		0x5402
2130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETSW		0x5403
2230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETSF		0x5404
2330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCGETA		0x5405
2430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETA		0x5406
2530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETAW		0x5407
2630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETAF		0x5408
2730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSBRK		0x5409
2830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCXONC		0x540A
2930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCFLSH		0x540B
3030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCEXCL	0x540C
3130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCNXCL	0x540D
3230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSCTTY	0x540E
3330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGPGRP	0x540F
3430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSPGRP	0x5410
3530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCOUTQ	0x5411
3630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSTI		0x5412
3730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGWINSZ	0x5413
3830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSWINSZ	0x5414
3930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCMGET	0x5415
4030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCMBIS	0x5416
4130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCMBIC	0x5417
4230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCMSET	0x5418
4330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGSOFTCAR	0x5419
4430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSSOFTCAR	0x541A
4530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FIONREAD	0x541B
4630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCINQ		FIONREAD
4730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCLINUX	0x541C
4830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCCONS	0x541D
4930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGSERIAL	0x541E
5030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSSERIAL	0x541F
5130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT		0x5420
5230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FIONBIO		0x5421
5330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCNOTTY	0x5422
5430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSETD	0x5423
5530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGETD	0x5424
5630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
5730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSBRK	0x5427  /* BSD compatibility */
5830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCCBRK	0x5428  /* BSD compatibility */
5930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGSID	0x5429  /* Return the session ID of FD */
6030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCGETS2		_IOR('T', 0x2A, struct termios2)
6130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETS2		_IOW('T', 0x2B, struct termios2)
6230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETSW2	_IOW('T', 0x2C, struct termios2)
6330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETSF2	_IOW('T', 0x2D, struct termios2)
6430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGRS485	0x542E
6530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#ifndef TIOCSRS485
6630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSRS485	0x542F
6730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#endif
6830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGPTN	_IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
6930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSPTLCK	_IOW('T', 0x31, int)  /* Lock/unlock Pty */
7030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGDEV	_IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
7130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCGETX		0x5432 /* SYS5 TCGETX compatibility */
7230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETX		0x5433
7330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETXF		0x5434
7430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TCSETXW		0x5435
7530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSIG		_IOW('T', 0x36, int)  /* pty: generate signal */
7630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCVHANGUP	0x5437
7730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGPKT	_IOR('T', 0x38, int) /* Get packet mode state */
7830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGPTLCK	_IOR('T', 0x39, int) /* Get Pty lock state */
7930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGEXCL	_IOR('T', 0x40, int) /* Get exclusive mode state */
8030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
8130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FIONCLEX	0x5450
8230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FIOCLEX		0x5451
8330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define FIOASYNC	0x5452
8430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERCONFIG	0x5453
8530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERGWILD	0x5454
8630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERSWILD	0x5455
8730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGLCKTRMIOS	0x5456
8830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSLCKTRMIOS	0x5457
8930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERGSTRUCT	0x5458 /* For debugging only */
9030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERGETLSR   0x5459 /* Get line status register */
9130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
9230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSERSETMULTI 0x545B /* Set multiport config */
9330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
9430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
9530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
9630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
9730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/*
9830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * Some arches already define FIOQSIZE due to a historical
9930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng * conflict with a Hayes modem-specific ioctl value.
10030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng */
10130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#ifndef FIOQSIZE
10230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng# define FIOQSIZE	0x5460
10330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#endif
10430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
10530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng/* Used for packet mode */
10630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_DATA		 0
10730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_FLUSHREAD	 1
10830692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_FLUSHWRITE	 2
10930692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_STOP		 4
11030692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_START		 8
11130692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_NOSTOP		16
11230692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_DOSTOP		32
11330692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCPKT_IOCTL		64
11430692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
11530692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#define TIOCSER_TEMT	0x01	/* Transmitter physically empty */
11630692c65c4174412c90e79489e98ab85c1a7412fBen Cheng
11730692c65c4174412c90e79489e98ab85c1a7412fBen Cheng#endif /* __ASM_GENERIC_IOCTLS_H */
118