ioctls.h 3.9 KB

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