18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _LINUX_TTY_FLAGS_H
38c2ecf20Sopenharmony_ci#define _LINUX_TTY_FLAGS_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * Definitions for async_struct (and serial_struct) flags field also
78c2ecf20Sopenharmony_ci * shared by the tty_port flags structures.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Define ASYNCB_* for convenient use with {test,set,clear}_bit.
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * Bits [0..ASYNCB_LAST_USER] are userspace defined/visible/changeable
128c2ecf20Sopenharmony_ci * [x] in the bit comments indicates the flag is defunct and no longer used.
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci#define ASYNCB_HUP_NOTIFY	 0 /* Notify getty on hangups and closes
158c2ecf20Sopenharmony_ci				    * on the callout port */
168c2ecf20Sopenharmony_ci#define ASYNCB_FOURPORT		 1 /* Set OUT1, OUT2 per AST Fourport settings */
178c2ecf20Sopenharmony_ci#define ASYNCB_SAK		 2 /* Secure Attention Key (Orange book) */
188c2ecf20Sopenharmony_ci#define ASYNCB_SPLIT_TERMIOS	 3 /* [x] Separate termios for dialin/callout */
198c2ecf20Sopenharmony_ci#define ASYNCB_SPD_HI		 4 /* Use 57600 instead of 38400 bps */
208c2ecf20Sopenharmony_ci#define ASYNCB_SPD_VHI		 5 /* Use 115200 instead of 38400 bps */
218c2ecf20Sopenharmony_ci#define ASYNCB_SKIP_TEST	 6 /* Skip UART test during autoconfiguration */
228c2ecf20Sopenharmony_ci#define ASYNCB_AUTO_IRQ		 7 /* Do automatic IRQ during
238c2ecf20Sopenharmony_ci				    * autoconfiguration */
248c2ecf20Sopenharmony_ci#define ASYNCB_SESSION_LOCKOUT	 8 /* [x] Lock out cua opens based on session */
258c2ecf20Sopenharmony_ci#define ASYNCB_PGRP_LOCKOUT	 9 /* [x] Lock out cua opens based on pgrp */
268c2ecf20Sopenharmony_ci#define ASYNCB_CALLOUT_NOHUP	10 /* [x] Don't do hangups for cua device */
278c2ecf20Sopenharmony_ci#define ASYNCB_HARDPPS_CD	11 /* Call hardpps when CD goes high  */
288c2ecf20Sopenharmony_ci#define ASYNCB_SPD_SHI		12 /* Use 230400 instead of 38400 bps */
298c2ecf20Sopenharmony_ci#define ASYNCB_LOW_LATENCY	13 /* Request low latency behaviour */
308c2ecf20Sopenharmony_ci#define ASYNCB_BUGGY_UART	14 /* This is a buggy UART, skip some safety
318c2ecf20Sopenharmony_ci				    * checks.  Note: can be dangerous! */
328c2ecf20Sopenharmony_ci#define ASYNCB_AUTOPROBE	15 /* [x] Port was autoprobed by PCI/PNP code */
338c2ecf20Sopenharmony_ci#define ASYNCB_MAGIC_MULTIPLIER	16 /* Use special CLK or divisor */
348c2ecf20Sopenharmony_ci#define ASYNCB_LAST_USER	16
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/*
378c2ecf20Sopenharmony_ci * Internal flags used only by kernel (read-only)
388c2ecf20Sopenharmony_ci *
398c2ecf20Sopenharmony_ci * WARNING: These flags are no longer used and have been superceded by the
408c2ecf20Sopenharmony_ci *	    TTY_PORT_ flags in the iflags field (and not userspace-visible)
418c2ecf20Sopenharmony_ci */
428c2ecf20Sopenharmony_ci#ifndef __KERNEL__
438c2ecf20Sopenharmony_ci#define ASYNCB_INITIALIZED	31 /* Serial port was initialized */
448c2ecf20Sopenharmony_ci#define ASYNCB_SUSPENDED	30 /* Serial port is suspended */
458c2ecf20Sopenharmony_ci#define ASYNCB_NORMAL_ACTIVE	29 /* Normal device is active */
468c2ecf20Sopenharmony_ci#define ASYNCB_BOOT_AUTOCONF	28 /* Autoconfigure port on bootup */
478c2ecf20Sopenharmony_ci#define ASYNCB_CLOSING		27 /* Serial port is closing */
488c2ecf20Sopenharmony_ci#define ASYNCB_CTS_FLOW		26 /* Do CTS flow control */
498c2ecf20Sopenharmony_ci#define ASYNCB_CHECK_CD		25 /* i.e., CLOCAL */
508c2ecf20Sopenharmony_ci#define ASYNCB_SHARE_IRQ	24 /* for multifunction cards, no longer used */
518c2ecf20Sopenharmony_ci#define ASYNCB_CONS_FLOW	23 /* flow control for console  */
528c2ecf20Sopenharmony_ci#define ASYNCB_FIRST_KERNEL	22
538c2ecf20Sopenharmony_ci#endif
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* Masks */
568c2ecf20Sopenharmony_ci#define ASYNC_HUP_NOTIFY	(1U << ASYNCB_HUP_NOTIFY)
578c2ecf20Sopenharmony_ci#define ASYNC_SUSPENDED		(1U << ASYNCB_SUSPENDED)
588c2ecf20Sopenharmony_ci#define ASYNC_FOURPORT		(1U << ASYNCB_FOURPORT)
598c2ecf20Sopenharmony_ci#define ASYNC_SAK		(1U << ASYNCB_SAK)
608c2ecf20Sopenharmony_ci#define ASYNC_SPLIT_TERMIOS	(1U << ASYNCB_SPLIT_TERMIOS)
618c2ecf20Sopenharmony_ci#define ASYNC_SPD_HI		(1U << ASYNCB_SPD_HI)
628c2ecf20Sopenharmony_ci#define ASYNC_SPD_VHI		(1U << ASYNCB_SPD_VHI)
638c2ecf20Sopenharmony_ci#define ASYNC_SKIP_TEST		(1U << ASYNCB_SKIP_TEST)
648c2ecf20Sopenharmony_ci#define ASYNC_AUTO_IRQ		(1U << ASYNCB_AUTO_IRQ)
658c2ecf20Sopenharmony_ci#define ASYNC_SESSION_LOCKOUT	(1U << ASYNCB_SESSION_LOCKOUT)
668c2ecf20Sopenharmony_ci#define ASYNC_PGRP_LOCKOUT	(1U << ASYNCB_PGRP_LOCKOUT)
678c2ecf20Sopenharmony_ci#define ASYNC_CALLOUT_NOHUP	(1U << ASYNCB_CALLOUT_NOHUP)
688c2ecf20Sopenharmony_ci#define ASYNC_HARDPPS_CD	(1U << ASYNCB_HARDPPS_CD)
698c2ecf20Sopenharmony_ci#define ASYNC_SPD_SHI		(1U << ASYNCB_SPD_SHI)
708c2ecf20Sopenharmony_ci#define ASYNC_LOW_LATENCY	(1U << ASYNCB_LOW_LATENCY)
718c2ecf20Sopenharmony_ci#define ASYNC_BUGGY_UART	(1U << ASYNCB_BUGGY_UART)
728c2ecf20Sopenharmony_ci#define ASYNC_AUTOPROBE		(1U << ASYNCB_AUTOPROBE)
738c2ecf20Sopenharmony_ci#define ASYNC_MAGIC_MULTIPLIER	(1U << ASYNCB_MAGIC_MULTIPLIER)
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci#define ASYNC_FLAGS		((1U << (ASYNCB_LAST_USER + 1)) - 1)
768c2ecf20Sopenharmony_ci#define ASYNC_DEPRECATED	(ASYNC_SESSION_LOCKOUT | ASYNC_PGRP_LOCKOUT | \
778c2ecf20Sopenharmony_ci		ASYNC_CALLOUT_NOHUP | ASYNC_AUTOPROBE)
788c2ecf20Sopenharmony_ci#define ASYNC_USR_MASK		(ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \
798c2ecf20Sopenharmony_ci		ASYNC_LOW_LATENCY)
808c2ecf20Sopenharmony_ci#define ASYNC_SPD_CUST		(ASYNC_SPD_HI|ASYNC_SPD_VHI)
818c2ecf20Sopenharmony_ci#define ASYNC_SPD_WARP		(ASYNC_SPD_HI|ASYNC_SPD_SHI)
828c2ecf20Sopenharmony_ci#define ASYNC_SPD_MASK		(ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#ifndef __KERNEL__
858c2ecf20Sopenharmony_ci/* These flags are no longer used (and were always masked from userspace) */
868c2ecf20Sopenharmony_ci#define ASYNC_INITIALIZED	(1U << ASYNCB_INITIALIZED)
878c2ecf20Sopenharmony_ci#define ASYNC_NORMAL_ACTIVE	(1U << ASYNCB_NORMAL_ACTIVE)
888c2ecf20Sopenharmony_ci#define ASYNC_BOOT_AUTOCONF	(1U << ASYNCB_BOOT_AUTOCONF)
898c2ecf20Sopenharmony_ci#define ASYNC_CLOSING		(1U << ASYNCB_CLOSING)
908c2ecf20Sopenharmony_ci#define ASYNC_CTS_FLOW		(1U << ASYNCB_CTS_FLOW)
918c2ecf20Sopenharmony_ci#define ASYNC_CHECK_CD		(1U << ASYNCB_CHECK_CD)
928c2ecf20Sopenharmony_ci#define ASYNC_SHARE_IRQ		(1U << ASYNCB_SHARE_IRQ)
938c2ecf20Sopenharmony_ci#define ASYNC_CONS_FLOW		(1U << ASYNCB_CONS_FLOW)
948c2ecf20Sopenharmony_ci#define ASYNC_INTERNAL_FLAGS	(~((1U << ASYNCB_FIRST_KERNEL) - 1))
958c2ecf20Sopenharmony_ci#endif
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#endif
98